UNPKG

@mxtommy/kip

Version:

An advanced and versatile marine instrumentation package to display Signal K data.

1 lines 700 kB
import{A as Sd,B as Cd,C as xd,D as ji,E as cn,F as Td,G as Ed,H as Ad,I as Dd,J as Pd,K as Md,L as Od,a as Fi,b as Hi,c as Gi,d as fo,e as ln,f as xr,g as ui,h as Ui,i as Ut,j as go,k as vo,l as Xn,m as dn,n as yo,o as bo,p as mi,q as Fa,r as _o,s as Tr,t as kd,u as Ha,v as Ga,w as Ua,x as ja,y as $n,z as Er}from"./chunk-ACMPUT6Z.js";import{b as Wd,g as Bd}from"./chunk-OTD7HT32.js";import{a as lt,b as pd,c as ho,d as Yn,e as Qn,f as fd,g as gd,h as vd}from"./chunk-AYIHSTCC.js";import"./chunk-SHKAX4XV.js";import{a as yd,b as bd,c as _d,d as wd,e as mo,f as po}from"./chunk-JZUG3W7P.js";import{a as qn,b as uo}from"./chunk-AB7BX4CL.js";import{a as Id,b as Rd,c as Nd}from"./chunk-MR7RUNKP.js";import{a as co}from"./chunk-WE4P4WBD.js";import"./chunk-36TH3DJS.js";import"./chunk-QMIJ5LO6.js";import{a as Wl,b as Bl,c as zl,d as Vl,e as Ll,f as Fl,g as Vn,h as Hl,i as ro,k as Gl,l as Ul,m as jl,n as Yl,o as ki,p as Bt}from"./chunk-6QHCHGTT.js";import{f as hd}from"./chunk-CD375FDG.js";import"./chunk-SGYCFQGT.js";import{a as ii}from"./chunk-EQAHQINY.js";import{a as md}from"./chunk-7TWI6ZJI.js";import{a as zn,b as Ml,c as Ol,d as io,f as no,g as ti,h as Cr,i as Ln,j as Wa,k as Wt,l as te,m as Fn,n as wi,o as Hn,p as ql,r as Li,y as ud}from"./chunk-EQ5CPWIU.js";import{$ as Pa,$a as Ai,$b as Nt,$c as to,$d as ao,Ac as ce,Ae as od,Bb as Ra,Bc as Xe,Be as ad,Cb as de,Cc as kl,Da as Zt,Dc as E,Ea as V,Eb as Sr,Ec as xt,Ee as Va,Fa as L,Fc as at,Fd as Il,G as ol,Ga as dt,Gd as Rl,H as Ea,Ha as cl,Hb as G,Hd as Nl,I as al,Ia as Nn,Ib as Jt,Ic as Ae,J as sl,Jb as bi,Jc as De,K as Mn,Ka as on,Kb as yl,Kc as Pe,Ke as sd,Lb as fe,Lc as Sl,Le as jn,Ma as hl,Mc as Cl,Me as ld,Nb as ke,Nc as xl,Ne as La,O as Xr,Oa as st,Oc as Wn,Od as Gn,Pa as ut,Pe as dd,Q as wr,Qd as Ba,R as Aa,Ra as Wi,Rc as eo,S as Da,Sa as Q,Sc as Tl,Se as cd,Ta as Ee,Tc as El,Td as Ql,U as ll,Ub as bl,Va as $r,Vc as Na,Vd as Xl,Wa as ul,Wd as $l,Xc as Bn,Yb as be,Yd as oo,Zb as U,_b as it,a as K,aa as On,ae as Kl,b as rt,be as Zl,c as nl,cb as ml,cd as Fe,ce as Jl,d as Sa,db as pl,dc as Ge,de as so,e as _r,eb as kr,ec as Jr,ed as Al,ee as ed,f as Ca,fa as Ma,fd as Vi,g as rn,gc as Bi,ha as Gt,hc as zi,ia as Oa,ic as v,jc as _,je as td,kc as B,ke as id,la as Ve,lc as _l,le as Un,m as bt,mc as wl,ne as sn,o as Ni,oa as ot,oc as ee,od as Dl,pa as Kt,qb as Ia,qc as F,ra as In,rb as Kr,rc as se,sc as ei,sd as _i,t as rl,ta as Rn,tb as fl,tc as Ct,te as nd,u as xa,ua as M,ub as P,uc as ci,vc as an,ve as ni,wb as gl,wc as Je,wd as Pl,we as lo,xb as vl,xc as Ue,xe as rd,y as Ta,ya as dl,yb as Zr,yc as je,ye as hi,z as Ht,zb as Rt,ze as za}from"./chunk-Y7X77HSW.js";var Xa=Sa(Do=>{(function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var s=this||n;return s._counter=1e3,s._html5AudioPool=[],s.html5PoolSize=10,s._codecs={},s._howls=[],s._muted=!1,s._volume=1,s._canPlayEvent="canplaythrough",s._navigator=typeof window<"u"&&window.navigator?window.navigator:null,s.masterGain=null,s.noAudio=!1,s.usingWebAudio=!0,s.autoSuspend=!0,s.ctx=null,s.autoUnlock=!0,s._setup(),s},volume:function(s){var c=this||n;if(s=parseFloat(s),c.ctx||f(),typeof s<"u"&&s>=0&&s<=1){if(c._volume=s,c._muted)return c;c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s,n.ctx.currentTime);for(var m=0;m<c._howls.length;m++)if(!c._howls[m]._webAudio)for(var y=c._howls[m]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[m]._soundById(y[k]);x&&x._node&&(x._node.volume=x._volume*s)}return c}return c._volume},mute:function(s){var c=this||n;c.ctx||f(),c._muted=s,c.usingWebAudio&&c.masterGain.gain.setValueAtTime(s?0:c._volume,n.ctx.currentTime);for(var m=0;m<c._howls.length;m++)if(!c._howls[m]._webAudio)for(var y=c._howls[m]._getSoundIds(),k=0;k<y.length;k++){var x=c._howls[m]._soundById(y[k]);x&&x._node&&(x._node.muted=s?!0:x._muted)}return c},stop:function(){for(var s=this||n,c=0;c<s._howls.length;c++)s._howls[c].stop();return s},unload:function(){for(var s=this||n,c=s._howls.length-1;c>=0;c--)s._howls[c].unload();return s.usingWebAudio&&s.ctx&&typeof s.ctx.close<"u"&&(s.ctx.close(),s.ctx=null,f()),s},codecs:function(s){return(this||n)._codecs[s.replace(/^x-/,"")]},_setup:function(){var s=this||n;if(s.state=s.ctx&&s.ctx.state||"suspended",s._autoSuspend(),!s.usingWebAudio)if(typeof Audio<"u")try{var c=new Audio;typeof c.oncanplaythrough>"u"&&(s._canPlayEvent="canplay")}catch{s.noAudio=!0}else s.noAudio=!0;try{var c=new Audio;c.muted&&(s.noAudio=!0)}catch{}return s.noAudio||s._setupCodecs(),s},_setupCodecs:function(){var s=this||n,c=null;try{c=typeof Audio<"u"?new Audio:null}catch{return s}if(!c||typeof c.canPlayType!="function")return s;var m=c.canPlayType("audio/mpeg;").replace(/^no$/,""),y=s._navigator?s._navigator.userAgent:"",k=y.match(/OPR\/(\d+)/g),x=k&&parseInt(k[0].split("/")[1],10)<33,A=y.indexOf("Safari")!==-1&&y.indexOf("Chrome")===-1,z=y.match(/Version\/(.*?) /),Y=A&&z&&parseInt(z[1],10)<15;return s._codecs={mp3:!!(!x&&(m||c.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!m,opus:!!c.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(c.canPlayType('audio/wav; codecs="1"')||c.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(c.canPlayType("audio/x-m4b;")||c.canPlayType("audio/m4b;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!Y&&c.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!c.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")},s},_unlockAudio:function(){var s=this||n;if(!(s._audioUnlocked||!s.ctx)){s._audioUnlocked=!1,s.autoUnlock=!1,!s._mobileUnloaded&&s.ctx.sampleRate!==44100&&(s._mobileUnloaded=!0,s.unload()),s._scratchBuffer=s.ctx.createBuffer(1,1,22050);var c=function(m){for(;s._html5AudioPool.length<s.html5PoolSize;)try{var y=new Audio;y._unlocked=!0,s._releaseHtml5Audio(y)}catch{s.noAudio=!0;break}for(var k=0;k<s._howls.length;k++)if(!s._howls[k]._webAudio)for(var x=s._howls[k]._getSoundIds(),A=0;A<x.length;A++){var z=s._howls[k]._soundById(x[A]);z&&z._node&&!z._node._unlocked&&(z._node._unlocked=!0,z._node.load())}s._autoResume();var Y=s.ctx.createBufferSource();Y.buffer=s._scratchBuffer,Y.connect(s.ctx.destination),typeof Y.start>"u"?Y.noteOn(0):Y.start(0),typeof s.ctx.resume=="function"&&s.ctx.resume(),Y.onended=function(){Y.disconnect(0),s._audioUnlocked=!0,document.removeEventListener("touchstart",c,!0),document.removeEventListener("touchend",c,!0),document.removeEventListener("click",c,!0),document.removeEventListener("keydown",c,!0);for(var re=0;re<s._howls.length;re++)s._howls[re]._emit("unlock")}};return document.addEventListener("touchstart",c,!0),document.addEventListener("touchend",c,!0),document.addEventListener("click",c,!0),document.addEventListener("keydown",c,!0),s}},_obtainHtml5Audio:function(){var s=this||n;if(s._html5AudioPool.length)return s._html5AudioPool.pop();var c=new Audio().play();return c&&typeof Promise<"u"&&(c instanceof Promise||typeof c.then=="function")&&c.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(s){var c=this||n;return s._unlocked&&c._html5AudioPool.push(s),c},_autoSuspend:function(){var s=this;if(!(!s.autoSuspend||!s.ctx||typeof s.ctx.suspend>"u"||!n.usingWebAudio)){for(var c=0;c<s._howls.length;c++)if(s._howls[c]._webAudio){for(var m=0;m<s._howls[c]._sounds.length;m++)if(!s._howls[c]._sounds[m]._paused)return s}return s._suspendTimer&&clearTimeout(s._suspendTimer),s._suspendTimer=setTimeout(function(){if(s.autoSuspend){s._suspendTimer=null,s.state="suspending";var y=function(){s.state="suspended",s._resumeAfterSuspend&&(delete s._resumeAfterSuspend,s._autoResume())};s.ctx.suspend().then(y,y)}},3e4),s}},_autoResume:function(){var s=this;if(!(!s.ctx||typeof s.ctx.resume>"u"||!n.usingWebAudio))return s.state==="running"&&s.ctx.state!=="interrupted"&&s._suspendTimer?(clearTimeout(s._suspendTimer),s._suspendTimer=null):s.state==="suspended"||s.state==="running"&&s.ctx.state==="interrupted"?(s.ctx.resume().then(function(){s.state="running";for(var c=0;c<s._howls.length;c++)s._howls[c]._emit("resume")}),s._suspendTimer&&(clearTimeout(s._suspendTimer),s._suspendTimer=null)):s.state==="suspending"&&(s._resumeAfterSuspend=!0),s}};var n=new r,e=function(s){var c=this;if(!s.src||s.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}c.init(s)};e.prototype={init:function(s){var c=this;return n.ctx||f(),c._autoplay=s.autoplay||!1,c._format=typeof s.format!="string"?s.format:[s.format],c._html5=s.html5||!1,c._muted=s.mute||!1,c._loop=s.loop||!1,c._pool=s.pool||5,c._preload=typeof s.preload=="boolean"||s.preload==="metadata"?s.preload:!0,c._rate=s.rate||1,c._sprite=s.sprite||{},c._src=typeof s.src!="string"?s.src:[s.src],c._volume=s.volume!==void 0?s.volume:1,c._xhr={method:s.xhr&&s.xhr.method?s.xhr.method:"GET",headers:s.xhr&&s.xhr.headers?s.xhr.headers:null,withCredentials:s.xhr&&s.xhr.withCredentials?s.xhr.withCredentials:!1},c._duration=0,c._state="unloaded",c._sounds=[],c._endTimers={},c._queue=[],c._playLock=!1,c._onend=s.onend?[{fn:s.onend}]:[],c._onfade=s.onfade?[{fn:s.onfade}]:[],c._onload=s.onload?[{fn:s.onload}]:[],c._onloaderror=s.onloaderror?[{fn:s.onloaderror}]:[],c._onplayerror=s.onplayerror?[{fn:s.onplayerror}]:[],c._onpause=s.onpause?[{fn:s.onpause}]:[],c._onplay=s.onplay?[{fn:s.onplay}]:[],c._onstop=s.onstop?[{fn:s.onstop}]:[],c._onmute=s.onmute?[{fn:s.onmute}]:[],c._onvolume=s.onvolume?[{fn:s.onvolume}]:[],c._onrate=s.onrate?[{fn:s.onrate}]:[],c._onseek=s.onseek?[{fn:s.onseek}]:[],c._onunlock=s.onunlock?[{fn:s.onunlock}]:[],c._onresume=[],c._webAudio=n.usingWebAudio&&!c._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(c),c._autoplay&&c._queue.push({event:"play",action:function(){c.play()}}),c._preload&&c._preload!=="none"&&c.load(),c},load:function(){var s=this,c=null;if(n.noAudio){s._emit("loaderror",null,"No audio support.");return}typeof s._src=="string"&&(s._src=[s._src]);for(var m=0;m<s._src.length;m++){var y,k;if(s._format&&s._format[m])y=s._format[m];else{if(k=s._src[m],typeof k!="string"){s._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}y=/^data:audio\/([^;,]+);/i.exec(k),y||(y=/\.([^.]+)$/.exec(k.split("?",1)[0])),y&&(y=y[1].toLowerCase())}if(y||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),y&&n.codecs(y)){c=s._src[m];break}}if(!c){s._emit("loaderror",null,"No codec support for selected audio sources.");return}return s._src=c,s._state="loading",window.location.protocol==="https:"&&c.slice(0,5)==="http:"&&(s._html5=!0,s._webAudio=!1),new t(s),s._webAudio&&o(s),s},play:function(s,c){var m=this,y=null;if(typeof s=="number")y=s,s=null;else{if(typeof s=="string"&&m._state==="loaded"&&!m._sprite[s])return null;if(typeof s>"u"&&(s="__default",!m._playLock)){for(var k=0,x=0;x<m._sounds.length;x++)m._sounds[x]._paused&&!m._sounds[x]._ended&&(k++,y=m._sounds[x]._id);k===1?s=null:y=null}}var A=y?m._soundById(y):m._inactiveSound();if(!A)return null;if(y&&!s&&(s=A._sprite||"__default"),m._state!=="loaded"){A._sprite=s,A._ended=!1;var z=A._id;return m._queue.push({event:"play",action:function(){m.play(z)}}),z}if(y&&!A._paused)return c||m._loadQueue("play"),A._id;m._webAudio&&n._autoResume();var Y=Math.max(0,A._seek>0?A._seek:m._sprite[s][0]/1e3),re=Math.max(0,(m._sprite[s][0]+m._sprite[s][1])/1e3-Y),_e=re*1e3/Math.abs(A._rate),Le=m._sprite[s][0]/1e3,Ye=(m._sprite[s][0]+m._sprite[s][1])/1e3;A._sprite=s,A._ended=!1;var Ke=function(){A._paused=!1,A._seek=Y,A._start=Le,A._stop=Ye,A._loop=!!(A._loop||m._sprite[s][2])};if(Y>=Ye){m._ended(A);return}var he=A._node;if(m._webAudio){var mt=function(){m._playLock=!1,Ke(),m._refreshBuffer(A);var ft=A._muted||m._muted?0:A._volume;he.gain.setValueAtTime(ft,n.ctx.currentTime),A._playStart=n.ctx.currentTime,typeof he.bufferSource.start>"u"?A._loop?he.bufferSource.noteGrainOn(0,Y,86400):he.bufferSource.noteGrainOn(0,Y,re):A._loop?he.bufferSource.start(0,Y,86400):he.bufferSource.start(0,Y,re),_e!==1/0&&(m._endTimers[A._id]=setTimeout(m._ended.bind(m,A),_e)),c||setTimeout(function(){m._emit("play",A._id),m._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?mt():(m._playLock=!0,m.once("resume",mt),m._clearTimer(A._id))}else{var ct=function(){he.currentTime=Y,he.muted=A._muted||m._muted||n._muted||he.muted,he.volume=A._volume*n.volume(),he.playbackRate=A._rate;try{var ft=he.play();if(ft&&typeof Promise<"u"&&(ft instanceof Promise||typeof ft.then=="function")?(m._playLock=!0,Ke(),ft.then(function(){m._playLock=!1,he._unlocked=!0,c?m._loadQueue():m._emit("play",A._id)}).catch(function(){m._playLock=!1,m._emit("playerror",A._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."),A._ended=!0,A._paused=!0})):c||(m._playLock=!1,Ke(),m._emit("play",A._id)),he.playbackRate=A._rate,he.paused){m._emit("playerror",A._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}s!=="__default"||A._loop?m._endTimers[A._id]=setTimeout(m._ended.bind(m,A),_e):(m._endTimers[A._id]=function(){m._ended(A),he.removeEventListener("ended",m._endTimers[A._id],!1)},he.addEventListener("ended",m._endTimers[A._id],!1))}catch(xi){m._emit("playerror",A._id,xi)}};he.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(he.src=m._src,he.load());var qt=window&&window.ejecta||!he.readyState&&n._navigator.isCocoonJS;if(he.readyState>=3||qt)ct();else{m._playLock=!0,m._state="loading";var pt=function(){m._state="loaded",ct(),he.removeEventListener(n._canPlayEvent,pt,!1)};he.addEventListener(n._canPlayEvent,pt,!1),m._clearTimer(A._id)}}return A._id},pause:function(s){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"pause",action:function(){c.pause(s)}}),c;for(var m=c._getSoundIds(s),y=0;y<m.length;y++){c._clearTimer(m[y]);var k=c._soundById(m[y]);if(k&&!k._paused&&(k._seek=c.seek(m[y]),k._rateSeek=0,k._paused=!0,c._stopFade(m[y]),k._node))if(c._webAudio){if(!k._node.bufferSource)continue;typeof k._node.bufferSource.stop>"u"?k._node.bufferSource.noteOff(0):k._node.bufferSource.stop(0),c._cleanBuffer(k._node)}else(!isNaN(k._node.duration)||k._node.duration===1/0)&&k._node.pause();arguments[1]||c._emit("pause",k?k._id:null)}return c},stop:function(s,c){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"stop",action:function(){m.stop(s)}}),m;for(var y=m._getSoundIds(s),k=0;k<y.length;k++){m._clearTimer(y[k]);var x=m._soundById(y[k]);x&&(x._seek=x._start||0,x._rateSeek=0,x._paused=!0,x._ended=!0,m._stopFade(y[k]),x._node&&(m._webAudio?x._node.bufferSource&&(typeof x._node.bufferSource.stop>"u"?x._node.bufferSource.noteOff(0):x._node.bufferSource.stop(0),m._cleanBuffer(x._node)):(!isNaN(x._node.duration)||x._node.duration===1/0)&&(x._node.currentTime=x._start||0,x._node.pause(),x._node.duration===1/0&&m._clearSound(x._node))),c||m._emit("stop",x._id))}return m},mute:function(s,c){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"mute",action:function(){m.mute(s,c)}}),m;if(typeof c>"u")if(typeof s=="boolean")m._muted=s;else return m._muted;for(var y=m._getSoundIds(c),k=0;k<y.length;k++){var x=m._soundById(y[k]);x&&(x._muted=s,x._interval&&m._stopFade(x._id),m._webAudio&&x._node?x._node.gain.setValueAtTime(s?0:x._volume,n.ctx.currentTime):x._node&&(x._node.muted=n._muted?!0:s),m._emit("mute",x._id))}return m},volume:function(){var s=this,c=arguments,m,y;if(c.length===0)return s._volume;if(c.length===1||c.length===2&&typeof c[1]>"u"){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):m=parseFloat(c[0])}else c.length>=2&&(m=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof m<"u"&&m>=0&&m<=1){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"volume",action:function(){s.volume.apply(s,c)}}),s;typeof y>"u"&&(s._volume=m),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)A=s._soundById(y[z]),A&&(A._volume=m,c[2]||s._stopFade(y[z]),s._webAudio&&A._node&&!A._muted?A._node.gain.setValueAtTime(m,n.ctx.currentTime):A._node&&!A._muted&&(A._node.volume=m*n.volume()),s._emit("volume",A._id))}else return A=y?s._soundById(y):s._sounds[0],A?A._volume:0;return s},fade:function(s,c,m,y){var k=this;if(k._state!=="loaded"||k._playLock)return k._queue.push({event:"fade",action:function(){k.fade(s,c,m,y)}}),k;s=Math.min(Math.max(0,parseFloat(s)),1),c=Math.min(Math.max(0,parseFloat(c)),1),m=parseFloat(m),k.volume(s,y);for(var x=k._getSoundIds(y),A=0;A<x.length;A++){var z=k._soundById(x[A]);if(z){if(y||k._stopFade(x[A]),k._webAudio&&!z._muted){var Y=n.ctx.currentTime,re=Y+m/1e3;z._volume=s,z._node.gain.setValueAtTime(s,Y),z._node.gain.linearRampToValueAtTime(c,re)}k._startFadeInterval(z,s,c,m,x[A],typeof y>"u")}}return k},_startFadeInterval:function(s,c,m,y,k,x){var A=this,z=c,Y=m-c,re=Math.abs(Y/.01),_e=Math.max(4,re>0?y/re:y),Le=Date.now();s._fadeTo=m,s._interval=setInterval(function(){var Ye=(Date.now()-Le)/y;Le=Date.now(),z+=Y*Ye,z=Math.round(z*100)/100,Y<0?z=Math.max(m,z):z=Math.min(m,z),A._webAudio?s._volume=z:A.volume(z,s._id,!0),x&&(A._volume=z),(m<c&&z<=m||m>c&&z>=m)&&(clearInterval(s._interval),s._interval=null,s._fadeTo=null,A.volume(m,s._id),A._emit("fade",s._id))},_e)},_stopFade:function(s){var c=this,m=c._soundById(s);return m&&m._interval&&(c._webAudio&&m._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(m._interval),m._interval=null,c.volume(m._fadeTo,s),m._fadeTo=null,c._emit("fade",s)),c},loop:function(){var s=this,c=arguments,m,y,k;if(c.length===0)return s._loop;if(c.length===1)if(typeof c[0]=="boolean")m=c[0],s._loop=m;else return k=s._soundById(parseInt(c[0],10)),k?k._loop:!1;else c.length===2&&(m=c[0],y=parseInt(c[1],10));for(var x=s._getSoundIds(y),A=0;A<x.length;A++)k=s._soundById(x[A]),k&&(k._loop=m,s._webAudio&&k._node&&k._node.bufferSource&&(k._node.bufferSource.loop=m,m&&(k._node.bufferSource.loopStart=k._start||0,k._node.bufferSource.loopEnd=k._stop,s.playing(x[A])&&(s.pause(x[A],!0),s.play(x[A],!0)))));return s},rate:function(){var s=this,c=arguments,m,y;if(c.length===0)y=s._sounds[0]._id;else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):m=parseFloat(c[0])}else c.length===2&&(m=parseFloat(c[0]),y=parseInt(c[1],10));var A;if(typeof m=="number"){if(s._state!=="loaded"||s._playLock)return s._queue.push({event:"rate",action:function(){s.rate.apply(s,c)}}),s;typeof y>"u"&&(s._rate=m),y=s._getSoundIds(y);for(var z=0;z<y.length;z++)if(A=s._soundById(y[z]),A){s.playing(y[z])&&(A._rateSeek=s.seek(y[z]),A._playStart=s._webAudio?n.ctx.currentTime:A._playStart),A._rate=m,s._webAudio&&A._node&&A._node.bufferSource?A._node.bufferSource.playbackRate.setValueAtTime(m,n.ctx.currentTime):A._node&&(A._node.playbackRate=m);var Y=s.seek(y[z]),re=(s._sprite[A._sprite][0]+s._sprite[A._sprite][1])/1e3-Y,_e=re*1e3/Math.abs(A._rate);(s._endTimers[y[z]]||!A._paused)&&(s._clearTimer(y[z]),s._endTimers[y[z]]=setTimeout(s._ended.bind(s,A),_e)),s._emit("rate",A._id)}}else return A=s._soundById(y),A?A._rate:s._rate;return s},seek:function(){var s=this,c=arguments,m,y;if(c.length===0)s._sounds.length&&(y=s._sounds[0]._id);else if(c.length===1){var k=s._getSoundIds(),x=k.indexOf(c[0]);x>=0?y=parseInt(c[0],10):s._sounds.length&&(y=s._sounds[0]._id,m=parseFloat(c[0]))}else c.length===2&&(m=parseFloat(c[0]),y=parseInt(c[1],10));if(typeof y>"u")return 0;if(typeof m=="number"&&(s._state!=="loaded"||s._playLock))return s._queue.push({event:"seek",action:function(){s.seek.apply(s,c)}}),s;var A=s._soundById(y);if(A)if(typeof m=="number"&&m>=0){var z=s.playing(y);z&&s.pause(y,!0),A._seek=m,A._ended=!1,s._clearTimer(y),!s._webAudio&&A._node&&!isNaN(A._node.duration)&&(A._node.currentTime=m);var Y=function(){z&&s.play(y,!0),s._emit("seek",y)};if(z&&!s._webAudio){var re=function(){s._playLock?setTimeout(re,0):Y()};setTimeout(re,0)}else Y()}else if(s._webAudio){var _e=s.playing(y)?n.ctx.currentTime-A._playStart:0,Le=A._rateSeek?A._rateSeek-A._seek:0;return A._seek+(Le+_e*Math.abs(A._rate))}else return A._node.currentTime;return s},playing:function(s){var c=this;if(typeof s=="number"){var m=c._soundById(s);return m?!m._paused:!1}for(var y=0;y<c._sounds.length;y++)if(!c._sounds[y]._paused)return!0;return!1},duration:function(s){var c=this,m=c._duration,y=c._soundById(s);return y&&(m=c._sprite[y._sprite][1]/1e3),m},state:function(){return this._state},unload:function(){for(var s=this,c=s._sounds,m=0;m<c.length;m++)c[m]._paused||s.stop(c[m]._id),s._webAudio||(s._clearSound(c[m]._node),c[m]._node.removeEventListener("error",c[m]._errorFn,!1),c[m]._node.removeEventListener(n._canPlayEvent,c[m]._loadFn,!1),c[m]._node.removeEventListener("ended",c[m]._endFn,!1),n._releaseHtml5Audio(c[m]._node)),delete c[m]._node,s._clearTimer(c[m]._id);var y=n._howls.indexOf(s);y>=0&&n._howls.splice(y,1);var k=!0;for(m=0;m<n._howls.length;m++)if(n._howls[m]._src===s._src||s._src.indexOf(n._howls[m]._src)>=0){k=!1;break}return i&&k&&delete i[s._src],n.noAudio=!1,s._state="unloaded",s._sounds=[],s=null,null},on:function(s,c,m,y){var k=this,x=k["_on"+s];return typeof c=="function"&&x.push(y?{id:m,fn:c,once:y}:{id:m,fn:c}),k},off:function(s,c,m){var y=this,k=y["_on"+s],x=0;if(typeof c=="number"&&(m=c,c=null),c||m)for(x=0;x<k.length;x++){var A=m===k[x].id;if(c===k[x].fn&&A||!c&&A){k.splice(x,1);break}}else if(s)y["_on"+s]=[];else{var z=Object.keys(y);for(x=0;x<z.length;x++)z[x].indexOf("_on")===0&&Array.isArray(y[z[x]])&&(y[z[x]]=[])}return y},once:function(s,c,m){var y=this;return y.on(s,c,m,1),y},_emit:function(s,c,m){for(var y=this,k=y["_on"+s],x=k.length-1;x>=0;x--)(!k[x].id||k[x].id===c||s==="load")&&(setTimeout(function(A){A.call(this,c,m)}.bind(y,k[x].fn),0),k[x].once&&y.off(s,k[x].fn,k[x].id));return y._loadQueue(s),y},_loadQueue:function(s){var c=this;if(c._queue.length>0){var m=c._queue[0];m.event===s&&(c._queue.shift(),c._loadQueue()),s||m.action()}return c},_ended:function(s){var c=this,m=s._sprite;if(!c._webAudio&&s._node&&!s._node.paused&&!s._node.ended&&s._node.currentTime<s._stop)return setTimeout(c._ended.bind(c,s),100),c;var y=!!(s._loop||c._sprite[m][2]);if(c._emit("end",s._id),!c._webAudio&&y&&c.stop(s._id,!0).play(s._id),c._webAudio&&y){c._emit("play",s._id),s._seek=s._start||0,s._rateSeek=0,s._playStart=n.ctx.currentTime;var k=(s._stop-s._start)*1e3/Math.abs(s._rate);c._endTimers[s._id]=setTimeout(c._ended.bind(c,s),k)}return c._webAudio&&!y&&(s._paused=!0,s._ended=!0,s._seek=s._start||0,s._rateSeek=0,c._clearTimer(s._id),c._cleanBuffer(s._node),n._autoSuspend()),!c._webAudio&&!y&&c.stop(s._id,!0),c},_clearTimer:function(s){var c=this;if(c._endTimers[s]){if(typeof c._endTimers[s]!="function")clearTimeout(c._endTimers[s]);else{var m=c._soundById(s);m&&m._node&&m._node.removeEventListener("ended",c._endTimers[s],!1)}delete c._endTimers[s]}return c},_soundById:function(s){for(var c=this,m=0;m<c._sounds.length;m++)if(s===c._sounds[m]._id)return c._sounds[m];return null},_inactiveSound:function(){var s=this;s._drain();for(var c=0;c<s._sounds.length;c++)if(s._sounds[c]._ended)return s._sounds[c].reset();return new t(s)},_drain:function(){var s=this,c=s._pool,m=0,y=0;if(!(s._sounds.length<c)){for(y=0;y<s._sounds.length;y++)s._sounds[y]._ended&&m++;for(y=s._sounds.length-1;y>=0;y--){if(m<=c)return;s._sounds[y]._ended&&(s._webAudio&&s._sounds[y]._node&&s._sounds[y]._node.disconnect(0),s._sounds.splice(y,1),m--)}}},_getSoundIds:function(s){var c=this;if(typeof s>"u"){for(var m=[],y=0;y<c._sounds.length;y++)m.push(c._sounds[y]._id);return m}else return[s]},_refreshBuffer:function(s){var c=this;return s._node.bufferSource=n.ctx.createBufferSource(),s._node.bufferSource.buffer=i[c._src],s._panner?s._node.bufferSource.connect(s._panner):s._node.bufferSource.connect(s._node),s._node.bufferSource.loop=s._loop,s._loop&&(s._node.bufferSource.loopStart=s._start||0,s._node.bufferSource.loopEnd=s._stop||0),s._node.bufferSource.playbackRate.setValueAtTime(s._rate,n.ctx.currentTime),c},_cleanBuffer:function(s){var c=this,m=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!s.bufferSource)return c;if(n._scratchBuffer&&s.bufferSource&&(s.bufferSource.onended=null,s.bufferSource.disconnect(0),m))try{s.bufferSource.buffer=n._scratchBuffer}catch{}return s.bufferSource=null,c},_clearSound:function(s){var c=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);c||(s.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var t=function(s){this._parent=s,this.init()};t.prototype={init:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,c._sounds.push(s),s.create(),s},create:function(){var s=this,c=s._parent,m=n._muted||s._muted||s._parent._muted?0:s._volume;return c._webAudio?(s._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),s._node.gain.setValueAtTime(m,n.ctx.currentTime),s._node.paused=!0,s._node.connect(n.masterGain)):n.noAudio||(s._node=n._obtainHtml5Audio(),s._errorFn=s._errorListener.bind(s),s._node.addEventListener("error",s._errorFn,!1),s._loadFn=s._loadListener.bind(s),s._node.addEventListener(n._canPlayEvent,s._loadFn,!1),s._endFn=s._endListener.bind(s),s._node.addEventListener("ended",s._endFn,!1),s._node.src=c._src,s._node.preload=c._preload===!0?"auto":c._preload,s._node.volume=m*n.volume(),s._node.load()),s},reset:function(){var s=this,c=s._parent;return s._muted=c._muted,s._loop=c._loop,s._volume=c._volume,s._rate=c._rate,s._seek=0,s._rateSeek=0,s._paused=!0,s._ended=!0,s._sprite="__default",s._id=++n._counter,s},_errorListener:function(){var s=this;s._parent._emit("loaderror",s._id,s._node.error?s._node.error.code:0),s._node.removeEventListener("error",s._errorFn,!1)},_loadListener:function(){var s=this,c=s._parent;c._duration=Math.ceil(s._node.duration*10)/10,Object.keys(c._sprite).length===0&&(c._sprite={__default:[0,c._duration*1e3]}),c._state!=="loaded"&&(c._state="loaded",c._emit("load"),c._loadQueue()),s._node.removeEventListener(n._canPlayEvent,s._loadFn,!1)},_endListener:function(){var s=this,c=s._parent;c._duration===1/0&&(c._duration=Math.ceil(s._node.duration*10)/10,c._sprite.__default[1]===1/0&&(c._sprite.__default[1]=c._duration*1e3),c._ended(s)),s._node.removeEventListener("ended",s._endFn,!1)}};var i={},o=function(s){var c=s._src;if(i[c]){s._duration=i[c].duration,d(s);return}if(/^data:[^;]+;base64,/.test(c)){for(var m=atob(c.split(",")[1]),y=new Uint8Array(m.length),k=0;k<m.length;++k)y[k]=m.charCodeAt(k);l(y.buffer,s)}else{var x=new XMLHttpRequest;x.open(s._xhr.method,c,!0),x.withCredentials=s._xhr.withCredentials,x.responseType="arraybuffer",s._xhr.headers&&Object.keys(s._xhr.headers).forEach(function(A){x.setRequestHeader(A,s._xhr.headers[A])}),x.onload=function(){var A=(x.status+"")[0];if(A!=="0"&&A!=="2"&&A!=="3"){s._emit("loaderror",null,"Failed loading audio file with status: "+x.status+".");return}l(x.response,s)},x.onerror=function(){s._webAudio&&(s._html5=!0,s._webAudio=!1,s._sounds=[],delete i[c],s.load())},a(x)}},a=function(s){try{s.send()}catch{s.onerror()}},l=function(s,c){var m=function(){c._emit("loaderror",null,"Decoding audio data failed.")},y=function(k){k&&c._sounds.length>0?(i[c._src]=k,d(c,k)):m()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(s).then(y).catch(m):n.ctx.decodeAudioData(s,y,m)},d=function(s,c){c&&!s._duration&&(s._duration=c.duration),Object.keys(s._sprite).length===0&&(s._sprite={__default:[0,s._duration*1e3]}),s._state!=="loaded"&&(s._state="loaded",s._emit("load"),s._loadQueue())},f=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var s=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),c=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),m=c?parseInt(c[1],10):null;if(s&&m&&m<9){var y=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!y&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:n,Howl:e}}),typeof Do<"u"&&(Do.Howler=n,Do.Howl=e),typeof global<"u"?(global.HowlerGlobal=r,global.Howler=n,global.Howl=e,global.Sound=t):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=n,window.Howl=e,window.Sound=t)})();(function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var t=e._howls.length-1;t>=0;t--)e._howls[t].stereo(n);return e},HowlerGlobal.prototype.pos=function(n,e,t){var i=this;if(!i.ctx||!i.ctx.listener)return i;if(e=typeof e!="number"?i._pos[1]:e,t=typeof t!="number"?i._pos[2]:t,typeof n=="number")i._pos=[n,e,t],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(n,e,t,i,o,a){var l=this;if(!l.ctx||!l.ctx.listener)return l;var d=l._orientation;if(e=typeof e!="number"?d[1]:e,t=typeof t!="number"?d[2]:t,i=typeof i!="number"?d[3]:i,o=typeof o!="number"?d[4]:o,a=typeof a!="number"?d[5]:a,typeof n=="number")l._orientation=[n,e,t,i,o,a],typeof l.ctx.listener.forwardX<"u"?(l.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),l.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),l.ctx.listener.forwardZ.setTargetAtTime(t,Howler.ctx.currentTime,.1),l.ctx.listener.upX.setTargetAtTime(i,Howler.ctx.currentTime,.1),l.ctx.listener.upY.setTargetAtTime(o,Howler.ctx.currentTime,.1),l.ctx.listener.upZ.setTargetAtTime(a,Howler.ctx.currentTime,.1)):l.ctx.listener.setOrientation(n,e,t,i,o,a);else return d;return l},Howl.prototype.init=function(n){return function(e){var t=this;return t._orientation=e.orientation||[1,0,0],t._stereo=e.stereo||null,t._pos=e.pos||null,t._pannerAttr={coneInnerAngle:typeof e.coneInnerAngle<"u"?e.coneInnerAngle:360,coneOuterAngle:typeof e.coneOuterAngle<"u"?e.coneOuterAngle:360,coneOuterGain:typeof e.coneOuterGain<"u"?e.coneOuterGain:0,distanceModel:typeof e.distanceModel<"u"?e.distanceModel:"inverse",maxDistance:typeof e.maxDistance<"u"?e.maxDistance:1e4,panningModel:typeof e.panningModel<"u"?e.panningModel:"HRTF",refDistance:typeof e.refDistance<"u"?e.refDistance:1,rolloffFactor:typeof e.rolloffFactor<"u"?e.rolloffFactor:1},t._onstereo=e.onstereo?[{fn:e.onstereo}]:[],t._onpos=e.onpos?[{fn:e.onpos}]:[],t._onorientation=e.onorientation?[{fn:e.onorientation}]:[],n.call(this,e)}}(Howl.prototype.init),Howl.prototype.stereo=function(n,e){var t=this;if(!t._webAudio)return t;if(t._state!=="loaded")return t._queue.push({event:"stereo",action:function(){t.stereo(n,e)}}),t;var i=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof n=="number")t._stereo=n,t._pos=[n,0,0];else return t._stereo;for(var o=t._getSoundIds(e),a=0;a<o.length;a++){var l=t._soundById(o[a]);if(l)if(typeof n=="number")l._stereo=n,l._pos=[n,0,0],l._node&&(l._pannerAttr.panningModel="equalpower",(!l._panner||!l._panner.pan)&&r(l,i),i==="spatial"?typeof l._panner.positionX<"u"?(l._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),l._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),l._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):l._panner.setPosition(n,0,0):l._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),t._emit("stereo",l._id);else return l._stereo}return t},Howl.prototype.pos=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"pos",action:function(){o.pos(n,e,t,i)}}),o;if(e=typeof e!="number"?0:e,t=typeof t!="number"?-.5:t,typeof i>"u")if(typeof n=="number")o._pos=[n,e,t];else return o._pos;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._pos=[n,e,t],d._node&&((!d._panner||d._panner.pan)&&r(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setPosition(n,e,t)),o._emit("pos",d._id);else return d._pos}return o},Howl.prototype.orientation=function(n,e,t,i){var o=this;if(!o._webAudio)return o;if(o._state!=="loaded")return o._queue.push({event:"orientation",action:function(){o.orientation(n,e,t,i)}}),o;if(e=typeof e!="number"?o._orientation[1]:e,t=typeof t!="number"?o._orientation[2]:t,typeof i>"u")if(typeof n=="number")o._orientation=[n,e,t];else return o._orientation;for(var a=o._getSoundIds(i),l=0;l<a.length;l++){var d=o._soundById(a[l]);if(d)if(typeof n=="number")d._orientation=[n,e,t],d._node&&(d._panner||(d._pos||(d._pos=o._pos||[0,0,-.5]),r(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(t,Howler.ctx.currentTime)):d._panner.setOrientation(n,e,t)),o._emit("orientation",d._id);else return d._orientation}return o},Howl.prototype.pannerAttr=function(){var n=this,e=arguments,t,i,o;if(!n._webAudio)return n;if(e.length===0)return n._pannerAttr;if(e.length===1)if(typeof e[0]=="object")t=e[0],typeof i>"u"&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),n._pannerAttr={coneInnerAngle:typeof t.pannerAttr.coneInnerAngle<"u"?t.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof t.pannerAttr.coneOuterAngle<"u"?t.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof t.pannerAttr.coneOuterGain<"u"?t.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof t.pannerAttr.distanceModel<"u"?t.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof t.pannerAttr.maxDistance<"u"?t.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof t.pannerAttr.refDistance<"u"?t.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof t.pannerAttr.rolloffFactor<"u"?t.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof t.pannerAttr.panningModel<"u"?t.pannerAttr.panningModel:n._panningModel});else return o=n._soundById(parseInt(e[0],10)),o?o._pannerAttr:n._pannerAttr;else e.length===2&&(t=e[0],i=parseInt(e[1],10));for(var a=n._getSoundIds(i),l=0;l<a.length;l++)if(o=n._soundById(a[l]),o){var d=o._pannerAttr;d={coneInnerAngle:typeof t.coneInnerAngle<"u"?t.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof t.coneOuterAngle<"u"?t.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof t.coneOuterGain<"u"?t.coneOuterGain:d.coneOuterGain,distanceModel:typeof t.distanceModel<"u"?t.distanceModel:d.distanceModel,maxDistance:typeof t.maxDistance<"u"?t.maxDistance:d.maxDistance,refDistance:typeof t.refDistance<"u"?t.refDistance:d.refDistance,rolloffFactor:typeof t.rolloffFactor<"u"?t.rolloffFactor:d.rolloffFactor,panningModel:typeof t.panningModel<"u"?t.panningModel:d.panningModel};var f=o._panner;f||(o._pos||(o._pos=n._pos||[0,0,-.5]),r(o,"spatial"),f=o._panner),f.coneInnerAngle=d.coneInnerAngle,f.coneOuterAngle=d.coneOuterAngle,f.coneOuterGain=d.coneOuterGain,f.distanceModel=d.distanceModel,f.maxDistance=d.maxDistance,f.refDistance=d.refDistance,f.rolloffFactor=d.rolloffFactor,f.panningModel=d.panningModel}return n},Sound.prototype.init=function(n){return function(){var e=this,t=e._parent;e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,n.call(this),e._stereo?t.stereo(e._stereo):e._pos&&t.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}}(Sound.prototype.init),Sound.prototype.reset=function(n){return function(){var e=this,t=e._parent;return e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,e._stereo?t.stereo(e._stereo):e._pos?t.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,t._refreshBuffer(e)),n.call(this)}}(Sound.prototype.reset);var r=function(n,e){e=e||"spatial",e==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()});var ms=Sa((s2,zo)=>{(function(r){"use strict";function n(u){if(Array.isArray(u)){for(var h=0,p=Array(u.length);h<u.length;h++)p[h]=u[h];return p}return Array.from(u)}function e(u,h){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?u:h}function t(u,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);u.prototype=Object.create(h&&h.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(u,h):u.__proto__=h)}function i(u,h){if(!(u instanceof h))throw new TypeError("Cannot call a class as a function")}function o(u,h){if(h||(h=typeof window>"u"?global:window),h[u]!==void 0)return h[u];if(Ti===null){var p=window.getComputedStyle(document.documentElement,"");Ti=(Array.prototype.slice.call(p).join("").match(/-(moz|webkit|ms)-/)||p.OLink===""&&["","o"]||["",""])[1]}if(Ti==="")return null;var w=u.charAt(0).toUpperCase()+u.substr(1),C=h[Ti+w];return C!==void 0?C:null}function a(u,h,p,w,C,T,O){if(typeof w!="function")throw new TypeError("Invalid animation rule:",w);var N=u-p,R=N/C,W=0;R>1&&(R=1),R!==1&&(W=w(R),isFinite(W)&&!isNaN(W)&&(R=W)),h&&h(R),N<C?O.frame=jr(function(j){return a(j,h,p,w,C,T,O)}):(T&&T(),O.inProgress=!1)}function l(){Array.prototype.constructor.apply(this,arguments)}function d(u){if(!(u instanceof DOMException&&u.result===2152923147))throw u}function f(u,h){return h.replace(ya,function(p,w){var C=u[w];return C!==void 0?C:p})}function s(u){return u.majorTicks instanceof Array||(u.majorTicks=u.majorTicks?[u.majorTicks]:[]),u.majorTicks.length||(u.majorTicks.push(Z.formatMajorTickNumber(u.minValue,u)),u.majorTicks.push(Z.formatMajorTickNumber(u.maxValue,u))),[u.tickSide!=="right",u.tickSide!=="left"]}function c(u,h,p,w,C,T){u.beginPath(),u.moveTo(h+T,p),u.lineTo(h+w-T,p),u.quadraticCurveTo(h+w,p,h+w,p+T),u.lineTo(h+w,p+C-T),u.quadraticCurveTo(h+w,p+C,h+w-T,p+C),u.lineTo(h+T,p+C),u.quadraticCurveTo(h,p+C,h,p+C-T),u.lineTo(h,p+T),u.quadraticCurveTo(h,p,h+T,p),u.closePath()}function m(u,h){var p=h.valueDec,w=h.valueInt,C=0,T=void 0,O=void 0,N=void 0;if(u=parseFloat(u),N=u<0,u=Math.abs(u),p>0){for(O=u.toFixed(p).toString().split("."),T=w-O[0].length;C<T;++C)O[0]="0"+O[0];O=(N?"-":"")+O[0]+"."+O[1]}else{for(O=Math.round(u).toString(),T=w-O.length;C<T;++C)O="0"+O;O=(N?"-":"")+O}return O}function y(u,h){var p=void 0,w=!1;return p=h.majorTicksDec===0?Math.round(u).toString():u.toFixed(h.majorTicksDec),h.majorTicksInt>1?(w=~p.indexOf("."),~p.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(w?1:0)-p.length].join("0")+p.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(w?1:0)-p.length].join("0")+p):p}function k(u){return u*Math.PI/180}function x(u,h){return{x:-u*Math.sin(h),y:u*Math.cos(h)}}function A(u,h,p,w){var C=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],T=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,O=u.createLinearGradient(C?0:T,C?T:0,C?0:w,C?w:0);return O.addColorStop(0,h),O.addColorStop(1,p),O}function z(u,h){h.needleShadow&&(u.shadowOffsetX=2,u.shadowOffsetY=2,u.shadowBlur=10,u.shadowColor=h.colorNeedleShadowDown)}function Y(u,h,p){return u["font"+h+"Style"]+" "+u["font"+h+"Weight"]+" "+u["font"+h+"Size"]*p+"px "+u["font"+h]}function re(u){u.shadowOffsetX=null,u.shadowOffsetY=null,u.shadowBlur=null,u.shadowColor="",u.strokeStyle=null,u.lineWidth=0,u.save()}function _e(u,h,p,w){h.valueTextShadow&&(u.shadowOffsetX=p,u.shadowOffsetY=p,u.shadowBlur=w,u.shadowColor=h.colorValueTextShadow)}function Le(u,h,p,w,C,T){if(h.valueBox){re(u);var O=h.valueDec?1+h.valueDec:0,N="9".repeat(Math.max.apply(null,[String(parseInt(p)).length+O].concat(h.majorTicks.map(function(we){return String(parseInt(we,10)).length+O})))),R=h.valueText||m(p,h),W=T/200,j=T/100,q=.4*j,J=1.2*j;u.font=Y(h,"Value",W),_e(u,h,q,J);var le=u.measureText(h.valueText?R:"-"+m(Number(N),h)).width;re(u);var pe=parseFloat(h.fontValueSize)*W+q+J,Oe=j*parseFloat(h.valueBoxStroke),ge=2*T-2*Oe,Ne=le+10*j,We=1.1*pe+q+J,Be=j*h.valueBoxBorderRadius,ue=(parseFloat(h.valueBoxWidth)||0)/100*ge;ue>Ne&&(Ne=ue),Ne>ge&&(Ne=ge);var xe=w-Ne/2,ve=C-We/2,oe=C-5.75*j;if(u.beginPath(),Be?c(u,xe,ve,Ne,We,Be):u.rect(xe,ve,Ne,We),Oe){var ye=u.createRadialGradient(w,oe,10*j,w,oe,20*j);ye.addColorStop(0,h.colorValueBoxRect),ye.addColorStop(1,h.colorValueBoxRectEnd),u.strokeStyle=ye,u.lineWidth=Oe,u.stroke()}h.colorValueBoxShadow&&(u.shadowBlur=1.2*j,u.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(u.fillStyle=h.colorValueBoxBackground,u.fill()),u.closePath(),u.restore(),_e(u,h,q,J),u.fillStyle=h.colorValueText,u.textAlign="center",u.textBaseline="alphabetic",u.fillText(R,xe+Ne/2,C+We/2-pe/3),u.restore()}}function Ye(u){var h=u.value,p=u.minValue,w=u.maxValue,C=.01*(w-p);return{normal:h<p?p:h>w?w:h,indented:h<p?p-C:h>w?w+C:h}}function Ke(u,h,p,w,C){p.beginPath(),p.arc(0,0,Ot(u),0,2*nn,!0),p.lineWidth=h,p.strokeStyle=C?Z.linearGradient(p,w,C,u):w,p.stroke(),p.closePath()}function he(u,h){var p=Ft.pixelRatio;return u.maxRadius||(u.maxRadius=u.max-h.borderShadowWidth-h.borderOuterWidth*p-h.borderMiddleWidth*p-h.borderInnerWidth*p+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),u.maxRadius}function mt(u,h){function p(q,J,le,pe,Oe,ge){return J&&(!ge&&h.borderShadowWidth&&(le.save(),le.shadowBlur=h.borderShadowWidth,le.shadowColor=h.colorBorderShadow),Ke(q,J*w,le,pe,Oe),!ge&&h.borderShadowWidth&&(ge=!0,le.restore())),ge}var w=Ft.pixelRatio,C=h.borderShadowWidth*w,T=u.max-C-h.borderOuterWidth*w/2,O=T-h.borderOuterWidth*w/2-h.borderMiddleWidth*w/2+.5,N=O-h.borderMiddleWidth*w/2-h.borderInnerWidth*w/2+.5,R=he(u,h),W=void 0,j=!1;u.save(),j=p(T,h.borderOuterWidth,u,h.colorBorderOuter,h.colorBorderOuterEnd,j),j=p(O,h.borderMiddleWidth,u,h.colorBorderMiddle,h.colorBorderMiddleEnd,j),j=p(N,h.borderInnerWidth,u,h.colorBorderInner,h.colorBorderInnerEnd,j),!j&&h.borderShadowWidth&&(u.shadowBlur=h.borderShadowWidth,u.shadowColor=h.colorBorderShadow),u.beginPath(),u.arc(0,0,Ot(R),0,2*nn,!0),h.colorPlateEnd?(W=u.createRadialGradient(0,0,R/2,0,0,R),W.addColorStop(0,h.colorPlate),W.addColorStop(1,h.colorPlateEnd)):W=h.colorPlate,u.fillStyle=W,u.fill(),u.closePath(),u.restore()}function ct(u,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var p=u.max*(parseFloat(h.highlightsWidth)||0)/100,w=Ot(pt(u,h)-p/2),C=h.highlights.length,T=(h.maxValue-h.minValue)/h.ticksAngle;u.save();for(var O=0;O<C;O++){var N=h.highlights[O];u.lineWidth=p,u.lineCap=h.highlightsLineCap,u.strokeStyle=N.color,u.beginPath(),u.rotate(En),u.arc(0,0,w,Z.radians(h.startAngle+(N.from-h.minValue)/T),Z.radians(h.startAngle+(N.to-h.minValue)/T),!1),u.stroke(),u.closePath(),u.restore(),u.save()}u.restore()}}function qt(u,h){var p=pt(u,h),w=void 0,C=void 0,T=void 0,O=0,N=Math.abs(h.minorTicks)||0,R=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(C=h.maxValue-h.minValue,w=N?C/N:0,O=(It.mod(h.majorTicks[0],N)||0)*R):w=N*(h.majorTicks.length-1),u.lineWidth=Ft.pixelRatio,u.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,u.save();for(var W=0;W<w;++W)(T=h.startAngle+O+W*(h.ticksAngle/w))<=h.ticksAngle+h.startAngle&&(u.rotate(Z.radians(T)),u.beginPath(),u.moveTo(0,p),u.lineTo(0,p-.075*u.max),Sn(u));u.restore()}function pt(u,h){var p=u.max/100;return he(u,h)-5*p-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*p:0)}function ft(u,h){Z.prepareTicks(h);var p=Ot(pt(u,h)),w=void 0,C=h.majorTicks.length,T=Ft.pixelRatio;u.lineWidth=2*T,w=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(C).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var O=0;O<C;++O)u.save(),u.strokeStyle=w[O],u.rotate(Z.radians(xi(h,h.exactTicks?h.majorTicks[O]:O,C))),u.beginPath(),u.moveTo(0,p),u.lineTo(0,p-.15*u.max),u.stroke(),u.closePath(),u.restore();h.strokeTicks&&(u.save(),u.strokeStyle=h.colorStrokeTicks||w[0],u.rotate(En),u.beginPath(),u.arc(0,0,p,Z.radians(h.startAngle),Z.radians(h.startAngle+h.ticksAngle),!1),u.stroke(),u.closePath(),u.restore())}function xi(u,h,p){if(u.exactTicks){var w=u.ticksAngle/(u.maxValue-u.minValue);return u.startAngle+w*(h-u.minValue)}return u.startAngle+h*(u.ticksAngle/(p-1))}function Sn(u){u.stroke(),u.restore(),u.closePath(),u.save()}function X(u,h){var p=pt(u,h)-.15*u.max,w={},C=0,T=h.majorTicks.length,O=h.animationTarget!=="needle",N=h.colorNumbers instanceof Array?h.colorNumbers:new Array(T).fill(h.colorNumbers),R=O?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(O&&(u.save(),u.rotate(-Z.radians(R))),u.font=Z.font(h,"Numbers",u.max/200),u.lineWidth=0,u.textAlign="center",u.textBaseline="middle";C<T;++C){var W=R+xi(h,h.exactTicks?h.majorTicks[C]:C,T),j=u.measureText(h.majorTicks[C]).width,q=h.fontNumbersSize,J=Math.sqrt(j*j+q*q)/2,le=Z.radialPoint(p-J-h.numbersMargin/100*u.max,Z.radians(W));W===360&&(W=0),w[W]||(w[W]=!0,u.fillStyle=N[C],u.fillText(h.majorTicks[C],le.x,le.y))}O&&u.restore()}function ie(u,h){h.title&&(u.save(),u.font=Z.font(h,"Title",u.max/200),u.fillStyle=h.colorTitle,u.textAlign="center",u.fillText(h.title,0,-u.max/4.25,.8*u.max),u.restore())}function ae(u,h){h.units&&(u.save(),u.font=Z.font(h,"Units",u.max/200),u.fillStyle=h.colorUnits,u.textAlign="center",u.fillText(Z.formatContext(h,h.units),0,u.max/3.25,.8*u.max),u.restore())}function Me(u,h){if(h.needle){var p=h.animationTarget!=="needle",w=h.ticksAngle<360?Z.normalizedValue(h).indented:h.value,C=p?h.startAngle:h.startAngle+(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(C=h.startAngle+h.ticksAngle-(w-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var T=he(u,h),O=Ot(T/100*h.needleCircleSize),N=Ot(T/100*h.needleCircleSize*.75),R=Ot(T/100*h.needleEnd),W=Ot(h.needleStart?T/100*h.needleStart:0),j=T/100*h.needleWidth,q=T/100*h.needleWidth/2,J=Ft.pixelRatio;u.save(),Z.drawNeedleShadow(u,h),u.rotate(Z.radians(C)),u.fillStyle=Z.linearGradient(u,h.colorNeedle,h.colorNeedleEnd,R-W),h.needleType==="arrow"?(u.beginPath(),u.moveTo(-q,-W),u.lineTo(-j,0),u.lineTo(-1*J,R),u.lineTo(J,R),u.lineTo(j,0),u.lineTo(q,-W),u.closePath(),u.fill(),u.beginPath(),u.lineTo(-.5*J,R),u.lineTo(-1*J,R),u.lineTo(-j,0),u.lineTo(-q,-W),u.lineTo(q/2*J-2*J,-W),u.closePath(),u.fillStyle=h.colorNeedleShadowUp,u.fill()):(u.beginPath(),u.moveTo(-q,R),u.lineTo(-q,W),u.lineTo(q,W),u.lineTo(q,R),u.closePath(),u.fill()),u.restore(),h.needleCircleSize&&(u.save(),Z.drawNeedleShadow(u,h),h.needleCircleOuter&&(u.beginPath(),u.arc(0,0,O,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,O),u.fill(),u.closePath()),h.needleCircleInner&&(u.beginPath(),u.arc(0,0,N,0,2*nn,!0),u.fillStyle=Z.linearGradient(u,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,N),u.fill(),u.closePath()),u.restore())}}function nt(u,h,p){Z.drawValueBox(u,h,p,0,u.max-.33*u.max,u.max)}function gt(u){var h=u.startAngle,p=u.startAngle+u.ticksAngle,w=h,C=h+(Z.normalizedValue(u).normal-u.minValue)/(u.maxValue-u.minValue)*u.ticksAngle;if(u.bar