import{X as y,o as d,m as p,a,b as h,D as E,S as x}from"./chunk-Dn3xWmgR.js";import{Q,w as o}from"./chunk-DvrnVFXc.js";import"./chunk-CF7PZJR8.js";import"./chunk-BdvozYt0.js";/* empty css              */import"./chunk-DH1DswfA.js";import"./chunk-BXl3LOEh.js";import"./chunk-2B0sFjzh.js";import"./chunk-ChHTQ4Sk.js";import"./chunk-SmZMj1n8.js";import"./chunk-BHDKgRpG.js";import"./chunk-Q1j31JH2.js";const w={metaQuest3:h,metaQuest2:a,metaQuestPro:p,oculusQuest1:d},s=["office_small","meeting_room","living_room","music_room","office_large"],z=["left","none","right"];function X(n){const r=typeof n=="string"?n:n.type??"metaQuest3",e=new y(w[r],typeof n=="string"?void 0:n);typeof n!="string"&&(l(e,n.headset),m(e.hands,n.hand),m(e.controllers,n.controller),e.primaryInputMode=n.primaryInputMode??"controller"),e.ipd=typeof n=="string"?0:n.ipd??0,e.installRuntime(),e.installDevUI(E);const t=typeof n=="string"?!0:n.syntheticEnvironment;return t===!1||(e.installSEM(x),t===null)?e:typeof t=="string"&&s.includes(t)?(e.sem?.loadDefaultEnvironment(t),e):t===!0||t===void 0?(e.sem?.loadDefaultEnvironment(s[0]),e):typeof t=="object"?(e.sem?.loadEnvironment(t),e):(fetch(t).then(i=>i.json()).then(i=>e.sem?.loadEnvironment(i)).catch(console.error),e)}const f=new o,D=new Q;function m(n,r){if(r!=null)for(const e of z)l(n[e],r[e])}function l(n,r){n==null||r==null||(u(n.position,r.position),u(f,r.rotation),c(n.quaternion,D.setFromEuler(f)),c(n.quaternion,r.quaternion))}function u(n,r){if(r!=null){if(r instanceof o&&n instanceof o&&n.copy(r),Array.isArray(r)){n.x=r[0],n.y=r[1],n.z=r[2];return}n.x=r.x,n.y=r.y,n.z=r.z}}function c(n,r){if(r!=null){if(Array.isArray(r)){n.x=r[0],n.y=r[1],n.z=r[2],n.w=r[3];return}n.x=r.x,n.y=r.y,n.z=r.z,n.w=r.w}}export{X as emulate};
