UNPKG

@splinetool/runtime

Version:

1 lines 1.45 MB
"use strict";var nI=Object.create;var bf=Object.defineProperty;var rI=Object.getOwnPropertyDescriptor;var iI=Object.getOwnPropertyNames;var sI=Object.getPrototypeOf,oI=Object.prototype.hasOwnProperty;var ky=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),GS=(r,e)=>{for(var t in e)bf(r,t,{get:e[t],enumerable:!0})},kS=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of iI(e))!oI.call(r,i)&&i!==t&&bf(r,i,{get:()=>e[i],enumerable:!(n=rI(e,i))||n.enumerable});return r};var lo=(r,e,t)=>(t=r!=null?nI(sI(r)):{},kS(e||!r||!r.__esModule?bf(t,"default",{value:r,enumerable:!0}):t,r)),aI=r=>kS(bf({},"__esModule",{value:!0}),r);var WM=ky((_x,HM)=>{(function(r,e){typeof _x=="object"?HM.exports=e():typeof define=="function"&&define.amd?define(e):r.Alea=e()})(_x,function(){"use strict";return r.importState=function(t){var n=new r;return n.importState(t),n},r;function r(){return function(t){var n=0,i=0,s=0,o=1;t.length==0&&(t=[+new Date]);var a=e();n=a(" "),i=a(" "),s=a(" ");for(var l=0;l<t.length;l++)n-=a(t[l]),n<0&&(n+=1),i-=a(t[l]),i<0&&(i+=1),s-=a(t[l]),s<0&&(s+=1);a=null;var u=function(){var c=2091639*n+o*23283064365386963e-26;return n=i,i=s,s=c-(o=c|0)};return u.next=u,u.uint32=function(){return u()*4294967296},u.fract53=function(){return u()+(u()*2097152|0)*11102230246251565e-32},u.version="Alea 0.9",u.args=t,u.exportState=function(){return[n,i,s,o]},u.importState=function(c){n=+c[0]||0,i=+c[1]||0,s=+c[2]||0,o=+c[3]||0},u}(Array.prototype.slice.call(arguments))}function e(){var t=4022871197,n=function(i){i=i.toString();for(var s=0;s<i.length;s++){t+=i.charCodeAt(s);var o=.02519603282416938*t;t=o>>>0,o-=t,o*=t,t=o>>>0,o-=t,t+=o*4294967296}return(t>>>0)*23283064365386963e-26};return n.version="Mash 0.9",n}})});var Mx=ky((Ym,YM)=>{(function(r,e){typeof Ym=="object"&&typeof YM<"u"?e(Ym):typeof define=="function"&&define.amd?define(["exports"],e):e((r=typeof globalThis<"u"?globalThis:r||self).SVDJS={})})(Ym,function(r){"use strict";r.SVD=function(e,t,n,i,s){if(t=t===void 0||t,n=n===void 0||n,s=1e-64/(i=i||Math.pow(2,-52)),!e)throw new TypeError("Matrix a is not defined");var o,a,l,u,c,d,h,f,g,p,m,y,v=e[0].length,x=e.length;if(x<v)throw new TypeError("Invalid matrix: m < n");for(var b=[],w=[],A=[],T=t==="f"?x:v,S=p=h=0;S<x;S++)w[S]=new Array(T).fill(0);for(S=0;S<v;S++)A[S]=new Array(v).fill(0);var M,E=new Array(v).fill(0);for(S=0;S<x;S++)for(o=0;o<v;o++)w[S][o]=e[S][o];for(S=0;S<v;S++){for(b[S]=h,g=0,l=S+1,o=S;o<x;o++)g+=Math.pow(w[o][S],2);if(g<s)h=0;else for(f=(d=w[S][S])*(h=d<0?Math.sqrt(g):-Math.sqrt(g))-g,w[S][S]=d-h,o=l;o<v;o++){for(g=0,a=S;a<x;a++)g+=w[a][S]*w[a][o];for(d=g/f,a=S;a<x;a++)w[a][o]=w[a][o]+d*w[a][S]}for(E[S]=h,g=0,o=l;o<v;o++)g+=Math.pow(w[S][o],2);if(g<s)h=0;else{for(f=(d=w[S][S+1])*(h=d<0?Math.sqrt(g):-Math.sqrt(g))-g,w[S][S+1]=d-h,o=l;o<v;o++)b[o]=w[S][o]/f;for(o=l;o<x;o++){for(g=0,a=l;a<v;a++)g+=w[o][a]*w[S][a];for(a=l;a<v;a++)w[o][a]=w[o][a]+g*b[a]}}p<(m=Math.abs(E[S])+Math.abs(b[S]))&&(p=m)}if(n)for(S=v-1;0<=S;S--){if(h!==0){for(f=w[S][S+1]*h,o=l;o<v;o++)A[o][S]=w[S][o]/f;for(o=l;o<v;o++){for(g=0,a=l;a<v;a++)g+=w[S][a]*A[a][o];for(a=l;a<v;a++)A[a][o]=A[a][o]+g*A[a][S]}}for(o=l;o<v;o++)A[S][o]=0,A[o][S]=0;A[S][S]=1,h=b[S],l=S}if(t){if(t==="f")for(S=v;S<x;S++){for(o=v;o<x;o++)w[S][o]=0;w[S][S]=1}for(S=v-1;0<=S;S--){for(l=S+1,h=E[S],o=l;o<T;o++)w[S][o]=0;if(h!==0){for(f=w[S][S]*h,o=l;o<T;o++){for(g=0,a=l;a<x;a++)g+=w[a][S]*w[a][o];for(d=g/f,a=S;a<x;a++)w[a][o]=w[a][o]+d*w[a][S]}for(o=S;o<x;o++)w[o][S]=w[o][S]/h}else for(o=S;o<x;o++)w[o][S]=0;w[S][S]=w[S][S]+1}}for(i*=p,a=v-1;0<=a;a--)for(var I=0;I<50;I++){for(M=!1,l=a;0<=l;l--){if(Math.abs(b[l])<=i){M=!0;break}if(Math.abs(E[l-1])<=i)break}if(!M){for(c=0,u=l-(g=1),S=l;S<a+1&&(d=g*b[S],b[S]=c*b[S],!(Math.abs(d)<=i));S++)if(h=E[S],E[S]=Math.sqrt(d*d+h*h),c=h/(f=E[S]),g=-d/f,t)for(o=0;o<x;o++)m=w[o][u],y=w[o][S],w[o][u]=m*c+y*g,w[o][S]=-m*g+y*c}if(y=E[a],l===a){if(y<0&&(E[a]=-y,n))for(o=0;o<v;o++)A[o][a]=-A[o][a];break}for(p=E[l],d=(((m=E[a-1])-y)*(m+y)+((h=b[a-1])-(f=b[a]))*(h+f))/(2*f*m),h=Math.sqrt(d*d+1),d=((p-y)*(p+y)+f*(m/(d<0?d-h:d+h)-f))/p,S=l+(g=c=1);S<a+1;S++){if(h=b[S],m=E[S],f=g*h,h*=c,y=Math.sqrt(d*d+f*f),d=p*(c=d/(b[S-1]=y))+h*(g=f/y),h=-p*g+h*c,f=m*g,m*=c,n)for(o=0;o<v;o++)p=A[o][S-1],y=A[o][S],A[o][S-1]=p*c+y*g,A[o][S]=-p*g+y*c;if(y=Math.sqrt(d*d+f*f),d=(c=d/(E[S-1]=y))*h+(g=f/y)*m,p=-g*h+c*m,t)for(o=0;o<x;o++)m=w[o][S-1],y=w[o][S],w[o][S-1]=m*c+y*g,w[o][S]=-m*g+y*c}b[l]=0,b[a]=d,E[a]=p}for(S=0;S<v;S++)E[S]<i&&(E[S]=0);return{u:w,q:E,v:A}},r.VERSION="1.1.1",Object.defineProperty(r,"__esModule",{value:!0})})});var cC=ky(wg=>{(function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var c=this||e;return c._counter=1e3,c._html5AudioPool=[],c.html5PoolSize=10,c._codecs={},c._howls=[],c._muted=!1,c._volume=1,c._canPlayEvent="canplaythrough",c._navigator=typeof window<"u"&&window.navigator?window.navigator:null,c.masterGain=null,c.noAudio=!1,c.usingWebAudio=!0,c.autoSuspend=!0,c.ctx=null,c.autoUnlock=!0,c._setup(),c},volume:function(c){var d=this||e;if(c=parseFloat(c),d.ctx||u(),typeof c<"u"&&c>=0&&c<=1){if(d._volume=c,d._muted)return d;d.usingWebAudio&&d.masterGain.gain.setValueAtTime(c,e.ctx.currentTime);for(var h=0;h<d._howls.length;h++)if(!d._howls[h]._webAudio)for(var f=d._howls[h]._getSoundIds(),g=0;g<f.length;g++){var p=d._howls[h]._soundById(f[g]);p&&p._node&&(p._node.volume=p._volume*c)}return d}return d._volume},mute:function(c){var d=this||e;d.ctx||u(),d._muted=c,d.usingWebAudio&&d.masterGain.gain.setValueAtTime(c?0:d._volume,e.ctx.currentTime);for(var h=0;h<d._howls.length;h++)if(!d._howls[h]._webAudio)for(var f=d._howls[h]._getSoundIds(),g=0;g<f.length;g++){var p=d._howls[h]._soundById(f[g]);p&&p._node&&(p._node.muted=c?!0:p._muted)}return d},stop:function(){for(var c=this||e,d=0;d<c._howls.length;d++)c._howls[d].stop();return c},unload:function(){for(var c=this||e,d=c._howls.length-1;d>=0;d--)c._howls[d].unload();return c.usingWebAudio&&c.ctx&&typeof c.ctx.close<"u"&&(c.ctx.close(),c.ctx=null,u()),c},codecs:function(c){return(this||e)._codecs[c.replace(/^x-/,"")]},_setup:function(){var c=this||e;if(c.state=c.ctx&&c.ctx.state||"suspended",c._autoSuspend(),!c.usingWebAudio)if(typeof Audio<"u")try{var d=new Audio;typeof d.oncanplaythrough>"u"&&(c._canPlayEvent="canplay")}catch{c.noAudio=!0}else c.noAudio=!0;try{var d=new Audio;d.muted&&(c.noAudio=!0)}catch{}return c.noAudio||c._setupCodecs(),c},_setupCodecs:function(){var c=this||e,d=null;try{d=typeof Audio<"u"?new Audio:null}catch{return c}if(!d||typeof d.canPlayType!="function")return c;var h=d.canPlayType("audio/mpeg;").replace(/^no$/,""),f=c._navigator?c._navigator.userAgent:"",g=f.match(/OPR\/([0-6].)/g),p=g&&parseInt(g[0].split("/")[1],10)<33,m=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,y=f.match(/Version\/(.*?) /),v=m&&y&&parseInt(y[1],10)<15;return c._codecs={mp3:!!(!p&&(h||d.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!h,opus:!!d.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!d.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(d.canPlayType('audio/wav; codecs="1"')||d.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!d.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!d.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(d.canPlayType("audio/x-m4a;")||d.canPlayType("audio/m4a;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(d.canPlayType("audio/x-m4b;")||d.canPlayType("audio/m4b;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(d.canPlayType("audio/x-mp4;")||d.canPlayType("audio/mp4;")||d.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!v&&d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!v&&d.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!d.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(d.canPlayType("audio/x-flac;")||d.canPlayType("audio/flac;")).replace(/^no$/,"")},c},_unlockAudio:function(){var c=this||e;if(!(c._audioUnlocked||!c.ctx)){c._audioUnlocked=!1,c.autoUnlock=!1,!c._mobileUnloaded&&c.ctx.sampleRate!==44100&&(c._mobileUnloaded=!0,c.unload()),c._scratchBuffer=c.ctx.createBuffer(1,1,22050);var d=function(h){for(;c._html5AudioPool.length<c.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,c._releaseHtml5Audio(f)}catch{c.noAudio=!0;break}for(var g=0;g<c._howls.length;g++)if(!c._howls[g]._webAudio)for(var p=c._howls[g]._getSoundIds(),m=0;m<p.length;m++){var y=c._howls[g]._soundById(p[m]);y&&y._node&&!y._node._unlocked&&(y._node._unlocked=!0,y._node.load())}c._autoResume();var v=c.ctx.createBufferSource();v.buffer=c._scratchBuffer,v.connect(c.ctx.destination),typeof v.start>"u"?v.noteOn(0):v.start(0),typeof c.ctx.resume=="function"&&c.ctx.resume(),v.onended=function(){v.disconnect(0),c._audioUnlocked=!0,document.removeEventListener("touchstart",d,!0),document.removeEventListener("touchend",d,!0),document.removeEventListener("click",d,!0),document.removeEventListener("keydown",d,!0);for(var x=0;x<c._howls.length;x++)c._howls[x]._emit("unlock")}};return document.addEventListener("touchstart",d,!0),document.addEventListener("touchend",d,!0),document.addEventListener("click",d,!0),document.addEventListener("keydown",d,!0),c}},_obtainHtml5Audio:function(){var c=this||e;if(c._html5AudioPool.length)return c._html5AudioPool.pop();var d=new Audio().play();return d&&typeof Promise<"u"&&(d instanceof Promise||typeof d.then=="function")&&d.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(c){var d=this||e;return c._unlocked&&d._html5AudioPool.push(c),d},_autoSuspend:function(){var c=this;if(!(!c.autoSuspend||!c.ctx||typeof c.ctx.suspend>"u"||!e.usingWebAudio)){for(var d=0;d<c._howls.length;d++)if(c._howls[d]._webAudio){for(var h=0;h<c._howls[d]._sounds.length;h++)if(!c._howls[d]._sounds[h]._paused)return c}return c._suspendTimer&&clearTimeout(c._suspendTimer),c._suspendTimer=setTimeout(function(){if(!!c.autoSuspend){c._suspendTimer=null,c.state="suspending";var f=function(){c.state="suspended",c._resumeAfterSuspend&&(delete c._resumeAfterSuspend,c._autoResume())};c.ctx.suspend().then(f,f)}},3e4),c}},_autoResume:function(){var c=this;if(!(!c.ctx||typeof c.ctx.resume>"u"||!e.usingWebAudio))return c.state==="running"&&c.ctx.state!=="interrupted"&&c._suspendTimer?(clearTimeout(c._suspendTimer),c._suspendTimer=null):c.state==="suspended"||c.state==="running"&&c.ctx.state==="interrupted"?(c.ctx.resume().then(function(){c.state="running";for(var d=0;d<c._howls.length;d++)c._howls[d]._emit("resume")}),c._suspendTimer&&(clearTimeout(c._suspendTimer),c._suspendTimer=null)):c.state==="suspending"&&(c._resumeAfterSuspend=!0),c}};var e=new r,t=function(c){var d=this;if(!c.src||c.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}d.init(c)};t.prototype={init:function(c){var d=this;return e.ctx||u(),d._autoplay=c.autoplay||!1,d._format=typeof c.format!="string"?c.format:[c.format],d._html5=c.html5||!1,d._muted=c.mute||!1,d._loop=c.loop||!1,d._pool=c.pool||5,d._preload=typeof c.preload=="boolean"||c.preload==="metadata"?c.preload:!0,d._rate=c.rate||1,d._sprite=c.sprite||{},d._src=typeof c.src!="string"?c.src:[c.src],d._volume=c.volume!==void 0?c.volume:1,d._xhr={method:c.xhr&&c.xhr.method?c.xhr.method:"GET",headers:c.xhr&&c.xhr.headers?c.xhr.headers:null,withCredentials:c.xhr&&c.xhr.withCredentials?c.xhr.withCredentials:!1},d._duration=0,d._state="unloaded",d._sounds=[],d._endTimers={},d._queue=[],d._playLock=!1,d._onend=c.onend?[{fn:c.onend}]:[],d._onfade=c.onfade?[{fn:c.onfade}]:[],d._onload=c.onload?[{fn:c.onload}]:[],d._onloaderror=c.onloaderror?[{fn:c.onloaderror}]:[],d._onplayerror=c.onplayerror?[{fn:c.onplayerror}]:[],d._onpause=c.onpause?[{fn:c.onpause}]:[],d._onplay=c.onplay?[{fn:c.onplay}]:[],d._onstop=c.onstop?[{fn:c.onstop}]:[],d._onmute=c.onmute?[{fn:c.onmute}]:[],d._onvolume=c.onvolume?[{fn:c.onvolume}]:[],d._onrate=c.onrate?[{fn:c.onrate}]:[],d._onseek=c.onseek?[{fn:c.onseek}]:[],d._onunlock=c.onunlock?[{fn:c.onunlock}]:[],d._onresume=[],d._webAudio=e.usingWebAudio&&!d._html5,typeof e.ctx<"u"&&e.ctx&&e.autoUnlock&&e._unlockAudio(),e._howls.push(d),d._autoplay&&d._queue.push({event:"play",action:function(){d.play()}}),d._preload&&d._preload!=="none"&&d.load(),d},load:function(){var c=this,d=null;if(e.noAudio){c._emit("loaderror",null,"No audio support.");return}typeof c._src=="string"&&(c._src=[c._src]);for(var h=0;h<c._src.length;h++){var f,g;if(c._format&&c._format[h])f=c._format[h];else{if(g=c._src[h],typeof g!="string"){c._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(g),f||(f=/\.([^.]+)$/.exec(g.split("?",1)[0])),f&&(f=f[1].toLowerCase())}if(f||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),f&&e.codecs(f)){d=c._src[h];break}}if(!d){c._emit("loaderror",null,"No codec support for selected audio sources.");return}return c._src=d,c._state="loading",window.location.protocol==="https:"&&d.slice(0,5)==="http:"&&(c._html5=!0,c._webAudio=!1),new n(c),c._webAudio&&s(c),c},play:function(c,d){var h=this,f=null;if(typeof c=="number")f=c,c=null;else{if(typeof c=="string"&&h._state==="loaded"&&!h._sprite[c])return null;if(typeof c>"u"&&(c="__default",!h._playLock)){for(var g=0,p=0;p<h._sounds.length;p++)h._sounds[p]._paused&&!h._sounds[p]._ended&&(g++,f=h._sounds[p]._id);g===1?c=null:f=null}}var m=f?h._soundById(f):h._inactiveSound();if(!m)return null;if(f&&!c&&(c=m._sprite||"__default"),h._state!=="loaded"){m._sprite=c,m._ended=!1;var y=m._id;return h._queue.push({event:"play",action:function(){h.play(y)}}),y}if(f&&!m._paused)return d||h._loadQueue("play"),m._id;h._webAudio&&e._autoResume();var v=Math.max(0,m._seek>0?m._seek:h._sprite[c][0]/1e3),x=Math.max(0,(h._sprite[c][0]+h._sprite[c][1])/1e3-v),b=x*1e3/Math.abs(m._rate),w=h._sprite[c][0]/1e3,A=(h._sprite[c][0]+h._sprite[c][1])/1e3;m._sprite=c,m._ended=!1;var T=function(){m._paused=!1,m._seek=v,m._start=w,m._stop=A,m._loop=!!(m._loop||h._sprite[c][2])};if(v>=A){h._ended(m);return}var S=m._node;if(h._webAudio){var M=function(){h._playLock=!1,T(),h._refreshBuffer(m);var C=m._muted||h._muted?0:m._volume;S.gain.setValueAtTime(C,e.ctx.currentTime),m._playStart=e.ctx.currentTime,typeof S.bufferSource.start>"u"?m._loop?S.bufferSource.noteGrainOn(0,v,86400):S.bufferSource.noteGrainOn(0,v,x):m._loop?S.bufferSource.start(0,v,86400):S.bufferSource.start(0,v,x),b!==1/0&&(h._endTimers[m._id]=setTimeout(h._ended.bind(h,m),b)),d||setTimeout(function(){h._emit("play",m._id),h._loadQueue()},0)};e.state==="running"&&e.ctx.state!=="interrupted"?M():(h._playLock=!0,h.once("resume",M),h._clearTimer(m._id))}else{var E=function(){S.currentTime=v,S.muted=m._muted||h._muted||e._muted||S.muted,S.volume=m._volume*e.volume(),S.playbackRate=m._rate;try{var C=S.play();if(C&&typeof Promise<"u"&&(C instanceof Promise||typeof C.then=="function")?(h._playLock=!0,T(),C.then(function(){h._playLock=!1,S._unlocked=!0,d?h._loadQueue():h._emit("play",m._id)}).catch(function(){h._playLock=!1,h._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),m._ended=!0,m._paused=!0})):d||(h._playLock=!1,T(),h._emit("play",m._id)),S.playbackRate=m._rate,S.paused){h._emit("playerror",m._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}c!=="__default"||m._loop?h._endTimers[m._id]=setTimeout(h._ended.bind(h,m),b):(h._endTimers[m._id]=function(){h._ended(m),S.removeEventListener("ended",h._endTimers[m._id],!1)},S.addEventListener("ended",h._endTimers[m._id],!1))}catch(O){h._emit("playerror",m._id,O)}};S.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(S.src=h._src,S.load());var I=window&&window.ejecta||!S.readyState&&e._navigator.isCocoonJS;if(S.readyState>=3||I)E();else{h._playLock=!0,h._state="loading";var P=function(){h._state="loaded",E(),S.removeEventListener(e._canPlayEvent,P,!1)};S.addEventListener(e._canPlayEvent,P,!1),h._clearTimer(m._id)}}return m._id},pause:function(c){var d=this;if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"pause",action:function(){d.pause(c)}}),d;for(var h=d._getSoundIds(c),f=0;f<h.length;f++){d._clearTimer(h[f]);var g=d._soundById(h[f]);if(g&&!g._paused&&(g._seek=d.seek(h[f]),g._rateSeek=0,g._paused=!0,d._stopFade(h[f]),g._node))if(d._webAudio){if(!g._node.bufferSource)continue;typeof g._node.bufferSource.stop>"u"?g._node.bufferSource.noteOff(0):g._node.bufferSource.stop(0),d._cleanBuffer(g._node)}else(!isNaN(g._node.duration)||g._node.duration===1/0)&&g._node.pause();arguments[1]||d._emit("pause",g?g._id:null)}return d},stop:function(c,d){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"stop",action:function(){h.stop(c)}}),h;for(var f=h._getSoundIds(c),g=0;g<f.length;g++){h._clearTimer(f[g]);var p=h._soundById(f[g]);p&&(p._seek=p._start||0,p._rateSeek=0,p._paused=!0,p._ended=!0,h._stopFade(f[g]),p._node&&(h._webAudio?p._node.bufferSource&&(typeof p._node.bufferSource.stop>"u"?p._node.bufferSource.noteOff(0):p._node.bufferSource.stop(0),h._cleanBuffer(p._node)):(!isNaN(p._node.duration)||p._node.duration===1/0)&&(p._node.currentTime=p._start||0,p._node.pause(),p._node.duration===1/0&&h._clearSound(p._node))),d||h._emit("stop",p._id))}return h},mute:function(c,d){var h=this;if(h._state!=="loaded"||h._playLock)return h._queue.push({event:"mute",action:function(){h.mute(c,d)}}),h;if(typeof d>"u")if(typeof c=="boolean")h._muted=c;else return h._muted;for(var f=h._getSoundIds(d),g=0;g<f.length;g++){var p=h._soundById(f[g]);p&&(p._muted=c,p._interval&&h._stopFade(p._id),h._webAudio&&p._node?p._node.gain.setValueAtTime(c?0:p._volume,e.ctx.currentTime):p._node&&(p._node.muted=e._muted?!0:c),h._emit("mute",p._id))}return h},volume:function(){var c=this,d=arguments,h,f;if(d.length===0)return c._volume;if(d.length===1||d.length===2&&typeof d[1]>"u"){var g=c._getSoundIds(),p=g.indexOf(d[0]);p>=0?f=parseInt(d[0],10):h=parseFloat(d[0])}else d.length>=2&&(h=parseFloat(d[0]),f=parseInt(d[1],10));var m;if(typeof h<"u"&&h>=0&&h<=1){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"volume",action:function(){c.volume.apply(c,d)}}),c;typeof f>"u"&&(c._volume=h),f=c._getSoundIds(f);for(var y=0;y<f.length;y++)m=c._soundById(f[y]),m&&(m._volume=h,d[2]||c._stopFade(f[y]),c._webAudio&&m._node&&!m._muted?m._node.gain.setValueAtTime(h,e.ctx.currentTime):m._node&&!m._muted&&(m._node.volume=h*e.volume()),c._emit("volume",m._id))}else return m=f?c._soundById(f):c._sounds[0],m?m._volume:0;return c},fade:function(c,d,h,f){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"fade",action:function(){g.fade(c,d,h,f)}}),g;c=Math.min(Math.max(0,parseFloat(c)),1),d=Math.min(Math.max(0,parseFloat(d)),1),h=parseFloat(h),g.volume(c,f);for(var p=g._getSoundIds(f),m=0;m<p.length;m++){var y=g._soundById(p[m]);if(y){if(f||g._stopFade(p[m]),g._webAudio&&!y._muted){var v=e.ctx.currentTime,x=v+h/1e3;y._volume=c,y._node.gain.setValueAtTime(c,v),y._node.gain.linearRampToValueAtTime(d,x)}g._startFadeInterval(y,c,d,h,p[m],typeof f>"u")}}return g},_startFadeInterval:function(c,d,h,f,g,p){var m=this,y=d,v=h-d,x=Math.abs(v/.01),b=Math.max(4,x>0?f/x:f),w=Date.now();c._fadeTo=h,c._interval=setInterval(function(){var A=(Date.now()-w)/f;w=Date.now(),y+=v*A,y=Math.round(y*100)/100,v<0?y=Math.max(h,y):y=Math.min(h,y),m._webAudio?c._volume=y:m.volume(y,c._id,!0),p&&(m._volume=y),(h<d&&y<=h||h>d&&y>=h)&&(clearInterval(c._interval),c._interval=null,c._fadeTo=null,m.volume(h,c._id),m._emit("fade",c._id))},b)},_stopFade:function(c){var d=this,h=d._soundById(c);return h&&h._interval&&(d._webAudio&&h._node.gain.cancelScheduledValues(e.ctx.currentTime),clearInterval(h._interval),h._interval=null,d.volume(h._fadeTo,c),h._fadeTo=null,d._emit("fade",c)),d},loop:function(){var c=this,d=arguments,h,f,g;if(d.length===0)return c._loop;if(d.length===1)if(typeof d[0]=="boolean")h=d[0],c._loop=h;else return g=c._soundById(parseInt(d[0],10)),g?g._loop:!1;else d.length===2&&(h=d[0],f=parseInt(d[1],10));for(var p=c._getSoundIds(f),m=0;m<p.length;m++)g=c._soundById(p[m]),g&&(g._loop=h,c._webAudio&&g._node&&g._node.bufferSource&&(g._node.bufferSource.loop=h,h&&(g._node.bufferSource.loopStart=g._start||0,g._node.bufferSource.loopEnd=g._stop,c.playing(p[m])&&(c.pause(p[m],!0),c.play(p[m],!0)))));return c},rate:function(){var c=this,d=arguments,h,f;if(d.length===0)f=c._sounds[0]._id;else if(d.length===1){var g=c._getSoundIds(),p=g.indexOf(d[0]);p>=0?f=parseInt(d[0],10):h=parseFloat(d[0])}else d.length===2&&(h=parseFloat(d[0]),f=parseInt(d[1],10));var m;if(typeof h=="number"){if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"rate",action:function(){c.rate.apply(c,d)}}),c;typeof f>"u"&&(c._rate=h),f=c._getSoundIds(f);for(var y=0;y<f.length;y++)if(m=c._soundById(f[y]),m){c.playing(f[y])&&(m._rateSeek=c.seek(f[y]),m._playStart=c._webAudio?e.ctx.currentTime:m._playStart),m._rate=h,c._webAudio&&m._node&&m._node.bufferSource?m._node.bufferSource.playbackRate.setValueAtTime(h,e.ctx.currentTime):m._node&&(m._node.playbackRate=h);var v=c.seek(f[y]),x=(c._sprite[m._sprite][0]+c._sprite[m._sprite][1])/1e3-v,b=x*1e3/Math.abs(m._rate);(c._endTimers[f[y]]||!m._paused)&&(c._clearTimer(f[y]),c._endTimers[f[y]]=setTimeout(c._ended.bind(c,m),b)),c._emit("rate",m._id)}}else return m=c._soundById(f),m?m._rate:c._rate;return c},seek:function(){var c=this,d=arguments,h,f;if(d.length===0)c._sounds.length&&(f=c._sounds[0]._id);else if(d.length===1){var g=c._getSoundIds(),p=g.indexOf(d[0]);p>=0?f=parseInt(d[0],10):c._sounds.length&&(f=c._sounds[0]._id,h=parseFloat(d[0]))}else d.length===2&&(h=parseFloat(d[0]),f=parseInt(d[1],10));if(typeof f>"u")return 0;if(typeof h=="number"&&(c._state!=="loaded"||c._playLock))return c._queue.push({event:"seek",action:function(){c.seek.apply(c,d)}}),c;var m=c._soundById(f);if(m)if(typeof h=="number"&&h>=0){var y=c.playing(f);y&&c.pause(f,!0),m._seek=h,m._ended=!1,c._clearTimer(f),!c._webAudio&&m._node&&!isNaN(m._node.duration)&&(m._node.currentTime=h);var v=function(){y&&c.play(f,!0),c._emit("seek",f)};if(y&&!c._webAudio){var x=function(){c._playLock?setTimeout(x,0):v()};setTimeout(x,0)}else v()}else if(c._webAudio){var b=c.playing(f)?e.ctx.currentTime-m._playStart:0,w=m._rateSeek?m._rateSeek-m._seek:0;return m._seek+(w+b*Math.abs(m._rate))}else return m._node.currentTime;return c},playing:function(c){var d=this;if(typeof c=="number"){var h=d._soundById(c);return h?!h._paused:!1}for(var f=0;f<d._sounds.length;f++)if(!d._sounds[f]._paused)return!0;return!1},duration:function(c){var d=this,h=d._duration,f=d._soundById(c);return f&&(h=d._sprite[f._sprite][1]/1e3),h},state:function(){return this._state},unload:function(){for(var c=this,d=c._sounds,h=0;h<d.length;h++)d[h]._paused||c.stop(d[h]._id),c._webAudio||(c._clearSound(d[h]._node),d[h]._node.removeEventListener("error",d[h]._errorFn,!1),d[h]._node.removeEventListener(e._canPlayEvent,d[h]._loadFn,!1),d[h]._node.removeEventListener("ended",d[h]._endFn,!1),e._releaseHtml5Audio(d[h]._node)),delete d[h]._node,c._clearTimer(d[h]._id);var f=e._howls.indexOf(c);f>=0&&e._howls.splice(f,1);var g=!0;for(h=0;h<e._howls.length;h++)if(e._howls[h]._src===c._src||c._src.indexOf(e._howls[h]._src)>=0){g=!1;break}return i&&g&&delete i[c._src],e.noAudio=!1,c._state="unloaded",c._sounds=[],c=null,null},on:function(c,d,h,f){var g=this,p=g["_on"+c];return typeof d=="function"&&p.push(f?{id:h,fn:d,once:f}:{id:h,fn:d}),g},off:function(c,d,h){var f=this,g=f["_on"+c],p=0;if(typeof d=="number"&&(h=d,d=null),d||h)for(p=0;p<g.length;p++){var m=h===g[p].id;if(d===g[p].fn&&m||!d&&m){g.splice(p,1);break}}else if(c)f["_on"+c]=[];else{var y=Object.keys(f);for(p=0;p<y.length;p++)y[p].indexOf("_on")===0&&Array.isArray(f[y[p]])&&(f[y[p]]=[])}return f},once:function(c,d,h){var f=this;return f.on(c,d,h,1),f},_emit:function(c,d,h){for(var f=this,g=f["_on"+c],p=g.length-1;p>=0;p--)(!g[p].id||g[p].id===d||c==="load")&&(setTimeout(function(m){m.call(this,d,h)}.bind(f,g[p].fn),0),g[p].once&&f.off(c,g[p].fn,g[p].id));return f._loadQueue(c),f},_loadQueue:function(c){var d=this;if(d._queue.length>0){var h=d._queue[0];h.event===c&&(d._queue.shift(),d._loadQueue()),c||h.action()}return d},_ended:function(c){var d=this,h=c._sprite;if(!d._webAudio&&c._node&&!c._node.paused&&!c._node.ended&&c._node.currentTime<c._stop)return setTimeout(d._ended.bind(d,c),100),d;var f=!!(c._loop||d._sprite[h][2]);if(d._emit("end",c._id),!d._webAudio&&f&&d.stop(c._id,!0).play(c._id),d._webAudio&&f){d._emit("play",c._id),c._seek=c._start||0,c._rateSeek=0,c._playStart=e.ctx.currentTime;var g=(c._stop-c._start)*1e3/Math.abs(c._rate);d._endTimers[c._id]=setTimeout(d._ended.bind(d,c),g)}return d._webAudio&&!f&&(c._paused=!0,c._ended=!0,c._seek=c._start||0,c._rateSeek=0,d._clearTimer(c._id),d._cleanBuffer(c._node),e._autoSuspend()),!d._webAudio&&!f&&d.stop(c._id,!0),d},_clearTimer:function(c){var d=this;if(d._endTimers[c]){if(typeof d._endTimers[c]!="function")clearTimeout(d._endTimers[c]);else{var h=d._soundById(c);h&&h._node&&h._node.removeEventListener("ended",d._endTimers[c],!1)}delete d._endTimers[c]}return d},_soundById:function(c){for(var d=this,h=0;h<d._sounds.length;h++)if(c===d._sounds[h]._id)return d._sounds[h];return null},_inactiveSound:function(){var c=this;c._drain();for(var d=0;d<c._sounds.length;d++)if(c._sounds[d]._ended)return c._sounds[d].reset();return new n(c)},_drain:function(){var c=this,d=c._pool,h=0,f=0;if(!(c._sounds.length<d)){for(f=0;f<c._sounds.length;f++)c._sounds[f]._ended&&h++;for(f=c._sounds.length-1;f>=0;f--){if(h<=d)return;c._sounds[f]._ended&&(c._webAudio&&c._sounds[f]._node&&c._sounds[f]._node.disconnect(0),c._sounds.splice(f,1),h--)}}},_getSoundIds:function(c){var d=this;if(typeof c>"u"){for(var h=[],f=0;f<d._sounds.length;f++)h.push(d._sounds[f]._id);return h}else return[c]},_refreshBuffer:function(c){var d=this;return c._node.bufferSource=e.ctx.createBufferSource(),c._node.bufferSource.buffer=i[d._src],c._panner?c._node.bufferSource.connect(c._panner):c._node.bufferSource.connect(c._node),c._node.bufferSource.loop=c._loop,c._loop&&(c._node.bufferSource.loopStart=c._start||0,c._node.bufferSource.loopEnd=c._stop||0),c._node.bufferSource.playbackRate.setValueAtTime(c._rate,e.ctx.currentTime),d},_cleanBuffer:function(c){var d=this,h=e._navigator&&e._navigator.vendor.indexOf("Apple")>=0;if(e._scratchBuffer&&c.bufferSource&&(c.bufferSource.onended=null,c.bufferSource.disconnect(0),h))try{c.bufferSource.buffer=e._scratchBuffer}catch{}return c.bufferSource=null,d},_clearSound:function(c){var d=/MSIE |Trident\//.test(e._navigator&&e._navigator.userAgent);d||(c.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(c){this._parent=c,this.init()};n.prototype={init:function(){var c=this,d=c._parent;return c._muted=d._muted,c._loop=d._loop,c._volume=d._volume,c._rate=d._rate,c._seek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++e._counter,d._sounds.push(c),c.create(),c},create:function(){var c=this,d=c._parent,h=e._muted||c._muted||c._parent._muted?0:c._volume;return d._webAudio?(c._node=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),c._node.gain.setValueAtTime(h,e.ctx.currentTime),c._node.paused=!0,c._node.connect(e.masterGain)):e.noAudio||(c._node=e._obtainHtml5Audio(),c._errorFn=c._errorListener.bind(c),c._node.addEventListener("error",c._errorFn,!1),c._loadFn=c._loadListener.bind(c),c._node.addEventListener(e._canPlayEvent,c._loadFn,!1),c._endFn=c._endListener.bind(c),c._node.addEventListener("ended",c._endFn,!1),c._node.src=d._src,c._node.preload=d._preload===!0?"auto":d._preload,c._node.volume=h*e.volume(),c._node.load()),c},reset:function(){var c=this,d=c._parent;return c._muted=d._muted,c._loop=d._loop,c._volume=d._volume,c._rate=d._rate,c._seek=0,c._rateSeek=0,c._paused=!0,c._ended=!0,c._sprite="__default",c._id=++e._counter,c},_errorListener:function(){var c=this;c._parent._emit("loaderror",c._id,c._node.error?c._node.error.code:0),c._node.removeEventListener("error",c._errorFn,!1)},_loadListener:function(){var c=this,d=c._parent;d._duration=Math.ceil(c._node.duration*10)/10,Object.keys(d._sprite).length===0&&(d._sprite={__default:[0,d._duration*1e3]}),d._state!=="loaded"&&(d._state="loaded",d._emit("load"),d._loadQueue()),c._node.removeEventListener(e._canPlayEvent,c._loadFn,!1)},_endListener:function(){var c=this,d=c._parent;d._duration===1/0&&(d._duration=Math.ceil(c._node.duration*10)/10,d._sprite.__default[1]===1/0&&(d._sprite.__default[1]=d._duration*1e3),d._ended(c)),c._node.removeEventListener("ended",c._endFn,!1)}};var i={},s=function(c){var d=c._src;if(i[d]){c._duration=i[d].duration,l(c);return}if(/^data:[^;]+;base64,/.test(d)){for(var h=atob(d.split(",")[1]),f=new Uint8Array(h.length),g=0;g<h.length;++g)f[g]=h.charCodeAt(g);a(f.buffer,c)}else{var p=new XMLHttpRequest;p.open(c._xhr.method,d,!0),p.withCredentials=c._xhr.withCredentials,p.responseType="arraybuffer",c._xhr.headers&&Object.keys(c._xhr.headers).forEach(function(m){p.setRequestHeader(m,c._xhr.headers[m])}),p.onload=function(){var m=(p.status+"")[0];if(m!=="0"&&m!=="2"&&m!=="3"){c._emit("loaderror",null,"Failed loading audio file with status: "+p.status+".");return}a(p.response,c)},p.onerror=function(){c._webAudio&&(c._html5=!0,c._webAudio=!1,c._sounds=[],delete i[d],c.load())},o(p)}},o=function(c){try{c.send()}catch{c.onerror()}},a=function(c,d){var h=function(){d._emit("loaderror",null,"Decoding audio data failed.")},f=function(g){g&&d._sounds.length>0?(i[d._src]=g,l(d,g)):h()};typeof Promise<"u"&&e.ctx.decodeAudioData.length===1?e.ctx.decodeAudioData(c).then(f).catch(h):e.ctx.decodeAudioData(c,f,h)},l=function(c,d){d&&!c._duration&&(c._duration=d.duration),Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue())},u=function(){if(!!e.usingWebAudio){try{typeof AudioContext<"u"?e.ctx=new AudioContext:typeof webkitAudioContext<"u"?e.ctx=new webkitAudioContext:e.usingWebAudio=!1}catch{e.usingWebAudio=!1}e.ctx||(e.usingWebAudio=!1);var c=/iP(hone|od|ad)/.test(e._navigator&&e._navigator.platform),d=e._navigator&&e._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),h=d?parseInt(d[1],10):null;if(c&&h&&h<9){var f=/safari/.test(e._navigator&&e._navigator.userAgent.toLowerCase());e._navigator&&!f&&(e.usingWebAudio=!1)}e.usingWebAudio&&(e.masterGain=typeof e.ctx.createGain>"u"?e.ctx.createGainNode():e.ctx.createGain(),e.masterGain.gain.setValueAtTime(e._muted?0:e._volume,e.ctx.currentTime),e.masterGain.connect(e.ctx.destination)),e._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:e,Howl:t}}),typeof wg<"u"&&(wg.Howler=e,wg.Howl=t),typeof global<"u"?(global.HowlerGlobal=r,global.Howler=e,global.Howl=t,global.Sound=n):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=e,window.Howl=t,window.Sound=n)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;n>=0;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(t=typeof t!="number"?i._pos[1]:t,n=typeof n!="number"?i._pos[2]:n,typeof e=="number")i._pos=[e,t,n],typeof i.ctx.listener.positionX<"u"?(i.ctx.listener.positionX.setTargetAtTime(i._pos[0],Howler.ctx.currentTime,.1),i.ctx.listener.positionY.setTargetAtTime(i._pos[1],Howler.ctx.currentTime,.1),i.ctx.listener.positionZ.setTargetAtTime(i._pos[2],Howler.ctx.currentTime,.1)):i.ctx.listener.setPosition(i._pos[0],i._pos[1],i._pos[2]);else return i._pos;return i},HowlerGlobal.prototype.orientation=function(e,t,n,i,s,o){var a=this;if(!a.ctx||!a.ctx.listener)return a;var l=a._orientation;if(t=typeof t!="number"?l[1]:t,n=typeof n!="number"?l[2]:n,i=typeof i!="number"?l[3]:i,s=typeof s!="number"?l[4]:s,o=typeof o!="number"?l[5]:o,typeof e=="number")a._orientation=[e,t,n,i,s,o],typeof a.ctx.listener.forwardX<"u"?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,t,n,i,s,o);else return l;return a},Howl.prototype.init=function(e){return function(t){var n=this;return n._orientation=t.orientation||[1,0,0],n._stereo=t.stereo||null,n._pos=t.pos||null,n._pannerAttr={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:360,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:360,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:0,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:"inverse",maxDistance:typeof t.maxDistance<"u"?t.maxDistance:1e4,panningModel:typeof t.panningModel<"u"?t.panningModel:"HRTF",refDistance:typeof t.refDistance<"u"?t.refDistance:1,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:1},n._onstereo=t.onstereo?[{fn:t.onstereo}]:[],n._onpos=t.onpos?[{fn:t.onpos}]:[],n._onorientation=t.onorientation?[{fn:t.onorientation}]:[],e.call(this,t)}}(Howl.prototype.init),Howl.prototype.stereo=function(e,t){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(e,t)}}),n;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof t>"u")if(typeof e=="number")n._stereo=e,n._pos=[e,0,0];else return n._stereo;for(var s=n._getSoundIds(t),o=0;o<s.length;o++){var a=n._soundById(s[o]);if(a)if(typeof e=="number")a._stereo=e,a._pos=[e,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",(!a._panner||!a._panner.pan)&&r(a,i),i==="spatial"?typeof a._panner.positionX<"u"?(a._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(e,0,0):a._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),n._emit("stereo",a._id);else return a._stereo}return n},Howl.prototype.pos=function(e,t,n,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"pos",action:function(){s.pos(e,t,n,i)}}),s;if(t=typeof t!="number"?0:t,n=typeof n!="number"?-.5:n,typeof i>"u")if(typeof e=="number")s._pos=[e,t,n];else return s._pos;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var l=s._soundById(o[a]);if(l)if(typeof e=="number")l._pos=[e,t,n],l._node&&((!l._panner||l._panner.pan)&&r(l,"spatial"),typeof l._panner.positionX<"u"?(l._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):l._panner.setPosition(e,t,n)),s._emit("pos",l._id);else return l._pos}return s},Howl.prototype.orientation=function(e,t,n,i){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"orientation",action:function(){s.orientation(e,t,n,i)}}),s;if(t=typeof t!="number"?s._orientation[1]:t,n=typeof n!="number"?s._orientation[2]:n,typeof i>"u")if(typeof e=="number")s._orientation=[e,t,n];else return s._orientation;for(var o=s._getSoundIds(i),a=0;a<o.length;a++){var l=s._soundById(o[a]);if(l)if(typeof e=="number")l._orientation=[e,t,n],l._node&&(l._panner||(l._pos||(l._pos=s._pos||[0,0,-.5]),r(l,"spatial")),typeof l._panner.orientationX<"u"?(l._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),l._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),l._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):l._panner.setOrientation(e,t,n)),s._emit("orientation",l._id);else return l._orientation}return s},Howl.prototype.pannerAttr=function(){var e=this,t=arguments,n,i,s;if(!e._webAudio)return e;if(t.length===0)return e._pannerAttr;if(t.length===1)if(typeof t[0]=="object")n=t[0],typeof i>"u"&&(n.pannerAttr||(n.pannerAttr={coneInnerAngle:n.coneInnerAngle,coneOuterAngle:n.coneOuterAngle,coneOuterGain:n.coneOuterGain,distanceModel:n.distanceModel,maxDistance:n.maxDistance,refDistance:n.refDistance,rolloffFactor:n.rolloffFactor,panningModel:n.panningModel}),e._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:e._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:e._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:e._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:e._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:e._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:e._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:e._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:e._panningModel});else return s=e._soundById(parseInt(t[0],10)),s?s._pannerAttr:e._pannerAttr;else t.length===2&&(n=t[0],i=parseInt(t[1],10));for(var o=e._getSoundIds(i),a=0;a<o.length;a++)if(s=e._soundById(o[a]),s){var l=s._pannerAttr;l={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:l.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:l.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:l.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:l.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:l.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:l.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:l.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:l.panningModel};var u=s._panner;u?(u.coneInnerAngle=l.coneInnerAngle,u.coneOuterAngle=l.coneOuterAngle,u.coneOuterGain=l.coneOuterGain,u.distanceModel=l.distanceModel,u.maxDistance=l.maxDistance,u.refDistance=l.refDistance,u.rolloffFactor=l.rolloffFactor,u.panningModel=l.panningModel):(s._pos||(s._pos=e._pos||[0,0,-.5]),r(s,"spatial"))}return e},Sound.prototype.init=function(e){return function(){var t=this,n=t._parent;t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,e.call(this),t._stereo?n.stereo(t._stereo):t._pos&&n.pos(t._pos[0],t._pos[1],t._pos[2],t._id)}}(Sound.prototype.init),Sound.prototype.reset=function(e){return function(){var t=this,n=t._parent;return t._orientation=n._orientation,t._stereo=n._stereo,t._pos=n._pos,t._pannerAttr=n._pannerAttr,t._stereo?n.stereo(t._stereo):t._pos?n.pos(t._pos[0],t._pos[1],t._pos[2],t._id):t._panner&&(t._panner.disconnect(0),t._panner=void 0,n._refreshBuffer(t)),e.call(this)}}(Sound.prototype.reset);var r=function(e,t){t=t||"spatial",t==="spatial"?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,typeof e._panner.positionX<"u"?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),typeof e._panner.orientationX<"u"?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}})()});var i6={};GS(i6,{Application:()=>NS});module.exports=aI(i6);var ks="149";var Wr={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lI=0,zS=1,cI=2;var xp=1,l0=2,hd=3,zr=0,xn=1,dr=2;var Bt=0,Pl=1,VS=2,HS=3,WS=4,uI=5,Ml=100,dI=101,hI=102,jS=103,qS=104,fI=200,pI=201,mI=202,gI=203,x1=204,b1=205,yI=206,vI=207,xI=208,bI=209,SI=210,wI=0,AI=1,_I=2,_v=3,TI=4,MI=5,EI=6,CI=7,S1=0,PI=1,II=2,Bs=0,DI=1,OI=2,LI=3,RI=4,NI=5,w1=300,go=301,yo=302,Tv=303,Mv=304,Yl=306,Dl=1e3,ur=1001,Ev=1002,Nt=1003,XS=1004;var zy=1005;var st=1006,BI=1007;var xa=1008;var Gt=1009,FI=1010,UI=1011,A1=1012,GI=1013,Rs=1014,ji=1015,xd=1016,kI=1017,zI=1018,mo=1020,VI=1021,ii=1023,HI=1024,WI=1025,ya=1026,vo=1027,jI=1028,qI=1029,XI=1030,YI=1031,KI=1033,Vy=33776,Hy=33777,Wy=33778,jy=33779,YS=35840,KS=35841,ZS=35842,QS=35843,ZI=36196,JS=37492,$S=37496,ew=37808,tw=37809,nw=37810,rw=37811,iw=37812,sw=37813,ow=37814,aw=37815,lw=37816,cw=37817,uw=37818,dw=37819,hw=37820,fw=37821,qy=36492,QI=36283,pw=36284,mw=36285,gw=36286;var Kf=2300,Zf=2301,Xy=2302,yw=2400,vw=2401,xw=2402;var Vr=3e3,Xe=3001,Fn=3200,c0=3201,JI=0,$I=1;var Hi="srgb",bd="srgb-linear";var Yy=7680;var eD=519,Cv=35044;var bw="300 es",Pv=1035,Wt=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;let n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;let i=this._listeners[e];if(i!==void 0){let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;let n=this._listeners[e.type];if(n!==void 0){e.target=this;let i=n.slice(0);for(let s=0,o=i.length;s<o;s++)i[s].call(this,e);e.target=null}}},$n=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],Sw=1234567,pd=Math.PI/180,Sd=180/Math.PI;function Xi(){let r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return($n[r&255]+$n[r>>8&255]+$n[r>>16&255]+$n[r>>24&255]+"-"+$n[e&255]+$n[e>>8&255]+"-"+$n[e>>16&15|64]+$n[e>>24&255]+"-"+$n[t&63|128]+$n[t>>8&255]+"-"+$n[t>>16&255]+$n[t>>24&255]+$n[n&255]+$n[n>>8&255]+$n[n>>16&255]+$n[n>>24&255]).toLowerCase()}function An(r,e,t){return Math.max(e,Math.min(t,r))}function u0(r,e){return(r%e+e)%e}function tD(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function nD(r,e,t){return r!==e?(t-r)/(e-r):0}function md(r,e,t){return(1-t)*r+t*e}function rD(r,e,t,n){return md(r,e,1-Math.exp(-t*n))}function iD(r,e=1){return e-Math.abs(u0(r,e*2)-e)}function sD(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function oD(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function aD(r,e){return r+Math.floor(Math.random()*(e-r+1))}function lD(r,e){return r+Math.random()*(e-r)}function cD(r){return r*(.5-Math.random())}function uD(r){r!==void 0&&(Sw=r);let e=Sw+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function dD(r){return r*pd}function hD(r){return r*Sd}function Iv(r){return(r&r-1)===0&&r!==0}function fD(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Qf(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function pD(r,e,t,n,i){let s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),u=s((e+n)/2),c=o((e+n)/2),d=s((e-n)/2),h=o((e-n)/2),f=s((n-e)/2),g=o((n-e)/2);switch(i){case"XYX":r.set(a*c,l*d,l*h,a*u);break;case"YZY":r.set(l*h,a*c,l*d,a*u);break;case"ZXZ":r.set(l*d,l*h,a*c,a*u);break;case"XZX":r.set(a*c,l*g,l*f,a*u);break;case"YXY":r.set(l*f,a*c,l*g,a*u);break;case"ZYZ":r.set(l*g,l*f,a*c,a*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ns(r,e){switch(e.constructor){case Float32Array:return r;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Ot(r,e){switch(e.constructor){case Float32Array:return r;case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}var Ve=Object.freeze({__proto__:null,DEG2RAD:pd,RAD2DEG:Sd,ceilPowerOfTwo:fD,clamp:An,damp:rD,degToRad:dD,denormalize:Ns,euclideanModulo:u0,floorPowerOfTwo:Qf,generateUUID:Xi,inverseLerp:nD,isPowerOfTwo:Iv,lerp:md,mapLinear:tD,normalize:Ot,pingpong:iD,radToDeg:hD,randFloat:lD,randFloatSpread:cD,randInt:aD,seededRandom:uD,setQuaternionFromProperEuler:pD,smootherstep:oD,smoothstep:sD}),F=class{constructor(e=0,t=0){F.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){let n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){