UNPKG

x_ite

Version:

X_ITE X3D Browser, view and manipulate X3D, VRML, glTF and other 3D sources in HTML.

2 lines 1.39 MB
/* X_ITE v11.6.6 */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.X3D=t():e.X3D=t()}(self,()=>(()=>{var t={11:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(7637),s=i(1847),r=i(5787),o=i(5307),a=i(3613);function l(e){r.A.call(this,e),this.addType(o.A.X3DTextureNode),this.addChildObjects(o.A.outputOnly,"transparent",new n.A.SFBool)}Object.assign(Object.setPrototypeOf(l.prototype,r.A.prototype),{setTransparent(e){!!e!==this._transparent.getValue()&&(this._transparent=e)},isTransparent(){return this._transparent.getValue()}}),Object.defineProperties(l,s.A.getStaticProperties("X3DTextureNode","Texturing",1));const h=l,c=a.A.add("X3DTextureNode",h)},153:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var n=i(7637),s=i(1847),r=i(5307),o=i(2506),a=i(3613);function l(e){this.getExecutionContext()||(s.A.call(this,e),this.addType(r.A.X3DChildNode),this.addChildObjects(r.A.outputOnly,"isBoundedObject",new n.A.SFBool,r.A.outputOnly,"isPointingObject",new n.A.SFBool,r.A.outputOnly,"isCameraObject",new n.A.SFBool,r.A.outputOnly,"isPickableObject",new n.A.SFBool,r.A.outputOnly,"isCollisionObject",new n.A.SFBool,r.A.outputOnly,"isShadowObject",new n.A.SFBool,r.A.outputOnly,"isVisibleObject",new n.A.SFBool))}Object.assign(Object.setPrototypeOf(l.prototype,s.A.prototype),{setBoundedObject(e){!!e!==this._isBoundedObject.getValue()&&(this._isBoundedObject=e)},isBoundedObject(){return this._isBoundedObject.getValue()},setPointingObject(e){!!e!==this._isPointingObject.getValue()&&(this._isPointingObject=e)},isPointingObject(){return this._isPointingObject.getValue()},setCameraObject(e){!!e!==this._isCameraObject.getValue()&&(this._isCameraObject=e)},isCameraObject(){return this._isCameraObject.getValue()},setPickableObject(e){!!e!==this._isPickableObject.getValue()&&(this._isPickableObject=e)},isPickableObject(){return this._isPickableObject.getValue()},setShadowObject(e){!!e!==this._isShadowObject.getValue()&&(this._isShadowObject=e)},isShadowObject(){return this._isShadowObject.getValue()},setCollisionObject(e){!!e!==this._isCollisionObject.getValue()&&(this._isCollisionObject=e)},isCollisionObject(){return this._isCollisionObject.getValue()},setVisibleObject(e){!!e!==this._isVisibleObject.getValue()&&(this._isVisibleObject=e)},isVisibleObject(){return this._isVisibleObject.getValue()},isVisible:()=>!0,connectChildNode(e,t){t?.includes(o.A.BBOX)||(e._isBoundedObject.addFieldInterest(this._isBoundedObject),this.setBoundedObject(e.isBoundedObject())),t?.includes(o.A.POINTER)||(e._isPointingObject.addFieldInterest(this._isPointingObject),this.setPointingObject(e.isPointingObject())),t?.includes(o.A.CAMERA)||(e._isCameraObject.addFieldInterest(this._isCameraObject),this.setCameraObject(e.isCameraObject())),t?.includes(o.A.PICKING)||(e._isPickableObject.addFieldInterest(this._isPickableObject),this.setPickableObject(e.isPickableObject())),t?.includes(o.A.COLLISION)||(e._isCollisionObject.addFieldInterest(this._isCollisionObject),this.setCollisionObject(e.isCollisionObject())),t?.includes(o.A.SHADOW)||(e._isShadowObject.addFieldInterest(this._isShadowObject),this.setShadowObject(e.isShadowObject())),t?.includes(o.A.DISPLAY)||(e._isVisibleObject.addFieldInterest(this._isVisibleObject),this.setVisibleObject(e.isVisibleObject()))},disconnectChildNode(e){e._isBoundedObject.removeFieldInterest(this._isBoundedObject),e._isPointingObject.removeFieldInterest(this._isPointingObject),e._isCameraObject.removeFieldInterest(this._isCameraObject),e._isPickableObject.removeFieldInterest(this._isPickableObject),e._isCollisionObject.removeFieldInterest(this._isCollisionObject),e._isShadowObject.removeFieldInterest(this._isShadowObject),e._isVisibleObject.removeFieldInterest(this._isVisibleObject)}}),Object.defineProperties(l,s.A.getStaticProperties("X3DChildNode","Core",1));const h=l,c=a.A.add("X3DChildNode",h)},227:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var n=i(3763),s=i(8532),r=i(3613);function o(e=[]){return n.A.call(this,Array.from(e,e=>[e.category,e]),s.A)}Object.setPrototypeOf(o.prototype,n.A.prototype);for(const e of Object.keys(o.prototype))Object.defineProperty(o.prototype,e,{enumerable:!1});Object.defineProperties(o,{typeName:{value:"UnitInfoArray",enumerable:!0}});const a=o,l=r.A.add("UnitInfoArray",a)},497:(e,t,i)=>{"use strict";i.d(t,{A:()=>g});var n=i(7637),s=i(8815),r=i(6469),o=i(1847),a=i(2508),l=i(9499),h=i(5307),c=i(9280),d=i(3613);function u(e){a.A.call(this,e),l.A.call(this,e),this.addType(h.A.Fog),this.modelMatrix=new c.A}Object.assign(Object.setPrototypeOf(u.prototype,a.A.prototype),l.A.prototype,{initialize(){a.A.prototype.initialize.call(this),l.A.prototype.initialize.call(this)},getModelMatrix(){return this.modelMatrix},traverse(e,t){t.getLayer().getFogs().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get())},dispose(){l.A.prototype.dispose.call(this),a.A.prototype.dispose.call(this)}}),Object.defineProperties(u,{...o.A.getStaticProperties("Fog","EnvironmentalEffects",2,"children","2.0"),fieldDefinitions:{value:new r.A([new s.A(h.A.inputOutput,"metadata",new n.A.SFNode),new s.A(h.A.inputOnly,"set_bind",new n.A.SFBool),new s.A(h.A.inputOutput,"fogType",new n.A.SFString("LINEAR")),new s.A(h.A.inputOutput,"color",new n.A.SFColor(1,1,1)),new s.A(h.A.inputOutput,"visibilityStart",new n.A.SFFloat),new s.A(h.A.inputOutput,"visibilityRange",new n.A.SFFloat),new s.A(h.A.outputOnly,"isBound",new n.A.SFBool),new s.A(h.A.outputOnly,"bindTime",new n.A.SFTime)]),enumerable:!0}});const p=u,g=d.A.add("Fog",p)},812:(e,t,i)=>{"use strict";i.d(t,{A:()=>n});const n=i(3613).A.add("DEVELOPMENT",!1)},826:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(812),s=i(3613);const r={get ENVIRONMENT(){return n.A?"BROWSER":"object"==typeof process&&-1!==process.release.name.search(/node|io.js/)?"NODE":"BROWSER"},WEAK_REF:"undefined"!=typeof WeakRef,FINALIZATION_REGISTRY:"undefined"!=typeof FinalizationRegistry};(()=>{function e(e){if((e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this[e]}const t=Reflect.getPrototypeOf(Int8Array);for(const i of[Array,String,t])void 0===i.prototype.at&&Object.defineProperty(i.prototype,"at",{value:e,writable:!0,enumerable:!1,configurable:!0})})(),r.WEAK_REF||(n.A&&console.info("Added shim for WeakRef."),window.WeakRef=class{#e;constructor(e){this.#e=e}deref(){return this.#e}}),r.FINALIZATION_REGISTRY||(n.A&&console.info("Added shim for FinalizationRegistry."),window.FinalizationRegistry=class{register(){}unregister(){}}),(()=>{for(const e of[Map,WeakMap])e.prototype.getOrInsert??=function(e,t){return this.has(e)?this.get(e):(this.set(e,t),t)};for(const e of[Map,WeakMap])e.prototype.getOrInsertComputed??=function(e,t){if(this.has(e))return this.get(e);const i=t(e);return this.set(e,i),i}})();const o=r,a=s.A.add("Features",o)},849:(e,t,i)=>{"use strict";i.d(t,{A:()=>o});var n=i(3613);function s(e){this.gl=e,this.vertexArrays=new Map}Object.assign(s.prototype,{update(e=!0){return e&&this.dispose(),this},enable(e){const{gl:t,vertexArrays:i}=this,n=i.get(e);if(n)return t.bindVertexArray(n),!1;{i.size>100&&this.dispose();const n=t.createVertexArray();return i.set(e,n),t.bindVertexArray(n),!0}},dispose(){const{gl:e,vertexArrays:t}=this;for(const i of t.values())e.deleteVertexArray(i);t.clear()}});const r=s,o=n.A.add("VertexArray",r)},921:(e,t,i)=>{"use strict";i.d(t,{A:()=>x});var n=i(7637),s=i(1847),r=i(2508),o=i(8243),a=i(8890),l=i(4137),h=i(7712),c=i(1346),d=i(6144),u=i(5307),p=i(2951),g=i(7421),f=i(7940),m=i(9280),A=i(9957),_=i(3613);function y(e){r.A.call(this,e),this.addType(u.A.X3DViewpointNode),this.addChildObjects(u.A.inputOutput,"positionOffset",new n.A.SFVec3f,u.A.inputOutput,"orientationOffset",new n.A.SFRotation,u.A.inputOutput,"scaleOffset",new n.A.SFVec3f(1,1,1),u.A.inputOutput,"scaleOrientationOffset",new n.A.SFRotation,u.A.inputOutput,"centerOfRotationOffset",new n.A.SFVec3f,u.A.inputOutput,"fieldOfViewScale",new n.A.SFFloat(1)),this.descriptions=[],this.userPosition=new p.A,this.userOrientation=new g.A,this.userCenterOfRotation=new p.A,this.modelMatrix=new m.A,this.cameraSpaceMatrix=new m.A(1,0,0,0,0,1,0,0,0,0,1,0,0,0,10,1),this.viewMatrix=new m.A(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-10,1);const t=this.getBrowser().getPrivateScene();this.timeSensor=new o.A(t),this.easeInEaseOut=new a.A(t),this.positionInterpolator=new l.A(t),this.orientationInterpolator=new h.A(t),this.scaleInterpolator=new l.A(t),this.scaleOrientationInterpolator=new h.A(t),this.fieldOfViewScaleInterpolator=new c.A(t)}Object.assign(Object.setPrototypeOf(y.prototype,r.A.prototype),{initialize(){r.A.prototype.initialize.call(this),this.timeSensor._stopTime=1,this.timeSensor.setup(),this.easeInEaseOut._key=new n.A.MFFloat(0,1),this.easeInEaseOut._easeInEaseOut=new n.A.MFVec2f(new n.A.SFVec2f,new n.A.SFVec2f),this.easeInEaseOut.setup(),this.positionInterpolator._key=new n.A.MFFloat(0,1),this.orientationInterpolator._key=new n.A.MFFloat(0,1),this.scaleInterpolator._key=new n.A.MFFloat(0,1),this.scaleOrientationInterpolator._key=new n.A.MFFloat(0,1),this.fieldOfViewScaleInterpolator._key=new n.A.MFFloat(0,1),this.positionInterpolator.setup(),this.orientationInterpolator.setup(),this.scaleInterpolator.setup(),this.scaleOrientationInterpolator.setup(),this.fieldOfViewScaleInterpolator.setup(),this.timeSensor._fraction_changed.addFieldInterest(this.easeInEaseOut._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.positionInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.orientationInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.scaleInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.scaleOrientationInterpolator._set_fraction),this.easeInEaseOut._modifiedFraction_changed.addFieldInterest(this.fieldOfViewScaleInterpolator._set_fraction),this.positionInterpolator._value_changed.addFieldInterest(this._positionOffset),this.orientationInterpolator._value_changed.addFieldInterest(this._orientationOffset),this.scaleInterpolator._value_changed.addFieldInterest(this._scaleOffset),this.scaleOrientationInterpolator._value_changed.addFieldInterest(this._scaleOrientationOffset),this.fieldOfViewScaleInterpolator._value_changed.addFieldInterest(this._fieldOfViewScale),this._nearDistance.addInterest("set_nearDistance__",this),this._farDistance.addInterest("set_farDistance__",this),this._viewAll.addInterest("set_viewAll__",this),this._navigationInfo.addInterest("set_navigationInfo__",this),this._isBound.addInterest("set_bound__",this),this.set_nearDistance__(),this.set_farDistance__(),this.set_navigationInfo__()},set_nearDistance__(){const e=this._nearDistance.getValue();this.nearDistance=e>=0?e:void 0},set_farDistance__(){const e=this._farDistance.getValue();this.farDistance=e>=0?e:void 0},set_viewAll__(){this._viewAll.getValue()&&this._isBound.getValue()&&(this._set_bind=!0)},set_navigationInfo__(){this.navigationInfoNode&&this._isBound.removeFieldInterest(this.navigationInfoNode._set_bind),this.navigationInfoNode=(0,d.A)(u.A.NavigationInfo,this._navigationInfo),this.navigationInfoNode&&this._isBound.addFieldInterest(this.navigationInfoNode._set_bind)},set_bound__(){this._isBound.getValue()?this.getBrowser().setDescription(this._description):this.timeSensor._stopTime=Date.now()/1e3},set_active__(e,t){t.getValue()||(this.timeSensor._isActive.removeInterest("set_active__",this),this._isBound.getValue()&&1===this.timeSensor._fraction_changed.getValue()&&(e._transitionComplete=!0))},setInterpolators(){},getDescriptions(){return this.descriptions},getPosition(){return this._position.getValue()},setPosition(e){this._position=e},getOrientation(){return this._orientation.getValue()},setOrientation(e){this._orientation=e},getCenterOfRotation(){return this._centerOfRotation.getValue()},setCenterOfRotation(e){this._centerOfRotation=e},getUserPosition(){return this.userPosition.assign(this.getPosition()).add(this._positionOffset.getValue())},setUserPosition(e){this._positionOffset=this.userPosition.assign(e).subtract(this.getPosition())},getUserOrientation(){return this.userOrientation.assign(this.getOrientation()).multRight(this._orientationOffset.getValue())},setUserOrientation(e){this._orientationOffset=this.userOrientation.assign(this.getOrientation()).inverse().multRight(e)},getUserCenterOfRotation(){return this.userCenterOfRotation.assign(this.getCenterOfRotation()).add(this._centerOfRotationOffset.getValue())},setUserCenterOfRotation(e){this._centerOfRotationOffset=this.userCenterOfRotation.assign(e).subtract(this.getCenterOfRotation())},getFieldOfViewScale(){return this._fieldOfViewScale.getValue()},setFieldOfViewScale(e){this._fieldOfViewScale=e},getNearDistance(e){return this.nearDistance??e?.getNearValue()},setNearDistance(e){this.nearDistance=e},getFarDistance(e){return this.farDistance??(e?e.getFarValue()||this.getMaxFarValue():void 0)},setFarDistance(e){this.farDistance=e},getProjectionMatrix(e){const t=e.getNavigationInfo();return this.getProjectionMatrixWithLimits(this.getNearDistance(t),this.getFarDistance(t),e.getLayer().getViewport().getRectangle())},getCameraSpaceMatrix(){return this.cameraSpaceMatrix},getViewMatrix(){return this.viewMatrix},getModelMatrix(){return this.modelMatrix},getMaxFarValue(){return this.getBrowser().getRenderingProperty("LogarithmicDepthBuffer")?1e10:1e5},getUpVector:()=>p.A.yAxis,getSpeedFactor:()=>1,setVRMLTransition(e){this.VRMLTransition=e},getVRMLTransition(){return this.VRMLTransition},checkTransition(e){return!(!this.timeSensor._isActive.getValue()||this.timeSensor._description.getValue()!==e)||(this.timeSensor._description=e,!1)},transitionStart(e,t){if(this._jump.getValue()){if(this.checkTransition("transitionStart"))return;const i=this.getRelativeTransformation(t);this._retainUserOffsets.getValue()||this.resetUserOffsets(),this._viewAll.getValue()&&this.viewAll(e.getBBox(new A.A));const s=e.getNavigationInfo(),r=s._transitionTime.getValue();let o=s.getTransitionType();switch(2==this.getExecutionContext().getSpecificationVersion()&&(o=this.getVRMLTransition()?"LINEAR":"TELEPORT"),this.setVRMLTransition(!1),r<=0&&(o="TELEPORT"),this.constructor!==t.constructor&&(o="TELEPORT"),o){case"TELEPORT":return void(s._transitionComplete=!0);case"ANIMATE":this.easeInEaseOut._easeInEaseOut=new n.A.MFVec2f(new n.A.SFVec2f(0,1),new n.A.SFVec2f(1,0));break;default:this.easeInEaseOut._easeInEaseOut=new n.A.MFVec2f(new n.A.SFVec2f,new n.A.SFVec2f)}s._transitionStart=!0,this.timeSensor._cycleInterval=r,this.timeSensor._stopTime=Date.now()/1e3,this.timeSensor._startTime=Date.now()/1e3,this.timeSensor._isActive.addInterest("set_active__",this,s),this.positionInterpolator._keyValue=new n.A.MFVec3f(i.position,this._positionOffset),this.orientationInterpolator._keyValue=new n.A.MFRotation(i.orientation,this._orientationOffset),this.scaleInterpolator._keyValue=new n.A.MFVec3f(i.scale,this._scaleOffset),this.scaleOrientationInterpolator._keyValue=new n.A.MFRotation(i.scaleOrientation,this._scaleOrientationOffset),this._positionOffset=i.position,this._orientationOffset=i.orientation,this._scaleOffset=i.scale,this._scaleOrientationOffset=i.scaleOrientation,this.setInterpolators(t,i)}else{this.transitionStop();e.getNavigationInfo()._transitionComplete=!0;const i=this.getRelativeTransformation(t);this._positionOffset=i.position,this._orientationOffset=i.orientation,this._scaleOffset=i.scale,this._scaleOrientationOffset=i.scaleOrientation,this.setInterpolators(t,i)}},transitionStop(){this.timeSensor._stopTime=Date.now()/1e3,this.timeSensor._isActive.removeInterest("set_active__",this)},resetUserOffsets(){this._positionOffset=p.A.Zero,this._orientationOffset=g.A.Identity,this._scaleOffset=p.A.One,this._scaleOrientationOffset=g.A.Identity,this._centerOfRotationOffset=p.A.Zero,this._fieldOfViewScale=1,this.set_nearDistance__(),this.set_farDistance__()},getRelativeTransformation:(()=>{const e=new p.A,t=new g.A,i=new p.A,n=new g.A;return function(s){return this.modelMatrix.copy().multRight(s.getViewMatrix()).inverse().get(e,t,i,n),e.subtract(this.getPosition()),t.multLeft(this.getOrientation().copy().inverse()),{position:e,orientation:t,scale:i,scaleOrientation:n}}})(),getLookAtRotation:(()=>{const e=new p.A,t=new p.A,i=new p.A,n=new f.A,s=new g.A;return function(r,o){const a=this.getUpVector(!0);return i.assign(r).subtract(o).normalize(),e.assign(a).cross(i).normalize(),t.assign(i).cross(e).normalize(),n.set(...e,...t,...i),s.setMatrix(n),s}})(),lookAtPoint(e,t,i=1,n=1,s=!1){this.getCameraSpaceMatrix().multVecMatrix(t),this.getModelMatrix().copy().inverse().multVecMatrix(t);const r=2*this.getNearDistance(e.getNavigationInfo());this.lookAt(e,t,r,i,n,s)},lookAtBBox(e,t,i=1,n=1,s=!1){t.size.equals(p.A.Zero)||(t=t.copy().multRight(this.getModelMatrix().copy().inverse()),this.lookAt(e,t.center,this.getLookAtDistance(t),i,n,s))},lookAt(e,t,i,s=1,r=1,o=!1){this.timeSensor._description="lookAt";const a=t.copy().add(this.getUserOrientation().multVecRot(new p.A(0,0,i))).subtract(this.getPosition());e.getNavigationInfo()._transitionStart=!0,this.timeSensor._cycleInterval=s,this.timeSensor._stopTime=Date.now()/1e3,this.timeSensor._startTime=Date.now()/1e3,this.timeSensor._isActive.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut._easeInEaseOut=new n.A.MFVec2f(new n.A.SFVec2f(0,1),new n.A.SFVec2f(1,0));const l=this._positionOffset.getValue().copy().lerp(a,r),h=this.getPosition().copy().add(l).subtract(t);let c=this._orientationOffset.getValue().copy().multRight(new g.A(this.getUserOrientation().multVecRot(new p.A(0,0,1)),h));o&&(c=this.getOrientation().copy().inverse().multRight(this.straightenHorizon(this.getOrientation().copy().multRight(c)))),this.positionInterpolator._keyValue=new n.A.MFVec3f(this._positionOffset,l),this.orientationInterpolator._keyValue=new n.A.MFRotation(this._orientationOffset,c),this.scaleInterpolator._keyValue=new n.A.MFVec3f(this._scaleOffset,p.A.One),this.scaleOrientationInterpolator._keyValue=new n.A.MFRotation(this._scaleOrientationOffset,this._scaleOrientationOffset);const d=this.getRelativeTransformation(this);this._fieldOfViewScale=1,this._centerOfRotationOffset=t.copy().subtract(this.getCenterOfRotation()),this.nearDistance=.0125*i,this.farDistance=this.nearDistance*this.getMaxFarValue()/.125,this.setInterpolators(this,d)},straightenView(e){if(this.checkTransition("straightenView"))return;e.getNavigationInfo()._transitionStart=!0,this.timeSensor._cycleInterval=1,this.timeSensor._stopTime=Date.now()/1e3,this.timeSensor._startTime=Date.now()/1e3,this.timeSensor._isActive.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut._easeInEaseOut=new n.A.MFVec2f(new n.A.SFVec2f(0,1),new n.A.SFVec2f(1,0));const t=this.getOrientation().copy().inverse().multRight(this.straightenHorizon(this.getUserOrientation()));this.positionInterpolator._keyValue=new n.A.MFVec3f(this._positionOffset,this._positionOffset),this.orientationInterpolator._keyValue=new n.A.MFRotation(this._orientationOffset,t),this.scaleInterpolator._keyValue=new n.A.MFVec3f(this._scaleOffset,this._scaleOffset),this.scaleOrientationInterpolator._keyValue=new n.A.MFRotation(this._scaleOrientationOffset,this._scaleOrientationOffset);const i=this.getRelativeTransformation(this);this._fieldOfViewScale=1,this.setInterpolators(this,i)},straightenHorizon(e,t=this.getUpVector(!0)){return e.straighten(t)},viewAll(e){if(e.copy().multRight(this.modelMatrix.copy().inverse()),e.size.equals(p.A.Zero))this.set_nearDistance__(),this.set_farDistance__();else{const t=this.getUserPosition().copy().subtract(e.center).normalize(),i=this.getLookAtDistance(e),n=e.center.copy().add(t.multiply(i)),s=this.getLookAtRotation(n,e.center);this._positionOffset=n.subtract(this.getPosition()),this._orientationOffset=this.getOrientation().copy().inverse().multRight(s),this._centerOfRotationOffset=e.center.copy().subtract(this.getCenterOfRotation()),this._fieldOfViewScale=1,this.nearDistance=.0125*i,this.farDistance=this.nearDistance*this.getMaxFarValue()/.125}},traverse(e,t){this.navigationInfoNode?.traverse(e,t),this.descriptions.length=0;const i=this._description.getValue();if(i&&t.getViewpointGroups().every(e=>e.getDisplayed())){for(const e of t.getViewpointGroups()){const t=e._description.getValue();t&&this.descriptions.push(t)}this.descriptions.push(i)}t.getLayer().getViewpoints().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get())},update(){this.cameraSpaceMatrix.set(this.getUserPosition(),this.getUserOrientation(),this._scaleOffset.getValue(),this._scaleOrientationOffset.getValue()),this.cameraSpaceMatrix.multRight(this.modelMatrix),this.viewMatrix.assign(this.cameraSpaceMatrix).inverse()}}),Object.defineProperties(y,s.A.getStaticProperties("X3DViewpointNode","Navigation",1));const w=y,x=_.A.add("X3DViewpointNode",w)},943:(e,t,i)=>{"use strict";i.d(t,{A:()=>l});var n=i(9875),s=i(7087),r=i(3613);function o(e,t,i,n,r=!1,o=[]){Object.defineProperties(this,{name:{value:e,enumerable:!0},level:{value:t,enumerable:!0},title:{value:i,enumerable:!0},providerURL:{value:n||s.A.getProviderURL(r&&e),enumerable:!0},external:{value:r},dependencies:{value:o}})}Object.assign(Object.setPrototypeOf(o.prototype,n.A.prototype),{toVRMLStream(e){e.string+=e.Indent(),e.string+="COMPONENT",e.string+=e.Space(),e.string+=this.name,e.string+=e.TidySpace(),e.string+=":",e.string+=e.TidySpace(),e.string+=this.level},toXMLStream(e){e.string+=e.Indent(),e.string+="<component",e.string+=e.Space(),e.string+="name='",e.string+=this.name,e.string+="'",e.string+=e.Space(),e.string+="level='",e.string+=this.level,e.string+="'",e.string+=e.closingTags?"></component>":"/>"},toJSONStream(e){e.string+=e.Indent(),e.string+="{",e.string+=e.TidyBreak(),e.string+=e.IncIndent(),e.string+=e.Indent(),e.string+='"',e.string+="@name",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+='"',e.string+=this.name,e.string+='"',e.string+=",",e.string+=e.TidyBreak(),e.string+=e.Indent(),e.string+='"',e.string+="@level",e.string+='"',e.string+=":",e.string+=e.TidySpace(),e.string+=this.level,e.string+=e.TidyBreak(),e.string+=e.DecIndent(),e.string+=e.Indent(),e.string+="}"}});for(const e of Object.keys(o.prototype))Object.defineProperty(o.prototype,e,{enumerable:!1});Object.defineProperties(o,{typeName:{value:"ComponentInfo",enumerable:!0}}),Object.defineProperties(o.prototype,{providerUrl:{get:function(){return this.providerURL}}});const a=o,l=r.A.add("ComponentInfo",a)},1100:(e,t,i)=>{"use strict";i.d(t,{A:()=>j});var n=i(7637),s=i(1847),r=i(7259),o=i(2506),a=i(3613);function l(e,t){this.array=e,this.auxiliary=[],t&&(this.compare=t)}Object.assign(l.prototype,{compare:(e,t)=>e<t,sort(e,t){this.mergeSort(e,t-1)},mergeSort(e,t){if(e<t){const i=e+t>>>1;this.mergeSort(e,i),this.mergeSort(i+1,t),this.merge(e,i,t)}},merge(e,t,i){const{array:n,auxiliary:s,compare:r}=this;let o,a,l;for(o=0,a=e;a<=t;)s[o++]=n[a++];for(o=0,l=e;l<a&&a<=i;)r(n[a],s[o])?n[l++]=n[a++]:n[l++]=s[o++];for(;l<a;)n[l++]=s[o++]}});const h=l,c=a.A.add("MergeSort",h);var d=i(2072),u=i(9957),p=i(9324),g=i(1452),f=i(2951),m=i(8070),A=i(7421),_=i(9280),y=i(6922),w=i(8178);function x(e){const t=e.getBrowser();this.renderKey="",this.renderAndGlobalLightsKey="",this.renderCount=0,this.view=null,this.viewVolumes=[],this.projectionMatrix=new y.A(_.A),this.modelViewMatrix=new y.A(_.A),this.viewMatrix=new y.A(_.A),this.cameraSpaceMatrix=new y.A(_.A),this.viewportArray=new Int32Array(4),this.projectionMatrixArray=new Float32Array(16),this.eyeMatrixArray=new Float32Array(16),this.viewMatrixArray=new Float32Array(16),this.cameraSpaceMatrixArray=new Float32Array(16),this.hitRay=new p.A,this.sensors=[[]],this.viewpointGroups=[],this.lights=[],this.globalLightsKeys=[],this.globalLights=[],this.localObjectsKeys=[],this.localObjects=[],this.globalShadows=[!1],this.globalShadow=!1,this.localShadows=[!1],this.localFogs=[null],this.layouts=[],this.hAnimNode=[null],this.invHumanoidMatrix=new y.A(_.A),this.generatedCubeMapTextures=[],this.collisions=[],this.collisionTime=new w.A,this.numPointingShapes=0,this.numCollisionShapes=0,this.numShadowShapes=0,this.numOpaqueShapes=0,this.numTransparentShapes=0,this.pointingShapes=[],this.collisionShapes=[],this.activeCollisions=[],this.shadowShapes=[],this.opaqueShapes=[],this.transparentShapes=[],this.transparencySorter=new c(this.transparentShapes,(e,t)=>e.distance<t.distance),this.transmission=!1,this.speed=0,this.depthBuffer=new r.A({browser:t,width:16,height:16,float:!0})}function b(e,t){const i=t.length;for(let n=0;n<i;++n)e[n]=t[n];e.length=i}Object.assign(x.prototype,{initialize(){const e=this.getBrowser();e.getRenderingProperties()._Shading.addInterest("set_renderKey__",this),e.getRenderingProperties()._LogarithmicDepthBuffer.addInterest("set_renderKey__",this),e.getRenderingProperties()._XRSession.addInterest("set_renderKey__",this),e.getBrowserOptions()._ColorSpace.addInterest("set_renderKey__",this),e.getBrowserOptions()._OrderIndependentTransparency.addInterest("set_renderKey__",this),e.getBrowserOptions()._ToneMapping.addInterest("set_renderKey__",this),this.getViewpointStack().addInterest("set_renderKey__",this),this.set_renderKey__()},isIndependent:()=>!0,getNode:()=>null,set_renderKey__(){const e=this.getBrowser();this.logarithmicDepthBuffer=e.getRenderingProperty("LogarithmicDepthBuffer")||this.getViewpoint().getLogarithmicDepthBuffer(),this.orderIndependentTransparency=e.getBrowserOption("OrderIndependentTransparency");let t="";switch(t+="FLAT"===e.getRenderingProperty("Shading")?1:0,t+=e.getRenderingProperty("XRSession")?1:0,t+=this.logarithmicDepthBuffer?1:0,t+=this.orderIndependentTransparency?1:0,e.getBrowserOption("ColorSpace")){case"SRGB":t+=0;break;default:t+=1;break;case"LINEAR":t+=2}switch(e.getBrowserOption("ToneMapping")){default:t+=0;break;case"ACES_NARKOWICZ":t+=1;break;case"ACES_HILL":t+=2;break;case"ACES_HILL_EXPOSURE_BOOST":t+=3;break;case"KHR_PBR_NEUTRAL":t+=4}this.renderKey=t},getLogarithmicDepthBuffer(){return this.logarithmicDepthBuffer},getOrderIndependentTransparency(){return this.orderIndependentTransparency},getRenderKey(){return this.renderKey},getRenderAndGlobalLightsKey(){return this.renderAndGlobalLightsKey},getRenderCount(){return this.renderCount},advanceRenderCount:(()=>{let e=0;return function(){e===Number.MAX_SAFE_INTEGER&&(e=0),this.renderCount=++e}})(),getFramebuffers(){return this.getBrowser().getFramebuffers()},getView(){return this.view},getViewVolumes(){return this.viewVolumes},getViewVolume(){return this.viewVolumes.at(-1)},getProjectionMatrix(){return this.projectionMatrix},getProjectionMatrixWithLimits(e,t,i){return this.getViewpoint().getProjectionMatrixWithLimits(e,t,i)},getModelViewMatrix(){return this.modelViewMatrix},getViewMatrix(){return this.viewMatrix},getCameraSpaceMatrix(){return this.cameraSpaceMatrix},getViewportArray(){return this.viewportArray},getProjectionMatrixArray(){return this.projectionMatrixArray},getEyeMatrixArray(){return this.eyeMatrixArray},getViewMatrixArray(){return this.viewMatrixArray},getCameraSpaceMatrixArray(){return this.cameraSpaceMatrixArray},getHitRay(){return this.hitRay},getSensors(){return this.sensors},getViewpointGroups(){return this.viewpointGroups},getLights(){return this.lights},getGlobalLights(){return this.globalLights},getGlobalLightsKeys(){return this.globalLightsKeys},getLocalObjects(){return this.localObjects},getLocalObjectsKeys(){return this.localObjectsKeys},pushGlobalShadows(e){this.globalShadows.push(e||this.globalShadows.at(-1))},getGlobalShadows(){return this.globalShadows},getGlobalShadow(){return this.globalShadow},pushLocalShadows(e){this.localShadows.push(e||this.localShadows.at(-1))},popLocalShadows(){this.localShadows.pop()},setGlobalFog:(()=>{const e=new _.A;return function(t){if(t.getFogType()){const i=this.localFogs[0]||t.getFogs().pop();e.assign(t.getModelMatrix()).multRight(this.getViewMatrix().get()),i.set(t,e),this.localFogs[0]=i}else this.localFogs[0]=null}})(),getLocalFogs(){return this.localFogs},getLayouts(){return this.layouts},getParentLayout(){return this.layouts.at(-1)},getHAnimNode(){return this.hAnimNode},getInvHumanoidMatrix(){return this.invHumanoidMatrix},getGeneratedCubeMapTextures(){return this.generatedCubeMapTextures},getCollisions(){return this.collisions},getCollisionTime(){return this.collisionTime},setNumPointingShapes(e){this.numPointingShapes=e},getNumPointingShapes(){return this.numPointingShapes},getPointingShapes(){return this.pointingShapes},setNumCollisionShapes(e){this.numCollisionShapes=e},getNumCollisionShapes(){return this.numCollisionShapes},getCollisionShapes(){return this.collisionShapes},setNumShadowShapes(e){this.numShadowShapes=e},getNumShadowShapes(){return this.numShadowShapes},getShadowShapes(){return this.shadowShapes},getNumOpaqueShapes(){return this.numOpaqueShapes},setNumOpaqueShapes(e){this.numOpaqueShapes=e},getOpaqueShapes(){return this.opaqueShapes},getNumTransparentShapes(){return this.numTransparentShapes},setNumTransparentShapes(e){this.numTransparentShapes=e},getTransparentShapes(){return this.transparentShapes},isTransmission(){return this.transmission},constrainTranslation(e,t){const i=this.getDistance(e)-this.getNavigationInfo().getCollisionRadius();if(i>0){return e.norm()>i?e.normalize().multiply(i):e}return t?this.constrainTranslation(e.normalize().multiply(i),!1):e.assign(f.A.Zero)},getDistance:(()=>{const e=new _.A,t=new _.A,i=new A.A,n=new f.A,s=new A.A;return function(r){this.collisionTime.start();const o=this.getNavigationInfo(),a=this.getViewpoint(),l=o.getCollisionRadius(),h=o.getStepHeight()-o.getAvatarHeight(),c=a.getNearDistance(o),u=o.getAvatarHeight();d.A.ortho(-l,l,Math.min(h,-l),l,c,Math.max(2*l,2*u),e),i.assign(a._orientation.getValue()).inverse().multRight(a.getOrientation()),s.setFromToVec(f.A.zAxis,n.assign(r).negate()).multRight(i),a.straightenHorizon(s),t.assign(a.getModelMatrix()).translate(a.getUserPosition()).rotate(s).inverse().multRight(e).multLeft(a.getCameraSpaceMatrix()),this.getProjectionMatrix().push(t);const p=this.getDepth(e);return this.getProjectionMatrix().pop(),this.collisionTime.stop(),-p}})(),getDepth:(()=>{const e=new m.A(0,0,16,16),t=new g.A;return t.set(_.A.Identity,e),function(i){this.depthBuffer.bind(),this.viewVolumes.push(t),this.depth(this.collisionShapes,this.numCollisionShapes);const n=this.depthBuffer.readDepth(i,e);return this.viewVolumes.pop(),n}})(),render(e,t,i){switch(e){case o.A.POINTER:this.numPointingShapes=0,t.call(i,e,this),this.pointing(this.pointingShapes,this.numPointingShapes);break;case o.A.COLLISION:this.numCollisionShapes=0,t.call(i,e,this),this.collide(),this.gravitate();break;case o.A.SHADOW:this.numShadowShapes=0,t.call(i,e,this),this.depth(this.shadowShapes,this.numShadowShapes);break;case o.A.DISPLAY:this.lightIndex=0,this.numOpaqueShapes=0,this.numTransparentShapes=0,this.setGlobalFog(this.getFog()),t.call(i,e,this),this.draw()}},setHitRay(e,t,i){g.A.unProjectRay(i.x,i.y,_.A.Identity,e,t,this.hitRay)},addPointingShape:(()=>{const e=new f.A,t=new f.A;return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.norm()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){const e=this.numPointingShapes++;e===this.pointingShapes.length&&this.pointingShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),viewport:new m.A,clipPlanes:[],sensors:[]});const t=this.pointingShapes[e];return t.modelViewMatrix.set(n),t.viewport.assign(r.getViewport()),t.hAnimNode=this.hAnimNode.at(-1),t.shapeNode=i,b(t.clipPlanes,this.localObjects),b(t.sensors,this.sensors.at(-1)),!0}return!1}})(),addCollisionShape:(()=>{const e=new f.A,t=new f.A;return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.norm()/2;if(this.viewVolumes.at(-1).intersectsSphere(s,t)){const e=this.numCollisionShapes++;e===this.collisionShapes.length&&this.collisionShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),collisions:[],clipPlanes:[]});const t=this.collisionShapes[e];return t.modelViewMatrix.set(n),t.shapeNode=i,b(t.collisions,this.collisions),b(t.clipPlanes,this.localObjects),!0}return!1}})(),addShadowShape:(()=>{const e=new f.A,t=new f.A;return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.norm()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){const e=this.numShadowShapes++;e===this.shadowShapes.length&&this.shadowShapes.push({renderObject:this,modelViewMatrix:new Float32Array(16),viewport:new m.A,clipPlanes:[]});const t=this.shadowShapes[e];return t.modelViewMatrix.set(n),t.viewport.assign(r.getViewport()),t.hAnimNode=this.hAnimNode.at(-1),t.shapeNode=i,b(t.clipPlanes,this.localObjects),!0}return!1}})(),addDisplayShape:(()=>{const e=new f.A,t=new f.A;return function(i){const n=this.getModelViewMatrix().get();n.multDirMatrix(e.assign(i.getBBoxSize())),n.multVecMatrix(t.assign(i.getBBoxCenter()));const s=e.norm()/2,r=this.viewVolumes.at(-1);if(r.intersectsSphere(s,t)){if(i.isTransparent()){const e=this.numTransparentShapes++;e===this.transparentShapes.length&&this.transparentShapes.push(this.createRenderContext(!0)),(o=this.transparentShapes[e]).distance=t.z}else{const e=this.numOpaqueShapes++;e===this.opaqueShapes.length&&this.opaqueShapes.push(this.createRenderContext(!1));var o=this.opaqueShapes[e]}return this.transmission||=i.isTransmission(),o.modelViewMatrix.set(n),o.viewport.assign(r.getViewport()),o.shadows=this.localShadows.at(-1),o.fogNode=this.localFogs.at(-1),o.hAnimNode=this.hAnimNode.at(-1),o.shapeNode=i,o.appearanceNode=i.getAppearance(),b(o.localObjects,this.localObjects),b(o.localObjectsKeys,this.localObjectsKeys),!0}return!1}})(),createRenderContext(e){return{renderObject:this,transparent:e,modelViewMatrix:new Float32Array(16),viewport:new m.A,localObjects:[],localObjectsKeys:[]}},pointing:(()=>{const e=new Float32Array(16);return function(t,i){const n=this.getBrowser(),s=n.getContext(),r=this.viewVolumes.at(-1).getViewport(),{x:o,y:a}=n.getPointer();e.set(this.getProjectionMatrix().get()),s.viewport(r.x-o,r.y-a,r.z,r.w),s.scissor(0,0,1,1),s.clear(s.DEPTH_BUFFER_BIT),s.disable(s.CULL_FACE);for(let r=0;r<i;++r){const i=t[r],{modelViewMatrix:l,viewport:h,shapeNode:c,hAnimNode:d,clipPlanes:u}=i,p=c.getAppearance(),g=c.getGeometryContext(),f=p.getDepthMode(),m=p.getStyleProperties(g.geometryType),A=n.getPointingShader(u.length,c,d),_=n.addPointingShape(i);s.viewport(h.x-o,h.y-a,h.z,h.w),A.enable(s),A.setClipPlanes(s,u),s.uniformMatrix4fv(A.x3d_ProjectionMatrix,!1,e),s.uniformMatrix4fv(A.x3d_ModelViewMatrix,!1,l),s.uniform1f(A.x3d_Id,_),f?.enable(s),m?.setShaderUniforms(s,A),d?.setShaderUniforms(s,A),c.displaySimple(s,i,A),f?.disable(s),n.resetTextureUnits()}}})(),collide:(()=>{const e=new _.A,t=new _.A,i=new u.A(f.A.Zero,f.A.Zero),n=new f.A;return function(){const s=[],r=2.2*this.getNavigationInfo().getCollisionRadius(),o=this.numCollisionShapes;n.set(r,r,r);for(let r=0;r<o;++r){const o=this.collisionShapes[r],a=o.collisions;if(a.length&&(i.set(n,f.A.Zero),i.multRight(e.assign(o.modelViewMatrix).inverse()),o.shapeNode.intersectsBox(i,o.clipPlanes,t.assign(o.modelViewMatrix))))for(const e of a)s.push(e)}if(this.activeCollisions.length){const e=s.length?this.activeCollisions.filter(e=>!s.includes(e)):this.activeCollisions;for(const t of e)t.set_active(!1)}this.activeCollisions=s;for(const e of s)e.set_active(!0)}})(),gravitate:(()=>{const e=new _.A,t=new _.A,i=new f.A,n=new A.A;return function(){const s=this.getBrowser();if(s.getActiveLayer()!==this)return;if("WALK"!==s.getCurrentViewer())return;const r=this.getNavigationInfo(),o=this.getViewpoint(),a=r.getCollisionRadius(),l=r.getAvatarHeight(),h=r.getStepHeight(),c=o.getNearDistance(r);d.A.ortho(-a,a,-a,a,c,2*Math.max(a,l),e);const u=o.getUpVector(),p=n.setFromToVec(f.A.zAxis,u);t.assign(o.getModelMatrix()).translate(o.getUserPosition()).rotate(p).inverse().multRight(e).multLeft(o.getCameraSpaceMatrix()),this.getProjectionMatrix().push(t);let g=-this.getDepth(e);this.getProjectionMatrix().pop(),g-=l;const m=n.setFromToVec(f.A.yAxis,u);if(g>0){const e=this.speed?s.getCurrentFrameRate():1e6;this.speed-=s.getBrowserOptions()._Gravity.getValue()/e;let t=this.speed/e;t<-g&&(t=-g,this.speed=0),o._positionOffset=o._positionOffset.getValue().add(m.multVecRot(i.set(0,t,0)))}else this.speed=0,g=-g,g>.01&&g<h&&(this.constrainTranslation(m.multVecRot(i.set(0,g,0)),!1),o._positionOffset=i.add(o._positionOffset.getValue()))}})(),depth:(()=>{const e=new Float32Array(16);return function(t,i){const n=this.getBrowser(),s=n.getContext(),r=this.viewVolumes.at(-1).getViewport();e.set(this.getProjectionMatrix().get()),s.viewport(...r),s.scissor(...r),s.clearColor(1,0,0,0),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.disable(s.CULL_FACE);for(let r=0;r<i;++r){const i=t[r],{clipPlanes:o,modelViewMatrix:a,shapeNode:l,hAnimNode:h}=i,c=l.getAppearance(),d=l.getGeometryContext(),u=c.getStyleProperties(d.geometryType),p=n.getDepthShader(o.length,l,h);p.enable(s),p.setClipPlanes(s,o),s.uniformMatrix4fv(p.x3d_ProjectionMatrix,!1,e),s.uniformMatrix4fv(p.x3d_ModelViewMatrix,!1,a),u?.setShaderUniforms(s,p),h?.setShaderUniforms(s,p),l.displaySimple(s,i,p),n.resetTextureUnits()}}})(),draw(){const e=this.isIndependent(),t=this.getBrowser(),i=t.getContext(),n=t.getPose(),s=this.getFramebuffers(),r=s.length,o=this.viewVolumes.at(-1).getViewport(),a=this.lights,l=this.globalLightsKeys,h=this.globalLights,c=this.generatedCubeMapTextures,d=this.globalShadows,u=this.getNavigationInfo()._headlight.getValue();if(this.viewportArray.set(o),this.viewMatrixArray.set(this.getViewMatrix().get()),this.cameraSpaceMatrixArray.set(this.getCameraSpaceMatrix().get()),e){for(const e of a)e.renderShadowMap(this);for(const e of c)e.renderTexture(this)}this.renderAndGlobalLightsKey=`.${this.renderKey}.${l.sort().join("")}.`,this.globalShadow=d.at(-1);const p=this.transmission;for(let l=0;l<r;++l){const r=s[l],h=this.view=n?.views[l];h?(this.projectionMatrixArray.set(h.projectionMatrix),this.eyeMatrixArray.set(h.matrix)):(this.projectionMatrixArray.set(this.getProjectionMatrix().get()),this.eyeMatrixArray.set(_.A.Identity)),u&&t.getHeadlight().setGlobalVariables(this);for(const e of a)e.setGlobalVariables(this);if(e&&p){this.transmission=!0;const e=t.getTransmissionBuffer();this.drawShapes(i,t,e,i.COLOR_BUFFER_BIT,!1,o,this.opaqueShapes,this.numOpaqueShapes,this.transparentShapes,this.numTransparentShapes,this.transparencySorter),i.bindTexture(i.TEXTURE_2D,e.getColorTexture()),i.generateMipmap(i.TEXTURE_2D),this.transmission=!1}this.drawShapes(i,t,r,0,r.getOIT(),o,this.opaqueShapes,this.numOpaqueShapes,this.transparentShapes,this.numTransparentShapes,this.transparencySorter)}if(this.view=null,e){const e=t.getLocalObjects();for(const t of e)t.dispose();e.length=0;for(const e of h)e.dispose()}l.length=0,h.length=0,a.length=0,d.length=1,c.length=0},drawShapes(e,t,i,n,s,r,o,a,l,h,c){this.advanceRenderCount(),i.bind(),e.viewport(...r),e.scissor(...r),e.clearColor(0,0,0,0),e.clear(e.DEPTH_BUFFER_BIT|n),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),this.getBackground().display(e,this);for(let i=0;i<a;++i){const n=o[i];e.viewport(...n.viewport),n.shapeNode.display(e,n),t.resetTextureUnits()}s?i.bindTransparency():c.sort(0,h),e.depthMask(!1),e.enable(e.BLEND);for(let i=0;i<h;++i){const n=l[i];e.viewport(...n.viewport),n.shapeNode.display(e,n),t.resetTextureUnits()}e.depthMask(!0),e.disable(e.BLEND),s&&i.compose()}});const S=x,T=a.A.add("X3DRenderObject",S);var v=i(5502);function O(e,t){v.A.call(this,e),this.nodes=[t]}Object.assign(Object.setPrototypeOf(O.prototype,v.A.prototype),{get(){return this.nodes},top(){return this.nodes.at(-1)},pushOnTop(e){e!==this.nodes[0]&&(this.nodes.at(-1)._isBound=!1,this.nodes.push(e)),e._isBound=!0,e._bindTime=this.getBrowser().getCurrentTime(),this.addNodeEvent()},update(e,t,i){if(!t.length&&!i.length)return;const n=this.top(),s=this.nodes.at(-1);for(const e of t){const t=this.nodes.indexOf(e);t>0&&this.nodes.splice(t,1)}s!==this.nodes[0]&&i.some(e=>!e._set_bind.getValue()&&e===s)&&this.nodes.pop();for(const e of i){if(!e._set_bind.getValue())continue;const t=this.nodes.indexOf(e);t>-1&&this.nodes.splice(t,1),this.nodes.push(e)}const r=this.nodes.at(-1);r!==s?(s._isBound=!1,r._isBound=!0,r._bindTime=this.getBrowser().getCurrentTime(),r.transitionStart(e,n)):i.includes(r)&&r.transitionStart(e,n),this.addNodeEvent()}});for(const e of Object.keys(O.prototype))Object.defineProperty(O.prototype,e,{enumerable:!1});Object.defineProperties(O,{typeName:{value:"BindableStack",enumerable:!0}});const E=O,N=a.A.add("BindableStack",E);var I=i(2508);function C(e,t){v.A.call(this,e),this.modificationCount=0,this.nodes=[t],this.collectedNodes=[t],this.changedNodes=[],this.removedNodes=[]}Object.assign(Object.setPrototypeOf(C.prototype,v.A.prototype),{get(){return this.nodes},getBound(e){const t=this.nodes.length;if(1===t)return this.nodes[0];if(e)for(let i=1;i<t;++i){const t=this.nodes[i];if(!(t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).getExecutionContext()&&t.getName()==e)return t}for(let e=1;e<t;++e){const t=this.nodes[e];if(!(t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).getExecutionContext()&&t._isBound.getValue())return t}for(let e=1;e<t;++e){const t=this.nodes[e];if(!(t.getExecutionContext().getOuterNode()?.getScene()??t.getScene()).getExecutionContext())return t}return this.nodes[0]},push(e){return this.collectedNodes.push(e)},update(e,t){const{collectedNodes:i,changedNodes:n,removedNodes:s}=this;for(const e of i)e.getModificationCount()>this.modificationCount&&n.push(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i])return!1;return!0}(i,this.nodes)){for(const e of this.nodes)i.includes(e)||s.push(e);const e=this.nodes;this.nodes=i,this.collectedNodes=e}this.collectedNodes.length=1,t.update(e,s,n),n.length=0,s.length=0,this.modificationCount=I.A.getModificationCount()}});for(const e of Object.keys(C.prototype))Object.defineProperty(C.prototype,e,{enumerable:!1});Object.defineProperties(C,{typeName:{value:"BindableList",enumerable:!0}});const F=C,M=a.A.add("BindableList",F);var P=i(5553),R=i(6771),V=i(497),D=i(1481),L=i(6144),B=i(5307);function k(e,t,i){let r;s.A.call(this,e),T.call(this,e),this.addType(B.A.X3DLayerNode),this.addChildObjects(B.A.inputOutput,"hidden",new n.A.SFBool,B.A.outputOnly,"display",new n.A.SFBool(!0)),e.getSpecificationVersion()<=3.3&&this.addAlias("isPickable",this._pickable),e.hasComponent("Picking")&&(r=e.createNode("PickableGroup",!1),r&&(this._pickable.addFieldInterest(r._pickable),this._objectType.addFieldInterest(r._objectType))),r??=new P.A(e),r._children=[i],r.setPrivate(!0),this.active=!1,this.layer0=!1,this.groupNodes=r,this.defaultNavigationInfo=new R.A(e),this.defaultViewpoint=t,this.defaultBackground=new D.A(e),this.defaultFog=new V.A(e),this.navigationInfoStack=new N(e,this.defaultNavigationInfo),this.viewpointStack=new N(e,this.defaultViewpoint),this.backgroundStack=new N(e,this.defaultBackground),this.fogStack=new N(e,this.defaultFog),this.navigationInfos=new M(e,this.defaultNavigationInfo),this.viewpoints=new M(e,this.defaultViewpoint),this.backgrounds=new M(e,this.defaultBackground),this.fogs=new M(e,this.defaultFog),this.defaultBackground.setHidden(!0),this.defaultFog.setHidden(!0)}Object.assign(Object.setPrototypeOf(k.prototype,s.A.prototype),T.prototype,{layer0:!1,initialize(){s.A.prototype.initialize.call(this),T.prototype.initialize.call(this),this.defaultNavigationInfo.setup(),this.defaultViewpoint.setup(),this.defaultBackground.setup(),this.defaultFog.setup(),this.navigationInfoStack.setup(),this.viewpointStack.setup(),this.backgroundStack.setup(),this.fogStack.setup(),this.navigationInfos.setup(),this.viewpoints.setup(),this.backgrounds.setup(),this.fogs.setup(),this._hidden.addInterest("set_visible_and_hidden__",this),this._visible.addInterest("set_visible_and_hidden__",this),this._viewport.addInterest("set_viewport__",this),this.set_visible_and_hidden__(),this.set_viewport__()},isHidden(){return this._hidden.getValue()},setHidden(e){e!==this._hidden.getValue()&&(this._hidden=e)},getBBox(e,t){return this.groupNodes.getBBox(e,t)},isLayer0(){return this.layer0},setLayer0(e){this.layer0=e,this.defaultBackground.setHidden(!e)},getLayer(){return this},getGroups(){return this.groupNodes},getViewport(){return this.viewportNode},getBackground(){return this.backgroundStack.top()},getFog(){return this.fogStack.top()},getNavigationInfo(){return this.navigationInfoStack.top()},getViewpoint(){return this.viewpointStack.top()},getBackgrounds(){return this.backgrounds},getFogs(){return this.fogs},getNavigationInfos(){return this.navigationInfos},getViewpoints(){return this.viewpoints},getUserViewpoints(){const e=this.getBrowser(),t=e.getBrowserOption("EnableInlineViewpoints"),i=e.currentScene;return Array.from(new Set(this.viewpoints.get().filter(e=>e.getDescriptions().length).filter(e=>t||e.getScene()===i)))},getBackgroundStack(){return this.backgroundStack},getFogStack(){return this.fogStack},getNavigationInfoStack(){return this.navigationInfoStack},getViewpointStack(){return this.viewpointStack},viewAll(e=1,t=1,i=!1){const n=this.getViewpoint(),s=this.getBBox(new u.A).multRight(n.getModelMatrix().copy().inverse());s.size.equals(f.A.Zero)||n.lookAt(this,s.center,n.getLookAtDistance(s),e,t,i)},straightenView(){this.getViewpoint().straightenView(this)},set_visible_and_hidden__(){const e=this._visible.getValue()&&!this._hidden.getValue();e!==this._display.getValue()&&(this._display=e)},set_viewport__(){this.viewportNode=(0,L.A)(B.A.X3DViewportNode,this._viewport)??this.getBrowser().getDefaultViewport()},bindBindables(e){this.traverse(o.A.CAMERA,this);const t=this.navigationInfos.getBound(),i=this.backgrounds.getBound(),n=this.fogs.getBound(),s=this.viewpoints.getBound(e);this.navigationInfoStack.pushOnTop(t),this.backgroundStack.pushOnTop(i),this.fogStack.pushOnTop(n),this.viewpointStack.pushOnTop(s),s.resetUserOffsets(),s._viewAll.getValue()&&s.viewAll(this.getBBox(new u.A)),s.update()},traverse:(()=>{const e=new _.A;return function(t,i=this){const n=this.getBrowser(),s=this.getViewpoint(),r=n.getPose();if(r?.views.length)switch(t){case o.A.POINTER:{const t=this.getNavigationInfo(),i=s.getFarDistance(t),o=n.getPointingInputSource();d.A.ortho(-1,1,-1,1,0,i,e),this.getProjectionMatrix().push(e),this.getCameraSpaceMatrix().push(o.matrix),this.getViewMatrix().push(o.inverse),this!==n.getActiveLayer()&&(this.getCameraSpaceMatrix().multRight(r.viewMatrix),this.getViewMatrix().multLeft(r.cameraSpaceMatrix)),this.getCameraSpaceMatrix().multRight(s.getCameraSpaceMatrix()),this.getViewMatrix().multLeft(s.getViewMatrix());break}case o.A.COLLISION:this.getProjectionMatrix().push(r.views[0].projectionMatrix),this.getCameraSpaceMatrix().push(s.getCameraSpaceMatrix()),this.getViewMatrix().push(s.getViewMatrix());break;default:this.getProjectionMatrix().push(r.views[0].projectionMatrix),this===n.getActiveLayer()?(this.getCameraSpaceMatrix().push(r.cameraSpaceMatrix),this.getViewMatrix().push(r.viewMatrix),this.getCameraSpaceMatrix().multRight(s.getCameraSpaceMatrix()),this.getViewMatrix().multLeft(s.getViewMatrix())):(this.getCameraSpaceMatrix().push(s.getCameraSpaceMatrix()),this.getViewMatrix().push(s.getViewMatrix()))}else this.getProjectionMatrix().push(s.getProjectionMatrix(this)),this.getCameraSpaceMatrix().push(s.getCameraSpaceMatrix()),this.getViewMatrix().push(s.getViewMatrix());switch(t){case o.A.POINTER:this.pointer(t,i);break;case o.A.CAMERA:this.camera(t,i);break;case o.A.PICKING:this.picking(t,i);break;case o.A.COLLISION:this.collision(t,i);break;case o.A.SHADOW:case o.A.DISPLAY:this.display(t,i)}this.getViewMatrix().pop(),this.getCameraSpaceMatrix().pop(),this.getProjectionMatrix().pop()}})(),pointer(e,t){if(!this._pointerEvents.getValue())return;const i=this.getBrowser(),n=this.viewportNode.getRectangle();if(i.getPointingLayer()){if(i.getPointingLayer()!==this)return}else if(!i.isPointerInRectangle(n))return;this.setHitRay(this.getProjectionMatrix().get(),n,i.getPointer()),this.getModelViewMatrix().push(this.getViewMatrix().get()),this.viewportNode.push(this),t.render(e,this.groupNodes.traverse,this.groupNodes),this.viewportNode.pop(this),this.getModelViewMatrix().pop()},camera(e,t){this.getModelViewMatrix().push(_.A.Identity),this.viewportNode.push(this),this.groupNodes.traverse(e,t),this.viewportNode.pop(this),this.getModelViewMatrix().pop(),this.navigationInfos.update(this,this.navigationInfoStack),this.viewpoints.update(this,this.viewpointStack),this.backgrounds.update(this,this.backgroundStack),this.fogs.update(this,this.fogStack),this.getViewpoint().update()},picking(e,t){this._pickable.getValue()&&(this.getModelViewMatrix().push(_.A.Identity),this.viewportNode.push(this),this.groupNodes.traverse(e,t),this.viewportNode.pop(this),this.getModelViewMatrix().pop())},collision:(()=>{const e=new _.A;return function(t,i){const n=this.getNavigationInfo();if(n._transitionActive.getValue())return;const s=n.getCollisionRadius(),r=n.getAvatarHeight(),o=Math.max(2*s,2*r);d.A.ortho(-o,o,-o,o,-o,o,e),this.getProjectionMatrix().push(e),this.getModelViewMatrix().push(this.getViewMatrix().get()),this.viewportNode.push(this),i.render(t,this.groupNodes.traverse,this.groupNodes),this.viewportNode.pop(this),this.getModelViewMatrix().pop(),this.getProjectionMatrix().pop()}})(),display(e,t){this.getNavigationInfo().enable(e,t),this.getModelViewMatrix().push(this.getViewMatrix().get()),this.viewportNode.push(this),t.render(e,this.groupNod