@needle-tools/engine 4.4.5 → 4.4.6-beta.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.
Files changed (61) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{assets/generateMeshBVH.worker-b7788939.js → generateMeshBVH.worker-2bb9524d.js} +1 -1
  3. package/dist/{gltf-progressive.light.umd.cjs → gltf-progressive-10ca5f84.umd.cjs} +1 -1
  4. package/dist/{gltf-progressive.light.js → gltf-progressive-13de1400.light.js} +2 -2
  5. package/dist/{gltf-progressive.js → gltf-progressive-1e91190e.js} +2 -2
  6. package/dist/{gltf-progressive.umd.cjs → gltf-progressive-9f7cc7b2.light.umd.cjs} +1 -1
  7. package/dist/{gltf-progressive.light.min.js → gltf-progressive-b5ae121f.light.min.js} +1 -1
  8. package/dist/{gltf-progressive.min.js → gltf-progressive-c7497194.min.js} +1 -1
  9. package/dist/{needle-engine.bundle.light.umd.cjs → needle-engine.bundle-20bcc194.light.umd.cjs} +82 -82
  10. package/dist/{needle-engine.bundle.js → needle-engine.bundle-8157ced8.js} +751 -750
  11. package/dist/{needle-engine.bundle.min.js → needle-engine.bundle-85de066b.min.js} +73 -73
  12. package/dist/{needle-engine.bundle.light.min.js → needle-engine.bundle-b6b34dbb.light.min.js} +73 -73
  13. package/dist/{needle-engine.bundle.light.js → needle-engine.bundle-d00182e4.light.js} +751 -750
  14. package/dist/{needle-engine.bundle.umd.cjs → needle-engine.bundle-d95f5f0b.umd.cjs} +87 -87
  15. package/dist/needle-engine.js +7 -7
  16. package/dist/needle-engine.light.js +7 -7
  17. package/dist/needle-engine.light.min.js +1 -1
  18. package/dist/needle-engine.light.umd.cjs +1 -1
  19. package/dist/needle-engine.min.js +1 -1
  20. package/dist/needle-engine.umd.cjs +1 -1
  21. package/dist/{postprocessing.js → postprocessing-1f7b0484.light.js} +2 -2
  22. package/dist/{postprocessing.light.min.js → postprocessing-3a475b1f.light.min.js} +1 -1
  23. package/dist/{postprocessing.light.umd.cjs → postprocessing-3a5c88ab.light.umd.cjs} +1 -1
  24. package/dist/{postprocessing.light.js → postprocessing-7f24854b.js} +2 -2
  25. package/dist/{postprocessing.min.js → postprocessing-992c1d00.min.js} +1 -1
  26. package/dist/{postprocessing.umd.cjs → postprocessing-a77d707a.umd.cjs} +1 -1
  27. package/dist/{three.light.umd.cjs → three-67c59991.umd.cjs} +1 -1
  28. package/dist/{three.umd.cjs → three-ed3e16aa.light.umd.cjs} +1 -1
  29. package/dist/{three-examples.light.umd.cjs → three-examples-609de8cf.light.umd.cjs} +1 -1
  30. package/dist/{three-examples.min.js → three-examples-84a86d3a.min.js} +1 -1
  31. package/dist/{three-examples.js → three-examples-9070776e.js} +1 -1
  32. package/dist/{three-examples.umd.cjs → three-examples-a36ec195.umd.cjs} +1 -1
  33. package/dist/{three-examples.light.js → three-examples-ae5d9997.light.js} +1 -1
  34. package/dist/{three-examples.light.min.js → three-examples-e915b453.light.min.js} +1 -1
  35. package/dist/{three-mesh-ui.light.umd.cjs → three-mesh-ui-0f43a7e0.umd.cjs} +1 -1
  36. package/dist/{three-mesh-ui.min.js → three-mesh-ui-34f3b06e.min.js} +1 -1
  37. package/dist/{three-mesh-ui.js → three-mesh-ui-3dd2ba28.js} +1 -1
  38. package/dist/{three-mesh-ui.light.min.js → three-mesh-ui-6c3bb6f5.light.min.js} +1 -1
  39. package/dist/{three-mesh-ui.light.js → three-mesh-ui-a93a09fb.light.js} +1 -1
  40. package/dist/{three-mesh-ui.umd.cjs → three-mesh-ui-c6a7f37c.light.umd.cjs} +1 -1
  41. package/dist/{vendor.umd.cjs → vendor-017686ea.light.umd.cjs} +1 -1
  42. package/dist/{vendor.light.umd.cjs → vendor-2a57f283.umd.cjs} +1 -1
  43. package/dist/{vendor.light.js → vendor-3f0ec7ec.light.js} +1 -1
  44. package/dist/{vendor.js → vendor-804f80f4.js} +1 -1
  45. package/dist/{vendor.min.js → vendor-e7e3da93.min.js} +1 -1
  46. package/dist/{vendor.light.min.js → vendor-ec47e3c4.light.min.js} +1 -1
  47. package/lib/engine/engine_networking.d.ts +1 -1
  48. package/lib/engine/engine_networking.js +13 -2
  49. package/lib/engine/engine_networking.js.map +1 -1
  50. package/package.json +1 -1
  51. package/src/engine/engine_networking.ts +13 -2
  52. /package/dist/{rapier.light.umd.cjs → rapier-32f37222.light.umd.cjs} +0 -0
  53. /package/dist/{rapier.umd.cjs → rapier-32f37222.umd.cjs} +0 -0
  54. /package/dist/{rapier.light.min.js → rapier-461dfeff.light.min.js} +0 -0
  55. /package/dist/{rapier.min.js → rapier-461dfeff.min.js} +0 -0
  56. /package/dist/{rapier.js → rapier-ef0b93e2.js} +0 -0
  57. /package/dist/{rapier.light.js → rapier-ef0b93e2.light.js} +0 -0
  58. /package/dist/{three.js → three-3fd45ef1.js} +0 -0
  59. /package/dist/{three.light.js → three-3fd45ef1.light.js} +0 -0
  60. /package/dist/{three.light.min.js → three-41cc41b9.light.min.js} +0 -0
  61. /package/dist/{three.min.js → three-41cc41b9.min.js} +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";var Mt=Object.defineProperty;var Ft=(i,e,t)=>e in i?Mt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var C=(i,e,t)=>(Ft(i,typeof e!="symbol"?e+"":e,t),t);const m=require("./three.umd.cjs");var k={};k.d=(i,e)=>{for(var t in e)k.o(e,t)&&!k.o(i,t)&&Object.defineProperty(i,t,{enumerable:!0,get:e[t]})};k.o=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);k.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var v={};k.d(v,{ti:()=>p,nS:()=>xt,eB:()=>F,Yp:()=>ae,VB:()=>R,BC:()=>z,zN:()=>B,cV:()=>A,hW:()=>L,k2:()=>Ee,K6:()=>S,M7:()=>ue,ls:()=>W,Hi:()=>st,EY:()=>O,MR:()=>Ke,zf:()=>We,Ay:()=>qr,yo:()=>wt});var ae={};k.r(ae);k.d(ae,{get:()=>Le,set:()=>Ot});var ue={};k.r(ue);k.d(ue,{alphaTestTransformer:()=>q,asPreprocessorValueTransformer:()=>qe,toPreprocessorTriggerTransformer:()=>ye,toUserDataTransformer:()=>ji,uniformOrUserDataTransformer:()=>w});const ne={fontFamily:null,fontSize:.05,fontKerning:"auto",fontStyle:"normal",fontWeight:"normal",offset:.005,lineHeight:1.2,lineBreak:`- ,.:?!
