text: !function(A){var t={};function e(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return A[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{enumerable:!0,get:i})},e.r=function(A){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})},e.t=function(A,t){if(1&t&&(A=e(A)),8&t)return A;if(4&t&&"object"==typeof A&&A&&A.__esModule)return A;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:A}),2&t&&"string"!=typeof A)for(var n in A)e.d(i,n,function(t){return A[t]}.bind(null,n));return i},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},e.p="",e(e.s=2)}([function(A,t,e){const{ResonanceAudio:i}=e(1),n=Object.keys(i.Utils.ROOM_MATERIAL_COEFFICIENTS);AFRAME.registerComponent("resonance-audio-room",{dependencies:["position","rotation"],schema:{width:{type:"number",default:i.Utils.DEFAULT_ROOM_DIMENSIONS.width},height:{type:"number",default:i.Utils.DEFAULT_ROOM_DIMENSIONS.height},depth:{type:"number",default:i.Utils.DEFAULT_ROOM_DIMENSIONS.depth},ambisonicOrder:{type:"int",default:i.Utils.DEFAULT_AMBISONIC_ORDER},speedOfSound:{type:"number",default:i.Utils.DEFAULT_SPEED_OF_SOUND},left:{default:"brick-bare",oneOf:n},right:{default:"brick-bare",oneOf:n},front:{default:"brick-bare",oneOf:n},back:{default:"brick-bare",oneOf:n},down:{default:"brick-bare",oneOf:n},up:{default:"brick-bare",oneOf:n},visualize:{type:"boolean",default:!1}},init(){this.audioContext=new AudioContext,this.resonanceAudioScene=new i(this.audioContext),this.resonanceAudioScene.output.connect(this.audioContext.destination),this.visualization=null,this.sources=[],this.updateRoomAcoustics(),this.setUpAudioSources(),this.exposeAPI(),this.el.addEventListener("componentchanged",A=>{"position"!==A.detail.name&&"rotation"!==A.detail.name||(this.updatePosition().updateVisualization(),this.sources.forEach(A=>A.updatePosition().updateVisualization()))}),this.el.addEventListener("child-attached",A=>{const t=A.detail.el;t.hasLoaded?this.attachSource(t):t.addEventListener("loaded",()=>this.attachSource(t))}),this.el.addEventListener("child-detached",A=>this.detachSource(A.detail.el)),this.el.sceneEl.addEventListener("loaded",()=>this.updateVisualization())},exposeAPI(){Object.defineProperties(this.el,{audioSources:{enumerable:!0,get:()=>this.sources},sounds:{enumerable:!0,get:()=>this.sources.map(A=>A.sound)}})},update(A){this.updateRoomAcoustics(),this.updateVisualization(A)},updatePosition(){return this.el.object3D.updateMatrixWorld(!0),this},tock(){this.resonanceAudioScene.setListenerFromMatrix((new THREE.Matrix4).multiplyMatrices((new THREE.Matrix4).getInverse(this.el.object3D.matrixWorld),this.el.sceneEl.camera.el.object3D.matrixWorld))},updateRoomAcoustics(){this.resonanceAudioScene.setRoomProperties({width:this.data.width,height:this.data.height,depth:this.data.depth},{left:this.data.left,right:this.data.right,front:this.data.front,back:this.data.back,down:this.data.down,up:this.data.up}),this.resonanceAudioScene.setAmbisonicOrder(this.data.ambisonicOrder),this.resonanceAudioScene.setSpeedOfSound(this.data.speedOfSound)},updateVisualization(A){const t=this.data;if(A&&(!A.visualize&&t.visualize?(this.visualization||(this.visualization=document.createElement("a-box"),this.visualization.audioRoom=this.el,this.visualization.setAttribute("material","wireframe",!0)),this.el.sceneEl.appendChild(this.visualization)):A.visualize&&!t.visualize&&(this.el.sceneEl.removeChild(this.visualization),this.visualization=null)),t.visualize){this.el.sceneEl.object3D.updateMatrixWorld(!0);const A=new THREE.Vector3,e=new THREE.Quaternion,i=new THREE.Vector3;this.el.object3D.matrixWorld.decompose(A,e,i);const n=(new THREE.Euler).setFromQuaternion(e,"YXZ"),s=THREE.Math.radToDeg;this.visualization.setAttribute("position",A),this.visualization.setAttribute("rotation",{x:s(n.x),y:s(n.y),z:s(n.z)}),this.visualization.setAttribute("width",t.width),this.visualization.setAttribute("height",t.height),this.visualization.setAttribute("depth",t.depth)}return this},setUpAudioSources(){this.el.querySelectorAll("[resonance-audio-src]").forEach(A=>this.attachSource(A))},attachSource(A){const t=A.components["resonance-audio-src"];t&&(this.sources.push(t),t.initAudioSrc(this))},detachSource(A){const t=A.components["resonance-audio-src"];t&&this.sources.includes(t)&&(this.sources.splice(this.sources.indexOf(t),1),t.disconnect())},remove(){[...this.sources].map(A=>this.detachSource(A.el)),this.visualization&&(this.el.sceneEl.removeChild(this.visualization),this.visualization=null)}}),AFRAME.registerPrimitive("a-resonance-audio-room",{defaultComponents:{"resonance-audio-room":{}},mappings:{width:"resonance-audio-room.width",height:"resonance-audio-room.height",depth:"resonance-audio-room.depth","ambisonic-order":"resonance-audio-room.ambisonicOrder","speed-of-sound":"resonance-audio-room.speedOfSound",left:"resonance-audio-room.left",right:"resonance-audio-room.right",front:"resonance-audio-room.front",back:"resonance-audio-room.back",down:"resonance-audio-room.down",up:"resonance-audio-room.up",visualize:"resonance-audio-room.visualize"}})},function(A,t,e){!function(t,e){A.exports=e()}(0,function(){return function(A){var t={};function e(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return A[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},e.p="",e(e.s=10)}([function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */function i(){}i.DEFAULT_SOURCE_GAIN=1,i.LISTENER_MAX_OUTSIDE_ROOM_DISTANCE=1,i.SOURCE_MAX_OUTSIDE_ROOM_DISTANCE=1,i.DEFAULT_SOURCE_DISTANCE=1,i.DEFAULT_POSITION=[0,0,0],i.DEFAULT_FORWARD=[0,0,-1],i.DEFAULT_UP=[0,1,0],i.DEFAULT_RIGHT=[1,0,0],i.DEFAULT_SPEED_OF_SOUND=343,i.ATTENUATION_ROLLOFFS=["logarithmic","linear","none"],i.DEFAULT_ATTENUATION_ROLLOFF="logarithmic",i.DEFAULT_MIN_DISTANCE=1,i.DEFAULT_MAX_DISTANCE=1e3,i.DEFAULT_DIRECTIVITY_ALPHA=0,i.DEFAULT_DIRECTIVITY_SHARPNESS=1,i.DEFAULT_AZIMUTH=0,i.DEFAULT_ELEVATION=0,i.DEFAULT_AMBISONIC_ORDER=1,i.DEFAULT_SOURCE_WIDTH=0,i.DEFAULT_REFLECTION_MAX_DURATION=.5,i.DEFAULT_REFLECTION_CUTOFF_FREQUENCY=6400,i.DEFAULT_REFLECTION_COEFFICIENTS={left:0,right:0,front:0,back:0,down:0,up:0},i.DEFAULT_REFLECTION_MIN_DISTANCE=1,i.DEFAULT_ROOM_DIMENSIONS={width:0,height:0,depth:0},i.DEFAULT_REFLECTION_MULTIPLIER=1,i.DEFAULT_REVERB_BANDWIDTH=1,i.DEFAULT_REVERB_DURATION_MULTIPLIER=1,i.DEFAULT_REVERB_PREDELAY=1.5,i.DEFAULT_REVERB_TAIL_ONSET=3.8,i.DEFAULT_REVERB_GAIN=.01,i.DEFAULT_REVERB_MAX_DURATION=3,i.DEFAULT_REVERB_FREQUENCY_BANDS=[31.25,62.5,125,250,500,1e3,2e3,4e3,8e3],i.NUMBER_REVERB_FREQUENCY_BANDS=i.DEFAULT_REVERB_FREQUENCY_BANDS.length,i.DEFAULT_REVERB_DURATIONS=new Float32Array(i.NUMBER_REVERB_FREQUENCY_BANDS),i.ROOM_MATERIAL_COEFFICIENTS={transparent:[1,1,1,1,1,1,1,1,1],"acoustic-ceiling-tiles":[.672,.675,.7,.66,.72,.92,.88,.75,1],"brick-bare":[.03,.03,.03,.03,.03,.04,.05,.07,.14],"brick-painted":[.006,.007,.01,.01,.02,.02,.02,.03,.06],"concrete-block-coarse":[.36,.36,.36,.44,.31,.29,.39,.25,.5],"concrete-block-painted":[.092,.09,.1,.05,.06,.07,.09,.08,.16],"curtain-heavy":[.073,.106,.14,.35,.55,.72,.7,.65,1],"fiber-glass-insulation":[.193,.22,.22,.82,.99,.99,.99,.99,1],"glass-thin":[.18,.169,.18,.06,.04,.03,.02,.02,.04],"glass-thick":[.35,.35,.35,.25,.18,.12,.07,.04,.08],grass:[.05,.05,.15,.25,.4,.55,.6,.6,.6],"linoleum-on-concrete":[.02,.02,.02,.03,.03,.03,.03,.02,.04],marble:[.01,.01,.01,.01,.01,.01,.02,.02,.04],metal:[.03,.035,.04,.04,.05,.05,.05,.07,.09],"parquet-on-concrete":[.028,.03,.04,.04,.07,.06,.06,.07,.14],"plaster-rough":[.017,.018,.02,.03,.04,.05,.04,.03,.06],"plaster-smooth":[.011,.012,.013,.015,.02,.03,.04,.05,.1],"plywood-panel":[.4,.34,.28,.22,.17,.09,.1,.11,.22],"polished-concrete-or-tile":[.008,.008,.01,.01,.015,.02,.02,.02,.04],"sheet-rock":[.29,.279,.29,.1,.05,.04,.07,.09,.18],"water-or-ice-surface":[.006,.006,.008,.008,.013,.015,.02,.025,.05],"wood-ceiling":[.15,.147,.15,.11,.1,.07,.06,.07,.14],"wood-panel":[.28,.28,.28,.22,.17,.09,.1,.11,.22],uniform:[.5,.5,.5,.5,.5,.5,.5,.5,.5]},i.DEFAULT_ROOM_MATERIALS={left:"transparent",right:"transparent",front:"transparent",back:"transparent",down:"transparent",up:"transparent"},i.NUMBER_REFLECTION_AVERAGING_BANDS=3,i.ROOM_STARTING_AVERAGING_BAND=4,i.ROOM_MIN_VOLUME=1e-4,i.ROOM_AIR_ABSORPTION_COEFFICIENTS=[6e-4,6e-4,7e-4,8e-4,.001,.0015,.0026,.006,.0207],i.ROOM_EYRING_CORRECTION_COEFFICIENT=1.38,i.TWO_PI=6.28318530717959,i.TWENTY_FOUR_LOG10=55.2620422318571,i.LOG1000=6.90775527898214,i.LOG2_DIV2=.346573590279973,i.DEGREES_TO_RADIANS=.017453292519943,i.RADIANS_TO_DEGREES=57.29577951308232,i.EPSILON_FLOAT=1e-8,i.log=function(){window.console.log.apply(window.console,["%c[ResonanceAudio]%c "+Array.prototype.slice.call(arguments).join(" ")+" %c(@"+performance.now().toFixed(2)+"ms)","background: #BBDEFB; color: #FF5722; font-weight: 700","font-weight: 400","color: #AAA"])},i.normalizeVector=function(A){let e=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);return e>t.EPSILON_FLOAT&&(e=1/e,A[0]*=e,A[1]*=e,A[2]*=e),A},i.crossProduct=function(A,t){return[A[1]*t[2]-A[2]*t[1],A[2]*t[0]-A[0]*t[2],A[0]*t[1]-A[1]*t[0]]},A.exports=i},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(3),n=e(0);function s(A,t){void 0==t&&(t={}),void 0==t.ambisonicOrder&&(t.ambisonicOrder=n.DEFAULT_AMBISONIC_ORDER),void 0==t.azimuth&&(t.azimuth=n.DEFAULT_AZIMUTH),void 0==t.elevation&&(t.elevation=n.DEFAULT_ELEVATION),void 0==t.sourceWidth&&(t.sourceWidth=n.DEFAULT_SOURCE_WIDTH),this._context=A,this.input=A.createGain(),this._channelGain=[],this._merger=void 0,this.output=A.createGain(),this.setAmbisonicOrder(t.ambisonicOrder),this._azimuth=t.azimuth,this._elevation=t.elevation,this.setSourceWidth(t.sourceWidth)}s.prototype.setAmbisonicOrder=function(A){this._ambisonicOrder=s.validateAmbisonicOrder(A),this.input.disconnect();for(let A=0;A<this._channelGain.length;A++)this._channelGain[A].disconnect();void 0!=this._merger&&this._merger.disconnect(),delete this._channelGain,delete this._merger;let t=(this._ambisonicOrder+1)*(this._ambisonicOrder+1);this._merger=this._context.createChannelMerger(t),this._channelGain=new Array(t);for(let A=0;A<t;A++)this._channelGain[A]=this._context.createGain(),this.input.connect(this._channelGain[A]),this._channelGain[A].connect(this._merger,0,A);this._merger.connect(this.output)},s.prototype.setDirection=function(A,t){(void 0==A||isNaN(A))&&(A=n.DEFAULT_AZIMUTH),(void 0==t||isNaN(t))&&(t=n.DEFAULT_ELEVATION),this._azimuth=A,this._elevation=t,(A=Math.round(A%360))<0&&(A+=360),t=Math.round(Math.min(90,Math.max(-90,t)))+90,this._channelGain[0].gain.value=i.MAX_RE_WEIGHTS[this._spreadIndex][0];for(let e=1;e<=this._ambisonicOrder;e++){let n=i.MAX_RE_WEIGHTS[this._spreadIndex][e];for(let s=-e;s<=e;s++){let o=e*e+e+s,r=e*(e+1)/2+Math.abs(s)-1,a=i.SPHERICAL_HARMONICS[1][t][r];if(0!=s){let t=i.SPHERICAL_HARMONICS_MAX_ORDER+s-1;s<0&&(t=i.SPHERICAL_HARMONICS_MAX_ORDER+s),a*=i.SPHERICAL_HARMONICS[0][A][t]}this._channelGain[o].gain.value=a*n}}},s.prototype.setSourceWidth=function(A){this._spreadIndex=Math.min(359,Math.max(0,Math.round(A))),this.setDirection(this._azimuth,this._elevation)},s.validateAmbisonicOrder=function(A){return isNaN(A)||void 0==A?(n.log("Error: Invalid ambisonic order",options.ambisonicOrder,"\nUsing ambisonicOrder=1 instead."),A=1):A<1?(n.log("Error: Unable to render ambisonic order",options.ambisonicOrder,"(Min order is 1)","\nUsing min order instead."),A=1):A>i.SPHERICAL_HARMONICS_MAX_ORDER&&(n.log("Error: Unable to render ambisonic order",options.ambisonicOrder,"(Max order is",i.SPHERICAL_HARMONICS_MAX_ORDER,")\nUsing max order instead."),options.ambisonicOrder=i.SPHERICAL_HARMONICS_MAX_ORDER),A},A.exports=s},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(12),n=e(1),s=e(0);function o(A,t){void 0==t&&(t={}),void 0==t.ambisonicOrder&&(t.ambisonicOrder=s.DEFAULT_AMBISONIC_ORDER),void 0==t.position&&(t.position=s.DEFAULT_POSITION.slice()),void 0==t.forward&&(t.forward=s.DEFAULT_FORWARD.slice()),void 0==t.up&&(t.up=s.DEFAULT_UP.slice()),this.position=new Float32Array(3),this._tempMatrix3=new Float32Array(9),this._ambisonicOrder=n.validateAmbisonicOrder(t.ambisonicOrder),this._context=A,1==this._ambisonicOrder?this._renderer=i.Omnitone.createFOARenderer(A,{}):this._ambisonicOrder>1&&(this._renderer=i.Omnitone.createHOARenderer(A,{ambisonicOrder:this._ambisonicOrder})),this.input=A.createGain(),this.output=A.createGain(),this.ambisonicOutput=A.createGain();let e=this;this._renderer.initialize().then(function(){e.input.connect(e._renderer.input),e._ambisonicOrder>1?e._renderer._hoaRotator.output.connect(e.ambisonicOutput):e._renderer._foaRotator.output.connect(e.ambisonicOutput),e._renderer.output.connect(e.output)}),this.setOrientation(t.forward[0],t.forward[1],t.forward[2],t.up[0],t.up[1],t.up[2])}o.prototype.setOrientation=function(A,t,e,i,n,o){let r=s.crossProduct([A,t,e],[i,n,o]);this._tempMatrix3[0]=r[0],this._tempMatrix3[1]=r[1],this._tempMatrix3[2]=r[2],this._tempMatrix3[3]=i,this._tempMatrix3[4]=n,this._tempMatrix3[5]=o,this._tempMatrix3[6]=A,this._tempMatrix3[7]=t,this._tempMatrix3[8]=e,this._renderer.setRotationMatrix3(this._tempMatrix3)},o.prototype.setFromMatrix=function(A){this._renderer.setRotationMatrix4(A.elements),this.position[0]=A.elements[12],this.position[1]=A.elements[13],this.position[2]=A.elements[14]},A.exports=o},function(A,t,e){"use strict";t.SPHERICAL_HARMONICS=[[[0,0,0,1,1,1],[.052336,.034899,.017452,.999848,.999391,.99863],[.104528,.069756,.034899,.999391,.997564,.994522],[.156434,.104528,.052336,.99863,.994522,.987688],[.207912,.139173,.069756,.997564,.990268,.978148],[.258819,.173648,.087156,.996195,.984808,.965926],[.309017,.207912,.104528,.994522,.978148,.951057],[.358368,.241922,.121869,.992546,.970296,.93358],[.406737,.275637,.139173,.990268,.961262,.913545],[.45399,.309017,.156434,.987688,.951057,.891007],[.5,.34202,.173648,.984808,.939693,.866025],[.544639,.374607,.190809,.981627,.927184,.838671],[.587785,.406737,.207912,.978148,.913545,.809017],[.62932,.438371,.224951,.97437,.898794,.777146],[.669131,.469472,.241922,.970296,.882948,.743145],[.707107,.5,.258819,.965926,.866025,.707107],[.743145,.529919,.275637,.961262,.848048,.669131],[.777146,.559193,.292372,.956305,.829038,.62932],[.809017,.587785,.309017,.951057,.809017,.587785],[.838671,.615661,.325568,.945519,.788011,.544639],[.866025,.642788,.34202,.939693,.766044,.5],[.891007,.669131,.358368,.93358,.743145,.45399],[.913545,.694658,.374607,.927184,.71934,.406737],[.93358,.71934,.390731,.920505,.694658,.358368],[.951057,.743145,.406737,.913545,.669131,.309017],[.965926,.766044,.422618,.906308,.642788,.258819],[.978148,.788011,.438371,.898794,.615661,.207912],[.987688,.809017,.45399,.891007,.587785,.156434],[.994522,.829038,.469472,.882948,.559193,.104528],[.99863,.848048,.48481,.87462,.529919,.052336],[1,.866025,.5,.866025,.5,0],[.99863,.882948,.515038,.857167,.469472,-.052336],[.994522,.898794,.529919,.848048,.438371,-.104528],[.987688,.913545,.544639,.838671,.406737,-.156434],[.978148,.927184,.559193,.829038,.374607,-.207912],[.965926,.939693,.573576,.819152,.34202,-.258819],[.951057,.951057,.587785,.809017,.309017,-.309017],[.93358,.961262,.601815,.798636,.275637,-.358368],[.913545,.970296,.615661,.788011,.241922,-.406737],[.891007,.978148,.62932,.777146,.207912,-.45399],[.866025,.984808,.642788,.766044,.173648,-.5],[.838671,.990268,.656059,.75471,.139173,-.544639],[.809017,.994522,.669131,.743145,.104528,-.587785],[.777146,.997564,.681998,.731354,.069756,-.62932],[.743145,.999391,.694658,.71934,.034899,-.669131],[.707107,1,.707107,.707107,0,-.707107],[.669131,.999391,.71934,.694658,-.034899,-.743145],[.62932,.997564,.731354,.681998,-.069756,-.777146],[.587785,.994522,.743145,.669131,-.104528,-.809017],[.544639,.990268,.75471,.656059,-.139173,-.838671],[.5,.984808,.766044,.642788,-.173648,-.866025],[.45399,.978148,.777146,.62932,-.207912,-.891007],[.406737,.970296,.788011,.615661,-.241922,-.913545],[.358368,.961262,.798636,.601815,-.275637,-.93358],[.309017,.951057,.809017,.587785,-.309017,-.951057],[.258819,.939693,.819152,.573576,-.34202,-.965926],[.207912,.927184,.829038,.559193,-.374607,-.978148],[.156434,.913545,.838671,.544639,-.406737,-.987688],[.104528,.898794,.848048,.529919,-.438371,-.994522],[.052336,.882948,.857167,.515038,-.469472,-.99863],[0,.866025,.866025,.5,-.5,-1],[-.052336,.848048,.87462,.48481,-.529919,-.99863],[-.104528,.829038,.882948,.469472,-.559193,-.994522],[-.156434,.809017,.891007,.45399,-.587785,-.987688],[-.207912,.788011,.898794,.438371,-.615661,-.978148],[-.258819,.766044,.906308,.422618,-.642788,-.965926],[-.309017,.743145,.913545,.406737,-.669131,-.951057],[-.358368,.71934,.920505,.390731,-.694658,-.93358],[-.406737,.694658,.927184,.374607,-.71934,-.913545],[-.45399,.669131,.93358,.358368,-.743145,-.891007],[-.5,.642788,.939693,.34202,-.766044,-.866025],[-.544639,.615661,.945519,.325568,-.788011,-.838671],[-.587785,.587785,.951057,.309017,-.809017,-.809017],[-.62932,.559193,.956305,.292372,-.829038,-.777146],[-.669131,.529919,.961262,.275637,-.848048,-.743145],[-.707107,.5,.965926,.258819,-.866025,-.707107],[-.743145,.469472,.970296,.241922,-.882948,-.669131],[-.777146,.438371,.97437,.224951,-.898794,-.62932],[-.809017,.406737,.978148,.207912,-.913545,-.587785],[-.838671,.374607,.981627,.190809,-.927184,-.544639],[-.866025,.34202,.984808,.173648,-.939693,-.5],[-.891007,.309017,.987688,.156434,-.951057,-.45399],[-.913545,.275637,.990268,.139173,-.961262,-.406737],[-.93358,.241922,.992546,.121869,-.970296,-.358368],[-.951057,.207912,.994522,.104528,-.978148,-.309017],[-.965926,.173648,.996195,.087156,-.984808,-.258819],[-.978148,.139173,.997564,.069756,-.990268,-.207912],[-.987688,.104528,.99863,.052336,-.994522,-.156434],[-.994522,.069756,.999391,.034899,-.997564,-.104528],[-.99863,.034899,.999848,.017452,-.999391,-.052336],[-1,0,1,0,-1,-0],[-.99863,-.034899,.999848,-.017452,-.999391,.052336],[-.994522,-.069756,.999391,-.034899,-.997564,.104528],[-.987688,-.104528,.99863,-.052336,-.994522,.156434],[-.978148,-.139173,.997564,-.069756,-.990268,.207912],[-.965926,-.173648,.996195,-.087156,-.984808,.258819],[-.951057,-.207912,.994522,-.104528,-.978148,.309017],[-.93358,-.241922,.992546,-.121869,-.970296,.358368],[-.913545,-.275637,.990268,-.139173,-.961262,.406737],[-.891007,-.309017,.987688,-.156434,-.951057,.45399],[-.866025,-.34202,.984808,-.173648,-.939693,.5],[-.838671,-.374607,.981627,-.190809,-.927184,.544639],[-.809017,-.406737,.978148,-.207912,-.913545,.587785],[-.777146,-.438371,.97437,-.224951,-.898794,.62932],[-.743145,-.469472,.970296,-.241922,-.882948,.669131],[-.707107,-.5,.965926,-.258819,-.866025,.707107],[-.669131,-.529919,.961262,-.275637,-.848048,.743145],[-.62932,-.559193,.956305,-.292372,-.829038,.777146],[-.587785,-.587785,.951057,-.309017,-.809017,.809017],[-.544639,-.615661,.945519,-.325568,-.788011,.838671],[-.5,-.642788,.939693,-.34202,-.766044,.866025],[-.45399,-.669131,.93358,-.358368,-.743145,.891007],[-.406737,-.694658,.927184,-.374607,-.71934,.913545],[-.358368,-.71934,.920505,-.390731,-.694658,.93358],[-.309017,-.743145,.913545,-.406737,-.669131,.951057],[-.258819,-.766044,.906308,-.422618,-.642788,.965926],[-.207912,-.788011,.898794,-.438371,-.615661,.978148],[-.156434,-.809017,.891007,-.45399,-.587785,.987688],[-.104528,-.829038,.882948,-.469472,-.559193,.994522],[-.052336,-.848048,.87462,-.48481,-.529919,.99863],[-0,-.866025,.866025,-.5,-.5,1],[.052336,-.882948,.857167,-.515038,-.469472,.99863],[.104528,-.898794,.848048,-.529919,-.438371,.994522],[.156434,-.913545,.838671,-.544639,-.406737,.987688],[.207912,-.927184,.829038,-.559193,-.374607,.978148],[.258819,-.939693,.819152,-.573576,-.34202,.965926],[.309017,-.951057,.809017,-.587785,-.309017,.951057],[.358368,-.961262,.798636,-.601815,-.275637,.93358],[.406737,-.970296,.788011,-.615661,-.241922,.913545],[.45399,-.978148,.777146,-.62932,-.207912,.891007],[.5,-.984808,.766044,-.642788,-.173648,.866025],[.544639,-.990268,.75471,-.656059,-.139173,.838671],[.587785,-.994522,.743145,-.669131,-.104528,.809017],[.62932,-.997564,.731354,-.681998,-.069756,.777146],[.669131,-.999391,.71934,-.694658,-.034899,.743145],[.707107,-1,.707107,-.707107,-0,.707107],[.743145,-.999391,.694658,-.71934,.034899,.669131],[.777146,-.997564,.681998,-.731354,.069756,.62932],[.809017,-.994522,.669131,-.743145,.104528,.587785],[.838671,-.990268,.656059,-.75471,.139173,.544639],[.866025,-.984808,.642788,-.766044,.173648,.5],[.891007,-.978148,.62932,-.777146,.207912,.45399],[.913545,-.970296,.615661,-.788011,.241922,.406737],[.93358,-.961262,.601815,-.798636,.275637,.358368],[.951057,-.951057,.587785,-.809017,.309017,.309017],[.965926,-.939693,.573576,-.819152,.34202,.258819],[.978148,-.927184,.559193,-.829038,.374607,.207912],[.987688,-.913545,.544639,-.838671,.406737,.156434],[.994522,-.898794,.529919,-.848048,.438371,.104528],[.99863,-.882948,.515038,-.857167,.469472,.052336],[1,-.866025,.5,-.866025,.5,0],[.99863,-.848048,.48481,-.87462,.529919,-.052336],[.994522,-.829038,.469472,-.882948,.559193,-.104528],[.987688,-.809017,.45399,-.891007,.587785,-.156434],[.978148,-.788011,.438371,-.898794,.615661,-.207912],[.965926,-.766044,.422618,-.906308,.642788,-.258819],[.951057,-.743145,.406737,-.913545,.669131,-.309017],[.93358,-.71934,.390731,-.920505,.694658,-.358368],[.913545,-.694658,.374607,-.927184,.71934,-.406737],[.891007,-.669131,.358368,-.93358,.743145,-.45399],[.866025,-.642788,.34202,-.939693,.766044,-.5],[.838671,-.615661,.325568,-.945519,.788011,-.544639],[.809017,-.587785,.309017,-.951057,.809017,-.587785],[.777146,-.559193,.292372,-.956305,.829038,-.62932],[.743145,-.529919,.275637,-.961262,.848048,-.669131],[.707107,-.5,.258819,-.965926,.866025,-.707107],[.669131,-.469472,.241922,-.970296,.882948,-.743145],[.62932,-.438371,.224951,-.97437,.898794,-.777146],[.587785,-.406737,.207912,-.978148,.913545,-.809017],[.544639,-.374607,.190809,-.981627,.927184,-.838671],[.5,-.34202,.173648,-.984808,.939693,-.866025],[.45399,-.309017,.156434,-.987688,.951057,-.891007],[.406737,-.275637,.139173,-.990268,.961262,-.913545],[.358368,-.241922,.121869,-.992546,.970296,-.93358],[.309017,-.207912,.104528,-.994522,.978148,-.951057],[.258819,-.173648,.087156,-.996195,.984808,-.965926],[.207912,-.139173,.069756,-.997564,.990268,-.978148],[.156434,-.104528,.052336,-.99863,.994522,-.987688],[.104528,-.069756,.034899,-.999391,.997564,-.994522],[.052336,-.034899,.017452,-.999848,.999391,-.99863],[0,-0,0,-1,1,-1],[-.052336,.034899,-.017452,-.999848,.999391,-.99863],[-.104528,.069756,-.034899,-.999391,.997564,-.994522],[-.156434,.104528,-.052336,-.99863,.994522,-.987688],[-.207912,.139173,-.069756,-.997564,.990268,-.978148],[-.258819,.173648,-.087156,-.996195,.984808,-.965926],[-.309017,.207912,-.104528,-.994522,.978148,-.951057],[-.358368,.241922,-.121869,-.992546,.970296,-.93358],[-.406737,.275637,-.139173,-.990268,.961262,-.913545],[-.45399,.309017,-.156434,-.987688,.951057,-.891007],[-.5,.34202,-.173648,-.984808,.939693,-.866025],[-.544639,.374607,-.190809,-.981627,.927184,-.838671],[-.587785,.406737,-.207912,-.978148,.913545,-.809017],[-.62932,.438371,-.224951,-.97437,.898794,-.777146],[-.669131,.469472,-.241922,-.970296,.882948,-.743145],[-.707107,.5,-.258819,-.965926,.866025,-.707107],[-.743145,.529919,-.275637,-.961262,.848048,-.669131],[-.777146,.559193,-.292372,-.956305,.829038,-.62932],[-.809017,.587785,-.309017,-.951057,.809017,-.587785],[-.838671,.615661,-.325568,-.945519,.788011,-.544639],[-.866025,.642788,-.34202,-.939693,.766044,-.5],[-.891007,.669131,-.358368,-.93358,.743145,-.45399],[-.913545,.694658,-.374607,-.927184,.71934,-.406737],[-.93358,.71934,-.390731,-.920505,.694658,-.358368],[-.951057,.743145,-.406737,-.913545,.669131,-.309017],[-.965926,.766044,-.422618,-.906308,.642788,-.258819],[-.978148,.788011,-.438371,-.898794,.615661,-.207912],[-.987688,.809017,-.45399,-.891007,.587785,-.156434],[-.994522,.829038,-.469472,-.882948,.559193,-.104528],[-.99863,.848048,-.48481,-.87462,.529919,-.052336],[-1,.866025,-.5,-.866025,.5,0],[-.99863,.882948,-.515038,-.857167,.469472,.052336],[-.994522,.898794,-.529919,-.848048,.438371,.104528],[-.987688,.913545,-.544639,-.838671,.406737,.156434],[-.978148,.927184,-.559193,-.829038,.374607,.207912],[-.965926,.939693,-.573576,-.819152,.34202,.258819],[-.951057,.951057,-.587785,-.809017,.309017,.309017],[-.93358,.961262,-.601815,-.798636,.275637,.358368],[-.913545,.970296,-.615661,-.788011,.241922,.406737],[-.891007,.978148,-.62932,-.777146,.207912,.45399],[-.866025,.984808,-.642788,-.766044,.173648,.5],[-.838671,.990268,-.656059,-.75471,.139173,.544639],[-.809017,.994522,-.669131,-.743145,.104528,.587785],[-.777146,.997564,-.681998,-.731354,.069756,.62932],[-.743145,.999391,-.694658,-.71934,.034899,.669131],[-.707107,1,-.707107,-.707107,0,.707107],[-.669131,.999391,-.71934,-.694658,-.034899,.743145],[-.62932,.997564,-.731354,-.681998,-.069756,.777146],[-.587785,.994522,-.743145,-.669131,-.104528,.809017],[-.544639,.990268,-.75471,-.656059,-.139173,.838671],[-.5,.984808,-.766044,-.642788,-.173648,.866025],[-.45399,.978148,-.777146,-.62932,-.207912,.891007],[-.406737,.970296,-.788011,-.615661,-.241922,.913545],[-.358368,.961262,-.798636,-.601815,-.275637,.93358],[-.309017,.951057,-.809017,-.587785,-.309017,.951057],[-.258819,.939693,-.819152,-.573576,-.34202,.965926],[-.207912,.927184,-.829038,-.559193,-.374607,.978148],[-.156434,.913545,-.838671,-.544639,-.406737,.987688],[-.104528,.898794,-.848048,-.529919,-.438371,.994522],[-.052336,.882948,-.857167,-.515038,-.469472,.99863],[-0,.866025,-.866025,-.5,-.5,1],[.052336,.848048,-.87462,-.48481,-.529919,.99863],[.104528,.829038,-.882948,-.469472,-.559193,.994522],[.156434,.809017,-.891007,-.45399,-.587785,.987688],[.207912,.788011,-.898794,-.438371,-.615661,.978148],[.258819,.766044,-.906308,-.422618,-.642788,.965926],[.309017,.743145,-.913545,-.406737,-.669131,.951057],[.358368,.71934,-.920505,-.390731,-.694658,.93358],[.406737,.694658,-.927184,-.374607,-.71934,.913545],[.45399,.669131,-.93358,-.358368,-.743145,.891007],[.5,.642788,-.939693,-.34202,-.766044,.866025],[.544639,.615661,-.945519,-.325568,-.788011,.838671],[.587785,.587785,-.951057,-.309017,-.809017,.809017],[.62932,.559193,-.956305,-.292372,-.829038,.777146],[.669131,.529919,-.961262,-.275637,-.848048,.743145],[.707107,.5,-.965926,-.258819,-.866025,.707107],[.743145,.469472,-.970296,-.241922,-.882948,.669131],[.777146,.438371,-.97437,-.224951,-.898794,.62932],[.809017,.406737,-.978148,-.207912,-.913545,.587785],[.838671,.374607,-.981627,-.190809,-.927184,.544639],[.866025,.34202,-.984808,-.173648,-.939693,.5],[.891007,.309017,-.987688,-.156434,-.951057,.45399],[.913545,.275637,-.990268,-.139173,-.961262,.406737],[.93358,.241922,-.992546,-.121869,-.970296,.358368],[.951057,.207912,-.994522,-.104528,-.978148,.309017],[.965926,.173648,-.996195,-.087156,-.984808,.258819],[.978148,.139173,-.997564,-.069756,-.990268,.207912],[.987688,.104528,-.99863,-.052336,-.994522,.156434],[.994522,.069756,-.999391,-.034899,-.997564,.104528],[.99863,.034899,-.999848,-.017452,-.999391,.052336],[1,0,-1,-0,-1,0],[.99863,-.034899,-.999848,.017452,-.999391,-.052336],[.994522,-.069756,-.999391,.034899,-.997564,-.104528],[.987688,-.104528,-.99863,.052336,-.994522,-.156434],[.978148,-.139173,-.997564,.069756,-.990268,-.207912],[.965926,-.173648,-.996195,.087156,-.984808,-.258819],[.951057,-.207912,-.994522,.104528,-.978148,-.309017],[.93358,-.241922,-.992546,.121869,-.970296,-.358368],[.913545,-.275637,-.990268,.139173,-.961262,-.406737],[.891007,-.309017,-.987688,.156434,-.951057,-.45399],[.866025,-.34202,-.984808,.173648,-.939693,-.5],[.838671,-.374607,-.981627,.190809,-.927184,-.544639],[.809017,-.406737,-.978148,.207912,-.913545,-.587785],[.777146,-.438371,-.97437,.224951,-.898794,-.62932],[.743145,-.469472,-.970296,.241922,-.882948,-.669131],[.707107,-.5,-.965926,.258819,-.866025,-.707107],[.669131,-.529919,-.961262,.275637,-.848048,-.743145],[.62932,-.559193,-.956305,.292372,-.829038,-.777146],[.587785,-.587785,-.951057,.309017,-.809017,-.809017],[.544639,-.615661,-.945519,.325568,-.788011,-.838671],[.5,-.642788,-.939693,.34202,-.766044,-.866025],[.45399,-.669131,-.93358,.358368,-.743145,-.891007],[.406737,-.694658,-.927184,.374607,-.71934,-.913545],[.358368,-.71934,-.920505,.390731,-.694658,-.93358],[.309017,-.743145,-.913545,.406737,-.669131,-.951057],[.258819,-.766044,-.906308,.422618,-.642788,-.965926],[.207912,-.788011,-.898794,.438371,-.615661,-.978148],[.156434,-.809017,-.891007,.45399,-.587785,-.987688],[.104528,-.829038,-.882948,.469472,-.559193,-.994522],[.052336,-.848048,-.87462,.48481,-.529919,-.99863],[0,-.866025,-.866025,.5,-.5,-1],[-.052336,-.882948,-.857167,.515038,-.469472,-.99863],[-.104528,-.898794,-.848048,.529919,-.438371,-.994522],[-.156434,-.913545,-.838671,.544639,-.406737,-.987688],[-.207912,-.927184,-.829038,.559193,-.374607,-.978148],[-.258819,-.939693,-.819152,.573576,-.34202,-.965926],[-.309017,-.951057,-.809017,.587785,-.309017,-.951057],[-.358368,-.961262,-.798636,.601815,-.275637,-.93358],[-.406737,-.970296,-.788011,.615661,-.241922,-.913545],[-.45399,-.978148,-.777146,.62932,-.207912,-.891007],[-.5,-.984808,-.766044,.642788,-.173648,-.866025],[-.544639,-.990268,-.75471,.656059,-.139173,-.838671],[-.587785,-.994522,-.743145,.669131,-.104528,-.809017],[-.62932,-.997564,-.731354,.681998,-.069756,-.777146],[-.669131,-.999391,-.71934,.694658,-.034899,-.743145],[-.707107,-1,-.707107,.707107,-0,-.707107],[-.743145,-.999391,-.694658,.71934,.034899,-.669131],[-.777146,-.997564,-.681998,.731354,.069756,-.62932],[-.809017,-.994522,-.669131,.743145,.104528,-.587785],[-.838671,-.990268,-.656059,.75471,.139173,-.544639],[-.866025,-.984808,-.642788,.766044,.173648,-.5],[-.891007,-.978148,-.62932,.777146,.207912,-.45399],[-.913545,-.970296,-.615661,.788011,.241922,-.406737],[-.93358,-.961262,-.601815,.798636,.275637,-.358368],[-.951057,-.951057,-.587785,.809017,.309017,-.309017],[-.965926,-.939693,-.573576,.819152,.34202,-.258819],[-.978148,-.927184,-.559193,.829038,.374607,-.207912],[-.987688,-.913545,-.544639,.838671,.406737,-.156434],[-.994522,-.898794,-.529919,.848048,.438371,-.104528],[-.99863,-.882948,-.515038,.857167,.469472,-.052336],[-1,-.866025,-.5,.866025,.5,-0],[-.99863,-.848048,-.48481,.87462,.529919,.052336],[-.994522,-.829038,-.469472,.882948,.559193,.104528],[-.987688,-.809017,-.45399,.891007,.587785,.156434],[-.978148,-.788011,-.438371,.898794,.615661,.207912],[-.965926,-.766044,-.422618,.906308,.642788,.258819],[-.951057,-.743145,-.406737,.913545,.669131,.309017],[-.93358,-.71934,-.390731,.920505,.694658,.358368],[-.913545,-.694658,-.374607,.927184,.71934,.406737],[-.891007,-.669131,-.358368,.93358,.743145,.45399],[-.866025,-.642788,-.34202,.939693,.766044,.5],[-.838671,-.615661,-.325568,.945519,.788011,.544639],[-.809017,-.587785,-.309017,.951057,.809017,.587785],[-.777146,-.559193,-.292372,.956305,.829038,.62932],[-.743145,-.529919,-.275637,.961262,.848048,.669131],[-.707107,-.5,-.258819,.965926,.866025,.707107],[-.669131,-.469472,-.241922,.970296,.882948,.743145],[-.62932,-.438371,-.224951,.97437,.898794,.777146],[-.587785,-.406737,-.207912,.978148,.913545,.809017],[-.544639,-.374607,-.190809,.981627,.927184,.838671],[-.5,-.34202,-.173648,.984808,.939693,.866025],[-.45399,-.309017,-.156434,.987688,.951057,.891007],[-.406737,-.275637,-.139173,.990268,.961262,.913545],[-.358368,-.241922,-.121869,.992546,.970296,.93358],[-.309017,-.207912,-.104528,.994522,.978148,.951057],[-.258819,-.173648,-.087156,.996195,.984808,.965926],[-.207912,-.139173,-.069756,.997564,.990268,.978148],[-.156434,-.104528,-.052336,.99863,.994522,.987688],[-.104528,-.069756,-.034899,.999391,.997564,.994522],[-.052336,-.034899,-.017452,.999848,.999391,.99863]],[[-1,-0,1,-0,0,-1,-0,0,-0],[-.999848,.017452,.999543,-.030224,264e-6,-.999086,.042733,-59e-5,4e-6],[-.999391,.034899,.998173,-.060411,.001055,-.996348,.085356,-.002357,34e-6],[-.99863,.052336,.995891,-.090524,.002372,-.991791,.127757,-.005297,113e-6],[-.997564,.069756,.992701,-.120527,.004214,-.985429,.169828,-.0094,268e-6],[-.996195,.087156,.988606,-.150384,.006578,-.977277,.21146,-.014654,523e-6],[-.994522,.104528,.983611,-.180057,.009462,-.967356,.252544,-.021043,903e-6],[-.992546,.121869,.977722,-.209511,.012862,-.955693,.292976,-.028547,.001431],[-.990268,.139173,.970946,-.238709,.016774,-.942316,.332649,-.037143,.002131],[-.987688,.156434,.963292,-.267617,.021193,-.927262,.371463,-.046806,.003026],[-.984808,.173648,.954769,-.296198,.026114,-.910569,.409317,-.057505,.00414],[-.981627,.190809,.945388,-.324419,.03153,-.892279,.446114,-.069209,.005492],[-.978148,.207912,.935159,-.352244,.037436,-.872441,.481759,-.08188,.007105],[-.97437,.224951,.924096,-.379641,.043823,-.851105,.516162,-.095481,.008999],[-.970296,.241922,.912211,-.406574,.050685,-.828326,.549233,-.109969,.011193],[-.965926,.258819,.899519,-.433013,.058013,-.804164,.580889,-.1253,.013707],[-.961262,.275637,.886036,-.458924,.065797,-.77868,.61105,-.141427,.016556],[-.956305,.292372,.871778,-.484275,.074029,-.75194,.639639,-.158301,.019758],[-.951057,.309017,.856763,-.509037,.082698,-.724012,.666583,-.175868,.023329],[-.945519,.325568,.841008,-.533178,.091794,-.694969,.691816,-.194075,.027281],[-.939693,.34202,.824533,-.55667,.101306,-.664885,.715274,-.212865,.03163],[-.93358,.358368,.807359,-.579484,.111222,-.633837,.736898,-.23218,.036385],[-.927184,.374607,.789505,-.601592,.121529,-.601904,.756637,-.25196,.041559],[-.920505,.390731,.770994,-.622967,.132217,-.569169,.774442,-.272143,.04716],[-.913545,.406737,.751848,-.643582,.143271,-.535715,.79027,-.292666,.053196],[-.906308,.422618,.732091,-.663414,.154678,-.501627,.804083,-.313464,.059674],[-.898794,.438371,.711746,-.682437,.166423,-.466993,.81585,-.334472,.066599],[-.891007,.45399,.690839,-.700629,.178494,-.431899,.825544,-.355623,.073974],[-.882948,.469472,.669395,-.717968,.190875,-.396436,.833145,-.376851,.081803],[-.87462,.48481,.647439,-.734431,.203551,-.360692,.838638,-.398086,.090085],[-.866025,.5,.625,-.75,.216506,-.32476,.842012,-.419263,.098821],[-.857167,.515038,.602104,-.764655,.229726,-.288728,.843265,-.440311,.108009],[-.848048,.529919,.578778,-.778378,.243192,-.252688,.842399,-.461164,.117644],[-.838671,.544639,.555052,-.791154,.256891,-.21673,.839422,-.481753,.127722],[-.829038,.559193,.530955,-.802965,.270803,-.180944,.834347,-.502011,.138237],[-.819152,.573576,.506515,-.813798,.284914,-.14542,.827194,-.521871,.149181],[-.809017,.587785,.481763,-.823639,.299204,-.110246,.817987,-.541266,.160545],[-.798636,.601815,.456728,-.832477,.313658,-.075508,.806757,-.560132,.172317],[-.788011,.615661,.431441,-.840301,.328257,-.041294,.793541,-.578405,.184487],[-.777146,.62932,.405934,-.847101,.342984,-.007686,.778379,-.596021,.19704],[-.766044,.642788,.380236,-.852869,.357821,.025233,.761319,-.612921,.209963],[-.75471,.656059,.35438,-.857597,.372749,.057383,.742412,-.629044,.223238],[-.743145,.669131,.328396,-.861281,.387751,.088686,.721714,-.644334,.23685],[-.731354,.681998,.302317,-.863916,.402807,.119068,.699288,-.658734,.250778],[-.71934,.694658,.276175,-.865498,.417901,.148454,.675199,-.67219,.265005],[-.707107,.707107,.25,-.866025,.433013,.176777,.649519,-.684653,.279508],[-.694658,.71934,.223825,-.865498,.448125,.203969,.622322,-.696073,.294267],[-.681998,.731354,.197683,-.863916,.463218,.229967,.593688,-.706405,.309259],[-.669131,.743145,.171604,-.861281,.478275,.254712,.5637,-.715605,.324459],[-.656059,.75471,.14562,-.857597,.493276,.278147,.532443,-.723633,.339844],[-.642788,.766044,.119764,-.852869,.508205,.300221,.500009,-.730451,.355387],[-.62932,.777146,.094066,-.847101,.523041,.320884,.46649,-.736025,.371063],[-.615661,.788011,.068559,-.840301,.537768,.340093,.431982,-.740324,.386845],[-.601815,.798636,.043272,-.832477,.552367,.357807,.396584,-.74332,.402704],[-.587785,.809017,.018237,-.823639,.566821,.373991,.360397,-.744989,.418613],[-.573576,.819152,-.006515,-.813798,.581112,.388612,.323524,-.745308,.434544],[-.559193,.829038,-.030955,-.802965,.595222,.401645,.286069,-.744262,.450467],[-.544639,.838671,-.055052,-.791154,.609135,.413066,.24814,-.741835,.466352],[-.529919,.848048,-.078778,-.778378,.622833,.422856,.209843,-.738017,.482171],[-.515038,.857167,-.102104,-.764655,.6363,.431004,.171288,-.732801,.497894],[-.5,.866025,-.125,-.75,.649519,.4375,.132583,-.726184,.51349],[-.48481,.87462,-.147439,-.734431,.662474,.44234,.093837,-.718167,.528929],[-.469472,.882948,-.169395,-.717968,.67515,.445524,.05516,-.708753,.544183],[-.45399,.891007,-.190839,-.700629,.687531,.447059,.016662,-.69795,.55922],[-.438371,.898794,-.211746,-.682437,.699602,.446953,-.02155,-.685769,.574011],[-.422618,.906308,-.232091,-.663414,.711348,.445222,-.059368,-.672226,.588528],[-.406737,.913545,-.251848,-.643582,.722755,.441884,-.096684,-.657339,.602741],[-.390731,.920505,-.270994,-.622967,.733809,.436964,-.133395,-.64113,.616621],[-.374607,.927184,-.289505,-.601592,.744496,.430488,-.169397,-.623624,.630141],[-.358368,.93358,-.307359,-.579484,.754804,.422491,-.204589,-.604851,.643273],[-.34202,.939693,-.324533,-.55667,.76472,.413008,-.238872,-.584843,.65599],[-.325568,.945519,-.341008,-.533178,.774231,.402081,-.27215,-.563635,.668267],[-.309017,.951057,-.356763,-.509037,.783327,.389754,-.304329,-.541266,.680078],[-.292372,.956305,-.371778,-.484275,.791997,.376077,-.335319,-.517778,.691399],[-.275637,.961262,-.386036,-.458924,.800228,.361102,-.365034,-.493216,.702207],[-.258819,.965926,-.399519,-.433013,.808013,.344885,-.393389,-.467627,.712478],[-.241922,.970296,-.412211,-.406574,.81534,.327486,-.420306,-.441061,.722191],[-.224951,.97437,-.424096,-.379641,.822202,.308969,-.445709,-.413572,.731327],[-.207912,.978148,-.435159,-.352244,.828589,.289399,-.469527,-.385215,.739866],[-.190809,.981627,-.445388,-.324419,.834495,.268846,-.491693,-.356047,.74779],[-.173648,.984808,-.454769,-.296198,.839912,.247382,-.512145,-.326129,.755082],[-.156434,.987688,-.463292,-.267617,.844832,.225081,-.530827,-.295521,.761728],[-.139173,.990268,-.470946,-.238709,.849251,.20202,-.547684,-.264287,.767712],[-.121869,.992546,-.477722,-.209511,.853163,.178279,-.562672,-.232494,.773023],[-.104528,.994522,-.483611,-.180057,.856563,.153937,-.575747,-.200207,.777648],[-.087156,.996195,-.488606,-.150384,.859447,.129078,-.586872,-.167494,.781579],[-.069756,.997564,-.492701,-.120527,.861811,.103786,-.596018,-.134426,.784806],[-.052336,.99863,-.495891,-.090524,.863653,.078146,-.603158,-.101071,.787324],[-.034899,.999391,-.498173,-.060411,.864971,.052243,-.608272,-.0675,.789126],[-.017452,.999848,-.499543,-.030224,.865762,.026165,-.611347,-.033786,.790208],[0,1,-.5,0,.866025,-0,-.612372,0,.790569],[.017452,.999848,-.499543,.030224,.865762,-.026165,-.611347,.033786,.790208],[.034899,.999391,-.498173,.060411,.864971,-.052243,-.608272,.0675,.789126],[.052336,.99863,-.495891,.090524,.863653,-.078146,-.603158,.101071,.787324],[.069756,.997564,-.492701,.120527,.861811,-.103786,-.596018,.134426,.784806],[.087156,.996195,-.488606,.150384,.859447,-.129078,-.586872,.167494,.781579],[.104528,.994522,-.483611,.180057,.856563,-.153937,-.575747,.200207,.777648],[.121869,.992546,-.477722,.209511,.853163,-.178279,-.562672,.232494,.773023],[.139173,.990268,-.470946,.238709,.849251,-.20202,-.547684,.264287,.767712],[.156434,.987688,-.463292,.267617,.844832,-.225081,-.530827,.295521,.761728],[.173648,.984808,-.454769,.296198,.839912,-.247382,-.512145,.326129,.755082],[.190809,.981627,-.445388,.324419,.834495,-.268846,-.491693,.356047,.74779],[.207912,.978148,-.435159,.352244,.828589,-.289399,-.469527,.385215,.739866],[.224951,.97437,-.424096,.379641,.822202,-.308969,-.445709,.413572,.731327],[.241922,.970296,-.412211,.406574,.81534,-.327486,-.420306,.441061,.722191],[.258819,.965926,-.399519,.433013,.808013,-.344885,-.393389,.467627,.712478],[.275637,.961262,-.386036,.458924,.800228,-.361102,-.365034,.493216,.702207],[.292372,.956305,-.371778,.484275,.791997,-.376077,-.335319,.517778,.691399],[.309017,.951057,-.356763,.509037,.783327,-.389754,-.304329,.541266,.680078],[.325568,.945519,-.341008,.533178,.774231,-.402081,-.27215,.563635,.668267],[.34202,.939693,-.324533,.55667,.76472,-.413008,-.238872,.584843,.65599],[.358368,.93358,-.307359,.579484,.754804,-.422491,-.204589,.604851,.643273],[.374607,.927184,-.289505,.601592,.744496,-.430488,-.169397,.623624,.630141],[.390731,.920505,-.270994,.622967,.733809,-.436964,-.133395,.64113,.616621],[.406737,.913545,-.251848,.643582,.722755,-.441884,-.096684,.657339,.602741],[.422618,.906308,-.232091,.663414,.711348,-.445222,-.059368,.672226,.588528],[.438371,.898794,-.211746,.682437,.699602,-.446953,-.02155,.685769,.574011],[.45399,.891007,-.190839,.700629,.687531,-.447059,.016662,.69795,.55922],[.469472,.882948,-.169395,.717968,.67515,-.445524,.05516,.708753,.544183],[.48481,.87462,-.147439,.734431,.662474,-.44234,.093837,.718167,.528929],[.5,.866025,-.125,.75,.649519,-.4375,.132583,.726184,.51349],[.515038,.857167,-.102104,.764655,.6363,-.431004,.171288,.732801,.497894],[.529919,.848048,-.078778,.778378,.622833,-.422856,.209843,.738017,.482171],[.544639,.838671,-.055052,.791154,.609135,-.413066,.24814,.741835,.466352],[.559193,.829038,-.030955,.802965,.595222,-.401645,.286069,.744262,.450467],[.573576,.819152,-.006515,.813798,.581112,-.388612,.323524,.745308,.434544],[.587785,.809017,.018237,.823639,.566821,-.373991,.360397,.744989,.418613],[.601815,.798636,.043272,.832477,.552367,-.357807,.396584,.74332,.402704],[.615661,.788011,.068559,.840301,.537768,-.340093,.431982,.740324,.386845],[.62932,.777146,.094066,.847101,.523041,-.320884,.46649,.736025,.371063],[.642788,.766044,.119764,.852869,.508205,-.300221,.500009,.730451,.355387],[.656059,.75471,.14562,.857597,.493276,-.278147,.532443,.723633,.339844],[.669131,.743145,.171604,.861281,.478275,-.254712,.5637,.715605,.324459],[.681998,.731354,.197683,.863916,.463218,-.229967,.593688,.706405,.309259],[.694658,.71934,.223825,.865498,.448125,-.203969,.622322,.696073,.294267],[.707107,.707107,.25,.866025,.433013,-.176777,.649519,.684653,.279508],[.71934,.694658,.276175,.865498,.417901,-.148454,.675199,.67219,.265005],[.731354,.681998,.302317,.863916,.402807,-.119068,.699288,.658734,.250778],[.743145,.669131,.328396,.861281,.387751,-.088686,.721714,.644334,.23685],[.75471,.656059,.35438,.857597,.372749,-.057383,.742412,.629044,.223238],[.766044,.642788,.380236,.852869,.357821,-.025233,.761319,.612921,.209963],[.777146,.62932,.405934,.847101,.342984,.007686,.778379,.596021,.19704],[.788011,.615661,.431441,.840301,.328257,.041294,.793541,.578405,.184487],[.798636,.601815,.456728,.832477,.313658,.075508,.806757,.560132,.172317],[.809017,.587785,.481763,.823639,.299204,.110246,.817987,.541266,.160545],[.819152,.573576,.506515,.813798,.284914,.14542,.827194,.521871,.149181],[.829038,.559193,.530955,.802965,.270803,.180944,.834347,.502011,.138237],[.838671,.544639,.555052,.791154,.256891,.21673,.839422,.481753,.127722],[.848048,.529919,.578778,.778378,.243192,.252688,.842399,.461164,.117644],[.857167,.515038,.602104,.764655,.229726,.288728,.843265,.440311,.108009],[.866025,.5,.625,.75,.216506,.32476,.842012,.419263,.098821],[.87462,.48481,.647439,.734431,.203551,.360692,.838638,.398086,.090085],[.882948,.469472,.669395,.717968,.190875,.396436,.833145,.376851,.081803],[.891007,.45399,.690839,.700629,.178494,.431899,.825544,.355623,.073974],[.898794,.438371,.711746,.682437,.166423,.466993,.81585,.334472,.066599],[.906308,.422618,.732091,.663414,.154678,.501627,.804083,.313464,.059674],[.913545,.406737,.751848,.643582,.143271,.535715,.79027,.292666,.053196],[.920505,.390731,.770994,.622967,.132217,.569169,.774442,.272143,.04716],[.927184,.374607,.789505,.601592,.121529,.601904,.756637,.25196,.041559],[.93358,.358368,.807359,.579484,.111222,.633837,.736898,.23218,.036385],[.939693,.34202,.824533,.55667,.101306,.664885,.715274,.212865,.03163],[.945519,.325568,.841008,.533178,.091794,.694969,.691816,.194075,.027281],[.951057,.309017,.856763,.509037,.082698,.724012,.666583,.175868,.023329],[.956305,.292372,.871778,.484275,.074029,.75194,.639639,.158301,.019758],[.961262,.275637,.886036,.458924,.065797,.77868,.61105,.141427,.016556],[.965926,.258819,.899519,.433013,.058013,.804164,.580889,.1253,.013707],[.970296,.241922,.912211,.406574,.050685,.828326,.549233,.109969,.011193],[.97437,.224951,.924096,.379641,.043823,.851105,.516162,.095481,.008999],[.978148,.207912,.935159,.352244,.037436,.872441,.481759,.08188,.007105],[.981627,.190809,.945388,.324419,.03153,.892279,.446114,.069209,.005492],[.984808,.173648,.954769,.296198,.026114,.910569,.409317,.057505,.00414],[.987688,.156434,.963292,.267617,.021193,.927262,.371463,.046806,.003026],[.990268,.139173,.970946,.238709,.016774,.942316,.332649,.037143,.002131],[.992546,.121869,.977722,.209511,.012862,.955693,.292976,.028547,.001431],[.994522,.104528,.983611,.180057,.009462,.967356,.252544,.021043,903e-6],[.996195,.087156,.988606,.150384,.006578,.977277,.21146,.014654,523e-6],[.997564,.069756,.992701,.120527,.004214,.985429,.169828,.0094,268e-6],[.99863,.052336,.995891,.090524,.002372,.991791,.127757,.005297,113e-6],[.999391,.034899,.998173,.060411,.001055,.996348,.085356,.002357,34e-6],[.999848,.017452,.999543,.030224,264e-6,.999086,.042733,59e-5,4e-6],[1,-0,1,-0,0,1,-0,0,-0]]],t.SPHERICAL_HARMONICS_AZIMUTH_RESOLUTION=t.SPHERICAL_HARMONICS[0].length,t.SPHERICAL_HARMONICS_ELEVATION_RESOLUTION=t.SPHERICAL_HARMONICS[1].length,t.SPHERICAL_HARMONICS_MAX_ORDER=t.SPHERICAL_HARMONICS[0][0].length/2,t.MAX_RE_WEIGHTS=[[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1.003236,1.002156,.999152,.990038],[1.03237,1.021194,.990433,.898572],[1.062694,1.040231,.979161,.799806],[1.093999,1.058954,.964976,.693603],[1.126003,1.077006,.947526,.57989],[1.158345,1.093982,.926474,.45869],[1.19059,1.109437,.901512,.330158],[1.222228,1.12289,.87237,.194621],[1.252684,1.133837,.838839,.052614],[1.281987,1.142358,.801199,0],[1.312073,1.150207,.760839,0],[1.343011,1.157424,.717799,0],[1.374649,1.163859,.671999,0],[1.406809,1.169354,.623371,0],[1.439286,1.173739,.571868,0],[1.471846,1.176837,.517465,0],[1.504226,1.178465,.460174,0],[1.536133,1.178438,.400043,0],[1.567253,1.176573,.337165,0],[1.597247,1.172695,.271688,0],[1.625766,1.166645,.203815,0],[1.652455,1.158285,.133806,0],[1.676966,1.147506,.061983,0],[1.699006,1.134261,0,0],[1.720224,1.119789,0,0],[1.741631,1.10481,0,0],[1.763183,1.08933,0,0],[1.784837,1.073356,0,0],[1.806548,1.056898,0,0],[1.828269,1.039968,0,0],[1.849952,1.02258,0,0],[1.871552,1.004752,0,0],[1.893018,.986504,0,0],[1.914305,.967857,0,0],[1.935366,.948837,0,0],[1.956154,.929471,0,0],[1.976625,.90979,0,0],[1.996736,.889823,0,0],[2.016448,.869607,0,0],[2.035721,.849175,0,0],[2.054522,.828565,0,0],[2.072818,.807816,0,0],[2.090581,.786964,0,0],[2.107785,.766051,0,0],[2.124411,.745115,0,0],[2.140439,.724196,0,0],[2.155856,.703332,0,0],[2.170653,.682561,0,0],[2.184823,.661921,0,0],[2.198364,.641445,0,0],[2.211275,.621169,0,0],[2.223562,.601125,0,0],[2.23523,.581341,0,0],[2.246289,.561847,0,0],[2.256751,.542667,0,0],[2.266631,.523826,0,0],[2.275943,.505344,0,0],[2.284707,.487239,0,0],[2.292939,.469528,0,0],[2.300661,.452225,0,0],[2.307892,.435342,0,0],[2.314654,.418888,0,0],[2.320969,.40287,0,0],[2.326858,.387294,0,0],[2.332343,.372164,0,0],[2.337445,.357481,0,0],[2.342186,.343246,0,0],[2.346585,.329458,0,0],[2.350664,.316113,0,0],[2.354442,.303208,0,0],[2.357937,.290738,0,0],[2.361168,.278698,0,0],[2.364152,.26708,0,0],[2.366906,.255878,0,0],[2.369446,.245082,0,0],[2.371786,.234685,0,0],[2.37394,.224677,0,0],[2.375923,.215048,0,0],[2.377745,.20579,0,0],[2.379421,.196891,0,0],[2.380959,.188342,0,0],[2.382372,.180132,0,0],[2.383667,.172251,0,0],[2.384856,.164689,0,0],[2.385945,.157435,0,0],[2.386943,.150479,0,0],[2.387857,.143811,0,0],[2.388694,.137421,0,0],[2.38946,.131299,0,0],[2.39016,.125435,0,0],[2.390801,.11982,0,0],[2.391386,.114445,0,0],[2.391921,.1093,0,0],[2.39241,.104376,0,0],[2.392857,.099666,0,0],[2.393265,.09516,0,0],[2.393637,.090851,0,0],[2.393977,.086731,0,0],[2.394288,.082791,0,0],[2.394571,.079025,0,0],[2.394829,.075426,0,0],[2.395064,.071986,0,0],[2.395279,.068699,0,0],[2.395475,.065558,0,0],[2.395653,.062558,0,0],[2.395816,.059693,0,0],[2.395964,.056955,0,0],[2.396099,.054341,0,0],[2.396222,.051845,0,0],[2.396334,.049462,0,0],[2.396436,.047186,0,0],[2.396529,.045013,0,0],[2.396613,.042939,0,0],[2.396691,.040959,0,0],[2.396761,.039069,0,0],[2.396825,.037266,0,0],[2.396883,.035544,0,0],[2.396936,.033901,0,0],[2.396984,.032334,0,0],[2.397028,.030838,0,0],[2.397068,.02941,0,0],[2.397104,.028048,0,0],[2.397137,.026749,0,0],[2.397167,.025509,0,0],[2.397194,.024326,0,0],[2.397219,.023198,0,0],[2.397242,.022122,0,0],[2.397262,.021095,0,0],[2.397281,.020116,0,0],[2.397298,.019181,0,0],[2.397314,.01829,0,0],[2.397328,.017441,0,0],[2.397341,.01663,0,0],[2.397352,.015857,0,0],[2.397363,.015119,0,0],[2.397372,.014416,0,0],[2.397381,.013745,0,0],[2.397389,.013106,0,0],[2.397396,.012496,0,0],[2.397403,.011914,0,0],[2.397409,.01136,0,0],[2.397414,.010831,0,0],[2.397419,.010326,0,0],[2.397424,.009845,0,0],[2.397428,.009387,0,0],[2.397432,.008949,0,0],[2.397435,.008532,0,0],[2.397438,.008135,0,0],[2.397441,.007755,0,0],[2.397443,.007394,0,0],[2.397446,.007049,0,0],[2.397448,.006721,0,0],[2.39745,.006407,0,0],[2.397451,.006108,0,0],[2.397453,.005824,0,0],[2.397454,.005552,0,0],[2.397456,.005293,0,0],[2.397457,.005046,0,0],[2.397458,.004811,0,0],[2.397459,.004586,0,0],[2.39746,.004372,0,0],[2.397461,.004168,0,0],[2.397461,.003974,0,0],[2.397462,.003788,0,0],[2.397463,.003611,0,0],[2.397463,.003443,0,0],[2.397464,.003282,0,0],[2.397464,.003129,0,0],[2.397465,.002983,0,0],[2.397465,.002844,0,0],[2.397465,.002711,0,0],[2.397466,.002584,0,0],[2.397466,.002464,0,0],[2.397466,.002349,0,0],[2.397466,.002239,0,0],[2.397467,.002135,0,0],[2.397467,.002035,0,0],[2.397467,.00194,0,0],[2.397467,.001849,0,0],[2.397467,.001763,0,0],[2.397467,.001681,0,0],[2.397468,.001602,0,0],[2.397468,.001527,0,0],[2.397468,.001456,0,0],[2.397468,.001388,0,0],[2.397468,.001323,0,0],[2.397468,.001261,0,0],[2.397468,.001202,0,0],[2.397468,.001146,0,0],[2.397468,.001093,0,0],[2.397468,.001042,0,0],[2.397468,993e-6,0,0],[2.397468,947e-6,0,0],[2.397468,902e-6,0,0],[2.397468,86e-5,0,0],[2.397468,82e-5,0,0],[2.397469,782e-6,0,0],[2.397469,745e-6,0,0],[2.397469,71e-5,0,0],[2.397469,677e-6,0,0],[2.397469,646e-6,0,0],[2.397469,616e-6,0,0],[2.397469,587e-6,0,0],[2.397469,559e-6,0,0],[2.397469,533e-6,0,0],[2.397469,508e-6,0,0],[2.397469,485e-6,0,0],[2.397469,462e-6,0,0],[2.397469,44e-5,0,0],[2.397469,42e-5,0,0],[2.397469,4e-4,0,0],[2.397469,381e-6,0,0],[2.397469,364e-6,0,0],[2.397469,347e-6,0,0],[2.397469,33e-5,0,0],[2.397469,315e-6,0,0],[2.397469,3e-4,0,0],[2.397469,286e-6,0,0],[2.397469,273e-6,0,0],[2.397469,26e-5,0,0],[2.397469,248e-6,0,0],[2.397469,236e-6,0,0],[2.397469,225e-6,0,0],[2.397469,215e-6,0,0],[2.397469,205e-6,0,0],[2.397469,195e-6,0,0],[2.397469,186e-6,0,0],[2.397469,177e-6,0,0],[2.397469,169e-6,0,0],[2.397469,161e-6,0,0],[2.397469,154e-6,0,0],[2.397469,147e-6,0,0],[2.397469,14e-5,0,0],[2.397469,133e-6,0,0],[2.397469,127e-6,0,0],[2.397469,121e-6,0,0],[2.397469,115e-6,0,0],[2.397469,11e-5,0,0],[2.397469,105e-6,0,0],[2.397469,1e-4,0,0],[2.397469,95e-6,0,0],[2.397469,91e-6,0,0],[2.397469,87e-6,0,0],[2.397469,83e-6,0,0],[2.397469,79e-6,0,0],[2.397469,75e-6,0,0],[2.397469,71e-6,0,0],[2.397469,68e-6,0,0],[2.397469,65e-6,0,0],[2.397469,62e-6,0,0],[2.397469,59e-6,0,0],[2.397469,56e-6,0,0],[2.397469,54e-6,0,0],[2.397469,51e-6,0,0],[2.397469,49e-6,0,0],[2.397469,46e-6,0,0],[2.397469,44e-6,0,0],[2.397469,42e-6,0,0],[2.397469,4e-5,0,0],[2.397469,38e-6,0,0],[2.397469,37e-6,0,0],[2.397469,35e-6,0,0],[2.397469,33e-6,0,0],[2.397469,32e-6,0,0],[2.397469,3e-5,0,0],[2.397469,29e-6,0,0],[2.397469,27e-6,0,0],[2.397469,26e-6,0,0],[2.397469,25e-6,0,0],[2.397469,24e-6,0,0],[2.397469,23e-6,0,0],[2.397469,22e-6,0,0],[2.397469,21e-6,0,0],[2.397469,2e-5,0,0],[2.397469,19e-6,0,0],[2.397469,18e-6,0,0],[2.397469,17e-6,0,0],[2.397469,16e-6,0,0],[2.397469,15e-6,0,0],[2.397469,15e-6,0,0],[2.397469,14e-6,0,0],[2.397469,13e-6,0,0],[2.397469,13e-6,0,0],[2.397469,12e-6,0,0],[2.397469,12e-6,0,0],[2.397469,11e-6,0,0],[2.397469,11e-6,0,0],[2.397469,1e-5,0,0],[2.397469,1e-5,0,0],[2.397469,9e-6,0,0],[2.397469,9e-6,0,0],[2.397469,8e-6,0,0],[2.397469,8e-6,0,0],[2.397469,8e-6,0,0],[2.397469,7e-6,0,0],[2.397469,7e-6,0,0],[2.397469,7e-6,0,0],[2.397469,6e-6,0,0],[2.397469,6e-6,0,0],[2.397469,6e-6,0,0],[2.397469,5e-6,0,0],[2.397469,5e-6,0,0],[2.397469,5e-6,0,0],[2.397469,5e-6,0,0],[2.397469,4e-6,0,0],[2.397469,4e-6,0,0],[2.397469,4e-6,0,0],[2.397469,4e-6,0,0],[2.397469,4e-6,0,0],[2.397469,4e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,3e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,2e-6,0,0],[2.397469,1e-6,0,0],[2.397469,1e-6,0,0],[2.397469,1e-6,0,0]],t.MAX_RE_WEIGHTS_RESOLUTION=t.MAX_RE_WEIGHTS.length},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(5),n=e(6),s=e(1),o=e(0);function r(A,t){void 0==t&&(t={}),void 0==t.position&&(t.position=o.DEFAULT_POSITION.slice()),void 0==t.forward&&(t.forward=o.DEFAULT_FORWARD.slice()),void 0==t.up&&(t.up=o.DEFAULT_UP.slice()),void 0==t.minDistance&&(t.minDistance=o.DEFAULT_MIN_DISTANCE),void 0==t.maxDistance&&(t.maxDistance=o.DEFAULT_MAX_DISTANCE),void 0==t.rolloff&&(t.rolloff=o.DEFAULT_ROLLOFF),void 0==t.gain&&(t.gain=o.DEFAULT_SOURCE_GAIN),void 0==t.alpha&&(t.alpha=o.DEFAULT_DIRECTIVITY_ALPHA),void 0==t.sharpness&&(t.sharpness=o.DEFAULT_DIRECTIVITY_SHARPNESS),void 0==t.sourceWidth&&(t.sourceWidth=o.DEFAULT_SOURCE_WIDTH),this._scene=A,this._position=t.position,this._forward=t.forward,this._up=t.up,this._dx=new Float32Array(3),this._right=o.crossProduct(this._forward,this._up);let e=A._context;this.input=e.createGain(),this._directivity=new i(e,{alpha:t.alpha,sharpness:t.sharpness}),this._toEarly=e.createGain(),this._toLate=e.createGain(),this._attenuation=new n(e,{minDistance:t.minDistance,maxDistance:t.maxDistance,rolloff:t.rolloff}),this._encoder=new s(e,{ambisonicOrder:A._ambisonicOrder,sourceWidth:t.sourceWidth}),this.input.connect(this._toLate),this._toLate.connect(A._room.late.input),this.input.connect(this._attenuation.input),this._attenuation.output.connect(this._toEarly),this._toEarly.connect(A._room.early.input),this._attenuation.output.connect(this._directivity.input),this._directivity.output.connect(this._encoder.input),this._encoder.output.connect(A._listener.input),this.setPosition(t.position[0],t.position[1],t.position[2]),this.input.gain.value=t.gain}r.prototype.setPosition=function(A,t,e){this._position[0]=A,this._position[1]=t,this._position[2]=e;let i=function(A){let t=1;A>o.EPSILON_FLOAT&&(t=1-A/o.SOURCE_MAX_OUTSIDE_ROOM_DISTANCE,t=Math.max(0,Math.min(1,t)));return t}(this._scene._room.getDistanceOutsideRoom(this._position[0],this._position[1],this._position[2]));this._toLate.gain.value=i,this._toEarly.gain.value=i,this._update()},r.prototype._update=function(){for(let A=0;A<3;A++)this._dx[A]=this._position[A]-this._scene._listener.position[A];let A=Math.sqrt(this._dx[0]*this._dx[0]+this._dx[1]*this._dx[1]+this._dx[2]*this._dx[2]);A>0&&(this._dx[0]/=A,this._dx[1]/=A,this._dx[2]/=A);let t=Math.atan2(-this._dx[0],this._dx[2])*o.RADIANS_TO_DEGREES,e=Math.atan2(this._dx[1],Math.sqrt(this._dx[0]*this._dx[0]+this._dx[2]*this._dx[2]))*o.RADIANS_TO_DEGREES;this._attenuation.setDistance(A),this._directivity.computeAngle(this._forward,this._dx),this._encoder.setDirection(t,e)},r.prototype.setRolloff=function(A){this._attenuation.setRolloff(A)},r.prototype.setMinDistance=function(A){this._attenuation.minDistance=A},r.prototype.setMaxDistance=function(A){this._attenuation.maxDistance=A},r.prototype.setGain=function(A){this.input.gain.value=A},r.prototype.setOrientation=function(A,t,e,i,n,s){this._forward[0]=A,this._forward[1]=t,this._forward[2]=e,this._up[0]=i,this._up[1]=n,this._up[2]=s,this._right=o.crossProduct(this._forward,this._up)},r.prototype.setFromMatrix=function(A){this._right[0]=A.elements[0],this._right[1]=A.elements[1],this._right[2]=A.elements[2],this._up[0]=A.elements[4],this._up[1]=A.elements[5],this._up[2]=A.elements[6],this._forward[0]=A.elements[8],this._forward[1]=A.elements[9],this._forward[2]=A.elements[10],this._right=o.normalizeVector(this._right),this._up=o.normalizeVector(this._up),this._forward=o.normalizeVector(this._forward),this.setPosition(A.elements[12],A.elements[13],A.elements[14])},r.prototype.setSourceWidth=function(A){this._encoder.setSourceWidth(A),this.setPosition(this._position[0],this._position[1],this._position[2])},r.prototype.setDirectivityPattern=function(A,t){this._directivity.setPattern(A,t),this.setPosition(this._position[0],this._position[1],this._position[2])},A.exports=r},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(0);function n(A,t){void 0==t&&(t={}),void 0==t.alpha&&(t.alpha=i.DEFAULT_DIRECTIVITY_ALPHA),void 0==t.sharpness&&(t.sharpness=i.DEFAULT_DIRECTIVITY_SHARPNESS),this._context=A,this._lowpass=A.createBiquadFilter(),this._lowpass.type="lowpass",this._lowpass.Q.value=0,this._lowpass.frequency.value=.5*A.sampleRate,this._cosTheta=0,this.setPattern(t.alpha,t.sharpness),this.input=this._lowpass,this.output=this._lowpass}n.prototype.computeAngle=function(A,t){let e=i.normalizeVector(A),n=i.normalizeVector(t),s=1;if(this._alpha>i.EPSILON_FLOAT){let A=e[0]*n[0]+e[1]*n[1]+e[2]*n[2];s=1-this._alpha+this._alpha*A,s=Math.pow(Math.abs(s),this._sharpness)}this._lowpass.frequency.value=.5*this._context.sampleRate*s},n.prototype.setPattern=function(A,t){this._alpha=Math.min(1,Math.max(0,A)),this._sharpness=Math.max(1,t),this.computeAngle([this._cosTheta*this._cosTheta,0,0],[1,0,0])},A.exports=n},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(0);function n(A,t){void 0==t&&(t={}),void 0==t.minDistance&&(t.minDistance=i.DEFAULT_MIN_DISTANCE),void 0==t.maxDistance&&(t.maxDistance=i.DEFAULT_MAX_DISTANCE),void 0==t.rolloff&&(t.rolloff=i.DEFAULT_ATTENUATION_ROLLOFF),this.minDistance=t.minDistance,this.maxDistance=t.maxDistance,this.setRolloff(t.rolloff),this._gainNode=A.createGain(),this.setDistance(t.maxDistance),this.input=this._gainNode,this.output=this._gainNode}n.prototype.setDistance=function(A){let t=1;if("logarithmic"==this._rolloff){if(A>this.maxDistance)t=0;else if(A>this.minDistance){let e=this.maxDistance-this.minDistance;if(e>i.EPSILON_FLOAT){let i=1/(e+1);t=(1/(A-this.minDistance+1)-i)/(1-i)}}}else if("linear"==this._rolloff)if(A>this.maxDistance)t=0;else if(A>this.minDistance){let e=this.maxDistance-this.minDistance;e>i.EPSILON_FLOAT&&(t=(this.maxDistance-A)/e)}this._gainNode.gain.value=t},n.prototype.setRolloff=function(A){let t=~i.ATTENUATION_ROLLOFFS.indexOf(A);void 0!=A&&t?A=A.toString().toLowerCase():(t||i.log('Invalid rolloff model ("'+A+'"). Using default: "'+i.DEFAULT_ATTENUATION_ROLLOFF+'".'),A=i.DEFAULT_ATTENUATION_ROLLOFF),this._rolloff=A},A.exports=n},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(8),n=e(9),s=e(0);function o(A){let t={};for(let A in s.DEFAULT_ROOM_MATERIALS)s.DEFAULT_ROOM_MATERIALS.hasOwnProperty(A)&&(t[A]=s.ROOM_MATERIAL_COEFFICIENTS[s.DEFAULT_ROOM_MATERIALS[A]]);void 0==A&&(A={},Object.assign(A,s.DEFAULT_ROOM_MATERIALS));for(let e in s.DEFAULT_ROOM_MATERIALS)s.DEFAULT_ROOM_MATERIALS.hasOwnProperty(e)&&A.hasOwnProperty(e)?A[e]in s.ROOM_MATERIAL_COEFFICIENTS?t[e]=s.ROOM_MATERIAL_COEFFICIENTS[A[e]]:s.log('Material "'+A[e]+'" on wall "'+e+'" not found. Using "'+s.DEFAULT_ROOM_MATERIALS[e]+'".'):s.log('Wall "'+e+'" is not defined. Default used.');return t}function r(A){void 0==A&&(A={});for(let t in s.DEFAULT_ROOM_DIMENSIONS)A.hasOwnProperty(t)||(A[t]=s.DEFAULT_ROOM_DIMENSIONS[t]);return A}function a(A,t,e){let i=new Float32Array(s.NUMBER_REVERB_FREQUENCY_BANDS);A=r(A),t=function(A){void 0==A&&(A={});for(let t in s.DEFAULT_ROOM_MATERIALS)A.hasOwnProperty(t)||(A[t]=s.ROOM_MATERIAL_COEFFICIENTS[s.DEFAULT_ROOM_MATERIALS[t]]);return A}(t),void 0==e&&(e=s.DEFAULT_SPEED_OF_SOUND);let n=s.TWENTY_FOUR_LOG10/e,o=A.width*A.height*A.depth;if(o<s.ROOM_MIN_VOLUME)return i;let a=A.width*A.height,c=A.width*A.depth,h=A.depth*A.height,u=2*(a+c+h);for(let A=0;A<s.NUMBER_REVERB_FREQUENCY_BANDS;A++){let e=((t.left[A]+t.right[A])*a+(t.down[A]+t.up[A])*c+(t.front[A]+t.back[A])*h)/u;i[A]=s.ROOM_EYRING_CORRECTION_COEFFICIENT*n*o/(-u*Math.log(1-e)+4*s.ROOM_AIR_ABSORPTION_COEFFICIENTS[A]*o)}return i}function c(A){let t=[];for(let e in s.DEFAULT_REFLECTION_COEFFICIENTS)if(s.DEFAULT_REFLECTION_COEFFICIENTS.hasOwnProperty(e)){t[e]=0;for(let i=0;i<s.NUMBER_REFLECTION_AVERAGING_BANDS;i++){let n=i+s.ROOM_STARTING_AVERAGING_BAND;t[e]+=A[e][n]}t[e]/=s.NUMBER_REFLECTION_AVERAGING_BANDS,t[e]=Math.sqrt(1-t[e])}return t}function h(A,t){void 0==t&&(t={}),void 0==t.listenerPosition&&(t.listenerPosition=s.DEFAULT_POSITION.slice()),void 0==t.dimensions&&(t.dimensions={},Object.assign(t.dimensions,s.DEFAULT_ROOM_DIMENSIONS)),void 0==t.materials&&(t.materials={},Object.assign(t.materials,s.DEFAULT_ROOM_MATERIALS)),void 0==t.speedOfSound&&(t.speedOfSound=s.DEFAULT_SPEED_OF_SOUND),t.dimensions=r(t.dimensions);let e=o(t.materials),h=c(e),u=a(t.dimensions,e,t.speedOfSound);this.early=new n(A,{dimensions:t.dimensions,coefficients:h,speedOfSound:t.speedOfSound,listenerPosition:t.listenerPosition}),this.late=new i(A,{durations:u}),this.speedOfSound=t.speedOfSound,this.output=A.createGain(),this.early.output.connect(this.output),this._merger=A.createChannelMerger(4),this.late.output.connect(this._merger,0,0),this._merger.connect(this.output)}h.prototype.setProperties=function(A,t){let e=o(t),i=a(A,e,this.speedOfSound);this.late.setDurations(i),this.early.speedOfSound=this.speedOfSound;let n=c(e);this.early.setRoomProperties(A,n)},h.prototype.setListenerPosition=function(A,t,e){this.early.speedOfSound=this.speedOfSound,this.early.setListenerPosition(A,t,e);let i=this.getDistanceOutsideRoom(A,t,e),n=1;i>s.EPSILON_FLOAT&&(n=1-i/s.LISTENER_MAX_OUTSIDE_ROOM_DISTANCE,n=Math.max(0,Math.min(1,n))),this.output.gain.value=n},h.prototype.getDistanceOutsideRoom=function(A,t,e){let i=Math.max(0,-this.early._halfDimensions.width-A,A-this.early._halfDimensions.width),n=Math.max(0,-this.early._halfDimensions.height-t,t-this.early._halfDimensions.height),s=Math.max(0,-this.early._halfDimensions.depth-e,e-this.early._halfDimensions.depth);return Math.sqrt(i*i+n*n+s*s)},A.exports=h},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(0);function n(A,t){void 0==t&&(t={}),void 0==t.durations&&(t.durations=i.DEFAULT_REVERB_DURATIONS.slice()),void 0==t.predelay&&(t.predelay=i.DEFAULT_REVERB_PREDELAY),void 0==t.gain&&(t.gain=i.DEFAULT_REVERB_GAIN),void 0==t.bandwidth&&(t.bandwidth=i.DEFAULT_REVERB_BANDWIDTH),void 0==t.tailonset&&(t.tailonset=i.DEFAULT_REVERB_TAIL_ONSET);let e=t.predelay/1e3;this._bandwidthCoeff=t.bandwidth*i.LOG2_DIV2,this._tailonsetSamples=t.tailonset/1e3,this._context=A,this.input=A.createGain(),this._predelay=A.createDelay(e),this._convolver=A.createConvolver(),this.output=A.createGain(),this.output.gain.value=t.gain,this._convolver.normalize=!1,this.input.connect(this._predelay),this._predelay.connect(this._convolver),this._convolver.connect(this.output),this.setDurations(t.durations)}n.prototype.setDurations=function(A){if(A.length!==i.NUMBER_REVERB_FREQUENCY_BANDS)return void i.log("Warning: invalid number of RT60 values provided to reverb.");let t=new Float32Array(i.NUMBER_REVERB_FREQUENCY_BANDS),e=this._context.sampleRate;for(let n=0;n<A.length;n++)A[n]=Math.max(0,Math.min(i.DEFAULT_REVERB_MAX_DURATION,A[n])),t[n]=Math.round(A[n]*e*i.DEFAULT_REVERB_DURATION_MULTIPLIER);let n=0;for(let A=0;A<t.length;A++)t[A]>n&&(n=t[A]);n<1&&(n=1);let s=this._context.createBuffer(1,n,e),o=s.getChannelData(0),r=new Float32Array(n);for(let A=0;A<n;A++)r[A]=2*Math.random()-1;for(let A=0;A<i.NUMBER_REVERB_FREQUENCY_BANDS;A++){let n=-i.LOG1000/t[A],s=i.TWO_PI*i.DEFAULT_REVERB_FREQUENCY_BANDS[A]/e,a=Math.sin(s),c=a*Math.sinh(this._bandwidthCoeff*s/a),h=1/(1+c),u=c*h,l=-2*Math.cos(s)*h,_=(1-c)*h,d=0,f=0;for(let e=0;e<t[A];e++){let A=r[e]*Math.exp(n*e)-l*d-_*f;o[e]+=u*(A-f),f=d,d=A}}let a=Math.round(this._tailonsetSamples);for(let A=0;A<Math.min(o.length,a);A++){let t=.5*(1-Math.cos(i.TWO_PI*A/(2*a-1)));o[A]*=t}this._convolver.buffer=s},A.exports=n},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(0);function n(A,t){void 0==t&&(t={}),void 0==t.speedOfSound&&(t.speedOfSound=i.DEFAULT_SPEED_OF_SOUND),void 0==t.listenerPosition&&(t.listenerPosition=i.DEFAULT_POSITION.slice()),void 0==t.coefficients&&(t.coefficients={},Object.assign(t.coefficients,i.DEFAULT_REFLECTION_COEFFICIENTS)),this.speedOfSound=t.speedOfSound,this.input=A.createGain(),this.output=A.createGain(),this._lowpass=A.createBiquadFilter(),this._delays={},this._gains={},this._inverters={},this._merger=A.createChannelMerger(4);for(let t in i.DEFAULT_REFLECTION_COEFFICIENTS)i.DEFAULT_REFLECTION_COEFFICIENTS.hasOwnProperty(t)&&(this._delays[t]=A.createDelay(i.MAX_DURATION),this._gains[t]=A.createGain());this._inverters.right=A.createGain(),this._inverters.down=A.createGain(),this._inverters.back=A.createGain(),this._lowpass.type="lowpass",this._lowpass.frequency.value=i.DEFAULT_REFLECTION_CUTOFF_FREQUENCY,this._lowpass.Q.value=0;for(let A in i.DEFAULT_REFLECTION_COEFFICIENTS)i.DEFAULT_REFLECTION_COEFFICIENTS.hasOwnProperty(A)&&(this._delays[A].delayTime.value=0,this._gains[A].gain.value=0);this._inverters.right.gain.value=-1,this._inverters.down.gain.value=-1,this._inverters.back.gain.value=-1,this.input.connect(this._lowpass);for(let A in i.DEFAULT_REFLECTION_COEFFICIENTS)i.DEFAULT_REFLECTION_COEFFICIENTS.hasOwnProperty(A)&&(this._lowpass.connect(this._delays[A]),this._delays[A].connect(this._gains[A]),this._gains[A].connect(this._merger,0,0));this._gains.left.connect(this._merger,0,1),this._gains.right.connect(this._inverters.right),this._inverters.right.connect(this._merger,0,1),this._gains.up.connect(this._merger,0,2),this._gains.down.connect(this._inverters.down),this._inverters.down.connect(this._merger,0,2),this._gains.front.connect(this._merger,0,3),this._gains.back.connect(this._inverters.back),this._inverters.back.connect(this._merger,0,3),this._merger.connect(this.output),this._listenerPosition=t.listenerPosition,this.setRoomProperties(t.dimensions,t.coefficients)}n.prototype.setListenerPosition=function(A,t,e){this._listenerPosition=[A,t,e];let n={left:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.width+A)+i.DEFAULT_REFLECTION_MIN_DISTANCE,right:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.width-A)+i.DEFAULT_REFLECTION_MIN_DISTANCE,front:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.depth+e)+i.DEFAULT_REFLECTION_MIN_DISTANCE,back:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.depth-e)+i.DEFAULT_REFLECTION_MIN_DISTANCE,down:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.height+t)+i.DEFAULT_REFLECTION_MIN_DISTANCE,up:i.DEFAULT_REFLECTION_MULTIPLIER*Math.max(0,this._halfDimensions.height-t)+i.DEFAULT_REFLECTION_MIN_DISTANCE};for(let A in i.DEFAULT_REFLECTION_COEFFICIENTS)if(i.DEFAULT_REFLECTION_COEFFICIENTS.hasOwnProperty(A)){let t=n[A]/this.speedOfSound;this._delays[A].delayTime.value=t;let e=this._coefficients[A]/n[A];this._gains[A].gain.value=e}},n.prototype.setRoomProperties=function(A,t){void 0==A&&(A={},Object.assign(A,i.DEFAULT_ROOM_DIMENSIONS)),void 0==t&&(t={},Object.assign(t,i.DEFAULT_REFLECTION_COEFFICIENTS)),this._coefficients=t,this._halfDimensions={},this._halfDimensions.width=.5*A.width,this._halfDimensions.height=.5*A.height,this._halfDimensions.depth=.5*A.depth,this.setListenerPosition(this._listenerPosition[0],this._listenerPosition[1],this._listenerPosition[2])},A.exports=n},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */t.ResonanceAudio=e(11),t.ResonanceAudio.Attenuation=e(6),t.ResonanceAudio.Directivity=e(5),t.ResonanceAudio.EarlyReflections=e(9),t.ResonanceAudio.Encoder=e(1),t.ResonanceAudio.LateReflections=e(8),t.ResonanceAudio.Listener=e(2),t.ResonanceAudio.Room=e(7),t.ResonanceAudio.Source=e(4),t.ResonanceAudio.Tables=e(3),t.ResonanceAudio.Utils=e(0),t.ResonanceAudio.Version=e(13)},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2017 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */const i=e(2),n=e(4),s=e(7),o=e(1),r=e(0);function a(A,t){void 0==t&&(t={}),void 0==t.ambisonicOrder&&(t.ambisonicOrder=r.DEFAULT_AMBISONIC_ORDER),void 0==t.listenerPosition&&(t.listenerPosition=r.DEFAULT_POSITION.slice()),void 0==t.listenerForward&&(t.listenerForward=r.DEFAULT_FORWARD.slice()),void 0==t.listenerUp&&(t.listenerUp=r.DEFAULT_UP.slice()),void 0==t.dimensions&&(t.dimensions={},Object.assign(t.dimensions,r.DEFAULT_ROOM_DIMENSIONS)),void 0==t.materials&&(t.materials={},Object.assign(t.materials,r.DEFAULT_ROOM_MATERIALS)),void 0==t.speedOfSound&&(t.speedOfSound=r.DEFAULT_SPEED_OF_SOUND),this._ambisonicOrder=o.validateAmbisonicOrder(t.ambisonicOrder),this._sources=[],this._room=new s(A,{listenerPosition:t.listenerPosition,dimensions:t.dimensions,materials:t.materials,speedOfSound:t.speedOfSound}),this._listener=new i(A,{ambisonicOrder:t.ambisonicOrder,position:t.listenerPosition,forward:t.listenerForward,up:t.listenerUp}),this._context=A,this.output=A.createGain(),this.ambisonicOutput=A.createGain(),this.ambisonicInput=this._listener.input,this._room.output.connect(this._listener.input),this._listener.output.connect(this.output),this._listener.ambisonicOutput.connect(this.ambisonicOutput)}a.prototype.createSource=function(A){let t=new n(this,A);return this._sources[this._sources.length]=t,t},a.prototype.setAmbisonicOrder=function(A){this._ambisonicOrder=o.validateAmbisonicOrder(A)},a.prototype.setRoomProperties=function(A,t){this._room.setProperties(A,t)},a.prototype.setListenerPosition=function(A,t,e){this._listener.position[0]=A,this._listener.position[1]=t,this._listener.position[2]=e,this._room.setListenerPosition(A,t,e),this._sources.forEach(function(A){A._update()})},a.prototype.setListenerOrientation=function(A,t,e,i,n,s){this._listener.setOrientation(A,t,e,i,n,s)},a.prototype.setListenerFromMatrix=function(A){this._listener.setFromMatrix(A),this.setListenerPosition(this._listener.position[0],this._listener.position[1],this._listener.position[2])},a.prototype.setSpeedOfSound=function(A){this._room.speedOfSound=A},A.exports=a},function(A,t,e){!function(t,e){A.exports=e()}(0,function(){return function(A){var t={};function e(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return A[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}return e.m=A,e.c=t,e.d=function(A,t,i){e.o(A,t)||Object.defineProperty(A,t,{configurable:!1,enumerable:!0,get:i})},e.n=function(A){var t=A&&A.__esModule?function(){return A.default}:function(){return A};return e.d(t,"a",t),t},e.o=function(A,t){return Object.prototype.hasOwnProperty.call(A,t)},e.p="",e(e.s=10)}([function(A,t){let e,i,n,s,o,r,a,c,h,u,l,_,d,f,D,p,g,E,w,v,m,P,B,C,O,I,M,R,F;t.log=function(){window.console.log.apply(window.console,["%c[Omnitone]%c "+Array.prototype.slice.call(arguments).join(" ")+" %c(@"+performance.now().toFixed(2)+"ms)","background: #BBDEFB; color: #FF5722; font-weight: 500","font-weight: 300","color: #AAA"])},t.throw=function(){throw window.console.error.apply(window.console,["%c[Omnitone]%c "+Array.prototype.slice.call(arguments).join(" ")+" %c(@"+performance.now().toFixed(2)+"ms)","background: #C62828; color: #FFEBEE; font-weight: 800","font-weight: 400","color: #AAA"]),new Error(!1)},t.invertMatrix4=function(A,t){return e=t[0],i=t[1],n=t[2],s=t[3],o=t[4],r=t[5],a=t[6],c=t[7],h=t[8],u=t[9],l=t[10],_=t[11],d=t[12],f=t[13],D=t[14],p=t[15],(F=(g=e*r-i*o)*(R=l*p-_*D)-(E=e*a-n*o)*(M=u*p-_*f)+(w=e*c-s*o)*(I=u*D-l*f)+(v=i*a-n*r)*(O=h*p-_*d)-(m=i*c-s*r)*(C=h*D-l*d)+(P=n*c-s*a)*(B=h*f-u*d))?(F=1/F,A[0]=(r*R-a*M+c*I)*F,A[1]=(n*M-i*R-s*I)*F,A[2]=(f*P-D*m+p*v)*F,A[3]=(l*m-u*P-_*v)*F,A[4]=(a*O-o*R-c*C)*F,A[5]=(e*R-n*O+s*C)*F,A[6]=(D*w-d*P-p*E)*F,A[7]=(h*P-l*w+_*E)*F,A[8]=(o*M-r*O+c*B)*F,A[9]=(i*O-e*M-s*B)*F,A[10]=(d*m-f*w+p*g)*F,A[11]=(u*w-h*m-_*g)*F,A[12]=(r*C-o*I-a*B)*F,A[13]=(e*I-i*C+n*B)*F,A[14]=(f*E-d*v-D*g)*F,A[15]=(h*v-u*E+l*g)*F,A):null},t.isDefinedENUMEntry=function(A,t){for(let e in A)if(t===A[e])return!0;return!1},t.isAudioContext=function(A){return A instanceof AudioContext||A instanceof OfflineAudioContext},t.isAudioBuffer=function(A){return A instanceof AudioBuffer},t.mergeBufferListByChannel=function(A,e){const i=e[0].length,n=e[0].sampleRate;let s=0;for(let A=0;A<e.length;++A)s>32&&t.throw("Utils.mergeBuffer: Number of channels cannot exceed 32.(got "+s+")"),i!==e[A].length&&t.throw("Utils.mergeBuffer: AudioBuffer lengths are inconsistent. (expected "+i+" but got "+e[A].length+")"),n!==e[A].sampleRate&&t.throw("Utils.mergeBuffer: AudioBuffer sample rates are inconsistent. (expected "+n+" but got "+e[A].sampleRate+")"),s+=e[A].numberOfChannels;const o=A.createBuffer(s,i,n);let r=0;for(let A=0;A<e.length;++A)for(let t=0;t<e[A].numberOfChannels;++t)o.getChannelData(r++).set(e[A].getChannelData(t));return o},t.splitBufferbyChannel=function(A,e,i){e.numberOfChannels<=i&&t.throw("Utils.splitBuffer: Insufficient number of channels. ("+e.numberOfChannels+" splitted by "+i+")");let n=[],s=0;const o=Math.ceil(e.numberOfChannels/i);for(let t=0;t<o;++t){let t=A.createBuffer(i,e.length,e.sampleRate);for(let A=0;A<i;++A)s<e.numberOfChannels&&t.getChannelData(A).set(e.getChannelData(s++));n.push(t)}return bufferList},t.getArrayBufferFromBase64String=function(A){let t=window.atob(A),e=new Uint8Array(t.length);return e.forEach((A,i)=>e[i]=t.charCodeAt(i)),e.buffer}},function(A,t,e){"use strict";const i=e(0),n={BASE64:"base64",URL:"url"};function s(A,t,e){this._context=i.isAudioContext(A)?A:i.throw("BufferList: Invalid BaseAudioContext."),this._options={dataType:n.BASE64,verbose:!1},e&&(e.dataType&&i.isDefinedENUMEntry(n,e.dataType)&&(this._options.dataType=e.dataType),e.verbose&&(this._options.verbose=Boolean(e.verbose))),this._bufferList=[],this._bufferData=this._options.dataType===n.BASE64?t:t.slice(0),this._numberOfTasks=this._bufferData.length,this._resolveHandler=null,this._rejectHandler=new Function}s.prototype.load=function(){return new Promise(this._promiseGenerator.bind(this))},s.prototype._promiseGenerator=function(A,t){"function"!=typeof A?i.throw("BufferList: Invalid Promise resolver."):this._resolveHandler=A,"function"==typeof t&&(this._rejectHandler=t);for(let A=0;A<this._bufferData.length;++A)this._options.dataType===n.BASE64?this._launchAsyncLoadTask(A):this._launchAsyncLoadTaskXHR(A)},s.prototype._launchAsyncLoadTask=function(A){const t=this;this._context.decodeAudioData(i.getArrayBufferFromBase64String(this._bufferData[A]),function(e){t._updateProgress(A,e)},function(e){t._updateProgress(A,null);const n='BufferList: decoding ArrayByffer("'+A+'" from Base64-encoded data failed. ('+e+")";i.throw(n),t._rejectHandler(n)})},s.prototype._launchAsyncLoadTaskXHR=function(A){const t=new XMLHttpRequest;t.open("GET",this._bufferData[A]),t.responseType="arraybuffer";const e=this;t.onload=function(){if(200===t.status)e._context.decodeAudioData(t.response,function(t){e._updateProgress(A,t)},function(t){e._updateProgress(A,null);const n='BufferList: decoding "'+e._bufferData[A]+'" failed. ('+t+")";i.throw(n),e._rejectHandler(n)});else{const n='BufferList: XHR error while loading "'+e._bufferData[A]+"("+t.statusText+")";i.throw(n),e._rejectHandler(n)}},t.onerror=function(t){i.throw('BufferList: XHR network failed on loading "'+e._bufferData[A]+'".'),e._updateProgress(A,null),e._rejectHandler()},t.send()},s.prototype._updateProgress=function(A,t){if(this._bufferList[A]=t,this._options.verbose){let t=this._options.dataType===n.BASE64?"ArrayBuffer("+A+") from Base64-encoded HRIR":'"'+this._bufferData[A]+'"';i.log("BufferList: "+t+" successfully loaded.")}if(0==--this._numberOfTasks){let A=this._options.dataType===n.BASE64?this._bufferData.length+" AudioBuffers from Base64-encoded HRIRs":this._bufferData.length+" files via XHR";i.log("BufferList: "+A+" loaded successfully."),this._resolveHandler(this._bufferList)}},A.exports=s},function(A,t,e){"use strict";const i={DEFAULT:[0,1,2,3],SAFARI:[2,0,1,3],FUMA:[0,3,1,2]};function n(A,t){this._context=A,this._splitter=this._context.createChannelSplitter(4),this._merger=this._context.createChannelMerger(4),this.input=this._splitter,this.output=this._merger,this.setChannelMap(t||i.DEFAULT)}n.prototype.setChannelMap=function(A){Array.isArray(A)&&(this._channelMap=A,this._splitter.disconnect(),this._splitter.connect(this._merger,0,this._channelMap[0]),this._splitter.connect(this._merger,1,this._channelMap[1]),this._splitter.connect(this._merger,2,this._channelMap[2]),this._splitter.connect(this._merger,3,this._channelMap[3]))},n.ChannelMap=i,A.exports=n},function(A,t,e){"use strict";function i(A){this._context=A,this._splitter=this._context.createChannelSplitter(4),this._inY=this._context.createGain(),this._inZ=this._context.createGain(),this._inX=this._context.createGain(),this._m0=this._context.createGain(),this._m1=this._context.createGain(),this._m2=this._context.createGain(),this._m3=this._context.createGain(),this._m4=this._context.createGain(),this._m5=this._context.createGain(),this._m6=this._context.createGain(),this._m7=this._context.createGain(),this._m8=this._context.createGain(),this._outY=this._context.createGain(),this._outZ=this._context.createGain(),this._outX=this._context.createGain(),this._merger=this._context.createChannelMerger(4),this._splitter.connect(this._inY,1),this._splitter.connect(this._inZ,2),this._splitter.connect(this._inX,3),this._inY.gain.value=-1,this._inX.gain.value=-1,this._inY.connect(this._m0),this._inY.connect(this._m1),this._inY.connect(this._m2),this._inZ.connect(this._m3),this._inZ.connect(this._m4),this._inZ.connect(this._m5),this._inX.connect(this._m6),this._inX.connect(this._m7),this._inX.connect(this._m8),this._m0.connect(this._outY),this._m1.connect(this._outZ),this._m2.connect(this._outX),this._m3.connect(this._outY),this._m4.connect(this._outZ),this._m5.connect(this._outX),this._m6.connect(this._outY),this._m7.connect(this._outZ),this._m8.connect(this._outX),this._splitter.connect(this._merger,0,0),this._outY.connect(this._merger,0,1),this._outZ.connect(this._merger,0,2),this._outX.connect(this._merger,0,3),this._outY.gain.value=-1,this._outX.gain.value=-1,this.setRotationMatrix3(new Float32Array([1,0,0,0,1,0,0,0,1])),this.input=this._splitter,this.output=this._merger}i.prototype.setRotationMatrix3=function(A){this._m0.gain.value=A[0],this._m1.gain.value=A[1],this._m2.gain.value=A[2],this._m3.gain.value=A[3],this._m4.gain.value=A[4],this._m5.gain.value=A[5],this._m6.gain.value=A[6],this._m7.gain.value=A[7],this._m8.gain.value=A[8]},i.prototype.setRotationMatrix4=function(A){this._m0.gain.value=A[0],this._m1.gain.value=A[1],this._m2.gain.value=A[2],this._m3.gain.value=A[4],this._m4.gain.value=A[5],this._m5.gain.value=A[6],this._m6.gain.value=A[8],this._m7.gain.value=A[9],this._m8.gain.value=A[10]},i.prototype.getRotationMatrix3=function(){return[this._m0.gain.value,this._m1.gain.value,this._m2.gain.value,this._m3.gain.value,this._m4.gain.value,this._m5.gain.value,this._m6.gain.value,this._m7.gain.value,this._m8.gain.value]},i.prototype.getRotationMatrix4=function(){let A=new Float32Array(16);return A[0]=this._m0.gain.value,A[1]=this._m1.gain.value,A[2]=this._m2.gain.value,A[4]=this._m3.gain.value,A[5]=this._m4.gain.value,A[6]=this._m5.gain.value,A[8]=this._m6.gain.value,A[9]=this._m7.gain.value,A[10]=this._m8.gain.value,A},A.exports=i},function(A,t,e){"use strict";function i(A,t){this._context=A,this._active=!1,this._isBufferLoaded=!1,this._buildAudioGraph(),t&&this.setHRIRBufferList(t),this.enable()}i.prototype._buildAudioGraph=function(){this._splitterWYZX=this._context.createChannelSplitter(4),this._mergerWY=this._context.createChannelMerger(2),this._mergerZX=this._context.createChannelMerger(2),this._convolverWY=this._context.createConvolver(),this._convolverZX=this._context.createConvolver(),this._splitterWY=this._context.createChannelSplitter(2),this._splitterZX=this._context.createChannelSplitter(2),this._inverter=this._context.createGain(),this._mergerBinaural=this._context.createChannelMerger(2),this._summingBus=this._context.createGain(),this._splitterWYZX.connect(this._mergerWY,0,0),this._splitterWYZX.connect(this._mergerWY,1,1),this._splitterWYZX.connect(this._mergerZX,2,0),this._splitterWYZX.connect(this._mergerZX,3,1),this._mergerWY.connect(this._convolverWY),this._mergerZX.connect(this._convolverZX),this._convolverWY.connect(this._splitterWY),this._convolverZX.connect(this._splitterZX),this._splitterWY.connect(this._mergerBinaural,0,0),this._splitterWY.connect(this._mergerBinaural,0,1),this._splitterWY.connect(this._mergerBinaural,1,0),this._splitterWY.connect(this._inverter,1,0),this._inverter.connect(this._mergerBinaural,0,1),this._splitterZX.connect(this._mergerBinaural,0,0),this._splitterZX.connect(this._mergerBinaural,0,1),this._splitterZX.connect(this._mergerBinaural,1,0),this._splitterZX.connect(this._mergerBinaural,1,1),this._convolverWY.normalize=!1,this._convolverZX.normalize=!1,this._inverter.gain.value=-1,this.input=this._splitterWYZX,this.output=this._summingBus},i.prototype.setHRIRBufferList=function(A){this._isBufferLoaded||(this._convolverWY.buffer=A[0],this._convolverZX.buffer=A[1],this._isBufferLoaded=!0)},i.prototype.enable=function(){this._mergerBinaural.connect(this._summingBus),this._active=!0},i.prototype.disable=function(){this._mergerBinaural.disconnect(),this._active=!1},A.exports=i},function(A,t,e){"use strict";const i=e(0);function n(A,t,e,n,s){this._context=A,this._buffers=new Map,this._loadingTasks={},this._resolve=e,this._reject=n,this._progress=s;for(let A=0;A<t.length;A++){const e=t[A];if(this._loadingTasks.hasOwnProperty(e.name))return void i.log("Duplicated filename when loading: "+e.name);this._loadingTasks[e.name]=0,this._loadAudioFile(e)}}n.prototype._loadAudioFile=function(A){const t=new XMLHttpRequest;t.open("GET",A.url),t.responseType="arraybuffer";const e=this;t.onload=function(){200===t.status?e._context.decodeAudioData(t.response,function(t){e._done(A.name,t)},function(t){i.log("Decoding failure: "+A.url+" ("+t+")"),e._done(A.name,null)}):(i.log("XHR Error: "+A.url+" ("+t.statusText+")"),e._done(A.name,null))},t.onerror=function(t){i.log("XHR Network failure: "+A.url),e._done(A.name,null)},t.send()},n.prototype._done=function(A,t){this._loadingTasks[A]=null!==t?"loaded":"failed",this._buffers.set(A,t),this._updateProgress(A)},n.prototype._updateProgress=function(A){let t=0,e=0,i=0;for(const A in this._loadingTasks)Object.prototype.hasOwnProperty.call(this._loadingTasks,A)&&(i++,"loaded"===this._loadingTasks[A]?t++:"failed"===this._loadingTasks[A]&&e++);"function"!=typeof this._progress?t!==i?t+e!==i||this._reject(this._buffers):this._resolve(this._buffers):this._progress(A,t,i)},A.exports=n},function(A,t,e){"use strict";const i=e(0),n=690,s=[1.4142,.8166,.8166,.8166];A.exports=function(A){if(this._context=A,this._input=this._context.createGain(),this._context.createIIRFilter){const A=function(A,t){const e=Math.tan(Math.PI*A/t),i=e*e,n=i+2*e+1;return{lowpassA:[1,2*(i-1)/n,(i-2*e+1)/n],lowpassB:[i/n,2*i/n,i/n],hipassA:[1,2*(i-1)/n,(i-2*e+1)/n],hipassB:[1/n,-2/n,1/n]}}(n,this._context.sampleRate);this._lpf=this._context.createIIRFilter(A.lowpassB,A.lowpassA),this._hpf=this._context.createIIRFilter(A.hipassB,A.hipassA)}else i.log("IIR filter is missing. Using Biquad filter instead."),this._lpf=this._context.createBiquadFilter(),this._hpf=this._context.createBiquadFilter(),this._lpf.frequency.value=n,this._hpf.frequency.value=n,this._hpf.type="highpass";this._splitterLow=this._context.createChannelSplitter(4),this._splitterHigh=this._context.createChannelSplitter(4),this._gainHighW=this._context.createGain(),this._gainHighY=this._context.createGain(),this._gainHighZ=this._context.createGain(),this._gainHighX=this._context.createGain(),this._merger=this._context.createChannelMerger(4),this._input.connect(this._hpf),this._hpf.connect(this._splitterHigh),this._splitterHigh.connect(this._gainHighW,0),this._splitterHigh.connect(this._gainHighY,1),this._splitterHigh.connect(this._gainHighZ,2),this._splitterHigh.connect(this._gainHighX,3),this._gainHighW.connect(this._merger,0,0),this._gainHighY.connect(this._merger,0,1),this._gainHighZ.connect(this._merger,0,2),this._gainHighX.connect(this._merger,0,3),this._input.connect(this._lpf),this._lpf.connect(this._splitterLow),this._splitterLow.connect(this._merger,0,0),this._splitterLow.connect(this._merger,1,1),this._splitterLow.connect(this._merger,2,2),this._splitterLow.connect(this._merger,3,3);const t=this._context.currentTime;this._gainHighW.gain.setValueAtTime(-1*s[0],t),this._gainHighY.gain.setValueAtTime(-1*s[1],t),this._gainHighZ.gain.setValueAtTime(-1*s[2],t),this._gainHighX.gain.setValueAtTime(-1*s[3],t),this.input=this._input,this.output=this._merger}},function(A,t,e){"use strict";function i(A,t){if(2!==t.IR.numberOfChannels)throw new Error("IR does not have 2 channels. cannot proceed.");this._active=!1,this._context=A,this._input=this._context.createChannelSplitter(4),this._cW=this._context.createGain(),this._cY=this._context.createGain(),this._cZ=this._context.createGain(),this._cX=this._context.createGain(),this._convolver=this._context.createConvolver(),this._gain=this._context.createGain(),this._input.connect(this._cW,0),this._input.connect(this._cY,1),this._input.connect(this._cZ,2),this._input.connect(this._cX,3),this._cW.connect(this._convolver),this._cY.connect(this._convolver),this._cZ.connect(this._convolver),this._cX.connect(this._convolver),this._convolver.connect(this._gain),this._gain.connect(this._context.destination),this.enable(),this._convolver.normalize=!1,this._convolver.buffer=t.IR,this._gain.gain.value=t.gain,this._cW.gain.value=t.coefficients[0],this._cY.gain.value=t.coefficients[1],this._cZ.gain.value=t.coefficients[2],this._cX.gain.value=t.coefficients[3],this.input=this._input}i.prototype.enable=function(){this._gain.connect(this._context.destination),this._active=!0},i.prototype.disable=function(){this._gain.disconnect(),this._active=!1},A.exports=i},function(A,t,e){"use strict";function i(A,t,e){this._context=A,this._active=!1,this._isBufferLoaded=!1,this._ambisonicOrder=t,this._numberOfChannels=(this._ambisonicOrder+1)*(this._ambisonicOrder+1),this._buildAudioGraph(),e&&this.setHRIRBufferList(e),this.enable()}i.prototype._buildAudioGraph=function(){const A=Math.ceil(this._numberOfChannels/2);this._inputSplitter=this._context.createChannelSplitter(this._numberOfChannels),this._stereoMergers=[],this._convolvers=[],this._stereoSplitters=[],this._positiveIndexSphericalHarmonics=this._context.createGain(),this._negativeIndexSphericalHarmonics=this._context.createGain(),this._inverter=this._context.createGain(),this._binauralMerger=this._context.createChannelMerger(2),this._outputGain=this._context.createGain();for(let t=0;t<A;++t)this._stereoMergers[t]=this._context.createChannelMerger(2),this._convolvers[t]=this._context.createConvolver(),this._stereoSplitters[t]=this._context.createChannelSplitter(2),this._convolvers[t].normalize=!1;for(let A=0;A<=this._ambisonicOrder;++A)for(let t=-A;t<=A;t++){const e=A*A+A+t,i=Math.floor(e/2);this._inputSplitter.connect(this._stereoMergers[i],e,e%2),this._stereoMergers[i].connect(this._convolvers[i]),this._convolvers[i].connect(this._stereoSplitters[i]),t>=0?this._stereoSplitters[i].connect(this._positiveIndexSphericalHarmonics,e%2):this._stereoSplitters[i].connect(this._negativeIndexSphericalHarmonics,e%2)}this._positiveIndexSphericalHarmonics.connect(this._binauralMerger,0,0),this._positiveIndexSphericalHarmonics.connect(this._binauralMerger,0,1),this._negativeIndexSphericalHarmonics.connect(this._binauralMerger,0,0),this._negativeIndexSphericalHarmonics.connect(this._inverter),this._inverter.connect(this._binauralMerger,0,1),this._inverter.gain.value=-1,this.input=this._inputSplitter,this.output=this._outputGain},i.prototype.setHRIRBufferList=function(A){if(!this._isBufferLoaded){for(let t=0;t<A.length;++t)this._convolvers[t].buffer=A[t];this._isBufferLoaded=!0}},i.prototype.enable=function(){this._binauralMerger.connect(this._outputGain),this._active=!0},i.prototype.disable=function(){this._binauralMerger.disconnect(),this._active=!1},A.exports=i},function(A,t,e){"use strict";function i(A,t){return A===t?1:0}function n(A,t,e,i,n){const s=(i+t)*(2*t+1)+(e+t);A[t-1][s].gain.value=n}function s(A,t,e,i){const n=(i+t)*(2*t+1)+(e+t);return A[t-1][n].gain.value}function o(A,t,e,i,n){return i===n?s(A,1,t,1)*s(A,n-1,e,n-1)-s(A,1,t,-1)*s(A,n-1,e,1-n):i===-n?s(A,1,t,1)*s(A,n-1,e,1-n)+s(A,1,t,-1)*s(A,n-1,e,n-1):s(A,1,t,0)*s(A,n-1,e,i)}function r(A,t,e,i){return o(A,0,t,e,i)}function a(A,t,e,n){if(0===t)return o(A,1,1,e,n)+o(A,-1,-1,e,n);if(t>0){const s=i(t,1);return o(A,1,t-1,e,n)*Math.sqrt(1+s)-o(A,-1,1-t,e,n)*(1-s)}{const s=i(t,-1);return o(A,1,t+1,e,n)*(1-s)+o(A,-1,-t-1,e,n)*Math.sqrt(1+s)}}function c(A,t,e,i){return 0===t?0:t>0?o(A,1,t+1,e,i)+o(A,-1,-t-1,e,i):o(A,1,t-1,e,i)-o(A,-1,1-t,e,i)}function h(A,t,e){const n=i(A,0),s=Math.abs(t)===e?1/(2*e*(2*e-1)):1/((e+t)*(e-t));return[Math.sqrt((e+A)*(e-A)*s),.5*(1-2*n)*Math.sqrt((1+n)*(e+Math.abs(A)-1)*(e+Math.abs(A))*s),-.5*(1-n)*Math.sqrt((e-Math.abs(A)-1)*(e-Math.abs(A)))*s]}function u(A,t){for(let e=-t;e<=t;e++)for(let i=-t;i<=t;i++){const s=h(e,i,t);Math.abs(s[0])>0&&(s[0]*=r(A,e,i,t)),Math.abs(s[1])>0&&(s[1]*=a(A,e,i,t)),Math.abs(s[2])>0&&(s[2]*=c(A,e,i,t)),n(A,t,e,i,s[0]+s[1]+s[2])}}function l(A){for(let t=2;t<=A.length;t++)u(A,t)}function _(A,t){this._context=A,this._ambisonicOrder=t;const e=(t+1)*(t+1);let i,n,s,o,r;this._splitter=this._context.createChannelSplitter(e),this._merger=this._context.createChannelMerger(e),this._gainNodeMatrix=[];for(let A=1;A<=t;A++){i=A*A,n=2*A+1,this._gainNodeMatrix[A-1]=[];for(let t=0;t<n;t++){s=i+t;for(let e=0;e<n;e++)o=i+e,r=t*n+e,this._gainNodeMatrix[A-1][r]=this._context.createGain(),this._splitter.connect(this._gainNodeMatrix[A-1][r],s),this._gainNodeMatrix[A-1][r].connect(this._merger,0,o)}}this._splitter.connect(this._merger,0,0),this.setRotationMatrix3(new Float32Array([1,0,0,0,1,0,0,0,1])),this.input=this._splitter,this.output=this._merger}_.prototype.setRotationMatrix3=function(A){for(let t=0;t<9;++t)this._gainNodeMatrix[0][t].gain.value=A[t];l(this._gainNodeMatrix)},_.prototype.setRotationMatrix4=function(A){this._gainNodeMatrix[0][0].gain.value=A[0],this._gainNodeMatrix[0][1].gain.value=A[1],this._gainNodeMatrix[0][2].gain.value=A[2],this._gainNodeMatrix[0][3].gain.value=A[4],this._gainNodeMatrix[0][4].gain.value=A[5],this._gainNodeMatrix[0][5].gain.value=A[6],this._gainNodeMatrix[0][6].gain.value=A[8],this._gainNodeMatrix[0][7].gain.value=A[9],this._gainNodeMatrix[0][8].gain.value=A[10],l(this._gainNodeMatrix)},_.prototype.getRotationMatrix3=function(){let A=new Float32Array(9);for(let t=0;t<9;++t)A[t]=this._gainNodeMatrix[0][t].gain.value;return A},_.prototype.getRotationMatrix4=function(){let A=new Float32Array(16);return A[0]=this._gainNodeMatrix[0][0].gain.value,A[1]=this._gainNodeMatrix[0][1].gain.value,A[2]=this._gainNodeMatrix[0][2].gain.value,A[4]=this._gainNodeMatrix[0][3].gain.value,A[5]=this._gainNodeMatrix[0][4].gain.value,A[6]=this._gainNodeMatrix[0][5].gain.value,A[8]=this._gainNodeMatrix[0][6].gain.value,A[9]=this._gainNodeMatrix[0][7].gain.value,A[10]=this._gainNodeMatrix[0][8].gain.value,A},_.prototype.getAmbisonicOrder=function(){return this._ambisonicOrder},A.exports=_},function(A,t,e){"use strict";
  /**
   * @license
   * Copyright 2016 Google Inc. All Rights Reserved.
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */t.Omnitone=e(11)},function(A,t,e){"use strict";const i=e(1),n=e(4),s=e(12),o=e(6),r=e(14),a=e(3),c=e(2),h=e(7),u=e(8),l=e(16),_=e(9),d=e(19),f=e(0),D=e(20),p=e(5);let g={};g.browserInfo=d.getBrowserInfo(),g.loadAudioBuffers=function(A,t){return new Promise(function(e,i){new p(A,t,function(A){e(A)},i)})},g.createBufferList=function(A,t,e){return new i(A,t,e||{dataType:"url"}).load()},g.mergeBufferListByChannel=f.mergeBufferListByChannel,g.splitBufferbyChannel=f.splitBufferbyChannel,g.createFOAConvolver=function(A,t){return new n(A,t)},g.createFOARouter=function(A,t){return new c(A,t)},g.createFOARotator=function(A){return new a(A)},g.createFOAPhaseMatchedFilter=function(A){return new o(A)},g.createFOAVirtualSpeaker=function(A,t){return new h(A,t)},g.createFOADecoder=function(A,t,e){return f.log("WARNING: FOADecoder is deprecated in favor of FOARenderer."),new s(A,t,e)},g.createFOARenderer=function(A,t){return new r(A,t)},g.createHOARotator=function(A,t){return new _(A,t)},g.createHOAConvolver=function(A,t,e){return new u(A,t,e)},g.createHOARenderer=function(A,t){return new l(A,t)},f.log("Version "+D+" (running "+g.browserInfo.name+" "+g.browserInfo.version+" on "+g.browserInfo.platform+")"),"safari"===g.browserInfo.name.toLowerCase()&&(d.patchSafari(),f.log(g.browserInfo.name+" detected. Appliying polyfill...")),A.exports=g},function(A,t,e){"use strict";const i=e(5),n=e(2),s=e(3),o=e(6),r=e(7),a=e(13),c=e(0),h="https://raw.githubusercontent.com/GoogleChrome/omnitone/master/build/resources/";let u=0;function l(A,t,e){this._isDecoderReady=!1,this._context=A,this._videoElement=t,this._decodingMode="ambisonic",this._postGainDB=u,this._HRTFSetUrl=h,this._channelMap=n.ChannelMap.DEFAULT,e&&(e.postGainDB&&(this._postGainDB=e.postGainDB),e.HRTFSetUrl&&(this._HRTFSetUrl=e.HRTFSetUrl),e.channelMap&&(this._channelMap=e.channelMap)),this._speakerData=[];for(let A=0;A<a.length;++A)this._speakerData.push({name:a[A].name,url:this._HRTFSetUrl+"/"+a[A].url,coef:a[A].coef});this._tempMatrix4=new Float32Array(16)}l.prototype.initialize=function(){c.log("Initializing... (mode: "+this._decodingMode+")");let A=this._channelMap.toString(),t=n.ChannelMap.DEFAULT.toString();A!==t&&c.log("Remapping channels (["+t+"] -> ["+A+"])"),this._audioElementSource=this._context.createMediaElementSource(this._videoElement),this._foaRouter=new n(this._context,this._channelMap),this._foaRotator=new s(this._context),this._foaPhaseMatchedFilter=new o(this._context),this._audioElementSource.connect(this._foaRouter.input),this._foaRouter.output.connect(this._foaRotator.input),this._foaRotator.output.connect(this._foaPhaseMatchedFilter.input),this._foaVirtualSpeakers=[],this._bypass=this._context.createGain(),this._audioElementSource.connect(this._bypass);const e=Math.pow(10,this._postGainDB/20);c.log("Gain compensation: "+e+" ("+this._postGainDB+"dB)");const a=this;return new Promise(function(A,t){new i(a._context,a._speakerData,function(t){for(let A=0;A<a._speakerData.length;++A)a._foaVirtualSpeakers[A]=new r(a._context,{coefficients:a._speakerData[A].coef,IR:t.get(a._speakerData[A].name),gain:e}),a._foaPhaseMatchedFilter.output.connect(a._foaVirtualSpeakers[A].input);a.setMode(a._decodingMode),a._isDecoderReady=!0,c.log("HRTF IRs are loaded successfully. The decoder is ready."),A()},t)})},l.prototype.setRotationMatrix=function(A){this._foaRotator.setRotationMatrix(A)},l.prototype.setRotationMatrixFromCamera=function(A){c.invertMatrix4(this._tempMatrix4,A.elements),this._foaRotator.setRotationMatrix4(this._tempMatrix4)},l.prototype.setMode=function(A){if(A!==this._decodingMode){switch(A){case"bypass":this._decodingMode="bypass";for(let A=0;A<this._foaVirtualSpeakers.length;++A)this._foaVirtualSpeakers[A].disable();this._bypass.connect(this._context.destination);break;case"ambisonic":this._decodingMode="ambisonic";for(let A=0;A<this._foaVirtualSpeakers.length;++A)this._foaVirtualSpeakers[A].enable();this._bypass.disconnect();break;case"off":this._decodingMode="off";for(let A=0;A<this._foaVirtualSpeakers.length;++A)this._foaVirtualSpeakers[A].disable();this._bypass.disconnect()}c.log("Decoding mode changed. ("+A+")")}},A.exports=l},function(A,t){A.exports=[{name:"E35_A135",url:"E35_A135.wav",gainFactor:1,coef:[.125,.216495,.21653,-.216495]},{name:"E35_A-135",url:"E35_A-135.wav",gainFactor:1,coef:[.125,-.216495,.21653,-.216495]},{name:"E-35_A135",url:"E-35_A135.wav",gainFactor:1,coef:[.125,.216495,-.21653,-.216495]},{name:"E-35_A-135",url:"E-35_A-135.wav",gainFactor:1,coef:[.125,-.216495,-.21653,-.216495]},{name:"E35_A45",url:"E35_A45.wav",gainFactor:1,coef:[.125,.216495,.21653,.216495]},{name:"E35_A-45",url:"E35_A-45.wav",gainFactor:1,coef:[.125,-.216495,.21653,.216495]},{name:"E-35_A45",url:"E-35_A45.wav",gainFactor:1,coef:[.125,.216495,-.21653,.216495]},{name:"E-35_A-45",url:"E-35_A-45.wav",gainFactor:1,coef:[.125,-.216495,-.21653,.216495]}]},function(A,t,e){"use strict";const i=e(1),n=e(4),s=e(15),o=e(3),r=e(2),a=e(0),c={AMBISONIC:"ambisonic",BYPASS:"bypass",OFF:"off"};function h(A,t){this._context=a.isAudioContext(A)?A:a.throw("FOARenderer: Invalid BaseAudioContext."),this._config={channelMap:r.ChannelMap.DEFAULT,renderingMode:c.AMBISONIC},t&&(t.channelMap&&(Array.isArray(t.channelMap)&&4===t.channelMap.length?this._config.channelMap=t.channelMap:a.throw("FOARenderer: Invalid channel map. (got "+t.channelMap+")")),t.hrirPathList&&(Array.isArray(t.hrirPathList)&&2===t.hrirPathList.length?this._config.pathList=t.hrirPathList:a.throw("FOARenderer: Invalid HRIR URLs. It must be an array with 2 URLs to HRIR files. (got "+t.hrirPathList+")")),t.renderingMode&&(Object.values(c).includes(t.renderingMode)?this._config.renderingMode=t.renderingMode:a.log("FOARenderer: Invalid rendering mode order. (got"+t.renderingMode+') Fallbacks to the mode "ambisonic".'))),this._buildAudioGraph(),this._tempMatrix4=new Float32Array(16),this._isRendererReady=!1}h.prototype._buildAudioGraph=function(){this.input=this._context.createGain(),this.output=this._context.createGain(),this._bypass=this._context.createGain(),this._foaRouter=new r(this._context,this._config.channelMap),this._foaRotator=new o(this._context),this._foaConvolver=new n(this._context),this.input.connect(this._foaRouter.input),this.input.connect(this._bypass),this._foaRouter.output.connect(this._foaRotator.input),this._foaRotator.output.connect(this._foaConvolver.input),this._foaConvolver.output.connect(this.output),this.input.channelCount=4,this.input.channelCountMode="explicit",this.input.channelInterpretation="discrete"},h.prototype._initializeCallback=function(A,t){(this._config.pathList?new i(this._context,this._config.pathList,{dataType:"url"}):new i(this._context,s)).load().then(function(t){this._foaConvolver.setHRIRBufferList(t),this.setRenderingMode(this._config.renderingMode),this._isRendererReady=!0,a.log("FOARenderer: HRIRs loaded successfully. Ready."),A()}.bind(this),function(){const A="FOARenderer: HRIR loading/decoding failed.";a.throw(A),t(A)})},h.prototype.initialize=function(){return a.log("FOARenderer: Initializing... (mode: "+this._config.renderingMode+")"),new Promise(this._initializeCallback.bind(this),function(A){a.throw("FOARenderer: Initialization failed. ("+A+")")})},h.prototype.setChannelMap=function(A){this._isRendererReady&&A.toString()!==this._config.channelMap.toString()&&(a.log("Remapping channels (["+this._config.channelMap.toString()+"] -> ["+A.toString()+"])."),this._config.channelMap=A.slice(),this._foaRouter.setChannelMap(this._config.channelMap))},h.prototype.setRotationMatrix3=function(A){this._isRendererReady&&this._foaRotator.setRotationMatrix3(A)},h.prototype.setRotationMatrix4=function(A){this._isRendererReady&&this._foaRotator.setRotationMatrix4(A)},h.prototype.setRotationMatrixFromCamera=function(A){this._isRendererReady&&(a.invertMatrix4(this._tempMatrix4,A.elements),this._foaRotator.setRotationMatrix4(this._tempMatrix4))},h.prototype.setRenderingMode=function(A){if(A!==this._config.renderingMode){switch(A){case c.AMBISONIC:this._foaConvolver.enable(),this._bypass.disconnect();break;case c.BYPASS:this._foaConvolver.disable(),this._bypass.connect(this.output);break;case c.OFF:this._foaConvolver.disable(),this._bypass.disconnect();break;default:return void a.log('FOARenderer: Rendering mode "'+A+'" is not supported.')}this._config.renderingMode=A,a.log("FOARenderer: Rendering mode changed. ("+A+")")}},A.exports=h},function(A,t){A.exports=["UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD+/wIA9v8QAPv/CwD+/wcA/v8MAP//AQD7/wEACAAEAPj/+v8YABAA7v/n//v/9P/M/8D//f34/R38EvzxAfEBtA2lDTcBJQFJ9T71FP0D/cD1tfVo/Wv9uPTO9PPmOufc/U/+agL3Aisc/RxuGKEZBv3j/iYMzQ2gAzsEQQUABiQFrASzA5cB2QmyCy0AtgR4AeYGtfgAA2j5OQHP+scArPsMBJgEggIEBtz6+QVq/pj/aPg8BP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/wAABgATAAEA/f/u/wQABgAQAPr/+P/z/wUACQALAPj/9//4/wgABwAKAPT/+f/5/w4ABwAIAPT/+//9/w4AAwADAPH//f///w8A//8BAPP///8BAA0A/f/+//X/AgACAA0A+//8//b/BAADAAoA+f/7//n/BgADAAcA+P/7//v/BwABAAQA+P/8//3/CQABAAIA9//9////CQD/////+P///wAACAD9//7/+f8AAAAABwD8//3/+v8CAAAABgD7//z//P8EAAAABAD6//3//P8FAP//AgD6//7//v8FAP7/AQD7//////8GAP7/AAD7/wEA//8EAP3/AAD9/wEA/v8DAP3/AAD9/wIA/v8CAP3/AQD9/wIA/v8CAP7/AQD+/wEA"]},function(A,t,e){"use strict";const i=e(1),n=e(8),s=e(9),o=e(17),r=e(18),a=e(0),c={AMBISONIC:"ambisonic",BYPASS:"bypass",OFF:"off"},h=[2,3];function u(A,t){this._context=a.isAudioContext(A)?A:a.throw("HOARenderer: Invalid BaseAudioContext."),this._config={ambisonicOrder:3,renderingMode:c.AMBISONIC},t&&t.ambisonicOrder&&(h.includes(t.ambisonicOrder)?this._config.ambisonicOrder=t.ambisonicOrder:a.log("HOARenderer: Invalid ambisonic order. (got "+t.ambisonicOrder+") Fallbacks to 3rd-order ambisonic.")),this._config.numberOfChannels=(this._config.ambisonicOrder+1)*(this._config.ambisonicOrder+1),this._config.numberOfStereoChannels=Math.ceil(this._config.numberOfChannels/2),t&&t.hrirPathList&&(Array.isArray(t.hrirPathList)&&t.hrirPathList.length===this._config.numberOfStereoChannels?this._config.pathList=t.hrirPathList:a.throw("HOARenderer: Invalid HRIR URLs. It must be an array with "+this._config.numberOfStereoChannels+" URLs to HRIR files. (got "+t.hrirPathList+")")),t&&t.renderingMode&&(Object.values(c).includes(t.renderingMode)?this._config.renderingMode=t.renderingMode:a.log("HOARenderer: Invalid rendering mode. (got "+t.renderingMode+') Fallbacks to "ambisonic".')),this._buildAudioGraph(),this._isRendererReady=!1}u.prototype._buildAudioGraph=function(){this.input=this._context.createGain(),this.output=this._context.createGain(),this._bypass=this._context.createGain(),this._hoaRotator=new s(this._context,this._config.ambisonicOrder),this._hoaConvolver=new n(this._context,this._config.ambisonicOrder),this.input.connect(this._hoaRotator.input),this.input.connect(this._bypass),this._hoaRotator.output.connect(this._hoaConvolver.input),this._hoaConvolver.output.connect(this.output),this.input.channelCount=this._config.numberOfChannels,this.input.channelCountMode="explicit",this.input.channelInterpretation="discrete"},u.prototype._initializeCallback=function(A,t){let e;(e=this._config.pathList?new i(this._context,this._config.pathList,{dataType:"url"}):2===this._config.ambisonicOrder?new i(this._context,r):new i(this._context,o)).load().then(function(t){this._hoaConvolver.setHRIRBufferList(t),this.setRenderingMode(this._config.renderingMode),this._isRendererReady=!0,a.log("HOARenderer: HRIRs loaded successfully. Ready."),A()}.bind(this),function(){const A="HOARenderer: HRIR loading/decoding failed.";a.throw(A),t(A)})},u.prototype.initialize=function(){return a.log("HOARenderer: Initializing... (mode: "+this._config.renderingMode+", ambisonic order: "+this._config.ambisonicOrder+")"),new Promise(this._initializeCallback.bind(this),function(A){a.throw("HOARenderer: Initialization failed. ("+A+")")})},u.prototype.setRotationMatrix3=function(A){this._isRendererReady&&this._hoaRotator.setRotationMatrix3(A)},u.prototype.setRotationMatrix4=function(A){this._isRendererReady&&this._hoaRotator.setRotationMatrix4(A)},u.prototype.setRenderingMode=function(A){if(A!==this._config.renderingMode){switch(A){case c.AMBISONIC:this._hoaConvolver.enable(),this._bypass.disconnect();break;case c.BYPASS:this._hoaConvolver.disable(),this._bypass.connect(this.output);break;case c.OFF:this._hoaConvolver.disable(),this._bypass.disconnect();break;default:return void a.log('HOARenderer: Rendering mode "'+A+'" is not supported.')}this._config.renderingMode=A,a.log("HOARenderer: Rendering mode changed. ("+A+")")}},A.exports=u},function(A,t){A.exports=["UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD+/wQA8/8YAP3/CgACAAAA//8CAAYA8/8AAPH/CgDv/97/e/+y/9P+UQDwAHUBEwV7/p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///H/CwDz/wEADgAHAPP/FADn/+3/AQD5//f/AgD7/wEABwAMAAEADQD8//n/8f8OAPX/BAD+//X/+v8WAAQA+f8CAAEA7/8QAAEA/P8DAAUA9f8KAAwA9v8DAAUA+f8OAAoA9f/7/w0A+v8EAAgA8P/6/woA+//8/wkA+P/3/woA+//8/wcA9//1/woAAwD5/wcA/P/3/w0AAwD3/wEABAD2/wkABgD3/wEABQD3/wUABQD3//v/BwD3/wMABQD3//r/CQD7////BQD6//n/CQD9//3/BAD9//j/BwAAAPv/AwD///j/BwABAPn/AQABAPn/BQACAPn///8DAPr/AwADAPr//v8EAPv/AQADAPv//P8FAP3///8DAPz/+/8FAP7//f8CAP7/+/8EAP///P8BAP//+/8DAAEA+/8AAAEA+/8CAAIA+////wIA/f8AAAIA/P/+/wIA/f8AAAIA/f/9/wMA/////wEA///+/wIA/////wAAAAD+/wAAAAD/////AAD//wAA//8AAP//AAD//wAA","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD////////+//////8AAP////8AAP//AAAAAPz//f8IAAMA9////w4AAQD6/wwA8//+/y8Afv/0/2H/UP5gAbH+2QG1B2cAVAIh/l32FPyM/nACPQDV/+UEo/Q6AQwCu/oLD9kF8QJA/Uz+Wf2KCOcC+wUKBsL5aQBQ97rwOPiPAvn5CAl8AHEDkQPcAA8Bn/lIAdz7HQF1+xz9cAM4/94E4gDKAun+cgPYAYr9JgJr/bf+ivxz/MoBgv5UA8EBSgAQAJ7/UgEk/cQB7f63/sD/vf4XAhT/BQFCADYAnQGI/9EBtv3hALD/vP+c/3H/TgIN/1sBpf8yAP3/4f8qABr+1f8OAJ3/dwAGADEBnv9JAPz/IQBwAIH/jgAS/4wAsACTAOn/DQDCALn/ZQCSAAIAAwD1/9//jv9aADQA/v9EAB0AfgA8AAQACgB9APr/IAARAPT/5v9xACAABAAHAGUAt/89AC4ACgAjAMP/+v/9/xYA7f/1/+D/7P87AC0Auv8RAAcA9/8FAC8A2//y/xIAEwAaADQAJADp/zoAAgAfABIA2f/e/zUA+P/6/w4A9//A/zcA4//P//T/5f/R////EwDb/w4A8/8BABkANADh/xEA+f/0/wIAHADc//j/GwD1//f/GADs/+v/EAAAAPz/EgD3/+r/FgAMAAkAGAD9/+z/IQAQAPH/GQD3//z/CgAfAOX/AgD8//H/BAATAOv/+v///wIABAAdAOj/BQAPAAcAAQATAOz/8/8JAAkA6f8VAOv/+f8QABUA/v8OAO3/+P8KABUA9f8FAPv/5/8TAA0A7f8XAAkAAQAJABYA4/8WAAcACgANABEA7v8EAP7/AAD+/wMA9//7/xAAAQD8/wQA+f/7/wMABgDq/wAA+v/3/wYACQD1//3/BAD9/wgADgDw//r/AgD6/wEACADv//j/BQD///X/BwDu//j/AgACAPP/BAD2//n/BAAGAPb/BAD8//3/BQAJAPL/AwD+//3/BAAIAPP//f8DAPz/AAAGAPP/+/8CAP7//f8FAPX/+f8DAAAA/P8EAPf/+v8GAAMA+/8EAPv/+/8GAAQA+v8CAP///P8EAAUA+f8AAP///f8CAAUA+P///wEA/v8BAAUA+f/+/wIAAAD//wUA+v/9/wMAAQD9/wQA+//9/wMAAgD8/wMA/P/9/wMAAwD7/wEA/v/+/wIAAwD6/wEA///+/wAABAD6/wAAAQD//wAAAwD7////AQAAAP//AwD8//7/AgABAP3/AgD9//7/AQABAP3/AQD+//7/AAACAPz/AAD+//////8BAP3/AAD//wAA//8BAP7/AAD//wAA/v8AAP7/AAD//wAA//8AAP//","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD//////P/9//3//////wAAAAAAAAIAAgACAP//CAAEAEEA//+cAAUAb/8HAAH9+P9eARkAogQUAJn8BwCd/gX/+QQNAKoC9gFdAtb/b/vd/936TP/6AsD/nfqn/un1W/0dA8IEsQLvAJv2bP72+WMAkP8dAcX+nQO2AIr6bP/EABX+NgK/Bdj2IQv2AE4EUAiD/xQAnwIm/B0B/wGNAoH7sQaP/b8CiQakAqD+R/9xA477KQL//6r75v/O/pcCgQCtAiMCBQAkANAARwHf//39hgBl/kUAJgEtAUEATgA/AgoASADK/zUAJv29/vL+l/9c/0cAUwBBAE8A6QE5/87/Wv9NAOf+5v7P/5P/4/9BAKYAQwDD/zYB5v+r/zYATwAp/1v/WQAEAB0AhwA0AA0AIAA3AAEAzv/u/+//5v9m/zwAIADQ/8T/SABiANb/SwAbAFf/MQDX/7L/hP8TAPr/AgAMAAsAHwAZAI3/VgDC/9v/5//x/6P/AwBlAMv/yf82AB4A+P9WAPj/NwDi/1EA0v9JANj/JwAcAAEADABYANj/4f8MAEwAmP82AN//3P8UADYA7//6/wIACADU/ygAyv82AN7/9v/2/ygAxv/9/+3/5//n/zUA6//g/y4ADgD5/wsABwDv/xIADwAGACoAJQD3/zIA+/8FABsAFgDO/zAAHAAIABQALADp/xcACAAAAPH/GADs/wkACQAFAAgAFQDp/wIAHAD1//P/EQDw/+3/GAD9/+f/HAD8//T/DAAQAPH/HwD4//r/DwAPAOj/EQACAOn/DAAXAOX/BAAOANH/9/8MAO//9f8LANT/9f8EAO//6f8NANb/+P8KAOz/5v8MAOD/7f8UAO//7//+//7/9v8YAPj/9f/z/wsA+v8SAPD/+v/x/xYA+f8SAPb/9//3/xEABQACAPn/9//y/xQACQD///b//v/7/xIACQD9//H/AAD7/xEAAgD5//P/AwD9/w8AAgD3//D/BAD//wUA/v/0//D/BgADAAMA/P/2//f/BwAGAP7/+//2//j/CAAFAPv/+f/5//v/BwAHAPn/9//7//7/BQAFAPf/9//+/wEABAACAPf/+P8BAAIAAgAAAPj/9/8CAAMAAAD+//n/+f8EAAQA/v/8//r/+/8EAAMA/P/7//z//P8EAAIA/P/5//7//v8DAAEA+//5//////8CAAAA+//5/wEAAAABAP//+//6/wIAAQD///3//P/7/wMAAQD///3//f/9/wIAAQD9//3//v/9/wMAAQD9//z/AAD//wEAAAD9//z/AAAAAAAA///9//3/AAD//wAA/v////7/AAD//wAA////////AAD//wAA//8AAP//","UklGRiQ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AkA/v/p/wMACwALAP7/9P/p/wcADQAFAPb/7//4/w0ACAD8//b//v/1/wMACwD1//T/8P/8/wAACQDz/+f/5P8GAAkABQD5//D/+v8FAA0AAwD///T/AgACABAA/v8CAPD/+/8FAAoA9f/3//f//v8GAP7/9v/t//z/+f8AAPj/+v/3/wEA+v8HAPr//P/5/wQA//8DAPr/+P/3/wYA///+//X/+//5/wQA/f/7//X/+//4/wMA/f/8//j//v/9/wYA///8//f/AgAAAAUA/f/6//n/AwACAAIA/f/7//z/AwACAAAA/f/6//3/AgADAP7//f/7/wAAAwAFAPz////8/wMAAgAEAPv//v/+/wMAAgADAPv//v///wMAAQABAPv//f8AAAIAAAD///v//f8BAAIA///+//z//v8CAAIA/v/9//3///8CAAEA/v/9//7/AAACAAAA/v/9////AAABAAAA/f/9/wAAAQABAP///f/+/wEAAQAAAP///v/+/wEAAQD///7//v///wEAAQD///7//v///wEAAAD+//7///8AAAAAAAD+//7///8AAAAA///+//7///8AAAAA////////AAAAAP////////////8AAP//////////","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAAAAAAAAAABAAAAAAD//////////////v////3/////////+//8////AQD9//z/9f8BAAIA+f8dACgAWQBxAJX/qv+Y/uz9aP9k/7UDUQQBAiQA4Pgi/AkB0gKaBsD/+fxp/vz9CQSp/I/+ywDO+vMD0fzK/PABcgBeBfoBv/+uAuH9Sf5gAy39awMmBWUBuP9fA9/9fgDj/2/+EACaACcCSv9Z/2j/rv7hAA0AWf55/7L84P7E/SIAT/67AMv/tf+FAA7/1v+7/gv/IP+E/sQA+P5aAXz/tP9XAFX/tP8o/4r/j//e/yQAMv9mAJT/rgCr/9X/EwCb//H/9f7F/6D/EAAoAK3//v+e/zsAh/+B/7r/if/C/2r/4P/z/6//HwCy/0IA7/9ZALT/y/80ACgA9v/J/9//DgA5ADUALQARADIACwAfAOf/NgArACMACQBBAEcAGAAjAC4AWQBUAHcAAAAfACEAIAAcAPj/CADk/yQA7v89AEEAFwD5/xYA6f8aAOX/AADF/zQADwAUAOT/BQDr/yUA6P8XAOf/HADR/0AA8P8nAAgACQDt/ycAKAAHAPH/IQDz/xsACADn//n/DgADAA4A8P///8z/GgDN/yMA/f8QANj/MwACAC0ACwAOAO3/JgAZAAUACgAAAA4AIgAaAAkADwACAAAAHQATAAUABQACAAgACwAjAO////8AAA8ABQAPAPL//f8GAAsABgAGAPD/8v8GAPz/CAD6//H/6v8PAAgABgD4//3/9v8aAAgABwD1//7//v8QAAoACAD//wUA9v8QAAoABAAFAAgAAgAJAAoAAwD//w0AAgD//wcA/v8DAAoABQAFABUABAAKAAYABwAHAA8ACgAGAAwADwAMAAkAEAAJAAgADwAMAAgADgAJAAUACQAPAAUACwAHAAEABgAIAAEABAAGAP//AgAJAAAAAgAEAP7///8IAAIA//8GAAEAAQAJAAIA/v8EAAMA//8JAAEA/v8DAAMA/v8HAAMA/f8BAAUA/v8FAAMA/v8BAAcA//8DAAMA/v8BAAYA//8CAAMA/////wcAAAAAAAMAAAD//wYAAQD+/wMAAQD//wUAAQD+/wIAAgD//wQAAgD+/wEAAwD//wMAAwD+/wEAAwD//wIAAwD//wEABAAAAAEABAD//wAABAABAAAAAwAAAAAABAABAP//AwABAAAAAwACAP//AgACAAAAAwACAP//AgACAAAAAgACAAAAAQADAAAAAQACAAAAAQADAAAAAQACAAAAAAACAAEAAAACAAEAAAACAAEAAAABAAEAAAABAAEAAAABAAEAAAABAAEAAAABAAEAAAABAAEAAAAAAAAAAAAAAAAA","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAAAAP//AAD//wAA//8AAAAA//8AAP//AAACAAAA+f8BAAYA///4/wIA//8AAA8A/v/V/wEAEwA9AAEBRwA2AF7/kfog/3gBwv99CDYBU/qtAUX/AP7OAfkAX/o9B38FSfwaAuT14/60BAr8CQAI/tfyIQTzAXP+egdUBBwBof7TBMT8bAWi/5EEWwBRAAAKyfxE/8b88vp6ACP+PAF4/qD8MQNM/ygCJ/2XAPD9kP5gAVT/iP9I/lEB4P8qAD0BFAGa/+7/DgB2AOP98gFm/u/+Vv5/AG8ASP9gAM//qv9w//oAcv+2/jIBHgA7/6D/oAAGAKH/lADT/wAAggC8AAYAkP9yAEcAkf8BAOD/RAAr/zUANwDt/xQAJQAkAMT/zwA/AOH/xv9zAGsANQBTAIcALAAvACIATACy/xMADADg/xcAWABvAJL/7f9VAPb/EgDt/wcA4f8kAPP/5P+h/wgACQDy//r/LgAQAMn/8/9CAOX/5v/S/9//3P8pABYAuP/s/w8AFgDt/+3/7v/w/9j/5/8GAOf/2P/2//P//v8kABMAuf/m/xoADADZ/+r/3P8KAAUAKwDe/wsA3P8VAAAADgAfAB0ACAAMAF4AGgAhAPL/MwDz/0kABAAKAPX/LwAbAAkA9v/s/+3/8/8CABAAAADm//n/BQALAAUAAQDj//n/JQAVAPX/9v/+/wIAEQABAPP/8P/1/wAABgD6/+3/7//o//j/DAD8/+b/8P8IAAkABgD4//D/8P8UAAoAAwD4/wAA+f8OAAcAAAAFAPX/9v8TAAkA8v8EAPb/9/8dAA0A7/8CAPn/+f8SAAQA8/8CAOf/+v8DAAgA9P////H//P8IAAUA8//0/wIAAQAGAAgA9//7/wAA+/8EAP//+P/+////AgACAAsA8v/+/wIABQD7/wgA9v/7/wMABAD5/wAA/P/3/wEAAQD7//7//P/1/wQA///3//r////3/wMAAwD1//r/AwD6////AgD4//n/AwD8//7/AgD4//n/AwD+//3/AQD4//n/BQD///n/AAD6//j/BAABAPj/AAD9//v/AwADAPj//v/+//z/AwAEAPj//v8BAP7/AQADAPj//f8CAP////8EAPr//P8DAAAA/v8CAPv//P8DAAEA/f8BAP3//f8DAAIA/P8AAP7//f8DAAIA/P///wAA/f8BAAIA+//+/wEA//8AAAEA+//+/wEA/////wEA/P/+/wEA///+/wAA/f/9/wEAAAD9/wAA/f/+/wEAAQD8/////v/+/wAAAQD8////////////AQD9////AAD/////AAD+////AAAAAP//AAD///////8AAP//A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ay////x0APAABAAQA2v8iAAcAEgDE/+v/FQD+/+P/DAD1/97/6v/4//X/EwD4/+7/5P8cAA0ACQDH//7/CQAXAAEA/P/5//j/CwAWAAEABQD9//n/AQAWAB0A7v/k/wAACQAmAP//9/8AAPn/8/8aAO//6/8fAOv/5v8hAP//5/8PAOf/AAAGAPn/6v8JAAYABgABAOv/1//1//L/+P8DABcA6f/8/wMACgD7/xAA3v/2//z/DADu//z/5v/5/wEA/P/6//7/7v/x/wQABgD5/wAA8v/w/wkAEQD2//j/+v8EAAcAEAD3//v/+v8CAAAACQD3//v//v/9/wUADAD2//X/AgAHAAAABwD2//T/BgAKAP7/AQD4//r/BAAIAPn/AAD3//f/BQAHAPv//v/7//n/BQAJAPj/+v/9//7/AgAGAPj/+f8BAAEAAgAFAPn/+v8BAAIAAAAEAPn/+f8CAAQA/v8BAPr/+v8CAAQA/P////v//P8CAAQA+//+//3//f8CAAUA+v/9//////8AAAQA+v/8////AAD//wIA+//8/wAAAQD+/wEA+//8/wAAAgD9/////P/9/wEAAgD8//7//f/9/wAAAgD8//3//v/+////AQD8//z/////////AAD8//3///8AAP7/AAD9//7///8AAP7////+//////8AAP7////+////////////////////","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD//////v8AAP///////wAAAAAAAP7/AQABAAAABwD///X/BQAjAPL/CQDb/9D/GAAb/7sAYwCW/z0BcP/X/7T/2QDW+wH8yANCCCUJ5QT++UXmhPwhA78FuAxH+p78ifudBlAG9vmu/lAK2fdlB///cfjoCa0E7Akn9Yb/zvba+AkAHPywBGEBFwUNAL8AXAAGA20DFvmR/kz+F/06Ag/+GwHl/5EEKgJd/q0AP/ym/9n6EfxY/2H+/QFtAC4C6QBDAaMCo/20/+3/3f/p/fL9rv9V/6cBhQHuAX4AcwJYAaH/IP/P/gsApP0LAe7/sQBuAI0AAgGDAE4BzACe/5X//v+v/+f+Zf+gAOv/5QBhAOIApAANASYAuP+h/8b/HQBr/9//bACWAGEAFAB5AD0AWQDU/+D/Yf/p//D/s/+R/4QAMQBvABEAkQBfABQAJgDW/wwA8/8XALz/vf8zAFAAKwD1/zEAPwDJ/x0A7/8LAOX/FwDR//H/EQAdAO//6P8QAFEA2f8WABEAMgDy/xIA+f/s/xAALgDv////HQAvAPT/+f8iAAYAEgAFABoAGgD//w0A+f/0/xsAHgDx/9f/GAACAPH/8f8JAPf/GwALABEA7/8cAPT/CgD2//j/BQD8/+3/OgAgAAYA9f8PAN7/DgD9/9r/1//3/+3/9//1//b/8//5//f/AgAJAOf/+v8OAAMACwD9/+7/5f8eAAEA9//q//7/8P8WAP7/+//4/wIA+f8TAAIA9f/5/wcA+P8iAAgA9v/n/xoA//8gAAUABwDj/wAA9v8BAAUAFQDn/wMA7v8QABAAEQDm/wwA8f8aAAAABwDu/wcACgASAAEA7//w//f/BgARAAkA6P/3/wcADgAKAAYA4f/4/wYADgAAAPr/8P/9/xQACgAHAPn/7//9/xEAAgD+//L/8v/8/xUAAwDw//H/9f8CAAsA/v/q//L/+f8FAAYA/P/r//j///8GAAkA+//o//j/AQAIAP//+v/o//v/CAAIAPv/+P/w/wEACQAHAPj/+f/0/wIACwAFAPb/+f/4/wQACwACAPP/+f/+/wYACAD///L/+/8BAAYABQD9//P//P8FAAUAAgD7//T//f8HAAQA///7//f///8IAAMA/P/6//r/AQAIAAEA+v/6//3/AgAHAAAA+f/7/wAAAwAFAP7/+P/8/wIAAgACAP3/+f/9/wMAAwAAAPz/+v/+/wQAAgD+//z/+/8AAAQAAQD8//z//f8BAAQAAAD7//3///8BAAMA///7//3/AAACAAEA/v/7//7/AQABAAAA/v/9////AQAAAP///v/+////AAD/////////////////////////////","UklGRiQEAABXQVZFZm10IBAAAAABAAIAgLsAAADuAgAEABAAZGF0YQAEAAD////////+//////8AAAAA/v/+/wAAAQD8//3/CQAJAP3/+v8PAAcApABlABkBkwCO/i//lfqa/HQAcf/3BdkCzwJcBCMC0wMN/9/9wgI7AaECYfxV/Tf83vhn/xrt8Owx/8n7cgHABYb43QcZDh4WugNrA7P74gHu/9z/zv0t/acCiQHY/iv4qQOl/ysCE/0//XT9Sf4O//j9xfupAn394gHO+rsCXAFIAxQC9wIXBgcD2AQuAnb/9gJh/6wAVfxEAI4Bvf7oAFv/bALsAMQBe/88/joAT/4dAH39/v9LAXn/gwDI//QBdABcAA0A7f4lAMn///+9/tv/iABp/13/pP/dALv/w/8MAHv//f+y/6////7U/5AAZP+Z/8r/nQDR/5r/DwDr/xAA4v+s/3z/+P9uAOv/t/82AGcAHgCb/yQAFQBGAM7/CgD3/xoAegAaAOz/CgBHAA8Adv8/AAAABQC2/xIAAAA7ABQAKgCj/z4AAQAXAJz/JAADAAcA8f/1/2AAAQAlAPD/NgDx/1wA7v/4/wMAZADv//3/HQAkAFoA8P9FAPv/FgBIAPf/WQAHAEUACQD0/xIAQwDu/wMAwP9VALn/XwCw/yEA5f8sAPj/FgDD/1YAyv8rAOX/HQDo//j/IQAQACAAHwD9/yQAHQBAABgABQAiAAUAKAD3/wkACwAKAAMABwAJAPb/+f8GAOr/JQAHABMA6P8TAA4AGgD//woA8/8ZAP//GADu/w0A9v8SAAMABwD4/wQA5P8XAAQACgDq/wUA+/8VAAcACADs/xIAAAATAPH/+v/1//T/7f///+z/+v/y/+//9/8KAAcACgAJAPT/BAAKAAAABgAIAPL/9v8KAAMABAACAPr/9v8OAAIA+P/x//v/+f8MAPb/+P/w/wQA9f8MAPn////7/woA/v8PAAEAAgD1/xAAAQAPAP//AwD//xQABwALAAAABgADABAAAgAHAAAACAABAA8ABQAFAAMABwAEAA4ABwADAAEACQAFAAoAAwD//wAACQADAAUAAQD/////CAABAAMAAAD/////BwACAAEAAAD/////BwACAP7///8BAAAABgABAP7///8CAAAABAAAAP7///8DAAAAAwAAAP3///8DAAAAAQAAAP3//v8EAAAAAAD+//////8EAP/////+/wAA/v8EAP/////+/wEA/v8EAP///v/+/wIA//8DAP///v/+/wIA//8BAP///v/+/wMA//8BAP/////+/wMA//8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AAAAQAAAAeAAAABAAAAAYAAAAZAAAAAQAAAA4AAAATAAAA/v8AAAoAAAAOAAAA+/8AAAsAAAAJAAAA+f8AAAsAAAABAAAA+f8AAAoAAAD9/wAA+v8AAAcAAAD5/wAA+v8AAAUAAAD3/wAA/f8AAAQAAAD2/wAAAAAAAAEAAAD3/wAAAgAAAAAAAAD4/wAAAwAAAP7/AAD6/wAABAAAAP3/AAD8/wAABAAAAPv/AAD+/wAAAwAAAPv/AAD//wAAAQAAAPv/AAAAAAAAAAAAAPv/AAACAAAA//8AAPz/AAACAAAA/v8AAP3/AAACAAAA/f8AAP7/AAABAAAA/f8AAP//AAABAAAA/f8AAAAAAAAAAAAA/v8AAAEAAAAAAAAA//8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA"]},function(A,t,e){"use strict";t.getBrowserInfo=function(){const A=navigator.userAgent;let t,e=A.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i)||[];if(/trident/i.test(e[1]))return{name:"IE",version:(t=/\brv[ :]+(\d+)/g.exec(A)||[])[1]||""};if("Chrome"===e[1]&&null!=(t=A.match(/\bOPR|Edge\/(\d+)/)))return{name:"Opera",version:t[1]};e=e[2]?[e[1],e[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=A.match(/version\/([\d.]+)/i))&&e.splice(1,1,t[1]);let i=A.match(/android|ipad|iphone/i);return i||(i=A.match(/cros|linux|mac os x|windows/i)),{name:e[0],version:e[1],platform:i?i[0]:"unknown"}},t.patchSafari=function(){window.webkitAudioContext&&window.webkitOfflineAudioContext&&(window.AudioContext=window.webkitAudioContext,window.OfflineAudioContext=window.webkitOfflineAudioContext)}},function(A,t,e){"use strict";A.exports="1.0.6"}])})},function(A,t,e){"use strict";A.exports="0.0.4"}])})},function(A,t,e){if("undefined"==typeof AFRAME)throw new Error("Component attempted to register before AFRAME was available. Did you include A-Frame?");const i=e(3).version,n=AFRAME.utils.debug,s=n("A-Frame Resonance Audio Component:info");n("A-Frame Resonance Audio Component:warn");s(`Version: ${i}`),e(0),e(4),e(5)},function(A){A.exports={name:"@digaverse/aframe-resonance-audio-component",version:"0.3.1",description:"Google Resonance component for A-Frame (https://aframe.io).",main:"src/index.js",repository:{type:"git",url:"git+https://github.com/digaverse/aframe-resonance-audio-component.git"},bugs:{url:"https://github.com/digaverse/aframe-resonance-audio-component/issues"},homepage:"https://github.com/digaverse/aframe-resonance-audio-component#readme",author:"Marko Kungla <marko.kungla@gmail.com>",license:"MIT",keywords:["aframe","a-frame","aframe-component","aframe-vr","vr","webgl","webvr","mozvr"],scripts:{start:"webpack-dev-server --config ./config/webpack-dev.js --mode development --progress --colors",build:"webpack --config ./config/webpack-prod.js --mode production","gh-pages":"git subtree push --prefix examples github/digaverse gh-pages",lint:"./node_modules/.bin/eslint tests/ src/ config/",test:"karma start ./tests/karma.conf.js","test:firefox":"karma start ./tests/karma.conf.js --browsers Firefox","test:chrome":"karma start ./tests/karma.conf.js --browsers Chrome"},dependencies:{"resonance-audio":"^1.0.0"},devDependencies:{aframe:"^0.8.2",browserify:"^16.2.2",chai:"^4.1.2","chai-shallow-deep-equal":"^1.4.6","clean-webpack-plugin":"^0.1.19",eslint:"^5.1.0","eslint-config-standard":"^11.0.0","eslint-plugin-import":"^2.13.0","eslint-plugin-node":"^7.0.1","eslint-plugin-promise":"^3.8.0","eslint-plugin-standard":"^3.1.0",karma:"^2.0.4","karma-browserify":"^5.3.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^2.2.0","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.1.0","karma-mocha":"^1.3.0","karma-mocha-reporter":"^2.2.5","karma-sinon-chai":"^2.0.2",mocha:"^5.2.0","mozilla-download":"^1.1.1",sinon:"^6.1.0","sinon-chai":"^3.2.0",standard:"^11.0.1",watchify:"^3.11.0",webpack:"^4.8.3","webpack-cli":"^3.1.0","webpack-dev-server":"^3.1.4"}}},function(A,t,e){e(0),AFRAME.registerComponent("resonance-audio-room-bb",{dependencies:["position","geometry"],schema:AFRAME.components["resonance-audio-room"].schema,init(){this.el.components["obj-model"]&&!this.el.components["obj-model"].model?this.el.addEventListener("model-loaded",A=>this.loadAudioRoom()):this.loadAudioRoom()},loadAudioRoom(){const A=(new THREE.Box3).setFromObject(this.el.object3D);this.data.width=A.getSize().x,this.data.height=A.getSize().y,this.data.depth=A.getSize().z,this.el.setAttribute("resonance-audio-room",this.data)}})},function(A,t,e){const{ResonanceAudio:i}=e(1),n=(0,AFRAME.utils.debug)("components:resonance-audio-src:warn");function s(A){return"object"==typeof A&&void 0!==A.x&&void 0!==A.y&&void 0!==A.z}AFRAME.registerComponent("resonance-audio-src",{dependencies:["position","rotation"],schema:{src:{type:"string"},loop:{type:"boolean",default:!0},autoplay:{type:"boolean",default:!0},gain:{type:"number",default:i.Utils.DEFAULT_SOURCE_GAIN},maxDistance:{type:"number",default:i.Utils.DEFAULT_MAX_DISTANCE},minDistance:{type:"number",default:i.Utils.DEFAULT_MIN_DISTANCE},directivityPattern:{type:"vec2",default:{x:i.Utils.DEFAULT_DIRECTIVITY_ALPHA,y:i.Utils.DEFAULT_DIRECTIVITY_SHARPNESS}},sourceWidth:{type:"number",default:i.Utils.DEFAULT_SOURCE_WIDTH},rolloff:{type:"string",oneOff:i.Utils.ATTENUATION_ROLLOFFS,default:i.Utils.DEFAULT_ATTENUATION_ROLLOFF},position:{type:"vec3",default:{}},rotation:{type:"vec3",default:{}},visualize:{type:"boolean",default:!1}},init(){this.room=null,this.connected={element:!1,stream:!1},this.sound=null,this.resonance=null,this.visualization=null,this.mediaAudioSourceNodes=new Map,this.el.addEventListener("componentchanged",A=>{"position"!==A.detail.name&&"rotation"!==A.detail.name||(this.room.updatePosition(),this.updatePosition(),this.updateVisualization())}),this.el.sceneEl.addEventListener("loaded",A=>this.updateVisualization())},initAudioSrc(A){if(this.room)throw new Error("audio src can only be initiated once");this.room=A,this.resonance=this.room.resonanceAudioScene.createSource(),this.updateSoundSettings(),this.room.updatePosition(),this.updatePosition(),this.defaultAudioEl=document.createElement("audio"),this.mediaAudioSourceNodes.set(this.defaultAudioEl,this.room.audioContext.createMediaElementSource(this.defaultAudioEl)),this.setSrc(this.data.src),this.updateVisualization()},update(A){this.room&&A.src!==this.data.src&&this.setSrc(this.data.src),this.updateSoundSettings(),this.updatePlaybackSettings(),this.updatePosition(),this.updateVisualization(A)},updateSoundSettings(){const A=this.resonance;A&&(A.setGain(this.data.gain),A.setMinDistance(this.data.minDistance),A.setMaxDistance(this.data.maxDistance),A.setDirectivityPattern(this.data.directivityPattern.x,this.data.directivityPattern.y),A.setSourceWidth(this.data.sourceWidth),A.setRolloff(this.data.rolloff))},updatePlaybackSettings(){this.connected.element&&(this.data.loop?this.sound.setAttribute("loop","true"):this.sound.removeAttribute("loop"),this.data.autoplay?this.sound.setAttribute("autoplay","true"):this.sound.removeAttribute("autoplay"))},updatePosition(){if(this.resonance)return this.resonance.setFromMatrix(this.getMatrixRoom()),this},getMatrixWorld(){if(this.el.sceneEl.object3D.updateMatrixWorld(),s(this.data.position)||s(this.data.rotation)){const A=s(this.data.position)?new THREE.Vector3(this.data.position.x,this.data.position.y,this.data.position.z):this.el.object3D.position,t=s(this.data.rotation)?(new THREE.Euler).reorder("YXZ").fromArray([this.data.rotation.x,this.data.rotation.y,this.data.rotation.z].map(THREE.Math.degToRad)):this.el.object3D.rotation;return(new THREE.Matrix4).multiplyMatrices(this.el.object3D.parent.matrixWorld,(new THREE.Matrix4).compose(A,(new THREE.Quaternion).setFromEuler(t),{x:1,y:1,z:1}))}return(new THREE.Matrix4).copy(this.el.object3D.matrixWorld)},getMatrixRoom(){return this.getMatrixWorld().premultiply((new THREE.Matrix4).getInverse(this.room.el.object3D.matrixWorld))},updateVisualization(A){const t=this.data;if(A&&(!A.visualize&&t.visualize?(this.visualization||(this.visualization=document.createElement("a-sphere"),this.visualization.audioSrc=this.el,this.visualization.setAttribute("material","wireframe",!0)),this.el.sceneEl.appendChild(this.visualization)):A.visualize&&!t.visualize&&(this.el.sceneEl.removeChild(this.visualization),this.visualization=null)),t.visualize){const A=new THREE.Vector3,e=new THREE.Quaternion,i=new THREE.Vector3;this.getMatrixWorld().decompose(A,e,i);const n=(new THREE.Euler).setFromQuaternion(e,"YXZ"),s=THREE.Math.radToDeg;this.visualization.setAttribute("position",A),this.visualization.setAttribute("rotation",{x:s(n.x),y:s(n.y),z:s(n.z)}),this.visualization.setAttribute("radius",t.minDistance)}return this},disconnect(){this.sound&&(this.mediaAudioSourceNodes.get(this.sound).disconnect(this.resonance.input),this.sound=null),this.connected.element=!1,this.connected.stream=!1},_connect(A,t){return this.disconnect(),!!A&&(this.sound=A,this.mediaAudioSourceNodes.has(this.sound)||this.mediaAudioSourceNodes.set(this.sound,t.call(this.room.audioContext,this.sound)),this.mediaAudioSourceNodes.get(this.sound).connect(this.resonance.input),!0)},connectWithElement(A){this.connected.element=this._connect(A,this.room.audioContext.createMediaElementSource),this.connected.element&&(this.sound.srcObject&&n("can't use a HTMLMediaElement that contains a stream. Connect the stream itself."),this.updatePlaybackSettings(),this.sound.getAttribute("autoplay")&&this.sound.play())},connectWithStream(A){if(this.connected.stream=this._connect(A,this.room.audioContext.createMediaStreamSource),!this.connected.stream)return;const t=()=>n("can't use play/pause on MediaStream. Manipulate the stream's source instead");this.sound.play=t,this.sound.pause=t},setSrc(A){const t="invalid src value. Must be element id string, resource string, HTMLMediaElement or MediaStream";let e;if(A)if(A instanceof MediaStream)this.connectWithStream(A);else if(A instanceof HTMLMediaElement)this.connectWithElement(A);else{if("string"!=typeof A)throw new TypeError(t);if("#"===A.charAt(0)?e=document.getElementById(A.substr(1)):(e=this.defaultAudioEl).setAttribute("src",A),!e)throw new TypeError(t);this.connectWithElement(e)}else this.disconnect();this.data.src=e||A},remove(){this.disconnect(),this.defaultAudioEl.remove(),this.visualization&&(this.el.sceneEl.removeChild(this.visualization),this.visualization=null)}}),AFRAME.registerPrimitive("a-resonance-audio-src",{defaultComponents:{"resonance-audio-src":{}},mappings:{src:"resonance-audio-src.src",loop:"resonance-audio-src.loop",autoplay:"resonance-audio-src.autoplay",gain:"resonance-audio-src.gain","min-distance":"resonance-audio-src.minDistance","max-distance":"resonance-audio-src.maxDistaonce","directivity-pattern":"resonance-audio-src.directivityPattern","source-width":"resonance-audio-src.sourceWidth",rolloff:"resonance-audio-src.rolloff",visualize:"resonance-audio-src.visualize"}})}]);