iwer 2.0.0 → 2.0.1

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.
package/build/iwer.js CHANGED
@@ -4620,7 +4620,7 @@
4620
4620
  }
4621
4621
  }
4622
4622
 
4623
- const VERSION = "2.0.0";
4623
+ const VERSION = "2.0.1";
4624
4624
 
4625
4625
  /**
4626
4626
  * Copyright (c) Meta Platforms, Inc. and affiliates.
package/build/iwer.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IWER={})}(this,(function(e){"use strict";var t=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function r(){var e=new i(16);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function n(e){var t=new i(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function s(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function a(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],h=t[9],u=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],x=i*o-r*a,S=i*c-n*a,y=i*l-s*a,w=r*c-n*o,b=r*l-s*o,M=n*l-s*c,R=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,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function l(e,i,r){var n,s,a,o=r[0],c=r[1],l=r[2],d=Math.hypot(o,c,l);return d<t?null:(o*=d=1/d,c*=d,l*=d,n=Math.sin(i),a=1-(s=Math.cos(i)),e[0]=o*o*a+s,e[1]=c*o*a+l*n,e[2]=l*o*a-c*n,e[3]=0,e[4]=o*c*a-l*n,e[5]=c*c*a+s,e[6]=l*c*a+o*n,e[7]=0,e[8]=o*l*a+c*n,e[9]=c*l*a-o*n,e[10]=l*l*a+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function d(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=r+r,c=n+n,l=s+s,d=r*o,h=r*c,u=r*l,p=n*c,f=n*l,m=s*l,g=a*o,v=a*c,x=a*l;return e[0]=1-(p+m),e[1]=h+x,e[2]=u-v,e[3]=0,e[4]=h-x,e[5]=1-(d+m),e[6]=f+g,e[7]=0,e[8]=u+v,e[9]=f-g,e[10]=1-(d+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function h(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function u(e,t){var i=t[0],r=t[1],n=t[2],s=t[4],a=t[5],o=t[6],c=t[8],l=t[9],d=t[10];return e[0]=Math.hypot(i,r,n),e[1]=Math.hypot(s,a,o),e[2]=Math.hypot(c,l,d),e}function p(e,t){var r=new i(3);u(r,t);var n=1/r[0],s=1/r[1],a=1/r[2],o=t[0]*n,c=t[1]*s,l=t[2]*a,d=t[4]*n,h=t[5]*s,p=t[6]*a,f=t[8]*n,m=t[9]*s,g=t[10]*a,v=o+h+g,x=0;return v>0?(x=2*Math.sqrt(v+1),e[3]=.25*x,e[0]=(p-m)/x,e[1]=(f-l)/x,e[2]=(c-d)/x):o>h&&o>g?(x=2*Math.sqrt(1+o-h-g),e[3]=(p-m)/x,e[0]=.25*x,e[1]=(c+d)/x,e[2]=(f+l)/x):h>g?(x=2*Math.sqrt(1+h-o-g),e[3]=(f-l)/x,e[0]=(c+d)/x,e[1]=.25*x,e[2]=(p+m)/x):(x=2*Math.sqrt(1+g-o-h),e[3]=(c-d)/x,e[0]=(f+l)/x,e[1]=(p+m)/x,e[2]=.25*x),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var f=function(e,t,i,r,n){var s,a=1/Math.tan(t/2);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(s=1/(r-n),e[10]=(n+r)*s,e[14]=2*n*r*s):(e[10]=-1,e[14]=-2*r),e};function m(){var e=new i(3);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function g(e,t,r){var n=new i(3);return n[0]=e,n[1]=t,n[2]=r,n}function v(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function x(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function S(e,t){var i=t[0],r=t[1],n=t[2],s=i*i+r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function w(e,t,i){var r=t[0],n=t[1],s=t[2],a=i[0],o=i[1],c=i[2];return e[0]=n*c-s*o,e[1]=s*a-r*c,e[2]=r*o-n*a,e}function b(e,t,i,r){var n=t[0],s=t[1],a=t[2];return e[0]=n+r*(i[0]-n),e[1]=s+r*(i[1]-s),e[2]=a+r*(i[2]-a),e}function M(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function R(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function E(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*a,e[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*a,e[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*a,e[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*a,e}function F(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function P(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function A(e,i,r,n){var s,a,o,c,l,d=i[0],h=i[1],u=i[2],p=i[3],f=r[0],m=r[1],g=r[2],v=r[3];return(a=d*f+h*m+u*g+p*v)<0&&(a=-a,f=-f,m=-m,g=-g,v=-v),1-a>t?(s=Math.acos(a),o=Math.sin(s),c=Math.sin((1-n)*s)/o,l=Math.sin(n*s)/o):(c=1-n,l=n),e[0]=c*d+l*f,e[1]=c*h+l*m,e[2]=c*u+l*g,e[3]=c*p+l*v,e}m(),function(){var e=M()}();var I,T=function(e,t,r,n){var s=new i(4);return s[0]=e,s[1]=t,s[2]=r,s[3]=n,s},O=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},q=R,k=function(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=i*i+r*r+n*n+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=s*a,e};m(),g(1,0,0),g(0,1,0),F(),F(),I=new i(9),i!=Float32Array&&(I[1]=0,I[2]=0,I[3]=0,I[5]=0,I[6]=0,I[7]=0),I[0]=1,I[4]=1,I[8]=1;const L=Symbol("@iwer/action-player"),X=Symbol("@iwer/action-recorder"),z=Symbol("@iwer/xr-anchor"),C=Symbol("@iwer/xr-controller"),V=Symbol("@iwer/xr-device"),D=Symbol("@iwer/xr-hand-input"),N=Symbol("@iwer/xr-tracked-input"),j=Symbol("@iwer/xr-frame"),H=Symbol("@iwer/gamepad"),_=Symbol("@iwer/xr-system"),B=Symbol("@iwer/xr-input-source"),G=Symbol("@iwer/xr-webgl-layer"),W=Symbol("@iwer/xr-mesh"),Q=Symbol("@iwer/xr-plane"),U=Symbol("@iwer/xr-joint-pose"),K=Symbol("@iwer/xr-pose"),$=Symbol("@iwer/xr-viewer-pose"),J=Symbol("@iwer/xr-rigid-transform"),Y=Symbol("@iwer/xr-render-state"),Z=Symbol("@iwer/xr-session"),ee=Symbol("@iwer/xr-joint-space"),te=Symbol("@iwer/xr-reference-space"),ie=Symbol("@iwer/xr-space"),re=Symbol("@iwer/xr-view"),ne=Symbol("@iwer/xr-viewport"),se=Symbol("@iwer/xr-ray"),ae=Symbol("@iwer/xr-hit-test");class oe extends EventTarget{constructor(e,t){super(),this[ie]={parentSpace:e,offsetMatrix:t?n(t):r(),emulated:!0}}}class ce extends oe{constructor(){super(void 0,r())}}class le{static updateOffsetPosition(e,t){c(e[ie].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[ie].offsetMatrix,r=m();h(r,i),d(i,t,r)}static updateOffsetMatrix(e,t){s(e[ie].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,t=r()){return o(t,e[ie].parentSpace?le.calculateGlobalOffsetMatrix(e[ie].parentSpace):r(),e[ie].offsetMatrix),t}}class de{constructor(e=0,t=0,i=0){this.vec3=g(e,t,i),this.tempVec3=m()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return x(this.vec3,e,t,i),this}clone(){return new de(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return v(this.tempVec3,this.vec3),S(this.vec3,this.tempVec3),this}add(e){return v(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return v(this.tempVec3,this.vec3),function(e,t,i){var r=i[0],n=i[1],s=i[2],a=i[3],o=t[0],c=t[1],l=t[2],d=n*l-s*c,h=s*o-r*l,u=r*c-n*o,p=n*u-s*h,f=s*d-r*u,m=r*h-n*d,g=2*a;d*=g,h*=g,u*=g,p*=2,f*=2,m*=2,e[0]=o+d+p,e[1]=c+h+f,e[2]=l+u+m}(this.vec3,this.tempVec3,e.quat),this}}class he{constructor(e=0,t=0,i=0,r=1){this.quat=T(e,t,i,r),this.tempQuat=F()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,r){return q(this.quat,e,t,i,r),this}clone(){return new he(this.x,this.y,this.z,this.w)}copy(e){return q(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return O(this.tempQuat,this.quat),k(this.quat,this.tempQuat),this}invert(){return O(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return O(this.tempQuat,this.quat),function(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=i[0],c=i[1],l=i[2],d=i[3];e[0]=r*d+a*o+n*l-s*c,e[1]=n*d+a*c+s*o-r*l,e[2]=s*d+a*l+r*c-n*o,e[3]=a*d-r*o-n*c-s*l}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return P(this.quat,e.vec3,t),this}}var ue,pe,fe;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(ue||(ue={}));class me{constructor(e,t){this[H]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[H].type?this[H].pressed:this[H].value>0}get touched(){return"manual"===this[H].type?this[H].touched:this[H].touched||this.pressed}get value(){return this[H].value}}class ge{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ve{constructor(e,t="",i=-1){this[H]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[H].buttonsSequence.push(null):(this[H].buttonsSequence.push(e.id),this[H].buttonsMap[e.id]=new me(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[H].axesSequence.push(null):(this[H].axesSequence.push(e.id+e.type),this[H].axesMap[e.id]||(this[H].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[H].id}get index(){return this[H].index}get connected(){return this[H].connected}get timestamp(){return this[H].timestamp}get mapping(){return this[H].mapping}get axes(){const e=[];return this[H].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),r=t.substring(t.length-6);e.push("y-axis"===r?this[H].axesMap[i].y:this[H].axesMap[i].x)}})),e}get buttons(){return this[H].buttonsSequence.map((e=>null===e?new ge:this[H].buttonsMap[e]))}get hapticActuators(){return this[H].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(pe||(pe={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(fe||(fe={}));class xe extends Array{}class Se{constructor(e,t,i,r,n,s,a){this[B]={handedness:e,targetRayMode:t,targetRaySpace:r,gripSpace:s,profiles:i,gamepad:n,hand:a}}get handedness(){return this[B].handedness}get targetRayMode(){return this[B].targetRayMode}get targetRaySpace(){return this[B].targetRaySpace}get gripSpace(){return this[B].gripSpace}get profiles(){return this[B].profiles}get gamepad(){return this[B].gamepad}get hand(){return this[B].hand}}class ye extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const we={[pe.Left]:{position:new de(-.25,1.5,-.4),quaternion:new he},[pe.Right]:{position:new de(.25,1.5,-.4),quaternion:new he},[pe.None]:{position:new de(.25,1.5,-.4),quaternion:new he}};class be{constructor(e){this[N]={inputSource:e,position:we[e.handedness].position.clone(),quaternion:we[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[N].position}get quaternion(){return this[N].quaternion}get inputSource(){return this[N].inputSource}get connected(){return this[N].connected}set connected(e){this[N].connected=e,this[N].inputSource.gamepad[H].connected=e}onFrameStart(e){d(this[N].inputSource.targetRaySpace[ie].offsetMatrix,this[N].quaternion.quat,this[N].position.vec3);const t=e.session;this[N].inputSource.gamepad.buttons.forEach((i=>{i instanceof me&&(i[H].lastFrameValue=i[H].value,null!=i[H].pendingValue&&(i[H].value=i[H].pendingValue,i[H].pendingValue=null),null!=i[H].eventTrigger&&(0===i[H].lastFrameValue&&i[H].value>0?(t.dispatchEvent(new ye(i[H].eventTrigger,{frame:e,inputSource:this[N].inputSource})),t.dispatchEvent(new ye(i[H].eventTrigger+"start",{frame:e,inputSource:this[N].inputSource}))):i[H].lastFrameValue>0&&0===i[H].value&&t.dispatchEvent(new ye(i[H].eventTrigger+"end",{frame:e,inputSource:this[N].inputSource}))))})),this[N].inputSourceChanged=this.connected!==this[N].lastFrameConnected,this[N].lastFrameConnected=this.connected}}class Me extends be{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const r=new oe(i),n=e.layout[t].gripOffsetMatrix?new oe(r,e.layout[t].gripOffsetMatrix):void 0,s=[e.profileId,...e.fallbackProfileIds];super(new Se(t,fe.TrackedPointer,s,r,new ve(e.layout[t].gamepad),n)),this[C]={profileId:e.profileId,gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[C].gamepadConfig}get profileId(){return this[C].profileId}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[N].inputSource.gamepad[H].buttonsMap[e];if(i){if("binary"===i[H].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[H].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[N].inputSource.gamepad[H].buttonsMap[e];i?i[H].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const r=this[N].inputSource.gamepad[H].axesMap[e];r?"x-axis"===t?r.x=i:"y-axis"===t&&(r.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const r=this[N].inputSource.gamepad[H].axesMap[e];r?(r.x=t,r.y=i):console.warn(`Current controller does not have ${e} axes.`)}}class Re{constructor(e,t,i,r,n){this[W]={nativeMesh:e,frame:void 0,meshSpace:t,vertices:i,indices:r,lastChangedTime:performance.now(),semanticLabel:n}}get meshSpace(){return this[W].meshSpace}get vertices(){return this[W].vertices}get indices(){return this[W].indices}get lastChangedTime(){return this[W].lastChangedTime}get semanticLabel(){return this[W].semanticLabel}}class Ee extends Set{}var Fe,Pe;e.XRSemanticLabels=void 0,(Fe=e.XRSemanticLabels||(e.XRSemanticLabels={})).Desk="desk",Fe.Couch="couch",Fe.Floor="floor",Fe.Ceiling="ceiling",Fe.Wall="wall",Fe.Door="door",Fe.Window="window",Fe.Table="table",Fe.Shelf="shelf",Fe.Bed="bed",Fe.Screen="screen",Fe.Lamp="lamp",Fe.Plant="plant",Fe.WallArt="wall art",Fe.GlobalMesh="global mesh",Fe.Other="other",function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Pe||(Pe={}));const Ae={[e.XRSemanticLabels.Desk]:Pe.Horizontal,[e.XRSemanticLabels.Couch]:Pe.Horizontal,[e.XRSemanticLabels.Floor]:Pe.Horizontal,[e.XRSemanticLabels.Ceiling]:Pe.Horizontal,[e.XRSemanticLabels.Wall]:Pe.Vertical,[e.XRSemanticLabels.Door]:Pe.Vertical,[e.XRSemanticLabels.Window]:Pe.Vertical,[e.XRSemanticLabels.Table]:Pe.Horizontal,[e.XRSemanticLabels.Shelf]:Pe.Horizontal,[e.XRSemanticLabels.Bed]:Pe.Horizontal,[e.XRSemanticLabels.Screen]:Pe.Horizontal,[e.XRSemanticLabels.Lamp]:Pe.Horizontal,[e.XRSemanticLabels.Plant]:Pe.Horizontal,[e.XRSemanticLabels.WallArt]:Pe.Vertical};class Ie{constructor(e,t,i,r){this[Q]={nativePlane:e,frame:void 0,planeSpace:t,polygon:i,lastChangedTime:performance.now(),semanticLabel:r,orientation:r?Ae[r]:void 0}}get planeSpace(){return this[Q].planeSpace}get polygon(){return this[Q].polygon}get orientation(){return this[Q].orientation}get lastChangedTime(){return this[Q].lastChangedTime}get semanticLabel(){return this[Q].semanticLabel}}class Te extends Set{}class Oe{constructor(e,t){this[z]={anchorSpace:e,session:t,deleted:!1},t[Z].trackedAnchors.add(this)}get anchorSpace(){if(this[z].deleted)throw new DOMException("XRAnchor has already been deleted.","InvalidStateError");return this[z].anchorSpace}requestPersistentHandle(){return new Promise(((e,t)=>{if(this[z].deleted)t(new DOMException("XRAnchor has already been deleted.","InvalidStateError"));else{const t=this[z].session[Z].persistentAnchors;for(const[i,r]of t.entries())if(r===this)return void e(i);const i=crypto.randomUUID();Le.createPersistentAnchor(this[z].session,this,i),e(i)}}))}delete(){this[z].deleted||(this[z].anchorSpace=null,this[z].deleted=!0,this[z].session[Z].trackedAnchors.delete(this))}}class qe extends Set{}const ke="@immersive-web-emulation-runtime/persistent-anchors";class Le{static recoverPersistentAnchorsFromStorage(e){const t=JSON.parse(localStorage.getItem(ke)||"{}");Object.entries(t).forEach((([t,i])=>{const r=e[Z].device[V].globalSpace,n=new oe(r,i),s=new Oe(n,e);e[Z].persistentAnchors.set(t,s)}))}static createPersistentAnchor(e,t,i){e[Z].trackedAnchors.add(t),e[Z].persistentAnchors.set(i,t);const r=JSON.parse(localStorage.getItem(ke)||"{}");r[i]=Array.from(t[z].anchorSpace[ie].offsetMatrix),localStorage.setItem(ke,JSON.stringify(r))}}class Xe{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r,Object.freeze(this)}static fromPoint(e){return new Xe(e.x,e.y,e.z,e.w)}matrixTransform(e){return new Xe}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const ze=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:Xe;class Ce{constructor(e,t){const i=g(0,0,0),n=F();this[J]={matrix:r(),position:e?g(e.x,e.y,e.z):i,orientation:t?k(F(),T(t.x,t.y,t.z,t.w)):n,inverse:null},this.updateMatrix()}updateMatrix(){d(this[J].matrix,this[J].orientation,this[J].position)}get matrix(){return this[J].matrix}get position(){const e=this[J].position;return new ze(e[0],e[1],e[2],1)}get orientation(){const e=this[J].orientation;return new ze(e[0],e[1],e[2],e[3])}get inverse(){if(!this[J].inverse){const e=r();if(!a(e,this[J].matrix))throw new Error("Matrix is not invertible.");let t=m();h(t,e);let i=F();p(i,e),this[J].inverse=new Ce(new ze(t[0],t[1],t[2],1),new ze(i[0],i[1],i[2],i[3])),this[J].inverse[J].inverse=this}return this[J].inverse}}class Ve{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}}class De{constructor(e,t){const i={x:0,y:0,z:0,w:1},r={x:0,y:0,z:-1,w:0};if(e instanceof Ce){const t=e.matrix,n=R(M(),i.x,i.y,i.z,i.w),s=R(M(),r.x,r.y,r.z,r.w);E(n,n,t),E(s,s,t),i.x=n[0],i.y=n[1],i.z=n[2],i.w=n[3],r.x=s[0],r.y=s[1],r.z=s[2],r.w=s[3]}else if(e&&(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w),t){if(0===t.x&&0===t.y&&0===t.z||1!==t.w)throw new DOMException("Invalid direction value to construct XRRay","TypeError");r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w}const n=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z)||1;r.x=r.x/n,r.y=r.y/n,r.z=r.z/n,this[se]={origin:new Ve(i.x,i.y,i.z,i.w),direction:new Ve(r.x,r.y,r.z,r.w),matrix:null}}get origin(){return this[se].origin}get direction(){return this[se].direction}get matrix(){if(this[se].matrix)return this[se].matrix;const e=x(m(),0,0,-1),t=x(m(),this[se].origin.x,this[se].origin.y,this[se].origin.z),i=x(m(),this[se].direction.x,this[se].direction.y,this[se].direction.z),n=w(m(),i,e),s=y(i,e),a=r();s>-1&&s<1?l(a,Math.acos(s),n):-1===s?l(a,Math.acos(s),x(m(),1,0,0)):function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(a);const d=c(r(),t),h=o(r(),d,a);return this[se].matrix=new Float32Array(h),this[se].matrix}}class Ne{constructor(e,t){var i;this[ae]={session:e,space:t.space,offsetRay:null!==(i=t.offsetRay)&&void 0!==i?i:new De}}cancel(){this[ae].session[Z].hitTestSources.delete(this)}}class je{constructor(e,t){this[ae]={frame:e,offsetSpace:t}}getPose(e){return this[ae].frame.getPose(this[ae].offsetSpace,e)}createAnchor(){return this[ae].frame.createAnchor(new Ce,this[ae].offsetSpace)}}class He extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var _e,Be,Ge;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(Be||(Be={}));class We extends oe{constructor(e,t,i){super(t,i),this[_e]={type:null,onreset:()=>{}},this[te].type=e}get onreset(){var e;return null!==(e=this[te].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[te].onreset&&this.removeEventListener("reset",this[te].onreset),this[te].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new We(this[te].type,this,e)}}_e=te;class Qe{constructor(e={},t){this[Y]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[Y].depthNear}get depthFar(){return this[Y].depthFar}get inlineVerticalFieldOfView(){return this[Y].inlineVerticalFieldOfView}get baseLayer(){return this[Y].baseLayer}}class Ue extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}!function(e){e.None="none",e.Left="left",e.Right="right"}(Ge||(Ge={}));class Ke{constructor(e,t,i,r){this[re]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:r}}get eye(){return this[re].eye}get projectionMatrix(){return this[re].projectionMatrix}get transform(){return this[re].transform}get recommendedViewportScale(){return this[re].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[re].requestedViewportScale=e}}class $e{constructor(e,t=!1,i=void 0,r=void 0){this[K]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:r}}get transform(){return this[K].transform}get emulatedPosition(){return this[K].emulatedPosition}get linearVelocity(){return this[K].linearVelocity}get angularVelocity(){return this[K].angularVelocity}}class Je extends $e{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[U]={radius:t}}get radius(){return this[U].radius}}class Ye extends $e{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[$]={views:Object.freeze(t)}}get views(){return this[$].views}}const Ze=r(),et=r(),tt=r(),it=(e,t,i)=>{le.calculateGlobalOffsetMatrix(t,Ze),le.calculateGlobalOffsetMatrix(i,et),a(tt,et),o(e,tt,Ze)};class rt{constructor(e,t,i,n,s){this[j]={session:e,id:t,active:i,animationFrame:n,predictedDisplayTime:s,tempMat4:r(),detectedPlanes:new Te,detectedMeshes:new Ee,trackedAnchors:e[Z].frameTrackedAnchors,hitTestResultsMap:new Map}}get session(){return this[j].session}get predictedDisplayTime(){return this[j].predictedDisplayTime}getPose(e,t){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");it(this[j].tempMat4,e,t);const i=m();h(i,this[j].tempMat4);const r=F();return p(r,this[j].tempMat4),new $e(new Ce({x:i[0],y:i[1],z:i[2],w:1},{x:r[0],y:r[1],z:r[2],w:r[3]}),e[ie].emulated)}getViewerPose(e){if(!this[j].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[j].session,i=t[Z].device,r=this.getPose(i.viewerSpace,e),n="inline"===t[Z].mode?[Ge.None]:[Ge.Left,Ge.Right],s=[];return n.forEach((r=>{const n=i.viewSpaces[r],a=this.getPose(n,e),o=t[Z].getProjectionMatrix(r),c=new Ke(r,new Float32Array(o),a.transform,t);s.push(c)})),new Ye(r.transform,s,!1)}getJointPose(e,t){const i=this.getPose(e,t),r=e[ee].radius;return new Je(i.transform,r,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let r=0;r<e.length;r++)e[r][ee].radius?t[r]=e[r][ee].radius:(t[r]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,r)=>{it(this[j].tempMat4,e,t);for(let e=0;e<16;e++)i[16*r+e]=this[j].tempMat4[e]})),!0}get detectedPlanes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedPlanes}get detectedMeshes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedMeshes}get trackedAnchors(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].trackedAnchors}createAnchor(e,t){return new Promise(((i,r)=>{if(this[j].active){const n=this[j].session[Z].device[V].globalSpace,s=new oe(t,e.matrix),a=le.calculateGlobalOffsetMatrix(s),o=new oe(n,a),c=new Oe(o,this[j].session);this[j].session[Z].trackedAnchors.add(c),this[j].session[Z].newAnchors.set(c,{resolve:i,reject:r})}else r(new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError"))}))}getHitTestResults(e){if(this[j].active){if(this[j].hitTestResultsMap.has(e))return[...this[j].hitTestResultsMap.get(e)];throw new DOMException("Requested hit test results are not available for current frame.","InvalidStateError")}throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError")}}var nt,st,at;!function(e){e.Opaque="opaque",e.AlphaBlend="alpha-blend",e.Additive="additive"}(nt||(nt={})),function(e){e.ScreenSpace="screen-space",e.WorldSpace="world-space"}(st||(st={}));class ot extends EventTarget{constructor(e,t,i){super(),this[Z]={device:e,mode:t,renderState:new Qe,pendingRenderState:null,enabledFeatures:i,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[Ge.Left]:r(),[Ge.Right]:r(),[Ge.None]:r()},getProjectionMatrix:e=>this[Z].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[Z].enabledFeatures.includes(e))return!1;switch(e){case Be.Viewer:return!0;case Be.Local:case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:return"inline"!=this[Z].mode}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[Z].ended)return;this[Z].deviceFrameHandle=globalThis.requestAnimationFrame(this[Z].onDeviceFrame),null!=this[Z].pendingRenderState&&(this[Z].renderState=this[Z].pendingRenderState,this[Z].pendingRenderState=null,this[Z].device[V].onBaseLayerSet(this[Z].renderState.baseLayer));const e=this[Z].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if("inline"!=this[Z].mode){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),r=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(r)}const{depthNear:r,depthFar:n}=this[Z].renderState,{width:a,height:o}=i;if("inline"!==this[Z].mode){const e=a*(this[Z].device.stereoEnabled?.5:1)/o;f(this[Z].projectionMatrices[Ge.Left],this[Z].device.fovy,e,r,n),s(this[Z].projectionMatrices[Ge.Right],this[Z].projectionMatrices[Ge.Left])}else{const e=a/o;f(this[Z].projectionMatrices[Ge.None],this[Z].renderState.inlineVerticalFieldOfView,e,r,n)}const c=new rt(this,this[Z].frameHandle,!0,!0,performance.now()),l=performance.now(),d=this[Z].device[V].devui;if(d&&d.render(l),"immersive-ar"===this[Z].mode){const e=this[Z].device[V].sem;e&&e.render(l)}this[Z].enabledFeatures.includes("anchors")&&this[Z].updateTrackedAnchors(),this[Z].enabledFeatures.includes("plane-detection")&&this[Z].updateTrackedPlanes(c),this[Z].enabledFeatures.includes("mesh-detection")&&this[Z].updateTrackedMeshes(c),this[Z].enabledFeatures.includes("hit-test")&&this[Z].computeHitTestResults(c),this[Z].device[V].onFrameStart(c),this[Z].updateActiveInputSources();const h=this[Z].currentFrameCallbacks=this[Z].frameCallbacks;this[Z].frameCallbacks=[];const u=performance.now();for(let e=0;e<h.length;e++)try{h[e].cancelled||h[e].callback(u,c)}catch(e){console.error(e)}this[Z].currentFrameCallbacks=null,c[j].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[Z].enabledFeatures.includes("hand-tracking"),t=this[Z].activeInputSources,i=this[Z].device.inputSources.filter((t=>!t.hand||e)),r=i.filter((e=>!t.includes(e))),n=t.filter((e=>!i.includes(e)));this[Z].activeInputSources=i,(r.length>0||n.length>0)&&this.dispatchEvent(new He("inputsourceschange",{session:this,added:r,removed:n}))},trackedAnchors:new qe,persistentAnchors:new Map,newAnchors:new Map,frameTrackedAnchors:new qe,updateTrackedAnchors:()=>{this[Z].enabledFeatures.includes("anchors")&&(this[Z].frameTrackedAnchors.clear(),Array.from(this[Z].trackedAnchors).forEach((e=>{if(e[z].deleted){if(this[Z].trackedAnchors.delete(e),this[Z].newAnchors.has(e)){const{reject:t}=this[Z].newAnchors.get(e);t(new DOMException("Anchor is no longer tracked","InvalidStateError"))}}else if(this[Z].frameTrackedAnchors.add(e),this[Z].newAnchors.has(e)){const{resolve:t}=this[Z].newAnchors.get(e);t(e),this[Z].newAnchors.delete(e)}})))},trackedPlanes:new Map,updateTrackedPlanes:e=>{const t=this[Z].device[V].sem;if(!t)return;Array.from(this[Z].trackedPlanes.keys()).forEach((e=>{t.trackedPlanes.has(e)||this[Z].trackedPlanes.delete(e)})),t.trackedPlanes.forEach((t=>{let i=this[Z].trackedPlanes.get(t);if(!i){const e=new oe(this[Z].device[V].globalSpace,t.transform.matrix);i=new Ie(t,e,t.polygon,t.semanticLabel),this[Z].trackedPlanes.set(t,i)}i[Q].lastChangedTime=e.predictedDisplayTime,i[Q].frame=e,e[j].detectedPlanes.add(i)}))},trackedMeshes:new Map,updateTrackedMeshes:e=>{const t=this[Z].device[V].sem;if(!t)return;Array.from(this[Z].trackedMeshes.keys()).forEach((e=>{t.trackedMeshes.has(e)||this[Z].trackedMeshes.delete(e)})),t.trackedMeshes.forEach((t=>{let i=this[Z].trackedMeshes.get(t);if(!i){const e=new oe(this[Z].device[V].globalSpace,t.transform.matrix);i=new Re(t,e,t.vertices,t.indices,t.semanticLabel),this[Z].trackedMeshes.set(t,i)}i[W].lastChangedTime=e.predictedDisplayTime,i[W].frame=e,e[j].detectedMeshes.add(i)}))},hitTestSources:new Set,computeHitTestResults:e=>{const t=this[Z].device[V].sem;if(!t)return;const i=this[Z].device[V].globalSpace;this[Z].hitTestSources.forEach((n=>{const s=n[ae].space,a=le.calculateGlobalOffsetMatrix(s),c=n[ae].offsetRay.matrix,l=r();o(l,a,c);const d=[];t.computeHitTestResults(l).forEach((t=>{const r=new oe(i,t),n=new je(e,r);d.push(n)})),e[j].hitTestResultsMap.set(n,d)}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},Le.recoverPersistentAnchorsFromStorage(this),this[Z].onDeviceFrame()}get visibilityState(){return this[Z].device.visibilityState}get frameRate(){return this[Z].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[Z].device.supportedFrameRates)}get renderState(){return this[Z].renderState}get inputSources(){return this[Z].inputSourceArray.length=0,this[Z].ended||"inline"===this[Z].mode||this[Z].inputSourceArray.push(...this[Z].activeInputSources),this[Z].inputSourceArray}get enabledFeatures(){return this[Z].enabledFeatures}get isSystemKeyboardSupported(){return this[Z].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[Z].device[V].environmentBlendModes[this[Z].mode])&&void 0!==e?e:nt.Opaque}get interactionMode(){return this[Z].device[V].interactionMode}updateRenderState(e={}){var t,i,r,n;if(this[Z].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[G].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&"inline"!==this[Z].mode)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:e.baseLayer||(null===(t=this[Z].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[Z].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(r=this[Z].pendingRenderState)||void 0===r?void 0:r.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(n=this[Z].pendingRenderState)||void 0===n?void 0:n.inlineVerticalFieldOfView)||void 0};this[Z].pendingRenderState=new Qe(s,this[Z].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[Z].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[Z].device.supportedFrameRates.includes(e)?(this[Z].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[Z].nominalFrameRate=e,this.dispatchEvent(new Ue("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[Z].ended||!this[Z].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let r;switch(e){case Be.Viewer:r=this[Z].device.viewerSpace;break;case Be.Local:r=new We(e,this[Z].device[V].globalSpace,this[Z].device.viewerSpace[ie].offsetMatrix);break;case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:r=new We(e,this[Z].device[V].globalSpace)}this[Z].referenceSpaces.push(r),t(r)}))}requestAnimationFrame(e){if(this[Z].ended)return 0;const t=++this[Z].frameHandle;return this[Z].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[Z].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[Z].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[Z].ended||null===this[Z].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[Z].deviceFrameHandle),this[Z].device[V].onSessionEnd(),this.dispatchEvent(new Ue("end",{session:this})),e())}))}get persistentAnchors(){return Array.from(this[Z].persistentAnchors.keys())}restorePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Z].persistentAnchors.has(e))if(this[Z].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else{const r=this[Z].persistentAnchors.get(e);this[Z].newAnchors.has(r)?i(new DOMException(`Multiple concurrent attempts detected to restore the anchor with UUID: ${e}.`,"InvalidStateError")):(this[Z].trackedAnchors.add(r),this[Z].newAnchors.set(r,{resolve:t,reject:i}))}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}deletePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Z].persistentAnchors.has(e)){const i=this[Z].persistentAnchors.get(e);this[Z].persistentAnchors.delete(e),i.delete(),t(void 0)}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}requestHitTestSource(e){return new Promise(((t,i)=>{if(this[Z].enabledFeatures.includes("hit-test"))if(this[Z].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else if(this[Z].device[V].sem){const i=new Ne(this,e);this[Z].hitTestSources.add(i),t(i)}else i(new DOMException("Synthethic Environment Module required for emulating hit-test","OperationError"));else i(new DOMException('WebXR feature "hit-test" is not supported by current session',"NotSupportedError"))}))}get onend(){var e;return null!==(e=this[Z].onend)&&void 0!==e?e:()=>{}}set onend(e){this[Z].onend&&this.removeEventListener("end",this[Z].onend),this[Z].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[Z].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[Z].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[Z].oninputsourceschange),this[Z].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[Z].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[Z].onselect&&this.removeEventListener("select",this[Z].onselect),this[Z].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[Z].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[Z].onselectstart&&this.removeEventListener("selectstart",this[Z].onselectstart),this[Z].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[Z].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[Z].onselectend&&this.removeEventListener("selectend",this[Z].onselectend),this[Z].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[Z].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[Z].onsqueeze&&this.removeEventListener("squeeze",this[Z].onsqueeze),this[Z].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[Z].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[Z].onsqueezestart&&this.removeEventListener("squeezestart",this[Z].onsqueezestart),this[Z].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[Z].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[Z].onsqueezeend&&this.removeEventListener("squeezeend",this[Z].onsqueezeend),this[Z].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[Z].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[Z].onvisibilitychange&&this.removeEventListener("visibilitychange",this[Z].onvisibilitychange),this[Z].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[Z].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[Z].onframeratechange&&this.removeEventListener("frameratechange",this[Z].onframeratechange),this[Z].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(at||(at={}));class ct extends Map{}class lt extends oe{constructor(e,t,i){super(t,i),this[ee]={jointName:e,radius:0}}get jointName(){return this[ee].jointName}}const dt={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},ht={mapping:ue.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},ut=m(),pt=F(),ft=m(),mt=m(),gt=F(),vt=m(),xt=m(),St=F(),yt=m(),wt=(e,t,i,r)=>(h(ut,t),p(pt,t),u(ft,t),h(mt,i),p(gt,i),u(vt,i),b(xt,ut,mt,r),A(St,pt,gt,r),b(yt,ft,vt,r),function(e,t,i,r){var n=t[0],s=t[1],a=t[2],o=t[3],c=n+n,l=s+s,d=a+a,h=n*c,u=n*l,p=n*d,f=s*l,m=s*d,g=a*d,v=o*c,x=o*l,S=o*d,y=r[0],w=r[1],b=r[2];e[0]=(1-(f+g))*y,e[1]=(u+S)*y,e[2]=(p-x)*y,e[3]=0,e[4]=(u-S)*w,e[5]=(1-(h+g))*w,e[6]=(m+v)*w,e[7]=0,e[8]=(p+x)*b,e[9]=(m-v)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,St,xt,yt),e),bt=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1];class Mt extends be{constructor(e,t,i){if(t!==pe.Left&&t!==pe.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const r=new oe(i),n=new oe(r),s=[e.profileId,...e.fallbackProfileIds],a=new ct;Object.values(at).forEach((e=>{a.set(e,new lt(e,r))}));super(new Se(t,fe.TrackedPointer,s,r,new ve(ht),n,a)),this[D]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[D].poseId}set poseId(e){this[D].poses[e]?this[D].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[D].poses[this[D].poseId],t=this[D].poses.pinch;Object.values(at).forEach((i=>{const r=e.jointTransforms[i].offsetMatrix,n=t.jointTransforms[i].offsetMatrix,s=this.inputSource.hand.get(i);wt(s[ie].offsetMatrix,r,n,this.pinchValue),this.inputSource.handedness===pe.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=bt[t]})(s[ie].offsetMatrix),s[ee].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&wt(this.inputSource.gripSpace[ie].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[N].inputSource.gamepad[H].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[N].inputSource.gamepad[H].buttonsMap.pinch[H].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}class Rt extends EventTarget{}const Et={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class Ft extends Rt{constructor(e,t,i={}){if(super(),e[Z].ended)throw new DOMException("Session has ended","InvalidStateError");const r={...Et,...i};this[G]={session:e,context:t,antialias:r.antialias}}get context(){return this[G].context}get antialias(){return this[G].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[G].context.drawingBufferWidth}get framebufferHeight(){return this[G].context.drawingBufferHeight}getViewport(e){if(e[re].session!==this[G].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[G].session[Z].device[V].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof ot))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[Z].ended?0:1}}class Pt{constructor(e,t,i){const{schema:r,frames:n}=t;if(!n||!r||0===n.length)throw new DOMException("wrong recording format","NotSupportedError");const s=new We(Be.Viewer,e),a={[Ge.Left]:new oe(s),[Ge.Right]:new oe(s),[Ge.None]:new oe(s)};this[L]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:n,recordedFramePointer:0,startingTimeStamp:n[0][0],endingTimeStamp:n[n.length-1][0],playbackTime:n[0][0],playing:!1,viewerSpace:s,viewSpaces:a,vec3:m(),quat:F()},c(this[L].viewSpaces[Ge.Left][ie].offsetMatrix,g(-i/2,0,0)),c(this[L].viewSpaces[Ge.Right][ie].offsetMatrix,g(i/2,0,0)),r.forEach((t=>{const i=t[0],r=t[1];let n;if(r.hasGamepad){const e=[];for(let t=0;t<r.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<r.numAxes;e++)t.push({id:e.toString(),type:"manual"});n=new ve({mapping:r.mapping,buttons:e,axes:t})}const s=new oe(e);let a;r.hasHand&&(a=new ct,Object.values(at).forEach((e=>{a.set(e,new lt(e,s))})));const o=new Se(r.handedness,r.targetRayMode,r.profiles,s,n,r.hasGrip?new oe(e):void 0,r.hasHand?a:void 0);this[L].inputSources.set(i,{active:!1,source:o}),this[L].inputSchemas.set(i,r)}))}play(){this[L].recordedFramePointer=0,this[L].playbackTime=this[L].startingTimeStamp,this[L].playing=!0,this[L].actualTimeStamp=performance.now()}stop(){this[L].playing=!1}get playing(){return this[L].playing}get viewerSpace(){return this[L].viewerSpace}get viewSpaces(){return this[L].viewSpaces}get inputSources(){return Array.from(this[L].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[L].actualTimeStamp;if(this[L].actualTimeStamp=e,this[L].playbackTime+=t,this[L].playbackTime>this[L].endingTimeStamp)return void this.stop();for(;this[L].frames[this[L].recordedFramePointer+1][0]<this[L].playbackTime;)this[L].recordedFramePointer++;const i=this[L].frames[this[L].recordedFramePointer],r=this[L].frames[this[L].recordedFramePointer+1],n=(this[L].playbackTime-i[0])/(r[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[L].viewerSpace,i.slice(1,8),r.slice(1,8),n);const s=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:r}=this.processRawInputData(i[e]);s.set(t,r)}const a=new Map;for(let e=8;e<r.length;e++){const{index:t,inputData:i}=this.processRawInputData(r[e]);a.set(t,i)}this[L].inputSources.forEach((e=>{e.active=!1})),a.forEach(((e,t)=>{this[L].inputSources.get(t).active=!0;const i=this[L].inputSources.get(t).source,r=this[L].inputSchemas.get(t);this.updateInputSource(i,r,s.has(t)?s.get(t):e,e,n)}))}updateInputSource(e,t,i,r,n){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,r.targetRayTransform,n),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,r.gripTransform,n),t.hasHand)for(let s=0;s<25;s++){const a=i.handTransforms.slice(8*s,8*s+7),o=r.handTransforms.slice(8*s,8*s+7),c=i.handTransforms[8*s+7],l=r.handTransforms[8*s+7],d=e.hand.get(t.jointSequence[s]);this.updateXRSpaceFromMergedFrames(d,a,o,n),d[ee].radius=(l-c)*n+c}if(t.hasGamepad){const t=e.gamepad;r.buttons.forEach(((e,r)=>{const s=t.buttons[r];s[H].pressed=1===e[0],s[H].touched=1===e[1];const a=i.buttons[r][2],o=e[2];s[H].value=(o-a)*n+a})),r.axes.forEach(((e,r)=>{const s=i.axes[r];t[H].axesMap[r.toString()].x=(e-s)*n+s}))}}updateXRSpaceFromMergedFrames(e,t,i,r){const n=g(t[0],t[1],t[2]),s=T(t[3],t[4],t[5],t[6]),a=g(i[0],i[1],i[2]),o=T(i[3],i[4],i[5],i[6]);b(this[L].vec3,n,a,r),A(this[L].quat,s,o,r),d(e[ie].offsetMatrix,this[L].quat,this[L].vec3)}processRawInputData(e){const t=e[0],i=this[L].inputSchemas.get(t),r={targetRayTransform:e.slice(1,8)};let n=8;if(i.hasGrip&&(r.gripTransform=e[n++]),i.hasHand&&(r.handTransforms=e[n++]),i.hasGamepad){const t=e[n];r.buttons=t.slice(0,i.numButtons),r.axes=t.slice(i.numButtons)}return{index:t,inputData:r}}}const At="2.0.0";class It extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}class Tt extends EventTarget{constructor(e){super(),this[_]={device:e,grantSession:({resolve:e,reject:t,mode:i,options:r})=>{if(this[_].activeSession)return void t(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:n=[],optionalFeatures:s=[]}=r,{supportedFeatures:a}=this[_].device;if(!n.every((e=>a.includes(e))))return void t(new Error("One or more required features are not supported by the device."));const o=s.filter((e=>a.includes(e))),c=Array.from(new Set([...n,...o,"viewer","local"])),l=new ot(this[_].device,i,c);this[_].activeSession=l,l.addEventListener("end",(()=>{this[_].activeSession=void 0})),e(l)}}}isSessionSupported(e){return new Promise(((t,i)=>{t("inline"===e||this[_].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{if(!n)return void r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));const s={resolve:i,reject:r,mode:e,options:t};this[_].grantSession(s)})).catch(r)}))}offerSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{n?this[_].offeredSessionConfig={resolve:i,reject:r,mode:e,options:t}:r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"))})).catch(r)}))}}class Ot{constructor(e,t,i,r){this[ne]={x:e,y:t,width:i,height:r}}get x(){return this[ne].x}get y(){return this[ne].y}get width(){return this[ne].width}get height(){return this[ne].height}}const qt={ipd:.063,fovy:Math.PI/2,headsetPosition:new de(0,1.6,0),headsetQuaternion:new he,stereoEnabled:!1};const kt={mapping:ue.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Lt={mapping:ue.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Xt={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},zt={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},Ct={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},Vt={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","hand-tracking"],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Dt={name:"Meta Quest 2",controllerConfig:Xt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Nt={name:"Meta Quest Pro",controllerConfig:zt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},jt={name:"Meta Quest 3",controllerConfig:Ct,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking","depth-sensing"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Ht=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};e.ActionRecorder=class{constructor(e,t){this[X]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),r=null===(t=e.getViewerPose(this[X].refSpace))||void 0===t?void 0:t.transform.matrix;if(!r)return;const n={timeStamp:i,position:h(m(),r),quaternion:p(F(),r),inputFrames:[]};this[X].session.inputSources.forEach((t=>{var i,r;if(!this[X].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[X].inputMap.size;this[X].inputMap.set(t,i),this[X].schemaMap.set(i,e)}const s=this[X].inputMap.get(t),a=this[X].schemaMap.get(s),o=null===(i=e.getPose(t.targetRaySpace,this[X].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:s,targetRayTransform:{position:h(m(),o),quaternion:p(F(),o)}};if(a.hasGrip){const n=null===(r=e.getPose(t.gripSpace,this[X].refSpace))||void 0===r?void 0:r.transform.matrix;if(n){const e=h(m(),n),t=p(F(),n);i.gripTransform={position:e,quaternion:t}}}if(a.hasHand){const r=Array.from(t.hand.values());let n=!0;if(n&&(n=e.fillPoses(r,t.targetRaySpace,this[X].jointTransforms)),n&&(n=e.fillJointRadii(r,this[X].jointRadii)),n){const e={};for(let t=0;t<25;t++){const i=this[X].jointTransforms.slice(16*t,16*(t+1)),n=this[X].jointRadii[t],s=h(m(),i),a=p(F(),i);e[r[t].jointName]={position:s,quaternion:a,radius:n}}i.hand=e}}if(a.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}n.inputFrames.push(i)}})),this[X].compressedFrames.push(this.compressActionFrame(n))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...Ht(e.position),...Ht(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,r=this[X].schemaMap.get(i),n=[i,...Ht(e.targetRayTransform.position),...Ht(e.targetRayTransform.quaternion)];if(r.hasGrip&&n.push([...Ht(e.gripTransform.position),...Ht(e.gripTransform.quaternion)]),r.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:r})=>{t.push(...Ht(e),...Ht(i),parseFloat(r.toFixed(3)))})),n.push(t)}r.hasGamepad&&n.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(n)})),t}log(){const e={schema:Array.from(this[X].schemaMap.entries()),frames:this[X].compressedFrames};console.log(JSON.stringify(e))}},e.NativeMesh=class{constructor(e,t,i,r){this.transform=e,this.vertices=t,this.indices=i,this.semanticLabel=r}},e.NativePlane=class{constructor(e,t,i){this.transform=e,this.polygon=t,this.semanticLabel=i}},e.P_ACTION_PLAYER=L,e.P_ACTION_RECORDER=X,e.P_ANCHOR=z,e.P_CONTROLLER=C,e.P_DEVICE=V,e.P_FRAME=j,e.P_GAMEPAD=H,e.P_HAND_INPUT=D,e.P_HIT_TEST=ae,e.P_INPUT_SOURCE=B,e.P_JOINT_POSE=U,e.P_JOINT_SPACE=ee,e.P_MESH=W,e.P_PLANE=Q,e.P_POSE=K,e.P_RAY=se,e.P_REF_SPACE=te,e.P_RENDER_STATE=Y,e.P_RIGID_TRANSFORM=J,e.P_SESSION=Z,e.P_SPACE=ie,e.P_SYSTEM=_,e.P_TRACKED_INPUT=N,e.P_VIEW=re,e.P_VIEWER_POSE=$,e.P_VIEWPORT=ne,e.P_WEBGL_LAYER=G,e.XRAnchor=Oe,e.XRAnchorSet=qe,e.XRDevice=class{constructor(e,t={}){var i,n,s,a,o,l;this.version=At;const h=new ce,u=new We(Be.Viewer,h),p={[Ge.Left]:new oe(u),[Ge.Right]:new oe(u),[Ge.None]:new oe(u)},f=e.controllerConfig,m={};f&&Object.values(pe).forEach((e=>{f.layout[e]&&(m[e]=new Me(f,e,h))}));const v={[pe.Left]:new Mt(dt,pe.Left,h),[pe.Right]:new Mt(dt,pe.Right,h)},x=null!==(i=t.canvasContainer)&&void 0!==i?i:document.createElement("div");x.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${At}`,x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[V]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(n=t.headsetPosition)&&void 0!==n?n:qt.headsetPosition.clone(),quaternion:null!==(s=t.headsetQuaternion)&&void 0!==s?s:qt.headsetQuaternion.clone(),stereoEnabled:null!==(a=t.stereoEnabled)&&void 0!==a?a:qt.stereoEnabled,ipd:null!==(o=t.ipd)&&void 0!==o?o:qt.ipd,fovy:null!==(l=t.fovy)&&void 0!==l?l:qt.fovy,controllers:m,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:"visible",pendingVisibilityState:null,xrSystem:null,matrix:r(),globalSpace:h,viewerSpace:u,viewSpaces:p,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:r,height:n}=i;switch(t.eye){case Ge.None:return new Ot(0,0,r,n);case Ge.Left:return new Ot(0,0,this[V].stereoEnabled?r/2:r,n);case Ge.Right:return new Ot(r/2,0,this[V].stereoEnabled?r/2:0,n)}},updateViews:()=>{d(this[V].viewerSpace[ie].offsetMatrix,this[V].quaternion.quat,this[V].position.vec3),c(this[V].viewSpaces[Ge.Left][ie].offsetMatrix,g(-this[V].ipd/2,0,0)),c(this[V].viewSpaces[Ge.Right][ie].offsetMatrix,g(this[V].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;if(t.parentElement!==this[V].canvasContainer){const e=this[V].devui;if(e){const{devUICanvas:t,devUIContainer:i}=e;t.style.zIndex=3..toString(),i.style.zIndex=4..toString(),this[V].canvasContainer.appendChild(e.devUICanvas),this[V].canvasContainer.appendChild(e.devUIContainer)}const i=this[V].sem;i&&(i.environmentCanvas.style.zIndex=1..toString(),this[V].canvasContainer.appendChild(i.environmentCanvas)),this[V].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height,zIndex:t.style.zIndex},t.style.zIndex=2..toString(),this[V].canvasContainer.appendChild(t),document.body.appendChild(this[V].canvasContainer)}t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[V].canvasData){const{canvas:e,parent:t,width:i,height:r,zIndex:n}=this[V].canvasData;e.width=i,e.height=r,e.style.zIndex=n,t?t.appendChild(e):this[V].canvasContainer.removeChild(e);const s=this[V].devui;s&&(this[V].canvasContainer.removeChild(s.devUICanvas),this[V].canvasContainer.removeChild(s.devUIContainer));const a=this[V].sem;a&&this[V].canvasContainer.removeChild(a.environmentCanvas),document.body.removeChild(this[V].canvasContainer),this[V].canvasData=void 0,window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[V].actionPlayer)||void 0===t?void 0:t.playing)this[V].actionPlayer.playFrame();else{const t=e.session;this[V].updateViews(),this[V].pendingVisibilityState&&(this[V].visibilityState=this[V].pendingVisibilityState,this[V].pendingVisibilityState=null,t.dispatchEvent(new Ue("visibilitychange",{session:t}))),"visible"===this[V].visibilityState&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[V].pendingReferenceSpaceReset&&(t[Z].referenceSpaces.forEach((e=>{switch(e[te].type){case Be.Local:case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:e.dispatchEvent(new It("reset",{referenceSpace:e}))}})),this[V].pendingReferenceSpaceReset=!1)}this[V].updateViews()}},this[V].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[V].xrSystem=new Tt(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[V].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[V].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=Tt,e.XRSession=ot,e.XRRenderState=Qe,e.XRFrame=rt,e.XRSpace=oe,e.XRReferenceSpace=We,e.XRJointSpace=lt,e.XRView=Ke,e.XRViewport=Ot,e.XRRigidTransform=Ce,e.XRPose=$e,e.XRViewerPose=Ye,e.XRJointPose=Je,e.XRInputSource=Se,e.XRInputSourceArray=xe,e.XRHand=ct,e.XRLayer=Rt,e.XRWebGLLayer=Ft,e.XRSessionEvent=Ue,e.XRInputSourceEvent=ye,e.XRInputSourcesChangeEvent=He,e.XRReferenceSpaceEvent=It}installDevUI(e){this[V].devui=new e(this)}installSEM(e){this[V].sem=new e(this)}get supportedSessionModes(){return this[V].supportedSessionModes}get supportedFeatures(){return this[V].supportedFeatures}get supportedFrameRates(){return this[V].supportedFrameRates}get isSystemKeyboardSupported(){return this[V].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[V].internalNominalFrameRate}get stereoEnabled(){return this[V].stereoEnabled}set stereoEnabled(e){this[V].stereoEnabled=e}get ipd(){return this[V].ipd}set ipd(e){this[V].ipd=e}get fovy(){return this[V].fovy}set fovy(e){this[V].fovy=e}get position(){return this[V].position}get quaternion(){return this[V].quaternion}get viewerSpace(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.viewerSpace:this[V].viewerSpace}get viewSpaces(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.viewSpaces:this[V].viewSpaces}get controllers(){return this[V].controllers}get hands(){return this[V].hands}get primaryInputMode(){return this[V].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[V].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if("visible"!==this[V].visibilityState)return[];return("controller"===this[V].primaryInputMode?Object.values(this[V].controllers):Object.values(this[V].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[V].canvasContainer}get canvasDimensions(){if(this[V].canvasData){const{width:e,height:t}=this[V].canvasData.canvas;return{width:e,height:t}}}get activeSession(){var e;return null===(e=this[V].xrSystem)||void 0===e?void 0:e[_].activeSession}get sessionOffered(){var e;return Boolean(null===(e=this[V].xrSystem)||void 0===e?void 0:e[_].offeredSessionConfig)}get name(){return this[V].name}grantOfferedSession(){var e;const t=null===(e=this[V].xrSystem)||void 0===e?void 0:e[_];t&&t.offeredSessionConfig&&(t.grantSession(t.offeredSessionConfig),t.offeredSessionConfig=void 0)}recenter(){const e=new de(-this.position.x,0,-this.position.z),t=new de(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),r=(new he).setFromAxisAngle(new de(0,1,0),i);this.position.add(e),this.quaternion.multiply(r),[...Object.values(this[V].controllers),...Object.values(this[V].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(r),t.position.applyQuaternion(r)})),this[V].pendingReferenceSpaceReset=!0}get visibilityState(){return this[V].visibilityState}updateVisibilityState(e){if(!Object.values(["visible","visible-blurred","hidden"]).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[V].visibilityState&&(this[V].pendingVisibilityState=e)}createActionPlayer(e,t){return this[V].actionPlayer=new Pt(e,t,this[V].ipd),this[V].actionPlayer}get devui(){return this[V].devui}get sem(){return this[V].sem}},e.XRFrame=rt,e.XRHand=ct,e.XRInputSource=Se,e.XRInputSourceArray=xe,e.XRInputSourceEvent=ye,e.XRInputSourcesChangeEvent=He,e.XRJointPose=Je,e.XRJointSpace=lt,e.XRLayer=Rt,e.XRMesh=Re,e.XRMeshSet=Ee,e.XRPlane=Ie,e.XRPlaneSet=Te,e.XRPose=$e,e.XRRay=De,e.XRReferenceSpace=We,e.XRReferenceSpaceEvent=It,e.XRRenderState=Qe,e.XRRigidTransform=Ce,e.XRSession=ot,e.XRSessionEvent=Ue,e.XRSpace=oe,e.XRSystem=Tt,e.XRView=Ke,e.XRViewerPose=Ye,e.XRViewport=Ot,e.XRWebGLLayer=Ft,e.metaQuest2=Dt,e.metaQuest3=jt,e.metaQuestPro=Nt,e.oculusQuest1=Vt,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).IWER={})}(this,(function(e){"use strict";var t=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function r(){var e=new i(16);return i!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function n(e){var t=new i(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function s(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function a(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=t[5],c=t[6],l=t[7],d=t[8],h=t[9],u=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],x=i*o-r*a,S=i*c-n*a,y=i*l-s*a,w=r*c-n*o,b=r*l-s*o,M=n*l-s*c,R=d*m-h*f,E=d*g-u*f,F=d*v-p*f,P=h*g-u*m,A=h*v-p*m,I=u*v-p*g,T=x*I-S*A+y*P+w*F-b*E+M*R;return T?(T=1/T,e[0]=(o*I-c*A+l*P)*T,e[1]=(n*A-r*I-s*P)*T,e[2]=(m*M-g*b+v*w)*T,e[3]=(u*b-h*M-p*w)*T,e[4]=(c*F-a*I-l*E)*T,e[5]=(i*I-n*F+s*E)*T,e[6]=(g*y-f*M-v*S)*T,e[7]=(d*M-u*y+p*S)*T,e[8]=(a*A-o*F+l*R)*T,e[9]=(r*F-i*A-s*R)*T,e[10]=(f*b-m*y+v*x)*T,e[11]=(h*y-d*b-p*x)*T,e[12]=(o*E-a*P-c*R)*T,e[13]=(i*P-r*E+n*R)*T,e[14]=(m*S-f*w-g*x)*T,e[15]=(d*w-h*S+u*x)*T,e):null}function o(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],c=t[5],l=t[6],d=t[7],h=t[8],u=t[9],p=t[10],f=t[11],m=t[12],g=t[13],v=t[14],x=t[15],S=i[0],y=i[1],w=i[2],b=i[3];return e[0]=S*r+y*o+w*h+b*m,e[1]=S*n+y*c+w*u+b*g,e[2]=S*s+y*l+w*p+b*v,e[3]=S*a+y*d+w*f+b*x,S=i[4],y=i[5],w=i[6],b=i[7],e[4]=S*r+y*o+w*h+b*m,e[5]=S*n+y*c+w*u+b*g,e[6]=S*s+y*l+w*p+b*v,e[7]=S*a+y*d+w*f+b*x,S=i[8],y=i[9],w=i[10],b=i[11],e[8]=S*r+y*o+w*h+b*m,e[9]=S*n+y*c+w*u+b*g,e[10]=S*s+y*l+w*p+b*v,e[11]=S*a+y*d+w*f+b*x,S=i[12],y=i[13],w=i[14],b=i[15],e[12]=S*r+y*o+w*h+b*m,e[13]=S*n+y*c+w*u+b*g,e[14]=S*s+y*l+w*p+b*v,e[15]=S*a+y*d+w*f+b*x,e}function c(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function l(e,i,r){var n,s,a,o=r[0],c=r[1],l=r[2],d=Math.hypot(o,c,l);return d<t?null:(o*=d=1/d,c*=d,l*=d,n=Math.sin(i),a=1-(s=Math.cos(i)),e[0]=o*o*a+s,e[1]=c*o*a+l*n,e[2]=l*o*a-c*n,e[3]=0,e[4]=o*c*a-l*n,e[5]=c*c*a+s,e[6]=l*c*a+o*n,e[7]=0,e[8]=o*l*a+c*n,e[9]=c*l*a-o*n,e[10]=l*l*a+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function d(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=r+r,c=n+n,l=s+s,d=r*o,h=r*c,u=r*l,p=n*c,f=n*l,m=s*l,g=a*o,v=a*c,x=a*l;return e[0]=1-(p+m),e[1]=h+x,e[2]=u-v,e[3]=0,e[4]=h-x,e[5]=1-(d+m),e[6]=f+g,e[7]=0,e[8]=u+v,e[9]=f-g,e[10]=1-(d+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function h(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function u(e,t){var i=t[0],r=t[1],n=t[2],s=t[4],a=t[5],o=t[6],c=t[8],l=t[9],d=t[10];return e[0]=Math.hypot(i,r,n),e[1]=Math.hypot(s,a,o),e[2]=Math.hypot(c,l,d),e}function p(e,t){var r=new i(3);u(r,t);var n=1/r[0],s=1/r[1],a=1/r[2],o=t[0]*n,c=t[1]*s,l=t[2]*a,d=t[4]*n,h=t[5]*s,p=t[6]*a,f=t[8]*n,m=t[9]*s,g=t[10]*a,v=o+h+g,x=0;return v>0?(x=2*Math.sqrt(v+1),e[3]=.25*x,e[0]=(p-m)/x,e[1]=(f-l)/x,e[2]=(c-d)/x):o>h&&o>g?(x=2*Math.sqrt(1+o-h-g),e[3]=(p-m)/x,e[0]=.25*x,e[1]=(c+d)/x,e[2]=(f+l)/x):h>g?(x=2*Math.sqrt(1+h-o-g),e[3]=(f-l)/x,e[0]=(c+d)/x,e[1]=.25*x,e[2]=(p+m)/x):(x=2*Math.sqrt(1+g-o-h),e[3]=(c-d)/x,e[0]=(f+l)/x,e[1]=(p+m)/x,e[2]=.25*x),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var f=function(e,t,i,r,n){var s,a=1/Math.tan(t/2);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(s=1/(r-n),e[10]=(n+r)*s,e[14]=2*n*r*s):(e[10]=-1,e[14]=-2*r),e};function m(){var e=new i(3);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function g(e,t,r){var n=new i(3);return n[0]=e,n[1]=t,n[2]=r,n}function v(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function x(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function S(e,t){var i=t[0],r=t[1],n=t[2],s=i*i+r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function w(e,t,i){var r=t[0],n=t[1],s=t[2],a=i[0],o=i[1],c=i[2];return e[0]=n*c-s*o,e[1]=s*a-r*c,e[2]=r*o-n*a,e}function b(e,t,i,r){var n=t[0],s=t[1],a=t[2];return e[0]=n+r*(i[0]-n),e[1]=s+r*(i[1]-s),e[2]=a+r*(i[2]-a),e}function M(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function R(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function E(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*a,e[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*a,e[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*a,e[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*a,e}function F(){var e=new i(4);return i!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function P(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function A(e,i,r,n){var s,a,o,c,l,d=i[0],h=i[1],u=i[2],p=i[3],f=r[0],m=r[1],g=r[2],v=r[3];return(a=d*f+h*m+u*g+p*v)<0&&(a=-a,f=-f,m=-m,g=-g,v=-v),1-a>t?(s=Math.acos(a),o=Math.sin(s),c=Math.sin((1-n)*s)/o,l=Math.sin(n*s)/o):(c=1-n,l=n),e[0]=c*d+l*f,e[1]=c*h+l*m,e[2]=c*u+l*g,e[3]=c*p+l*v,e}m(),function(){var e=M()}();var I,T=function(e,t,r,n){var s=new i(4);return s[0]=e,s[1]=t,s[2]=r,s[3]=n,s},O=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},q=R,k=function(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=i*i+r*r+n*n+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=s*a,e};m(),g(1,0,0),g(0,1,0),F(),F(),I=new i(9),i!=Float32Array&&(I[1]=0,I[2]=0,I[3]=0,I[5]=0,I[6]=0,I[7]=0),I[0]=1,I[4]=1,I[8]=1;const L=Symbol("@iwer/action-player"),X=Symbol("@iwer/action-recorder"),z=Symbol("@iwer/xr-anchor"),C=Symbol("@iwer/xr-controller"),V=Symbol("@iwer/xr-device"),D=Symbol("@iwer/xr-hand-input"),N=Symbol("@iwer/xr-tracked-input"),j=Symbol("@iwer/xr-frame"),H=Symbol("@iwer/gamepad"),_=Symbol("@iwer/xr-system"),B=Symbol("@iwer/xr-input-source"),G=Symbol("@iwer/xr-webgl-layer"),W=Symbol("@iwer/xr-mesh"),Q=Symbol("@iwer/xr-plane"),U=Symbol("@iwer/xr-joint-pose"),K=Symbol("@iwer/xr-pose"),$=Symbol("@iwer/xr-viewer-pose"),J=Symbol("@iwer/xr-rigid-transform"),Y=Symbol("@iwer/xr-render-state"),Z=Symbol("@iwer/xr-session"),ee=Symbol("@iwer/xr-joint-space"),te=Symbol("@iwer/xr-reference-space"),ie=Symbol("@iwer/xr-space"),re=Symbol("@iwer/xr-view"),ne=Symbol("@iwer/xr-viewport"),se=Symbol("@iwer/xr-ray"),ae=Symbol("@iwer/xr-hit-test");class oe extends EventTarget{constructor(e,t){super(),this[ie]={parentSpace:e,offsetMatrix:t?n(t):r(),emulated:!0}}}class ce extends oe{constructor(){super(void 0,r())}}class le{static updateOffsetPosition(e,t){c(e[ie].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[ie].offsetMatrix,r=m();h(r,i),d(i,t,r)}static updateOffsetMatrix(e,t){s(e[ie].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,t=r()){return o(t,e[ie].parentSpace?le.calculateGlobalOffsetMatrix(e[ie].parentSpace):r(),e[ie].offsetMatrix),t}}class de{constructor(e=0,t=0,i=0){this.vec3=g(e,t,i),this.tempVec3=m()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return x(this.vec3,e,t,i),this}clone(){return new de(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return v(this.tempVec3,this.vec3),S(this.vec3,this.tempVec3),this}add(e){return v(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return v(this.tempVec3,this.vec3),function(e,t,i){var r=i[0],n=i[1],s=i[2],a=i[3],o=t[0],c=t[1],l=t[2],d=n*l-s*c,h=s*o-r*l,u=r*c-n*o,p=n*u-s*h,f=s*d-r*u,m=r*h-n*d,g=2*a;d*=g,h*=g,u*=g,p*=2,f*=2,m*=2,e[0]=o+d+p,e[1]=c+h+f,e[2]=l+u+m}(this.vec3,this.tempVec3,e.quat),this}}class he{constructor(e=0,t=0,i=0,r=1){this.quat=T(e,t,i,r),this.tempQuat=F()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,r){return q(this.quat,e,t,i,r),this}clone(){return new he(this.x,this.y,this.z,this.w)}copy(e){return q(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return O(this.tempQuat,this.quat),k(this.quat,this.tempQuat),this}invert(){return O(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return O(this.tempQuat,this.quat),function(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=i[0],c=i[1],l=i[2],d=i[3];e[0]=r*d+a*o+n*l-s*c,e[1]=n*d+a*c+s*o-r*l,e[2]=s*d+a*l+r*c-n*o,e[3]=a*d-r*o-n*c-s*l}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return P(this.quat,e.vec3,t),this}}var ue,pe,fe;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(ue||(ue={}));class me{constructor(e,t){this[H]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[H].type?this[H].pressed:this[H].value>0}get touched(){return"manual"===this[H].type?this[H].touched:this[H].touched||this.pressed}get value(){return this[H].value}}class ge{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ve{constructor(e,t="",i=-1){this[H]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[H].buttonsSequence.push(null):(this[H].buttonsSequence.push(e.id),this[H].buttonsMap[e.id]=new me(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[H].axesSequence.push(null):(this[H].axesSequence.push(e.id+e.type),this[H].axesMap[e.id]||(this[H].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[H].id}get index(){return this[H].index}get connected(){return this[H].connected}get timestamp(){return this[H].timestamp}get mapping(){return this[H].mapping}get axes(){const e=[];return this[H].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),r=t.substring(t.length-6);e.push("y-axis"===r?this[H].axesMap[i].y:this[H].axesMap[i].x)}})),e}get buttons(){return this[H].buttonsSequence.map((e=>null===e?new ge:this[H].buttonsMap[e]))}get hapticActuators(){return this[H].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(pe||(pe={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(fe||(fe={}));class xe extends Array{}class Se{constructor(e,t,i,r,n,s,a){this[B]={handedness:e,targetRayMode:t,targetRaySpace:r,gripSpace:s,profiles:i,gamepad:n,hand:a}}get handedness(){return this[B].handedness}get targetRayMode(){return this[B].targetRayMode}get targetRaySpace(){return this[B].targetRaySpace}get gripSpace(){return this[B].gripSpace}get profiles(){return this[B].profiles}get gamepad(){return this[B].gamepad}get hand(){return this[B].hand}}class ye extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const we={[pe.Left]:{position:new de(-.25,1.5,-.4),quaternion:new he},[pe.Right]:{position:new de(.25,1.5,-.4),quaternion:new he},[pe.None]:{position:new de(.25,1.5,-.4),quaternion:new he}};class be{constructor(e){this[N]={inputSource:e,position:we[e.handedness].position.clone(),quaternion:we[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[N].position}get quaternion(){return this[N].quaternion}get inputSource(){return this[N].inputSource}get connected(){return this[N].connected}set connected(e){this[N].connected=e,this[N].inputSource.gamepad[H].connected=e}onFrameStart(e){d(this[N].inputSource.targetRaySpace[ie].offsetMatrix,this[N].quaternion.quat,this[N].position.vec3);const t=e.session;this[N].inputSource.gamepad.buttons.forEach((i=>{i instanceof me&&(i[H].lastFrameValue=i[H].value,null!=i[H].pendingValue&&(i[H].value=i[H].pendingValue,i[H].pendingValue=null),null!=i[H].eventTrigger&&(0===i[H].lastFrameValue&&i[H].value>0?(t.dispatchEvent(new ye(i[H].eventTrigger,{frame:e,inputSource:this[N].inputSource})),t.dispatchEvent(new ye(i[H].eventTrigger+"start",{frame:e,inputSource:this[N].inputSource}))):i[H].lastFrameValue>0&&0===i[H].value&&t.dispatchEvent(new ye(i[H].eventTrigger+"end",{frame:e,inputSource:this[N].inputSource}))))})),this[N].inputSourceChanged=this.connected!==this[N].lastFrameConnected,this[N].lastFrameConnected=this.connected}}class Me extends be{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const r=new oe(i),n=e.layout[t].gripOffsetMatrix?new oe(r,e.layout[t].gripOffsetMatrix):void 0,s=[e.profileId,...e.fallbackProfileIds];super(new Se(t,fe.TrackedPointer,s,r,new ve(e.layout[t].gamepad),n)),this[C]={profileId:e.profileId,gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[C].gamepadConfig}get profileId(){return this[C].profileId}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[N].inputSource.gamepad[H].buttonsMap[e];if(i){if("binary"===i[H].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[H].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[N].inputSource.gamepad[H].buttonsMap[e];i?i[H].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const r=this[N].inputSource.gamepad[H].axesMap[e];r?"x-axis"===t?r.x=i:"y-axis"===t&&(r.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const r=this[N].inputSource.gamepad[H].axesMap[e];r?(r.x=t,r.y=i):console.warn(`Current controller does not have ${e} axes.`)}}class Re{constructor(e,t,i,r,n){this[W]={nativeMesh:e,frame:void 0,meshSpace:t,vertices:i,indices:r,lastChangedTime:performance.now(),semanticLabel:n}}get meshSpace(){return this[W].meshSpace}get vertices(){return this[W].vertices}get indices(){return this[W].indices}get lastChangedTime(){return this[W].lastChangedTime}get semanticLabel(){return this[W].semanticLabel}}class Ee extends Set{}var Fe,Pe;e.XRSemanticLabels=void 0,(Fe=e.XRSemanticLabels||(e.XRSemanticLabels={})).Desk="desk",Fe.Couch="couch",Fe.Floor="floor",Fe.Ceiling="ceiling",Fe.Wall="wall",Fe.Door="door",Fe.Window="window",Fe.Table="table",Fe.Shelf="shelf",Fe.Bed="bed",Fe.Screen="screen",Fe.Lamp="lamp",Fe.Plant="plant",Fe.WallArt="wall art",Fe.GlobalMesh="global mesh",Fe.Other="other",function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Pe||(Pe={}));const Ae={[e.XRSemanticLabels.Desk]:Pe.Horizontal,[e.XRSemanticLabels.Couch]:Pe.Horizontal,[e.XRSemanticLabels.Floor]:Pe.Horizontal,[e.XRSemanticLabels.Ceiling]:Pe.Horizontal,[e.XRSemanticLabels.Wall]:Pe.Vertical,[e.XRSemanticLabels.Door]:Pe.Vertical,[e.XRSemanticLabels.Window]:Pe.Vertical,[e.XRSemanticLabels.Table]:Pe.Horizontal,[e.XRSemanticLabels.Shelf]:Pe.Horizontal,[e.XRSemanticLabels.Bed]:Pe.Horizontal,[e.XRSemanticLabels.Screen]:Pe.Horizontal,[e.XRSemanticLabels.Lamp]:Pe.Horizontal,[e.XRSemanticLabels.Plant]:Pe.Horizontal,[e.XRSemanticLabels.WallArt]:Pe.Vertical};class Ie{constructor(e,t,i,r){this[Q]={nativePlane:e,frame:void 0,planeSpace:t,polygon:i,lastChangedTime:performance.now(),semanticLabel:r,orientation:r?Ae[r]:void 0}}get planeSpace(){return this[Q].planeSpace}get polygon(){return this[Q].polygon}get orientation(){return this[Q].orientation}get lastChangedTime(){return this[Q].lastChangedTime}get semanticLabel(){return this[Q].semanticLabel}}class Te extends Set{}class Oe{constructor(e,t){this[z]={anchorSpace:e,session:t,deleted:!1},t[Z].trackedAnchors.add(this)}get anchorSpace(){if(this[z].deleted)throw new DOMException("XRAnchor has already been deleted.","InvalidStateError");return this[z].anchorSpace}requestPersistentHandle(){return new Promise(((e,t)=>{if(this[z].deleted)t(new DOMException("XRAnchor has already been deleted.","InvalidStateError"));else{const t=this[z].session[Z].persistentAnchors;for(const[i,r]of t.entries())if(r===this)return void e(i);const i=crypto.randomUUID();Le.createPersistentAnchor(this[z].session,this,i),e(i)}}))}delete(){this[z].deleted||(this[z].anchorSpace=null,this[z].deleted=!0,this[z].session[Z].trackedAnchors.delete(this))}}class qe extends Set{}const ke="@immersive-web-emulation-runtime/persistent-anchors";class Le{static recoverPersistentAnchorsFromStorage(e){const t=JSON.parse(localStorage.getItem(ke)||"{}");Object.entries(t).forEach((([t,i])=>{const r=e[Z].device[V].globalSpace,n=new oe(r,i),s=new Oe(n,e);e[Z].persistentAnchors.set(t,s)}))}static createPersistentAnchor(e,t,i){e[Z].trackedAnchors.add(t),e[Z].persistentAnchors.set(i,t);const r=JSON.parse(localStorage.getItem(ke)||"{}");r[i]=Array.from(t[z].anchorSpace[ie].offsetMatrix),localStorage.setItem(ke,JSON.stringify(r))}}class Xe{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r,Object.freeze(this)}static fromPoint(e){return new Xe(e.x,e.y,e.z,e.w)}matrixTransform(e){return new Xe}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const ze=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:Xe;class Ce{constructor(e,t){const i=g(0,0,0),n=F();this[J]={matrix:r(),position:e?g(e.x,e.y,e.z):i,orientation:t?k(F(),T(t.x,t.y,t.z,t.w)):n,inverse:null},this.updateMatrix()}updateMatrix(){d(this[J].matrix,this[J].orientation,this[J].position)}get matrix(){return this[J].matrix}get position(){const e=this[J].position;return new ze(e[0],e[1],e[2],1)}get orientation(){const e=this[J].orientation;return new ze(e[0],e[1],e[2],e[3])}get inverse(){if(!this[J].inverse){const e=r();if(!a(e,this[J].matrix))throw new Error("Matrix is not invertible.");let t=m();h(t,e);let i=F();p(i,e),this[J].inverse=new Ce(new ze(t[0],t[1],t[2],1),new ze(i[0],i[1],i[2],i[3])),this[J].inverse[J].inverse=this}return this[J].inverse}}class Ve{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}}class De{constructor(e,t){const i={x:0,y:0,z:0,w:1},r={x:0,y:0,z:-1,w:0};if(e instanceof Ce){const t=e.matrix,n=R(M(),i.x,i.y,i.z,i.w),s=R(M(),r.x,r.y,r.z,r.w);E(n,n,t),E(s,s,t),i.x=n[0],i.y=n[1],i.z=n[2],i.w=n[3],r.x=s[0],r.y=s[1],r.z=s[2],r.w=s[3]}else if(e&&(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w),t){if(0===t.x&&0===t.y&&0===t.z||1!==t.w)throw new DOMException("Invalid direction value to construct XRRay","TypeError");r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w}const n=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z)||1;r.x=r.x/n,r.y=r.y/n,r.z=r.z/n,this[se]={origin:new Ve(i.x,i.y,i.z,i.w),direction:new Ve(r.x,r.y,r.z,r.w),matrix:null}}get origin(){return this[se].origin}get direction(){return this[se].direction}get matrix(){if(this[se].matrix)return this[se].matrix;const e=x(m(),0,0,-1),t=x(m(),this[se].origin.x,this[se].origin.y,this[se].origin.z),i=x(m(),this[se].direction.x,this[se].direction.y,this[se].direction.z),n=w(m(),i,e),s=y(i,e),a=r();s>-1&&s<1?l(a,Math.acos(s),n):-1===s?l(a,Math.acos(s),x(m(),1,0,0)):function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(a);const d=c(r(),t),h=o(r(),d,a);return this[se].matrix=new Float32Array(h),this[se].matrix}}class Ne{constructor(e,t){var i;this[ae]={session:e,space:t.space,offsetRay:null!==(i=t.offsetRay)&&void 0!==i?i:new De}}cancel(){this[ae].session[Z].hitTestSources.delete(this)}}class je{constructor(e,t){this[ae]={frame:e,offsetSpace:t}}getPose(e){return this[ae].frame.getPose(this[ae].offsetSpace,e)}createAnchor(){return this[ae].frame.createAnchor(new Ce,this[ae].offsetSpace)}}class He extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var _e,Be,Ge;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(Be||(Be={}));class We extends oe{constructor(e,t,i){super(t,i),this[_e]={type:null,onreset:()=>{}},this[te].type=e}get onreset(){var e;return null!==(e=this[te].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[te].onreset&&this.removeEventListener("reset",this[te].onreset),this[te].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new We(this[te].type,this,e)}}_e=te;class Qe{constructor(e={},t){this[Y]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[Y].depthNear}get depthFar(){return this[Y].depthFar}get inlineVerticalFieldOfView(){return this[Y].inlineVerticalFieldOfView}get baseLayer(){return this[Y].baseLayer}}class Ue extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}!function(e){e.None="none",e.Left="left",e.Right="right"}(Ge||(Ge={}));class Ke{constructor(e,t,i,r){this[re]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:r}}get eye(){return this[re].eye}get projectionMatrix(){return this[re].projectionMatrix}get transform(){return this[re].transform}get recommendedViewportScale(){return this[re].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[re].requestedViewportScale=e}}class $e{constructor(e,t=!1,i=void 0,r=void 0){this[K]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:r}}get transform(){return this[K].transform}get emulatedPosition(){return this[K].emulatedPosition}get linearVelocity(){return this[K].linearVelocity}get angularVelocity(){return this[K].angularVelocity}}class Je extends $e{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[U]={radius:t}}get radius(){return this[U].radius}}class Ye extends $e{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[$]={views:Object.freeze(t)}}get views(){return this[$].views}}const Ze=r(),et=r(),tt=r(),it=(e,t,i)=>{le.calculateGlobalOffsetMatrix(t,Ze),le.calculateGlobalOffsetMatrix(i,et),a(tt,et),o(e,tt,Ze)};class rt{constructor(e,t,i,n,s){this[j]={session:e,id:t,active:i,animationFrame:n,predictedDisplayTime:s,tempMat4:r(),detectedPlanes:new Te,detectedMeshes:new Ee,trackedAnchors:e[Z].frameTrackedAnchors,hitTestResultsMap:new Map}}get session(){return this[j].session}get predictedDisplayTime(){return this[j].predictedDisplayTime}getPose(e,t){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");it(this[j].tempMat4,e,t);const i=m();h(i,this[j].tempMat4);const r=F();return p(r,this[j].tempMat4),new $e(new Ce({x:i[0],y:i[1],z:i[2],w:1},{x:r[0],y:r[1],z:r[2],w:r[3]}),e[ie].emulated)}getViewerPose(e){if(!this[j].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[j].session,i=t[Z].device,r=this.getPose(i.viewerSpace,e),n="inline"===t[Z].mode?[Ge.None]:[Ge.Left,Ge.Right],s=[];return n.forEach((r=>{const n=i.viewSpaces[r],a=this.getPose(n,e),o=t[Z].getProjectionMatrix(r),c=new Ke(r,new Float32Array(o),a.transform,t);s.push(c)})),new Ye(r.transform,s,!1)}getJointPose(e,t){const i=this.getPose(e,t),r=e[ee].radius;return new Je(i.transform,r,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let r=0;r<e.length;r++)e[r][ee].radius?t[r]=e[r][ee].radius:(t[r]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,r)=>{it(this[j].tempMat4,e,t);for(let e=0;e<16;e++)i[16*r+e]=this[j].tempMat4[e]})),!0}get detectedPlanes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedPlanes}get detectedMeshes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedMeshes}get trackedAnchors(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].trackedAnchors}createAnchor(e,t){return new Promise(((i,r)=>{if(this[j].active){const n=this[j].session[Z].device[V].globalSpace,s=new oe(t,e.matrix),a=le.calculateGlobalOffsetMatrix(s),o=new oe(n,a),c=new Oe(o,this[j].session);this[j].session[Z].trackedAnchors.add(c),this[j].session[Z].newAnchors.set(c,{resolve:i,reject:r})}else r(new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError"))}))}getHitTestResults(e){if(this[j].active){if(this[j].hitTestResultsMap.has(e))return[...this[j].hitTestResultsMap.get(e)];throw new DOMException("Requested hit test results are not available for current frame.","InvalidStateError")}throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError")}}var nt,st,at;!function(e){e.Opaque="opaque",e.AlphaBlend="alpha-blend",e.Additive="additive"}(nt||(nt={})),function(e){e.ScreenSpace="screen-space",e.WorldSpace="world-space"}(st||(st={}));class ot extends EventTarget{constructor(e,t,i){super(),this[Z]={device:e,mode:t,renderState:new Qe,pendingRenderState:null,enabledFeatures:i,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[Ge.Left]:r(),[Ge.Right]:r(),[Ge.None]:r()},getProjectionMatrix:e=>this[Z].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[Z].enabledFeatures.includes(e))return!1;switch(e){case Be.Viewer:return!0;case Be.Local:case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:return"inline"!=this[Z].mode}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[Z].ended)return;this[Z].deviceFrameHandle=globalThis.requestAnimationFrame(this[Z].onDeviceFrame),null!=this[Z].pendingRenderState&&(this[Z].renderState=this[Z].pendingRenderState,this[Z].pendingRenderState=null,this[Z].device[V].onBaseLayerSet(this[Z].renderState.baseLayer));const e=this[Z].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if("inline"!=this[Z].mode){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),r=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(r)}const{depthNear:r,depthFar:n}=this[Z].renderState,{width:a,height:o}=i;if("inline"!==this[Z].mode){const e=a*(this[Z].device.stereoEnabled?.5:1)/o;f(this[Z].projectionMatrices[Ge.Left],this[Z].device.fovy,e,r,n),s(this[Z].projectionMatrices[Ge.Right],this[Z].projectionMatrices[Ge.Left])}else{const e=a/o;f(this[Z].projectionMatrices[Ge.None],this[Z].renderState.inlineVerticalFieldOfView,e,r,n)}const c=new rt(this,this[Z].frameHandle,!0,!0,performance.now()),l=performance.now(),d=this[Z].device[V].devui;if(d&&d.render(l),"immersive-ar"===this[Z].mode){const e=this[Z].device[V].sem;e&&e.render(l)}this[Z].enabledFeatures.includes("anchors")&&this[Z].updateTrackedAnchors(),this[Z].enabledFeatures.includes("plane-detection")&&this[Z].updateTrackedPlanes(c),this[Z].enabledFeatures.includes("mesh-detection")&&this[Z].updateTrackedMeshes(c),this[Z].enabledFeatures.includes("hit-test")&&this[Z].computeHitTestResults(c),this[Z].device[V].onFrameStart(c),this[Z].updateActiveInputSources();const h=this[Z].currentFrameCallbacks=this[Z].frameCallbacks;this[Z].frameCallbacks=[];const u=performance.now();for(let e=0;e<h.length;e++)try{h[e].cancelled||h[e].callback(u,c)}catch(e){console.error(e)}this[Z].currentFrameCallbacks=null,c[j].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[Z].enabledFeatures.includes("hand-tracking"),t=this[Z].activeInputSources,i=this[Z].device.inputSources.filter((t=>!t.hand||e)),r=i.filter((e=>!t.includes(e))),n=t.filter((e=>!i.includes(e)));this[Z].activeInputSources=i,(r.length>0||n.length>0)&&this.dispatchEvent(new He("inputsourceschange",{session:this,added:r,removed:n}))},trackedAnchors:new qe,persistentAnchors:new Map,newAnchors:new Map,frameTrackedAnchors:new qe,updateTrackedAnchors:()=>{this[Z].enabledFeatures.includes("anchors")&&(this[Z].frameTrackedAnchors.clear(),Array.from(this[Z].trackedAnchors).forEach((e=>{if(e[z].deleted){if(this[Z].trackedAnchors.delete(e),this[Z].newAnchors.has(e)){const{reject:t}=this[Z].newAnchors.get(e);t(new DOMException("Anchor is no longer tracked","InvalidStateError"))}}else if(this[Z].frameTrackedAnchors.add(e),this[Z].newAnchors.has(e)){const{resolve:t}=this[Z].newAnchors.get(e);t(e),this[Z].newAnchors.delete(e)}})))},trackedPlanes:new Map,updateTrackedPlanes:e=>{const t=this[Z].device[V].sem;if(!t)return;Array.from(this[Z].trackedPlanes.keys()).forEach((e=>{t.trackedPlanes.has(e)||this[Z].trackedPlanes.delete(e)})),t.trackedPlanes.forEach((t=>{let i=this[Z].trackedPlanes.get(t);if(!i){const e=new oe(this[Z].device[V].globalSpace,t.transform.matrix);i=new Ie(t,e,t.polygon,t.semanticLabel),this[Z].trackedPlanes.set(t,i)}i[Q].lastChangedTime=e.predictedDisplayTime,i[Q].frame=e,e[j].detectedPlanes.add(i)}))},trackedMeshes:new Map,updateTrackedMeshes:e=>{const t=this[Z].device[V].sem;if(!t)return;Array.from(this[Z].trackedMeshes.keys()).forEach((e=>{t.trackedMeshes.has(e)||this[Z].trackedMeshes.delete(e)})),t.trackedMeshes.forEach((t=>{let i=this[Z].trackedMeshes.get(t);if(!i){const e=new oe(this[Z].device[V].globalSpace,t.transform.matrix);i=new Re(t,e,t.vertices,t.indices,t.semanticLabel),this[Z].trackedMeshes.set(t,i)}i[W].lastChangedTime=e.predictedDisplayTime,i[W].frame=e,e[j].detectedMeshes.add(i)}))},hitTestSources:new Set,computeHitTestResults:e=>{const t=this[Z].device[V].sem;if(!t)return;const i=this[Z].device[V].globalSpace;this[Z].hitTestSources.forEach((n=>{const s=n[ae].space,a=le.calculateGlobalOffsetMatrix(s),c=n[ae].offsetRay.matrix,l=r();o(l,a,c);const d=[];t.computeHitTestResults(l).forEach((t=>{const r=new oe(i,t),n=new je(e,r);d.push(n)})),e[j].hitTestResultsMap.set(n,d)}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},Le.recoverPersistentAnchorsFromStorage(this),this[Z].onDeviceFrame()}get visibilityState(){return this[Z].device.visibilityState}get frameRate(){return this[Z].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[Z].device.supportedFrameRates)}get renderState(){return this[Z].renderState}get inputSources(){return this[Z].inputSourceArray.length=0,this[Z].ended||"inline"===this[Z].mode||this[Z].inputSourceArray.push(...this[Z].activeInputSources),this[Z].inputSourceArray}get enabledFeatures(){return this[Z].enabledFeatures}get isSystemKeyboardSupported(){return this[Z].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[Z].device[V].environmentBlendModes[this[Z].mode])&&void 0!==e?e:nt.Opaque}get interactionMode(){return this[Z].device[V].interactionMode}updateRenderState(e={}){var t,i,r,n;if(this[Z].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[G].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&"inline"!==this[Z].mode)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:e.baseLayer||(null===(t=this[Z].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[Z].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(r=this[Z].pendingRenderState)||void 0===r?void 0:r.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(n=this[Z].pendingRenderState)||void 0===n?void 0:n.inlineVerticalFieldOfView)||void 0};this[Z].pendingRenderState=new Qe(s,this[Z].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[Z].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[Z].device.supportedFrameRates.includes(e)?(this[Z].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[Z].nominalFrameRate=e,this.dispatchEvent(new Ue("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[Z].ended||!this[Z].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let r;switch(e){case Be.Viewer:r=this[Z].device.viewerSpace;break;case Be.Local:r=new We(e,this[Z].device[V].globalSpace,this[Z].device.viewerSpace[ie].offsetMatrix);break;case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:r=new We(e,this[Z].device[V].globalSpace)}this[Z].referenceSpaces.push(r),t(r)}))}requestAnimationFrame(e){if(this[Z].ended)return 0;const t=++this[Z].frameHandle;return this[Z].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[Z].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[Z].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[Z].ended||null===this[Z].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[Z].deviceFrameHandle),this[Z].device[V].onSessionEnd(),this.dispatchEvent(new Ue("end",{session:this})),e())}))}get persistentAnchors(){return Array.from(this[Z].persistentAnchors.keys())}restorePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Z].persistentAnchors.has(e))if(this[Z].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else{const r=this[Z].persistentAnchors.get(e);this[Z].newAnchors.has(r)?i(new DOMException(`Multiple concurrent attempts detected to restore the anchor with UUID: ${e}.`,"InvalidStateError")):(this[Z].trackedAnchors.add(r),this[Z].newAnchors.set(r,{resolve:t,reject:i}))}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}deletePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Z].persistentAnchors.has(e)){const i=this[Z].persistentAnchors.get(e);this[Z].persistentAnchors.delete(e),i.delete(),t(void 0)}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}requestHitTestSource(e){return new Promise(((t,i)=>{if(this[Z].enabledFeatures.includes("hit-test"))if(this[Z].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else if(this[Z].device[V].sem){const i=new Ne(this,e);this[Z].hitTestSources.add(i),t(i)}else i(new DOMException("Synthethic Environment Module required for emulating hit-test","OperationError"));else i(new DOMException('WebXR feature "hit-test" is not supported by current session',"NotSupportedError"))}))}get onend(){var e;return null!==(e=this[Z].onend)&&void 0!==e?e:()=>{}}set onend(e){this[Z].onend&&this.removeEventListener("end",this[Z].onend),this[Z].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[Z].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[Z].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[Z].oninputsourceschange),this[Z].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[Z].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[Z].onselect&&this.removeEventListener("select",this[Z].onselect),this[Z].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[Z].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[Z].onselectstart&&this.removeEventListener("selectstart",this[Z].onselectstart),this[Z].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[Z].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[Z].onselectend&&this.removeEventListener("selectend",this[Z].onselectend),this[Z].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[Z].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[Z].onsqueeze&&this.removeEventListener("squeeze",this[Z].onsqueeze),this[Z].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[Z].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[Z].onsqueezestart&&this.removeEventListener("squeezestart",this[Z].onsqueezestart),this[Z].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[Z].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[Z].onsqueezeend&&this.removeEventListener("squeezeend",this[Z].onsqueezeend),this[Z].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[Z].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[Z].onvisibilitychange&&this.removeEventListener("visibilitychange",this[Z].onvisibilitychange),this[Z].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[Z].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[Z].onframeratechange&&this.removeEventListener("frameratechange",this[Z].onframeratechange),this[Z].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(at||(at={}));class ct extends Map{}class lt extends oe{constructor(e,t,i){super(t,i),this[ee]={jointName:e,radius:0}}get jointName(){return this[ee].jointName}}const dt={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},ht={mapping:ue.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},ut=m(),pt=F(),ft=m(),mt=m(),gt=F(),vt=m(),xt=m(),St=F(),yt=m(),wt=(e,t,i,r)=>(h(ut,t),p(pt,t),u(ft,t),h(mt,i),p(gt,i),u(vt,i),b(xt,ut,mt,r),A(St,pt,gt,r),b(yt,ft,vt,r),function(e,t,i,r){var n=t[0],s=t[1],a=t[2],o=t[3],c=n+n,l=s+s,d=a+a,h=n*c,u=n*l,p=n*d,f=s*l,m=s*d,g=a*d,v=o*c,x=o*l,S=o*d,y=r[0],w=r[1],b=r[2];e[0]=(1-(f+g))*y,e[1]=(u+S)*y,e[2]=(p-x)*y,e[3]=0,e[4]=(u-S)*w,e[5]=(1-(h+g))*w,e[6]=(m+v)*w,e[7]=0,e[8]=(p+x)*b,e[9]=(m-v)*b,e[10]=(1-(h+f))*b,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,St,xt,yt),e),bt=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1];class Mt extends be{constructor(e,t,i){if(t!==pe.Left&&t!==pe.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const r=new oe(i),n=new oe(r),s=[e.profileId,...e.fallbackProfileIds],a=new ct;Object.values(at).forEach((e=>{a.set(e,new lt(e,r))}));super(new Se(t,fe.TrackedPointer,s,r,new ve(ht),n,a)),this[D]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[D].poseId}set poseId(e){this[D].poses[e]?this[D].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[D].poses[this[D].poseId],t=this[D].poses.pinch;Object.values(at).forEach((i=>{const r=e.jointTransforms[i].offsetMatrix,n=t.jointTransforms[i].offsetMatrix,s=this.inputSource.hand.get(i);wt(s[ie].offsetMatrix,r,n,this.pinchValue),this.inputSource.handedness===pe.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=bt[t]})(s[ie].offsetMatrix),s[ee].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&wt(this.inputSource.gripSpace[ie].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[N].inputSource.gamepad[H].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[N].inputSource.gamepad[H].buttonsMap.pinch[H].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}class Rt extends EventTarget{}const Et={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class Ft extends Rt{constructor(e,t,i={}){if(super(),e[Z].ended)throw new DOMException("Session has ended","InvalidStateError");const r={...Et,...i};this[G]={session:e,context:t,antialias:r.antialias}}get context(){return this[G].context}get antialias(){return this[G].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[G].context.drawingBufferWidth}get framebufferHeight(){return this[G].context.drawingBufferHeight}getViewport(e){if(e[re].session!==this[G].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[G].session[Z].device[V].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof ot))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[Z].ended?0:1}}class Pt{constructor(e,t,i){const{schema:r,frames:n}=t;if(!n||!r||0===n.length)throw new DOMException("wrong recording format","NotSupportedError");const s=new We(Be.Viewer,e),a={[Ge.Left]:new oe(s),[Ge.Right]:new oe(s),[Ge.None]:new oe(s)};this[L]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:n,recordedFramePointer:0,startingTimeStamp:n[0][0],endingTimeStamp:n[n.length-1][0],playbackTime:n[0][0],playing:!1,viewerSpace:s,viewSpaces:a,vec3:m(),quat:F()},c(this[L].viewSpaces[Ge.Left][ie].offsetMatrix,g(-i/2,0,0)),c(this[L].viewSpaces[Ge.Right][ie].offsetMatrix,g(i/2,0,0)),r.forEach((t=>{const i=t[0],r=t[1];let n;if(r.hasGamepad){const e=[];for(let t=0;t<r.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<r.numAxes;e++)t.push({id:e.toString(),type:"manual"});n=new ve({mapping:r.mapping,buttons:e,axes:t})}const s=new oe(e);let a;r.hasHand&&(a=new ct,Object.values(at).forEach((e=>{a.set(e,new lt(e,s))})));const o=new Se(r.handedness,r.targetRayMode,r.profiles,s,n,r.hasGrip?new oe(e):void 0,r.hasHand?a:void 0);this[L].inputSources.set(i,{active:!1,source:o}),this[L].inputSchemas.set(i,r)}))}play(){this[L].recordedFramePointer=0,this[L].playbackTime=this[L].startingTimeStamp,this[L].playing=!0,this[L].actualTimeStamp=performance.now()}stop(){this[L].playing=!1}get playing(){return this[L].playing}get viewerSpace(){return this[L].viewerSpace}get viewSpaces(){return this[L].viewSpaces}get inputSources(){return Array.from(this[L].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[L].actualTimeStamp;if(this[L].actualTimeStamp=e,this[L].playbackTime+=t,this[L].playbackTime>this[L].endingTimeStamp)return void this.stop();for(;this[L].frames[this[L].recordedFramePointer+1][0]<this[L].playbackTime;)this[L].recordedFramePointer++;const i=this[L].frames[this[L].recordedFramePointer],r=this[L].frames[this[L].recordedFramePointer+1],n=(this[L].playbackTime-i[0])/(r[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[L].viewerSpace,i.slice(1,8),r.slice(1,8),n);const s=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:r}=this.processRawInputData(i[e]);s.set(t,r)}const a=new Map;for(let e=8;e<r.length;e++){const{index:t,inputData:i}=this.processRawInputData(r[e]);a.set(t,i)}this[L].inputSources.forEach((e=>{e.active=!1})),a.forEach(((e,t)=>{this[L].inputSources.get(t).active=!0;const i=this[L].inputSources.get(t).source,r=this[L].inputSchemas.get(t);this.updateInputSource(i,r,s.has(t)?s.get(t):e,e,n)}))}updateInputSource(e,t,i,r,n){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,r.targetRayTransform,n),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,r.gripTransform,n),t.hasHand)for(let s=0;s<25;s++){const a=i.handTransforms.slice(8*s,8*s+7),o=r.handTransforms.slice(8*s,8*s+7),c=i.handTransforms[8*s+7],l=r.handTransforms[8*s+7],d=e.hand.get(t.jointSequence[s]);this.updateXRSpaceFromMergedFrames(d,a,o,n),d[ee].radius=(l-c)*n+c}if(t.hasGamepad){const t=e.gamepad;r.buttons.forEach(((e,r)=>{const s=t.buttons[r];s[H].pressed=1===e[0],s[H].touched=1===e[1];const a=i.buttons[r][2],o=e[2];s[H].value=(o-a)*n+a})),r.axes.forEach(((e,r)=>{const s=i.axes[r];t[H].axesMap[r.toString()].x=(e-s)*n+s}))}}updateXRSpaceFromMergedFrames(e,t,i,r){const n=g(t[0],t[1],t[2]),s=T(t[3],t[4],t[5],t[6]),a=g(i[0],i[1],i[2]),o=T(i[3],i[4],i[5],i[6]);b(this[L].vec3,n,a,r),A(this[L].quat,s,o,r),d(e[ie].offsetMatrix,this[L].quat,this[L].vec3)}processRawInputData(e){const t=e[0],i=this[L].inputSchemas.get(t),r={targetRayTransform:e.slice(1,8)};let n=8;if(i.hasGrip&&(r.gripTransform=e[n++]),i.hasHand&&(r.handTransforms=e[n++]),i.hasGamepad){const t=e[n];r.buttons=t.slice(0,i.numButtons),r.axes=t.slice(i.numButtons)}return{index:t,inputData:r}}}const At="2.0.1";class It extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}class Tt extends EventTarget{constructor(e){super(),this[_]={device:e,grantSession:({resolve:e,reject:t,mode:i,options:r})=>{if(this[_].activeSession)return void t(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:n=[],optionalFeatures:s=[]}=r,{supportedFeatures:a}=this[_].device;if(!n.every((e=>a.includes(e))))return void t(new Error("One or more required features are not supported by the device."));const o=s.filter((e=>a.includes(e))),c=Array.from(new Set([...n,...o,"viewer","local"])),l=new ot(this[_].device,i,c);this[_].activeSession=l,l.addEventListener("end",(()=>{this[_].activeSession=void 0})),e(l)}}}isSessionSupported(e){return new Promise(((t,i)=>{t("inline"===e||this[_].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{if(!n)return void r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));const s={resolve:i,reject:r,mode:e,options:t};this[_].grantSession(s)})).catch(r)}))}offerSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{n?this[_].offeredSessionConfig={resolve:i,reject:r,mode:e,options:t}:r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"))})).catch(r)}))}}class Ot{constructor(e,t,i,r){this[ne]={x:e,y:t,width:i,height:r}}get x(){return this[ne].x}get y(){return this[ne].y}get width(){return this[ne].width}get height(){return this[ne].height}}const qt={ipd:.063,fovy:Math.PI/2,headsetPosition:new de(0,1.6,0),headsetQuaternion:new he,stereoEnabled:!1};const kt={mapping:ue.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Lt={mapping:ue.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Xt={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},zt={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},Ct={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},Vt={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:kt,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:Lt,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","hand-tracking"],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Dt={name:"Meta Quest 2",controllerConfig:Xt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Nt={name:"Meta Quest Pro",controllerConfig:zt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},jt={name:"Meta Quest 3",controllerConfig:Ct,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking","depth-sensing"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":nt.Opaque,"immersive-ar":nt.AlphaBlend},interactionMode:st.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Ht=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};e.ActionRecorder=class{constructor(e,t){this[X]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),r=null===(t=e.getViewerPose(this[X].refSpace))||void 0===t?void 0:t.transform.matrix;if(!r)return;const n={timeStamp:i,position:h(m(),r),quaternion:p(F(),r),inputFrames:[]};this[X].session.inputSources.forEach((t=>{var i,r;if(!this[X].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[X].inputMap.size;this[X].inputMap.set(t,i),this[X].schemaMap.set(i,e)}const s=this[X].inputMap.get(t),a=this[X].schemaMap.get(s),o=null===(i=e.getPose(t.targetRaySpace,this[X].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:s,targetRayTransform:{position:h(m(),o),quaternion:p(F(),o)}};if(a.hasGrip){const n=null===(r=e.getPose(t.gripSpace,this[X].refSpace))||void 0===r?void 0:r.transform.matrix;if(n){const e=h(m(),n),t=p(F(),n);i.gripTransform={position:e,quaternion:t}}}if(a.hasHand){const r=Array.from(t.hand.values());let n=!0;if(n&&(n=e.fillPoses(r,t.targetRaySpace,this[X].jointTransforms)),n&&(n=e.fillJointRadii(r,this[X].jointRadii)),n){const e={};for(let t=0;t<25;t++){const i=this[X].jointTransforms.slice(16*t,16*(t+1)),n=this[X].jointRadii[t],s=h(m(),i),a=p(F(),i);e[r[t].jointName]={position:s,quaternion:a,radius:n}}i.hand=e}}if(a.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}n.inputFrames.push(i)}})),this[X].compressedFrames.push(this.compressActionFrame(n))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...Ht(e.position),...Ht(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,r=this[X].schemaMap.get(i),n=[i,...Ht(e.targetRayTransform.position),...Ht(e.targetRayTransform.quaternion)];if(r.hasGrip&&n.push([...Ht(e.gripTransform.position),...Ht(e.gripTransform.quaternion)]),r.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:r})=>{t.push(...Ht(e),...Ht(i),parseFloat(r.toFixed(3)))})),n.push(t)}r.hasGamepad&&n.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(n)})),t}log(){const e={schema:Array.from(this[X].schemaMap.entries()),frames:this[X].compressedFrames};console.log(JSON.stringify(e))}},e.NativeMesh=class{constructor(e,t,i,r){this.transform=e,this.vertices=t,this.indices=i,this.semanticLabel=r}},e.NativePlane=class{constructor(e,t,i){this.transform=e,this.polygon=t,this.semanticLabel=i}},e.P_ACTION_PLAYER=L,e.P_ACTION_RECORDER=X,e.P_ANCHOR=z,e.P_CONTROLLER=C,e.P_DEVICE=V,e.P_FRAME=j,e.P_GAMEPAD=H,e.P_HAND_INPUT=D,e.P_HIT_TEST=ae,e.P_INPUT_SOURCE=B,e.P_JOINT_POSE=U,e.P_JOINT_SPACE=ee,e.P_MESH=W,e.P_PLANE=Q,e.P_POSE=K,e.P_RAY=se,e.P_REF_SPACE=te,e.P_RENDER_STATE=Y,e.P_RIGID_TRANSFORM=J,e.P_SESSION=Z,e.P_SPACE=ie,e.P_SYSTEM=_,e.P_TRACKED_INPUT=N,e.P_VIEW=re,e.P_VIEWER_POSE=$,e.P_VIEWPORT=ne,e.P_WEBGL_LAYER=G,e.XRAnchor=Oe,e.XRAnchorSet=qe,e.XRDevice=class{constructor(e,t={}){var i,n,s,a,o,l;this.version=At;const h=new ce,u=new We(Be.Viewer,h),p={[Ge.Left]:new oe(u),[Ge.Right]:new oe(u),[Ge.None]:new oe(u)},f=e.controllerConfig,m={};f&&Object.values(pe).forEach((e=>{f.layout[e]&&(m[e]=new Me(f,e,h))}));const v={[pe.Left]:new Mt(dt,pe.Left,h),[pe.Right]:new Mt(dt,pe.Right,h)},x=null!==(i=t.canvasContainer)&&void 0!==i?i:document.createElement("div");x.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${At}`,x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[V]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(n=t.headsetPosition)&&void 0!==n?n:qt.headsetPosition.clone(),quaternion:null!==(s=t.headsetQuaternion)&&void 0!==s?s:qt.headsetQuaternion.clone(),stereoEnabled:null!==(a=t.stereoEnabled)&&void 0!==a?a:qt.stereoEnabled,ipd:null!==(o=t.ipd)&&void 0!==o?o:qt.ipd,fovy:null!==(l=t.fovy)&&void 0!==l?l:qt.fovy,controllers:m,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:"visible",pendingVisibilityState:null,xrSystem:null,matrix:r(),globalSpace:h,viewerSpace:u,viewSpaces:p,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:r,height:n}=i;switch(t.eye){case Ge.None:return new Ot(0,0,r,n);case Ge.Left:return new Ot(0,0,this[V].stereoEnabled?r/2:r,n);case Ge.Right:return new Ot(r/2,0,this[V].stereoEnabled?r/2:0,n)}},updateViews:()=>{d(this[V].viewerSpace[ie].offsetMatrix,this[V].quaternion.quat,this[V].position.vec3),c(this[V].viewSpaces[Ge.Left][ie].offsetMatrix,g(-this[V].ipd/2,0,0)),c(this[V].viewSpaces[Ge.Right][ie].offsetMatrix,g(this[V].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;if(t.parentElement!==this[V].canvasContainer){const e=this[V].devui;if(e){const{devUICanvas:t,devUIContainer:i}=e;t.style.zIndex=3..toString(),i.style.zIndex=4..toString(),this[V].canvasContainer.appendChild(e.devUICanvas),this[V].canvasContainer.appendChild(e.devUIContainer)}const i=this[V].sem;i&&(i.environmentCanvas.style.zIndex=1..toString(),this[V].canvasContainer.appendChild(i.environmentCanvas)),this[V].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height,zIndex:t.style.zIndex},t.style.zIndex=2..toString(),this[V].canvasContainer.appendChild(t),document.body.appendChild(this[V].canvasContainer)}t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[V].canvasData){const{canvas:e,parent:t,width:i,height:r,zIndex:n}=this[V].canvasData;e.width=i,e.height=r,e.style.zIndex=n,t?t.appendChild(e):this[V].canvasContainer.removeChild(e);const s=this[V].devui;s&&(this[V].canvasContainer.removeChild(s.devUICanvas),this[V].canvasContainer.removeChild(s.devUIContainer));const a=this[V].sem;a&&this[V].canvasContainer.removeChild(a.environmentCanvas),document.body.removeChild(this[V].canvasContainer),this[V].canvasData=void 0,window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[V].actionPlayer)||void 0===t?void 0:t.playing)this[V].actionPlayer.playFrame();else{const t=e.session;this[V].updateViews(),this[V].pendingVisibilityState&&(this[V].visibilityState=this[V].pendingVisibilityState,this[V].pendingVisibilityState=null,t.dispatchEvent(new Ue("visibilitychange",{session:t}))),"visible"===this[V].visibilityState&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[V].pendingReferenceSpaceReset&&(t[Z].referenceSpaces.forEach((e=>{switch(e[te].type){case Be.Local:case Be.LocalFloor:case Be.BoundedFloor:case Be.Unbounded:e.dispatchEvent(new It("reset",{referenceSpace:e}))}})),this[V].pendingReferenceSpaceReset=!1)}this[V].updateViews()}},this[V].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[V].xrSystem=new Tt(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[V].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[V].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=Tt,e.XRSession=ot,e.XRRenderState=Qe,e.XRFrame=rt,e.XRSpace=oe,e.XRReferenceSpace=We,e.XRJointSpace=lt,e.XRView=Ke,e.XRViewport=Ot,e.XRRigidTransform=Ce,e.XRPose=$e,e.XRViewerPose=Ye,e.XRJointPose=Je,e.XRInputSource=Se,e.XRInputSourceArray=xe,e.XRHand=ct,e.XRLayer=Rt,e.XRWebGLLayer=Ft,e.XRSessionEvent=Ue,e.XRInputSourceEvent=ye,e.XRInputSourcesChangeEvent=He,e.XRReferenceSpaceEvent=It}installDevUI(e){this[V].devui=new e(this)}installSEM(e){this[V].sem=new e(this)}get supportedSessionModes(){return this[V].supportedSessionModes}get supportedFeatures(){return this[V].supportedFeatures}get supportedFrameRates(){return this[V].supportedFrameRates}get isSystemKeyboardSupported(){return this[V].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[V].internalNominalFrameRate}get stereoEnabled(){return this[V].stereoEnabled}set stereoEnabled(e){this[V].stereoEnabled=e}get ipd(){return this[V].ipd}set ipd(e){this[V].ipd=e}get fovy(){return this[V].fovy}set fovy(e){this[V].fovy=e}get position(){return this[V].position}get quaternion(){return this[V].quaternion}get viewerSpace(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.viewerSpace:this[V].viewerSpace}get viewSpaces(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.viewSpaces:this[V].viewSpaces}get controllers(){return this[V].controllers}get hands(){return this[V].hands}get primaryInputMode(){return this[V].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[V].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if("visible"!==this[V].visibilityState)return[];return("controller"===this[V].primaryInputMode?Object.values(this[V].controllers):Object.values(this[V].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[V].actionPlayer)||void 0===e?void 0:e.playing)?this[V].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[V].canvasContainer}get canvasDimensions(){if(this[V].canvasData){const{width:e,height:t}=this[V].canvasData.canvas;return{width:e,height:t}}}get activeSession(){var e;return null===(e=this[V].xrSystem)||void 0===e?void 0:e[_].activeSession}get sessionOffered(){var e;return Boolean(null===(e=this[V].xrSystem)||void 0===e?void 0:e[_].offeredSessionConfig)}get name(){return this[V].name}grantOfferedSession(){var e;const t=null===(e=this[V].xrSystem)||void 0===e?void 0:e[_];t&&t.offeredSessionConfig&&(t.grantSession(t.offeredSessionConfig),t.offeredSessionConfig=void 0)}recenter(){const e=new de(-this.position.x,0,-this.position.z),t=new de(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),r=(new he).setFromAxisAngle(new de(0,1,0),i);this.position.add(e),this.quaternion.multiply(r),[...Object.values(this[V].controllers),...Object.values(this[V].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(r),t.position.applyQuaternion(r)})),this[V].pendingReferenceSpaceReset=!0}get visibilityState(){return this[V].visibilityState}updateVisibilityState(e){if(!Object.values(["visible","visible-blurred","hidden"]).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[V].visibilityState&&(this[V].pendingVisibilityState=e)}createActionPlayer(e,t){return this[V].actionPlayer=new Pt(e,t,this[V].ipd),this[V].actionPlayer}get devui(){return this[V].devui}get sem(){return this[V].sem}},e.XRFrame=rt,e.XRHand=ct,e.XRInputSource=Se,e.XRInputSourceArray=xe,e.XRInputSourceEvent=ye,e.XRInputSourcesChangeEvent=He,e.XRJointPose=Je,e.XRJointSpace=lt,e.XRLayer=Rt,e.XRMesh=Re,e.XRMeshSet=Ee,e.XRPlane=Ie,e.XRPlaneSet=Te,e.XRPose=$e,e.XRRay=De,e.XRReferenceSpace=We,e.XRReferenceSpaceEvent=It,e.XRRenderState=Qe,e.XRRigidTransform=Ce,e.XRSession=ot,e.XRSessionEvent=Ue,e.XRSpace=oe,e.XRSystem=Tt,e.XRView=Ke,e.XRViewerPose=Ye,e.XRViewport=Ot,e.XRWebGLLayer=Ft,e.metaQuest2=Dt,e.metaQuest3=jt,e.metaQuestPro=Nt,e.oculusQuest1=Vt,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -4614,7 +4614,7 @@ class ActionPlayer {
4614
4614
  }
4615
4615
  }
4616
4616
 
4617
- const VERSION = "2.0.0";
4617
+ const VERSION = "2.0.1";
4618
4618
 
4619
4619
  /**
4620
4620
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -1 +1 @@
1
- var e=1e-6,t="undefined"!=typeof Float32Array?Float32Array:Array;function i(){var e=new t(16);return t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function r(e){var i=new t(16);return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function s(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=t[5],c=t[6],d=t[7],l=t[8],h=t[9],u=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],x=i*o-r*a,w=i*c-n*a,S=i*d-s*a,y=r*c-n*o,M=r*d-s*o,b=n*d-s*c,E=l*m-h*f,F=l*g-u*f,R=l*v-p*f,A=h*g-u*m,q=h*v-p*m,I=u*v-p*g,T=x*I-w*q+S*A+y*R-M*F+b*E;return T?(T=1/T,e[0]=(o*I-c*q+d*A)*T,e[1]=(n*q-r*I-s*A)*T,e[2]=(m*b-g*M+v*y)*T,e[3]=(u*M-h*b-p*y)*T,e[4]=(c*R-a*I-d*F)*T,e[5]=(i*I-n*R+s*F)*T,e[6]=(g*S-f*b-v*w)*T,e[7]=(l*b-u*S+p*w)*T,e[8]=(a*q-o*R+d*E)*T,e[9]=(r*R-i*q-s*E)*T,e[10]=(f*M-m*S+v*x)*T,e[11]=(h*S-l*M-p*x)*T,e[12]=(o*F-a*A-c*E)*T,e[13]=(i*A-r*F+n*E)*T,e[14]=(m*w-f*y-g*x)*T,e[15]=(l*y-h*w+u*x)*T,e):null}function a(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],c=t[5],d=t[6],l=t[7],h=t[8],u=t[9],p=t[10],f=t[11],m=t[12],g=t[13],v=t[14],x=t[15],w=i[0],S=i[1],y=i[2],M=i[3];return e[0]=w*r+S*o+y*h+M*m,e[1]=w*n+S*c+y*u+M*g,e[2]=w*s+S*d+y*p+M*v,e[3]=w*a+S*l+y*f+M*x,w=i[4],S=i[5],y=i[6],M=i[7],e[4]=w*r+S*o+y*h+M*m,e[5]=w*n+S*c+y*u+M*g,e[6]=w*s+S*d+y*p+M*v,e[7]=w*a+S*l+y*f+M*x,w=i[8],S=i[9],y=i[10],M=i[11],e[8]=w*r+S*o+y*h+M*m,e[9]=w*n+S*c+y*u+M*g,e[10]=w*s+S*d+y*p+M*v,e[11]=w*a+S*l+y*f+M*x,w=i[12],S=i[13],y=i[14],M=i[15],e[12]=w*r+S*o+y*h+M*m,e[13]=w*n+S*c+y*u+M*g,e[14]=w*s+S*d+y*p+M*v,e[15]=w*a+S*l+y*f+M*x,e}function o(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function c(t,i,r){var n,s,a,o=r[0],c=r[1],d=r[2],l=Math.hypot(o,c,d);return l<e?null:(o*=l=1/l,c*=l,d*=l,n=Math.sin(i),a=1-(s=Math.cos(i)),t[0]=o*o*a+s,t[1]=c*o*a+d*n,t[2]=d*o*a-c*n,t[3]=0,t[4]=o*c*a-d*n,t[5]=c*c*a+s,t[6]=d*c*a+o*n,t[7]=0,t[8]=o*d*a+c*n,t[9]=c*d*a-o*n,t[10]=d*d*a+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function d(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=r+r,c=n+n,d=s+s,l=r*o,h=r*c,u=r*d,p=n*c,f=n*d,m=s*d,g=a*o,v=a*c,x=a*d;return e[0]=1-(p+m),e[1]=h+x,e[2]=u-v,e[3]=0,e[4]=h-x,e[5]=1-(l+m),e[6]=f+g,e[7]=0,e[8]=u+v,e[9]=f-g,e[10]=1-(l+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function l(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function h(e,t){var i=t[0],r=t[1],n=t[2],s=t[4],a=t[5],o=t[6],c=t[8],d=t[9],l=t[10];return e[0]=Math.hypot(i,r,n),e[1]=Math.hypot(s,a,o),e[2]=Math.hypot(c,d,l),e}function u(e,i){var r=new t(3);h(r,i);var n=1/r[0],s=1/r[1],a=1/r[2],o=i[0]*n,c=i[1]*s,d=i[2]*a,l=i[4]*n,u=i[5]*s,p=i[6]*a,f=i[8]*n,m=i[9]*s,g=i[10]*a,v=o+u+g,x=0;return v>0?(x=2*Math.sqrt(v+1),e[3]=.25*x,e[0]=(p-m)/x,e[1]=(f-d)/x,e[2]=(c-l)/x):o>u&&o>g?(x=2*Math.sqrt(1+o-u-g),e[3]=(p-m)/x,e[0]=.25*x,e[1]=(c+l)/x,e[2]=(f+d)/x):u>g?(x=2*Math.sqrt(1+u-o-g),e[3]=(f-d)/x,e[0]=(c+l)/x,e[1]=.25*x,e[2]=(p+m)/x):(x=2*Math.sqrt(1+g-o-u),e[3]=(c-l)/x,e[0]=(f+d)/x,e[1]=(p+m)/x,e[2]=.25*x),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var p=function(e,t,i,r,n){var s,a=1/Math.tan(t/2);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(s=1/(r-n),e[10]=(n+r)*s,e[14]=2*n*r*s):(e[10]=-1,e[14]=-2*r),e};function f(){var e=new t(3);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function m(e,i,r){var n=new t(3);return n[0]=e,n[1]=i,n[2]=r,n}function g(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function v(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function x(e,t){var i=t[0],r=t[1],n=t[2],s=i*i+r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function w(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function S(e,t,i){var r=t[0],n=t[1],s=t[2],a=i[0],o=i[1],c=i[2];return e[0]=n*c-s*o,e[1]=s*a-r*c,e[2]=r*o-n*a,e}function y(e,t,i,r){var n=t[0],s=t[1],a=t[2];return e[0]=n+r*(i[0]-n),e[1]=s+r*(i[1]-s),e[2]=a+r*(i[2]-a),e}function M(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function b(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function E(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*a,e[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*a,e[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*a,e[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*a,e}function F(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function R(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function A(t,i,r,n){var s,a,o,c,d,l=i[0],h=i[1],u=i[2],p=i[3],f=r[0],m=r[1],g=r[2],v=r[3];return(a=l*f+h*m+u*g+p*v)<0&&(a=-a,f=-f,m=-m,g=-g,v=-v),1-a>e?(s=Math.acos(a),o=Math.sin(s),c=Math.sin((1-n)*s)/o,d=Math.sin(n*s)/o):(c=1-n,d=n),t[0]=c*l+d*f,t[1]=c*h+d*m,t[2]=c*u+d*g,t[3]=c*p+d*v,t}f(),function(){var e=M()}();var q,I=function(e,i,r,n){var s=new t(4);return s[0]=e,s[1]=i,s[2]=r,s[3]=n,s},T=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},P=b,k=function(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=i*i+r*r+n*n+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=s*a,e};f(),m(1,0,0),m(0,1,0),F(),F(),q=new t(9),t!=Float32Array&&(q[1]=0,q[2]=0,q[3]=0,q[5]=0,q[6]=0,q[7]=0),q[0]=1,q[4]=1,q[8]=1;const O=Symbol("@iwer/action-player"),z=Symbol("@iwer/action-recorder"),C=Symbol("@iwer/xr-anchor"),V=Symbol("@iwer/xr-controller"),L=Symbol("@iwer/xr-device"),D=Symbol("@iwer/xr-hand-input"),X=Symbol("@iwer/xr-tracked-input"),j=Symbol("@iwer/xr-frame"),H=Symbol("@iwer/gamepad"),N=Symbol("@iwer/xr-system"),B=Symbol("@iwer/xr-input-source"),G=Symbol("@iwer/xr-webgl-layer"),W=Symbol("@iwer/xr-mesh"),Q=Symbol("@iwer/xr-plane"),U=Symbol("@iwer/xr-joint-pose"),$=Symbol("@iwer/xr-pose"),K=Symbol("@iwer/xr-viewer-pose"),_=Symbol("@iwer/xr-rigid-transform"),J=Symbol("@iwer/xr-render-state"),Y=Symbol("@iwer/xr-session"),Z=Symbol("@iwer/xr-joint-space"),ee=Symbol("@iwer/xr-reference-space"),te=Symbol("@iwer/xr-space"),ie=Symbol("@iwer/xr-view"),re=Symbol("@iwer/xr-viewport"),ne=Symbol("@iwer/xr-ray"),se=Symbol("@iwer/xr-hit-test");class ae extends EventTarget{constructor(e,t){super(),this[te]={parentSpace:e,offsetMatrix:t?r(t):i(),emulated:!0}}}class oe extends ae{constructor(){super(void 0,i())}}class ce{static updateOffsetPosition(e,t){o(e[te].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[te].offsetMatrix,r=f();l(r,i),d(i,t,r)}static updateOffsetMatrix(e,t){n(e[te].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,t=i()){return a(t,e[te].parentSpace?ce.calculateGlobalOffsetMatrix(e[te].parentSpace):i(),e[te].offsetMatrix),t}}class de{constructor(e=0,t=0,i=0){this.vec3=m(e,t,i),this.tempVec3=f()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return v(this.vec3,e,t,i),this}clone(){return new de(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return g(this.tempVec3,this.vec3),x(this.vec3,this.tempVec3),this}add(e){return g(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return g(this.tempVec3,this.vec3),function(e,t,i){var r=i[0],n=i[1],s=i[2],a=i[3],o=t[0],c=t[1],d=t[2],l=n*d-s*c,h=s*o-r*d,u=r*c-n*o,p=n*u-s*h,f=s*l-r*u,m=r*h-n*l,g=2*a;l*=g,h*=g,u*=g,p*=2,f*=2,m*=2,e[0]=o+l+p,e[1]=c+h+f,e[2]=d+u+m}(this.vec3,this.tempVec3,e.quat),this}}class le{constructor(e=0,t=0,i=0,r=1){this.quat=I(e,t,i,r),this.tempQuat=F()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,r){return P(this.quat,e,t,i,r),this}clone(){return new le(this.x,this.y,this.z,this.w)}copy(e){return P(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return T(this.tempQuat,this.quat),k(this.quat,this.tempQuat),this}invert(){return T(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return T(this.tempQuat,this.quat),function(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=i[0],c=i[1],d=i[2],l=i[3];e[0]=r*l+a*o+n*d-s*c,e[1]=n*l+a*c+s*o-r*d,e[2]=s*l+a*d+r*c-n*o,e[3]=a*l-r*o-n*c-s*d}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return R(this.quat,e.vec3,t),this}}var he,ue,pe;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(he||(he={}));class fe{constructor(e,t){this[H]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[H].type?this[H].pressed:this[H].value>0}get touched(){return"manual"===this[H].type?this[H].touched:this[H].touched||this.pressed}get value(){return this[H].value}}class me{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ge{constructor(e,t="",i=-1){this[H]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[H].buttonsSequence.push(null):(this[H].buttonsSequence.push(e.id),this[H].buttonsMap[e.id]=new fe(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[H].axesSequence.push(null):(this[H].axesSequence.push(e.id+e.type),this[H].axesMap[e.id]||(this[H].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[H].id}get index(){return this[H].index}get connected(){return this[H].connected}get timestamp(){return this[H].timestamp}get mapping(){return this[H].mapping}get axes(){const e=[];return this[H].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),r=t.substring(t.length-6);e.push("y-axis"===r?this[H].axesMap[i].y:this[H].axesMap[i].x)}})),e}get buttons(){return this[H].buttonsSequence.map((e=>null===e?new me:this[H].buttonsMap[e]))}get hapticActuators(){return this[H].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(ue||(ue={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(pe||(pe={}));class ve extends Array{}class xe{constructor(e,t,i,r,n,s,a){this[B]={handedness:e,targetRayMode:t,targetRaySpace:r,gripSpace:s,profiles:i,gamepad:n,hand:a}}get handedness(){return this[B].handedness}get targetRayMode(){return this[B].targetRayMode}get targetRaySpace(){return this[B].targetRaySpace}get gripSpace(){return this[B].gripSpace}get profiles(){return this[B].profiles}get gamepad(){return this[B].gamepad}get hand(){return this[B].hand}}class we extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const Se={[ue.Left]:{position:new de(-.25,1.5,-.4),quaternion:new le},[ue.Right]:{position:new de(.25,1.5,-.4),quaternion:new le},[ue.None]:{position:new de(.25,1.5,-.4),quaternion:new le}};class ye{constructor(e){this[X]={inputSource:e,position:Se[e.handedness].position.clone(),quaternion:Se[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[X].position}get quaternion(){return this[X].quaternion}get inputSource(){return this[X].inputSource}get connected(){return this[X].connected}set connected(e){this[X].connected=e,this[X].inputSource.gamepad[H].connected=e}onFrameStart(e){d(this[X].inputSource.targetRaySpace[te].offsetMatrix,this[X].quaternion.quat,this[X].position.vec3);const t=e.session;this[X].inputSource.gamepad.buttons.forEach((i=>{i instanceof fe&&(i[H].lastFrameValue=i[H].value,null!=i[H].pendingValue&&(i[H].value=i[H].pendingValue,i[H].pendingValue=null),null!=i[H].eventTrigger&&(0===i[H].lastFrameValue&&i[H].value>0?(t.dispatchEvent(new we(i[H].eventTrigger,{frame:e,inputSource:this[X].inputSource})),t.dispatchEvent(new we(i[H].eventTrigger+"start",{frame:e,inputSource:this[X].inputSource}))):i[H].lastFrameValue>0&&0===i[H].value&&t.dispatchEvent(new we(i[H].eventTrigger+"end",{frame:e,inputSource:this[X].inputSource}))))})),this[X].inputSourceChanged=this.connected!==this[X].lastFrameConnected,this[X].lastFrameConnected=this.connected}}class Me extends ye{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const r=new ae(i),n=e.layout[t].gripOffsetMatrix?new ae(r,e.layout[t].gripOffsetMatrix):void 0,s=[e.profileId,...e.fallbackProfileIds];super(new xe(t,pe.TrackedPointer,s,r,new ge(e.layout[t].gamepad),n)),this[V]={profileId:e.profileId,gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[V].gamepadConfig}get profileId(){return this[V].profileId}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[X].inputSource.gamepad[H].buttonsMap[e];if(i){if("binary"===i[H].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[H].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[X].inputSource.gamepad[H].buttonsMap[e];i?i[H].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const r=this[X].inputSource.gamepad[H].axesMap[e];r?"x-axis"===t?r.x=i:"y-axis"===t&&(r.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const r=this[X].inputSource.gamepad[H].axesMap[e];r?(r.x=t,r.y=i):console.warn(`Current controller does not have ${e} axes.`)}}class be{constructor(e,t,i,r,n){this[W]={nativeMesh:e,frame:void 0,meshSpace:t,vertices:i,indices:r,lastChangedTime:performance.now(),semanticLabel:n}}get meshSpace(){return this[W].meshSpace}get vertices(){return this[W].vertices}get indices(){return this[W].indices}get lastChangedTime(){return this[W].lastChangedTime}get semanticLabel(){return this[W].semanticLabel}}class Ee extends Set{}class Fe{constructor(e,t,i,r){this.transform=e,this.vertices=t,this.indices=i,this.semanticLabel=r}}var Re,Ae;!function(e){e.Desk="desk",e.Couch="couch",e.Floor="floor",e.Ceiling="ceiling",e.Wall="wall",e.Door="door",e.Window="window",e.Table="table",e.Shelf="shelf",e.Bed="bed",e.Screen="screen",e.Lamp="lamp",e.Plant="plant",e.WallArt="wall art",e.GlobalMesh="global mesh",e.Other="other"}(Re||(Re={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Ae||(Ae={}));const qe={[Re.Desk]:Ae.Horizontal,[Re.Couch]:Ae.Horizontal,[Re.Floor]:Ae.Horizontal,[Re.Ceiling]:Ae.Horizontal,[Re.Wall]:Ae.Vertical,[Re.Door]:Ae.Vertical,[Re.Window]:Ae.Vertical,[Re.Table]:Ae.Horizontal,[Re.Shelf]:Ae.Horizontal,[Re.Bed]:Ae.Horizontal,[Re.Screen]:Ae.Horizontal,[Re.Lamp]:Ae.Horizontal,[Re.Plant]:Ae.Horizontal,[Re.WallArt]:Ae.Vertical};class Ie{constructor(e,t,i,r){this[Q]={nativePlane:e,frame:void 0,planeSpace:t,polygon:i,lastChangedTime:performance.now(),semanticLabel:r,orientation:r?qe[r]:void 0}}get planeSpace(){return this[Q].planeSpace}get polygon(){return this[Q].polygon}get orientation(){return this[Q].orientation}get lastChangedTime(){return this[Q].lastChangedTime}get semanticLabel(){return this[Q].semanticLabel}}class Te extends Set{}class Pe{constructor(e,t,i){this.transform=e,this.polygon=t,this.semanticLabel=i}}class ke{constructor(e,t){this[C]={anchorSpace:e,session:t,deleted:!1},t[Y].trackedAnchors.add(this)}get anchorSpace(){if(this[C].deleted)throw new DOMException("XRAnchor has already been deleted.","InvalidStateError");return this[C].anchorSpace}requestPersistentHandle(){return new Promise(((e,t)=>{if(this[C].deleted)t(new DOMException("XRAnchor has already been deleted.","InvalidStateError"));else{const t=this[C].session[Y].persistentAnchors;for(const[i,r]of t.entries())if(r===this)return void e(i);const i=crypto.randomUUID();Ce.createPersistentAnchor(this[C].session,this,i),e(i)}}))}delete(){this[C].deleted||(this[C].anchorSpace=null,this[C].deleted=!0,this[C].session[Y].trackedAnchors.delete(this))}}class Oe extends Set{}const ze="@immersive-web-emulation-runtime/persistent-anchors";class Ce{static recoverPersistentAnchorsFromStorage(e){const t=JSON.parse(localStorage.getItem(ze)||"{}");Object.entries(t).forEach((([t,i])=>{const r=e[Y].device[L].globalSpace,n=new ae(r,i),s=new ke(n,e);e[Y].persistentAnchors.set(t,s)}))}static createPersistentAnchor(e,t,i){e[Y].trackedAnchors.add(t),e[Y].persistentAnchors.set(i,t);const r=JSON.parse(localStorage.getItem(ze)||"{}");r[i]=Array.from(t[C].anchorSpace[te].offsetMatrix),localStorage.setItem(ze,JSON.stringify(r))}}class Ve{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r,Object.freeze(this)}static fromPoint(e){return new Ve(e.x,e.y,e.z,e.w)}matrixTransform(e){return new Ve}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Le=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:Ve;class De{constructor(e,t){const r=m(0,0,0),n=F();this[_]={matrix:i(),position:e?m(e.x,e.y,e.z):r,orientation:t?k(F(),I(t.x,t.y,t.z,t.w)):n,inverse:null},this.updateMatrix()}updateMatrix(){d(this[_].matrix,this[_].orientation,this[_].position)}get matrix(){return this[_].matrix}get position(){const e=this[_].position;return new Le(e[0],e[1],e[2],1)}get orientation(){const e=this[_].orientation;return new Le(e[0],e[1],e[2],e[3])}get inverse(){if(!this[_].inverse){const e=i();if(!s(e,this[_].matrix))throw new Error("Matrix is not invertible.");let t=f();l(t,e);let r=F();u(r,e),this[_].inverse=new De(new Le(t[0],t[1],t[2],1),new Le(r[0],r[1],r[2],r[3])),this[_].inverse[_].inverse=this}return this[_].inverse}}class Xe{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}}class je{constructor(e,t){const i={x:0,y:0,z:0,w:1},r={x:0,y:0,z:-1,w:0};if(e instanceof De){const t=e.matrix,n=b(M(),i.x,i.y,i.z,i.w),s=b(M(),r.x,r.y,r.z,r.w);E(n,n,t),E(s,s,t),i.x=n[0],i.y=n[1],i.z=n[2],i.w=n[3],r.x=s[0],r.y=s[1],r.z=s[2],r.w=s[3]}else if(e&&(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w),t){if(0===t.x&&0===t.y&&0===t.z||1!==t.w)throw new DOMException("Invalid direction value to construct XRRay","TypeError");r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w}const n=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z)||1;r.x=r.x/n,r.y=r.y/n,r.z=r.z/n,this[ne]={origin:new Xe(i.x,i.y,i.z,i.w),direction:new Xe(r.x,r.y,r.z,r.w),matrix:null}}get origin(){return this[ne].origin}get direction(){return this[ne].direction}get matrix(){if(this[ne].matrix)return this[ne].matrix;const e=v(f(),0,0,-1),t=v(f(),this[ne].origin.x,this[ne].origin.y,this[ne].origin.z),r=v(f(),this[ne].direction.x,this[ne].direction.y,this[ne].direction.z),n=S(f(),r,e),s=w(r,e),d=i();s>-1&&s<1?c(d,Math.acos(s),n):-1===s?c(d,Math.acos(s),v(f(),1,0,0)):function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(d);const l=o(i(),t),h=a(i(),l,d);return this[ne].matrix=new Float32Array(h),this[ne].matrix}}class He{constructor(e,t){var i;this[se]={session:e,space:t.space,offsetRay:null!==(i=t.offsetRay)&&void 0!==i?i:new je}}cancel(){this[se].session[Y].hitTestSources.delete(this)}}class Ne{constructor(e,t){this[se]={frame:e,offsetSpace:t}}getPose(e){return this[se].frame.getPose(this[se].offsetSpace,e)}createAnchor(){return this[se].frame.createAnchor(new De,this[se].offsetSpace)}}class Be extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var Ge,We,Qe;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(We||(We={}));class Ue extends ae{constructor(e,t,i){super(t,i),this[Ge]={type:null,onreset:()=>{}},this[ee].type=e}get onreset(){var e;return null!==(e=this[ee].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[ee].onreset&&this.removeEventListener("reset",this[ee].onreset),this[ee].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new Ue(this[ee].type,this,e)}}Ge=ee;class $e{constructor(e={},t){this[J]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[J].depthNear}get depthFar(){return this[J].depthFar}get inlineVerticalFieldOfView(){return this[J].inlineVerticalFieldOfView}get baseLayer(){return this[J].baseLayer}}class Ke extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}!function(e){e.None="none",e.Left="left",e.Right="right"}(Qe||(Qe={}));class _e{constructor(e,t,i,r){this[ie]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:r}}get eye(){return this[ie].eye}get projectionMatrix(){return this[ie].projectionMatrix}get transform(){return this[ie].transform}get recommendedViewportScale(){return this[ie].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[ie].requestedViewportScale=e}}class Je{constructor(e,t=!1,i=void 0,r=void 0){this[$]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:r}}get transform(){return this[$].transform}get emulatedPosition(){return this[$].emulatedPosition}get linearVelocity(){return this[$].linearVelocity}get angularVelocity(){return this[$].angularVelocity}}class Ye extends Je{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[U]={radius:t}}get radius(){return this[U].radius}}class Ze extends Je{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[K]={views:Object.freeze(t)}}get views(){return this[K].views}}const et=i(),tt=i(),it=i(),rt=(e,t,i)=>{ce.calculateGlobalOffsetMatrix(t,et),ce.calculateGlobalOffsetMatrix(i,tt),s(it,tt),a(e,it,et)};class nt{constructor(e,t,r,n,s){this[j]={session:e,id:t,active:r,animationFrame:n,predictedDisplayTime:s,tempMat4:i(),detectedPlanes:new Te,detectedMeshes:new Ee,trackedAnchors:e[Y].frameTrackedAnchors,hitTestResultsMap:new Map}}get session(){return this[j].session}get predictedDisplayTime(){return this[j].predictedDisplayTime}getPose(e,t){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");rt(this[j].tempMat4,e,t);const i=f();l(i,this[j].tempMat4);const r=F();return u(r,this[j].tempMat4),new Je(new De({x:i[0],y:i[1],z:i[2],w:1},{x:r[0],y:r[1],z:r[2],w:r[3]}),e[te].emulated)}getViewerPose(e){if(!this[j].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[j].session,i=t[Y].device,r=this.getPose(i.viewerSpace,e),n="inline"===t[Y].mode?[Qe.None]:[Qe.Left,Qe.Right],s=[];return n.forEach((r=>{const n=i.viewSpaces[r],a=this.getPose(n,e),o=t[Y].getProjectionMatrix(r),c=new _e(r,new Float32Array(o),a.transform,t);s.push(c)})),new Ze(r.transform,s,!1)}getJointPose(e,t){const i=this.getPose(e,t),r=e[Z].radius;return new Ye(i.transform,r,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let r=0;r<e.length;r++)e[r][Z].radius?t[r]=e[r][Z].radius:(t[r]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,r)=>{rt(this[j].tempMat4,e,t);for(let e=0;e<16;e++)i[16*r+e]=this[j].tempMat4[e]})),!0}get detectedPlanes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedPlanes}get detectedMeshes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedMeshes}get trackedAnchors(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].trackedAnchors}createAnchor(e,t){return new Promise(((i,r)=>{if(this[j].active){const n=this[j].session[Y].device[L].globalSpace,s=new ae(t,e.matrix),a=ce.calculateGlobalOffsetMatrix(s),o=new ae(n,a),c=new ke(o,this[j].session);this[j].session[Y].trackedAnchors.add(c),this[j].session[Y].newAnchors.set(c,{resolve:i,reject:r})}else r(new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError"))}))}getHitTestResults(e){if(this[j].active){if(this[j].hitTestResultsMap.has(e))return[...this[j].hitTestResultsMap.get(e)];throw new DOMException("Requested hit test results are not available for current frame.","InvalidStateError")}throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError")}}var st,at,ot;!function(e){e.Opaque="opaque",e.AlphaBlend="alpha-blend",e.Additive="additive"}(st||(st={})),function(e){e.ScreenSpace="screen-space",e.WorldSpace="world-space"}(at||(at={}));class ct extends EventTarget{constructor(e,t,r){super(),this[Y]={device:e,mode:t,renderState:new $e,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[Qe.Left]:i(),[Qe.Right]:i(),[Qe.None]:i()},getProjectionMatrix:e=>this[Y].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[Y].enabledFeatures.includes(e))return!1;switch(e){case We.Viewer:return!0;case We.Local:case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:return"inline"!=this[Y].mode}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[Y].ended)return;this[Y].deviceFrameHandle=globalThis.requestAnimationFrame(this[Y].onDeviceFrame),null!=this[Y].pendingRenderState&&(this[Y].renderState=this[Y].pendingRenderState,this[Y].pendingRenderState=null,this[Y].device[L].onBaseLayerSet(this[Y].renderState.baseLayer));const e=this[Y].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if("inline"!=this[Y].mode){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),r=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(r)}const{depthNear:r,depthFar:s}=this[Y].renderState,{width:a,height:o}=i;if("inline"!==this[Y].mode){const e=a*(this[Y].device.stereoEnabled?.5:1)/o;p(this[Y].projectionMatrices[Qe.Left],this[Y].device.fovy,e,r,s),n(this[Y].projectionMatrices[Qe.Right],this[Y].projectionMatrices[Qe.Left])}else{const e=a/o;p(this[Y].projectionMatrices[Qe.None],this[Y].renderState.inlineVerticalFieldOfView,e,r,s)}const c=new nt(this,this[Y].frameHandle,!0,!0,performance.now()),d=performance.now(),l=this[Y].device[L].devui;if(l&&l.render(d),"immersive-ar"===this[Y].mode){const e=this[Y].device[L].sem;e&&e.render(d)}this[Y].enabledFeatures.includes("anchors")&&this[Y].updateTrackedAnchors(),this[Y].enabledFeatures.includes("plane-detection")&&this[Y].updateTrackedPlanes(c),this[Y].enabledFeatures.includes("mesh-detection")&&this[Y].updateTrackedMeshes(c),this[Y].enabledFeatures.includes("hit-test")&&this[Y].computeHitTestResults(c),this[Y].device[L].onFrameStart(c),this[Y].updateActiveInputSources();const h=this[Y].currentFrameCallbacks=this[Y].frameCallbacks;this[Y].frameCallbacks=[];const u=performance.now();for(let e=0;e<h.length;e++)try{h[e].cancelled||h[e].callback(u,c)}catch(e){console.error(e)}this[Y].currentFrameCallbacks=null,c[j].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[Y].enabledFeatures.includes("hand-tracking"),t=this[Y].activeInputSources,i=this[Y].device.inputSources.filter((t=>!t.hand||e)),r=i.filter((e=>!t.includes(e))),n=t.filter((e=>!i.includes(e)));this[Y].activeInputSources=i,(r.length>0||n.length>0)&&this.dispatchEvent(new Be("inputsourceschange",{session:this,added:r,removed:n}))},trackedAnchors:new Oe,persistentAnchors:new Map,newAnchors:new Map,frameTrackedAnchors:new Oe,updateTrackedAnchors:()=>{this[Y].enabledFeatures.includes("anchors")&&(this[Y].frameTrackedAnchors.clear(),Array.from(this[Y].trackedAnchors).forEach((e=>{if(e[C].deleted){if(this[Y].trackedAnchors.delete(e),this[Y].newAnchors.has(e)){const{reject:t}=this[Y].newAnchors.get(e);t(new DOMException("Anchor is no longer tracked","InvalidStateError"))}}else if(this[Y].frameTrackedAnchors.add(e),this[Y].newAnchors.has(e)){const{resolve:t}=this[Y].newAnchors.get(e);t(e),this[Y].newAnchors.delete(e)}})))},trackedPlanes:new Map,updateTrackedPlanes:e=>{const t=this[Y].device[L].sem;if(!t)return;Array.from(this[Y].trackedPlanes.keys()).forEach((e=>{t.trackedPlanes.has(e)||this[Y].trackedPlanes.delete(e)})),t.trackedPlanes.forEach((t=>{let i=this[Y].trackedPlanes.get(t);if(!i){const e=new ae(this[Y].device[L].globalSpace,t.transform.matrix);i=new Ie(t,e,t.polygon,t.semanticLabel),this[Y].trackedPlanes.set(t,i)}i[Q].lastChangedTime=e.predictedDisplayTime,i[Q].frame=e,e[j].detectedPlanes.add(i)}))},trackedMeshes:new Map,updateTrackedMeshes:e=>{const t=this[Y].device[L].sem;if(!t)return;Array.from(this[Y].trackedMeshes.keys()).forEach((e=>{t.trackedMeshes.has(e)||this[Y].trackedMeshes.delete(e)})),t.trackedMeshes.forEach((t=>{let i=this[Y].trackedMeshes.get(t);if(!i){const e=new ae(this[Y].device[L].globalSpace,t.transform.matrix);i=new be(t,e,t.vertices,t.indices,t.semanticLabel),this[Y].trackedMeshes.set(t,i)}i[W].lastChangedTime=e.predictedDisplayTime,i[W].frame=e,e[j].detectedMeshes.add(i)}))},hitTestSources:new Set,computeHitTestResults:e=>{const t=this[Y].device[L].sem;if(!t)return;const r=this[Y].device[L].globalSpace;this[Y].hitTestSources.forEach((n=>{const s=n[se].space,o=ce.calculateGlobalOffsetMatrix(s),c=n[se].offsetRay.matrix,d=i();a(d,o,c);const l=[];t.computeHitTestResults(d).forEach((t=>{const i=new ae(r,t),n=new Ne(e,i);l.push(n)})),e[j].hitTestResultsMap.set(n,l)}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},Ce.recoverPersistentAnchorsFromStorage(this),this[Y].onDeviceFrame()}get visibilityState(){return this[Y].device.visibilityState}get frameRate(){return this[Y].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[Y].device.supportedFrameRates)}get renderState(){return this[Y].renderState}get inputSources(){return this[Y].inputSourceArray.length=0,this[Y].ended||"inline"===this[Y].mode||this[Y].inputSourceArray.push(...this[Y].activeInputSources),this[Y].inputSourceArray}get enabledFeatures(){return this[Y].enabledFeatures}get isSystemKeyboardSupported(){return this[Y].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[Y].device[L].environmentBlendModes[this[Y].mode])&&void 0!==e?e:st.Opaque}get interactionMode(){return this[Y].device[L].interactionMode}updateRenderState(e={}){var t,i,r,n;if(this[Y].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[G].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&"inline"!==this[Y].mode)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:e.baseLayer||(null===(t=this[Y].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[Y].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(r=this[Y].pendingRenderState)||void 0===r?void 0:r.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(n=this[Y].pendingRenderState)||void 0===n?void 0:n.inlineVerticalFieldOfView)||void 0};this[Y].pendingRenderState=new $e(s,this[Y].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[Y].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[Y].device.supportedFrameRates.includes(e)?(this[Y].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[Y].nominalFrameRate=e,this.dispatchEvent(new Ke("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[Y].ended||!this[Y].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let r;switch(e){case We.Viewer:r=this[Y].device.viewerSpace;break;case We.Local:r=new Ue(e,this[Y].device[L].globalSpace,this[Y].device.viewerSpace[te].offsetMatrix);break;case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:r=new Ue(e,this[Y].device[L].globalSpace)}this[Y].referenceSpaces.push(r),t(r)}))}requestAnimationFrame(e){if(this[Y].ended)return 0;const t=++this[Y].frameHandle;return this[Y].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[Y].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[Y].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[Y].ended||null===this[Y].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[Y].deviceFrameHandle),this[Y].device[L].onSessionEnd(),this.dispatchEvent(new Ke("end",{session:this})),e())}))}get persistentAnchors(){return Array.from(this[Y].persistentAnchors.keys())}restorePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Y].persistentAnchors.has(e))if(this[Y].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else{const r=this[Y].persistentAnchors.get(e);this[Y].newAnchors.has(r)?i(new DOMException(`Multiple concurrent attempts detected to restore the anchor with UUID: ${e}.`,"InvalidStateError")):(this[Y].trackedAnchors.add(r),this[Y].newAnchors.set(r,{resolve:t,reject:i}))}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}deletePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Y].persistentAnchors.has(e)){const i=this[Y].persistentAnchors.get(e);this[Y].persistentAnchors.delete(e),i.delete(),t(void 0)}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}requestHitTestSource(e){return new Promise(((t,i)=>{if(this[Y].enabledFeatures.includes("hit-test"))if(this[Y].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else if(this[Y].device[L].sem){const i=new He(this,e);this[Y].hitTestSources.add(i),t(i)}else i(new DOMException("Synthethic Environment Module required for emulating hit-test","OperationError"));else i(new DOMException('WebXR feature "hit-test" is not supported by current session',"NotSupportedError"))}))}get onend(){var e;return null!==(e=this[Y].onend)&&void 0!==e?e:()=>{}}set onend(e){this[Y].onend&&this.removeEventListener("end",this[Y].onend),this[Y].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[Y].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[Y].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[Y].oninputsourceschange),this[Y].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[Y].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[Y].onselect&&this.removeEventListener("select",this[Y].onselect),this[Y].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[Y].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[Y].onselectstart&&this.removeEventListener("selectstart",this[Y].onselectstart),this[Y].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[Y].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[Y].onselectend&&this.removeEventListener("selectend",this[Y].onselectend),this[Y].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[Y].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[Y].onsqueeze&&this.removeEventListener("squeeze",this[Y].onsqueeze),this[Y].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[Y].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[Y].onsqueezestart&&this.removeEventListener("squeezestart",this[Y].onsqueezestart),this[Y].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[Y].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[Y].onsqueezeend&&this.removeEventListener("squeezeend",this[Y].onsqueezeend),this[Y].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[Y].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[Y].onvisibilitychange&&this.removeEventListener("visibilitychange",this[Y].onvisibilitychange),this[Y].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[Y].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[Y].onframeratechange&&this.removeEventListener("frameratechange",this[Y].onframeratechange),this[Y].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(ot||(ot={}));class dt extends Map{}class lt extends ae{constructor(e,t,i){super(t,i),this[Z]={jointName:e,radius:0}}get jointName(){return this[Z].jointName}}const ht={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},ut={mapping:he.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},pt=f(),ft=F(),mt=f(),gt=f(),vt=F(),xt=f(),wt=f(),St=F(),yt=f(),Mt=(e,t,i,r)=>(l(pt,t),u(ft,t),h(mt,t),l(gt,i),u(vt,i),h(xt,i),y(wt,pt,gt,r),A(St,ft,vt,r),y(yt,mt,xt,r),function(e,t,i,r){var n=t[0],s=t[1],a=t[2],o=t[3],c=n+n,d=s+s,l=a+a,h=n*c,u=n*d,p=n*l,f=s*d,m=s*l,g=a*l,v=o*c,x=o*d,w=o*l,S=r[0],y=r[1],M=r[2];e[0]=(1-(f+g))*S,e[1]=(u+w)*S,e[2]=(p-x)*S,e[3]=0,e[4]=(u-w)*y,e[5]=(1-(h+g))*y,e[6]=(m+v)*y,e[7]=0,e[8]=(p+x)*M,e[9]=(m-v)*M,e[10]=(1-(h+f))*M,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,St,wt,yt),e),bt=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1];class Et extends ye{constructor(e,t,i){if(t!==ue.Left&&t!==ue.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const r=new ae(i),n=new ae(r),s=[e.profileId,...e.fallbackProfileIds],a=new dt;Object.values(ot).forEach((e=>{a.set(e,new lt(e,r))}));super(new xe(t,pe.TrackedPointer,s,r,new ge(ut),n,a)),this[D]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[D].poseId}set poseId(e){this[D].poses[e]?this[D].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[D].poses[this[D].poseId],t=this[D].poses.pinch;Object.values(ot).forEach((i=>{const r=e.jointTransforms[i].offsetMatrix,n=t.jointTransforms[i].offsetMatrix,s=this.inputSource.hand.get(i);Mt(s[te].offsetMatrix,r,n,this.pinchValue),this.inputSource.handedness===ue.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=bt[t]})(s[te].offsetMatrix),s[Z].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&Mt(this.inputSource.gripSpace[te].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[X].inputSource.gamepad[H].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[X].inputSource.gamepad[H].buttonsMap.pinch[H].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}class Ft extends EventTarget{}const Rt={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class At extends Ft{constructor(e,t,i={}){if(super(),e[Y].ended)throw new DOMException("Session has ended","InvalidStateError");const r={...Rt,...i};this[G]={session:e,context:t,antialias:r.antialias}}get context(){return this[G].context}get antialias(){return this[G].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[G].context.drawingBufferWidth}get framebufferHeight(){return this[G].context.drawingBufferHeight}getViewport(e){if(e[ie].session!==this[G].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[G].session[Y].device[L].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof ct))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[Y].ended?0:1}}class qt{constructor(e,t,i){const{schema:r,frames:n}=t;if(!n||!r||0===n.length)throw new DOMException("wrong recording format","NotSupportedError");const s=new Ue(We.Viewer,e),a={[Qe.Left]:new ae(s),[Qe.Right]:new ae(s),[Qe.None]:new ae(s)};this[O]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:n,recordedFramePointer:0,startingTimeStamp:n[0][0],endingTimeStamp:n[n.length-1][0],playbackTime:n[0][0],playing:!1,viewerSpace:s,viewSpaces:a,vec3:f(),quat:F()},o(this[O].viewSpaces[Qe.Left][te].offsetMatrix,m(-i/2,0,0)),o(this[O].viewSpaces[Qe.Right][te].offsetMatrix,m(i/2,0,0)),r.forEach((t=>{const i=t[0],r=t[1];let n;if(r.hasGamepad){const e=[];for(let t=0;t<r.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<r.numAxes;e++)t.push({id:e.toString(),type:"manual"});n=new ge({mapping:r.mapping,buttons:e,axes:t})}const s=new ae(e);let a;r.hasHand&&(a=new dt,Object.values(ot).forEach((e=>{a.set(e,new lt(e,s))})));const o=new xe(r.handedness,r.targetRayMode,r.profiles,s,n,r.hasGrip?new ae(e):void 0,r.hasHand?a:void 0);this[O].inputSources.set(i,{active:!1,source:o}),this[O].inputSchemas.set(i,r)}))}play(){this[O].recordedFramePointer=0,this[O].playbackTime=this[O].startingTimeStamp,this[O].playing=!0,this[O].actualTimeStamp=performance.now()}stop(){this[O].playing=!1}get playing(){return this[O].playing}get viewerSpace(){return this[O].viewerSpace}get viewSpaces(){return this[O].viewSpaces}get inputSources(){return Array.from(this[O].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[O].actualTimeStamp;if(this[O].actualTimeStamp=e,this[O].playbackTime+=t,this[O].playbackTime>this[O].endingTimeStamp)return void this.stop();for(;this[O].frames[this[O].recordedFramePointer+1][0]<this[O].playbackTime;)this[O].recordedFramePointer++;const i=this[O].frames[this[O].recordedFramePointer],r=this[O].frames[this[O].recordedFramePointer+1],n=(this[O].playbackTime-i[0])/(r[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[O].viewerSpace,i.slice(1,8),r.slice(1,8),n);const s=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:r}=this.processRawInputData(i[e]);s.set(t,r)}const a=new Map;for(let e=8;e<r.length;e++){const{index:t,inputData:i}=this.processRawInputData(r[e]);a.set(t,i)}this[O].inputSources.forEach((e=>{e.active=!1})),a.forEach(((e,t)=>{this[O].inputSources.get(t).active=!0;const i=this[O].inputSources.get(t).source,r=this[O].inputSchemas.get(t);this.updateInputSource(i,r,s.has(t)?s.get(t):e,e,n)}))}updateInputSource(e,t,i,r,n){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,r.targetRayTransform,n),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,r.gripTransform,n),t.hasHand)for(let s=0;s<25;s++){const a=i.handTransforms.slice(8*s,8*s+7),o=r.handTransforms.slice(8*s,8*s+7),c=i.handTransforms[8*s+7],d=r.handTransforms[8*s+7],l=e.hand.get(t.jointSequence[s]);this.updateXRSpaceFromMergedFrames(l,a,o,n),l[Z].radius=(d-c)*n+c}if(t.hasGamepad){const t=e.gamepad;r.buttons.forEach(((e,r)=>{const s=t.buttons[r];s[H].pressed=1===e[0],s[H].touched=1===e[1];const a=i.buttons[r][2],o=e[2];s[H].value=(o-a)*n+a})),r.axes.forEach(((e,r)=>{const s=i.axes[r];t[H].axesMap[r.toString()].x=(e-s)*n+s}))}}updateXRSpaceFromMergedFrames(e,t,i,r){const n=m(t[0],t[1],t[2]),s=I(t[3],t[4],t[5],t[6]),a=m(i[0],i[1],i[2]),o=I(i[3],i[4],i[5],i[6]);y(this[O].vec3,n,a,r),A(this[O].quat,s,o,r),d(e[te].offsetMatrix,this[O].quat,this[O].vec3)}processRawInputData(e){const t=e[0],i=this[O].inputSchemas.get(t),r={targetRayTransform:e.slice(1,8)};let n=8;if(i.hasGrip&&(r.gripTransform=e[n++]),i.hasHand&&(r.handTransforms=e[n++]),i.hasGamepad){const t=e[n];r.buttons=t.slice(0,i.numButtons),r.axes=t.slice(i.numButtons)}return{index:t,inputData:r}}}const It="2.0.0";class Tt extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}class Pt extends EventTarget{constructor(e){super(),this[N]={device:e,grantSession:({resolve:e,reject:t,mode:i,options:r})=>{if(this[N].activeSession)return void t(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:n=[],optionalFeatures:s=[]}=r,{supportedFeatures:a}=this[N].device;if(!n.every((e=>a.includes(e))))return void t(new Error("One or more required features are not supported by the device."));const o=s.filter((e=>a.includes(e))),c=Array.from(new Set([...n,...o,"viewer","local"])),d=new ct(this[N].device,i,c);this[N].activeSession=d,d.addEventListener("end",(()=>{this[N].activeSession=void 0})),e(d)}}}isSessionSupported(e){return new Promise(((t,i)=>{t("inline"===e||this[N].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{if(!n)return void r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));const s={resolve:i,reject:r,mode:e,options:t};this[N].grantSession(s)})).catch(r)}))}offerSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{n?this[N].offeredSessionConfig={resolve:i,reject:r,mode:e,options:t}:r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"))})).catch(r)}))}}class kt{constructor(e,t,i,r){this[re]={x:e,y:t,width:i,height:r}}get x(){return this[re].x}get y(){return this[re].y}get width(){return this[re].width}get height(){return this[re].height}}const Ot={ipd:.063,fovy:Math.PI/2,headsetPosition:new de(0,1.6,0),headsetQuaternion:new le,stereoEnabled:!1};class zt{constructor(e,t={}){var r,n,s,a,c,l;this.version=It;const h=new oe,u=new Ue(We.Viewer,h),p={[Qe.Left]:new ae(u),[Qe.Right]:new ae(u),[Qe.None]:new ae(u)},f=e.controllerConfig,g={};f&&Object.values(ue).forEach((e=>{f.layout[e]&&(g[e]=new Me(f,e,h))}));const v={[ue.Left]:new Et(ht,ue.Left,h),[ue.Right]:new Et(ht,ue.Right,h)},x=null!==(r=t.canvasContainer)&&void 0!==r?r:document.createElement("div");x.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${It}`,x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[L]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(n=t.headsetPosition)&&void 0!==n?n:Ot.headsetPosition.clone(),quaternion:null!==(s=t.headsetQuaternion)&&void 0!==s?s:Ot.headsetQuaternion.clone(),stereoEnabled:null!==(a=t.stereoEnabled)&&void 0!==a?a:Ot.stereoEnabled,ipd:null!==(c=t.ipd)&&void 0!==c?c:Ot.ipd,fovy:null!==(l=t.fovy)&&void 0!==l?l:Ot.fovy,controllers:g,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:"visible",pendingVisibilityState:null,xrSystem:null,matrix:i(),globalSpace:h,viewerSpace:u,viewSpaces:p,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:r,height:n}=i;switch(t.eye){case Qe.None:return new kt(0,0,r,n);case Qe.Left:return new kt(0,0,this[L].stereoEnabled?r/2:r,n);case Qe.Right:return new kt(r/2,0,this[L].stereoEnabled?r/2:0,n)}},updateViews:()=>{d(this[L].viewerSpace[te].offsetMatrix,this[L].quaternion.quat,this[L].position.vec3),o(this[L].viewSpaces[Qe.Left][te].offsetMatrix,m(-this[L].ipd/2,0,0)),o(this[L].viewSpaces[Qe.Right][te].offsetMatrix,m(this[L].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;if(t.parentElement!==this[L].canvasContainer){const e=this[L].devui;if(e){const{devUICanvas:t,devUIContainer:i}=e;t.style.zIndex=3..toString(),i.style.zIndex=4..toString(),this[L].canvasContainer.appendChild(e.devUICanvas),this[L].canvasContainer.appendChild(e.devUIContainer)}const i=this[L].sem;i&&(i.environmentCanvas.style.zIndex=1..toString(),this[L].canvasContainer.appendChild(i.environmentCanvas)),this[L].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height,zIndex:t.style.zIndex},t.style.zIndex=2..toString(),this[L].canvasContainer.appendChild(t),document.body.appendChild(this[L].canvasContainer)}t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[L].canvasData){const{canvas:e,parent:t,width:i,height:r,zIndex:n}=this[L].canvasData;e.width=i,e.height=r,e.style.zIndex=n,t?t.appendChild(e):this[L].canvasContainer.removeChild(e);const s=this[L].devui;s&&(this[L].canvasContainer.removeChild(s.devUICanvas),this[L].canvasContainer.removeChild(s.devUIContainer));const a=this[L].sem;a&&this[L].canvasContainer.removeChild(a.environmentCanvas),document.body.removeChild(this[L].canvasContainer),this[L].canvasData=void 0,window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[L].actionPlayer)||void 0===t?void 0:t.playing)this[L].actionPlayer.playFrame();else{const t=e.session;this[L].updateViews(),this[L].pendingVisibilityState&&(this[L].visibilityState=this[L].pendingVisibilityState,this[L].pendingVisibilityState=null,t.dispatchEvent(new Ke("visibilitychange",{session:t}))),"visible"===this[L].visibilityState&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[L].pendingReferenceSpaceReset&&(t[Y].referenceSpaces.forEach((e=>{switch(e[ee].type){case We.Local:case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:e.dispatchEvent(new Tt("reset",{referenceSpace:e}))}})),this[L].pendingReferenceSpaceReset=!1)}this[L].updateViews()}},this[L].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[L].xrSystem=new Pt(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[L].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[L].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=Pt,e.XRSession=ct,e.XRRenderState=$e,e.XRFrame=nt,e.XRSpace=ae,e.XRReferenceSpace=Ue,e.XRJointSpace=lt,e.XRView=_e,e.XRViewport=kt,e.XRRigidTransform=De,e.XRPose=Je,e.XRViewerPose=Ze,e.XRJointPose=Ye,e.XRInputSource=xe,e.XRInputSourceArray=ve,e.XRHand=dt,e.XRLayer=Ft,e.XRWebGLLayer=At,e.XRSessionEvent=Ke,e.XRInputSourceEvent=we,e.XRInputSourcesChangeEvent=Be,e.XRReferenceSpaceEvent=Tt}installDevUI(e){this[L].devui=new e(this)}installSEM(e){this[L].sem=new e(this)}get supportedSessionModes(){return this[L].supportedSessionModes}get supportedFeatures(){return this[L].supportedFeatures}get supportedFrameRates(){return this[L].supportedFrameRates}get isSystemKeyboardSupported(){return this[L].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[L].internalNominalFrameRate}get stereoEnabled(){return this[L].stereoEnabled}set stereoEnabled(e){this[L].stereoEnabled=e}get ipd(){return this[L].ipd}set ipd(e){this[L].ipd=e}get fovy(){return this[L].fovy}set fovy(e){this[L].fovy=e}get position(){return this[L].position}get quaternion(){return this[L].quaternion}get viewerSpace(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.viewerSpace:this[L].viewerSpace}get viewSpaces(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.viewSpaces:this[L].viewSpaces}get controllers(){return this[L].controllers}get hands(){return this[L].hands}get primaryInputMode(){return this[L].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[L].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if("visible"!==this[L].visibilityState)return[];return("controller"===this[L].primaryInputMode?Object.values(this[L].controllers):Object.values(this[L].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[L].canvasContainer}get canvasDimensions(){if(this[L].canvasData){const{width:e,height:t}=this[L].canvasData.canvas;return{width:e,height:t}}}get activeSession(){var e;return null===(e=this[L].xrSystem)||void 0===e?void 0:e[N].activeSession}get sessionOffered(){var e;return Boolean(null===(e=this[L].xrSystem)||void 0===e?void 0:e[N].offeredSessionConfig)}get name(){return this[L].name}grantOfferedSession(){var e;const t=null===(e=this[L].xrSystem)||void 0===e?void 0:e[N];t&&t.offeredSessionConfig&&(t.grantSession(t.offeredSessionConfig),t.offeredSessionConfig=void 0)}recenter(){const e=new de(-this.position.x,0,-this.position.z),t=new de(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),r=(new le).setFromAxisAngle(new de(0,1,0),i);this.position.add(e),this.quaternion.multiply(r),[...Object.values(this[L].controllers),...Object.values(this[L].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(r),t.position.applyQuaternion(r)})),this[L].pendingReferenceSpaceReset=!0}get visibilityState(){return this[L].visibilityState}updateVisibilityState(e){if(!Object.values(["visible","visible-blurred","hidden"]).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[L].visibilityState&&(this[L].pendingVisibilityState=e)}createActionPlayer(e,t){return this[L].actionPlayer=new qt(e,t,this[L].ipd),this[L].actionPlayer}get devui(){return this[L].devui}get sem(){return this[L].sem}}const Ct={mapping:he.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Vt={mapping:he.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Lt={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},Dt={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},Xt={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},jt={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","hand-tracking"],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Ht={name:"Meta Quest 2",controllerConfig:Lt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Nt={name:"Meta Quest Pro",controllerConfig:Dt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Bt={name:"Meta Quest 3",controllerConfig:Xt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking","depth-sensing"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Gt=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};class Wt{constructor(e,t){this[z]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),r=null===(t=e.getViewerPose(this[z].refSpace))||void 0===t?void 0:t.transform.matrix;if(!r)return;const n={timeStamp:i,position:l(f(),r),quaternion:u(F(),r),inputFrames:[]};this[z].session.inputSources.forEach((t=>{var i,r;if(!this[z].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[z].inputMap.size;this[z].inputMap.set(t,i),this[z].schemaMap.set(i,e)}const s=this[z].inputMap.get(t),a=this[z].schemaMap.get(s),o=null===(i=e.getPose(t.targetRaySpace,this[z].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:s,targetRayTransform:{position:l(f(),o),quaternion:u(F(),o)}};if(a.hasGrip){const n=null===(r=e.getPose(t.gripSpace,this[z].refSpace))||void 0===r?void 0:r.transform.matrix;if(n){const e=l(f(),n),t=u(F(),n);i.gripTransform={position:e,quaternion:t}}}if(a.hasHand){const r=Array.from(t.hand.values());let n=!0;if(n&&(n=e.fillPoses(r,t.targetRaySpace,this[z].jointTransforms)),n&&(n=e.fillJointRadii(r,this[z].jointRadii)),n){const e={};for(let t=0;t<25;t++){const i=this[z].jointTransforms.slice(16*t,16*(t+1)),n=this[z].jointRadii[t],s=l(f(),i),a=u(F(),i);e[r[t].jointName]={position:s,quaternion:a,radius:n}}i.hand=e}}if(a.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}n.inputFrames.push(i)}})),this[z].compressedFrames.push(this.compressActionFrame(n))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...Gt(e.position),...Gt(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,r=this[z].schemaMap.get(i),n=[i,...Gt(e.targetRayTransform.position),...Gt(e.targetRayTransform.quaternion)];if(r.hasGrip&&n.push([...Gt(e.gripTransform.position),...Gt(e.gripTransform.quaternion)]),r.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:r})=>{t.push(...Gt(e),...Gt(i),parseFloat(r.toFixed(3)))})),n.push(t)}r.hasGamepad&&n.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(n)})),t}log(){const e={schema:Array.from(this[z].schemaMap.entries()),frames:this[z].compressedFrames};console.log(JSON.stringify(e))}}export{Wt as ActionRecorder,Fe as NativeMesh,Pe as NativePlane,O as P_ACTION_PLAYER,z as P_ACTION_RECORDER,C as P_ANCHOR,V as P_CONTROLLER,L as P_DEVICE,j as P_FRAME,H as P_GAMEPAD,D as P_HAND_INPUT,se as P_HIT_TEST,B as P_INPUT_SOURCE,U as P_JOINT_POSE,Z as P_JOINT_SPACE,W as P_MESH,Q as P_PLANE,$ as P_POSE,ne as P_RAY,ee as P_REF_SPACE,J as P_RENDER_STATE,_ as P_RIGID_TRANSFORM,Y as P_SESSION,te as P_SPACE,N as P_SYSTEM,X as P_TRACKED_INPUT,ie as P_VIEW,K as P_VIEWER_POSE,re as P_VIEWPORT,G as P_WEBGL_LAYER,ke as XRAnchor,Oe as XRAnchorSet,zt as XRDevice,nt as XRFrame,dt as XRHand,xe as XRInputSource,ve as XRInputSourceArray,we as XRInputSourceEvent,Be as XRInputSourcesChangeEvent,Ye as XRJointPose,lt as XRJointSpace,Ft as XRLayer,be as XRMesh,Ee as XRMeshSet,Ie as XRPlane,Te as XRPlaneSet,Je as XRPose,je as XRRay,Ue as XRReferenceSpace,Tt as XRReferenceSpaceEvent,$e as XRRenderState,De as XRRigidTransform,Re as XRSemanticLabels,ct as XRSession,Ke as XRSessionEvent,ae as XRSpace,Pt as XRSystem,_e as XRView,Ze as XRViewerPose,kt as XRViewport,At as XRWebGLLayer,Ht as metaQuest2,Bt as metaQuest3,Nt as metaQuestPro,jt as oculusQuest1};
1
+ var e=1e-6,t="undefined"!=typeof Float32Array?Float32Array:Array;function i(){var e=new t(16);return t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function r(e){var i=new t(16);return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function s(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=t[5],c=t[6],d=t[7],l=t[8],h=t[9],u=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],x=i*o-r*a,w=i*c-n*a,S=i*d-s*a,y=r*c-n*o,M=r*d-s*o,b=n*d-s*c,E=l*m-h*f,F=l*g-u*f,R=l*v-p*f,A=h*g-u*m,q=h*v-p*m,I=u*v-p*g,T=x*I-w*q+S*A+y*R-M*F+b*E;return T?(T=1/T,e[0]=(o*I-c*q+d*A)*T,e[1]=(n*q-r*I-s*A)*T,e[2]=(m*b-g*M+v*y)*T,e[3]=(u*M-h*b-p*y)*T,e[4]=(c*R-a*I-d*F)*T,e[5]=(i*I-n*R+s*F)*T,e[6]=(g*S-f*b-v*w)*T,e[7]=(l*b-u*S+p*w)*T,e[8]=(a*q-o*R+d*E)*T,e[9]=(r*R-i*q-s*E)*T,e[10]=(f*M-m*S+v*x)*T,e[11]=(h*S-l*M-p*x)*T,e[12]=(o*F-a*A-c*E)*T,e[13]=(i*A-r*F+n*E)*T,e[14]=(m*w-f*y-g*x)*T,e[15]=(l*y-h*w+u*x)*T,e):null}function a(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=t[4],c=t[5],d=t[6],l=t[7],h=t[8],u=t[9],p=t[10],f=t[11],m=t[12],g=t[13],v=t[14],x=t[15],w=i[0],S=i[1],y=i[2],M=i[3];return e[0]=w*r+S*o+y*h+M*m,e[1]=w*n+S*c+y*u+M*g,e[2]=w*s+S*d+y*p+M*v,e[3]=w*a+S*l+y*f+M*x,w=i[4],S=i[5],y=i[6],M=i[7],e[4]=w*r+S*o+y*h+M*m,e[5]=w*n+S*c+y*u+M*g,e[6]=w*s+S*d+y*p+M*v,e[7]=w*a+S*l+y*f+M*x,w=i[8],S=i[9],y=i[10],M=i[11],e[8]=w*r+S*o+y*h+M*m,e[9]=w*n+S*c+y*u+M*g,e[10]=w*s+S*d+y*p+M*v,e[11]=w*a+S*l+y*f+M*x,w=i[12],S=i[13],y=i[14],M=i[15],e[12]=w*r+S*o+y*h+M*m,e[13]=w*n+S*c+y*u+M*g,e[14]=w*s+S*d+y*p+M*v,e[15]=w*a+S*l+y*f+M*x,e}function o(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function c(t,i,r){var n,s,a,o=r[0],c=r[1],d=r[2],l=Math.hypot(o,c,d);return l<e?null:(o*=l=1/l,c*=l,d*=l,n=Math.sin(i),a=1-(s=Math.cos(i)),t[0]=o*o*a+s,t[1]=c*o*a+d*n,t[2]=d*o*a-c*n,t[3]=0,t[4]=o*c*a-d*n,t[5]=c*c*a+s,t[6]=d*c*a+o*n,t[7]=0,t[8]=o*d*a+c*n,t[9]=c*d*a-o*n,t[10]=d*d*a+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function d(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=r+r,c=n+n,d=s+s,l=r*o,h=r*c,u=r*d,p=n*c,f=n*d,m=s*d,g=a*o,v=a*c,x=a*d;return e[0]=1-(p+m),e[1]=h+x,e[2]=u-v,e[3]=0,e[4]=h-x,e[5]=1-(l+m),e[6]=f+g,e[7]=0,e[8]=u+v,e[9]=f-g,e[10]=1-(l+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function l(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function h(e,t){var i=t[0],r=t[1],n=t[2],s=t[4],a=t[5],o=t[6],c=t[8],d=t[9],l=t[10];return e[0]=Math.hypot(i,r,n),e[1]=Math.hypot(s,a,o),e[2]=Math.hypot(c,d,l),e}function u(e,i){var r=new t(3);h(r,i);var n=1/r[0],s=1/r[1],a=1/r[2],o=i[0]*n,c=i[1]*s,d=i[2]*a,l=i[4]*n,u=i[5]*s,p=i[6]*a,f=i[8]*n,m=i[9]*s,g=i[10]*a,v=o+u+g,x=0;return v>0?(x=2*Math.sqrt(v+1),e[3]=.25*x,e[0]=(p-m)/x,e[1]=(f-d)/x,e[2]=(c-l)/x):o>u&&o>g?(x=2*Math.sqrt(1+o-u-g),e[3]=(p-m)/x,e[0]=.25*x,e[1]=(c+l)/x,e[2]=(f+d)/x):u>g?(x=2*Math.sqrt(1+u-o-g),e[3]=(f-d)/x,e[0]=(c+l)/x,e[1]=.25*x,e[2]=(p+m)/x):(x=2*Math.sqrt(1+g-o-u),e[3]=(c-l)/x,e[0]=(f+d)/x,e[1]=(p+m)/x,e[2]=.25*x),e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var p=function(e,t,i,r,n){var s,a=1/Math.tan(t/2);return e[0]=a/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(s=1/(r-n),e[10]=(n+r)*s,e[14]=2*n*r*s):(e[10]=-1,e[14]=-2*r),e};function f(){var e=new t(3);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function m(e,i,r){var n=new t(3);return n[0]=e,n[1]=i,n[2]=r,n}function g(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function v(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e}function x(e,t){var i=t[0],r=t[1],n=t[2],s=i*i+r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function w(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function S(e,t,i){var r=t[0],n=t[1],s=t[2],a=i[0],o=i[1],c=i[2];return e[0]=n*c-s*o,e[1]=s*a-r*c,e[2]=r*o-n*a,e}function y(e,t,i,r){var n=t[0],s=t[1],a=t[2];return e[0]=n+r*(i[0]-n),e[1]=s+r*(i[1]-s),e[2]=a+r*(i[2]-a),e}function M(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function b(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e}function E(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*a,e[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*a,e[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*a,e[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*a,e}function F(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function R(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function A(t,i,r,n){var s,a,o,c,d,l=i[0],h=i[1],u=i[2],p=i[3],f=r[0],m=r[1],g=r[2],v=r[3];return(a=l*f+h*m+u*g+p*v)<0&&(a=-a,f=-f,m=-m,g=-g,v=-v),1-a>e?(s=Math.acos(a),o=Math.sin(s),c=Math.sin((1-n)*s)/o,d=Math.sin(n*s)/o):(c=1-n,d=n),t[0]=c*l+d*f,t[1]=c*h+d*m,t[2]=c*u+d*g,t[3]=c*p+d*v,t}f(),function(){var e=M()}();var q,I=function(e,i,r,n){var s=new t(4);return s[0]=e,s[1]=i,s[2]=r,s[3]=n,s},T=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},P=b,k=function(e,t){var i=t[0],r=t[1],n=t[2],s=t[3],a=i*i+r*r+n*n+s*s;return a>0&&(a=1/Math.sqrt(a)),e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=s*a,e};f(),m(1,0,0),m(0,1,0),F(),F(),q=new t(9),t!=Float32Array&&(q[1]=0,q[2]=0,q[3]=0,q[5]=0,q[6]=0,q[7]=0),q[0]=1,q[4]=1,q[8]=1;const O=Symbol("@iwer/action-player"),z=Symbol("@iwer/action-recorder"),C=Symbol("@iwer/xr-anchor"),V=Symbol("@iwer/xr-controller"),L=Symbol("@iwer/xr-device"),D=Symbol("@iwer/xr-hand-input"),X=Symbol("@iwer/xr-tracked-input"),j=Symbol("@iwer/xr-frame"),H=Symbol("@iwer/gamepad"),N=Symbol("@iwer/xr-system"),B=Symbol("@iwer/xr-input-source"),G=Symbol("@iwer/xr-webgl-layer"),W=Symbol("@iwer/xr-mesh"),Q=Symbol("@iwer/xr-plane"),U=Symbol("@iwer/xr-joint-pose"),$=Symbol("@iwer/xr-pose"),K=Symbol("@iwer/xr-viewer-pose"),_=Symbol("@iwer/xr-rigid-transform"),J=Symbol("@iwer/xr-render-state"),Y=Symbol("@iwer/xr-session"),Z=Symbol("@iwer/xr-joint-space"),ee=Symbol("@iwer/xr-reference-space"),te=Symbol("@iwer/xr-space"),ie=Symbol("@iwer/xr-view"),re=Symbol("@iwer/xr-viewport"),ne=Symbol("@iwer/xr-ray"),se=Symbol("@iwer/xr-hit-test");class ae extends EventTarget{constructor(e,t){super(),this[te]={parentSpace:e,offsetMatrix:t?r(t):i(),emulated:!0}}}class oe extends ae{constructor(){super(void 0,i())}}class ce{static updateOffsetPosition(e,t){o(e[te].offsetMatrix,t)}static updateOffsetQuaternion(e,t){const i=e[te].offsetMatrix,r=f();l(r,i),d(i,t,r)}static updateOffsetMatrix(e,t){n(e[te].offsetMatrix,t)}static calculateGlobalOffsetMatrix(e,t=i()){return a(t,e[te].parentSpace?ce.calculateGlobalOffsetMatrix(e[te].parentSpace):i(),e[te].offsetMatrix),t}}class de{constructor(e=0,t=0,i=0){this.vec3=m(e,t,i),this.tempVec3=f()}get x(){return this.vec3[0]}set x(e){this.vec3[0]=e}get y(){return this.vec3[1]}set y(e){this.vec3[1]=e}get z(){return this.vec3[2]}set z(e){this.vec3[2]=e}set(e,t,i){return v(this.vec3,e,t,i),this}clone(){return new de(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}normalize(){return g(this.tempVec3,this.vec3),x(this.vec3,this.tempVec3),this}add(e){return g(this.tempVec3,this.vec3),function(e,t,i){e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2]}(this.vec3,this.tempVec3,e.vec3),this}applyQuaternion(e){return g(this.tempVec3,this.vec3),function(e,t,i){var r=i[0],n=i[1],s=i[2],a=i[3],o=t[0],c=t[1],d=t[2],l=n*d-s*c,h=s*o-r*d,u=r*c-n*o,p=n*u-s*h,f=s*l-r*u,m=r*h-n*l,g=2*a;l*=g,h*=g,u*=g,p*=2,f*=2,m*=2,e[0]=o+l+p,e[1]=c+h+f,e[2]=d+u+m}(this.vec3,this.tempVec3,e.quat),this}}class le{constructor(e=0,t=0,i=0,r=1){this.quat=I(e,t,i,r),this.tempQuat=F()}get x(){return this.quat[0]}set x(e){this.quat[0]=e}get y(){return this.quat[1]}set y(e){this.quat[1]=e}get z(){return this.quat[2]}set z(e){this.quat[2]=e}get w(){return this.quat[3]}set w(e){this.quat[3]=e}set(e,t,i,r){return P(this.quat,e,t,i,r),this}clone(){return new le(this.x,this.y,this.z,this.w)}copy(e){return P(this.quat,e.x,e.y,e.z,e.w),this}normalize(){return T(this.tempQuat,this.quat),k(this.quat,this.tempQuat),this}invert(){return T(this.tempQuat,this.quat),function(e,t){e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3]}(this.quat,this.tempQuat),this}multiply(e){return T(this.tempQuat,this.quat),function(e,t,i){var r=t[0],n=t[1],s=t[2],a=t[3],o=i[0],c=i[1],d=i[2],l=i[3];e[0]=r*l+a*o+n*d-s*c,e[1]=n*l+a*c+s*o-r*d,e[2]=s*l+a*d+r*c-n*o,e[3]=a*l-r*o-n*c-s*d}(this.quat,this.tempQuat,e.quat),this}setFromAxisAngle(e,t){return R(this.quat,e.vec3,t),this}}var he,ue,pe;!function(e){e.None="",e.Standard="standard",e.XRStandard="xr-standard"}(he||(he={}));class fe{constructor(e,t){this[H]={type:e,eventTrigger:t,pressed:!1,touched:!1,value:0,lastFrameValue:0,pendingValue:null}}get pressed(){return"manual"===this[H].type?this[H].pressed:this[H].value>0}get touched(){return"manual"===this[H].type?this[H].touched:this[H].touched||this.pressed}get value(){return this[H].value}}class me{constructor(){this.pressed=!1,this.touched=!1,this.value=0}}class ge{constructor(e,t="",i=-1){this[H]={id:t,index:i,connected:!1,timestamp:performance.now(),mapping:e.mapping,buttonsMap:{},buttonsSequence:[],axesMap:{},axesSequence:[],hapticActuators:[]},e.buttons.forEach((e=>{var t;null===e?this[H].buttonsSequence.push(null):(this[H].buttonsSequence.push(e.id),this[H].buttonsMap[e.id]=new fe(e.type,null!==(t=e.eventTrigger)&&void 0!==t?t:null))})),e.axes.forEach((e=>{null===e?this[H].axesSequence.push(null):(this[H].axesSequence.push(e.id+e.type),this[H].axesMap[e.id]||(this[H].axesMap[e.id]={x:0,y:0}))}))}get id(){return this[H].id}get index(){return this[H].index}get connected(){return this[H].connected}get timestamp(){return this[H].timestamp}get mapping(){return this[H].mapping}get axes(){const e=[];return this[H].axesSequence.forEach((t=>{if(null===t)e.push(null);else{const i=t.substring(0,t.length-6),r=t.substring(t.length-6);e.push("y-axis"===r?this[H].axesMap[i].y:this[H].axesMap[i].x)}})),e}get buttons(){return this[H].buttonsSequence.map((e=>null===e?new me:this[H].buttonsMap[e]))}get hapticActuators(){return this[H].hapticActuators}get vibrationActuator(){return null}}!function(e){e.None="none",e.Left="left",e.Right="right"}(ue||(ue={})),function(e){e.Gaze="gaze",e.TrackedPointer="tracked-pointer",e.Screen="screen",e.TransientPointer="transient-pointer"}(pe||(pe={}));class ve extends Array{}class xe{constructor(e,t,i,r,n,s,a){this[B]={handedness:e,targetRayMode:t,targetRaySpace:r,gripSpace:s,profiles:i,gamepad:n,hand:a}}get handedness(){return this[B].handedness}get targetRayMode(){return this[B].targetRayMode}get targetRaySpace(){return this[B].targetRaySpace}get gripSpace(){return this[B].gripSpace}get profiles(){return this[B].profiles}get gamepad(){return this[B].gamepad}get hand(){return this[B].hand}}class we extends Event{constructor(e,t){if(super(e,t),!t.frame)throw new Error("XRInputSourceEventInit.frame is required");if(!t.inputSource)throw new Error("XRInputSourceEventInit.inputSource is required");this.frame=t.frame,this.inputSource=t.inputSource}}const Se={[ue.Left]:{position:new de(-.25,1.5,-.4),quaternion:new le},[ue.Right]:{position:new de(.25,1.5,-.4),quaternion:new le},[ue.None]:{position:new de(.25,1.5,-.4),quaternion:new le}};class ye{constructor(e){this[X]={inputSource:e,position:Se[e.handedness].position.clone(),quaternion:Se[e.handedness].quaternion.clone(),connected:!0,lastFrameConnected:!1,inputSourceChanged:!0}}get position(){return this[X].position}get quaternion(){return this[X].quaternion}get inputSource(){return this[X].inputSource}get connected(){return this[X].connected}set connected(e){this[X].connected=e,this[X].inputSource.gamepad[H].connected=e}onFrameStart(e){d(this[X].inputSource.targetRaySpace[te].offsetMatrix,this[X].quaternion.quat,this[X].position.vec3);const t=e.session;this[X].inputSource.gamepad.buttons.forEach((i=>{i instanceof fe&&(i[H].lastFrameValue=i[H].value,null!=i[H].pendingValue&&(i[H].value=i[H].pendingValue,i[H].pendingValue=null),null!=i[H].eventTrigger&&(0===i[H].lastFrameValue&&i[H].value>0?(t.dispatchEvent(new we(i[H].eventTrigger,{frame:e,inputSource:this[X].inputSource})),t.dispatchEvent(new we(i[H].eventTrigger+"start",{frame:e,inputSource:this[X].inputSource}))):i[H].lastFrameValue>0&&0===i[H].value&&t.dispatchEvent(new we(i[H].eventTrigger+"end",{frame:e,inputSource:this[X].inputSource}))))})),this[X].inputSourceChanged=this.connected!==this[X].lastFrameConnected,this[X].lastFrameConnected=this.connected}}class Me extends ye{constructor(e,t,i){if(!e.layout[t])throw new DOMException("Handedness not supported","InvalidStateError");const r=new ae(i),n=e.layout[t].gripOffsetMatrix?new ae(r,e.layout[t].gripOffsetMatrix):void 0,s=[e.profileId,...e.fallbackProfileIds];super(new xe(t,pe.TrackedPointer,s,r,new ge(e.layout[t].gamepad),n)),this[V]={profileId:e.profileId,gamepadConfig:e.layout[t].gamepad}}get gamepadConfig(){return this[V].gamepadConfig}get profileId(){return this[V].profileId}updateButtonValue(e,t){if(t>1||t<0)return void console.warn(`Out-of-range value ${t} provided for button ${e}.`);const i=this[X].inputSource.gamepad[H].buttonsMap[e];if(i){if("binary"===i[H].type&&1!=t&&0!=t)return void console.warn(`Non-binary value ${t} provided for binary button ${e}.`);i[H].pendingValue=t}else console.warn(`Current controller does not have button ${e}.`)}updateButtonTouch(e,t){const i=this[X].inputSource.gamepad[H].buttonsMap[e];i?i[H].touched=t:console.warn(`Current controller does not have button ${e}.`)}updateAxis(e,t,i){if(i>1||i<-1)return void console.warn(`Out-of-range value ${i} provided for ${e} axes.`);const r=this[X].inputSource.gamepad[H].axesMap[e];r?"x-axis"===t?r.x=i:"y-axis"===t&&(r.y=i):console.warn(`Current controller does not have ${e} axes.`)}updateAxes(e,t,i){if(t>1||t<-1||i>1||i<-1)return void console.warn(`Out-of-range value x:${t}, y:${i} provided for ${e} axes.`);const r=this[X].inputSource.gamepad[H].axesMap[e];r?(r.x=t,r.y=i):console.warn(`Current controller does not have ${e} axes.`)}}class be{constructor(e,t,i,r,n){this[W]={nativeMesh:e,frame:void 0,meshSpace:t,vertices:i,indices:r,lastChangedTime:performance.now(),semanticLabel:n}}get meshSpace(){return this[W].meshSpace}get vertices(){return this[W].vertices}get indices(){return this[W].indices}get lastChangedTime(){return this[W].lastChangedTime}get semanticLabel(){return this[W].semanticLabel}}class Ee extends Set{}class Fe{constructor(e,t,i,r){this.transform=e,this.vertices=t,this.indices=i,this.semanticLabel=r}}var Re,Ae;!function(e){e.Desk="desk",e.Couch="couch",e.Floor="floor",e.Ceiling="ceiling",e.Wall="wall",e.Door="door",e.Window="window",e.Table="table",e.Shelf="shelf",e.Bed="bed",e.Screen="screen",e.Lamp="lamp",e.Plant="plant",e.WallArt="wall art",e.GlobalMesh="global mesh",e.Other="other"}(Re||(Re={})),function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(Ae||(Ae={}));const qe={[Re.Desk]:Ae.Horizontal,[Re.Couch]:Ae.Horizontal,[Re.Floor]:Ae.Horizontal,[Re.Ceiling]:Ae.Horizontal,[Re.Wall]:Ae.Vertical,[Re.Door]:Ae.Vertical,[Re.Window]:Ae.Vertical,[Re.Table]:Ae.Horizontal,[Re.Shelf]:Ae.Horizontal,[Re.Bed]:Ae.Horizontal,[Re.Screen]:Ae.Horizontal,[Re.Lamp]:Ae.Horizontal,[Re.Plant]:Ae.Horizontal,[Re.WallArt]:Ae.Vertical};class Ie{constructor(e,t,i,r){this[Q]={nativePlane:e,frame:void 0,planeSpace:t,polygon:i,lastChangedTime:performance.now(),semanticLabel:r,orientation:r?qe[r]:void 0}}get planeSpace(){return this[Q].planeSpace}get polygon(){return this[Q].polygon}get orientation(){return this[Q].orientation}get lastChangedTime(){return this[Q].lastChangedTime}get semanticLabel(){return this[Q].semanticLabel}}class Te extends Set{}class Pe{constructor(e,t,i){this.transform=e,this.polygon=t,this.semanticLabel=i}}class ke{constructor(e,t){this[C]={anchorSpace:e,session:t,deleted:!1},t[Y].trackedAnchors.add(this)}get anchorSpace(){if(this[C].deleted)throw new DOMException("XRAnchor has already been deleted.","InvalidStateError");return this[C].anchorSpace}requestPersistentHandle(){return new Promise(((e,t)=>{if(this[C].deleted)t(new DOMException("XRAnchor has already been deleted.","InvalidStateError"));else{const t=this[C].session[Y].persistentAnchors;for(const[i,r]of t.entries())if(r===this)return void e(i);const i=crypto.randomUUID();Ce.createPersistentAnchor(this[C].session,this,i),e(i)}}))}delete(){this[C].deleted||(this[C].anchorSpace=null,this[C].deleted=!0,this[C].session[Y].trackedAnchors.delete(this))}}class Oe extends Set{}const ze="@immersive-web-emulation-runtime/persistent-anchors";class Ce{static recoverPersistentAnchorsFromStorage(e){const t=JSON.parse(localStorage.getItem(ze)||"{}");Object.entries(t).forEach((([t,i])=>{const r=e[Y].device[L].globalSpace,n=new ae(r,i),s=new ke(n,e);e[Y].persistentAnchors.set(t,s)}))}static createPersistentAnchor(e,t,i){e[Y].trackedAnchors.add(t),e[Y].persistentAnchors.set(i,t);const r=JSON.parse(localStorage.getItem(ze)||"{}");r[i]=Array.from(t[C].anchorSpace[te].offsetMatrix),localStorage.setItem(ze,JSON.stringify(r))}}class Ve{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r,Object.freeze(this)}static fromPoint(e){return new Ve(e.x,e.y,e.z,e.w)}matrixTransform(e){return new Ve}toJSON(){return{x:this.x,y:this.y,z:this.z,w:this.w}}}const Le=void 0!==globalThis.DOMPointReadOnly?globalThis.DOMPointReadOnly:Ve;class De{constructor(e,t){const r=m(0,0,0),n=F();this[_]={matrix:i(),position:e?m(e.x,e.y,e.z):r,orientation:t?k(F(),I(t.x,t.y,t.z,t.w)):n,inverse:null},this.updateMatrix()}updateMatrix(){d(this[_].matrix,this[_].orientation,this[_].position)}get matrix(){return this[_].matrix}get position(){const e=this[_].position;return new Le(e[0],e[1],e[2],1)}get orientation(){const e=this[_].orientation;return new Le(e[0],e[1],e[2],e[3])}get inverse(){if(!this[_].inverse){const e=i();if(!s(e,this[_].matrix))throw new Error("Matrix is not invertible.");let t=f();l(t,e);let r=F();u(r,e),this[_].inverse=new De(new Le(t[0],t[1],t[2],1),new Le(r[0],r[1],r[2],r[3])),this[_].inverse[_].inverse=this}return this[_].inverse}}class Xe{constructor(e=0,t=0,i=0,r=1){this.x=e,this.y=t,this.z=i,this.w=r}}class je{constructor(e,t){const i={x:0,y:0,z:0,w:1},r={x:0,y:0,z:-1,w:0};if(e instanceof De){const t=e.matrix,n=b(M(),i.x,i.y,i.z,i.w),s=b(M(),r.x,r.y,r.z,r.w);E(n,n,t),E(s,s,t),i.x=n[0],i.y=n[1],i.z=n[2],i.w=n[3],r.x=s[0],r.y=s[1],r.z=s[2],r.w=s[3]}else if(e&&(i.x=e.x,i.y=e.y,i.z=e.z,i.w=e.w),t){if(0===t.x&&0===t.y&&0===t.z||1!==t.w)throw new DOMException("Invalid direction value to construct XRRay","TypeError");r.x=t.x,r.y=t.y,r.z=t.z,r.w=t.w}const n=Math.sqrt(r.x*r.x+r.y*r.y+r.z*r.z)||1;r.x=r.x/n,r.y=r.y/n,r.z=r.z/n,this[ne]={origin:new Xe(i.x,i.y,i.z,i.w),direction:new Xe(r.x,r.y,r.z,r.w),matrix:null}}get origin(){return this[ne].origin}get direction(){return this[ne].direction}get matrix(){if(this[ne].matrix)return this[ne].matrix;const e=v(f(),0,0,-1),t=v(f(),this[ne].origin.x,this[ne].origin.y,this[ne].origin.z),r=v(f(),this[ne].direction.x,this[ne].direction.y,this[ne].direction.z),n=S(f(),r,e),s=w(r,e),d=i();s>-1&&s<1?c(d,Math.acos(s),n):-1===s?c(d,Math.acos(s),v(f(),1,0,0)):function(e){e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1}(d);const l=o(i(),t),h=a(i(),l,d);return this[ne].matrix=new Float32Array(h),this[ne].matrix}}class He{constructor(e,t){var i;this[se]={session:e,space:t.space,offsetRay:null!==(i=t.offsetRay)&&void 0!==i?i:new je}}cancel(){this[se].session[Y].hitTestSources.delete(this)}}class Ne{constructor(e,t){this[se]={frame:e,offsetSpace:t}}getPose(e){return this[se].frame.getPose(this[se].offsetSpace,e)}createAnchor(){return this[se].frame.createAnchor(new De,this[se].offsetSpace)}}class Be extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRInputSourcesChangeEventInit.session is required");if(!t.added)throw new Error("XRInputSourcesChangeEventInit.added is required");if(!t.removed)throw new Error("XRInputSourcesChangeEventInit.removed is required");this.session=t.session,this.added=t.added,this.removed=t.removed}}var Ge,We,Qe;!function(e){e.Viewer="viewer",e.Local="local",e.LocalFloor="local-floor",e.BoundedFloor="bounded-floor",e.Unbounded="unbounded"}(We||(We={}));class Ue extends ae{constructor(e,t,i){super(t,i),this[Ge]={type:null,onreset:()=>{}},this[ee].type=e}get onreset(){var e;return null!==(e=this[ee].onreset)&&void 0!==e?e:()=>{}}set onreset(e){this[ee].onreset&&this.removeEventListener("reset",this[ee].onreset),this[ee].onreset=e,e&&this.addEventListener("reset",e)}getOffsetReferenceSpace(e){return new Ue(this[ee].type,this,e)}}Ge=ee;class $e{constructor(e={},t){this[J]={depthNear:e.depthNear||(null==t?void 0:t.depthNear)||.1,depthFar:e.depthFar||(null==t?void 0:t.depthFar)||1e3,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null==t?void 0:t.inlineVerticalFieldOfView)||null,baseLayer:e.baseLayer||(null==t?void 0:t.baseLayer)||null}}get depthNear(){return this[J].depthNear}get depthFar(){return this[J].depthFar}get inlineVerticalFieldOfView(){return this[J].inlineVerticalFieldOfView}get baseLayer(){return this[J].baseLayer}}class Ke extends Event{constructor(e,t){if(super(e,t),!t.session)throw new Error("XRSessionEventInit.session is required");this.session=t.session}}!function(e){e.None="none",e.Left="left",e.Right="right"}(Qe||(Qe={}));class _e{constructor(e,t,i,r){this[ie]={eye:e,projectionMatrix:t,transform:i,recommendedViewportScale:null,requestedViewportScale:1,session:r}}get eye(){return this[ie].eye}get projectionMatrix(){return this[ie].projectionMatrix}get transform(){return this[ie].transform}get recommendedViewportScale(){return this[ie].recommendedViewportScale}requestViewportScale(e){null===e||e<=0||e>1?console.warn("Invalid scale value. Scale must be > 0 and <= 1."):this[ie].requestedViewportScale=e}}class Je{constructor(e,t=!1,i=void 0,r=void 0){this[$]={transform:e,emulatedPosition:t,linearVelocity:i,angularVelocity:r}}get transform(){return this[$].transform}get emulatedPosition(){return this[$].emulatedPosition}get linearVelocity(){return this[$].linearVelocity}get angularVelocity(){return this[$].angularVelocity}}class Ye extends Je{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[U]={radius:t}}get radius(){return this[U].radius}}class Ze extends Je{constructor(e,t,i=!1,r=void 0,n=void 0){super(e,i,r,n),this[K]={views:Object.freeze(t)}}get views(){return this[K].views}}const et=i(),tt=i(),it=i(),rt=(e,t,i)=>{ce.calculateGlobalOffsetMatrix(t,et),ce.calculateGlobalOffsetMatrix(i,tt),s(it,tt),a(e,it,et)};class nt{constructor(e,t,r,n,s){this[j]={session:e,id:t,active:r,animationFrame:n,predictedDisplayTime:s,tempMat4:i(),detectedPlanes:new Te,detectedMeshes:new Ee,trackedAnchors:e[Y].frameTrackedAnchors,hitTestResultsMap:new Map}}get session(){return this[j].session}get predictedDisplayTime(){return this[j].predictedDisplayTime}getPose(e,t){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");rt(this[j].tempMat4,e,t);const i=f();l(i,this[j].tempMat4);const r=F();return u(r,this[j].tempMat4),new Je(new De({x:i[0],y:i[1],z:i[2],w:1},{x:r[0],y:r[1],z:r[2],w:r[3]}),e[te].emulated)}getViewerPose(e){if(!this[j].animationFrame)throw new DOMException("getViewerPose can only be called on XRFrame objects passed to XRSession.requestAnimationFrame callbacks.","InvalidStateError");const t=this[j].session,i=t[Y].device,r=this.getPose(i.viewerSpace,e),n="inline"===t[Y].mode?[Qe.None]:[Qe.Left,Qe.Right],s=[];return n.forEach((r=>{const n=i.viewSpaces[r],a=this.getPose(n,e),o=t[Y].getProjectionMatrix(r),c=new _e(r,new Float32Array(o),a.transform,t);s.push(c)})),new Ze(r.transform,s,!1)}getJointPose(e,t){const i=this.getPose(e,t),r=e[Z].radius;return new Ye(i.transform,r,!1)}fillJointRadii(e,t){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(e.length>t.length)throw new DOMException("The length of jointSpaces is larger than the number of elements in radii","TypeError");let i=!0;for(let r=0;r<e.length;r++)e[r][Z].radius?t[r]=e[r][Z].radius:(t[r]=NaN,i=!1);return i}fillPoses(e,t,i){if(e=Array.from(e),!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");if(16*e.length>i.length)throw new DOMException("The length of spaces multiplied by 16 is larger than the number of elements in transforms","TypeError");return e.forEach(((e,r)=>{rt(this[j].tempMat4,e,t);for(let e=0;e<16;e++)i[16*r+e]=this[j].tempMat4[e]})),!0}get detectedPlanes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedPlanes}get detectedMeshes(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].detectedMeshes}get trackedAnchors(){if(!this[j].active)throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError");return this[j].trackedAnchors}createAnchor(e,t){return new Promise(((i,r)=>{if(this[j].active){const n=this[j].session[Y].device[L].globalSpace,s=new ae(t,e.matrix),a=ce.calculateGlobalOffsetMatrix(s),o=new ae(n,a),c=new ke(o,this[j].session);this[j].session[Y].trackedAnchors.add(c),this[j].session[Y].newAnchors.set(c,{resolve:i,reject:r})}else r(new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError"))}))}getHitTestResults(e){if(this[j].active){if(this[j].hitTestResultsMap.has(e))return[...this[j].hitTestResultsMap.get(e)];throw new DOMException("Requested hit test results are not available for current frame.","InvalidStateError")}throw new DOMException("XRFrame access outside the callback that produced it is invalid.","InvalidStateError")}}var st,at,ot;!function(e){e.Opaque="opaque",e.AlphaBlend="alpha-blend",e.Additive="additive"}(st||(st={})),function(e){e.ScreenSpace="screen-space",e.WorldSpace="world-space"}(at||(at={}));class ct extends EventTarget{constructor(e,t,r){super(),this[Y]={device:e,mode:t,renderState:new $e,pendingRenderState:null,enabledFeatures:r,isSystemKeyboardSupported:!1,ended:!1,projectionMatrices:{[Qe.Left]:i(),[Qe.Right]:i(),[Qe.None]:i()},getProjectionMatrix:e=>this[Y].projectionMatrices[e],referenceSpaceIsSupported:e=>{if(!this[Y].enabledFeatures.includes(e))return!1;switch(e){case We.Viewer:return!0;case We.Local:case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:return"inline"!=this[Y].mode}},frameHandle:0,frameCallbacks:[],currentFrameCallbacks:null,onDeviceFrame:()=>{if(this[Y].ended)return;this[Y].deviceFrameHandle=globalThis.requestAnimationFrame(this[Y].onDeviceFrame),null!=this[Y].pendingRenderState&&(this[Y].renderState=this[Y].pendingRenderState,this[Y].pendingRenderState=null,this[Y].device[L].onBaseLayerSet(this[Y].renderState.baseLayer));const e=this[Y].renderState.baseLayer;if(null===e)return;const t=e.context,i=t.canvas;if("inline"!=this[Y].mode){const e=t.getParameter(t.COLOR_CLEAR_VALUE),i=t.getParameter(t.DEPTH_CLEAR_VALUE),r=t.getParameter(t.STENCIL_CLEAR_VALUE);t.clearColor(0,0,0,0),t.clearDepth(1),t.clearStencil(0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),t.clearColor(e[0],e[1],e[2],e[3]),t.clearDepth(i),t.clearStencil(r)}const{depthNear:r,depthFar:s}=this[Y].renderState,{width:a,height:o}=i;if("inline"!==this[Y].mode){const e=a*(this[Y].device.stereoEnabled?.5:1)/o;p(this[Y].projectionMatrices[Qe.Left],this[Y].device.fovy,e,r,s),n(this[Y].projectionMatrices[Qe.Right],this[Y].projectionMatrices[Qe.Left])}else{const e=a/o;p(this[Y].projectionMatrices[Qe.None],this[Y].renderState.inlineVerticalFieldOfView,e,r,s)}const c=new nt(this,this[Y].frameHandle,!0,!0,performance.now()),d=performance.now(),l=this[Y].device[L].devui;if(l&&l.render(d),"immersive-ar"===this[Y].mode){const e=this[Y].device[L].sem;e&&e.render(d)}this[Y].enabledFeatures.includes("anchors")&&this[Y].updateTrackedAnchors(),this[Y].enabledFeatures.includes("plane-detection")&&this[Y].updateTrackedPlanes(c),this[Y].enabledFeatures.includes("mesh-detection")&&this[Y].updateTrackedMeshes(c),this[Y].enabledFeatures.includes("hit-test")&&this[Y].computeHitTestResults(c),this[Y].device[L].onFrameStart(c),this[Y].updateActiveInputSources();const h=this[Y].currentFrameCallbacks=this[Y].frameCallbacks;this[Y].frameCallbacks=[];const u=performance.now();for(let e=0;e<h.length;e++)try{h[e].cancelled||h[e].callback(u,c)}catch(e){console.error(e)}this[Y].currentFrameCallbacks=null,c[j].active=!1},nominalFrameRate:e.internalNominalFrameRate,referenceSpaces:[],inputSourceArray:[],activeInputSources:[],updateActiveInputSources:()=>{const e=this[Y].enabledFeatures.includes("hand-tracking"),t=this[Y].activeInputSources,i=this[Y].device.inputSources.filter((t=>!t.hand||e)),r=i.filter((e=>!t.includes(e))),n=t.filter((e=>!i.includes(e)));this[Y].activeInputSources=i,(r.length>0||n.length>0)&&this.dispatchEvent(new Be("inputsourceschange",{session:this,added:r,removed:n}))},trackedAnchors:new Oe,persistentAnchors:new Map,newAnchors:new Map,frameTrackedAnchors:new Oe,updateTrackedAnchors:()=>{this[Y].enabledFeatures.includes("anchors")&&(this[Y].frameTrackedAnchors.clear(),Array.from(this[Y].trackedAnchors).forEach((e=>{if(e[C].deleted){if(this[Y].trackedAnchors.delete(e),this[Y].newAnchors.has(e)){const{reject:t}=this[Y].newAnchors.get(e);t(new DOMException("Anchor is no longer tracked","InvalidStateError"))}}else if(this[Y].frameTrackedAnchors.add(e),this[Y].newAnchors.has(e)){const{resolve:t}=this[Y].newAnchors.get(e);t(e),this[Y].newAnchors.delete(e)}})))},trackedPlanes:new Map,updateTrackedPlanes:e=>{const t=this[Y].device[L].sem;if(!t)return;Array.from(this[Y].trackedPlanes.keys()).forEach((e=>{t.trackedPlanes.has(e)||this[Y].trackedPlanes.delete(e)})),t.trackedPlanes.forEach((t=>{let i=this[Y].trackedPlanes.get(t);if(!i){const e=new ae(this[Y].device[L].globalSpace,t.transform.matrix);i=new Ie(t,e,t.polygon,t.semanticLabel),this[Y].trackedPlanes.set(t,i)}i[Q].lastChangedTime=e.predictedDisplayTime,i[Q].frame=e,e[j].detectedPlanes.add(i)}))},trackedMeshes:new Map,updateTrackedMeshes:e=>{const t=this[Y].device[L].sem;if(!t)return;Array.from(this[Y].trackedMeshes.keys()).forEach((e=>{t.trackedMeshes.has(e)||this[Y].trackedMeshes.delete(e)})),t.trackedMeshes.forEach((t=>{let i=this[Y].trackedMeshes.get(t);if(!i){const e=new ae(this[Y].device[L].globalSpace,t.transform.matrix);i=new be(t,e,t.vertices,t.indices,t.semanticLabel),this[Y].trackedMeshes.set(t,i)}i[W].lastChangedTime=e.predictedDisplayTime,i[W].frame=e,e[j].detectedMeshes.add(i)}))},hitTestSources:new Set,computeHitTestResults:e=>{const t=this[Y].device[L].sem;if(!t)return;const r=this[Y].device[L].globalSpace;this[Y].hitTestSources.forEach((n=>{const s=n[se].space,o=ce.calculateGlobalOffsetMatrix(s),c=n[se].offsetRay.matrix,d=i();a(d,o,c);const l=[];t.computeHitTestResults(d).forEach((t=>{const i=new ae(r,t),n=new Ne(e,i);l.push(n)})),e[j].hitTestResultsMap.set(n,l)}))},onend:null,oninputsourceschange:null,onselect:null,onselectstart:null,onselectend:null,onsqueeze:null,onsqueezestart:null,onsqueezeend:null,onvisibilitychange:null,onframeratechange:null},Ce.recoverPersistentAnchorsFromStorage(this),this[Y].onDeviceFrame()}get visibilityState(){return this[Y].device.visibilityState}get frameRate(){return this[Y].nominalFrameRate}get supportedFrameRates(){return new Float32Array(this[Y].device.supportedFrameRates)}get renderState(){return this[Y].renderState}get inputSources(){return this[Y].inputSourceArray.length=0,this[Y].ended||"inline"===this[Y].mode||this[Y].inputSourceArray.push(...this[Y].activeInputSources),this[Y].inputSourceArray}get enabledFeatures(){return this[Y].enabledFeatures}get isSystemKeyboardSupported(){return this[Y].isSystemKeyboardSupported}get environmentBlendMode(){var e;return null!==(e=this[Y].device[L].environmentBlendModes[this[Y].mode])&&void 0!==e?e:st.Opaque}get interactionMode(){return this[Y].device[L].interactionMode}updateRenderState(e={}){var t,i,r,n;if(this[Y].ended)throw new DOMException("XRSession has already ended.","InvalidStateError");if(e.baseLayer&&e.baseLayer[G].session!==this)throw new DOMException("Base layer was created by a different XRSession","InvalidStateError");if(null!=e.inlineVerticalFieldOfView&&"inline"!==this[Y].mode)throw new DOMException("InlineVerticalFieldOfView must not be set for an immersive session","InvalidStateError");const s={baseLayer:e.baseLayer||(null===(t=this[Y].pendingRenderState)||void 0===t?void 0:t.baseLayer)||void 0,depthFar:e.depthFar||(null===(i=this[Y].pendingRenderState)||void 0===i?void 0:i.depthFar)||void 0,depthNear:e.depthNear||(null===(r=this[Y].pendingRenderState)||void 0===r?void 0:r.depthNear)||void 0,inlineVerticalFieldOfView:e.inlineVerticalFieldOfView||(null===(n=this[Y].pendingRenderState)||void 0===n?void 0:n.inlineVerticalFieldOfView)||void 0};this[Y].pendingRenderState=new $e(s,this[Y].renderState)}async updateTargetFrameRate(e){return new Promise(((t,i)=>{this[Y].ended?i(new DOMException("XRSession has already ended.","InvalidStateError")):this[Y].device.supportedFrameRates.includes(e)?(this[Y].nominalFrameRate===e?console.log("Requested frame rate is the same as the current nominal frame rate, no update made"):(this[Y].nominalFrameRate=e,this.dispatchEvent(new Ke("frameratechange",{session:this})),console.log(`Nominal frame rate updated to ${e}`)),t()):i(new DOMException("Requested frame rate not supported.","InvalidStateError"))}))}async requestReferenceSpace(e){return new Promise(((t,i)=>{if(this[Y].ended||!this[Y].referenceSpaceIsSupported(e))return void i(new DOMException("The requested reference space type is not supported.","NotSupportedError"));let r;switch(e){case We.Viewer:r=this[Y].device.viewerSpace;break;case We.Local:r=new Ue(e,this[Y].device[L].globalSpace,this[Y].device.viewerSpace[te].offsetMatrix);break;case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:r=new Ue(e,this[Y].device[L].globalSpace)}this[Y].referenceSpaces.push(r),t(r)}))}requestAnimationFrame(e){if(this[Y].ended)return 0;const t=++this[Y].frameHandle;return this[Y].frameCallbacks.push({handle:t,callback:e,cancelled:!1}),t}cancelAnimationFrame(e){let t=this[Y].frameCallbacks,i=t.findIndex((t=>t&&t.handle===e));i>-1&&(t[i].cancelled=!0,t.splice(i,1)),t=this[Y].currentFrameCallbacks,t&&(i=t.findIndex((t=>t&&t.handle===e)),i>-1&&(t[i].cancelled=!0))}async end(){return new Promise(((e,t)=>{this[Y].ended||null===this[Y].deviceFrameHandle?t(new DOMException("XRSession has already ended.","InvalidStateError")):(globalThis.cancelAnimationFrame(this[Y].deviceFrameHandle),this[Y].device[L].onSessionEnd(),this.dispatchEvent(new Ke("end",{session:this})),e())}))}get persistentAnchors(){return Array.from(this[Y].persistentAnchors.keys())}restorePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Y].persistentAnchors.has(e))if(this[Y].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else{const r=this[Y].persistentAnchors.get(e);this[Y].newAnchors.has(r)?i(new DOMException(`Multiple concurrent attempts detected to restore the anchor with UUID: ${e}.`,"InvalidStateError")):(this[Y].trackedAnchors.add(r),this[Y].newAnchors.set(r,{resolve:t,reject:i}))}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}deletePersistentAnchor(e){return new Promise(((t,i)=>{if(this[Y].persistentAnchors.has(e)){const i=this[Y].persistentAnchors.get(e);this[Y].persistentAnchors.delete(e),i.delete(),t(void 0)}else i(new DOMException(`Persistent anchor with uuid ${e} not found.`,"InvalidStateError"))}))}requestHitTestSource(e){return new Promise(((t,i)=>{if(this[Y].enabledFeatures.includes("hit-test"))if(this[Y].ended)i(new DOMException("XRSession has already ended.","InvalidStateError"));else if(this[Y].device[L].sem){const i=new He(this,e);this[Y].hitTestSources.add(i),t(i)}else i(new DOMException("Synthethic Environment Module required for emulating hit-test","OperationError"));else i(new DOMException('WebXR feature "hit-test" is not supported by current session',"NotSupportedError"))}))}get onend(){var e;return null!==(e=this[Y].onend)&&void 0!==e?e:()=>{}}set onend(e){this[Y].onend&&this.removeEventListener("end",this[Y].onend),this[Y].onend=e,e&&this.addEventListener("end",e)}get oninputsourceschange(){var e;return null!==(e=this[Y].oninputsourceschange)&&void 0!==e?e:()=>{}}set oninputsourceschange(e){this[Y].oninputsourceschange&&this.removeEventListener("inputsourceschange",this[Y].oninputsourceschange),this[Y].oninputsourceschange=e,e&&this.addEventListener("inputsourceschange",e)}get onselect(){var e;return null!==(e=this[Y].onselect)&&void 0!==e?e:()=>{}}set onselect(e){this[Y].onselect&&this.removeEventListener("select",this[Y].onselect),this[Y].onselect=e,e&&this.addEventListener("select",e)}get onselectstart(){var e;return null!==(e=this[Y].onselectstart)&&void 0!==e?e:()=>{}}set onselectstart(e){this[Y].onselectstart&&this.removeEventListener("selectstart",this[Y].onselectstart),this[Y].onselectstart=e,e&&this.addEventListener("selectstart",e)}get onselectend(){var e;return null!==(e=this[Y].onselectend)&&void 0!==e?e:()=>{}}set onselectend(e){this[Y].onselectend&&this.removeEventListener("selectend",this[Y].onselectend),this[Y].onselectend=e,e&&this.addEventListener("selectend",e)}get onsqueeze(){var e;return null!==(e=this[Y].onsqueeze)&&void 0!==e?e:()=>{}}set onsqueeze(e){this[Y].onsqueeze&&this.removeEventListener("squeeze",this[Y].onsqueeze),this[Y].onsqueeze=e,e&&this.addEventListener("squeeze",e)}get onsqueezestart(){var e;return null!==(e=this[Y].onsqueezestart)&&void 0!==e?e:()=>{}}set onsqueezestart(e){this[Y].onsqueezestart&&this.removeEventListener("squeezestart",this[Y].onsqueezestart),this[Y].onsqueezestart=e,e&&this.addEventListener("squeezestart",e)}get onsqueezeend(){var e;return null!==(e=this[Y].onsqueezeend)&&void 0!==e?e:()=>{}}set onsqueezeend(e){this[Y].onsqueezeend&&this.removeEventListener("squeezeend",this[Y].onsqueezeend),this[Y].onsqueezeend=e,e&&this.addEventListener("squeezeend",e)}get onvisibilitychange(){var e;return null!==(e=this[Y].onvisibilitychange)&&void 0!==e?e:()=>{}}set onvisibilitychange(e){this[Y].onvisibilitychange&&this.removeEventListener("visibilitychange",this[Y].onvisibilitychange),this[Y].onvisibilitychange=e,e&&this.addEventListener("visibilitychange",e)}get onframeratechange(){var e;return null!==(e=this[Y].onframeratechange)&&void 0!==e?e:()=>{}}set onframeratechange(e){this[Y].onframeratechange&&this.removeEventListener("frameratechange",this[Y].onframeratechange),this[Y].onframeratechange=e,e&&this.addEventListener("frameratechange",e)}}!function(e){e.Wrist="wrist",e.ThumbMetacarpal="thumb-metacarpal",e.ThumbPhalanxProximal="thumb-phalanx-proximal",e.ThumbPhalanxDistal="thumb-phalanx-distal",e.ThumbTip="thumb-tip",e.IndexFingerMetacarpal="index-finger-metacarpal",e.IndexFingerPhalanxProximal="index-finger-phalanx-proximal",e.IndexFingerPhalanxIntermediate="index-finger-phalanx-intermediate",e.IndexFingerPhalanxDistal="index-finger-phalanx-distal",e.IndexFingerTip="index-finger-tip",e.MiddleFingerMetacarpal="middle-finger-metacarpal",e.MiddleFingerPhalanxProximal="middle-finger-phalanx-proximal",e.MiddleFingerPhalanxIntermediate="middle-finger-phalanx-intermediate",e.MiddleFingerPhalanxDistal="middle-finger-phalanx-distal",e.MiddleFingerTip="middle-finger-tip",e.RingFingerMetacarpal="ring-finger-metacarpal",e.RingFingerPhalanxProximal="ring-finger-phalanx-proximal",e.RingFingerPhalanxIntermediate="ring-finger-phalanx-intermediate",e.RingFingerPhalanxDistal="ring-finger-phalanx-distal",e.RingFingerTip="ring-finger-tip",e.PinkyFingerMetacarpal="pinky-finger-metacarpal",e.PinkyFingerPhalanxProximal="pinky-finger-phalanx-proximal",e.PinkyFingerPhalanxIntermediate="pinky-finger-phalanx-intermediate",e.PinkyFingerPhalanxDistal="pinky-finger-phalanx-distal",e.PinkyFingerTip="pinky-finger-tip"}(ot||(ot={}));class dt extends Map{}class lt extends ae{constructor(e,t,i){super(t,i),this[Z]={jointName:e,radius:0}}get jointName(){return this[Z].jointName}}const ht={profileId:"oculus-hand",fallbackProfileIds:["generic-hand","generic-hand-select","generic-trigger"],poses:{default:{jointTransforms:{wrist:{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.04913589730858803,.0021463718730956316,.11701996624469757,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.07536252588033676,-.9959676265716553,-.04867160692811012,0,.5877083539962769,-.08379616588354111,.8047218918800354,0,-.8055551648139954,.032041035592556,.5916536450386047,0,-.010643752291798592,.0006936835707165301,.08736639469861984,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.1374533325433731,-.9904957413673401,.004982374142855406,0,.5534393787384033,.08097179979085922,.8289443850517273,0,-.8214688897132874,-.11118389666080475,.559309184551239,0,.015547193586826324,-.0003480653394944966,.0681300163269043,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.04330715537071228,.003409178927540779,.0492292083799839,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.04659227654337883,-.9974699020385742,-.05369402840733528,0,.6812446117401123,-.07104194164276123,.728600800037384,0,-.7305715084075928,-.002631746232509613,.6828309893608093,0,.062003348022699356,.004069602582603693,.03322213143110275,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.02009812369942665,.008770795539021492,.08660387247800827,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9001791477203369,-.2598813474178314,.3494834005832672,0,.06073702871799469,.8695210218429565,.490146666765213,0,-.4312632381916046,-.41999316215515137,.7985095381736755,0,-.00017739279428496957,.03890012577176094,.039073407649993896,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9082008600234985,-.20898112654685974,.36262574791908264,0,.11045389622449875,.9553793668746948,.27395179867744446,0,-.40369608998298645,-.20874978601932526,.8907597661018372,0,.01617925800383091,.05482936650514603,.008788082748651505,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.02599053829908371,.059902746230363846,-.012860597111284733,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9309692978858948,-.16783711314201355,.32423174381256104,0,.1080828532576561,.9749603867530823,.1943446695804596,0,-.34873148798942566,-.14588497579097748,.9257990717887878,0,.03362493962049484,.06421422213315964,-.033461250364780426,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.03627845644950867,.011579737067222595,.08550142496824265,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9876697659492493,-.06786545366048813,.1410750150680542,0,-.015095947310328484,.855663537979126,.5173118710517883,0,-.15582047402858734,-.5130629539489746,.8440889716148376,0,-.021259509027004242,.04587256908416748,.03659208118915558,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.988391637802124,-.04354291781783104,.14555205404758453,0,.008894841186702251,.9729899168014526,.23067504167556763,0,-.15166506171226501,-.22670257091522217,.9620829224586487,0,-.014570588245987892,.06789684295654297,.0003578895702958107,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.010392282158136368,.07414241135120392,-.026147106662392616,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9853697419166565,.044260796159505844,.16458062827587128,0,-.0757969319820404,.9787378311157227,.19059516489505768,0,-.1526455283164978,-.20028135180473328,.9677740931510925,0,-.0069718430750072,.08024183660745621,-.05014154314994812,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9616971015930176,-.13805118203163147,.2368120402097702,0,.0005348679260350764,.8648636937141418,.5020061135292053,0,-.2741127610206604,-.48265108466148376,.8318111300468445,0,-.05402477830648422,.015797706320881844,.08152295649051666,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9940828680992126,.05735103040933609,.09224652498960495,0,-.10022822767496109,.8116500377655029,.5754809379577637,0,-.041867565363645554,-.5813214182853699,.8125960826873779,0,-.041623555123806,.04171867296099663,.03582974523305893,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9843675494194031,.12044742703437805,.12850022315979004,0,-.15629759430885315,.9337108135223389,.3221098482608795,0,-.08118485659360886,-.3371586799621582,.937940776348114,0,-.039990875869989395,.06438793987035751,.004141641780734062,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03783353418111801,.07334739714860916,-.020782606676220894,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9748351573944092,.11857274919748306,.18877571821212769,0,-.15575434267520905,.9681083559989929,.19623035192489624,0,-.15948788821697235,-.22069483995437622,.9622148275375366,0,-.03445569798350334,.0802423357963562,-.04392268508672714,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9181402921676636,.35625091195106506,.17350243031978607,0,-.39615097641944885,.8352503180503845,.38134080171585083,0,-.009065053425729275,-.41885748505592346,.9080066680908203,0,-.06191859766840935,.013620133511722088,.07850203663110733,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9714386463165283,.236698180437088,-.016745081171393394,0,-.18462024629116058,.7982627749443054,.5733163952827454,0,.14906984567642212,-.5538501739501953,.8191629648208618,0,-.061502378433942795,.032741155475378036,.03705105185508728,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9337416291236877,.35620439052581787,-.03527557849884033,0,-.33203884959220886,.8987522721290588,.28634607791900635,0,.13370157778263092,-.2556603252887726,.9574766755104065,0,-.06608185172080994,.049755651503801346,.011886020191013813,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.0687975287437439,.054948460310697556,-.007561664097011089,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9419984817504883,.3303581774234772,.059175245463848114,0,-.33483216166496277,.9130291938781738,.23294763267040253,0,.02292730286717415,-.2392500638961792,.970687210559845,0,-.06947512179613113,.0613851435482502,-.028543535619974136,1],radius:.005425984505563974}},gripOffsetMatrix:[-.0005348679260350764,-.8648636937141418,-.5020061135292053,0,-.2741127908229828,-.48265108466148376,.8318111896514893,0,-.9616971015930176,.13805119693279266,-.2368120402097702,0,-.02878567762672901,.0017147823236882687,.04536811262369156,1]},pinch:{jointTransforms:{wrist:{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06867414712905884,-.009423808194696903,.10627774149179459,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[-.5012241005897522,-.8650535345077515,-.0213695727288723,0,.7415963411331177,-.4421543478965759,.5045139193534851,0,-.44587990641593933,.23702676594257355,.8631392121315002,0,-.032122574746608734,-.01196830440312624,.07194234430789948,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[-.3175753057003021,-.9460570216178894,-.06419729441404343,0,.8958902955055237,-.32153913378715515,.30658137798309326,0,-.3106854259967804,.03984907269477844,.9496771097183228,0,-.017625702545046806,-.01967475935816765,.04387917369604111,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,-.007126678712666035,-.021021386608481407,.011786630377173424,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[-.4944636821746826,-.8691971898078918,.001086252392269671,0,.8307800889015198,-.4722411036491394,.2946045398712158,0,-.25555649399757385,.14657381176948547,.9556186199188232,0,.0003423091256991029,-.024528030306100845,-.011410919018089771,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.038037415593862534,-.0020236473064869642,.07626739144325256,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.7986818552017212,-.35985732078552246,.48229536414146423,0,.538311243057251,.7854709625244141,-.30537736415863037,0,-.2689369022846222,.5035246014595032,.8210577368736267,0,-.006869405973702669,.033938243985176086,.04206443578004837,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.8285930156707764,-.32672837376594543,.4546217918395996,0,.5577570199966431,.4116027057170868,-.7207564115524292,0,.04836784675717354,.8507823944091797,.5232869386672974,0,.0033306588884443045,.014840902760624886,.010923954658210278,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,.0021551470272243023,-.0058362227864563465,-.0017938464879989624,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.8412464261054993,-.35794928669929504,.4051857888698578,0,.5139996409416199,.29711154103279114,-.8046918511390686,0,.16765329241752625,.8852096796035767,.4339304566383362,0,-.00131594471167773,-.025222131982445717,-.012442642822861671,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.05395089089870453,.003063359996303916,.07402937114238739,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9187911748886108,-.1530158370733261,.36387869715690613,0,.038666240870952606,.9522662162780762,.302808940410614,0,-.3928440511226654,-.26414817571640015,.8808513283729553,0,-.02717282809317112,.04162866622209549,.03678669035434723,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9228746294975281,-.12856416404247284,.36300456523895264,0,.14524033665657043,.9892153143882751,-.01890045404434204,0,-.3566599190235138,.07016586512327194,.9315956234931946,0,-.01030921470373869,.05296773463487625,-.0010256498353555799,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,-.0004833847051486373,.05103470757603645,-.026690717786550522,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9325166344642639,-.040404170751571655,.35885775089263916,0,.06836572289466858,.995502769947052,-.0655682161450386,0,-.3545948565006256,.08567725121974945,.9310863614082336,0,.008158999495208263,.05004044249653816,-.050120558589696884,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9060805439949036,-.1844543218612671,.3807799518108368,0,-.08027800172567368,.8086723685264587,.5827555656433105,0,-.4154181182384491,-.5585917234420776,.7179155349731445,0,-.06732909381389618,.007902119308710098,.07209732383489609,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9391821026802063,-.027994679287075996,.34227466583251953,0,-.18282271921634674,.8029410243034363,.5673282742500305,0,-.2907087206840515,-.5954000353813171,.7489906549453735,0,-.047129884362220764,.03806127607822418,.032147664576768875,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9249380826950073,.03699534013867378,.3783116042613983,0,-.12898847460746765,.9667453765869141,.2208271026611328,0,-.3575615882873535,-.25304901599884033,.8989526629447937,0,-.03579339757561684,.06127955764532089,.002939916681498289,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.026291755959391594,.06800390034914017,-.02094830758869648,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9001164436340332,.03983335196971893,.4338230490684509,0,-.09662467986345291,.9892624020576477,.10964841395616531,0,-.4247973561286926,-.14061418175697327,.8943013548851013,0,-.016345610842108727,.07300511747598648,-.04263874143362045,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.8769711852073669,.31462907791137695,.36322021484375,0,-.4506046175956726,.801031768321991,.39408499002456665,0,-.16696058213710785,-.5092697143554688,.8442559838294983,0,-.07460174709558487,.0062340241856873035,.06756893545389175,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9498357176780701,.1553308218717575,.2714462876319885,0,-.3019258379936218,.6817675232887268,.6663586497306824,0,-.08155745267868042,-.7148879170417786,.694466233253479,0,-.06697750836610794,.029482364654541016,.02902858518064022,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9214097261428833,.27928245067596436,.2701927423477173,0,-.3670244514942169,.8538867831230164,.36901235580444336,0,-.12765564024448395,-.43917882442474365,.8892839550971985,0,-.06447203457355499,.05144399777054787,.0076942890882492065,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.06187915802001953,.060364335775375366,-.010368337854743004,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9038633704185486,.23618005216121674,.3567195236682892,0,-.3532794713973999,.8823202252388,.3109731376171112,0,-.24129553139209747,-.4070987403392792,.8809353709220886,0,-.056796226650476456,.07042007893323898,-.02921444922685623,1],radius:.005425984505563974}},gripOffsetMatrix:[.08027800917625427,-.8086723685264587,-.5827556252479553,0,-.4154181480407715,-.5585916638374329,.7179154753684998,0,-.9060805439949036,.1844543218612671,-.3807799518108368,0,-.038054611533880234,-.002910431008785963,.03720742464065552,1]},point:{jointTransforms:{wrist:{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05789132043719292,.01670890860259533,.11183350533246994,1],radius:.021460847929120064},"thumb-metacarpal":{offsetMatrix:[.02145560085773468,-.9978390336036682,.0621047280728817,0,.41311800479888916,.06541631370782852,.9083252549171448,0,-.9104245901107788,.006167683284729719,.4136286973953247,0,-.016488194465637207,.012708572670817375,.08862338215112686,1],radius:.019382517784833908},"thumb-phalanx-proximal":{offsetMatrix:[.21270370483398438,-.966137707233429,.14606566727161407,0,.49890995025634766,.2359165996313095,.8339261412620544,0,-.8401462435722351,-.10450579971075058,.5321959853172302,0,.013112368993461132,.012508046813309193,.07517509907484055,1],radius:.01228295173496008},"thumb-phalanx-distal":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.04150351136922836,.016039609909057617,.05719054117798805,1],radius:.009768804535269737},"thumb-tip":{offsetMatrix:[.01653280481696129,-.9986647963523865,.048943229019641876,0,.26313456892967224,.051570065319538116,.9633802771568298,0,-.9646173715591431,-.0030490627977997065,.26363563537597656,0,.06548332422971725,.01683700829744339,.0516640841960907,1],radius:.008768804371356964},"index-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.02592567168176174,.019982583820819855,.08479326963424683,1],radius:.021228281781077385},"index-finger-phalanx-proximal":{offsetMatrix:[.9063700437545776,-.21756279468536377,.3621589243412018,0,.0970839336514473,.9415287375450134,.3226419687271118,0,-.41117796301841736,-.2572731077671051,.8744958639144897,0,-.0015709538711234927,.043078210204839706,.034657616168260574,1],radius:.010295259766280651},"index-finger-phalanx-intermediate":{offsetMatrix:[.9159826040267944,-.1651475727558136,.36565208435058594,0,.09755707532167435,.9756820797920227,.1962820291519165,0,-.3891757130622864,-.14411886036396027,.9098196625709534,0,.014023927971720695,.052835866808891296,.0014903299743309617,1],radius:.00853810179978609},"index-finger-phalanx-distal":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.023482320830225945,.05633850023150444,-.020621655508875847,1],radius:.007636196445673704},"index-finger-tip":{offsetMatrix:[.9378057718276978,-.12329639494419098,.3245268166065216,0,.032558172941207886,.9619227051734924,.2713746726512909,0,-.3456292748451233,-.2439306229352951,.9061115384101868,0,.03096788562834263,.06281610578298569,-.040703095495700836,1],radius:.006636196281760931},"middle-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.04184452444314957,.022474845871329308,.08177298307418823,1],radius:.021231964230537415},"middle-finger-phalanx-proximal":{offsetMatrix:[.9720265865325928,-.08313076198101044,.21966552734375,0,.20477405190467834,.7580050826072693,-.6192700862884521,0,-.11502730846405029,.6469289064407349,.7538246512413025,0,-.022107340395450592,.05035499855875969,.02970452979207039,1],radius:.01117393933236599},"middle-finger-phalanx-intermediate":{offsetMatrix:[.9779140949249268,-.07129573822021484,.19646917283535004,0,.1287083923816681,-.5352076292037964,-.8348574042320251,0,.1646735966205597,.8417060971260071,-.5142109394073486,0,-.017169542610645294,.022584279999136925,-.00265491777099669,1],radius:.008030958473682404},"middle-finger-phalanx-distal":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02170622907578945,-.0006043742760084569,.011511396616697311,1],radius:.007629410829395056},"middle-finger-tip":{offsetMatrix:[.9774913787841797,-.19657190144062042,.07661263644695282,0,-.1924918293952942,-.9796126484870911,-.05749811604619026,0,.08635343611240387,.041456472128629684,-.995401918888092,0,-.02438267692923546,-.0026927536819130182,.03627248480916023,1],radius:.006629410665482283},"ring-finger-metacarpal":{offsetMatrix:[.9340395331382751,-.13936476409435272,.32885703444480896,0,-.005510995630174875,.914999783039093,.40341612696647644,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.05944233387708664,.0264605600386858,.07478221505880356,1],radius:.019088275730609894},"ring-finger-phalanx-proximal":{offsetMatrix:[.9842101335525513,.024470895528793335,.1753024309873581,0,.12200043350458145,.6237703561782837,-.7720272541046143,0,-.12824076414108276,.7812241315841675,.610936164855957,0,-.04249368980526924,.0467497780919075,.027722163125872612,1],radius:.00992213748395443},"ring-finger-phalanx-intermediate":{offsetMatrix:[.9941774606704712,.05949164181947708,.08983955532312393,0,.10504482686519623,-.7208291888237,-.6851072907447815,0,.024001073092222214,.6905553936958313,-.7228817939758301,0,-.0374927744269371,.016285063698887825,.0038980208337306976,1],radius:.007611672393977642},"ring-finger-phalanx-distal":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.038130562752485275,-.0020653479732573032,.02310742810368538,1],radius:.007231088820844889},"ring-finger-tip":{offsetMatrix:[.9995742440223694,.01638498157262802,.02412819117307663,0,.007813597097992897,-.9474818110466003,.31971633434295654,0,.028100071474909782,-.31939181685447693,-.9472070932388306,0,-.0390593595802784,.004176302347332239,.0466572530567646,1],radius:.0062310886569321156},"pinky-finger-metacarpal":{offsetMatrix:[.9147363901138306,.3458845317363739,.20885537564754486,0,-.3923271894454956,.8839452862739563,.2544005811214447,0,-.09662359952926636,-.3146490156650543,.9442773461341858,0,-.06715242564678192,.024195827543735504,.07137546688318253,1],radius:.01808827556669712},"pinky-finger-phalanx-proximal":{offsetMatrix:[.9613109827041626,.22439135611057281,.15977802872657776,0,.01002211682498455,.5511574745178223,-.8343409299850464,0,-.27528178691864014,.8036624789237976,.5275853276252747,0,-.06273911893367767,.038559623062610626,.028268879279494286,1],radius:.008483353070914745},"pinky-finger-phalanx-intermediate":{offsetMatrix:[.9820972084999084,.18811029195785522,-.00995189044624567,0,.14063723385334015,-.7673450708389282,-.6256227493286133,0,-.12532226741313934,.6130226850509644,-.7800630927085876,0,-.05428232625126839,.013870777562260628,.012061242014169693,1],radius:.0067641944624483585},"pinky-finger-phalanx-distal":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05173685774207115,.0014194445684552193,.02790539152920246,1],radius:.0064259846694767475},"pinky-finger-tip":{offsetMatrix:[.9744614362716675,.20454788208007812,-.09265263378620148,0,.22429193556308746,-.9065253138542175,.35764020681381226,0,-.010836843401193619,-.3692878782749176,-.9292529225349426,0,-.05098633095622063,.008463085629045963,.048688892275094986,1],radius:.005425984505563974}},gripOffsetMatrix:[.005510995630174875,-.9149997234344482,-.40341615676879883,0,-.3571262061595917,-.37861889600753784,.8538784384727478,0,-.9340395331382751,.13936474919319153,-.32885703444480896,0,-.031803809106349945,.007837686687707901,.04313928261399269,1]}}},ut={mapping:he.None,buttons:[{id:"pinch",type:"analog",eventTrigger:"select"}],axes:[]},pt=f(),ft=F(),mt=f(),gt=f(),vt=F(),xt=f(),wt=f(),St=F(),yt=f(),Mt=(e,t,i,r)=>(l(pt,t),u(ft,t),h(mt,t),l(gt,i),u(vt,i),h(xt,i),y(wt,pt,gt,r),A(St,ft,vt,r),y(yt,mt,xt,r),function(e,t,i,r){var n=t[0],s=t[1],a=t[2],o=t[3],c=n+n,d=s+s,l=a+a,h=n*c,u=n*d,p=n*l,f=s*d,m=s*l,g=a*l,v=o*c,x=o*d,w=o*l,S=r[0],y=r[1],M=r[2];e[0]=(1-(f+g))*S,e[1]=(u+w)*S,e[2]=(p-x)*S,e[3]=0,e[4]=(u-w)*y,e[5]=(1-(h+g))*y,e[6]=(m+v)*y,e[7]=0,e[8]=(p+x)*M,e[9]=(m-v)*M,e[10]=(1-(h+f))*M,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1}(e,St,wt,yt),e),bt=[1,-1,-1,0,-1,1,1,0,-1,1,1,0,-1,1,1,1];class Et extends ye{constructor(e,t,i){if(t!==ue.Left&&t!==ue.Right)throw new DOMException('handedness for XRHandInput must be either "left" or "right"',"InvalidStateError");if(!e.poses.default||!e.poses.pinch)throw new DOMException('"default" and "pinch" hand pose configs are required',"InvalidStateError");const r=new ae(i),n=new ae(r),s=[e.profileId,...e.fallbackProfileIds],a=new dt;Object.values(ot).forEach((e=>{a.set(e,new lt(e,r))}));super(new xe(t,pe.TrackedPointer,s,r,new ge(ut),n,a)),this[D]={poseId:"default",poses:e.poses},this.updateHandPose()}get poseId(){return this[D].poseId}set poseId(e){this[D].poses[e]?this[D].poseId=e:console.warn(`Pose config ${e} not found`)}updateHandPose(){const e=this[D].poses[this[D].poseId],t=this[D].poses.pinch;Object.values(ot).forEach((i=>{const r=e.jointTransforms[i].offsetMatrix,n=t.jointTransforms[i].offsetMatrix,s=this.inputSource.hand.get(i);Mt(s[te].offsetMatrix,r,n,this.pinchValue),this.inputSource.handedness===ue.Right&&(e=>{for(let t=0;t<16;t++)e[t]*=bt[t]})(s[te].offsetMatrix),s[Z].radius=(1-this.pinchValue)*e.jointTransforms[i].radius+this.pinchValue*t.jointTransforms[i].radius})),e.gripOffsetMatrix&&t.gripOffsetMatrix&&Mt(this.inputSource.gripSpace[te].offsetMatrix,e.gripOffsetMatrix,t.gripOffsetMatrix,this.pinchValue)}get pinchValue(){return this[X].inputSource.gamepad[H].buttonsMap.pinch.value}updatePinchValue(e){if(e>1||e<0)return void console.warn(`Out-of-range value ${e} provided for pinch`);this[X].inputSource.gamepad[H].buttonsMap.pinch[H].pendingValue=e}onFrameStart(e){super.onFrameStart(e),this.updateHandPose()}}class Ft extends EventTarget{}const Rt={antialias:!0,depth:!0,stencil:!1,alpha:!0,ignoreDepthValues:!1,framebufferScaleFactor:1};class At extends Ft{constructor(e,t,i={}){if(super(),e[Y].ended)throw new DOMException("Session has ended","InvalidStateError");const r={...Rt,...i};this[G]={session:e,context:t,antialias:r.antialias}}get context(){return this[G].context}get antialias(){return this[G].antialias}get ignoreDepthValues(){return!0}get framebuffer(){return null}get framebufferWidth(){return this[G].context.drawingBufferWidth}get framebufferHeight(){return this[G].context.drawingBufferHeight}getViewport(e){if(e[ie].session!==this[G].session)throw new DOMException("View's session differs from Layer's session","InvalidStateError");return this[G].session[Y].device[L].getViewport(this,e)}static getNativeFramebufferScaleFactor(e){if(!(e instanceof ct))throw new TypeError("getNativeFramebufferScaleFactor must be passed a session.");return e[Y].ended?0:1}}class qt{constructor(e,t,i){const{schema:r,frames:n}=t;if(!n||!r||0===n.length)throw new DOMException("wrong recording format","NotSupportedError");const s=new Ue(We.Viewer,e),a={[Qe.Left]:new ae(s),[Qe.Right]:new ae(s),[Qe.None]:new ae(s)};this[O]={refSpace:e,inputSources:new Map,inputSchemas:new Map,frames:n,recordedFramePointer:0,startingTimeStamp:n[0][0],endingTimeStamp:n[n.length-1][0],playbackTime:n[0][0],playing:!1,viewerSpace:s,viewSpaces:a,vec3:f(),quat:F()},o(this[O].viewSpaces[Qe.Left][te].offsetMatrix,m(-i/2,0,0)),o(this[O].viewSpaces[Qe.Right][te].offsetMatrix,m(i/2,0,0)),r.forEach((t=>{const i=t[0],r=t[1];let n;if(r.hasGamepad){const e=[];for(let t=0;t<r.numButtons;t++)e.push({id:t.toString(),type:"manual"});const t=[];for(let e=0;e<r.numAxes;e++)t.push({id:e.toString(),type:"manual"});n=new ge({mapping:r.mapping,buttons:e,axes:t})}const s=new ae(e);let a;r.hasHand&&(a=new dt,Object.values(ot).forEach((e=>{a.set(e,new lt(e,s))})));const o=new xe(r.handedness,r.targetRayMode,r.profiles,s,n,r.hasGrip?new ae(e):void 0,r.hasHand?a:void 0);this[O].inputSources.set(i,{active:!1,source:o}),this[O].inputSchemas.set(i,r)}))}play(){this[O].recordedFramePointer=0,this[O].playbackTime=this[O].startingTimeStamp,this[O].playing=!0,this[O].actualTimeStamp=performance.now()}stop(){this[O].playing=!1}get playing(){return this[O].playing}get viewerSpace(){return this[O].viewerSpace}get viewSpaces(){return this[O].viewSpaces}get inputSources(){return Array.from(this[O].inputSources.values()).filter((e=>e.active)).map((e=>e.source))}playFrame(){const e=performance.now(),t=e-this[O].actualTimeStamp;if(this[O].actualTimeStamp=e,this[O].playbackTime+=t,this[O].playbackTime>this[O].endingTimeStamp)return void this.stop();for(;this[O].frames[this[O].recordedFramePointer+1][0]<this[O].playbackTime;)this[O].recordedFramePointer++;const i=this[O].frames[this[O].recordedFramePointer],r=this[O].frames[this[O].recordedFramePointer+1],n=(this[O].playbackTime-i[0])/(r[0]-i[0]);this.updateXRSpaceFromMergedFrames(this[O].viewerSpace,i.slice(1,8),r.slice(1,8),n);const s=new Map;for(let e=8;e<i.length;e++){const{index:t,inputData:r}=this.processRawInputData(i[e]);s.set(t,r)}const a=new Map;for(let e=8;e<r.length;e++){const{index:t,inputData:i}=this.processRawInputData(r[e]);a.set(t,i)}this[O].inputSources.forEach((e=>{e.active=!1})),a.forEach(((e,t)=>{this[O].inputSources.get(t).active=!0;const i=this[O].inputSources.get(t).source,r=this[O].inputSchemas.get(t);this.updateInputSource(i,r,s.has(t)?s.get(t):e,e,n)}))}updateInputSource(e,t,i,r,n){if(this.updateXRSpaceFromMergedFrames(e.targetRaySpace,i.targetRayTransform,r.targetRayTransform,n),t.hasGrip&&this.updateXRSpaceFromMergedFrames(e.gripSpace,i.gripTransform,r.gripTransform,n),t.hasHand)for(let s=0;s<25;s++){const a=i.handTransforms.slice(8*s,8*s+7),o=r.handTransforms.slice(8*s,8*s+7),c=i.handTransforms[8*s+7],d=r.handTransforms[8*s+7],l=e.hand.get(t.jointSequence[s]);this.updateXRSpaceFromMergedFrames(l,a,o,n),l[Z].radius=(d-c)*n+c}if(t.hasGamepad){const t=e.gamepad;r.buttons.forEach(((e,r)=>{const s=t.buttons[r];s[H].pressed=1===e[0],s[H].touched=1===e[1];const a=i.buttons[r][2],o=e[2];s[H].value=(o-a)*n+a})),r.axes.forEach(((e,r)=>{const s=i.axes[r];t[H].axesMap[r.toString()].x=(e-s)*n+s}))}}updateXRSpaceFromMergedFrames(e,t,i,r){const n=m(t[0],t[1],t[2]),s=I(t[3],t[4],t[5],t[6]),a=m(i[0],i[1],i[2]),o=I(i[3],i[4],i[5],i[6]);y(this[O].vec3,n,a,r),A(this[O].quat,s,o,r),d(e[te].offsetMatrix,this[O].quat,this[O].vec3)}processRawInputData(e){const t=e[0],i=this[O].inputSchemas.get(t),r={targetRayTransform:e.slice(1,8)};let n=8;if(i.hasGrip&&(r.gripTransform=e[n++]),i.hasHand&&(r.handTransforms=e[n++]),i.hasGamepad){const t=e[n];r.buttons=t.slice(0,i.numButtons),r.axes=t.slice(i.numButtons)}return{index:t,inputData:r}}}const It="2.0.1";class Tt extends Event{constructor(e,t){if(super(e,t),!t.referenceSpace)throw new Error("XRReferenceSpaceEventInit.referenceSpace is required");this.referenceSpace=t.referenceSpace,this.transform=t.transform}}class Pt extends EventTarget{constructor(e){super(),this[N]={device:e,grantSession:({resolve:e,reject:t,mode:i,options:r})=>{if(this[N].activeSession)return void t(new DOMException("An active XRSession already exists.","InvalidStateError"));const{requiredFeatures:n=[],optionalFeatures:s=[]}=r,{supportedFeatures:a}=this[N].device;if(!n.every((e=>a.includes(e))))return void t(new Error("One or more required features are not supported by the device."));const o=s.filter((e=>a.includes(e))),c=Array.from(new Set([...n,...o,"viewer","local"])),d=new ct(this[N].device,i,c);this[N].activeSession=d,d.addEventListener("end",(()=>{this[N].activeSession=void 0})),e(d)}}}isSessionSupported(e){return new Promise(((t,i)=>{t("inline"===e||this[N].device.supportedSessionModes.includes(e))}))}requestSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{if(!n)return void r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"));const s={resolve:i,reject:r,mode:e,options:t};this[N].grantSession(s)})).catch(r)}))}offerSession(e,t={}){return new Promise(((i,r)=>{this.isSessionSupported(e).then((n=>{n?this[N].offeredSessionConfig={resolve:i,reject:r,mode:e,options:t}:r(new DOMException("The requested XRSession mode is not supported.","NotSupportedError"))})).catch(r)}))}}class kt{constructor(e,t,i,r){this[re]={x:e,y:t,width:i,height:r}}get x(){return this[re].x}get y(){return this[re].y}get width(){return this[re].width}get height(){return this[re].height}}const Ot={ipd:.063,fovy:Math.PI/2,headsetPosition:new de(0,1.6,0),headsetQuaternion:new le,stereoEnabled:!1};class zt{constructor(e,t={}){var r,n,s,a,c,l;this.version=It;const h=new oe,u=new Ue(We.Viewer,h),p={[Qe.Left]:new ae(u),[Qe.Right]:new ae(u),[Qe.None]:new ae(u)},f=e.controllerConfig,g={};f&&Object.values(ue).forEach((e=>{f.layout[e]&&(g[e]=new Me(f,e,h))}));const v={[ue.Left]:new Et(ht,ue.Left,h),[ue.Right]:new Et(ht,ue.Right,h)},x=null!==(r=t.canvasContainer)&&void 0!==r?r:document.createElement("div");x.dataset.webxr_runtime=`Immersive Web Emulation Runtime v${It}`,x.style.position="fixed",x.style.width="100%",x.style.height="100%",x.style.top="0",x.style.left="0",x.style.display="flex",x.style.justifyContent="center",x.style.alignItems="center",x.style.overflow="hidden",x.style.zIndex="999",this[L]={name:e.name,supportedSessionModes:e.supportedSessionModes,supportedFeatures:e.supportedFeatures,supportedFrameRates:e.supportedFrameRates,isSystemKeyboardSupported:e.isSystemKeyboardSupported,internalNominalFrameRate:e.internalNominalFrameRate,environmentBlendModes:e.environmentBlendModes,interactionMode:e.interactionMode,userAgent:e.userAgent,position:null!==(n=t.headsetPosition)&&void 0!==n?n:Ot.headsetPosition.clone(),quaternion:null!==(s=t.headsetQuaternion)&&void 0!==s?s:Ot.headsetQuaternion.clone(),stereoEnabled:null!==(a=t.stereoEnabled)&&void 0!==a?a:Ot.stereoEnabled,ipd:null!==(c=t.ipd)&&void 0!==c?c:Ot.ipd,fovy:null!==(l=t.fovy)&&void 0!==l?l:Ot.fovy,controllers:g,hands:v,primaryInputMode:"controller",pendingReferenceSpaceReset:!1,visibilityState:"visible",pendingVisibilityState:null,xrSystem:null,matrix:i(),globalSpace:h,viewerSpace:u,viewSpaces:p,canvasContainer:x,getViewport:(e,t)=>{const i=e.context.canvas,{width:r,height:n}=i;switch(t.eye){case Qe.None:return new kt(0,0,r,n);case Qe.Left:return new kt(0,0,this[L].stereoEnabled?r/2:r,n);case Qe.Right:return new kt(r/2,0,this[L].stereoEnabled?r/2:0,n)}},updateViews:()=>{d(this[L].viewerSpace[te].offsetMatrix,this[L].quaternion.quat,this[L].position.vec3),o(this[L].viewSpaces[Qe.Left][te].offsetMatrix,m(-this[L].ipd/2,0,0)),o(this[L].viewSpaces[Qe.Right][te].offsetMatrix,m(this[L].ipd/2,0,0))},onBaseLayerSet:e=>{if(!e)return;const t=e.context.canvas;if(t.parentElement!==this[L].canvasContainer){const e=this[L].devui;if(e){const{devUICanvas:t,devUIContainer:i}=e;t.style.zIndex=3..toString(),i.style.zIndex=4..toString(),this[L].canvasContainer.appendChild(e.devUICanvas),this[L].canvasContainer.appendChild(e.devUIContainer)}const i=this[L].sem;i&&(i.environmentCanvas.style.zIndex=1..toString(),this[L].canvasContainer.appendChild(i.environmentCanvas)),this[L].canvasData={canvas:t,parent:t.parentElement,width:t.width,height:t.height,zIndex:t.style.zIndex},t.style.zIndex=2..toString(),this[L].canvasContainer.appendChild(t),document.body.appendChild(this[L].canvasContainer)}t.width=window.innerWidth,t.height=window.innerHeight},onSessionEnd:()=>{if(this[L].canvasData){const{canvas:e,parent:t,width:i,height:r,zIndex:n}=this[L].canvasData;e.width=i,e.height=r,e.style.zIndex=n,t?t.appendChild(e):this[L].canvasContainer.removeChild(e);const s=this[L].devui;s&&(this[L].canvasContainer.removeChild(s.devUICanvas),this[L].canvasContainer.removeChild(s.devUIContainer));const a=this[L].sem;a&&this[L].canvasContainer.removeChild(a.environmentCanvas),document.body.removeChild(this[L].canvasContainer),this[L].canvasData=void 0,window.dispatchEvent(new Event("resize"))}},onFrameStart:e=>{var t;if(null===(t=this[L].actionPlayer)||void 0===t?void 0:t.playing)this[L].actionPlayer.playFrame();else{const t=e.session;this[L].updateViews(),this[L].pendingVisibilityState&&(this[L].visibilityState=this[L].pendingVisibilityState,this[L].pendingVisibilityState=null,t.dispatchEvent(new Ke("visibilitychange",{session:t}))),"visible"===this[L].visibilityState&&this.activeInputs.forEach((t=>{t.onFrameStart(e)})),this[L].pendingReferenceSpaceReset&&(t[Y].referenceSpaces.forEach((e=>{switch(e[ee].type){case We.Local:case We.LocalFloor:case We.BoundedFloor:case We.Unbounded:e.dispatchEvent(new Tt("reset",{referenceSpace:e}))}})),this[L].pendingReferenceSpaceReset=!1)}this[L].updateViews()}},this[L].updateViews()}installRuntime(e=globalThis){Object.defineProperty(WebGL2RenderingContext.prototype,"makeXRCompatible",{value:function(){return new Promise(((e,t)=>{e(!0)}))},configurable:!0}),this[L].xrSystem=new Pt(this),Object.defineProperty(globalThis.navigator,"xr",{value:this[L].xrSystem,configurable:!0}),Object.defineProperty(navigator,"userAgent",{value:this[L].userAgent,writable:!1,configurable:!1,enumerable:!0}),e.XRSystem=Pt,e.XRSession=ct,e.XRRenderState=$e,e.XRFrame=nt,e.XRSpace=ae,e.XRReferenceSpace=Ue,e.XRJointSpace=lt,e.XRView=_e,e.XRViewport=kt,e.XRRigidTransform=De,e.XRPose=Je,e.XRViewerPose=Ze,e.XRJointPose=Ye,e.XRInputSource=xe,e.XRInputSourceArray=ve,e.XRHand=dt,e.XRLayer=Ft,e.XRWebGLLayer=At,e.XRSessionEvent=Ke,e.XRInputSourceEvent=we,e.XRInputSourcesChangeEvent=Be,e.XRReferenceSpaceEvent=Tt}installDevUI(e){this[L].devui=new e(this)}installSEM(e){this[L].sem=new e(this)}get supportedSessionModes(){return this[L].supportedSessionModes}get supportedFeatures(){return this[L].supportedFeatures}get supportedFrameRates(){return this[L].supportedFrameRates}get isSystemKeyboardSupported(){return this[L].isSystemKeyboardSupported}get internalNominalFrameRate(){return this[L].internalNominalFrameRate}get stereoEnabled(){return this[L].stereoEnabled}set stereoEnabled(e){this[L].stereoEnabled=e}get ipd(){return this[L].ipd}set ipd(e){this[L].ipd=e}get fovy(){return this[L].fovy}set fovy(e){this[L].fovy=e}get position(){return this[L].position}get quaternion(){return this[L].quaternion}get viewerSpace(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.viewerSpace:this[L].viewerSpace}get viewSpaces(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.viewSpaces:this[L].viewSpaces}get controllers(){return this[L].controllers}get hands(){return this[L].hands}get primaryInputMode(){return this[L].primaryInputMode}set primaryInputMode(e){"controller"===e||"hand"===e?this[L].primaryInputMode=e:console.warn('primary input mode can only be "controller" or "hand"')}get activeInputs(){if("visible"!==this[L].visibilityState)return[];return("controller"===this[L].primaryInputMode?Object.values(this[L].controllers):Object.values(this[L].hands)).filter((e=>e.connected))}get inputSources(){var e;return(null===(e=this[L].actionPlayer)||void 0===e?void 0:e.playing)?this[L].actionPlayer.inputSources:this.activeInputs.map((e=>e.inputSource))}get canvasContainer(){return this[L].canvasContainer}get canvasDimensions(){if(this[L].canvasData){const{width:e,height:t}=this[L].canvasData.canvas;return{width:e,height:t}}}get activeSession(){var e;return null===(e=this[L].xrSystem)||void 0===e?void 0:e[N].activeSession}get sessionOffered(){var e;return Boolean(null===(e=this[L].xrSystem)||void 0===e?void 0:e[N].offeredSessionConfig)}get name(){return this[L].name}grantOfferedSession(){var e;const t=null===(e=this[L].xrSystem)||void 0===e?void 0:e[N];t&&t.offeredSessionConfig&&(t.grantSession(t.offeredSessionConfig),t.offeredSessionConfig=void 0)}recenter(){const e=new de(-this.position.x,0,-this.position.z),t=new de(0,0,-1).applyQuaternion(this.quaternion);t.y=0,t.normalize();const i=Math.atan2(t.x,-t.z),r=(new le).setFromAxisAngle(new de(0,1,0),i);this.position.add(e),this.quaternion.multiply(r),[...Object.values(this[L].controllers),...Object.values(this[L].hands)].forEach((t=>{t.position.add(e),t.quaternion.multiply(r),t.position.applyQuaternion(r)})),this[L].pendingReferenceSpaceReset=!0}get visibilityState(){return this[L].visibilityState}updateVisibilityState(e){if(!Object.values(["visible","visible-blurred","hidden"]).includes(e))throw new DOMException("Invalid XRVisibilityState value","NotSupportedError");e!==this[L].visibilityState&&(this[L].pendingVisibilityState=e)}createActionPlayer(e,t){return this[L].actionPlayer=new qt(e,t,this[L].ipd),this[L].actionPlayer}get devui(){return this[L].devui}get sem(){return this[L].sem}}const Ct={mapping:he.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"x-button",type:"binary"},{id:"y-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Vt={mapping:he.XRStandard,buttons:[{id:"trigger",type:"analog",eventTrigger:"select"},{id:"squeeze",type:"analog",eventTrigger:"squeeze"},null,{id:"thumbstick",type:"binary"},{id:"a-button",type:"binary"},{id:"b-button",type:"binary"},{id:"thumbrest",type:"binary"}],axes:[null,null,{id:"thumbstick",type:"x-axis"},{id:"thumbstick",type:"y-axis"}]},Lt={profileId:"oculus-touch-v3",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,2.0823669899527886e-8,-.12186937034130096,0,.08617465198040009,.7071067094802856,.701836109161377,0,.08617466688156128,-.7071067690849304,.7018360495567322,0,-.003979838453233242,-.015857907012104988,.04964181408286095,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,-8.329467959811154e-8,.12186941504478455,0,-.08617465943098068,.7071066498756409,.7018361687660217,0,-.08617471158504486,-.7071068286895752,.7018359303474426,0,.003979798872023821,-.015857888385653496,.049641866236925125,1],numHapticActuators:1}}},Dt={profileId:"meta-quest-touch-pro",fallbackProfileIds:["oculus-touch-v2","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,-1.5779937356796836e-8,-.12186935544013977,0,.08617467433214188,.7071067094802856,.701836109161377,0,.0861746296286583,-.7071067690849304,.7018360495567322,0,-.003979836590588093,-.015857847407460213,.049641840159893036,1],numHapticActuators:3},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,9267653311439972e-26,.12186937034130096,0,-.08617467433214188,.7071067094802856,.7018361687660217,0,-.08617464452981949,-.7071067690849304,.7018360495567322,0,.003979847766458988,-.01585782691836357,.04964186251163483,1],numHapticActuators:3}}},Xt={profileId:"meta-quest-touch-plus",fallbackProfileIds:["oculus-touch-v3","oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,1.0736208366779465e-8,-.12186933308839798,0,.08617459982633591,.70710688829422,.7018360495567322,0,.08617466688156128,-.7071067094802856,.7018362283706665,0,-.003979803062975407,-.015857873484492302,.04964187368750572,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,-2.6238110351073374e-8,.12186934053897858,0,-.0861746147274971,.7071067690849304,.7018360495567322,0,-.08617465943098068,-.7071067094802856,.701836109161377,0,.003979838453233242,-.015857869759202003,.04964182525873184,1],numHapticActuators:1}}},jt={name:"Oculus Quest 1",controllerConfig:{profileId:"oculus-touch-v2",fallbackProfileIds:["oculus-touch","generic-trigger-squeeze-thumbstick"],layout:{left:{gamepad:Ct,gripOffsetMatrix:[.9925461411476135,4.673031295254759e-9,-.12186938524246216,0,.08617470413446426,.7071065306663513,.7018362283706665,0,.0861746296286583,-.70710688829422,.7018358707427979,0,-.003979847766458988,-.01585787907242775,.04964185878634453,1],numHapticActuators:1},right:{gamepad:Vt,gripOffsetMatrix:[.9925461411476135,3.688163374704345e-8,.12186937034130096,0,-.08617469668388367,.7071066498756409,.7018361687660217,0,-.0861746147274971,-.7071068286895752,.7018359899520874,0,.003979853354394436,-.01585787907242775,.04964182525873184,1],numHapticActuators:1}}},supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","hand-tracking"],supportedFrameRates:[72,80,90],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 1) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Ht={name:"Meta Quest 2",controllerConfig:Lt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:72,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Nt={name:"Meta Quest Pro",controllerConfig:Dt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Bt={name:"Meta Quest 3",controllerConfig:Xt,supportedSessionModes:["inline","immersive-vr","immersive-ar"],supportedFeatures:["viewer","local","local-floor","bounded-floor","unbounded","anchors","plane-detection","mesh-detection","hit-test","hand-tracking","depth-sensing"],supportedFrameRates:[72,80,90,120],isSystemKeyboardSupported:!0,internalNominalFrameRate:90,environmentBlendModes:{"immersive-vr":st.Opaque,"immersive-ar":st.AlphaBlend},interactionMode:at.WorldSpace,userAgent:"Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/33.0.0.x.x.x Chrome/126.0.6478.122 VR Safari/537.36"},Gt=e=>{const t=[];return e.forEach((e=>{t.push(parseFloat(e.toFixed(3)))})),t};class Wt{constructor(e,t){this[z]={session:e,refSpace:t,inputMap:new Map,schemaMap:new Map,compressedFrames:[],jointRadii:new Float32Array(25),jointTransforms:new Float32Array(400)}}recordFrame(e){var t;const i=performance.now(),r=null===(t=e.getViewerPose(this[z].refSpace))||void 0===t?void 0:t.transform.matrix;if(!r)return;const n={timeStamp:i,position:l(f(),r),quaternion:u(F(),r),inputFrames:[]};this[z].session.inputSources.forEach((t=>{var i,r;if(!this[z].inputMap.has(t)){const e={handedness:t.handedness,targetRayMode:t.targetRayMode,profiles:t.profiles,hasGrip:null!=t.gripSpace,hasHand:null!=t.hand,hasGamepad:null!=t.gamepad};e.hasHand&&(e.jointSequence=Array.from(t.hand.values()).map((e=>e.jointName))),e.hasGamepad&&(e.mapping=t.gamepad.mapping,e.numButtons=t.gamepad.buttons.length,e.numAxes=t.gamepad.axes.length);const i=this[z].inputMap.size;this[z].inputMap.set(t,i),this[z].schemaMap.set(i,e)}const s=this[z].inputMap.get(t),a=this[z].schemaMap.get(s),o=null===(i=e.getPose(t.targetRaySpace,this[z].refSpace))||void 0===i?void 0:i.transform.matrix;if(o){const i={index:s,targetRayTransform:{position:l(f(),o),quaternion:u(F(),o)}};if(a.hasGrip){const n=null===(r=e.getPose(t.gripSpace,this[z].refSpace))||void 0===r?void 0:r.transform.matrix;if(n){const e=l(f(),n),t=u(F(),n);i.gripTransform={position:e,quaternion:t}}}if(a.hasHand){const r=Array.from(t.hand.values());let n=!0;if(n&&(n=e.fillPoses(r,t.targetRaySpace,this[z].jointTransforms)),n&&(n=e.fillJointRadii(r,this[z].jointRadii)),n){const e={};for(let t=0;t<25;t++){const i=this[z].jointTransforms.slice(16*t,16*(t+1)),n=this[z].jointRadii[t],s=l(f(),i),a=u(F(),i);e[r[t].jointName]={position:s,quaternion:a,radius:n}}i.hand=e}}if(a.hasGamepad){const e={buttons:t.gamepad.buttons.map((e=>e?[e.pressed?1:0,e.touched?1:0,e.value]:null)),axes:Array.from(t.gamepad.axes)};i.gamepad=e}n.inputFrames.push(i)}})),this[z].compressedFrames.push(this.compressActionFrame(n))}compressActionFrame(e){const t=[Math.round(10*e.timeStamp)/10,...Gt(e.position),...Gt(e.quaternion)];return e.inputFrames.forEach((e=>{const i=e.index,r=this[z].schemaMap.get(i),n=[i,...Gt(e.targetRayTransform.position),...Gt(e.targetRayTransform.quaternion)];if(r.hasGrip&&n.push([...Gt(e.gripTransform.position),...Gt(e.gripTransform.quaternion)]),r.hasHand){const t=[];Object.values(e.hand).forEach((({position:e,quaternion:i,radius:r})=>{t.push(...Gt(e),...Gt(i),parseFloat(r.toFixed(3)))})),n.push(t)}r.hasGamepad&&n.push([...e.gamepad.buttons,...e.gamepad.axes]),t.push(n)})),t}log(){const e={schema:Array.from(this[z].schemaMap.entries()),frames:this[z].compressedFrames};console.log(JSON.stringify(e))}}export{Wt as ActionRecorder,Fe as NativeMesh,Pe as NativePlane,O as P_ACTION_PLAYER,z as P_ACTION_RECORDER,C as P_ANCHOR,V as P_CONTROLLER,L as P_DEVICE,j as P_FRAME,H as P_GAMEPAD,D as P_HAND_INPUT,se as P_HIT_TEST,B as P_INPUT_SOURCE,U as P_JOINT_POSE,Z as P_JOINT_SPACE,W as P_MESH,Q as P_PLANE,$ as P_POSE,ne as P_RAY,ee as P_REF_SPACE,J as P_RENDER_STATE,_ as P_RIGID_TRANSFORM,Y as P_SESSION,te as P_SPACE,N as P_SYSTEM,X as P_TRACKED_INPUT,ie as P_VIEW,K as P_VIEWER_POSE,re as P_VIEWPORT,G as P_WEBGL_LAYER,ke as XRAnchor,Oe as XRAnchorSet,zt as XRDevice,nt as XRFrame,dt as XRHand,xe as XRInputSource,ve as XRInputSourceArray,we as XRInputSourceEvent,Be as XRInputSourcesChangeEvent,Ye as XRJointPose,lt as XRJointSpace,Ft as XRLayer,be as XRMesh,Ee as XRMeshSet,Ie as XRPlane,Te as XRPlaneSet,Je as XRPose,je as XRRay,Ue as XRReferenceSpace,Tt as XRReferenceSpaceEvent,$e as XRRenderState,De as XRRigidTransform,Re as XRSemanticLabels,ct as XRSession,Ke as XRSessionEvent,ae as XRSpace,Pt as XRSystem,_e as XRView,Ze as XRViewerPose,kt as XRViewport,At as XRWebGLLayer,Ht as metaQuest2,Bt as metaQuest3,Nt as metaQuestPro,jt as oculusQuest1};
@@ -62,6 +62,7 @@ export interface SyntheticEnvironmentModule {
62
62
  version: string;
63
63
  render(time: number): void;
64
64
  loadEnvironment(json: any): void;
65
+ loadDefaultEnvironment(envId: string): void;
65
66
  planesVisible: boolean;
66
67
  boundingBoxesVisible: boolean;
67
68
  meshesVisible: boolean;
@@ -75,7 +76,7 @@ export interface SyntheticEnvironmentModule {
75
76
  * Instead, it serves as an user-facing interface to control the emulated XR Device
76
77
  */