1
+ "use strict";var Mt=Object.defineProperty;var Ft=(i,e,t)=>e in i?Mt(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var C=(i,e,t)=>(Ft(i,typeof e!="symbol"?e+"":e,t),t);const m=require("./three-ed3e16aa.light.umd.cjs");var k={};k.d=(i,e)=>{for(var t in e)k.o(e,t)&&!k.o(i,t)&&Object.defineProperty(i,t,{enumerable:!0,get:e[t]})};k.o=(i,e)=>Object.prototype.hasOwnProperty.call(i,e);k.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var v={};k.d(v,{ti:()=>p,nS:()=>xt,eB:()=>F,Yp:()=>ae,VB:()=>R,BC:()=>z,zN:()=>B,cV:()=>A,hW:()=>L,k2:()=>Ee,K6:()=>S,M7:()=>ue,ls:()=>W,Hi:()=>st,EY:()=>O,MR:()=>Ke,zf:()=>We,Ay:()=>qr,yo:()=>wt});var ae={};k.r(ae);k.d(ae,{get:()=>Le,set:()=>Ot});var ue={};k.r(ue);k.d(ue,{alphaTestTransformer:()=>q,asPreprocessorValueTransformer:()=>qe,toPreprocessorTriggerTransformer:()=>ye,toUserDataTransformer:()=>ji,uniformOrUserDataTransformer:()=>w});const ne={fontFamily:null,fontSize:.05,fontKerning:"auto",fontStyle:"normal",fontWeight:"normal",offset:.005,lineHeight:1.2,lineBreak:`- ,.:?!
2
2
  `,whiteSpace:"pre-line",flexDirection:"column",justifyContent:"start",alignItems:"start",backgroundImage:null,textAlign:"left",boxSizing:"content-box",position:"static",color:16777215,fontColor:16777215,fontOpacity:1,opacity:1,fontPXRange:4,fontSupersampling:!0,fontSmooth:"antialiased",borderRadius:0,borderWidth:0,borderColor:"black",borderOpacity:1,backgroundSize:"cover",backgroundColor:0,backgroundOpacity:0,overflow:"visible",letterSpacing:0,invertAlpha:!1,segments:1},Ot=function(i){for(const e in i)ne[e]=i[e]},Le=function(i){return Object.prototype.hasOwnProperty.call(ne,i)||console.warn(`ThreeMeshUI::DefaultValues is trying to retrieve non-existing property '${i}'`),ne[i]};class p{constructor(e,t=null,s=!0){this._id=e,this._value=t,this._needsUpdate=!0,this._needsProcess=!1,this._needsRender=!1,this._isPrimitive=s}get id(){return this._id}get value(){return this._value}set value(e){this.isValid(e)&&this._value!==e&&(this._value=e,this._needsUpdate=!0)}update(e,t){this.output(t)}output(e){}_outputValue(e){e[this._id]=this._value}process(e){}render(e){}getInheritedInput(e){if(this._value!=="inherit")return this._value;const t=e._parent._value;return t&&t[`_${this._id}`]?t[`_${this._id}`].getInheritedInput(t):this.getDefaultValue()}getDefaultValue(){return Le(this._id)}isValid(e){return!0}emptyStrategyLogic(){throw new Error(`ThreeMeshUI::${this.constructor.name} has empty strategy. Update has not been processed.`)}requestUpdate(){this._needsUpdate=!0}requestProcess(){this._needsProcess=!1}requestRender(){this._needsRender=!1}}class Lt extends p{constructor(){super("renderOrder","auto",!0),this.output=this._outputValue,this._actualValue=0}set value(e){this.isValid(e)&&(this._value=e,this._needsUpdate=!0)}update(e,t){if(this._value!=="auto")this._actualValue=this._value;else{const s=e._parent._value;if(s!==null){const r=s._renderOrder._actualValue,n=1+s._children._uis.indexOf(e);this._actualValue=r+n}}for(const s of e._children._uis)s._renderOrder._value==="auto"&&(s._renderOrder._needsUpdate=!0);this._outputValue(t)}_outputValue(e){e[this._id]=this._actualValue}get value(){return this._value}}class B extends p{constructor(e,t=null,s=!0){super(e,t,s),this.output=this._outputValue,this._notInheritedValue=null}update(e,t){this._notInheritedValue=this._value,this._notInheritedValue==="inherit"&&(this._notInheritedValue=this.getInheritedInput(e)),this.propagate(e),this._outputValue(t)}propagate(e){for(const t of e._children._uis){const s=t[`_${this._id}`];s!==void 0&&s._value==="inherit"&&(t[`_${this._id}`]._needsUpdate=!0)}}_outputValue(e){e[this._id]=this._notInheritedValue}set value(e){this.isValid(e)&&this._value!==e&&(this._value=e,this._needsUpdate=!0)}get value(){return this._value==="inherit"?this._notInheritedValue:this._value}}class zt extends B{constructor(){super("offset","inherit",!1)}update(e,t){super.update(e,t),e._parent._value!==null&&(e.position.z=this._notInheritedValue)}}class Wt extends B{constructor(){super("fontSmooth","inherit",!0),this._needsUpdate=!1,this.isValid=Dt,this.output=this._outputValue}}const Et=["inherit","none","antialiased"];function Dt(i){return Et.indexOf(i)===-1?(console.warn(`.fontSmoothing value '${i}' is not valid. Aborted`),!1):!0}var Ht=i=>{var e={};return k.d(e,i),e};const u=Ht({BackSide:()=>m.BackSide,BufferAttribute:()=>m.BufferAttribute,BufferGeometry:()=>m.BufferGeometry,Color:()=>m.Color,DoubleSide:()=>m.DoubleSide,EventDispatcher:()=>m.EventDispatcher,FileLoader:()=>m.FileLoader,FrontSide:()=>m.FrontSide,LinearFilter:()=>m.LinearFilter,Mesh:()=>m.Mesh,MeshBasicMaterial:()=>m.MeshBasicMaterial,Object3D:()=>m.Object3D,Plane:()=>m.Plane,PlaneGeometry:()=>m.PlaneGeometry,ShaderMaterial:()=>m.ShaderMaterial,Texture:()=>m.Texture,TextureLoader:()=>m.TextureLoader,Vector2:()=>m.Vector2,Vector3:()=>m.Vector3,Vector4:()=>m.Vector4});class g extends p{constructor(e,t,s=!0){super(e,"unset",s),this._input="inherit",this._allowsInherit=!0,this._inheritedInput=void 0,this._inline=void 0}update(e,t){this._allowsInherit||(this._inheritedInput=this.getInheritedInput(e)),this.computeOutputValue(e);for(const s of e._children._uis){const r=s[`_${this._id}`];(r._input?r._input:r._value)==="inherit"&&(s[`_${this._id}`]._needsUpdate=!0)}this.output(t)}computeOutputValue(e){this._value=this._input}_computeFromInherited(e){this._value=this._inheritedInput}set value(e){console.warn(".(style) sub-property cannot be directly set. It must comes from inline or computed setter.")}set inline(e){this.isValidValue(e)&&e!==this._inline&&(this._input=this._inline=e,this._needsUpdate=!0)}get inline(){return this._inline}isValidValue(e){return!0}getInheritedInput(e){if(this._input!=="inherit")return this._input;const t=e._parent._value;return t?t[`_${this._id}`].getInheritedInput(t):this.getDefaultValue()}}class K extends g{constructor(e,t){super(e,t,!1),this._input=new u.Vector4(0,0,0,0),this._inline=null,this._value=new u.Vector4(0,0,0,0)}get value(){return this._value}computeOutputValue(e){this._vector4ValueSetter(this._value,this._input)}set inline(e){this._vector4ValueSetter(this._input,e),!this._input.equals(this._value)&&(this._needsUpdate=!0)}set top(e){this._input.x!==e&&(this._input.x=e,this._needsUpdate=!0)}get top(){return this._input.x}set right(e){this._input.y!==e&&(this._input.y=e,this._needsUpdate=!0)}get right(){return this._input.y}set bottom(e){this._input.z!==e&&(this._input.z=e,this._needsUpdate=!0)}get bottom(){return this._input.z}set left(e){this._input.w!==e&&(this._input.w=e,this._needsUpdate=!0)}get left(){return this._input.w}dispose(){this._computed=null,this._inline=null,this._input=null,this._output=null}_vector4ValueSetter(e,t){if(t instanceof u.Vector4){e.copy(t);return}if((typeof t=="string"||t instanceof String)&&(t=t.split(" ")),Array.isArray(t))switch(t=t.map(s=>parseFloat(s)),t.length){case 1:e.setScalar(t[0]);return;case 2:e.x=e.z=t[0],e.y=e.w=t[1];return;case 3:e.x=t[0],e.y=t[1],e.z=t[2];return;case 4:e.x=t[0],e.y=t[1],e.z=t[2],e.w=t[3];return;default:console.error("StyleVector4Property::set() Four Dimension property had more than four values");return}isNaN(t)||e.setScalar(t)}}class Gt extends K{constructor(){super("padding",new u.Vector4(0,0,0,0))}computeOutputValue(e){super.computeOutputValue(e),e._bounds._needsUpdate=!0,e._bounds._needsRender=!0,e._layouter._needsProcess=!0,e._renderer._needsRender=!0,e._parent._value&&(e._parent._value._layouter._needsProcess=!0)}}class $t extends K{constructor(){super("margin",new u.Vector4(0,0,0,0))}computeOutputValue(e){super.computeOutputValue(e),e._renderer._needsRender=!0,e._parent._value&&(e._parent._value._flexDirection._needsProcess=!0)}}const Re=function(i,e,t){i[e]=t},Nt=function(i,e,t){t!==null&&(i[e]=t)};class E{constructor(e){this._definition=e}set definition(e){this._definition=e}mediate(e,t,s,r=null){for(const n in this._definition){const o=this._definition[n];if(s[n]!==void 0){const a=o.t?o.t:Re;a(t,o.m,s[n]),r&&a(r,o.m,s[n])}}}static mediate(e,t,s,r,n=null){if(t)for(const o in r){const a=r[o];if(s[o]!==void 0){const l=a.t?a.t:Re;l(t,a.m,s[o]),n&&l(n,a.m,s[o])}}}}class Xt extends p{constructor(){super("parent",null,!1)}update(e,t){e.parent&&e.parent.isUI?this._value=e.parent:this._value=null}set value(e){console.warn("ParentProperty is readonly")}get value(){return this._value}find(e){return this._value?e(this._value)?this._value:this._value._parent.find(e):null}dispose(){this._value=null}}const oe=function(i,e,t=6){return i.toFixed(t)===e.toFixed(t)};class Be extends p{constructor(e,t){super(e,t,!0),this.output=this._outputValue}set value(e){this.isValid(e)&&(oe(this._value,e)||(this._value=e,this._needsUpdate=!0))}get value(){return this._value}}class Ue extends B{constructor(e){super(e,"inherit",!0),this.isValid=Yt}}const jt=[u.FrontSide,u.BackSide,u.DoubleSide];function Yt(i){return jt.indexOf(i)===-1?(console.warn(`SideProperty value '${i}' is not valid. Abort`),!1):!0}class ze{constructor(){this._offsetX=0,this._offsetY=0,this._lineBreak=null,this._kerning=0,this._fontFactor=1,this._fontSize=0,this._cumulativeWidth=0,this._paddingLeft=0,this._paddingRight=0,this._marginLeft=0,this._marginRight=0}resetOffsets(){this._offsetX=this._offsetY=0,this._cumulativeWidth=0}get xadvance(){return 0}get xoffset(){return 0}get yoffset(){return 0}get width(){return 0}get height(){return 0}set lineBreak(e){this._lineBreak=e}get lineBreak(){return this._lineBreak}get anchor(){return 0}get kerning(){return this._kerning*this._fontFactor}set kerning(e){this._kerning=e}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize=e}get lineHeight(){return 0}get offsetX(){return this._offsetX}set offsetX(e){this._offsetX=e}get offsetY(){return this._offsetY}set offsetY(e){this._offsetY=e}get cumulativeWidth(){return this._cumulativeWidth}set cumulativeWidth(e){this._cumulativeWidth=e}get marginLeft(){return this._marginLeft}set marginLeft(e){this._marginLeft=e}get marginRight(){return this._marginRight}set marginRight(e){this._marginRight=e}get paddingLeft(){return this._paddingLeft}set paddingLeft(e){this._paddingLeft=e}get paddingRight(){return this._paddingRight}set paddingRight(e){this._paddingRight=e}get lineBase(){return 0}set fontFactor(e){this._fontFactor=e}get fontFactor(){return this._fontFactor}}class We{constructor(e){this._char="",this._width=1,this._heigth=1,this._xadvance=1,this._xoffset=0,this._yoffset=0,this._font=e}get font(){return this._font}get char(){return this._char}get width(){return this._width}get height(){return this._heigth}get xadvance(){return this._xadvance}get xoffset(){return this._xoffset}get yoffset(){return this._yoffset}set yoffset(e){this._yoffset=e}clone(e){throw new Error("Abstract... Need to be implemented")}asInlineGlyph(){throw new Error("Abstract... Need to be implemented")}}class Ee extends ze{constructor(e){super(),this._typographic=e}get typographic(){return this._typographic}get xadvance(){return this._typographic.xadvance*this._fontFactor}get xoffset(){return this._typographic.xoffset*this._fontFactor}get yoffset(){return this._typographic.yoffset*this._fontFactor}get width(){return this._typographic.width*this._fontFactor}get height(){return this._typographic.height*this._fontFactor}get char(){return this._typographic.char}get anchor(){return this.yoffset}get lineHeight(){return this._typographic.font.lineHeight*this._fontFactor}get lineBase(){return this._typographic.font.lineBase*this._fontFactor}}const Kt={light:"100",normal:"400",bold:"700",bolder:"900"};function he(i){if(!isNaN(i))return i.toString();const e=Kt[i];return e||i}class qt extends u.EventDispatcher{constructor(e,t){super(),this._isReady=!1,this._weight=he(e),this._style=t,this._size=42,this._lineHeight=42,this._lineBase=42,this._font=null}get typographic(){return this._font}get isReady(){return this._isReady}get weight(){return this._weight}get style(){return this._style}get texture(){return this._texture}set fontMaterial(e){throw Error(`FontVariant('${this.id}')::fontMaterial - is abstract.`)}get fontMaterial(){throw Error(`FontVariant('${this.id}')::fontMaterial - is abstract.`)}get id(){return`${this._name}(w:${this.weight},s:${this.style})`}getTypographicGlyph(e){let t=this._chars[e];if(t)return t;if(e.match(/\s/))return this._chars[" "];const s=this._getFallbackCharacter(e);if(s&&(t=this._chars[s],t))return t;throw Error(`FontVariant('${this.id}')::getTypographicGlyph() - character('${e}') and/or fallback character were not found in provided msdf charset.`)}_getFallbackCharacter(e){throw new Error(`FontVariant(${typeof this})::_getFallbackCharacter() is abstract and should therefore be overridden.`)}getGeometricGlyph(e,t){throw new Error(`FontVariant(${typeof this})::getGeometryCharacter() is abstract and should therefore be overridden.`)}getKerningAmount(e){return this._kernings[e]?this._kernings[e]:0}adjustTypographicGlyphs(e){for(const t in e){const s=this.getTypographicGlyph(t),r=e[t];for(const n in r)s["_"+n]=e[t][n]}}_checkReadiness(){this._readyCondition()&&Zt(this)}_alterElementProperties(e){throw new Error(`FontVariant(${typeof this})::_alterElementProperties() is abstract and should therefore be overridden.`)}_readyCondition(){throw new Error(`FontVariant(${typeof this})::_readyCondition() is abstract and should therefore be overridden.`)}}const Jt={type:"ready"};function Zt(i){i._isReady=!0,i.dispatchEvent(Jt)}const z=qt;class Qt extends p{constructor(e=null){super("font",e,!1),this._needsUpdate=!1,this._fontVariant=null,this._handleFontReadyClosure=null,this.isValid=ei}output(e){e[this._id]=this._fontVariant}update(e,t){if(this._fontVariant&&!this._fontVariant.isReady&&this._fontVariant.removeEventListener("ready",this._handleFontReadyClosure),this._value&&this._value instanceof z)this._fontVariant=this._value;else{const s=e._fontFamily._value;s&&(this._fontVariant=s.getVariant(e._fontWeight._value,e._fontStyle._value))}this._fontVariant&&(this._fontVariant._alterElementProperties(e),this._handleFontReadyClosure=ti(e,this),this._fontVariant.isReady?this._handleFontReadyClosure():this._fontVariant.addEventListener("ready",this._handleFontReadyClosure),(!e._fontMaterial._defaultMaterial||!(e._fontMaterial._defaultMaterial instanceof this._fontVariant.fontMaterial))&&(e._fontMaterial._defaultMaterial=new this._fontVariant.fontMaterial,e._fontMaterial._needsUpdate=!0))}set value(e){this.isValid(e)&&this._value!==e&&(this._value=e,this._needsUpdate=!0)}get value(){return this._value}get fontVariant(){return this._fontVariant}dispose(){this._handleFontReadyClosure&&(this._fontVariant.removeEventListener("ready",this._handleFontReadyClosure),this._handleFontReadyClosure=null),this._value=null,this._fontVariant=null}}function ei(i){return i instanceof z?!0:(console.warn(`.font value '${i}' is not valid. It requires a FontVariant instance. Aborted`),!1)}function ti(i,e){return function(){e._needsUpdate=!0,i._glyphs._needsProcess=!0,e._fontVariant.removeEventListener("ready",e._handleFontReadyClosure),e._handleFontReadyClosure=null}}class ii extends g{constructor(e){super("display",e),this._value="flex",this._allowsInherit=!1,this._needsUpdate=!1,this.isValidValue=ri}computeOutputValue(e){e._visible._value=this._output!=="none"}}const si=["none","flex"];function ri(i){return si.indexOf(i)===-1?(console.warn(`(.style) display value '${i}' is not valid. Aborted`),!1):!0}class ni extends g{constructor(e){super("boxSizing",e),this._allowsInherit=!1,this.isValidValue=ai}computeOutputValue(e){this._value=this._inheritedInput,e._bounds._needsUpdate=!0}}const oi=["border-box","content-box"];function ai(i){return oi.indexOf(i)===-1?(console.warn(`(.style) boxSizing value '${i}' is not valid. Aborted`),!1):!0}class T extends g{constructor(e,t){super(e,t,!1),this._value=new u.Color,this.output=this._outputValue}computeOutputValue(e){this._input!=="inherit"&&this._value.set(this._input)}set inline(e){this._input=this._inline=e,this._needsUpdate=!0}}class ee extends g{constructor(e,t){super(e,t,!0),this.isValidValue=ui,this._allowsInherit=!1,this._input=t,this._value=t,this.output=this._outputValue,this.computeOutputValue=this._computeFromInherited}_outputValue(e){e[this._id]=this._inheritedInput}}function ui(i){return i<0&&i>1?(console.warn(`(.style) styleFactorProperty('${this.id}') value '${i}' is not valid)`),!1):!0}class hi extends g{constructor(e){super("backgroundImage",e,!0),this._input=null,this._allowsInherit=!1,this._textureSize=new u.Vector2(1,1),this.isValidValue=li}get value(){return this._value}output(e){e[this._id]=this._value,e.tSize=this._textureSize}computeOutputValue(e){if(this._value=this._inheritedInput,this._value instanceof u.Texture&&!this._value.image){console.warn("ThreeMeshUI - .backgroundImage :: Please provide preloaded texture in order to have accurate sizing.");return}this._needsProcess=!0}process(e){this._value?this._textureSize.set(this._value.image.width,this._value.image.height):this._textureSize.set(1,1)}}function li(i){return!0}class ci extends g{constructor(e){super("backgroundSize",e,!0),this.isValidValue=_i,this.output=this._outputValue}}const di=["cover","contain","stretch"];function _i(i){return di.indexOf(i)===-1?(console.warn(`(.style) backgroundSize value '${i}' is not valid. Aborted`),!1):!0}class fi extends g{constructor(e){super("overflow",e,!0),this.isValidValue=gi,this._clippingPlanes=null,this._renderStrategy=this._emptyRender}update(e,t){this._inline!==void 0&&this._inline!=="unset"?this._input=this._inline:this._computed!==void 0&&(this._input=this._computed),this._allowsInherit||(this._inheritedInput=this.getInheritedInput(e)),this.computeOutputValue(e);for(const s of e._children._uis)s._overflow._needsUpdate=!0;this.output(t)}output(e){e.clippingPlanes=this._clippingPlanes}computeOutputValue(e){super.computeOutputValue(e),this._value==="hidden"?this._renderStrategy=this._propagateRender:(this._renderStrategy=this._emptyRender,this._clippingPlanes=null);const t=e._parent._value;if(t!==null){const s=t._overflow;if((s._value==="hidden"||s._clippingPlanes!==null)&&!this._clippingPlanes){this._clippingPlanes=[new u.Plane(new u.Vector3(0,-1,0),1),new u.Plane(new u.Vector3(-1,0,0),1),new u.Plane(new u.Vector3(0,1,0),1),new u.Plane(new u.Vector3(1,0,0),1)];for(let r=0;r<this._clippingPlanes.length;r++)this._clippingPlanes[r].parent=t;s._clippingPlanes!==null&&this._clippingPlanes.push(...s._clippingPlanes),this._renderStrategy=this._hiddenRender,this._needsRender=!0}else(s._value==="visible"||s._clippingPlanes===null)&&this._clippingPlanes!==null&&(this._clippingPlanes=null,this._renderStrategy=this._emptyRender,this._needsRender=!0)}}render(e){this._renderStrategy(e)}_emptyRender(e){}_hiddenRender(e){const t=e._parent._value,s=t._bounds._offsetHeight,r=t._bounds._offsetWidth,n=t._padding._value,o=t._borderWidth._value;for(let a=0;a<4&&a<this._clippingPlanes.length;a++){const l=this._clippingPlanes[a];switch(a%4){case 0:l.constant=s/2-(n.x+o.x);break;case 1:l.constant=r/2-(n.y+o.y);break;case 2:l.constant=s/2-(n.z+o.z);break;case 3:l.constant=r/2-(n.w+o.w);break}l.applyMatrix4(t.matrixWorld)}for(let a=0;a<e._children._uis.length;a++){const l=e._children._uis[a];l._overflow._needsRender=!0}}_propagateRender(e){for(let t=0;t<e._children._uis.length;t++){const s=e._children._uis[t];s._overflow._needsRender=!0}}}const pi=["visible","hidden"];function gi(i){return pi.indexOf(i)===-1?(console.warn(`(.style) overflow value '${i}' is not valid. Aborted`),!1):!0}const U="rem",De="em",N="%",mi=[U,De,N],He=function(i){return mi.indexOf(i)===-1?U:i};class vi extends K{constructor(e){super("borderRadius",e),this._valueUV=this._value.clone(),this._input=new u.Vector4(0,0,0,0),this._mediation=!0,this._cornerTL=new u.Vector2(0,1),this._cornerTR=new u.Vector2(1,1),this._cornerBR=new u.Vector2(1,0),this._cornerBL=new u.Vector2(0,0);const t=new D(this._valueUV,["x","y"]),s=new D(this._valueUV,["z","w"]),r=new D(this._valueUV,["x","w"]),n=new D(this._valueUV,["y","z"]);t.complementaryMediation=s,s.complementaryMediation=t,r.complementaryMediation=n,n.complementaryMediation=r,this._sideMediators=[t,s,r,n],this._units=U}set units(e){this._units=He(e),this._needsProcess=!0}get units(){return this._units}set mediation(e){e!==this._mediation&&(this._mediation=e,this._needsUpdate=!0)}get mediation(){return this._mediation}output(e){e.cornerTL=this._cornerTL,e.cornerTR=this._cornerTR,e.cornerBR=this._cornerBR,e.cornerBL=this._cornerBL}computeOutputValue(e){this._vector4ValueSetter(this._value,this._input),this._needsProcess=!0}process(e){this._needsRender=!0}render(e){this._valueUV.copy(this._value);const t=e._bounds._offsetWidth,s=e._bounds._offsetHeight;if(this._units===N&&this._valueUV.divideScalar(100),this._units===U&&this._valueUV.divideScalar(Math.min(t,s)),this._mediation)do this._sideMediators.forEach(o=>o.computeValue()),this._sideMediators.sort((o,a)=>o.value<a.value?1:-1),this._sideMediators[0].value>1&&this._sideMediators[0].mediate();while(this._sideMediators[0].value>1);let r=t>s?s/t:1,n=t<s?t/s:1;this._units===N&&(r=n=1),this._cornerTL.x=this._valueUV.x*r,this._cornerTL.y=1-this._valueUV.x*n,this._cornerTR.x=1-this._valueUV.y*r,this._cornerTR.y=1-this._valueUV.y*n,this._cornerBR.x=1-this._valueUV.z*r,this._cornerBR.y=this._valueUV.z*n,this._cornerBL.x=this._valueUV.w*r,this._cornerBL.y=this._valueUV.w*n}dispose(){for(const e of this._sideMediators)e.dispose();this._sideMediators=null,this._cornerTL=null,this._cornerTR=null,this._cornerBR=null,this._cornerBL=null,super.dispose()}set topLeft(e){this._input.x!==e&&(this._input.x=e,this._needsUpdate=!0)}get topLeft(){return this._input.x}set topRight(e){this._input.y!==e&&(this._input.y=e,this._needsUpdate=!0)}get topRight(){return this._input.y}set bottomRight(e){this._input.z!==e&&(this._input.z=e,this._needsUpdate=!0)}get bottomRight(){return this._input.z}set bottomLeft(e){this._input.w!==e&&(this._input.w=e,this._needsUpdate=!0)}get bottomLeft(){return this._input.w}set top(e){this._input.x===e&&this._input.y===e||(this._input.x=this._input.y=e,this._needsUpdate=!0)}get top(){return(this._input.x+this._input.y)/2}set right(e){this._input.y===e&&this._input.z===e||(this._input.y=this._input.z=e,this._needsUpdate=!0)}get right(){return(this._input.y+this._input.z)/2}set bottom(e){this._input.z===e&&this._input.w===e||(this._input.z=this._input.w=e,this._needsUpdate=!0)}get bottom(){return(this._input.z+this._input.w)/2}set left(e){this._input.w===e&&this._input.x===e||(this._input.w=this._input.x=e,this._needsUpdate=!0)}get left(){return(this._input.w+this._input.x)/2}}class D{constructor(e,t){this._borderRadiuses=e,this._sideProperties=t,this._complementaryMediation=null,this._value=0}get value(){return this._value}set complementaryMediation(e){this._complementaryMediation=e}computeValue(){let e=0;for(const t of this._sideProperties)e+=this._borderRadiuses[t];this._value=e}mediate(e=!0){if(!(this._value<1)){for(const t of this._sideProperties)this._borderRadiuses[t]/=this._value;e&&this._complementaryMediation.mediate(!1)}}dispose(){this._complementaryMediation=null,this._borderRadiuses=null}}class yi extends K{constructor(e){super("borderWidth",e,!1),this._valueUV=this._value.clone(),this.output=this._outputValue,this._units=U}set units(e){this._units=He(e),this._needsUpdate=!0}get units(){return this._units}computeOutputValue(e){this._vector4ValueSetter(this._value,this._input),this._needsProcess=!0,e._bounds._needsUpdate=!0,e._layouter._needsUpdate=!0}_outputValue(e){e[this._id]=this._valueUV}process(e){this._needsRender=!0,e._borderRadius._needsRender=!0}render(e){this._valueUV.copy(this._value);const t=e._bounds._offsetWidth,s=e._bounds._offsetHeight;if(this._units===N&&(console.log("Percent"),console.log(this._valueUV)),this._units===U)t!==0&&(this._valueUV.w/=t,this._valueUV.y/=t),s!==0&&(this._valueUV.x/=s,this._valueUV.z/=s);else if(this._units===De){if(t!==0){const r=t>s?s/t:1;this._valueUV.y*=r,this._valueUV.w*=r}if(s!==0){const r=t<s?t/s:1;this._valueUV.x*=r,this._valueUV.z*=r}}}}class bi extends p{constructor(e,t=!0){super("visible",t,!0),this._needsUpdate=!1}update(e,t){e.visible=this._value,e._parent._value&&(e._parent._value._children._needsUpdate=!0)}set value(e){this.isValid(e)&&this._value!==e&&(this._value=e,this._needsUpdate=!0)}get value(){return this._value}}class Ge extends T{constructor(e){super("backgroundColor",e,!1),this._input="transparent",this._allowsInherit=!1}computeOutputValue(e){e._backgroundMesh.visible=!(this._input==="none"||this._input==="transparent"),this._input==="inherit"?this._value.set(this.getInheritedInput(e)):this._input==="transparent"||this._input==="none"||this._value.set(this._input)}}class I extends p{constructor(e="untitled"){super(e,void 0,!1)}update(e,t){}output(e){}}class xi extends p{constructor(){super("inlineJustificator",null,!1),this._value=null}update(e,t){}process(e){const t=e._bounds._innerHeight,s=e._layouter._value,r=Math.abs(s.height);let n=(()=>{switch(e._alignItems._value){case"inherit":case"start":return t/2;case"end":return r-t/2;case"stretch":case"center":return r/2}})();const o=e._padding._value,a=e._borderWidth._value;n+=(-o.x+o.z)/2+(-a.x+a.z)/2,s.forEach(l=>{l.y+=n,l.forEach(d=>{d.offsetY+=n})})}}const wi=["start","center","end","stretch"],Si=function(i){return wi.indexOf(i)===-1?(console.warn(`(.style) alignItems value '${i}' is not valid. Aborted`),!1):!0};class le extends g{constructor(){super("alignItems","inherit",!0),this.isValidValue=Si}}class ce extends g{constructor(){super("textAlign","inherit",!0),this.isValidValue=ki}}const Vi=["left","right","center","justify","justify-left","justify-right","justify-center"],ki=function(i){return Vi.indexOf(i)===-1?(console.warn(`(.style) textAlign value '${i}' is not valid. Aborted`),!1):!0};class de extends g{constructor(){super("flexDirection","inherit",!0),this.isValid=Ii}}const Pi=["row","row-reverse","column","column-reverse"];function Ii(i){return Pi.indexOf(i)===-1?(console.warn(`(.style) flexDirection value '${i}' is not valid. Aborted`),!1):!0}class _e extends g{constructor(){super("justifyContent","inherit",!0),this.isValidValue=Ri}}const Ci=["start","center","end","space-between","space-around","space-evenly"];function Ri(i){return Ci.indexOf(i)===-1?(console.warn(`(.style) justifyContent value '${i}' is not valid. Aborted`),!1):!0}class Bi extends g{constructor(){super("order",0,!0),this._value=0,this._input=0,this._allowsInherit=!1}computeOutputValue(e){this._value=this._inheritedInput,e._parent._value&&(e._parent._value._children._needsProcess=!0)}}class $e extends g{constructor(){super("position","static",!0),this._allowsInherit=!1,this._value="static",this._needsUpdate=!1,this.computeOutputValue=this._computeFromInherited,this.isValidValue=Ai}_computeFromInherited(e){super._computeFromInherited(e),e._parent._value&&(e._parent._value._children._needsProcess=!0)}}const Ui=["static","absolute"];function Ai(i){return Ui.indexOf(i)===-1?(console.warn(`(.style) position value '${i}' is not valid. Aborted`),!1):!0}class Ne extends g{constructor(e,t=null){super(e,t,!0),this._input="auto",this._auto=!0,this._relative=!1,this._updateRequired=!0}set inline(e){this.isValidValue(e)&&e!==this._inline&&(this._inline=e,this._input!==this._inline&&this._parseInput())}get inline(){return this._inline}_parseInput(){let e=!0;if(this._inline!==void 0&&this._inline!=="unset"?this._input=this._inline:this._computed!==void 0?(this._computed===this._input&&(e=!1),this._input=this._computed):e=this._input==="inherit",e){if(this._auto=!this._input||this._input==="auto",this._auto)this._relative=!1;else if((typeof this._input=="string"||this._input instanceof String)&&this._input.endsWith("%")){this._relative=!0,this._value=0;const t=parseFloat(this._input.replace("%","").trim());isNaN(t)||(this._value=t/100)}else this._relative=!1,this._value=this._input;this._needsUpdate=this._updateRequired=e}}update(e,t){if(this._updateRequired){this._updateRequired=!1,this._allowsInherit||(this._inheritedInput=this.getInheritedInput(e)),this.computeOutputValue(e);for(const s of e._children._uis)s[`_${this._id}`]._needsUpdate=!0;this.output(t),e._parent._value&&(e._parent._value._layouter._needsProcess=!0)}}computeOutputValue(e){e._bounds._needsUpdate=!0,e._renderer._needsRender=!0}getInheritedInput(e){if(this._input!=="inherit"&&!this._auto)return this._input;const t=e._parent._value;return t?t[`_${this._id}`].getInheritedInput(t):this.getDefaultValue()}getDefaultValue(){return 0}get value(){return this._value}}class Ti extends Ne{constructor(){super("width")}}class Mi extends Ne{constructor(){super("height")}computeOutputValue(e){super.computeOutputValue(e)}}class Xe extends I{constructor(){super("textContent"),this._needsUpdate=!1}set value(e){}process(e){let t="";for(let s=0;s<e.children.length;s++){const r=e.children[s];r.isUI&&(t+=r.textContent)}this._value=t}}class je extends g{constructor(e){super("fontStyle",e,!0),this.isValidValue=Oi}}const Fi=["normal","italic"];function Oi(i){return Fi.indexOf(i)===-1?(console.warn(`(.style) fontStyle value '${i}' is not valid. Aborted`),!1):!0}class Ye extends g{constructor(){super("fontWeight","inherit",!0),this.isValid=zi}}const Li=["100","200","300","400","500","600","700","800","900","light","normal","bold","bolder"];function zi(i){return Li.indexOf(i.toString())===-1?(console.warn(`(.style) fontWeight value '${i}' is not valid. Aborted`),!1):!0}class Ke{constructor(){this._size=42,this._lineHeight=42,this._lineBase=38,this._name="-",this._charset=""}get size(){return this._size}get lineHeight(){return this._lineHeight}get lineBase(){return this._lineBase}get name(){return this._name}get charset(){return this._charset}}class Wi extends Ke{constructor(e){super(),this._size=e.info.size,this._lineHeight=e.common.lineHeight,this._lineBase=e.common.base,this._name=e.info.face,this._textureWidth=e.common.scaleW,this._textureHeight=e.common.scaleH,this._charset=e.chars.map(t=>t.char).join("")}get textureWidth(){return this._textureWidth}get textureHeight(){return this._textureHeight}}class Ei extends Ee{constructor(e){super(e)}get uv(){return this.typographic.uv}}class X extends We{constructor(e,t){super(e),this._char=t.char,this._width=t.width,this._heigth=t.height,this._xadvance=t.xadvance?t.xadvance:this._width,this._xoffset=t.xoffset?t.xoffset:0,this._yoffset=t.yoffset?t.yoffset:0,this._uv=t.uv?t.uv:null,isNaN(t.x)||(this._uv={left:t.x/e.textureWidth,right:(t.x+t.width)/e.textureWidth,top:1-(t.y+t.height)/e.textureHeight,bottom:1-t.y/e.textureHeight})}get uv(){return this._uv}clone(e){return new X(this._font,{char:e,width:this._width,height:this._heigth,xadvance:this._xadvance,xoffset:this._xoffset,yoffset:this._yoffset,uv:null})}asInlineGlyph(){return new Ei(this)}}class Di extends u.PlaneGeometry{constructor(e,t){let s=1,r=1;const n=e.typographic.font.size,o=t._segments.value;s=Math.ceil(e.typographic.width/n*o),r=Math.ceil(e.typographic.height/n*o),super(e.width,e.height,s,r),e.uv?(this._mapUVs(e),this._transformGeometry(e)):(this._nullifyUVs(),this.scale(0,0,1),this.translate(0,e.fontSize/2,0)),this.name="GlyphGeometry"}_mapUVs(e){const t=e.uv.right-e.uv.left,s=e.uv.bottom-e.uv.top,r=this.getAttribute("uv").array.slice(),n=[];for(let o=0;o<r.length;o+=2){const a=r[o],l=r[o+1];n.push(e.uv.left+t*a),n.push(e.uv.top+s*l)}this.setAttribute("uvG",new u.BufferAttribute(new Float32Array(n),2))}_nullifyUVs(){const e=[],t=this.getAttribute("uv").array.length;for(let s=0;s<t;s++)e.push(0);this.setAttribute("uvG",new u.BufferAttribute(new Float32Array(e),2))}_transformGeometry(e){this.translate(e.width/2,-e.height/2,0)}}const Hi=`
3
3
  attribute vec2 uvG;
4
4
  varying vec2 vUvG;
@@ -1,4 +1,4 @@
1
- "use strict";const x=require("./three.umd.cjs"),st={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function _o(r){const t=await fetch(r);if(t.ok)return t.json();throw new Error(t.statusText)}async function La(r){if(!r)throw new Error("No basePath supplied");return await _o(`${r}/profilesList.json`)}async function Va(r,t,e=null,i=!0){if(!r)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const n=await La(t);let s;if(r.profiles.some(a=>{const l=n[a];return l&&(s={profileId:a,profilePath:`${t}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!e)throw new Error("No matching profile name found");const a=n[e];if(!a)throw new Error(`No matching profile name found and default profile "${e}" missing.`);s={profileId:e,profilePath:`${t}/${a.path}`,deprecated:!!a.deprecated}}const o=await _o(s.profilePath);let c;if(i){let a;if(r.handedness==="any"?a=o.layouts[Object.keys(o.layouts)[0]]:a=o.layouts[r.handedness],!a)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);a.assetPath&&(c=s.profilePath.replace("profile.json",a.assetPath))}return{profile:o,assetPath:c}}const Ja={xAxis:0,yAxis:0,button:0,state:st.ComponentState.DEFAULT};function Ga(r=0,t=0){let e=r,i=t;if(Math.sqrt(r*r+t*t)>1){const o=Math.atan2(t,r);e=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:e*.5+.5,normalizedYAxis:i*.5+.5}}class ja{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===st.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Ja)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:s,normalizedYAxis:o}=Ga(t,e);switch(this.componentProperty){case st.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?s:.5;break;case st.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case st.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case st.ComponentProperty.STATE:this.valueNodeProperty===st.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class $a{constructor(t,e){if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(i=>{const n=new ja(e.visualResponses[i]);this.visualResponses[i]=n}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:st.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=st.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||this.values.button===1?this.values.state=st.ComponentState.PRESSED:(e.touched||this.values.button>st.ButtonTouchThreshold)&&(this.values.state=st.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}}class Ha{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const s=this.layoutDescription.components[n];this.components[n]=new $a(n,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}const on=2,jt=4,ee=4,bo=4,le=new Int32Array(2),ps=new Float32Array(le.buffer),ms=new Float64Array(le.buffer),lr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class re{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?re.ZERO:new re(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}}re.ZERO=new re(0,0);var Rn;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Rn||(Rn={}));class Pi{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Pi(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new re(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new re(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return le[0]=this.readInt32(t),ps[0]}readFloat64(t){return le[lr?0:1]=this.readInt32(t),le[lr?1:0]=this.readInt32(t+4),ms[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){ps[0]=e,this.writeInt32(t,le[0])}writeFloat64(t,e){ms[0]=e,this.writeInt32(t,le[lr?0:1]),this.writeInt32(t+4,le[lr?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+jt+ee)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<ee;e++)t+=String.fromCharCode(this.readInt8(this.position_+jt+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const i=this.readInt32(t);let n="",s=0;if(t+=jt,e===Rn.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const c=this.readUint8(t+s++);if(c<192)o=c;else{const a=this.readUint8(t+s++);if(c<224)o=(c&31)<<6|a&63;else{const l=this.readUint8(t+s++);if(c<240)o=(c&15)<<12|(a&63)<<6|l&63;else{const u=this.readUint8(t+s++);o=(c&7)<<18|(a&63)<<12|(l&63)<<6|u&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&1024-1)+56320))}return n}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+jt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let e=0;e<ee;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+jt+e))return!1;return!0}createLong(t,e){return re.create(t,e)}createScalarList(t,e){const i=[];for(let n=0;n<e;++n)t(n)!==null&&i.push(t(n));return i}createObjList(t,e){const i=[];for(let n=0;n<e;++n){const s=t(n);s!==null&&i.push(s.unpack())}return i}}class ts{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=Pi.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const n=this.bb.capacity();this.bb=ts.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=e<<1,n=Pi.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n}addOffset(t){this.prep(jt,0),this.writeInt32(this.offset()-t+jt)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*on;this.addInt16(s);let o=0;const c=this.space;t:for(e=0;e<this.vtables.length;e++){const a=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(a)){for(let l=on;l<s;l+=on)if(this.bb.readInt16(c+l)!=this.bb.readInt16(a+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){const n=i?bo:0;if(e){const s=e;if(this.prep(this.minalign,jt+ee+n),s.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let o=ee-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,jt+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(this.bb.readInt16(n+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(jt,t*e),this.prep(i,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let i=0;for(;i<t.length;){let n;const s=t.charCodeAt(i++);if(s<55296||s>=56320)n=s;else{const o=t.charCodeAt(i++);n=(s<<10)+o+(65536-56623104-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,n=this.space,s=this.bb.bytes();i<e.length;i++)s[n++]=e[i];return this.endVector()}createLong(t,e){return re.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const n=t[i];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}}function Qr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var So={exports:{}};(function(r){var t={};t.useBlobBuilder=function(){try{return new Blob([]),!1}catch{return!0}}(),t.useArrayBufferView=!t.useBlobBuilder&&function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}}(),r.exports.binaryFeatures=t;var e=r.exports.BlobBuilder;typeof window<"u"&&(e=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function i(){this._pieces=[],this._parts=[]}i.prototype.append=function(n){typeof n=="number"?this._pieces.push(n):(this.flush(),this._parts.push(n))},i.prototype.flush=function(){if(this._pieces.length>0){var n=new Uint8Array(this._pieces);t.useArrayBufferView||(n=n.buffer),this._parts.push(n),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),t.useBlobBuilder){for(var n=new e,s=0,o=this._parts.length;s<o;s++)n.append(this._parts[s]);return n.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=i})(So);var To=So.exports,qa=To.BufferBuilder,ys=To.binaryFeatures,Xa={unpack:function(r){var t=new ht(r);return t.unpack()},pack:function(r){var t=new ft;t.pack(r);var e=t.getBuffer();return e}},Wa=Xa;function ht(r){this.index=0,this.dataBuffer=r,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}ht.prototype.unpack=function(){var r=this.unpack_uint8();if(r<128)return r;if((r^224)<32)return(r^224)-32;var t;if((t=r^160)<=15)return this.unpack_raw(t);if((t=r^176)<=15)return this.unpack_string(t);if((t=r^144)<=15)return this.unpack_array(t);if((t=r^128)<=15)return this.unpack_map(t);switch(r){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}};ht.prototype.unpack_uint8=function(){var r=this.dataView[this.index]&255;return this.index++,r};ht.prototype.unpack_uint16=function(){var r=this.read(2),t=(r[0]&255)*256+(r[1]&255);return this.index+=2,t};ht.prototype.unpack_uint32=function(){var r=this.read(4),t=((r[0]*256+r[1])*256+r[2])*256+r[3];return this.index+=4,t};ht.prototype.unpack_uint64=function(){var r=this.read(8),t=((((((r[0]*256+r[1])*256+r[2])*256+r[3])*256+r[4])*256+r[5])*256+r[6])*256+r[7];return this.index+=8,t};ht.prototype.unpack_int8=function(){var r=this.unpack_uint8();return r<128?r:r-256};ht.prototype.unpack_int16=function(){var r=this.unpack_uint16();return r<32768?r:r-65536};ht.prototype.unpack_int32=function(){var r=this.unpack_uint32();return r<Math.pow(2,31)?r:r-Math.pow(2,32)};ht.prototype.unpack_int64=function(){var r=this.unpack_uint64();return r<Math.pow(2,63)?r:r-Math.pow(2,64)};ht.prototype.unpack_raw=function(r){if(this.length<this.index+r)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+r+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+r);return this.index+=r,t};ht.prototype.unpack_string=function(r){for(var t=this.read(r),e=0,i="",n,s;e<r;)n=t[e],n<128?(i+=String.fromCharCode(n),e++):(n^192)<32?(s=(n^192)<<6|t[e+1]&63,i+=String.fromCharCode(s),e+=2):(s=(n&15)<<12|(t[e+1]&63)<<6|t[e+2]&63,i+=String.fromCharCode(s),e+=3);return this.index+=r,i};ht.prototype.unpack_array=function(r){for(var t=new Array(r),e=0;e<r;e++)t[e]=this.unpack();return t};ht.prototype.unpack_map=function(r){for(var t={},e=0;e<r;e++){var i=this.unpack(),n=this.unpack();t[i]=n}return t};ht.prototype.unpack_float=function(){var r=this.unpack_uint32(),t=r>>31,e=(r>>23&255)-127,i=r&8388607|8388608;return(t===0?1:-1)*i*Math.pow(2,e-23)};ht.prototype.unpack_double=function(){var r=this.unpack_uint32(),t=this.unpack_uint32(),e=r>>31,i=(r>>20&2047)-1023,n=r&1048575|1048576,s=n*Math.pow(2,i-20)+t*Math.pow(2,i-52);return(e===0?1:-1)*s};ht.prototype.read=function(r){var t=this.index;if(t+r<=this.length)return this.dataView.subarray(t,t+r);throw new Error("BinaryPackFailure: read index out of range")};function ft(){this.bufferBuilder=new qa}ft.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()};ft.prototype.pack=function(r){var t=typeof r;if(t==="string")this.pack_string(r);else if(t==="number")Math.floor(r)===r?this.pack_integer(r):this.pack_double(r);else if(t==="boolean")r===!0?this.bufferBuilder.append(195):r===!1&&this.bufferBuilder.append(194);else if(t==="undefined")this.bufferBuilder.append(192);else if(t==="object")if(r===null)this.bufferBuilder.append(192);else{var e=r.constructor;if(e==Array)this.pack_array(r);else if(e==Blob||e==File||r instanceof Blob||r instanceof File)this.pack_bin(r);else if(e==ArrayBuffer)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r)):this.pack_bin(r);else if("BYTES_PER_ELEMENT"in r)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r.buffer)):this.pack_bin(r.buffer);else if(e==Object||e.toString().startsWith("class"))this.pack_object(r);else if(e==Date)this.pack_string(r.toString());else if(typeof r.toBinaryPack=="function")this.bufferBuilder.append(r.toBinaryPack());else throw new Error('Type "'+e.toString()+'" not yet supported')}else throw new Error('Type "'+t+'" not yet supported');this.bufferBuilder.flush()};ft.prototype.pack_bin=function(r){var t=r.length||r.byteLength||r.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_string=function(r){var t=Za(r);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_array=function(r){var t=r.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(t);else throw new Error("Invalid length");for(var e=0;e<t;e++)this.pack(r[e])};ft.prototype.pack_integer=function(r){if(r>=-32&&r<=127)this.bufferBuilder.append(r&255);else if(r>=0&&r<=255)this.bufferBuilder.append(204),this.pack_uint8(r);else if(r>=-128&&r<=127)this.bufferBuilder.append(208),this.pack_int8(r);else if(r>=0&&r<=65535)this.bufferBuilder.append(205),this.pack_uint16(r);else if(r>=-32768&&r<=32767)this.bufferBuilder.append(209),this.pack_int16(r);else if(r>=0&&r<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(r);else if(r>=-2147483648&&r<=2147483647)this.bufferBuilder.append(210),this.pack_int32(r);else if(r>=-9223372036854776e3&&r<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(r);else if(r>=0&&r<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(r);else throw new Error("Invalid integer")};ft.prototype.pack_double=function(r){var t=0;r<0&&(t=1,r=-r);var e=Math.floor(Math.log(r)/Math.LN2),i=r/Math.pow(2,e)-1,n=Math.floor(i*Math.pow(2,52)),s=Math.pow(2,32),o=t<<31|e+1023<<20|n/s&1048575,c=n%s;this.bufferBuilder.append(203),this.pack_int32(o),this.pack_int32(c)};ft.prototype.pack_object=function(r){var t=Object.keys(r),e=t.length;if(e<=15)this.pack_uint8(128+e);else if(e<=65535)this.bufferBuilder.append(222),this.pack_uint16(e);else if(e<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(e);else throw new Error("Invalid length");for(var i in r)r.hasOwnProperty(i)&&(this.pack(i),this.pack(r[i]))};ft.prototype.pack_uint8=function(r){this.bufferBuilder.append(r)};ft.prototype.pack_uint16=function(r){this.bufferBuilder.append(r>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_uint32=function(r){var t=r&4294967295;this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255)};ft.prototype.pack_uint64=function(r){var t=r/Math.pow(2,32),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};ft.prototype.pack_int8=function(r){this.bufferBuilder.append(r&255)};ft.prototype.pack_int16=function(r){this.bufferBuilder.append((r&65280)>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int32=function(r){this.bufferBuilder.append(r>>>24&255),this.bufferBuilder.append((r&16711680)>>>16),this.bufferBuilder.append((r&65280)>>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int64=function(r){var t=Math.floor(r/Math.pow(2,32)),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};function Ya(r){var t=r.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}function Za(r){return r.length>600?new Blob([r]).size:r.replace(/[^\u0000-\u007F]/g,Ya).length}const gs=Qr(Wa);let Mo=!0,Co=!0;function _i(r,t,e){const i=r.match(t);return i&&i.length>=e&&parseInt(i[e],10)}function Qe(r,t,e){if(!r.RTCPeerConnection)return;const i=r.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(o,c){if(o!==t)return n.apply(this,arguments);const a=l=>{const u=e(l);u&&(c.handleEvent?c.handleEvent(u):c(u))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(c,a),n.apply(this,[o,a])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==t||!this._eventMap||!this._eventMap[t])return s.apply(this,arguments);if(!this._eventMap[t].has(c))return s.apply(this,arguments);const a=this._eventMap[t].get(c);return this._eventMap[t].delete(c),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,a])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(o){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),o&&this.addEventListener(t,this["_on"+t]=o)},enumerable:!0,configurable:!0})}function Qa(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Mo=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Ka(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Co=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function es(){if(typeof window=="object"){if(Mo)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Kr(r,t){Co&&console.warn(r+" is deprecated, please use "+t+" instead.")}function tc(r){const t={browser:null,version:null};if(typeof r>"u"||!r.navigator)return t.browser="Not a browser.",t;const{navigator:e}=r;if(e.mozGetUserMedia)t.browser="firefox",t.version=_i(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)t.browser="chrome",t.version=_i(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_i(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&e.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser="safari",t.version=_i(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return t.browser="Not a supported browser.",t;return t}function vs(r){return Object.prototype.toString.call(r)==="[object Object]"}function wo(r){return vs(r)?Object.keys(r).reduce(function(t,e){const i=vs(r[e]),n=i?wo(r[e]):r[e],s=i&&!Object.keys(n).length;return n===void 0||s?t:Object.assign(t,{[e]:n})},{}):r}function kn(r,t,e){!t||e.has(t.id)||(e.set(t.id,t),Object.keys(t).forEach(i=>{i.endsWith("Id")?kn(r,r.get(t[i]),e):i.endsWith("Ids")&&t[i].forEach(n=>{kn(r,r.get(n),e)})}))}function xs(r,t,e){const i=e?"outbound-rtp":"inbound-rtp",n=new Map;if(t===null)return n;const s=[];return r.forEach(o=>{o.type==="track"&&o.trackIdentifier===t.id&&s.push(o)}),s.forEach(o=>{r.forEach(c=>{c.type===i&&c.trackId===o.id&&kn(r,c,n)})}),n}const _s=es;function Po(r,t){const e=r&&r.navigator;if(!e.mediaDevices)return;const i=function(c){if(typeof c!="object"||c.mandatory||c.optional)return c;const a={};return Object.keys(c).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof c[l]=="object"?c[l]:{ideal:c[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const h=function(f,d){return f?f+d.charAt(0).toUpperCase()+d.slice(1):d==="deviceId"?"sourceId":d};if(u.ideal!==void 0){a.optional=a.optional||[];let f={};typeof u.ideal=="number"?(f[h("min",l)]=u.ideal,a.optional.push(f),f={},f[h("max",l)]=u.ideal,a.optional.push(f)):(f[h("",l)]=u.ideal,a.optional.push(f))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[h("",l)]=u.exact):["min","max"].forEach(f=>{u[f]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[h(f,l)]=u[f])})}),c.advanced&&(a.optional=(a.optional||[]).concat(c.advanced)),a},n=function(c,a){if(t.version>=61)return a(c);if(c=JSON.parse(JSON.stringify(c)),c&&typeof c.audio=="object"){const l=function(u,h,f){h in u&&!(f in u)&&(u[f]=u[h],delete u[h])};c=JSON.parse(JSON.stringify(c)),l(c.audio,"autoGainControl","googAutoGainControl"),l(c.audio,"noiseSuppression","googNoiseSuppression"),c.audio=i(c.audio)}if(c&&typeof c.video=="object"){let l=c.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=t.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(e.mediaDevices.getSupportedConstraints&&e.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete c.video.facingMode;let h;if(l.exact==="environment"||l.ideal==="environment"?h=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(h=["front"]),h)return e.mediaDevices.enumerateDevices().then(f=>{f=f.filter(p=>p.kind==="videoinput");let d=f.find(p=>h.some(m=>p.label.toLowerCase().includes(m)));return!d&&f.length&&h.includes("back")&&(d=f[f.length-1]),d&&(c.video.deviceId=l.exact?{exact:d.deviceId}:{ideal:d.deviceId}),c.video=i(c.video),_s("chrome: "+JSON.stringify(c)),a(c)})}c.video=i(c.video)}return _s("chrome: "+JSON.stringify(c)),a(c)},s=function(c){return t.version>=64?c:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[c.name]||c.name,message:c.message,constraint:c.constraint||c.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(c,a,l){n(c,u=>{e.webkitGetUserMedia(u,a,h=>{l&&l(s(h))})})};if(e.getUserMedia=o.bind(e),e.mediaDevices.getUserMedia){const c=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(a){return n(a,l=>c(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function ec(r,t){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof t!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then(n=>{const s=i.video&&i.video.width,o=i.video&&i.video.height,c=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:n,maxFrameRate:c||3}},s&&(i.video.mandatory.maxWidth=s),o&&(i.video.mandatory.maxHeight=o),r.navigator.mediaDevices.getUserMedia(i)})}}}function Eo(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function Ao(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.track.id):s={track:n.track};const o=new Event("track");o.track=n.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.id):s={track:n};const o=new Event("track");o.track=n,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Qe(r,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function Ro(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const t=function(n,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=n.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:n}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(c,a){let l=n.apply(this,arguments);return l||(l=t(this,c),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(c){s.apply(this,arguments);const a=this._senders.indexOf(c);a!==-1&&this._senders.splice(a,1)}}const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],e.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(t(this,o))})};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],i.apply(this,[s]),s.getTracks().forEach(o=>{const c=this._senders.find(a=>a.track===o);c&&this._senders.splice(this._senders.indexOf(c),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const i=t.apply(this,[]);return i.forEach(n=>n._pc=this),i},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function ko(r){if(!r.RTCPeerConnection)return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[i,n,s]=arguments;if(arguments.length>0&&typeof i=="function")return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof i!="function"))return t.apply(this,[]);const o=function(a){const l={};return a.result().forEach(h=>{const f={id:h.id,timestamp:h.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[h.type]||h.type};h.names().forEach(d=>{f[d]=h.stat(d)}),l[f.id]=f}),l},c=function(a){return new Map(Object.keys(a).map(l=>[l,a[l]]))};if(arguments.length>=2){const a=function(l){n(c(o(l)))};return t.apply(this,[a,i])}return new Promise((a,l)=>{t.apply(this,[function(u){a(c(o(u)))},l])}).then(n,s)}}function Bo(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;e&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=e.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=r.RTCPeerConnection.prototype.addTrack;i&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>xs(o,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const e=r.RTCPeerConnection.prototype.getReceivers;e&&(r.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(s=>s._pc=this),n}),Qe(r,"track",i=>(i.receiver._pc=i.srcElement,i)),r.RTCRtpReceiver.prototype.getStats=function(){const n=this;return this._pc.getStats().then(s=>xs(s,n.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const i=arguments[0];let n,s,o;return this.getSenders().forEach(c=>{c.track===i&&(n?o=!0:n=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||n&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function zo(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){if(!c)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=t.apply(this,arguments);return this._shimmedLocalStreams[c.id]?this._shimmedLocalStreams[c.id].indexOf(a)===-1&&this._shimmedLocalStreams[c.id].push(a):this._shimmedLocalStreams[c.id]=[c,a],a};const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const c=this.getSenders();e.apply(this,arguments);const a=this.getSenders().filter(l=>c.indexOf(l)===-1);this._shimmedLocalStreams[o.id]=[o].concat(a)};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],i.apply(this,arguments)};const n=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(c=>{const a=this._shimmedLocalStreams[c].indexOf(o);a!==-1&&this._shimmedLocalStreams[c].splice(a,1),this._shimmedLocalStreams[c].length===1&&delete this._shimmedLocalStreams[c]}),n.apply(this,arguments)}}function Oo(r,t){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&t.version>=65)return zo(r);const e=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=e.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(h=>this._reverseStreams[h.id])};const i=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(h=>{if(this.getSenders().find(d=>d.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const h=new r.MediaStream(u.getTracks());this._streams[u.id]=h,this._reverseStreams[h.id]=u,u=h}i.apply(this,[u])};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const f=[].slice.call(arguments,1);if(f.length!==1||!f[0].getTracks().find(m=>m===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const p=this._streams[h.id];if(p)p.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new r.MediaStream([u]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===u)};function s(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(p.id,"g"),d.id)}),new RTCSessionDescription({type:u.type,sdp:h})}function o(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(d.id,"g"),p.id)}),new RTCSessionDescription({type:u.type,sdp:h})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],h={[l](){const f=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[p=>{const m=s(this,p);f[0].apply(null,[m])},p=>{f[1]&&f[1].apply(null,p)},arguments[2]]):u.apply(this,arguments).then(p=>s(this,p))}};r.RTCPeerConnection.prototype[l]=h[l]});const c=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?c.apply(this,arguments):(arguments[0]=o(this,arguments[0]),c.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=a.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let f;Object.keys(this._streams).forEach(d=>{this._streams[d].getTracks().find(m=>u.track===m)&&(f=this._streams[d])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Bn(r,t){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const i=r.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new(e==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};r.RTCPeerConnection.prototype[e]=n[e]})}function Io(r,t){Qe(r,"negotiationneeded",e=>{const i=e.target;if(!((t.version<72||i.getConfiguration&&i.getConfiguration().sdpSemantics==="plan-b")&&i.signalingState!=="stable"))return e})}const bs=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Io,shimAddTrackRemoveTrack:Oo,shimAddTrackRemoveTrackWithNative:zo,shimGetDisplayMedia:ec,shimGetSendersWithDtmf:Ro,shimGetStats:ko,shimGetUserMedia:Po,shimMediaStream:Eo,shimOnTrack:Ao,shimPeerConnection:Bn,shimSenderReceiverGetStats:Bo},Symbol.toStringTag,{value:"Module"}));function ic(r,t){let e=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(i=>{if(i&&(i.urls||i.url)){let n=i.urls||i.url;i.url&&!i.urls&&Kr("RTCIceServer.url","RTCIceServer.urls");const s=typeof n=="string";return s&&(n=[n]),n=n.filter(o=>{if(o.indexOf("stun:")===0)return!1;const c=o.startsWith("turn")&&!o.startsWith("turn:[")&&o.includes("transport=udp");return c&&!e?(e=!0,!0):c&&!e}),delete i.url,i.urls=s?n[0]:n,!!n.length}})}var No={exports:{}};(function(r){var t={};t.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split(`
1
+ "use strict";const x=require("./three-ed3e16aa.light.umd.cjs"),st={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function _o(r){const t=await fetch(r);if(t.ok)return t.json();throw new Error(t.statusText)}async function La(r){if(!r)throw new Error("No basePath supplied");return await _o(`${r}/profilesList.json`)}async function Va(r,t,e=null,i=!0){if(!r)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const n=await La(t);let s;if(r.profiles.some(a=>{const l=n[a];return l&&(s={profileId:a,profilePath:`${t}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!e)throw new Error("No matching profile name found");const a=n[e];if(!a)throw new Error(`No matching profile name found and default profile "${e}" missing.`);s={profileId:e,profilePath:`${t}/${a.path}`,deprecated:!!a.deprecated}}const o=await _o(s.profilePath);let c;if(i){let a;if(r.handedness==="any"?a=o.layouts[Object.keys(o.layouts)[0]]:a=o.layouts[r.handedness],!a)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);a.assetPath&&(c=s.profilePath.replace("profile.json",a.assetPath))}return{profile:o,assetPath:c}}const Ja={xAxis:0,yAxis:0,button:0,state:st.ComponentState.DEFAULT};function Ga(r=0,t=0){let e=r,i=t;if(Math.sqrt(r*r+t*t)>1){const o=Math.atan2(t,r);e=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:e*.5+.5,normalizedYAxis:i*.5+.5}}class ja{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===st.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Ja)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:s,normalizedYAxis:o}=Ga(t,e);switch(this.componentProperty){case st.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?s:.5;break;case st.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case st.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case st.ComponentProperty.STATE:this.valueNodeProperty===st.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class $a{constructor(t,e){if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(i=>{const n=new ja(e.visualResponses[i]);this.visualResponses[i]=n}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:st.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=st.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||this.values.button===1?this.values.state=st.ComponentState.PRESSED:(e.touched||this.values.button>st.ButtonTouchThreshold)&&(this.values.state=st.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}}class Ha{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const s=this.layoutDescription.components[n];this.components[n]=new $a(n,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}const on=2,jt=4,ee=4,bo=4,le=new Int32Array(2),ps=new Float32Array(le.buffer),ms=new Float64Array(le.buffer),lr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class re{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?re.ZERO:new re(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}}re.ZERO=new re(0,0);var Rn;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Rn||(Rn={}));class Pi{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Pi(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new re(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new re(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return le[0]=this.readInt32(t),ps[0]}readFloat64(t){return le[lr?0:1]=this.readInt32(t),le[lr?1:0]=this.readInt32(t+4),ms[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){ps[0]=e,this.writeInt32(t,le[0])}writeFloat64(t,e){ms[0]=e,this.writeInt32(t,le[lr?0:1]),this.writeInt32(t+4,le[lr?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+jt+ee)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<ee;e++)t+=String.fromCharCode(this.readInt8(this.position_+jt+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const i=this.readInt32(t);let n="",s=0;if(t+=jt,e===Rn.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const c=this.readUint8(t+s++);if(c<192)o=c;else{const a=this.readUint8(t+s++);if(c<224)o=(c&31)<<6|a&63;else{const l=this.readUint8(t+s++);if(c<240)o=(c&15)<<12|(a&63)<<6|l&63;else{const u=this.readUint8(t+s++);o=(c&7)<<18|(a&63)<<12|(l&63)<<6|u&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&1024-1)+56320))}return n}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+jt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let e=0;e<ee;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+jt+e))return!1;return!0}createLong(t,e){return re.create(t,e)}createScalarList(t,e){const i=[];for(let n=0;n<e;++n)t(n)!==null&&i.push(t(n));return i}createObjList(t,e){const i=[];for(let n=0;n<e;++n){const s=t(n);s!==null&&i.push(s.unpack())}return i}}class ts{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=Pi.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const n=this.bb.capacity();this.bb=ts.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=e<<1,n=Pi.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n}addOffset(t){this.prep(jt,0),this.writeInt32(this.offset()-t+jt)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*on;this.addInt16(s);let o=0;const c=this.space;t:for(e=0;e<this.vtables.length;e++){const a=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(a)){for(let l=on;l<s;l+=on)if(this.bb.readInt16(c+l)!=this.bb.readInt16(a+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){const n=i?bo:0;if(e){const s=e;if(this.prep(this.minalign,jt+ee+n),s.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let o=ee-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,jt+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(this.bb.readInt16(n+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(jt,t*e),this.prep(i,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let i=0;for(;i<t.length;){let n;const s=t.charCodeAt(i++);if(s<55296||s>=56320)n=s;else{const o=t.charCodeAt(i++);n=(s<<10)+o+(65536-56623104-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,n=this.space,s=this.bb.bytes();i<e.length;i++)s[n++]=e[i];return this.endVector()}createLong(t,e){return re.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const n=t[i];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}}function Qr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var So={exports:{}};(function(r){var t={};t.useBlobBuilder=function(){try{return new Blob([]),!1}catch{return!0}}(),t.useArrayBufferView=!t.useBlobBuilder&&function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}}(),r.exports.binaryFeatures=t;var e=r.exports.BlobBuilder;typeof window<"u"&&(e=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function i(){this._pieces=[],this._parts=[]}i.prototype.append=function(n){typeof n=="number"?this._pieces.push(n):(this.flush(),this._parts.push(n))},i.prototype.flush=function(){if(this._pieces.length>0){var n=new Uint8Array(this._pieces);t.useArrayBufferView||(n=n.buffer),this._parts.push(n),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),t.useBlobBuilder){for(var n=new e,s=0,o=this._parts.length;s<o;s++)n.append(this._parts[s]);return n.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=i})(So);var To=So.exports,qa=To.BufferBuilder,ys=To.binaryFeatures,Xa={unpack:function(r){var t=new ht(r);return t.unpack()},pack:function(r){var t=new ft;t.pack(r);var e=t.getBuffer();return e}},Wa=Xa;function ht(r){this.index=0,this.dataBuffer=r,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}ht.prototype.unpack=function(){var r=this.unpack_uint8();if(r<128)return r;if((r^224)<32)return(r^224)-32;var t;if((t=r^160)<=15)return this.unpack_raw(t);if((t=r^176)<=15)return this.unpack_string(t);if((t=r^144)<=15)return this.unpack_array(t);if((t=r^128)<=15)return this.unpack_map(t);switch(r){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}};ht.prototype.unpack_uint8=function(){var r=this.dataView[this.index]&255;return this.index++,r};ht.prototype.unpack_uint16=function(){var r=this.read(2),t=(r[0]&255)*256+(r[1]&255);return this.index+=2,t};ht.prototype.unpack_uint32=function(){var r=this.read(4),t=((r[0]*256+r[1])*256+r[2])*256+r[3];return this.index+=4,t};ht.prototype.unpack_uint64=function(){var r=this.read(8),t=((((((r[0]*256+r[1])*256+r[2])*256+r[3])*256+r[4])*256+r[5])*256+r[6])*256+r[7];return this.index+=8,t};ht.prototype.unpack_int8=function(){var r=this.unpack_uint8();return r<128?r:r-256};ht.prototype.unpack_int16=function(){var r=this.unpack_uint16();return r<32768?r:r-65536};ht.prototype.unpack_int32=function(){var r=this.unpack_uint32();return r<Math.pow(2,31)?r:r-Math.pow(2,32)};ht.prototype.unpack_int64=function(){var r=this.unpack_uint64();return r<Math.pow(2,63)?r:r-Math.pow(2,64)};ht.prototype.unpack_raw=function(r){if(this.length<this.index+r)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+r+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+r);return this.index+=r,t};ht.prototype.unpack_string=function(r){for(var t=this.read(r),e=0,i="",n,s;e<r;)n=t[e],n<128?(i+=String.fromCharCode(n),e++):(n^192)<32?(s=(n^192)<<6|t[e+1]&63,i+=String.fromCharCode(s),e+=2):(s=(n&15)<<12|(t[e+1]&63)<<6|t[e+2]&63,i+=String.fromCharCode(s),e+=3);return this.index+=r,i};ht.prototype.unpack_array=function(r){for(var t=new Array(r),e=0;e<r;e++)t[e]=this.unpack();return t};ht.prototype.unpack_map=function(r){for(var t={},e=0;e<r;e++){var i=this.unpack(),n=this.unpack();t[i]=n}return t};ht.prototype.unpack_float=function(){var r=this.unpack_uint32(),t=r>>31,e=(r>>23&255)-127,i=r&8388607|8388608;return(t===0?1:-1)*i*Math.pow(2,e-23)};ht.prototype.unpack_double=function(){var r=this.unpack_uint32(),t=this.unpack_uint32(),e=r>>31,i=(r>>20&2047)-1023,n=r&1048575|1048576,s=n*Math.pow(2,i-20)+t*Math.pow(2,i-52);return(e===0?1:-1)*s};ht.prototype.read=function(r){var t=this.index;if(t+r<=this.length)return this.dataView.subarray(t,t+r);throw new Error("BinaryPackFailure: read index out of range")};function ft(){this.bufferBuilder=new qa}ft.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()};ft.prototype.pack=function(r){var t=typeof r;if(t==="string")this.pack_string(r);else if(t==="number")Math.floor(r)===r?this.pack_integer(r):this.pack_double(r);else if(t==="boolean")r===!0?this.bufferBuilder.append(195):r===!1&&this.bufferBuilder.append(194);else if(t==="undefined")this.bufferBuilder.append(192);else if(t==="object")if(r===null)this.bufferBuilder.append(192);else{var e=r.constructor;if(e==Array)this.pack_array(r);else if(e==Blob||e==File||r instanceof Blob||r instanceof File)this.pack_bin(r);else if(e==ArrayBuffer)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r)):this.pack_bin(r);else if("BYTES_PER_ELEMENT"in r)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r.buffer)):this.pack_bin(r.buffer);else if(e==Object||e.toString().startsWith("class"))this.pack_object(r);else if(e==Date)this.pack_string(r.toString());else if(typeof r.toBinaryPack=="function")this.bufferBuilder.append(r.toBinaryPack());else throw new Error('Type "'+e.toString()+'" not yet supported')}else throw new Error('Type "'+t+'" not yet supported');this.bufferBuilder.flush()};ft.prototype.pack_bin=function(r){var t=r.length||r.byteLength||r.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_string=function(r){var t=Za(r);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_array=function(r){var t=r.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(t);else throw new Error("Invalid length");for(var e=0;e<t;e++)this.pack(r[e])};ft.prototype.pack_integer=function(r){if(r>=-32&&r<=127)this.bufferBuilder.append(r&255);else if(r>=0&&r<=255)this.bufferBuilder.append(204),this.pack_uint8(r);else if(r>=-128&&r<=127)this.bufferBuilder.append(208),this.pack_int8(r);else if(r>=0&&r<=65535)this.bufferBuilder.append(205),this.pack_uint16(r);else if(r>=-32768&&r<=32767)this.bufferBuilder.append(209),this.pack_int16(r);else if(r>=0&&r<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(r);else if(r>=-2147483648&&r<=2147483647)this.bufferBuilder.append(210),this.pack_int32(r);else if(r>=-9223372036854776e3&&r<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(r);else if(r>=0&&r<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(r);else throw new Error("Invalid integer")};ft.prototype.pack_double=function(r){var t=0;r<0&&(t=1,r=-r);var e=Math.floor(Math.log(r)/Math.LN2),i=r/Math.pow(2,e)-1,n=Math.floor(i*Math.pow(2,52)),s=Math.pow(2,32),o=t<<31|e+1023<<20|n/s&1048575,c=n%s;this.bufferBuilder.append(203),this.pack_int32(o),this.pack_int32(c)};ft.prototype.pack_object=function(r){var t=Object.keys(r),e=t.length;if(e<=15)this.pack_uint8(128+e);else if(e<=65535)this.bufferBuilder.append(222),this.pack_uint16(e);else if(e<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(e);else throw new Error("Invalid length");for(var i in r)r.hasOwnProperty(i)&&(this.pack(i),this.pack(r[i]))};ft.prototype.pack_uint8=function(r){this.bufferBuilder.append(r)};ft.prototype.pack_uint16=function(r){this.bufferBuilder.append(r>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_uint32=function(r){var t=r&4294967295;this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255)};ft.prototype.pack_uint64=function(r){var t=r/Math.pow(2,32),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};ft.prototype.pack_int8=function(r){this.bufferBuilder.append(r&255)};ft.prototype.pack_int16=function(r){this.bufferBuilder.append((r&65280)>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int32=function(r){this.bufferBuilder.append(r>>>24&255),this.bufferBuilder.append((r&16711680)>>>16),this.bufferBuilder.append((r&65280)>>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int64=function(r){var t=Math.floor(r/Math.pow(2,32)),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};function Ya(r){var t=r.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}function Za(r){return r.length>600?new Blob([r]).size:r.replace(/[^\u0000-\u007F]/g,Ya).length}const gs=Qr(Wa);let Mo=!0,Co=!0;function _i(r,t,e){const i=r.match(t);return i&&i.length>=e&&parseInt(i[e],10)}function Qe(r,t,e){if(!r.RTCPeerConnection)return;const i=r.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(o,c){if(o!==t)return n.apply(this,arguments);const a=l=>{const u=e(l);u&&(c.handleEvent?c.handleEvent(u):c(u))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(c,a),n.apply(this,[o,a])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==t||!this._eventMap||!this._eventMap[t])return s.apply(this,arguments);if(!this._eventMap[t].has(c))return s.apply(this,arguments);const a=this._eventMap[t].get(c);return this._eventMap[t].delete(c),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,a])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(o){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),o&&this.addEventListener(t,this["_on"+t]=o)},enumerable:!0,configurable:!0})}function Qa(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Mo=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Ka(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Co=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function es(){if(typeof window=="object"){if(Mo)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Kr(r,t){Co&&console.warn(r+" is deprecated, please use "+t+" instead.")}function tc(r){const t={browser:null,version:null};if(typeof r>"u"||!r.navigator)return t.browser="Not a browser.",t;const{navigator:e}=r;if(e.mozGetUserMedia)t.browser="firefox",t.version=_i(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)t.browser="chrome",t.version=_i(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_i(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&e.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser="safari",t.version=_i(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return t.browser="Not a supported browser.",t;return t}function vs(r){return Object.prototype.toString.call(r)==="[object Object]"}function wo(r){return vs(r)?Object.keys(r).reduce(function(t,e){const i=vs(r[e]),n=i?wo(r[e]):r[e],s=i&&!Object.keys(n).length;return n===void 0||s?t:Object.assign(t,{[e]:n})},{}):r}function kn(r,t,e){!t||e.has(t.id)||(e.set(t.id,t),Object.keys(t).forEach(i=>{i.endsWith("Id")?kn(r,r.get(t[i]),e):i.endsWith("Ids")&&t[i].forEach(n=>{kn(r,r.get(n),e)})}))}function xs(r,t,e){const i=e?"outbound-rtp":"inbound-rtp",n=new Map;if(t===null)return n;const s=[];return r.forEach(o=>{o.type==="track"&&o.trackIdentifier===t.id&&s.push(o)}),s.forEach(o=>{r.forEach(c=>{c.type===i&&c.trackId===o.id&&kn(r,c,n)})}),n}const _s=es;function Po(r,t){const e=r&&r.navigator;if(!e.mediaDevices)return;const i=function(c){if(typeof c!="object"||c.mandatory||c.optional)return c;const a={};return Object.keys(c).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof c[l]=="object"?c[l]:{ideal:c[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const h=function(f,d){return f?f+d.charAt(0).toUpperCase()+d.slice(1):d==="deviceId"?"sourceId":d};if(u.ideal!==void 0){a.optional=a.optional||[];let f={};typeof u.ideal=="number"?(f[h("min",l)]=u.ideal,a.optional.push(f),f={},f[h("max",l)]=u.ideal,a.optional.push(f)):(f[h("",l)]=u.ideal,a.optional.push(f))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[h("",l)]=u.exact):["min","max"].forEach(f=>{u[f]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[h(f,l)]=u[f])})}),c.advanced&&(a.optional=(a.optional||[]).concat(c.advanced)),a},n=function(c,a){if(t.version>=61)return a(c);if(c=JSON.parse(JSON.stringify(c)),c&&typeof c.audio=="object"){const l=function(u,h,f){h in u&&!(f in u)&&(u[f]=u[h],delete u[h])};c=JSON.parse(JSON.stringify(c)),l(c.audio,"autoGainControl","googAutoGainControl"),l(c.audio,"noiseSuppression","googNoiseSuppression"),c.audio=i(c.audio)}if(c&&typeof c.video=="object"){let l=c.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=t.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(e.mediaDevices.getSupportedConstraints&&e.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete c.video.facingMode;let h;if(l.exact==="environment"||l.ideal==="environment"?h=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(h=["front"]),h)return e.mediaDevices.enumerateDevices().then(f=>{f=f.filter(p=>p.kind==="videoinput");let d=f.find(p=>h.some(m=>p.label.toLowerCase().includes(m)));return!d&&f.length&&h.includes("back")&&(d=f[f.length-1]),d&&(c.video.deviceId=l.exact?{exact:d.deviceId}:{ideal:d.deviceId}),c.video=i(c.video),_s("chrome: "+JSON.stringify(c)),a(c)})}c.video=i(c.video)}return _s("chrome: "+JSON.stringify(c)),a(c)},s=function(c){return t.version>=64?c:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[c.name]||c.name,message:c.message,constraint:c.constraint||c.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(c,a,l){n(c,u=>{e.webkitGetUserMedia(u,a,h=>{l&&l(s(h))})})};if(e.getUserMedia=o.bind(e),e.mediaDevices.getUserMedia){const c=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(a){return n(a,l=>c(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function ec(r,t){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof t!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then(n=>{const s=i.video&&i.video.width,o=i.video&&i.video.height,c=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:n,maxFrameRate:c||3}},s&&(i.video.mandatory.maxWidth=s),o&&(i.video.mandatory.maxHeight=o),r.navigator.mediaDevices.getUserMedia(i)})}}}function Eo(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function Ao(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.track.id):s={track:n.track};const o=new Event("track");o.track=n.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.id):s={track:n};const o=new Event("track");o.track=n,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Qe(r,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function Ro(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const t=function(n,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=n.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:n}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(c,a){let l=n.apply(this,arguments);return l||(l=t(this,c),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(c){s.apply(this,arguments);const a=this._senders.indexOf(c);a!==-1&&this._senders.splice(a,1)}}const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],e.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(t(this,o))})};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],i.apply(this,[s]),s.getTracks().forEach(o=>{const c=this._senders.find(a=>a.track===o);c&&this._senders.splice(this._senders.indexOf(c),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const i=t.apply(this,[]);return i.forEach(n=>n._pc=this),i},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function ko(r){if(!r.RTCPeerConnection)return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[i,n,s]=arguments;if(arguments.length>0&&typeof i=="function")return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof i!="function"))return t.apply(this,[]);const o=function(a){const l={};return a.result().forEach(h=>{const f={id:h.id,timestamp:h.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[h.type]||h.type};h.names().forEach(d=>{f[d]=h.stat(d)}),l[f.id]=f}),l},c=function(a){return new Map(Object.keys(a).map(l=>[l,a[l]]))};if(arguments.length>=2){const a=function(l){n(c(o(l)))};return t.apply(this,[a,i])}return new Promise((a,l)=>{t.apply(this,[function(u){a(c(o(u)))},l])}).then(n,s)}}function Bo(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;e&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=e.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=r.RTCPeerConnection.prototype.addTrack;i&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>xs(o,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const e=r.RTCPeerConnection.prototype.getReceivers;e&&(r.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(s=>s._pc=this),n}),Qe(r,"track",i=>(i.receiver._pc=i.srcElement,i)),r.RTCRtpReceiver.prototype.getStats=function(){const n=this;return this._pc.getStats().then(s=>xs(s,n.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const i=arguments[0];let n,s,o;return this.getSenders().forEach(c=>{c.track===i&&(n?o=!0:n=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||n&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function zo(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){if(!c)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=t.apply(this,arguments);return this._shimmedLocalStreams[c.id]?this._shimmedLocalStreams[c.id].indexOf(a)===-1&&this._shimmedLocalStreams[c.id].push(a):this._shimmedLocalStreams[c.id]=[c,a],a};const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const c=this.getSenders();e.apply(this,arguments);const a=this.getSenders().filter(l=>c.indexOf(l)===-1);this._shimmedLocalStreams[o.id]=[o].concat(a)};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],i.apply(this,arguments)};const n=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(c=>{const a=this._shimmedLocalStreams[c].indexOf(o);a!==-1&&this._shimmedLocalStreams[c].splice(a,1),this._shimmedLocalStreams[c].length===1&&delete this._shimmedLocalStreams[c]}),n.apply(this,arguments)}}function Oo(r,t){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&t.version>=65)return zo(r);const e=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=e.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(h=>this._reverseStreams[h.id])};const i=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(h=>{if(this.getSenders().find(d=>d.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const h=new r.MediaStream(u.getTracks());this._streams[u.id]=h,this._reverseStreams[h.id]=u,u=h}i.apply(this,[u])};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const f=[].slice.call(arguments,1);if(f.length!==1||!f[0].getTracks().find(m=>m===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const p=this._streams[h.id];if(p)p.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new r.MediaStream([u]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===u)};function s(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(p.id,"g"),d.id)}),new RTCSessionDescription({type:u.type,sdp:h})}function o(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(d.id,"g"),p.id)}),new RTCSessionDescription({type:u.type,sdp:h})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],h={[l](){const f=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[p=>{const m=s(this,p);f[0].apply(null,[m])},p=>{f[1]&&f[1].apply(null,p)},arguments[2]]):u.apply(this,arguments).then(p=>s(this,p))}};r.RTCPeerConnection.prototype[l]=h[l]});const c=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?c.apply(this,arguments):(arguments[0]=o(this,arguments[0]),c.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=a.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let f;Object.keys(this._streams).forEach(d=>{this._streams[d].getTracks().find(m=>u.track===m)&&(f=this._streams[d])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Bn(r,t){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const i=r.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new(e==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};r.RTCPeerConnection.prototype[e]=n[e]})}function Io(r,t){Qe(r,"negotiationneeded",e=>{const i=e.target;if(!((t.version<72||i.getConfiguration&&i.getConfiguration().sdpSemantics==="plan-b")&&i.signalingState!=="stable"))return e})}const bs=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Io,shimAddTrackRemoveTrack:Oo,shimAddTrackRemoveTrackWithNative:zo,shimGetDisplayMedia:ec,shimGetSendersWithDtmf:Ro,shimGetStats:ko,shimGetUserMedia:Po,shimMediaStream:Eo,shimOnTrack:Ao,shimPeerConnection:Bn,shimSenderReceiverGetStats:Bo},Symbol.toStringTag,{value:"Module"}));function ic(r,t){let e=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(i=>{if(i&&(i.urls||i.url)){let n=i.urls||i.url;i.url&&!i.urls&&Kr("RTCIceServer.url","RTCIceServer.urls");const s=typeof n=="string";return s&&(n=[n]),n=n.filter(o=>{if(o.indexOf("stun:")===0)return!1;const c=o.startsWith("turn")&&!o.startsWith("turn:[")&&o.includes("transport=udp");return c&&!e?(e=!0,!0):c&&!e}),delete i.url,i.urls=s?n[0]:n,!!n.length}})}var No={exports:{}};(function(r){var t={};t.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split(`
2
2
  `).map(function(i){return i.trim()})},t.splitSections=function(e){var i=e.split(`
3
3
  m=`);return i.map(function(n,s){return(s>0?"m="+n:n).trim()+`\r
4
4
  `})},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter(function(n){return n.indexOf(i)===0})},t.parseCandidate=function(e){var i;e.indexOf("a=candidate:")===0?i=e.substring(12).split(" "):i=e.substring(10).split(" ");for(var n={foundation:i[0],component:parseInt(i[1],10),protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],address:i[4],port:parseInt(i[5],10),type:i[7]},s=8;s<i.length;s+=2)switch(i[s]){case"raddr":n.relatedAddress=i[s+1];break;case"rport":n.relatedPort=parseInt(i[s+1],10);break;case"tcptype":n.tcpType=i[s+1];break;case"ufrag":n.ufrag=i[s+1],n.usernameFragment=i[s+1];break;default:n[i[s]]=i[s+1];break}return n},t.writeCandidate=function(e){var i=[];i.push(e.foundation),i.push(e.component),i.push(e.protocol.toUpperCase()),i.push(e.priority),i.push(e.address||e.ip),i.push(e.port);var n=e.type;return i.push("typ"),i.push(n),n!=="host"&&e.relatedAddress&&e.relatedPort&&(i.push("raddr"),i.push(e.relatedAddress),i.push("rport"),i.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()==="tcp"&&(i.push("tcptype"),i.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(i.push("ufrag"),i.push(e.usernameFragment||e.ufrag)),"candidate:"+i.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var i=e.substr(9).split(" "),n={payloadType:parseInt(i.shift(),10)};return i=i[0].split("/"),n.name=i[0],n.clockRate=parseInt(i[1],10),n.channels=i.length===3?parseInt(i[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){var i=e.payloadType;e.preferredPayloadType!==void 0&&(i=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+i+" "+e.name+"/"+e.clockRate+(n!==1?"/"+n:"")+`\r
@@ -1,4 +1,4 @@
1
- "use strict";const x=require("./three.light.umd.cjs"),st={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function _o(r){const t=await fetch(r);if(t.ok)return t.json();throw new Error(t.statusText)}async function La(r){if(!r)throw new Error("No basePath supplied");return await _o(`${r}/profilesList.json`)}async function Va(r,t,e=null,i=!0){if(!r)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const n=await La(t);let s;if(r.profiles.some(a=>{const l=n[a];return l&&(s={profileId:a,profilePath:`${t}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!e)throw new Error("No matching profile name found");const a=n[e];if(!a)throw new Error(`No matching profile name found and default profile "${e}" missing.`);s={profileId:e,profilePath:`${t}/${a.path}`,deprecated:!!a.deprecated}}const o=await _o(s.profilePath);let c;if(i){let a;if(r.handedness==="any"?a=o.layouts[Object.keys(o.layouts)[0]]:a=o.layouts[r.handedness],!a)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);a.assetPath&&(c=s.profilePath.replace("profile.json",a.assetPath))}return{profile:o,assetPath:c}}const Ja={xAxis:0,yAxis:0,button:0,state:st.ComponentState.DEFAULT};function Ga(r=0,t=0){let e=r,i=t;if(Math.sqrt(r*r+t*t)>1){const o=Math.atan2(t,r);e=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:e*.5+.5,normalizedYAxis:i*.5+.5}}class ja{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===st.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Ja)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:s,normalizedYAxis:o}=Ga(t,e);switch(this.componentProperty){case st.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?s:.5;break;case st.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case st.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case st.ComponentProperty.STATE:this.valueNodeProperty===st.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class $a{constructor(t,e){if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(i=>{const n=new ja(e.visualResponses[i]);this.visualResponses[i]=n}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:st.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=st.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||this.values.button===1?this.values.state=st.ComponentState.PRESSED:(e.touched||this.values.button>st.ButtonTouchThreshold)&&(this.values.state=st.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}}class Ha{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const s=this.layoutDescription.components[n];this.components[n]=new $a(n,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}const on=2,jt=4,ee=4,bo=4,le=new Int32Array(2),ps=new Float32Array(le.buffer),ms=new Float64Array(le.buffer),lr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class re{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?re.ZERO:new re(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}}re.ZERO=new re(0,0);var Rn;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Rn||(Rn={}));class Pi{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Pi(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new re(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new re(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return le[0]=this.readInt32(t),ps[0]}readFloat64(t){return le[lr?0:1]=this.readInt32(t),le[lr?1:0]=this.readInt32(t+4),ms[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){ps[0]=e,this.writeInt32(t,le[0])}writeFloat64(t,e){ms[0]=e,this.writeInt32(t,le[lr?0:1]),this.writeInt32(t+4,le[lr?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+jt+ee)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<ee;e++)t+=String.fromCharCode(this.readInt8(this.position_+jt+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const i=this.readInt32(t);let n="",s=0;if(t+=jt,e===Rn.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const c=this.readUint8(t+s++);if(c<192)o=c;else{const a=this.readUint8(t+s++);if(c<224)o=(c&31)<<6|a&63;else{const l=this.readUint8(t+s++);if(c<240)o=(c&15)<<12|(a&63)<<6|l&63;else{const u=this.readUint8(t+s++);o=(c&7)<<18|(a&63)<<12|(l&63)<<6|u&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&1024-1)+56320))}return n}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+jt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let e=0;e<ee;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+jt+e))return!1;return!0}createLong(t,e){return re.create(t,e)}createScalarList(t,e){const i=[];for(let n=0;n<e;++n)t(n)!==null&&i.push(t(n));return i}createObjList(t,e){const i=[];for(let n=0;n<e;++n){const s=t(n);s!==null&&i.push(s.unpack())}return i}}class ts{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=Pi.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const n=this.bb.capacity();this.bb=ts.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=e<<1,n=Pi.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n}addOffset(t){this.prep(jt,0),this.writeInt32(this.offset()-t+jt)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*on;this.addInt16(s);let o=0;const c=this.space;t:for(e=0;e<this.vtables.length;e++){const a=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(a)){for(let l=on;l<s;l+=on)if(this.bb.readInt16(c+l)!=this.bb.readInt16(a+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){const n=i?bo:0;if(e){const s=e;if(this.prep(this.minalign,jt+ee+n),s.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let o=ee-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,jt+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(this.bb.readInt16(n+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(jt,t*e),this.prep(i,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let i=0;for(;i<t.length;){let n;const s=t.charCodeAt(i++);if(s<55296||s>=56320)n=s;else{const o=t.charCodeAt(i++);n=(s<<10)+o+(65536-56623104-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,n=this.space,s=this.bb.bytes();i<e.length;i++)s[n++]=e[i];return this.endVector()}createLong(t,e){return re.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const n=t[i];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}}function Qr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var So={exports:{}};(function(r){var t={};t.useBlobBuilder=function(){try{return new Blob([]),!1}catch{return!0}}(),t.useArrayBufferView=!t.useBlobBuilder&&function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}}(),r.exports.binaryFeatures=t;var e=r.exports.BlobBuilder;typeof window<"u"&&(e=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function i(){this._pieces=[],this._parts=[]}i.prototype.append=function(n){typeof n=="number"?this._pieces.push(n):(this.flush(),this._parts.push(n))},i.prototype.flush=function(){if(this._pieces.length>0){var n=new Uint8Array(this._pieces);t.useArrayBufferView||(n=n.buffer),this._parts.push(n),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),t.useBlobBuilder){for(var n=new e,s=0,o=this._parts.length;s<o;s++)n.append(this._parts[s]);return n.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=i})(So);var To=So.exports,qa=To.BufferBuilder,ys=To.binaryFeatures,Xa={unpack:function(r){var t=new ht(r);return t.unpack()},pack:function(r){var t=new ft;t.pack(r);var e=t.getBuffer();return e}},Wa=Xa;function ht(r){this.index=0,this.dataBuffer=r,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}ht.prototype.unpack=function(){var r=this.unpack_uint8();if(r<128)return r;if((r^224)<32)return(r^224)-32;var t;if((t=r^160)<=15)return this.unpack_raw(t);if((t=r^176)<=15)return this.unpack_string(t);if((t=r^144)<=15)return this.unpack_array(t);if((t=r^128)<=15)return this.unpack_map(t);switch(r){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}};ht.prototype.unpack_uint8=function(){var r=this.dataView[this.index]&255;return this.index++,r};ht.prototype.unpack_uint16=function(){var r=this.read(2),t=(r[0]&255)*256+(r[1]&255);return this.index+=2,t};ht.prototype.unpack_uint32=function(){var r=this.read(4),t=((r[0]*256+r[1])*256+r[2])*256+r[3];return this.index+=4,t};ht.prototype.unpack_uint64=function(){var r=this.read(8),t=((((((r[0]*256+r[1])*256+r[2])*256+r[3])*256+r[4])*256+r[5])*256+r[6])*256+r[7];return this.index+=8,t};ht.prototype.unpack_int8=function(){var r=this.unpack_uint8();return r<128?r:r-256};ht.prototype.unpack_int16=function(){var r=this.unpack_uint16();return r<32768?r:r-65536};ht.prototype.unpack_int32=function(){var r=this.unpack_uint32();return r<Math.pow(2,31)?r:r-Math.pow(2,32)};ht.prototype.unpack_int64=function(){var r=this.unpack_uint64();return r<Math.pow(2,63)?r:r-Math.pow(2,64)};ht.prototype.unpack_raw=function(r){if(this.length<this.index+r)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+r+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+r);return this.index+=r,t};ht.prototype.unpack_string=function(r){for(var t=this.read(r),e=0,i="",n,s;e<r;)n=t[e],n<128?(i+=String.fromCharCode(n),e++):(n^192)<32?(s=(n^192)<<6|t[e+1]&63,i+=String.fromCharCode(s),e+=2):(s=(n&15)<<12|(t[e+1]&63)<<6|t[e+2]&63,i+=String.fromCharCode(s),e+=3);return this.index+=r,i};ht.prototype.unpack_array=function(r){for(var t=new Array(r),e=0;e<r;e++)t[e]=this.unpack();return t};ht.prototype.unpack_map=function(r){for(var t={},e=0;e<r;e++){var i=this.unpack(),n=this.unpack();t[i]=n}return t};ht.prototype.unpack_float=function(){var r=this.unpack_uint32(),t=r>>31,e=(r>>23&255)-127,i=r&8388607|8388608;return(t===0?1:-1)*i*Math.pow(2,e-23)};ht.prototype.unpack_double=function(){var r=this.unpack_uint32(),t=this.unpack_uint32(),e=r>>31,i=(r>>20&2047)-1023,n=r&1048575|1048576,s=n*Math.pow(2,i-20)+t*Math.pow(2,i-52);return(e===0?1:-1)*s};ht.prototype.read=function(r){var t=this.index;if(t+r<=this.length)return this.dataView.subarray(t,t+r);throw new Error("BinaryPackFailure: read index out of range")};function ft(){this.bufferBuilder=new qa}ft.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()};ft.prototype.pack=function(r){var t=typeof r;if(t==="string")this.pack_string(r);else if(t==="number")Math.floor(r)===r?this.pack_integer(r):this.pack_double(r);else if(t==="boolean")r===!0?this.bufferBuilder.append(195):r===!1&&this.bufferBuilder.append(194);else if(t==="undefined")this.bufferBuilder.append(192);else if(t==="object")if(r===null)this.bufferBuilder.append(192);else{var e=r.constructor;if(e==Array)this.pack_array(r);else if(e==Blob||e==File||r instanceof Blob||r instanceof File)this.pack_bin(r);else if(e==ArrayBuffer)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r)):this.pack_bin(r);else if("BYTES_PER_ELEMENT"in r)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r.buffer)):this.pack_bin(r.buffer);else if(e==Object||e.toString().startsWith("class"))this.pack_object(r);else if(e==Date)this.pack_string(r.toString());else if(typeof r.toBinaryPack=="function")this.bufferBuilder.append(r.toBinaryPack());else throw new Error('Type "'+e.toString()+'" not yet supported')}else throw new Error('Type "'+t+'" not yet supported');this.bufferBuilder.flush()};ft.prototype.pack_bin=function(r){var t=r.length||r.byteLength||r.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_string=function(r){var t=Za(r);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_array=function(r){var t=r.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(t);else throw new Error("Invalid length");for(var e=0;e<t;e++)this.pack(r[e])};ft.prototype.pack_integer=function(r){if(r>=-32&&r<=127)this.bufferBuilder.append(r&255);else if(r>=0&&r<=255)this.bufferBuilder.append(204),this.pack_uint8(r);else if(r>=-128&&r<=127)this.bufferBuilder.append(208),this.pack_int8(r);else if(r>=0&&r<=65535)this.bufferBuilder.append(205),this.pack_uint16(r);else if(r>=-32768&&r<=32767)this.bufferBuilder.append(209),this.pack_int16(r);else if(r>=0&&r<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(r);else if(r>=-2147483648&&r<=2147483647)this.bufferBuilder.append(210),this.pack_int32(r);else if(r>=-9223372036854776e3&&r<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(r);else if(r>=0&&r<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(r);else throw new Error("Invalid integer")};ft.prototype.pack_double=function(r){var t=0;r<0&&(t=1,r=-r);var e=Math.floor(Math.log(r)/Math.LN2),i=r/Math.pow(2,e)-1,n=Math.floor(i*Math.pow(2,52)),s=Math.pow(2,32),o=t<<31|e+1023<<20|n/s&1048575,c=n%s;this.bufferBuilder.append(203),this.pack_int32(o),this.pack_int32(c)};ft.prototype.pack_object=function(r){var t=Object.keys(r),e=t.length;if(e<=15)this.pack_uint8(128+e);else if(e<=65535)this.bufferBuilder.append(222),this.pack_uint16(e);else if(e<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(e);else throw new Error("Invalid length");for(var i in r)r.hasOwnProperty(i)&&(this.pack(i),this.pack(r[i]))};ft.prototype.pack_uint8=function(r){this.bufferBuilder.append(r)};ft.prototype.pack_uint16=function(r){this.bufferBuilder.append(r>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_uint32=function(r){var t=r&4294967295;this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255)};ft.prototype.pack_uint64=function(r){var t=r/Math.pow(2,32),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};ft.prototype.pack_int8=function(r){this.bufferBuilder.append(r&255)};ft.prototype.pack_int16=function(r){this.bufferBuilder.append((r&65280)>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int32=function(r){this.bufferBuilder.append(r>>>24&255),this.bufferBuilder.append((r&16711680)>>>16),this.bufferBuilder.append((r&65280)>>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int64=function(r){var t=Math.floor(r/Math.pow(2,32)),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};function Ya(r){var t=r.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}function Za(r){return r.length>600?new Blob([r]).size:r.replace(/[^\u0000-\u007F]/g,Ya).length}const gs=Qr(Wa);let Mo=!0,Co=!0;function _i(r,t,e){const i=r.match(t);return i&&i.length>=e&&parseInt(i[e],10)}function Qe(r,t,e){if(!r.RTCPeerConnection)return;const i=r.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(o,c){if(o!==t)return n.apply(this,arguments);const a=l=>{const u=e(l);u&&(c.handleEvent?c.handleEvent(u):c(u))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(c,a),n.apply(this,[o,a])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==t||!this._eventMap||!this._eventMap[t])return s.apply(this,arguments);if(!this._eventMap[t].has(c))return s.apply(this,arguments);const a=this._eventMap[t].get(c);return this._eventMap[t].delete(c),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,a])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(o){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),o&&this.addEventListener(t,this["_on"+t]=o)},enumerable:!0,configurable:!0})}function Qa(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Mo=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Ka(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Co=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function es(){if(typeof window=="object"){if(Mo)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Kr(r,t){Co&&console.warn(r+" is deprecated, please use "+t+" instead.")}function tc(r){const t={browser:null,version:null};if(typeof r>"u"||!r.navigator)return t.browser="Not a browser.",t;const{navigator:e}=r;if(e.mozGetUserMedia)t.browser="firefox",t.version=_i(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)t.browser="chrome",t.version=_i(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_i(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&e.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser="safari",t.version=_i(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return t.browser="Not a supported browser.",t;return t}function vs(r){return Object.prototype.toString.call(r)==="[object Object]"}function wo(r){return vs(r)?Object.keys(r).reduce(function(t,e){const i=vs(r[e]),n=i?wo(r[e]):r[e],s=i&&!Object.keys(n).length;return n===void 0||s?t:Object.assign(t,{[e]:n})},{}):r}function kn(r,t,e){!t||e.has(t.id)||(e.set(t.id,t),Object.keys(t).forEach(i=>{i.endsWith("Id")?kn(r,r.get(t[i]),e):i.endsWith("Ids")&&t[i].forEach(n=>{kn(r,r.get(n),e)})}))}function xs(r,t,e){const i=e?"outbound-rtp":"inbound-rtp",n=new Map;if(t===null)return n;const s=[];return r.forEach(o=>{o.type==="track"&&o.trackIdentifier===t.id&&s.push(o)}),s.forEach(o=>{r.forEach(c=>{c.type===i&&c.trackId===o.id&&kn(r,c,n)})}),n}const _s=es;function Po(r,t){const e=r&&r.navigator;if(!e.mediaDevices)return;const i=function(c){if(typeof c!="object"||c.mandatory||c.optional)return c;const a={};return Object.keys(c).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof c[l]=="object"?c[l]:{ideal:c[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const h=function(f,d){return f?f+d.charAt(0).toUpperCase()+d.slice(1):d==="deviceId"?"sourceId":d};if(u.ideal!==void 0){a.optional=a.optional||[];let f={};typeof u.ideal=="number"?(f[h("min",l)]=u.ideal,a.optional.push(f),f={},f[h("max",l)]=u.ideal,a.optional.push(f)):(f[h("",l)]=u.ideal,a.optional.push(f))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[h("",l)]=u.exact):["min","max"].forEach(f=>{u[f]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[h(f,l)]=u[f])})}),c.advanced&&(a.optional=(a.optional||[]).concat(c.advanced)),a},n=function(c,a){if(t.version>=61)return a(c);if(c=JSON.parse(JSON.stringify(c)),c&&typeof c.audio=="object"){const l=function(u,h,f){h in u&&!(f in u)&&(u[f]=u[h],delete u[h])};c=JSON.parse(JSON.stringify(c)),l(c.audio,"autoGainControl","googAutoGainControl"),l(c.audio,"noiseSuppression","googNoiseSuppression"),c.audio=i(c.audio)}if(c&&typeof c.video=="object"){let l=c.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=t.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(e.mediaDevices.getSupportedConstraints&&e.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete c.video.facingMode;let h;if(l.exact==="environment"||l.ideal==="environment"?h=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(h=["front"]),h)return e.mediaDevices.enumerateDevices().then(f=>{f=f.filter(p=>p.kind==="videoinput");let d=f.find(p=>h.some(m=>p.label.toLowerCase().includes(m)));return!d&&f.length&&h.includes("back")&&(d=f[f.length-1]),d&&(c.video.deviceId=l.exact?{exact:d.deviceId}:{ideal:d.deviceId}),c.video=i(c.video),_s("chrome: "+JSON.stringify(c)),a(c)})}c.video=i(c.video)}return _s("chrome: "+JSON.stringify(c)),a(c)},s=function(c){return t.version>=64?c:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[c.name]||c.name,message:c.message,constraint:c.constraint||c.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(c,a,l){n(c,u=>{e.webkitGetUserMedia(u,a,h=>{l&&l(s(h))})})};if(e.getUserMedia=o.bind(e),e.mediaDevices.getUserMedia){const c=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(a){return n(a,l=>c(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function ec(r,t){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof t!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then(n=>{const s=i.video&&i.video.width,o=i.video&&i.video.height,c=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:n,maxFrameRate:c||3}},s&&(i.video.mandatory.maxWidth=s),o&&(i.video.mandatory.maxHeight=o),r.navigator.mediaDevices.getUserMedia(i)})}}}function Eo(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function Ao(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.track.id):s={track:n.track};const o=new Event("track");o.track=n.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.id):s={track:n};const o=new Event("track");o.track=n,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Qe(r,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function Ro(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const t=function(n,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=n.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:n}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(c,a){let l=n.apply(this,arguments);return l||(l=t(this,c),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(c){s.apply(this,arguments);const a=this._senders.indexOf(c);a!==-1&&this._senders.splice(a,1)}}const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],e.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(t(this,o))})};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],i.apply(this,[s]),s.getTracks().forEach(o=>{const c=this._senders.find(a=>a.track===o);c&&this._senders.splice(this._senders.indexOf(c),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const i=t.apply(this,[]);return i.forEach(n=>n._pc=this),i},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function ko(r){if(!r.RTCPeerConnection)return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[i,n,s]=arguments;if(arguments.length>0&&typeof i=="function")return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof i!="function"))return t.apply(this,[]);const o=function(a){const l={};return a.result().forEach(h=>{const f={id:h.id,timestamp:h.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[h.type]||h.type};h.names().forEach(d=>{f[d]=h.stat(d)}),l[f.id]=f}),l},c=function(a){return new Map(Object.keys(a).map(l=>[l,a[l]]))};if(arguments.length>=2){const a=function(l){n(c(o(l)))};return t.apply(this,[a,i])}return new Promise((a,l)=>{t.apply(this,[function(u){a(c(o(u)))},l])}).then(n,s)}}function Bo(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;e&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=e.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=r.RTCPeerConnection.prototype.addTrack;i&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>xs(o,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const e=r.RTCPeerConnection.prototype.getReceivers;e&&(r.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(s=>s._pc=this),n}),Qe(r,"track",i=>(i.receiver._pc=i.srcElement,i)),r.RTCRtpReceiver.prototype.getStats=function(){const n=this;return this._pc.getStats().then(s=>xs(s,n.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const i=arguments[0];let n,s,o;return this.getSenders().forEach(c=>{c.track===i&&(n?o=!0:n=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||n&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function zo(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){if(!c)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=t.apply(this,arguments);return this._shimmedLocalStreams[c.id]?this._shimmedLocalStreams[c.id].indexOf(a)===-1&&this._shimmedLocalStreams[c.id].push(a):this._shimmedLocalStreams[c.id]=[c,a],a};const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const c=this.getSenders();e.apply(this,arguments);const a=this.getSenders().filter(l=>c.indexOf(l)===-1);this._shimmedLocalStreams[o.id]=[o].concat(a)};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],i.apply(this,arguments)};const n=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(c=>{const a=this._shimmedLocalStreams[c].indexOf(o);a!==-1&&this._shimmedLocalStreams[c].splice(a,1),this._shimmedLocalStreams[c].length===1&&delete this._shimmedLocalStreams[c]}),n.apply(this,arguments)}}function Oo(r,t){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&t.version>=65)return zo(r);const e=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=e.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(h=>this._reverseStreams[h.id])};const i=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(h=>{if(this.getSenders().find(d=>d.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const h=new r.MediaStream(u.getTracks());this._streams[u.id]=h,this._reverseStreams[h.id]=u,u=h}i.apply(this,[u])};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const f=[].slice.call(arguments,1);if(f.length!==1||!f[0].getTracks().find(m=>m===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const p=this._streams[h.id];if(p)p.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new r.MediaStream([u]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===u)};function s(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(p.id,"g"),d.id)}),new RTCSessionDescription({type:u.type,sdp:h})}function o(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(d.id,"g"),p.id)}),new RTCSessionDescription({type:u.type,sdp:h})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],h={[l](){const f=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[p=>{const m=s(this,p);f[0].apply(null,[m])},p=>{f[1]&&f[1].apply(null,p)},arguments[2]]):u.apply(this,arguments).then(p=>s(this,p))}};r.RTCPeerConnection.prototype[l]=h[l]});const c=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?c.apply(this,arguments):(arguments[0]=o(this,arguments[0]),c.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=a.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let f;Object.keys(this._streams).forEach(d=>{this._streams[d].getTracks().find(m=>u.track===m)&&(f=this._streams[d])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Bn(r,t){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const i=r.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new(e==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};r.RTCPeerConnection.prototype[e]=n[e]})}function Io(r,t){Qe(r,"negotiationneeded",e=>{const i=e.target;if(!((t.version<72||i.getConfiguration&&i.getConfiguration().sdpSemantics==="plan-b")&&i.signalingState!=="stable"))return e})}const bs=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Io,shimAddTrackRemoveTrack:Oo,shimAddTrackRemoveTrackWithNative:zo,shimGetDisplayMedia:ec,shimGetSendersWithDtmf:Ro,shimGetStats:ko,shimGetUserMedia:Po,shimMediaStream:Eo,shimOnTrack:Ao,shimPeerConnection:Bn,shimSenderReceiverGetStats:Bo},Symbol.toStringTag,{value:"Module"}));function ic(r,t){let e=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(i=>{if(i&&(i.urls||i.url)){let n=i.urls||i.url;i.url&&!i.urls&&Kr("RTCIceServer.url","RTCIceServer.urls");const s=typeof n=="string";return s&&(n=[n]),n=n.filter(o=>{if(o.indexOf("stun:")===0)return!1;const c=o.startsWith("turn")&&!o.startsWith("turn:[")&&o.includes("transport=udp");return c&&!e?(e=!0,!0):c&&!e}),delete i.url,i.urls=s?n[0]:n,!!n.length}})}var No={exports:{}};(function(r){var t={};t.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split(`
1
+ "use strict";const x=require("./three-67c59991.umd.cjs"),st={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})};async function _o(r){const t=await fetch(r);if(t.ok)return t.json();throw new Error(t.statusText)}async function La(r){if(!r)throw new Error("No basePath supplied");return await _o(`${r}/profilesList.json`)}async function Va(r,t,e=null,i=!0){if(!r)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const n=await La(t);let s;if(r.profiles.some(a=>{const l=n[a];return l&&(s={profileId:a,profilePath:`${t}/${l.path}`,deprecated:!!l.deprecated}),!!s}),!s){if(!e)throw new Error("No matching profile name found");const a=n[e];if(!a)throw new Error(`No matching profile name found and default profile "${e}" missing.`);s={profileId:e,profilePath:`${t}/${a.path}`,deprecated:!!a.deprecated}}const o=await _o(s.profilePath);let c;if(i){let a;if(r.handedness==="any"?a=o.layouts[Object.keys(o.layouts)[0]]:a=o.layouts[r.handedness],!a)throw new Error(`No matching handedness, ${r.handedness}, in profile ${s.profileId}`);a.assetPath&&(c=s.profilePath.replace("profile.json",a.assetPath))}return{profile:o,assetPath:c}}const Ja={xAxis:0,yAxis:0,button:0,state:st.ComponentState.DEFAULT};function Ga(r=0,t=0){let e=r,i=t;if(Math.sqrt(r*r+t*t)>1){const o=Math.atan2(t,r);e=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:e*.5+.5,normalizedYAxis:i*.5+.5}}class ja{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===st.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(Ja)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:s,normalizedYAxis:o}=Ga(t,e);switch(this.componentProperty){case st.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?s:.5;break;case st.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case st.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case st.ComponentProperty.STATE:this.valueNodeProperty===st.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class $a{constructor(t,e){if(!t||!e||!e.visualResponses||!e.gamepadIndices||Object.keys(e.gamepadIndices).length===0)throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(i=>{const n=new ja(e.visualResponses[i]);this.visualResponses[i]=n}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:st.ComponentState.DEFAULT,button:this.gamepadIndices.button!==void 0?0:void 0,xAxis:this.gamepadIndices.xAxis!==void 0?0:void 0,yAxis:this.gamepadIndices.yAxis!==void 0?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=st.ComponentState.DEFAULT,this.gamepadIndices.button!==void 0&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||this.values.button===1?this.values.state=st.ComponentState.PRESSED:(e.touched||this.values.button>st.ButtonTouchThreshold)&&(this.values.state=st.ComponentState.TOUCHED)}this.gamepadIndices.xAxis!==void 0&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),this.gamepadIndices.yAxis!==void 0&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===st.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>st.AxisTouchThreshold&&(this.values.state=st.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(e=>{e.updateFromComponent(this.values)})}}class Ha{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(n=>{const s=this.layoutDescription.components[n];this.components[n]=new $a(n,s)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}const on=2,jt=4,ee=4,bo=4,le=new Int32Array(2),ps=new Float32Array(le.buffer),ms=new Float64Array(le.buffer),lr=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;class re{constructor(t,e){this.low=t|0,this.high=e|0}static create(t,e){return t==0&&e==0?re.ZERO:new re(t,e)}toFloat64(){return(this.low>>>0)+this.high*4294967296}equals(t){return this.low==t.low&&this.high==t.high}}re.ZERO=new re(0,0);var Rn;(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Rn||(Rn={}));class Pi{constructor(t){this.bytes_=t,this.position_=0}static allocate(t){return new Pi(new Uint8Array(t))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(t){this.position_=t}capacity(){return this.bytes_.length}readInt8(t){return this.readUint8(t)<<24>>24}readUint8(t){return this.bytes_[t]}readInt16(t){return this.readUint16(t)<<16>>16}readUint16(t){return this.bytes_[t]|this.bytes_[t+1]<<8}readInt32(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}readUint32(t){return this.readInt32(t)>>>0}readInt64(t){return new re(this.readInt32(t),this.readInt32(t+4))}readUint64(t){return new re(this.readUint32(t),this.readUint32(t+4))}readFloat32(t){return le[0]=this.readInt32(t),ps[0]}readFloat64(t){return le[lr?0:1]=this.readInt32(t),le[lr?1:0]=this.readInt32(t+4),ms[0]}writeInt8(t,e){this.bytes_[t]=e}writeUint8(t,e){this.bytes_[t]=e}writeInt16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeUint16(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}writeInt32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeUint32(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}writeInt64(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)}writeUint64(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)}writeFloat32(t,e){ps[0]=e,this.writeInt32(t,le[0])}writeFloat64(t,e){ms[0]=e,this.writeInt32(t,le[lr?0:1]),this.writeInt32(t+4,le[lr?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+jt+ee)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let t="";for(let e=0;e<ee;e++)t+=String.fromCharCode(this.readInt8(this.position_+jt+e));return t}__offset(t,e){const i=t-this.readInt32(t);return e<this.readInt16(i)?this.readInt16(i+e):0}__union(t,e){return t.bb_pos=e+this.readInt32(e),t.bb=this,t}__string(t,e){t+=this.readInt32(t);const i=this.readInt32(t);let n="",s=0;if(t+=jt,e===Rn.UTF8_BYTES)return this.bytes_.subarray(t,t+i);for(;s<i;){let o;const c=this.readUint8(t+s++);if(c<192)o=c;else{const a=this.readUint8(t+s++);if(c<224)o=(c&31)<<6|a&63;else{const l=this.readUint8(t+s++);if(c<240)o=(c&15)<<12|(a&63)<<6|l&63;else{const u=this.readUint8(t+s++);o=(c&7)<<18|(a&63)<<12|(l&63)<<6|u&63}}}o<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode((o>>10)+55296,(o&1024-1)+56320))}return n}__union_with_string(t,e){return typeof t=="string"?this.__string(e):this.__union(t,e)}__indirect(t){return t+this.readInt32(t)}__vector(t){return t+this.readInt32(t)+jt}__vector_len(t){return this.readInt32(t+this.readInt32(t))}__has_identifier(t){if(t.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let e=0;e<ee;e++)if(t.charCodeAt(e)!=this.readInt8(this.position()+jt+e))return!1;return!0}createLong(t,e){return re.create(t,e)}createScalarList(t,e){const i=[];for(let n=0;n<e;++n)t(n)!==null&&i.push(t(n));return i}createObjList(t,e){const i=[];for(let n=0;n<e;++n){const s=t(n);s!==null&&i.push(s.unpack())}return i}}class ts{constructor(t){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null;let e;t?e=t:e=1024,this.bb=Pi.allocate(e),this.space=e}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(t){this.force_defaults=t}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(t,e){t>this.minalign&&(this.minalign=t);const i=~(this.bb.capacity()-this.space+e)+1&t-1;for(;this.space<i+t+e;){const n=this.bb.capacity();this.bb=ts.growByteBuffer(this.bb),this.space+=this.bb.capacity()-n}this.pad(i)}pad(t){for(let e=0;e<t;e++)this.bb.writeInt8(--this.space,0)}writeInt8(t){this.bb.writeInt8(this.space-=1,t)}writeInt16(t){this.bb.writeInt16(this.space-=2,t)}writeInt32(t){this.bb.writeInt32(this.space-=4,t)}writeInt64(t){this.bb.writeInt64(this.space-=8,t)}writeFloat32(t){this.bb.writeFloat32(this.space-=4,t)}writeFloat64(t){this.bb.writeFloat64(this.space-=8,t)}addInt8(t){this.prep(1,0),this.writeInt8(t)}addInt16(t){this.prep(2,0),this.writeInt16(t)}addInt32(t){this.prep(4,0),this.writeInt32(t)}addInt64(t){this.prep(8,0),this.writeInt64(t)}addFloat32(t){this.prep(4,0),this.writeFloat32(t)}addFloat64(t){this.prep(8,0),this.writeFloat64(t)}addFieldInt8(t,e,i){(this.force_defaults||e!=i)&&(this.addInt8(e),this.slot(t))}addFieldInt16(t,e,i){(this.force_defaults||e!=i)&&(this.addInt16(e),this.slot(t))}addFieldInt32(t,e,i){(this.force_defaults||e!=i)&&(this.addInt32(e),this.slot(t))}addFieldInt64(t,e,i){(this.force_defaults||!e.equals(i))&&(this.addInt64(e),this.slot(t))}addFieldFloat32(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat32(e),this.slot(t))}addFieldFloat64(t,e,i){(this.force_defaults||e!=i)&&(this.addFloat64(e),this.slot(t))}addFieldOffset(t,e,i){(this.force_defaults||e!=i)&&(this.addOffset(e),this.slot(t))}addFieldStruct(t,e,i){e!=i&&(this.nested(e),this.slot(t))}nested(t){if(t!=this.offset())throw new Error("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new Error("FlatBuffers: object serialization must not be nested.")}slot(t){this.vtable!==null&&(this.vtable[t]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(t){const e=t.capacity();if(e&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const i=e<<1,n=Pi.allocate(i);return n.setPosition(i-e),n.bytes().set(t.bytes(),i-e),n}addOffset(t){this.prep(jt,0),this.writeInt32(this.offset()-t+jt)}startObject(t){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=t;for(let e=0;e<t;e++)this.vtable[e]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const t=this.offset();let e=this.vtable_in_use-1;for(;e>=0&&this.vtable[e]==0;e--);const i=e+1;for(;e>=0;e--)this.addInt16(this.vtable[e]!=0?t-this.vtable[e]:0);const n=2;this.addInt16(t-this.object_start);const s=(i+n)*on;this.addInt16(s);let o=0;const c=this.space;t:for(e=0;e<this.vtables.length;e++){const a=this.bb.capacity()-this.vtables[e];if(s==this.bb.readInt16(a)){for(let l=on;l<s;l+=on)if(this.bb.readInt16(c+l)!=this.bb.readInt16(a+l))continue t;o=this.vtables[e];break}}return o?(this.space=this.bb.capacity()-t,this.bb.writeInt32(this.space,o-t)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-t,this.offset()-t)),this.isNested=!1,t}finish(t,e,i){const n=i?bo:0;if(e){const s=e;if(this.prep(this.minalign,jt+ee+n),s.length!=ee)throw new Error("FlatBuffers: file identifier must be length "+ee);for(let o=ee-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,jt+n),this.addOffset(t),n&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(t,e){this.finish(t,e,!0)}requiredField(t,e){const i=this.bb.capacity()-t,n=i-this.bb.readInt32(i);if(!(this.bb.readInt16(n+e)!=0))throw new Error("FlatBuffers: field "+e+" must be set")}startVector(t,e,i){this.notNested(),this.vector_num_elems=e,this.prep(jt,t*e),this.prep(i,t*e)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(t){if(!t)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(t))return this.string_maps.get(t);const e=this.createString(t);return this.string_maps.set(t,e),e}createString(t){if(!t)return 0;let e;if(t instanceof Uint8Array)e=t;else{e=[];let i=0;for(;i<t.length;){let n;const s=t.charCodeAt(i++);if(s<55296||s>=56320)n=s;else{const o=t.charCodeAt(i++);n=(s<<10)+o+(65536-56623104-56320)}n<128?e.push(n):(n<2048?e.push(n>>6&31|192):(n<65536?e.push(n>>12&15|224):e.push(n>>18&7|240,n>>12&63|128),e.push(n>>6&63|128)),e.push(n&63|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length);for(let i=0,n=this.space,s=this.bb.bytes();i<e.length;i++)s[n++]=e[i];return this.endVector()}createLong(t,e){return re.create(t,e)}createObjectOffset(t){return t===null?0:typeof t=="string"?this.createString(t):t.pack(this)}createObjectOffsetList(t){const e=[];for(let i=0;i<t.length;++i){const n=t[i];if(n!==null)e.push(this.createObjectOffset(n));else throw new Error("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return e}createStructOffsetList(t,e){return e(this,t.length),this.createObjectOffsetList(t),this.endVector()}}function Qr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var So={exports:{}};(function(r){var t={};t.useBlobBuilder=function(){try{return new Blob([]),!1}catch{return!0}}(),t.useArrayBufferView=!t.useBlobBuilder&&function(){try{return new Blob([new Uint8Array([])]).size===0}catch{return!0}}(),r.exports.binaryFeatures=t;var e=r.exports.BlobBuilder;typeof window<"u"&&(e=r.exports.BlobBuilder=window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder||window.BlobBuilder);function i(){this._pieces=[],this._parts=[]}i.prototype.append=function(n){typeof n=="number"?this._pieces.push(n):(this.flush(),this._parts.push(n))},i.prototype.flush=function(){if(this._pieces.length>0){var n=new Uint8Array(this._pieces);t.useArrayBufferView||(n=n.buffer),this._parts.push(n),this._pieces=[]}},i.prototype.getBuffer=function(){if(this.flush(),t.useBlobBuilder){for(var n=new e,s=0,o=this._parts.length;s<o;s++)n.append(this._parts[s]);return n.getBlob()}else return new Blob(this._parts)},r.exports.BufferBuilder=i})(So);var To=So.exports,qa=To.BufferBuilder,ys=To.binaryFeatures,Xa={unpack:function(r){var t=new ht(r);return t.unpack()},pack:function(r){var t=new ft;t.pack(r);var e=t.getBuffer();return e}},Wa=Xa;function ht(r){this.index=0,this.dataBuffer=r,this.dataView=new Uint8Array(this.dataBuffer),this.length=this.dataBuffer.byteLength}ht.prototype.unpack=function(){var r=this.unpack_uint8();if(r<128)return r;if((r^224)<32)return(r^224)-32;var t;if((t=r^160)<=15)return this.unpack_raw(t);if((t=r^176)<=15)return this.unpack_string(t);if((t=r^144)<=15)return this.unpack_array(t);if((t=r^128)<=15)return this.unpack_map(t);switch(r){case 192:return null;case 193:return;case 194:return!1;case 195:return!0;case 202:return this.unpack_float();case 203:return this.unpack_double();case 204:return this.unpack_uint8();case 205:return this.unpack_uint16();case 206:return this.unpack_uint32();case 207:return this.unpack_uint64();case 208:return this.unpack_int8();case 209:return this.unpack_int16();case 210:return this.unpack_int32();case 211:return this.unpack_int64();case 212:return;case 213:return;case 214:return;case 215:return;case 216:return t=this.unpack_uint16(),this.unpack_string(t);case 217:return t=this.unpack_uint32(),this.unpack_string(t);case 218:return t=this.unpack_uint16(),this.unpack_raw(t);case 219:return t=this.unpack_uint32(),this.unpack_raw(t);case 220:return t=this.unpack_uint16(),this.unpack_array(t);case 221:return t=this.unpack_uint32(),this.unpack_array(t);case 222:return t=this.unpack_uint16(),this.unpack_map(t);case 223:return t=this.unpack_uint32(),this.unpack_map(t)}};ht.prototype.unpack_uint8=function(){var r=this.dataView[this.index]&255;return this.index++,r};ht.prototype.unpack_uint16=function(){var r=this.read(2),t=(r[0]&255)*256+(r[1]&255);return this.index+=2,t};ht.prototype.unpack_uint32=function(){var r=this.read(4),t=((r[0]*256+r[1])*256+r[2])*256+r[3];return this.index+=4,t};ht.prototype.unpack_uint64=function(){var r=this.read(8),t=((((((r[0]*256+r[1])*256+r[2])*256+r[3])*256+r[4])*256+r[5])*256+r[6])*256+r[7];return this.index+=8,t};ht.prototype.unpack_int8=function(){var r=this.unpack_uint8();return r<128?r:r-256};ht.prototype.unpack_int16=function(){var r=this.unpack_uint16();return r<32768?r:r-65536};ht.prototype.unpack_int32=function(){var r=this.unpack_uint32();return r<Math.pow(2,31)?r:r-Math.pow(2,32)};ht.prototype.unpack_int64=function(){var r=this.unpack_uint64();return r<Math.pow(2,63)?r:r-Math.pow(2,64)};ht.prototype.unpack_raw=function(r){if(this.length<this.index+r)throw new Error("BinaryPackFailure: index is out of range "+this.index+" "+r+" "+this.length);var t=this.dataBuffer.slice(this.index,this.index+r);return this.index+=r,t};ht.prototype.unpack_string=function(r){for(var t=this.read(r),e=0,i="",n,s;e<r;)n=t[e],n<128?(i+=String.fromCharCode(n),e++):(n^192)<32?(s=(n^192)<<6|t[e+1]&63,i+=String.fromCharCode(s),e+=2):(s=(n&15)<<12|(t[e+1]&63)<<6|t[e+2]&63,i+=String.fromCharCode(s),e+=3);return this.index+=r,i};ht.prototype.unpack_array=function(r){for(var t=new Array(r),e=0;e<r;e++)t[e]=this.unpack();return t};ht.prototype.unpack_map=function(r){for(var t={},e=0;e<r;e++){var i=this.unpack(),n=this.unpack();t[i]=n}return t};ht.prototype.unpack_float=function(){var r=this.unpack_uint32(),t=r>>31,e=(r>>23&255)-127,i=r&8388607|8388608;return(t===0?1:-1)*i*Math.pow(2,e-23)};ht.prototype.unpack_double=function(){var r=this.unpack_uint32(),t=this.unpack_uint32(),e=r>>31,i=(r>>20&2047)-1023,n=r&1048575|1048576,s=n*Math.pow(2,i-20)+t*Math.pow(2,i-52);return(e===0?1:-1)*s};ht.prototype.read=function(r){var t=this.index;if(t+r<=this.length)return this.dataView.subarray(t,t+r);throw new Error("BinaryPackFailure: read index out of range")};function ft(){this.bufferBuilder=new qa}ft.prototype.getBuffer=function(){return this.bufferBuilder.getBuffer()};ft.prototype.pack=function(r){var t=typeof r;if(t==="string")this.pack_string(r);else if(t==="number")Math.floor(r)===r?this.pack_integer(r):this.pack_double(r);else if(t==="boolean")r===!0?this.bufferBuilder.append(195):r===!1&&this.bufferBuilder.append(194);else if(t==="undefined")this.bufferBuilder.append(192);else if(t==="object")if(r===null)this.bufferBuilder.append(192);else{var e=r.constructor;if(e==Array)this.pack_array(r);else if(e==Blob||e==File||r instanceof Blob||r instanceof File)this.pack_bin(r);else if(e==ArrayBuffer)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r)):this.pack_bin(r);else if("BYTES_PER_ELEMENT"in r)ys.useArrayBufferView?this.pack_bin(new Uint8Array(r.buffer)):this.pack_bin(r.buffer);else if(e==Object||e.toString().startsWith("class"))this.pack_object(r);else if(e==Date)this.pack_string(r.toString());else if(typeof r.toBinaryPack=="function")this.bufferBuilder.append(r.toBinaryPack());else throw new Error('Type "'+e.toString()+'" not yet supported')}else throw new Error('Type "'+t+'" not yet supported');this.bufferBuilder.flush()};ft.prototype.pack_bin=function(r){var t=r.length||r.byteLength||r.size;if(t<=15)this.pack_uint8(160+t);else if(t<=65535)this.bufferBuilder.append(218),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(219),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_string=function(r){var t=Za(r);if(t<=15)this.pack_uint8(176+t);else if(t<=65535)this.bufferBuilder.append(216),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(217),this.pack_uint32(t);else throw new Error("Invalid length");this.bufferBuilder.append(r)};ft.prototype.pack_array=function(r){var t=r.length;if(t<=15)this.pack_uint8(144+t);else if(t<=65535)this.bufferBuilder.append(220),this.pack_uint16(t);else if(t<=4294967295)this.bufferBuilder.append(221),this.pack_uint32(t);else throw new Error("Invalid length");for(var e=0;e<t;e++)this.pack(r[e])};ft.prototype.pack_integer=function(r){if(r>=-32&&r<=127)this.bufferBuilder.append(r&255);else if(r>=0&&r<=255)this.bufferBuilder.append(204),this.pack_uint8(r);else if(r>=-128&&r<=127)this.bufferBuilder.append(208),this.pack_int8(r);else if(r>=0&&r<=65535)this.bufferBuilder.append(205),this.pack_uint16(r);else if(r>=-32768&&r<=32767)this.bufferBuilder.append(209),this.pack_int16(r);else if(r>=0&&r<=4294967295)this.bufferBuilder.append(206),this.pack_uint32(r);else if(r>=-2147483648&&r<=2147483647)this.bufferBuilder.append(210),this.pack_int32(r);else if(r>=-9223372036854776e3&&r<=9223372036854776e3)this.bufferBuilder.append(211),this.pack_int64(r);else if(r>=0&&r<=18446744073709552e3)this.bufferBuilder.append(207),this.pack_uint64(r);else throw new Error("Invalid integer")};ft.prototype.pack_double=function(r){var t=0;r<0&&(t=1,r=-r);var e=Math.floor(Math.log(r)/Math.LN2),i=r/Math.pow(2,e)-1,n=Math.floor(i*Math.pow(2,52)),s=Math.pow(2,32),o=t<<31|e+1023<<20|n/s&1048575,c=n%s;this.bufferBuilder.append(203),this.pack_int32(o),this.pack_int32(c)};ft.prototype.pack_object=function(r){var t=Object.keys(r),e=t.length;if(e<=15)this.pack_uint8(128+e);else if(e<=65535)this.bufferBuilder.append(222),this.pack_uint16(e);else if(e<=4294967295)this.bufferBuilder.append(223),this.pack_uint32(e);else throw new Error("Invalid length");for(var i in r)r.hasOwnProperty(i)&&(this.pack(i),this.pack(r[i]))};ft.prototype.pack_uint8=function(r){this.bufferBuilder.append(r)};ft.prototype.pack_uint16=function(r){this.bufferBuilder.append(r>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_uint32=function(r){var t=r&4294967295;this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255)};ft.prototype.pack_uint64=function(r){var t=r/Math.pow(2,32),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};ft.prototype.pack_int8=function(r){this.bufferBuilder.append(r&255)};ft.prototype.pack_int16=function(r){this.bufferBuilder.append((r&65280)>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int32=function(r){this.bufferBuilder.append(r>>>24&255),this.bufferBuilder.append((r&16711680)>>>16),this.bufferBuilder.append((r&65280)>>>8),this.bufferBuilder.append(r&255)};ft.prototype.pack_int64=function(r){var t=Math.floor(r/Math.pow(2,32)),e=r%Math.pow(2,32);this.bufferBuilder.append((t&4278190080)>>>24),this.bufferBuilder.append((t&16711680)>>>16),this.bufferBuilder.append((t&65280)>>>8),this.bufferBuilder.append(t&255),this.bufferBuilder.append((e&4278190080)>>>24),this.bufferBuilder.append((e&16711680)>>>16),this.bufferBuilder.append((e&65280)>>>8),this.bufferBuilder.append(e&255)};function Ya(r){var t=r.charCodeAt(0);return t<=2047?"00":t<=65535?"000":t<=2097151?"0000":t<=67108863?"00000":"000000"}function Za(r){return r.length>600?new Blob([r]).size:r.replace(/[^\u0000-\u007F]/g,Ya).length}const gs=Qr(Wa);let Mo=!0,Co=!0;function _i(r,t,e){const i=r.match(t);return i&&i.length>=e&&parseInt(i[e],10)}function Qe(r,t,e){if(!r.RTCPeerConnection)return;const i=r.RTCPeerConnection.prototype,n=i.addEventListener;i.addEventListener=function(o,c){if(o!==t)return n.apply(this,arguments);const a=l=>{const u=e(l);u&&(c.handleEvent?c.handleEvent(u):c(u))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(c,a),n.apply(this,[o,a])};const s=i.removeEventListener;i.removeEventListener=function(o,c){if(o!==t||!this._eventMap||!this._eventMap[t])return s.apply(this,arguments);if(!this._eventMap[t].has(c))return s.apply(this,arguments);const a=this._eventMap[t].get(c);return this._eventMap[t].delete(c),this._eventMap[t].size===0&&delete this._eventMap[t],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[o,a])},Object.defineProperty(i,"on"+t,{get(){return this["_on"+t]},set(o){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),o&&this.addEventListener(t,this["_on"+t]=o)},enumerable:!0,configurable:!0})}function Qa(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Mo=r,r?"adapter.js logging disabled":"adapter.js logging enabled")}function Ka(r){return typeof r!="boolean"?new Error("Argument type: "+typeof r+". Please use a boolean."):(Co=!r,"adapter.js deprecation warnings "+(r?"disabled":"enabled"))}function es(){if(typeof window=="object"){if(Mo)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function Kr(r,t){Co&&console.warn(r+" is deprecated, please use "+t+" instead.")}function tc(r){const t={browser:null,version:null};if(typeof r>"u"||!r.navigator)return t.browser="Not a browser.",t;const{navigator:e}=r;if(e.mozGetUserMedia)t.browser="firefox",t.version=_i(e.userAgent,/Firefox\/(\d+)\./,1);else if(e.webkitGetUserMedia||r.isSecureContext===!1&&r.webkitRTCPeerConnection&&!r.RTCIceGatherer)t.browser="chrome",t.version=_i(e.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(e.mediaDevices&&e.userAgent.match(/Edge\/(\d+).(\d+)$/))t.browser="edge",t.version=_i(e.userAgent,/Edge\/(\d+).(\d+)$/,2);else if(r.RTCPeerConnection&&e.userAgent.match(/AppleWebKit\/(\d+)\./))t.browser="safari",t.version=_i(e.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=r.RTCRtpTransceiver&&"currentDirection"in r.RTCRtpTransceiver.prototype;else return t.browser="Not a supported browser.",t;return t}function vs(r){return Object.prototype.toString.call(r)==="[object Object]"}function wo(r){return vs(r)?Object.keys(r).reduce(function(t,e){const i=vs(r[e]),n=i?wo(r[e]):r[e],s=i&&!Object.keys(n).length;return n===void 0||s?t:Object.assign(t,{[e]:n})},{}):r}function kn(r,t,e){!t||e.has(t.id)||(e.set(t.id,t),Object.keys(t).forEach(i=>{i.endsWith("Id")?kn(r,r.get(t[i]),e):i.endsWith("Ids")&&t[i].forEach(n=>{kn(r,r.get(n),e)})}))}function xs(r,t,e){const i=e?"outbound-rtp":"inbound-rtp",n=new Map;if(t===null)return n;const s=[];return r.forEach(o=>{o.type==="track"&&o.trackIdentifier===t.id&&s.push(o)}),s.forEach(o=>{r.forEach(c=>{c.type===i&&c.trackId===o.id&&kn(r,c,n)})}),n}const _s=es;function Po(r,t){const e=r&&r.navigator;if(!e.mediaDevices)return;const i=function(c){if(typeof c!="object"||c.mandatory||c.optional)return c;const a={};return Object.keys(c).forEach(l=>{if(l==="require"||l==="advanced"||l==="mediaSource")return;const u=typeof c[l]=="object"?c[l]:{ideal:c[l]};u.exact!==void 0&&typeof u.exact=="number"&&(u.min=u.max=u.exact);const h=function(f,d){return f?f+d.charAt(0).toUpperCase()+d.slice(1):d==="deviceId"?"sourceId":d};if(u.ideal!==void 0){a.optional=a.optional||[];let f={};typeof u.ideal=="number"?(f[h("min",l)]=u.ideal,a.optional.push(f),f={},f[h("max",l)]=u.ideal,a.optional.push(f)):(f[h("",l)]=u.ideal,a.optional.push(f))}u.exact!==void 0&&typeof u.exact!="number"?(a.mandatory=a.mandatory||{},a.mandatory[h("",l)]=u.exact):["min","max"].forEach(f=>{u[f]!==void 0&&(a.mandatory=a.mandatory||{},a.mandatory[h(f,l)]=u[f])})}),c.advanced&&(a.optional=(a.optional||[]).concat(c.advanced)),a},n=function(c,a){if(t.version>=61)return a(c);if(c=JSON.parse(JSON.stringify(c)),c&&typeof c.audio=="object"){const l=function(u,h,f){h in u&&!(f in u)&&(u[f]=u[h],delete u[h])};c=JSON.parse(JSON.stringify(c)),l(c.audio,"autoGainControl","googAutoGainControl"),l(c.audio,"noiseSuppression","googNoiseSuppression"),c.audio=i(c.audio)}if(c&&typeof c.video=="object"){let l=c.video.facingMode;l=l&&(typeof l=="object"?l:{ideal:l});const u=t.version<66;if(l&&(l.exact==="user"||l.exact==="environment"||l.ideal==="user"||l.ideal==="environment")&&!(e.mediaDevices.getSupportedConstraints&&e.mediaDevices.getSupportedConstraints().facingMode&&!u)){delete c.video.facingMode;let h;if(l.exact==="environment"||l.ideal==="environment"?h=["back","rear"]:(l.exact==="user"||l.ideal==="user")&&(h=["front"]),h)return e.mediaDevices.enumerateDevices().then(f=>{f=f.filter(p=>p.kind==="videoinput");let d=f.find(p=>h.some(m=>p.label.toLowerCase().includes(m)));return!d&&f.length&&h.includes("back")&&(d=f[f.length-1]),d&&(c.video.deviceId=l.exact?{exact:d.deviceId}:{ideal:d.deviceId}),c.video=i(c.video),_s("chrome: "+JSON.stringify(c)),a(c)})}c.video=i(c.video)}return _s("chrome: "+JSON.stringify(c)),a(c)},s=function(c){return t.version>=64?c:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[c.name]||c.name,message:c.message,constraint:c.constraint||c.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}},o=function(c,a,l){n(c,u=>{e.webkitGetUserMedia(u,a,h=>{l&&l(s(h))})})};if(e.getUserMedia=o.bind(e),e.mediaDevices.getUserMedia){const c=e.mediaDevices.getUserMedia.bind(e.mediaDevices);e.mediaDevices.getUserMedia=function(a){return n(a,l=>c(l).then(u=>{if(l.audio&&!u.getAudioTracks().length||l.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(h=>{h.stop()}),new DOMException("","NotFoundError");return u},u=>Promise.reject(s(u))))}}}function ec(r,t){if(!(r.navigator.mediaDevices&&"getDisplayMedia"in r.navigator.mediaDevices)&&r.navigator.mediaDevices){if(typeof t!="function"){console.error("shimGetDisplayMedia: getSourceId argument is not a function");return}r.navigator.mediaDevices.getDisplayMedia=function(i){return t(i).then(n=>{const s=i.video&&i.video.width,o=i.video&&i.video.height,c=i.video&&i.video.frameRate;return i.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:n,maxFrameRate:c||3}},s&&(i.video.mandatory.maxWidth=s),o&&(i.video.mandatory.maxHeight=o),r.navigator.mediaDevices.getUserMedia(i)})}}}function Eo(r){r.MediaStream=r.MediaStream||r.webkitMediaStream}function Ao(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("ontrack"in r.RTCPeerConnection.prototype)){Object.defineProperty(r.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});const t=r.RTCPeerConnection.prototype.setRemoteDescription;r.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=i=>{i.stream.addEventListener("addtrack",n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.track.id):s={track:n.track};const o=new Event("track");o.track=n.track,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)}),i.stream.getTracks().forEach(n=>{let s;r.RTCPeerConnection.prototype.getReceivers?s=this.getReceivers().find(c=>c.track&&c.track.id===n.id):s={track:n};const o=new Event("track");o.track=n,o.receiver=s,o.transceiver={receiver:s},o.streams=[i.stream],this.dispatchEvent(o)})},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else Qe(r,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t))}function Ro(r){if(typeof r=="object"&&r.RTCPeerConnection&&!("getSenders"in r.RTCPeerConnection.prototype)&&"createDTMFSender"in r.RTCPeerConnection.prototype){const t=function(n,s){return{track:s,get dtmf(){return this._dtmf===void 0&&(s.kind==="audio"?this._dtmf=n.createDTMFSender(s):this._dtmf=null),this._dtmf},_pc:n}};if(!r.RTCPeerConnection.prototype.getSenders){r.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(c,a){let l=n.apply(this,arguments);return l||(l=t(this,c),this._senders.push(l)),l};const s=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(c){s.apply(this,arguments);const a=this._senders.indexOf(c);a!==-1&&this._senders.splice(a,1)}}const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(s){this._senders=this._senders||[],e.apply(this,[s]),s.getTracks().forEach(o=>{this._senders.push(t(this,o))})};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(s){this._senders=this._senders||[],i.apply(this,[s]),s.getTracks().forEach(o=>{const c=this._senders.find(a=>a.track===o);c&&this._senders.splice(this._senders.indexOf(c),1)})}}else if(typeof r=="object"&&r.RTCPeerConnection&&"getSenders"in r.RTCPeerConnection.prototype&&"createDTMFSender"in r.RTCPeerConnection.prototype&&r.RTCRtpSender&&!("dtmf"in r.RTCRtpSender.prototype)){const t=r.RTCPeerConnection.prototype.getSenders;r.RTCPeerConnection.prototype.getSenders=function(){const i=t.apply(this,[]);return i.forEach(n=>n._pc=this),i},Object.defineProperty(r.RTCRtpSender.prototype,"dtmf",{get(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function ko(r){if(!r.RTCPeerConnection)return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){const[i,n,s]=arguments;if(arguments.length>0&&typeof i=="function")return t.apply(this,arguments);if(t.length===0&&(arguments.length===0||typeof i!="function"))return t.apply(this,[]);const o=function(a){const l={};return a.result().forEach(h=>{const f={id:h.id,timestamp:h.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[h.type]||h.type};h.names().forEach(d=>{f[d]=h.stat(d)}),l[f.id]=f}),l},c=function(a){return new Map(Object.keys(a).map(l=>[l,a[l]]))};if(arguments.length>=2){const a=function(l){n(c(o(l)))};return t.apply(this,[a,i])}return new Promise((a,l)=>{t.apply(this,[function(u){a(c(o(u)))},l])}).then(n,s)}}function Bo(r){if(!(typeof r=="object"&&r.RTCPeerConnection&&r.RTCRtpSender&&r.RTCRtpReceiver))return;if(!("getStats"in r.RTCRtpSender.prototype)){const e=r.RTCPeerConnection.prototype.getSenders;e&&(r.RTCPeerConnection.prototype.getSenders=function(){const s=e.apply(this,[]);return s.forEach(o=>o._pc=this),s});const i=r.RTCPeerConnection.prototype.addTrack;i&&(r.RTCPeerConnection.prototype.addTrack=function(){const s=i.apply(this,arguments);return s._pc=this,s}),r.RTCRtpSender.prototype.getStats=function(){const s=this;return this._pc.getStats().then(o=>xs(o,s.track,!0))}}if(!("getStats"in r.RTCRtpReceiver.prototype)){const e=r.RTCPeerConnection.prototype.getReceivers;e&&(r.RTCPeerConnection.prototype.getReceivers=function(){const n=e.apply(this,[]);return n.forEach(s=>s._pc=this),n}),Qe(r,"track",i=>(i.receiver._pc=i.srcElement,i)),r.RTCRtpReceiver.prototype.getStats=function(){const n=this;return this._pc.getStats().then(s=>xs(s,n.track,!1))}}if(!("getStats"in r.RTCRtpSender.prototype&&"getStats"in r.RTCRtpReceiver.prototype))return;const t=r.RTCPeerConnection.prototype.getStats;r.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof r.MediaStreamTrack){const i=arguments[0];let n,s,o;return this.getSenders().forEach(c=>{c.track===i&&(n?o=!0:n=c)}),this.getReceivers().forEach(c=>(c.track===i&&(s?o=!0:s=c),c.track===i)),o||n&&s?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():s?s.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return t.apply(this,arguments)}}function zo(r){r.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(o=>this._shimmedLocalStreams[o][0])};const t=r.RTCPeerConnection.prototype.addTrack;r.RTCPeerConnection.prototype.addTrack=function(o,c){if(!c)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const a=t.apply(this,arguments);return this._shimmedLocalStreams[c.id]?this._shimmedLocalStreams[c.id].indexOf(a)===-1&&this._shimmedLocalStreams[c.id].push(a):this._shimmedLocalStreams[c.id]=[c,a],a};const e=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(o){this._shimmedLocalStreams=this._shimmedLocalStreams||{},o.getTracks().forEach(l=>{if(this.getSenders().find(h=>h.track===l))throw new DOMException("Track already exists.","InvalidAccessError")});const c=this.getSenders();e.apply(this,arguments);const a=this.getSenders().filter(l=>c.indexOf(l)===-1);this._shimmedLocalStreams[o.id]=[o].concat(a)};const i=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[o.id],i.apply(this,arguments)};const n=r.RTCPeerConnection.prototype.removeTrack;r.RTCPeerConnection.prototype.removeTrack=function(o){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},o&&Object.keys(this._shimmedLocalStreams).forEach(c=>{const a=this._shimmedLocalStreams[c].indexOf(o);a!==-1&&this._shimmedLocalStreams[c].splice(a,1),this._shimmedLocalStreams[c].length===1&&delete this._shimmedLocalStreams[c]}),n.apply(this,arguments)}}function Oo(r,t){if(!r.RTCPeerConnection)return;if(r.RTCPeerConnection.prototype.addTrack&&t.version>=65)return zo(r);const e=r.RTCPeerConnection.prototype.getLocalStreams;r.RTCPeerConnection.prototype.getLocalStreams=function(){const u=e.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(h=>this._reverseStreams[h.id])};const i=r.RTCPeerConnection.prototype.addStream;r.RTCPeerConnection.prototype.addStream=function(u){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},u.getTracks().forEach(h=>{if(this.getSenders().find(d=>d.track===h))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[u.id]){const h=new r.MediaStream(u.getTracks());this._streams[u.id]=h,this._reverseStreams[h.id]=u,u=h}i.apply(this,[u])};const n=r.RTCPeerConnection.prototype.removeStream;r.RTCPeerConnection.prototype.removeStream=function(u){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},n.apply(this,[this._streams[u.id]||u]),delete this._reverseStreams[this._streams[u.id]?this._streams[u.id].id:u.id],delete this._streams[u.id]},r.RTCPeerConnection.prototype.addTrack=function(u,h){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const f=[].slice.call(arguments,1);if(f.length!==1||!f[0].getTracks().find(m=>m===u))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(m=>m.track===u))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const p=this._streams[h.id];if(p)p.addTrack(u),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const m=new r.MediaStream([u]);this._streams[h.id]=m,this._reverseStreams[m.id]=h,this.addStream(m)}return this.getSenders().find(m=>m.track===u)};function s(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(p.id,"g"),d.id)}),new RTCSessionDescription({type:u.type,sdp:h})}function o(l,u){let h=u.sdp;return Object.keys(l._reverseStreams||[]).forEach(f=>{const d=l._reverseStreams[f],p=l._streams[d.id];h=h.replace(new RegExp(d.id,"g"),p.id)}),new RTCSessionDescription({type:u.type,sdp:h})}["createOffer","createAnswer"].forEach(function(l){const u=r.RTCPeerConnection.prototype[l],h={[l](){const f=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[p=>{const m=s(this,p);f[0].apply(null,[m])},p=>{f[1]&&f[1].apply(null,p)},arguments[2]]):u.apply(this,arguments).then(p=>s(this,p))}};r.RTCPeerConnection.prototype[l]=h[l]});const c=r.RTCPeerConnection.prototype.setLocalDescription;r.RTCPeerConnection.prototype.setLocalDescription=function(){return!arguments.length||!arguments[0].type?c.apply(this,arguments):(arguments[0]=o(this,arguments[0]),c.apply(this,arguments))};const a=Object.getOwnPropertyDescriptor(r.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(r.RTCPeerConnection.prototype,"localDescription",{get(){const l=a.get.apply(this);return l.type===""?l:s(this,l)}}),r.RTCPeerConnection.prototype.removeTrack=function(u){if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!u._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(u._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};let f;Object.keys(this._streams).forEach(d=>{this._streams[d].getTracks().find(m=>u.track===m)&&(f=this._streams[d])}),f&&(f.getTracks().length===1?this.removeStream(this._reverseStreams[f.id]):f.removeTrack(u.track),this.dispatchEvent(new Event("negotiationneeded")))}}function Bn(r,t){!r.RTCPeerConnection&&r.webkitRTCPeerConnection&&(r.RTCPeerConnection=r.webkitRTCPeerConnection),r.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const i=r.RTCPeerConnection.prototype[e],n={[e](){return arguments[0]=new(e==="addIceCandidate"?r.RTCIceCandidate:r.RTCSessionDescription)(arguments[0]),i.apply(this,arguments)}};r.RTCPeerConnection.prototype[e]=n[e]})}function Io(r,t){Qe(r,"negotiationneeded",e=>{const i=e.target;if(!((t.version<72||i.getConfiguration&&i.getConfiguration().sdpSemantics==="plan-b")&&i.signalingState!=="stable"))return e})}const bs=Object.freeze(Object.defineProperty({__proto__:null,fixNegotiationNeeded:Io,shimAddTrackRemoveTrack:Oo,shimAddTrackRemoveTrackWithNative:zo,shimGetDisplayMedia:ec,shimGetSendersWithDtmf:Ro,shimGetStats:ko,shimGetUserMedia:Po,shimMediaStream:Eo,shimOnTrack:Ao,shimPeerConnection:Bn,shimSenderReceiverGetStats:Bo},Symbol.toStringTag,{value:"Module"}));function ic(r,t){let e=!1;return r=JSON.parse(JSON.stringify(r)),r.filter(i=>{if(i&&(i.urls||i.url)){let n=i.urls||i.url;i.url&&!i.urls&&Kr("RTCIceServer.url","RTCIceServer.urls");const s=typeof n=="string";return s&&(n=[n]),n=n.filter(o=>{if(o.indexOf("stun:")===0)return!1;const c=o.startsWith("turn")&&!o.startsWith("turn:[")&&o.includes("transport=udp");return c&&!e?(e=!0,!0):c&&!e}),delete i.url,i.urls=s?n[0]:n,!!n.length}})}var No={exports:{}};(function(r){var t={};t.generateIdentifier=function(){return Math.random().toString(36).substr(2,10)},t.localCName=t.generateIdentifier(),t.splitLines=function(e){return e.trim().split(`
2
2
  `).map(function(i){return i.trim()})},t.splitSections=function(e){var i=e.split(`
3
3
  m=`);return i.map(function(n,s){return(s>0?"m="+n:n).trim()+`\r
4
4
  `})},t.getDescription=function(e){var i=t.splitSections(e);return i&&i[0]},t.getMediaSections=function(e){var i=t.splitSections(e);return i.shift(),i},t.matchPrefix=function(e,i){return t.splitLines(e).filter(function(n){return n.indexOf(i)===0})},t.parseCandidate=function(e){var i;e.indexOf("a=candidate:")===0?i=e.substring(12).split(" "):i=e.substring(10).split(" ");for(var n={foundation:i[0],component:parseInt(i[1],10),protocol:i[2].toLowerCase(),priority:parseInt(i[3],10),ip:i[4],address:i[4],port:parseInt(i[5],10),type:i[7]},s=8;s<i.length;s+=2)switch(i[s]){case"raddr":n.relatedAddress=i[s+1];break;case"rport":n.relatedPort=parseInt(i[s+1],10);break;case"tcptype":n.tcpType=i[s+1];break;case"ufrag":n.ufrag=i[s+1],n.usernameFragment=i[s+1];break;default:n[i[s]]=i[s+1];break}return n},t.writeCandidate=function(e){var i=[];i.push(e.foundation),i.push(e.component),i.push(e.protocol.toUpperCase()),i.push(e.priority),i.push(e.address||e.ip),i.push(e.port);var n=e.type;return i.push("typ"),i.push(n),n!=="host"&&e.relatedAddress&&e.relatedPort&&(i.push("raddr"),i.push(e.relatedAddress),i.push("rport"),i.push(e.relatedPort)),e.tcpType&&e.protocol.toLowerCase()==="tcp"&&(i.push("tcptype"),i.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(i.push("ufrag"),i.push(e.usernameFragment||e.ufrag)),"candidate:"+i.join(" ")},t.parseIceOptions=function(e){return e.substr(14).split(" ")},t.parseRtpMap=function(e){var i=e.substr(9).split(" "),n={payloadType:parseInt(i.shift(),10)};return i=i[0].split("/"),n.name=i[0],n.clockRate=parseInt(i[1],10),n.channels=i.length===3?parseInt(i[2],10):1,n.numChannels=n.channels,n},t.writeRtpMap=function(e){var i=e.payloadType;e.preferredPayloadType!==void 0&&(i=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+i+" "+e.name+"/"+e.clockRate+(n!==1?"/"+n:"")+`\r
@@ -1,4 +1,4 @@
1
- import { PlaneGeometry as qo, ShaderChunk as vc, Triangle as jt, Vector3 as B, Layers as Wr, MeshBasicMaterial as Hn, DoubleSide as qn, AdditiveBlending as Xo, Object3D as Ts, InstancedBufferAttribute as Be, DynamicDrawUsage as _t, InstancedBufferGeometry as xc, Uniform$1 as Gt, ShaderMaterial as Xn, BufferGeometry as si, BufferAttribute as gt, Mesh as pn, MeshStandardMaterial as _c, MeshPhysicalMaterial as bc, Vector2 as Qt, Plane as Wo, Line3 as ue, Sphere as Yo, Matrix4 as It, Box3 as Pt, REVISION as Zo, BackSide as Sc, FrontSide as Ds, Group as Tc, LineBasicMaterial as Mc, BatchedMesh as Cc, Ray as wc, DataTexture as Wn, NearestFilter as ii, UnsignedIntType as Ui, IntType as Yr, FloatType as Di, UnsignedByteType as Fs, UnsignedShortType as Pc, ByteType as Ls, ShortType as Ec, RGBAFormat as nn, RGBAIntegerFormat as Yn, RGFormat as Ac, RedFormat as kc, RGIntegerFormat as Qo, RedIntegerFormat as Rc, Matrix3 as zc, Vector4 as Ms } from "./three.light.js";
1
+ import { PlaneGeometry as qo, ShaderChunk as vc, Triangle as jt, Vector3 as B, Layers as Wr, MeshBasicMaterial as Hn, DoubleSide as qn, AdditiveBlending as Xo, Object3D as Ts, InstancedBufferAttribute as Be, DynamicDrawUsage as _t, InstancedBufferGeometry as xc, Uniform$1 as Gt, ShaderMaterial as Xn, BufferGeometry as si, BufferAttribute as gt, Mesh as pn, MeshStandardMaterial as _c, MeshPhysicalMaterial as bc, Vector2 as Qt, Plane as Wo, Line3 as ue, Sphere as Yo, Matrix4 as It, Box3 as Pt, REVISION as Zo, BackSide as Sc, FrontSide as Ds, Group as Tc, LineBasicMaterial as Mc, BatchedMesh as Cc, Ray as wc, DataTexture as Wn, NearestFilter as ii, UnsignedIntType as Ui, IntType as Yr, FloatType as Di, UnsignedByteType as Fs, UnsignedShortType as Pc, ByteType as Ls, ShortType as Ec, RGBAFormat as nn, RGBAIntegerFormat as Yn, RGFormat as Ac, RedFormat as kc, RGIntegerFormat as Qo, RedIntegerFormat as Rc, Matrix3 as zc, Vector4 as Ms } from "./three-3fd45ef1.light.js";
2
2
  const ot = {
3
3
  Handedness: Object.freeze({
4
4
  NONE: "none",
@@ -1,4 +1,4 @@
1
- import { PlaneGeometry as qo, ShaderChunk as vc, Triangle as jt, Vector3 as B, Layers as Wr, MeshBasicMaterial as Hn, DoubleSide as qn, AdditiveBlending as Xo, Object3D as Ts, InstancedBufferAttribute as Be, DynamicDrawUsage as _t, InstancedBufferGeometry as xc, Uniform$1 as Gt, ShaderMaterial as Xn, BufferGeometry as si, BufferAttribute as gt, Mesh as pn, MeshStandardMaterial as _c, MeshPhysicalMaterial as bc, Vector2 as Qt, Plane as Wo, Line3 as ue, Sphere as Yo, Matrix4 as It, Box3 as Pt, REVISION as Zo, BackSide as Sc, FrontSide as Ds, Group as Tc, LineBasicMaterial as Mc, BatchedMesh as Cc, Ray as wc, DataTexture as Wn, NearestFilter as ii, UnsignedIntType as Ui, IntType as Yr, FloatType as Di, UnsignedByteType as Fs, UnsignedShortType as Pc, ByteType as Ls, ShortType as Ec, RGBAFormat as nn, RGBAIntegerFormat as Yn, RGFormat as Ac, RedFormat as kc, RGIntegerFormat as Qo, RedIntegerFormat as Rc, Matrix3 as zc, Vector4 as Ms } from "./three.js";
1
+ import { PlaneGeometry as qo, ShaderChunk as vc, Triangle as jt, Vector3 as B, Layers as Wr, MeshBasicMaterial as Hn, DoubleSide as qn, AdditiveBlending as Xo, Object3D as Ts, InstancedBufferAttribute as Be, DynamicDrawUsage as _t, InstancedBufferGeometry as xc, Uniform$1 as Gt, ShaderMaterial as Xn, BufferGeometry as si, BufferAttribute as gt, Mesh as pn, MeshStandardMaterial as _c, MeshPhysicalMaterial as bc, Vector2 as Qt, Plane as Wo, Line3 as ue, Sphere as Yo, Matrix4 as It, Box3 as Pt, REVISION as Zo, BackSide as Sc, FrontSide as Ds, Group as Tc, LineBasicMaterial as Mc, BatchedMesh as Cc, Ray as wc, DataTexture as Wn, NearestFilter as ii, UnsignedIntType as Ui, IntType as Yr, FloatType as Di, UnsignedByteType as Fs, UnsignedShortType as Pc, ByteType as Ls, ShortType as Ec, RGBAFormat as nn, RGBAIntegerFormat as Yn, RGFormat as Ac, RedFormat as kc, RGIntegerFormat as Qo, RedIntegerFormat as Rc, Matrix3 as zc, Vector4 as Ms } from "./three-3fd45ef1.js";
2
2
  const ot = {
3
3
  Handedness: Object.freeze({
4
4
  NONE: "none",