77
78
  export declare class XRDevice {
78
- readonly version = "2.0.0";
79
+ readonly version = "2.0.1";
79
80
  [P_DEVICE]: {
80
81
  name: string;
81
82
  supportedSessionModes: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"XRDevice.d.ts","sourceRoot":"","sources":["../../src/device/XRDevice.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EACN,QAAQ,EAKR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EACN,sBAAsB,EACtB,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,MAAM,yBAA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C,QAAQ,CAAC,SAAS,CAAC,CAAC;YAC3C,WAAW,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,CAAC,0BAA0B,GAAG,IAAI,CAAC;IAClD,CAAC;IAED,IAAI,eAAe;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,eAAe,CAAC;IACvC,CAAC;IAED,0EAA0E;IAC1E,qBAAqB,CAAC,KAAwB;QAC7C,IACC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,iBAAiB,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EACvE;YACD,MAAM,IAAI,YAAY,CACrB,iCAAiC,EACjC,mBAAmB,CACnB,CAAC;SACF;QACD,IAAI,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,eAAe,EAAE;YAC7C,IAAI,CAAC,QAAQ,CAAC,CAAC,sBAAsB,GAAG,KAAK,CAAC;SAC9C;IACF,CAAC;IAED,kBAAkB,CACjB,QAA0B,EAC1B,SAMC;QAED,IAAI,CAAC,QAAQ,CAAC,CAAC,YAAY,GAAG,IAAI,YAAY,CAC7C,QAAQ,EACR,SAAS,EACT,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAClB,CAAC;QACF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC;IACpC,CAAC;IAED,IAAI,KAAK;QACR,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,IAAI,GAAG;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC;IAC3B,CAAC;CACD"}
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "2.0.0";
1
+ export declare const VERSION = "2.0.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = "2.0.0";
1
+ export const VERSION = "2.0.1";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iwer",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Javascript WebXR Runtime for Emulation",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",