@mxtommy/kip 4.0.6 → 4.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/package.json +2 -2
- package/public/{chunk-2HRNITBM.js → chunk-35577QTX.js} +1 -1
- package/public/{chunk-TPA3GIE5.js → chunk-4NJ3ZL5U.js} +1 -1
- package/public/chunk-BISZS3TE.js +3 -0
- package/public/{chunk-S7WGIMJE.js → chunk-DADLXEYG.js} +1 -1
- package/public/{chunk-GOOQYX3Z.js → chunk-JCVEDDSQ.js} +1 -1
- package/public/{chunk-7YFDJLS5.js → chunk-KZW5Z46K.js} +1 -1
- package/public/chunk-ROD2YZ6L.js +52 -0
- package/public/index.html +1 -1
- package/public/{main-UKCGZIC7.js → main-NJAW6UFC.js} +4 -4
- package/public/chunk-2E2KZ6D5.js +0 -3
- package/public/chunk-LOZEULT5.js +0 -52
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as k,b as ne,c as Bi,d as pn,e as Ee,f as Et,g as Ye,h as cr}from"./chunk-2E2KZ6D5.js";import{a as Ti,b as Nt,e as er,g as tr,i as nr,j as xt,l as ir,m as rr,n as Ot}from"./chunk-LOZEULT5.js";import"./chunk-F5X5MWHG.js";import"./chunk-QVCMARCU.js";import{a as pr,b as hr,c as _r,d as gr,e as yr,f as vr}from"./chunk-52M2PJJL.js";import{a as ur}from"./chunk-IJ22WXFB.js";import{c as or,f as ar,g as sr,h as lr}from"./chunk-RYHOAWDD.js";import{b as br,g as Sr}from"./chunk-BMDGKBYM.js";import{a as dr,b as fr,c as mr}from"./chunk-AB255PKD.js";import{c as Ji}from"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as Re,b as Ct}from"./chunk-S7WGIMJE.js";import{a as Zi}from"./chunk-OQULS6SV.js";import{a as ke,b as Le,c as Be,d as Ve,j as Xi,x as Yi}from"./chunk-QLTN6G6E.js";import{a as mn,b as ki,c as Ci,e as We,h as De,i as wt,k as ge,l as At,m as de}from"./chunk-XDPHEQEO.js";import{a as Ze,b as $i,c as Ui,f as _n,j as ji,k as Pt,n as Qi,o as Gi,p as Wi,s as gn}from"./chunk-SZ2GUIT5.js";import{Ab as sn,Bb as ln,Db as yt,Eb as vt,F as dt,Fa as x,Fb as yi,Fc as Ei,Ga as fi,Gd as Fe,Ha as mi,Hb as bt,Hd as ve,Jc as Mi,Kb as M,Kc as Pi,Lb as je,Lc as Ni,Ld as Mt,Ma as pi,Mb as Qe,Nc as Xe,Nd as hn,O as ri,Oa as J,Oc as te,Pb as cn,Pc as xi,Qa as pt,Qb as un,Qc as Oi,Rb as dn,Rc as Ii,Sa as hi,Tc as Tt,Ua as _i,V as oi,Vc as Di,Vd as Hi,Wc as ye,X as ai,Xa as ht,Xd as Ke,Ya as on,Yc as Ri,Yd as qi,Zc as Fi,_a as gi,_b as vi,_c as Li,_d as pe,a as X,aa as N,ab as _t,ac as bi,b as Jn,bb as $,c as ei,ca as H,cb as U,d as Vo,db as gt,dc as Si,e as ti,ea as nn,ec as Ge,f as tn,fa as ft,fb as Oe,fd as Vi,ga as y,gb as Ie,ha as si,hb as ue,ib as b,j as Ae,ja as I,jb as T,jc as wi,ka as D,kb as ee,kc as St,l as ut,mc as fn,na as Te,nc as Ai,oa as mt,pa as li,pd as kt,q as ni,ra as ci,rb as K,tb as F,ud as Ki,va as ui,vb as L,w as xe,wa as di,wd as zi,x as ii,za as rn,zb as an}from"./chunk-OB3QLUH6.js";var vn=Vo(It=>{(function(){"use strict";var o=function(){this.init()};o.prototype={init:function(){var i=this||t;return i._counter=1e3,i._html5AudioPool=[],i.html5PoolSize=10,i._codecs={},i._howls=[],i._muted=!1,i._volume=1,i._canPlayEvent="canplaythrough",i._navigator=typeof window<"u"&&window.navigator?window.navigator:null,i.masterGain=null,i.noAudio=!1,i.usingWebAudio=!0,i.autoSuspend=!0,i.ctx=null,i.autoUnlock=!0,i._setup(),i},volume:function(i){var a=this||t;if(i=parseFloat(i),a.ctx||_(),typeof i<"u"&&i>=0&&i<=1){if(a._volume=i,a._muted)return a;a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.volume=h._volume*i)}return a}return a._volume},mute:function(i){var a=this||t;a.ctx||_(),a._muted=i,a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i?0:a._volume,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.muted=i?!0:h._muted)}return a},stop:function(){for(var i=this||t,a=0;a<i._howls.length;a++)i._howls[a].stop();return i},unload:function(){for(var i=this||t,a=i._howls.length-1;a>=0;a--)i._howls[a].unload();return i.usingWebAudio&&i.ctx&&typeof i.ctx.close<"u"&&(i.ctx.close(),i.ctx=null,_()),i},codecs:function(i){return(this||t)._codecs[i.replace(/^x-/,"")]},_setup:function(){var i=this||t;if(i.state=i.ctx&&i.ctx.state||"suspended",i._autoSuspend(),!i.usingWebAudio)if(typeof Audio<"u")try{var a=new Audio;typeof a.oncanplaythrough>"u"&&(i._canPlayEvent="canplay")}catch{i.noAudio=!0}else i.noAudio=!0;try{var a=new Audio;a.muted&&(i.noAudio=!0)}catch{}return i.noAudio||i._setupCodecs(),i},_setupCodecs:function(){var i=this||t,a=null;try{a=typeof Audio<"u"?new Audio:null}catch{return i}if(!a||typeof a.canPlayType!="function")return i;var c=a.canPlayType("audio/mpeg;").replace(/^no$/,""),f=i._navigator?i._navigator.userAgent:"",m=f.match(/OPR\/(\d+)/g),h=m&&parseInt(m[0].split("/")[1],10)<33,p=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,g=f.match(/Version\/(.*?) /),w=p&&g&&parseInt(g[1],10)<15;return i._codecs={mp3:!!(!h&&(c||a.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!c,opus:!!a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(a.canPlayType('audio/wav; codecs="1"')||a.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!a.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!a.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(a.canPlayType("audio/x-m4b;")||a.canPlayType("audio/m4b;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(a.canPlayType("audio/x-mp4;")||a.canPlayType("audio/mp4;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!a.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(a.canPlayType("audio/x-flac;")||a.canPlayType("audio/flac;")).replace(/^no$/,"")},i},_unlockAudio:function(){var i=this||t;if(!(i._audioUnlocked||!i.ctx)){i._audioUnlocked=!1,i.autoUnlock=!1,!i._mobileUnloaded&&i.ctx.sampleRate!==44100&&(i._mobileUnloaded=!0,i.unload()),i._scratchBuffer=i.ctx.createBuffer(1,1,22050);var a=function(c){for(;i._html5AudioPool.length<i.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,i._releaseHtml5Audio(f)}catch{i.noAudio=!0;break}for(var m=0;m<i._howls.length;m++)if(!i._howls[m]._webAudio)for(var h=i._howls[m]._getSoundIds(),p=0;p<h.length;p++){var g=i._howls[m]._soundById(h[p]);g&&g._node&&!g._node._unlocked&&(g._node._unlocked=!0,g._node.load())}i._autoResume();var w=i.ctx.createBufferSource();w.buffer=i._scratchBuffer,w.connect(i.ctx.destination),typeof w.start>"u"?w.noteOn(0):w.start(0),typeof i.ctx.resume=="function"&&i.ctx.resume(),w.onended=function(){w.disconnect(0),i._audioUnlocked=!0,document.removeEventListener("touchstart",a,!0),document.removeEventListener("touchend",a,!0),document.removeEventListener("click",a,!0),document.removeEventListener("keydown",a,!0);for(var C=0;C<i._howls.length;C++)i._howls[C]._emit("unlock")}};return document.addEventListener("touchstart",a,!0),document.addEventListener("touchend",a,!0),document.addEventListener("click",a,!0),document.addEventListener("keydown",a,!0),i}},_obtainHtml5Audio:function(){var i=this||t;if(i._html5AudioPool.length)return i._html5AudioPool.pop();var a=new Audio().play();return a&&typeof Promise<"u"&&(a instanceof Promise||typeof a.then=="function")&&a.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(i){var a=this||t;return i._unlocked&&a._html5AudioPool.push(i),a},_autoSuspend:function(){var i=this;if(!(!i.autoSuspend||!i.ctx||typeof i.ctx.suspend>"u"||!t.usingWebAudio)){for(var a=0;a<i._howls.length;a++)if(i._howls[a]._webAudio){for(var c=0;c<i._howls[a]._sounds.length;c++)if(!i._howls[a]._sounds[c]._paused)return i}return i._suspendTimer&&clearTimeout(i._suspendTimer),i._suspendTimer=setTimeout(function(){if(i.autoSuspend){i._suspendTimer=null,i.state="suspending";var f=function(){i.state="suspended",i._resumeAfterSuspend&&(delete i._resumeAfterSuspend,i._autoResume())};i.ctx.suspend().then(f,f)}},3e4),i}},_autoResume:function(){var i=this;if(!(!i.ctx||typeof i.ctx.resume>"u"||!t.usingWebAudio))return i.state==="running"&&i.ctx.state!=="interrupted"&&i._suspendTimer?(clearTimeout(i._suspendTimer),i._suspendTimer=null):i.state==="suspended"||i.state==="running"&&i.ctx.state==="interrupted"?(i.ctx.resume().then(function(){i.state="running";for(var a=0;a<i._howls.length;a++)i._howls[a]._emit("resume")}),i._suspendTimer&&(clearTimeout(i._suspendTimer),i._suspendTimer=null)):i.state==="suspending"&&(i._resumeAfterSuspend=!0),i}};var t=new o,e=function(i){var a=this;if(!i.src||i.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}a.init(i)};e.prototype={init:function(i){var a=this;return t.ctx||_(),a._autoplay=i.autoplay||!1,a._format=typeof i.format!="string"?i.format:[i.format],a._html5=i.html5||!1,a._muted=i.mute||!1,a._loop=i.loop||!1,a._pool=i.pool||5,a._preload=typeof i.preload=="boolean"||i.preload==="metadata"?i.preload:!0,a._rate=i.rate||1,a._sprite=i.sprite||{},a._src=typeof i.src!="string"?i.src:[i.src],a._volume=i.volume!==void 0?i.volume:1,a._xhr={method:i.xhr&&i.xhr.method?i.xhr.method:"GET",headers:i.xhr&&i.xhr.headers?i.xhr.headers:null,withCredentials:i.xhr&&i.xhr.withCredentials?i.xhr.withCredentials:!1},a._duration=0,a._state="unloaded",a._sounds=[],a._endTimers={},a._queue=[],a._playLock=!1,a._onend=i.onend?[{fn:i.onend}]:[],a._onfade=i.onfade?[{fn:i.onfade}]:[],a._onload=i.onload?[{fn:i.onload}]:[],a._onloaderror=i.onloaderror?[{fn:i.onloaderror}]:[],a._onplayerror=i.onplayerror?[{fn:i.onplayerror}]:[],a._onpause=i.onpause?[{fn:i.onpause}]:[],a._onplay=i.onplay?[{fn:i.onplay}]:[],a._onstop=i.onstop?[{fn:i.onstop}]:[],a._onmute=i.onmute?[{fn:i.onmute}]:[],a._onvolume=i.onvolume?[{fn:i.onvolume}]:[],a._onrate=i.onrate?[{fn:i.onrate}]:[],a._onseek=i.onseek?[{fn:i.onseek}]:[],a._onunlock=i.onunlock?[{fn:i.onunlock}]:[],a._onresume=[],a._webAudio=t.usingWebAudio&&!a._html5,typeof t.ctx<"u"&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(a),a._autoplay&&a._queue.push({event:"play",action:function(){a.play()}}),a._preload&&a._preload!=="none"&&a.load(),a},load:function(){var i=this,a=null;if(t.noAudio){i._emit("loaderror",null,"No audio support.");return}typeof i._src=="string"&&(i._src=[i._src]);for(var c=0;c<i._src.length;c++){var f,m;if(i._format&&i._format[c])f=i._format[c];else{if(m=i._src[c],typeof m!="string"){i._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(m),f||(f=/\.([^.]+)$/.exec(m.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&&t.codecs(f)){a=i._src[c];break}}if(!a){i._emit("loaderror",null,"No codec support for selected audio sources.");return}return i._src=a,i._state="loading",window.location.protocol==="https:"&&a.slice(0,5)==="http:"&&(i._html5=!0,i._webAudio=!1),new n(i),i._webAudio&&s(i),i},play:function(i,a){var c=this,f=null;if(typeof i=="number")f=i,i=null;else{if(typeof i=="string"&&c._state==="loaded"&&!c._sprite[i])return null;if(typeof i>"u"&&(i="__default",!c._playLock)){for(var m=0,h=0;h<c._sounds.length;h++)c._sounds[h]._paused&&!c._sounds[h]._ended&&(m++,f=c._sounds[h]._id);m===1?i=null:f=null}}var p=f?c._soundById(f):c._inactiveSound();if(!p)return null;if(f&&!i&&(i=p._sprite||"__default"),c._state!=="loaded"){p._sprite=i,p._ended=!1;var g=p._id;return c._queue.push({event:"play",action:function(){c.play(g)}}),g}if(f&&!p._paused)return a||c._loadQueue("play"),p._id;c._webAudio&&t._autoResume();var w=Math.max(0,p._seek>0?p._seek:c._sprite[i][0]/1e3),C=Math.max(0,(c._sprite[i][0]+c._sprite[i][1])/1e3-w),O=C*1e3/Math.abs(p._rate),G=c._sprite[i][0]/1e3,q=(c._sprite[i][0]+c._sprite[i][1])/1e3;p._sprite=i,p._ended=!1;var B=function(){p._paused=!1,p._seek=w,p._start=G,p._stop=q,p._loop=!!(p._loop||c._sprite[i][2])};if(w>=q){c._ended(p);return}var E=p._node;if(c._webAudio){var ae=function(){c._playLock=!1,B(),c._refreshBuffer(p);var le=p._muted||c._muted?0:p._volume;E.gain.setValueAtTime(le,t.ctx.currentTime),p._playStart=t.ctx.currentTime,typeof E.bufferSource.start>"u"?p._loop?E.bufferSource.noteGrainOn(0,w,86400):E.bufferSource.noteGrainOn(0,w,C):p._loop?E.bufferSource.start(0,w,86400):E.bufferSource.start(0,w,C),O!==1/0&&(c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O)),a||setTimeout(function(){c._emit("play",p._id),c._loadQueue()},0)};t.state==="running"&&t.ctx.state!=="interrupted"?ae():(c._playLock=!0,c.once("resume",ae),c._clearTimer(p._id))}else{var me=function(){E.currentTime=w,E.muted=p._muted||c._muted||t._muted||E.muted,E.volume=p._volume*t.volume(),E.playbackRate=p._rate;try{var le=E.play();if(le&&typeof Promise<"u"&&(le instanceof Promise||typeof le.then=="function")?(c._playLock=!0,B(),le.then(function(){c._playLock=!1,E._unlocked=!0,a?c._loadQueue():c._emit("play",p._id)}).catch(function(){c._playLock=!1,c._emit("playerror",p._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."),p._ended=!0,p._paused=!0})):a||(c._playLock=!1,B(),c._emit("play",p._id)),E.playbackRate=p._rate,E.paused){c._emit("playerror",p._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}i!=="__default"||p._loop?c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O):(c._endTimers[p._id]=function(){c._ended(p),E.removeEventListener("ended",c._endTimers[p._id],!1)},E.addEventListener("ended",c._endTimers[p._id],!1))}catch(lt){c._emit("playerror",p._id,lt)}};E.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(E.src=c._src,E.load());var st=window&&window.ejecta||!E.readyState&&t._navigator.isCocoonJS;if(E.readyState>=3||st)me();else{c._playLock=!0,c._state="loading";var se=function(){c._state="loaded",me(),E.removeEventListener(t._canPlayEvent,se,!1)};E.addEventListener(t._canPlayEvent,se,!1),c._clearTimer(p._id)}}return p._id},pause:function(i){var a=this;if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"pause",action:function(){a.pause(i)}}),a;for(var c=a._getSoundIds(i),f=0;f<c.length;f++){a._clearTimer(c[f]);var m=a._soundById(c[f]);if(m&&!m._paused&&(m._seek=a.seek(c[f]),m._rateSeek=0,m._paused=!0,a._stopFade(c[f]),m._node))if(a._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),a._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||a._emit("pause",m?m._id:null)}return a},stop:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"stop",action:function(){c.stop(i)}}),c;for(var f=c._getSoundIds(i),m=0;m<f.length;m++){c._clearTimer(f[m]);var h=c._soundById(f[m]);h&&(h._seek=h._start||0,h._rateSeek=0,h._paused=!0,h._ended=!0,c._stopFade(f[m]),h._node&&(c._webAudio?h._node.bufferSource&&(typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),c._cleanBuffer(h._node)):(!isNaN(h._node.duration)||h._node.duration===1/0)&&(h._node.currentTime=h._start||0,h._node.pause(),h._node.duration===1/0&&c._clearSound(h._node))),a||c._emit("stop",h._id))}return c},mute:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"mute",action:function(){c.mute(i,a)}}),c;if(typeof a>"u")if(typeof i=="boolean")c._muted=i;else return c._muted;for(var f=c._getSoundIds(a),m=0;m<f.length;m++){var h=c._soundById(f[m]);h&&(h._muted=i,h._interval&&c._stopFade(h._id),c._webAudio&&h._node?h._node.gain.setValueAtTime(i?0:h._volume,t.ctx.currentTime):h._node&&(h._node.muted=t._muted?!0:i),c._emit("mute",h._id))}return c},volume:function(){var i=this,a=arguments,c,f;if(a.length===0)return i._volume;if(a.length===1||a.length===2&&typeof a[1]>"u"){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length>=2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c<"u"&&c>=0&&c<=1){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,a)}}),i;typeof f>"u"&&(i._volume=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)p=i._soundById(f[g]),p&&(p._volume=c,a[2]||i._stopFade(f[g]),i._webAudio&&p._node&&!p._muted?p._node.gain.setValueAtTime(c,t.ctx.currentTime):p._node&&!p._muted&&(p._node.volume=c*t.volume()),i._emit("volume",p._id))}else return p=f?i._soundById(f):i._sounds[0],p?p._volume:0;return i},fade:function(i,a,c,f){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(i,a,c,f)}}),m;i=Math.min(Math.max(0,parseFloat(i)),1),a=Math.min(Math.max(0,parseFloat(a)),1),c=parseFloat(c),m.volume(i,f);for(var h=m._getSoundIds(f),p=0;p<h.length;p++){var g=m._soundById(h[p]);if(g){if(f||m._stopFade(h[p]),m._webAudio&&!g._muted){var w=t.ctx.currentTime,C=w+c/1e3;g._volume=i,g._node.gain.setValueAtTime(i,w),g._node.gain.linearRampToValueAtTime(a,C)}m._startFadeInterval(g,i,a,c,h[p],typeof f>"u")}}return m},_startFadeInterval:function(i,a,c,f,m,h){var p=this,g=a,w=c-a,C=Math.abs(w/.01),O=Math.max(4,C>0?f/C:f),G=Date.now();i._fadeTo=c,i._interval=setInterval(function(){var q=(Date.now()-G)/f;G=Date.now(),g+=w*q,g=Math.round(g*100)/100,w<0?g=Math.max(c,g):g=Math.min(c,g),p._webAudio?i._volume=g:p.volume(g,i._id,!0),h&&(p._volume=g),(c<a&&g<=c||c>a&&g>=c)&&(clearInterval(i._interval),i._interval=null,i._fadeTo=null,p.volume(c,i._id),p._emit("fade",i._id))},O)},_stopFade:function(i){var a=this,c=a._soundById(i);return c&&c._interval&&(a._webAudio&&c._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(c._interval),c._interval=null,a.volume(c._fadeTo,i),c._fadeTo=null,a._emit("fade",i)),a},loop:function(){var i=this,a=arguments,c,f,m;if(a.length===0)return i._loop;if(a.length===1)if(typeof a[0]=="boolean")c=a[0],i._loop=c;else return m=i._soundById(parseInt(a[0],10)),m?m._loop:!1;else a.length===2&&(c=a[0],f=parseInt(a[1],10));for(var h=i._getSoundIds(f),p=0;p<h.length;p++)m=i._soundById(h[p]),m&&(m._loop=c,i._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=c,c&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,i.playing(h[p])&&(i.pause(h[p],!0),i.play(h[p],!0)))));return i},rate:function(){var i=this,a=arguments,c,f;if(a.length===0)f=i._sounds[0]._id;else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c=="number"){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,a)}}),i;typeof f>"u"&&(i._rate=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)if(p=i._soundById(f[g]),p){i.playing(f[g])&&(p._rateSeek=i.seek(f[g]),p._playStart=i._webAudio?t.ctx.currentTime:p._playStart),p._rate=c,i._webAudio&&p._node&&p._node.bufferSource?p._node.bufferSource.playbackRate.setValueAtTime(c,t.ctx.currentTime):p._node&&(p._node.playbackRate=c);var w=i.seek(f[g]),C=(i._sprite[p._sprite][0]+i._sprite[p._sprite][1])/1e3-w,O=C*1e3/Math.abs(p._rate);(i._endTimers[f[g]]||!p._paused)&&(i._clearTimer(f[g]),i._endTimers[f[g]]=setTimeout(i._ended.bind(i,p),O)),i._emit("rate",p._id)}}else return p=i._soundById(f),p?p._rate:i._rate;return i},seek:function(){var i=this,a=arguments,c,f;if(a.length===0)i._sounds.length&&(f=i._sounds[0]._id);else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):i._sounds.length&&(f=i._sounds[0]._id,c=parseFloat(a[0]))}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));if(typeof f>"u")return 0;if(typeof c=="number"&&(i._state!=="loaded"||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,a)}}),i;var p=i._soundById(f);if(p)if(typeof c=="number"&&c>=0){var g=i.playing(f);g&&i.pause(f,!0),p._seek=c,p._ended=!1,i._clearTimer(f),!i._webAudio&&p._node&&!isNaN(p._node.duration)&&(p._node.currentTime=c);var w=function(){g&&i.play(f,!0),i._emit("seek",f)};if(g&&!i._webAudio){var C=function(){i._playLock?setTimeout(C,0):w()};setTimeout(C,0)}else w()}else if(i._webAudio){var O=i.playing(f)?t.ctx.currentTime-p._playStart:0,G=p._rateSeek?p._rateSeek-p._seek:0;return p._seek+(G+O*Math.abs(p._rate))}else return p._node.currentTime;return i},playing:function(i){var a=this;if(typeof i=="number"){var c=a._soundById(i);return c?!c._paused:!1}for(var f=0;f<a._sounds.length;f++)if(!a._sounds[f]._paused)return!0;return!1},duration:function(i){var a=this,c=a._duration,f=a._soundById(i);return f&&(c=a._sprite[f._sprite][1]/1e3),c},state:function(){return this._state},unload:function(){for(var i=this,a=i._sounds,c=0;c<a.length;c++)a[c]._paused||i.stop(a[c]._id),i._webAudio||(i._clearSound(a[c]._node),a[c]._node.removeEventListener("error",a[c]._errorFn,!1),a[c]._node.removeEventListener(t._canPlayEvent,a[c]._loadFn,!1),a[c]._node.removeEventListener("ended",a[c]._endFn,!1),t._releaseHtml5Audio(a[c]._node)),delete a[c]._node,i._clearTimer(a[c]._id);var f=t._howls.indexOf(i);f>=0&&t._howls.splice(f,1);var m=!0;for(c=0;c<t._howls.length;c++)if(t._howls[c]._src===i._src||i._src.indexOf(t._howls[c]._src)>=0){m=!1;break}return r&&m&&delete r[i._src],t.noAudio=!1,i._state="unloaded",i._sounds=[],i=null,null},on:function(i,a,c,f){var m=this,h=m["_on"+i];return typeof a=="function"&&h.push(f?{id:c,fn:a,once:f}:{id:c,fn:a}),m},off:function(i,a,c){var f=this,m=f["_on"+i],h=0;if(typeof a=="number"&&(c=a,a=null),a||c)for(h=0;h<m.length;h++){var p=c===m[h].id;if(a===m[h].fn&&p||!a&&p){m.splice(h,1);break}}else if(i)f["_on"+i]=[];else{var g=Object.keys(f);for(h=0;h<g.length;h++)g[h].indexOf("_on")===0&&Array.isArray(f[g[h]])&&(f[g[h]]=[])}return f},once:function(i,a,c){var f=this;return f.on(i,a,c,1),f},_emit:function(i,a,c){for(var f=this,m=f["_on"+i],h=m.length-1;h>=0;h--)(!m[h].id||m[h].id===a||i==="load")&&(setTimeout((function(p){p.call(this,a,c)}).bind(f,m[h].fn),0),m[h].once&&f.off(i,m[h].fn,m[h].id));return f._loadQueue(i),f},_loadQueue:function(i){var a=this;if(a._queue.length>0){var c=a._queue[0];c.event===i&&(a._queue.shift(),a._loadQueue()),i||c.action()}return a},_ended:function(i){var a=this,c=i._sprite;if(!a._webAudio&&i._node&&!i._node.paused&&!i._node.ended&&i._node.currentTime<i._stop)return setTimeout(a._ended.bind(a,i),100),a;var f=!!(i._loop||a._sprite[c][2]);if(a._emit("end",i._id),!a._webAudio&&f&&a.stop(i._id,!0).play(i._id),a._webAudio&&f){a._emit("play",i._id),i._seek=i._start||0,i._rateSeek=0,i._playStart=t.ctx.currentTime;var m=(i._stop-i._start)*1e3/Math.abs(i._rate);a._endTimers[i._id]=setTimeout(a._ended.bind(a,i),m)}return a._webAudio&&!f&&(i._paused=!0,i._ended=!0,i._seek=i._start||0,i._rateSeek=0,a._clearTimer(i._id),a._cleanBuffer(i._node),t._autoSuspend()),!a._webAudio&&!f&&a.stop(i._id,!0),a},_clearTimer:function(i){var a=this;if(a._endTimers[i]){if(typeof a._endTimers[i]!="function")clearTimeout(a._endTimers[i]);else{var c=a._soundById(i);c&&c._node&&c._node.removeEventListener("ended",a._endTimers[i],!1)}delete a._endTimers[i]}return a},_soundById:function(i){for(var a=this,c=0;c<a._sounds.length;c++)if(i===a._sounds[c]._id)return a._sounds[c];return null},_inactiveSound:function(){var i=this;i._drain();for(var a=0;a<i._sounds.length;a++)if(i._sounds[a]._ended)return i._sounds[a].reset();return new n(i)},_drain:function(){var i=this,a=i._pool,c=0,f=0;if(!(i._sounds.length<a)){for(f=0;f<i._sounds.length;f++)i._sounds[f]._ended&&c++;for(f=i._sounds.length-1;f>=0;f--){if(c<=a)return;i._sounds[f]._ended&&(i._webAudio&&i._sounds[f]._node&&i._sounds[f]._node.disconnect(0),i._sounds.splice(f,1),c--)}}},_getSoundIds:function(i){var a=this;if(typeof i>"u"){for(var c=[],f=0;f<a._sounds.length;f++)c.push(a._sounds[f]._id);return c}else return[i]},_refreshBuffer:function(i){var a=this;return i._node.bufferSource=t.ctx.createBufferSource(),i._node.bufferSource.buffer=r[a._src],i._panner?i._node.bufferSource.connect(i._panner):i._node.bufferSource.connect(i._node),i._node.bufferSource.loop=i._loop,i._loop&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop||0),i._node.bufferSource.playbackRate.setValueAtTime(i._rate,t.ctx.currentTime),a},_cleanBuffer:function(i){var a=this,c=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!i.bufferSource)return a;if(t._scratchBuffer&&i.bufferSource&&(i.bufferSource.onended=null,i.bufferSource.disconnect(0),c))try{i.bufferSource.buffer=t._scratchBuffer}catch{}return i.bufferSource=null,a},_clearSound:function(i){var a=/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent);a||(i.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(i){this._parent=i,this.init()};n.prototype={init:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,a._sounds.push(i),i.create(),i},create:function(){var i=this,a=i._parent,c=t._muted||i._muted||i._parent._muted?0:i._volume;return a._webAudio?(i._node=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),i._node.gain.setValueAtTime(c,t.ctx.currentTime),i._node.paused=!0,i._node.connect(t.masterGain)):t.noAudio||(i._node=t._obtainHtml5Audio(),i._errorFn=i._errorListener.bind(i),i._node.addEventListener("error",i._errorFn,!1),i._loadFn=i._loadListener.bind(i),i._node.addEventListener(t._canPlayEvent,i._loadFn,!1),i._endFn=i._endListener.bind(i),i._node.addEventListener("ended",i._endFn,!1),i._node.src=a._src,i._node.preload=a._preload===!0?"auto":a._preload,i._node.volume=c*t.volume(),i._node.load()),i},reset:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._rateSeek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,i},_errorListener:function(){var i=this;i._parent._emit("loaderror",i._id,i._node.error?i._node.error.code:0),i._node.removeEventListener("error",i._errorFn,!1)},_loadListener:function(){var i=this,a=i._parent;a._duration=Math.ceil(i._node.duration*10)/10,Object.keys(a._sprite).length===0&&(a._sprite={__default:[0,a._duration*1e3]}),a._state!=="loaded"&&(a._state="loaded",a._emit("load"),a._loadQueue()),i._node.removeEventListener(t._canPlayEvent,i._loadFn,!1)},_endListener:function(){var i=this,a=i._parent;a._duration===1/0&&(a._duration=Math.ceil(i._node.duration*10)/10,a._sprite.__default[1]===1/0&&(a._sprite.__default[1]=a._duration*1e3),a._ended(i)),i._node.removeEventListener("ended",i._endFn,!1)}};var r={},s=function(i){var a=i._src;if(r[a]){i._duration=r[a].duration,d(i);return}if(/^data:[^;]+;base64,/.test(a)){for(var c=atob(a.split(",")[1]),f=new Uint8Array(c.length),m=0;m<c.length;++m)f[m]=c.charCodeAt(m);u(f.buffer,i)}else{var h=new XMLHttpRequest;h.open(i._xhr.method,a,!0),h.withCredentials=i._xhr.withCredentials,h.responseType="arraybuffer",i._xhr.headers&&Object.keys(i._xhr.headers).forEach(function(p){h.setRequestHeader(p,i._xhr.headers[p])}),h.onload=function(){var p=(h.status+"")[0];if(p!=="0"&&p!=="2"&&p!=="3"){i._emit("loaderror",null,"Failed loading audio file with status: "+h.status+".");return}u(h.response,i)},h.onerror=function(){i._webAudio&&(i._html5=!0,i._webAudio=!1,i._sounds=[],delete r[a],i.load())},l(h)}},l=function(i){try{i.send()}catch{i.onerror()}},u=function(i,a){var c=function(){a._emit("loaderror",null,"Decoding audio data failed.")},f=function(m){m&&a._sounds.length>0?(r[a._src]=m,d(a,m)):c()};typeof Promise<"u"&&t.ctx.decodeAudioData.length===1?t.ctx.decodeAudioData(i).then(f).catch(c):t.ctx.decodeAudioData(i,f,c)},d=function(i,a){a&&!i._duration&&(i._duration=a.duration),Object.keys(i._sprite).length===0&&(i._sprite={__default:[0,i._duration*1e3]}),i._state!=="loaded"&&(i._state="loaded",i._emit("load"),i._loadQueue())},_=function(){if(t.usingWebAudio){try{typeof AudioContext<"u"?t.ctx=new AudioContext:typeof webkitAudioContext<"u"?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch{t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var i=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),a=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),c=a?parseInt(a[1],10):null;if(i&&c&&c<9){var f=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!f&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:t,Howl:e}}),typeof It<"u"&&(It.Howler=t,It.Howl=e),typeof global<"u"?(global.HowlerGlobal=o,global.Howler=t,global.Howl=e,global.Sound=n):typeof window<"u"&&(window.HowlerGlobal=o,window.Howler=t,window.Howl=e,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(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(e=typeof e!="number"?r._pos[1]:e,n=typeof n!="number"?r._pos[2]:n,typeof t=="number")r._pos=[t,e,n],typeof r.ctx.listener.positionX<"u"?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]);else return r._pos;return r},HowlerGlobal.prototype.orientation=function(t,e,n,r,s,l){var u=this;if(!u.ctx||!u.ctx.listener)return u;var d=u._orientation;if(e=typeof e!="number"?d[1]:e,n=typeof n!="number"?d[2]:n,r=typeof r!="number"?d[3]:r,s=typeof s!="number"?d[4]:s,l=typeof l!="number"?d[5]:l,typeof t=="number")u._orientation=[t,e,n,r,s,l],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(t,e,n,r,s,l);else return d;return u},Howl.prototype.init=(function(t){return function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._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},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,e){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(t,e)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof t=="number")n._stereo=t,n._pos=[t,0,0];else return n._stereo;for(var s=n._getSoundIds(e),l=0;l<s.length;l++){var u=n._soundById(s[l]);if(u)if(typeof t=="number")u._stereo=t,u._pos=[t,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&o(u,r),r==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(t,0,0):u._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"pos",action:function(){s.pos(t,e,n,r)}}),s;if(e=typeof e!="number"?0:e,n=typeof n!="number"?-.5:n,typeof r>"u")if(typeof t=="number")s._pos=[t,e,n];else return s._pos;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._pos=[t,e,n],d._node&&((!d._panner||d._panner.pan)&&o(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setPosition(t,e,n)),s._emit("pos",d._id);else return d._pos}return s},Howl.prototype.orientation=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"orientation",action:function(){s.orientation(t,e,n,r)}}),s;if(e=typeof e!="number"?s._orientation[1]:e,n=typeof n!="number"?s._orientation[2]:n,typeof r>"u")if(typeof t=="number")s._orientation=[t,e,n];else return s._orientation;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._orientation=[t,e,n],d._node&&(d._panner||(d._pos||(d._pos=s._pos||[0,0,-.5]),o(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setOrientation(t,e,n)),s._emit("orientation",d._id);else return d._orientation}return s},Howl.prototype.pannerAttr=function(){var t=this,e=arguments,n,r,s;if(!t._webAudio)return t;if(e.length===0)return t._pannerAttr;if(e.length===1)if(typeof e[0]=="object")n=e[0],typeof r>"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}),t._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:t._panningModel});else return s=t._soundById(parseInt(e[0],10)),s?s._pannerAttr:t._pannerAttr;else e.length===2&&(n=e[0],r=parseInt(e[1],10));for(var l=t._getSoundIds(r),u=0;u<l.length;u++)if(s=t._soundById(l[u]),s){var d=s._pannerAttr;d={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:d.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:d.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:d.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:d.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:d.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:d.panningModel};var _=s._panner;_||(s._pos||(s._pos=t._pos||[0,0,-.5]),o(s,"spatial"),_=s._panner),_.coneInnerAngle=d.coneInnerAngle,_.coneOuterAngle=d.coneOuterAngle,_.coneOuterGain=d.coneOuterGain,_.distanceModel=d.distanceModel,_.maxDistance=d.maxDistance,_.refDistance=d.refDistance,_.rolloffFactor=d.rolloffFactor,_.panningModel=d.panningModel}return t},Sound.prototype.init=(function(t){return function(){var e=this,n=e._parent;e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,t.call(this),e._stereo?n.stereo(e._stereo):e._pos&&n.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(t){return function(){var e=this,n=e._parent;return e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,e._stereo?n.stereo(e._stereo):e._pos?n.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,n._refreshBuffer(e)),t.call(this)}})(Sound.prototype.reset);var o=function(t,e){e=e||"spatial",e==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()});var yn=(o,t)=>{let e=y(de),n=y(ye),r=e.getSplitShellEnabled(),s="/"+t.map(d=>d.path).join("/"),l=s.startsWith("/chartplotter"),u=s.startsWith("/dashboard");if(r&&u&&!l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["chartplotter",d??""])}if(!r&&l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["dashboard",d??""])}return!0};var wr=[{path:"dashboard/:id",component:cr,canMatch:[yn]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-TPA3GIE5.js").then(o=>o.SplitShellComponent),canMatch:[yn]},{path:"settings",loadComponent:()=>import("./chunk-GOOQYX3Z.js").then(o=>o.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-2HRNITBM.js").then(o=>o.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-NDOR4O4J.js").then(o=>o.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help",loadComponent:()=>import("./chunk-TIWUK3AU.js").then(o=>o.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-2DBQEP6W.js").then(o=>o.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-7YFDJLS5.js").then(o=>o.WidgetLoginComponent),title:"Login"},{path:"**",redirectTo:"dashboard/0"}];var Ar={production:!0};var Ir=ti(vn());function Ho(o,t){if(o&1){let e=K();b(0,"div",1)(1,"button",2),F("click",function(){I(e);let r=L();return D(r.action())}),M(2),T()()}if(o&2){let e=L();x(2),Qe(" ",e.data.action," ")}}var qo=["label"];function $o(o,t){}var Uo=Math.pow(2,31)-1,Je=class{_overlayRef;instance;containerInstance;_afterDismissed=new Ae;_afterOpened=new Ae;_onAction=new Ae;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Uo))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Tr=new nn("MatSnackBarData"),ze=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Qo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Go=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),Wo=(()=>{class o{snackBarRef=y(Je);data=y(Tr);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(n,r){n&1&&(b(0,"div",0),M(1),T(),$(2,Ho,3,1,"div",1)),n&2&&(x(),Qe(" ",r.data.message,`
|
|
1
|
+
import{a as k,b as ne,c as Vi,d as hn,e as Ee,f as Et,g as Ye,h as vn}from"./chunk-BISZS3TE.js";import{a as Ei,b as Nt,e as tr,h as nr,j as ir,k as xt,m as rr,n as or,o as Ot}from"./chunk-ROD2YZ6L.js";import"./chunk-F5X5MWHG.js";import"./chunk-QVCMARCU.js";import{a as pr,b as hr,c as _r,d as gr,e as yr,f as vr}from"./chunk-52M2PJJL.js";import{a as ur}from"./chunk-IJ22WXFB.js";import{c as ar,f as sr,g as lr,h as cr}from"./chunk-RYHOAWDD.js";import{b as br,g as Sr}from"./chunk-BMDGKBYM.js";import{a as dr,b as fr,c as mr}from"./chunk-AB255PKD.js";import{c as er}from"./chunk-PKKBBIJK.js";import"./chunk-HIADZ4BV.js";import{a as Re,b as Ct}from"./chunk-DADLXEYG.js";import{a as Ji}from"./chunk-OQULS6SV.js";import{a as ke,b as Le,c as Be,d as Ve,j as Yi,x as Zi}from"./chunk-QLTN6G6E.js";import{a as pn,b as Ci,c as Mi,e as We,h as De,i as wt,k as ge,l as At,m as de}from"./chunk-XDPHEQEO.js";import{a as Ze,b as Ui,c as ji,f as gn,j as Qi,k as Pt,n as Gi,o as Wi,p as Xi,s as yn}from"./chunk-SZ2GUIT5.js";import{Ab as ln,Bb as cn,Db as yt,Eb as vt,F as dt,Fa as x,Fb as vi,Fc as ki,Ga as mi,Gd as Fe,Ha as pi,Hb as bt,Hd as ve,Jc as Pi,Kb as M,Kc as Ni,Lb as je,Lc as xi,Ld as Mt,Ma as hi,Mb as Qe,Nc as Xe,Nd as _n,O as oi,Oa as J,Oc as te,Pb as un,Pc as Oi,Qa as pt,Qb as dn,Qc as Ii,Rb as fn,Rc as Di,Sa as _i,Tc as Tt,Ua as gi,V as ai,Vc as Ri,Vd as qi,Wc as ye,X as si,Xa as ht,Xd as Ke,Ya as an,Yc as Fi,Yd as $i,Zc as Li,_a as yi,_b as bi,_c as Bi,_d as pe,a as X,aa as N,ab as _t,ac as Si,b as ei,bb as $,c as ti,ca as H,cb as U,d as Vo,db as gt,dc as wi,e as ni,ea as rn,ec as Ge,f as nn,fa as ft,fb as Oe,fd as Ki,ga as y,gb as Ie,ha as li,hb as ue,ib as b,j as Ae,ja as I,jb as T,jc as Ai,ka as D,kb as ee,kc as St,l as ut,mc as mn,na as Te,nc as Ti,oa as mt,pa as ci,pd as kt,q as ii,ra as ui,rb as K,tb as F,ud as zi,va as di,vb as L,w as xe,wa as fi,wd as Hi,x as ri,za as on,zb as sn}from"./chunk-OB3QLUH6.js";var bn=Vo(Dt=>{(function(){"use strict";var o=function(){this.init()};o.prototype={init:function(){var i=this||t;return i._counter=1e3,i._html5AudioPool=[],i.html5PoolSize=10,i._codecs={},i._howls=[],i._muted=!1,i._volume=1,i._canPlayEvent="canplaythrough",i._navigator=typeof window<"u"&&window.navigator?window.navigator:null,i.masterGain=null,i.noAudio=!1,i.usingWebAudio=!0,i.autoSuspend=!0,i.ctx=null,i.autoUnlock=!0,i._setup(),i},volume:function(i){var a=this||t;if(i=parseFloat(i),a.ctx||_(),typeof i<"u"&&i>=0&&i<=1){if(a._volume=i,a._muted)return a;a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.volume=h._volume*i)}return a}return a._volume},mute:function(i){var a=this||t;a.ctx||_(),a._muted=i,a.usingWebAudio&&a.masterGain.gain.setValueAtTime(i?0:a._volume,t.ctx.currentTime);for(var c=0;c<a._howls.length;c++)if(!a._howls[c]._webAudio)for(var f=a._howls[c]._getSoundIds(),m=0;m<f.length;m++){var h=a._howls[c]._soundById(f[m]);h&&h._node&&(h._node.muted=i?!0:h._muted)}return a},stop:function(){for(var i=this||t,a=0;a<i._howls.length;a++)i._howls[a].stop();return i},unload:function(){for(var i=this||t,a=i._howls.length-1;a>=0;a--)i._howls[a].unload();return i.usingWebAudio&&i.ctx&&typeof i.ctx.close<"u"&&(i.ctx.close(),i.ctx=null,_()),i},codecs:function(i){return(this||t)._codecs[i.replace(/^x-/,"")]},_setup:function(){var i=this||t;if(i.state=i.ctx&&i.ctx.state||"suspended",i._autoSuspend(),!i.usingWebAudio)if(typeof Audio<"u")try{var a=new Audio;typeof a.oncanplaythrough>"u"&&(i._canPlayEvent="canplay")}catch{i.noAudio=!0}else i.noAudio=!0;try{var a=new Audio;a.muted&&(i.noAudio=!0)}catch{}return i.noAudio||i._setupCodecs(),i},_setupCodecs:function(){var i=this||t,a=null;try{a=typeof Audio<"u"?new Audio:null}catch{return i}if(!a||typeof a.canPlayType!="function")return i;var c=a.canPlayType("audio/mpeg;").replace(/^no$/,""),f=i._navigator?i._navigator.userAgent:"",m=f.match(/OPR\/(\d+)/g),h=m&&parseInt(m[0].split("/")[1],10)<33,p=f.indexOf("Safari")!==-1&&f.indexOf("Chrome")===-1,g=f.match(/Version\/(.*?) /),w=p&&g&&parseInt(g[1],10)<15;return i._codecs={mp3:!!(!h&&(c||a.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!c,opus:!!a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(a.canPlayType('audio/wav; codecs="1"')||a.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!a.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!a.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(a.canPlayType("audio/x-m4b;")||a.canPlayType("audio/m4b;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(a.canPlayType("audio/x-mp4;")||a.canPlayType("audio/mp4;")||a.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!w&&a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!a.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(a.canPlayType("audio/x-flac;")||a.canPlayType("audio/flac;")).replace(/^no$/,"")},i},_unlockAudio:function(){var i=this||t;if(!(i._audioUnlocked||!i.ctx)){i._audioUnlocked=!1,i.autoUnlock=!1,!i._mobileUnloaded&&i.ctx.sampleRate!==44100&&(i._mobileUnloaded=!0,i.unload()),i._scratchBuffer=i.ctx.createBuffer(1,1,22050);var a=function(c){for(;i._html5AudioPool.length<i.html5PoolSize;)try{var f=new Audio;f._unlocked=!0,i._releaseHtml5Audio(f)}catch{i.noAudio=!0;break}for(var m=0;m<i._howls.length;m++)if(!i._howls[m]._webAudio)for(var h=i._howls[m]._getSoundIds(),p=0;p<h.length;p++){var g=i._howls[m]._soundById(h[p]);g&&g._node&&!g._node._unlocked&&(g._node._unlocked=!0,g._node.load())}i._autoResume();var w=i.ctx.createBufferSource();w.buffer=i._scratchBuffer,w.connect(i.ctx.destination),typeof w.start>"u"?w.noteOn(0):w.start(0),typeof i.ctx.resume=="function"&&i.ctx.resume(),w.onended=function(){w.disconnect(0),i._audioUnlocked=!0,document.removeEventListener("touchstart",a,!0),document.removeEventListener("touchend",a,!0),document.removeEventListener("click",a,!0),document.removeEventListener("keydown",a,!0);for(var C=0;C<i._howls.length;C++)i._howls[C]._emit("unlock")}};return document.addEventListener("touchstart",a,!0),document.addEventListener("touchend",a,!0),document.addEventListener("click",a,!0),document.addEventListener("keydown",a,!0),i}},_obtainHtml5Audio:function(){var i=this||t;if(i._html5AudioPool.length)return i._html5AudioPool.pop();var a=new Audio().play();return a&&typeof Promise<"u"&&(a instanceof Promise||typeof a.then=="function")&&a.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(i){var a=this||t;return i._unlocked&&a._html5AudioPool.push(i),a},_autoSuspend:function(){var i=this;if(!(!i.autoSuspend||!i.ctx||typeof i.ctx.suspend>"u"||!t.usingWebAudio)){for(var a=0;a<i._howls.length;a++)if(i._howls[a]._webAudio){for(var c=0;c<i._howls[a]._sounds.length;c++)if(!i._howls[a]._sounds[c]._paused)return i}return i._suspendTimer&&clearTimeout(i._suspendTimer),i._suspendTimer=setTimeout(function(){if(i.autoSuspend){i._suspendTimer=null,i.state="suspending";var f=function(){i.state="suspended",i._resumeAfterSuspend&&(delete i._resumeAfterSuspend,i._autoResume())};i.ctx.suspend().then(f,f)}},3e4),i}},_autoResume:function(){var i=this;if(!(!i.ctx||typeof i.ctx.resume>"u"||!t.usingWebAudio))return i.state==="running"&&i.ctx.state!=="interrupted"&&i._suspendTimer?(clearTimeout(i._suspendTimer),i._suspendTimer=null):i.state==="suspended"||i.state==="running"&&i.ctx.state==="interrupted"?(i.ctx.resume().then(function(){i.state="running";for(var a=0;a<i._howls.length;a++)i._howls[a]._emit("resume")}),i._suspendTimer&&(clearTimeout(i._suspendTimer),i._suspendTimer=null)):i.state==="suspending"&&(i._resumeAfterSuspend=!0),i}};var t=new o,e=function(i){var a=this;if(!i.src||i.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}a.init(i)};e.prototype={init:function(i){var a=this;return t.ctx||_(),a._autoplay=i.autoplay||!1,a._format=typeof i.format!="string"?i.format:[i.format],a._html5=i.html5||!1,a._muted=i.mute||!1,a._loop=i.loop||!1,a._pool=i.pool||5,a._preload=typeof i.preload=="boolean"||i.preload==="metadata"?i.preload:!0,a._rate=i.rate||1,a._sprite=i.sprite||{},a._src=typeof i.src!="string"?i.src:[i.src],a._volume=i.volume!==void 0?i.volume:1,a._xhr={method:i.xhr&&i.xhr.method?i.xhr.method:"GET",headers:i.xhr&&i.xhr.headers?i.xhr.headers:null,withCredentials:i.xhr&&i.xhr.withCredentials?i.xhr.withCredentials:!1},a._duration=0,a._state="unloaded",a._sounds=[],a._endTimers={},a._queue=[],a._playLock=!1,a._onend=i.onend?[{fn:i.onend}]:[],a._onfade=i.onfade?[{fn:i.onfade}]:[],a._onload=i.onload?[{fn:i.onload}]:[],a._onloaderror=i.onloaderror?[{fn:i.onloaderror}]:[],a._onplayerror=i.onplayerror?[{fn:i.onplayerror}]:[],a._onpause=i.onpause?[{fn:i.onpause}]:[],a._onplay=i.onplay?[{fn:i.onplay}]:[],a._onstop=i.onstop?[{fn:i.onstop}]:[],a._onmute=i.onmute?[{fn:i.onmute}]:[],a._onvolume=i.onvolume?[{fn:i.onvolume}]:[],a._onrate=i.onrate?[{fn:i.onrate}]:[],a._onseek=i.onseek?[{fn:i.onseek}]:[],a._onunlock=i.onunlock?[{fn:i.onunlock}]:[],a._onresume=[],a._webAudio=t.usingWebAudio&&!a._html5,typeof t.ctx<"u"&&t.ctx&&t.autoUnlock&&t._unlockAudio(),t._howls.push(a),a._autoplay&&a._queue.push({event:"play",action:function(){a.play()}}),a._preload&&a._preload!=="none"&&a.load(),a},load:function(){var i=this,a=null;if(t.noAudio){i._emit("loaderror",null,"No audio support.");return}typeof i._src=="string"&&(i._src=[i._src]);for(var c=0;c<i._src.length;c++){var f,m;if(i._format&&i._format[c])f=i._format[c];else{if(m=i._src[c],typeof m!="string"){i._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}f=/^data:audio\/([^;,]+);/i.exec(m),f||(f=/\.([^.]+)$/.exec(m.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&&t.codecs(f)){a=i._src[c];break}}if(!a){i._emit("loaderror",null,"No codec support for selected audio sources.");return}return i._src=a,i._state="loading",window.location.protocol==="https:"&&a.slice(0,5)==="http:"&&(i._html5=!0,i._webAudio=!1),new n(i),i._webAudio&&s(i),i},play:function(i,a){var c=this,f=null;if(typeof i=="number")f=i,i=null;else{if(typeof i=="string"&&c._state==="loaded"&&!c._sprite[i])return null;if(typeof i>"u"&&(i="__default",!c._playLock)){for(var m=0,h=0;h<c._sounds.length;h++)c._sounds[h]._paused&&!c._sounds[h]._ended&&(m++,f=c._sounds[h]._id);m===1?i=null:f=null}}var p=f?c._soundById(f):c._inactiveSound();if(!p)return null;if(f&&!i&&(i=p._sprite||"__default"),c._state!=="loaded"){p._sprite=i,p._ended=!1;var g=p._id;return c._queue.push({event:"play",action:function(){c.play(g)}}),g}if(f&&!p._paused)return a||c._loadQueue("play"),p._id;c._webAudio&&t._autoResume();var w=Math.max(0,p._seek>0?p._seek:c._sprite[i][0]/1e3),C=Math.max(0,(c._sprite[i][0]+c._sprite[i][1])/1e3-w),O=C*1e3/Math.abs(p._rate),G=c._sprite[i][0]/1e3,q=(c._sprite[i][0]+c._sprite[i][1])/1e3;p._sprite=i,p._ended=!1;var B=function(){p._paused=!1,p._seek=w,p._start=G,p._stop=q,p._loop=!!(p._loop||c._sprite[i][2])};if(w>=q){c._ended(p);return}var E=p._node;if(c._webAudio){var ae=function(){c._playLock=!1,B(),c._refreshBuffer(p);var le=p._muted||c._muted?0:p._volume;E.gain.setValueAtTime(le,t.ctx.currentTime),p._playStart=t.ctx.currentTime,typeof E.bufferSource.start>"u"?p._loop?E.bufferSource.noteGrainOn(0,w,86400):E.bufferSource.noteGrainOn(0,w,C):p._loop?E.bufferSource.start(0,w,86400):E.bufferSource.start(0,w,C),O!==1/0&&(c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O)),a||setTimeout(function(){c._emit("play",p._id),c._loadQueue()},0)};t.state==="running"&&t.ctx.state!=="interrupted"?ae():(c._playLock=!0,c.once("resume",ae),c._clearTimer(p._id))}else{var me=function(){E.currentTime=w,E.muted=p._muted||c._muted||t._muted||E.muted,E.volume=p._volume*t.volume(),E.playbackRate=p._rate;try{var le=E.play();if(le&&typeof Promise<"u"&&(le instanceof Promise||typeof le.then=="function")?(c._playLock=!0,B(),le.then(function(){c._playLock=!1,E._unlocked=!0,a?c._loadQueue():c._emit("play",p._id)}).catch(function(){c._playLock=!1,c._emit("playerror",p._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."),p._ended=!0,p._paused=!0})):a||(c._playLock=!1,B(),c._emit("play",p._id)),E.playbackRate=p._rate,E.paused){c._emit("playerror",p._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}i!=="__default"||p._loop?c._endTimers[p._id]=setTimeout(c._ended.bind(c,p),O):(c._endTimers[p._id]=function(){c._ended(p),E.removeEventListener("ended",c._endTimers[p._id],!1)},E.addEventListener("ended",c._endTimers[p._id],!1))}catch(lt){c._emit("playerror",p._id,lt)}};E.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(E.src=c._src,E.load());var st=window&&window.ejecta||!E.readyState&&t._navigator.isCocoonJS;if(E.readyState>=3||st)me();else{c._playLock=!0,c._state="loading";var se=function(){c._state="loaded",me(),E.removeEventListener(t._canPlayEvent,se,!1)};E.addEventListener(t._canPlayEvent,se,!1),c._clearTimer(p._id)}}return p._id},pause:function(i){var a=this;if(a._state!=="loaded"||a._playLock)return a._queue.push({event:"pause",action:function(){a.pause(i)}}),a;for(var c=a._getSoundIds(i),f=0;f<c.length;f++){a._clearTimer(c[f]);var m=a._soundById(c[f]);if(m&&!m._paused&&(m._seek=a.seek(c[f]),m._rateSeek=0,m._paused=!0,a._stopFade(c[f]),m._node))if(a._webAudio){if(!m._node.bufferSource)continue;typeof m._node.bufferSource.stop>"u"?m._node.bufferSource.noteOff(0):m._node.bufferSource.stop(0),a._cleanBuffer(m._node)}else(!isNaN(m._node.duration)||m._node.duration===1/0)&&m._node.pause();arguments[1]||a._emit("pause",m?m._id:null)}return a},stop:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"stop",action:function(){c.stop(i)}}),c;for(var f=c._getSoundIds(i),m=0;m<f.length;m++){c._clearTimer(f[m]);var h=c._soundById(f[m]);h&&(h._seek=h._start||0,h._rateSeek=0,h._paused=!0,h._ended=!0,c._stopFade(f[m]),h._node&&(c._webAudio?h._node.bufferSource&&(typeof h._node.bufferSource.stop>"u"?h._node.bufferSource.noteOff(0):h._node.bufferSource.stop(0),c._cleanBuffer(h._node)):(!isNaN(h._node.duration)||h._node.duration===1/0)&&(h._node.currentTime=h._start||0,h._node.pause(),h._node.duration===1/0&&c._clearSound(h._node))),a||c._emit("stop",h._id))}return c},mute:function(i,a){var c=this;if(c._state!=="loaded"||c._playLock)return c._queue.push({event:"mute",action:function(){c.mute(i,a)}}),c;if(typeof a>"u")if(typeof i=="boolean")c._muted=i;else return c._muted;for(var f=c._getSoundIds(a),m=0;m<f.length;m++){var h=c._soundById(f[m]);h&&(h._muted=i,h._interval&&c._stopFade(h._id),c._webAudio&&h._node?h._node.gain.setValueAtTime(i?0:h._volume,t.ctx.currentTime):h._node&&(h._node.muted=t._muted?!0:i),c._emit("mute",h._id))}return c},volume:function(){var i=this,a=arguments,c,f;if(a.length===0)return i._volume;if(a.length===1||a.length===2&&typeof a[1]>"u"){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length>=2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c<"u"&&c>=0&&c<=1){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"volume",action:function(){i.volume.apply(i,a)}}),i;typeof f>"u"&&(i._volume=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)p=i._soundById(f[g]),p&&(p._volume=c,a[2]||i._stopFade(f[g]),i._webAudio&&p._node&&!p._muted?p._node.gain.setValueAtTime(c,t.ctx.currentTime):p._node&&!p._muted&&(p._node.volume=c*t.volume()),i._emit("volume",p._id))}else return p=f?i._soundById(f):i._sounds[0],p?p._volume:0;return i},fade:function(i,a,c,f){var m=this;if(m._state!=="loaded"||m._playLock)return m._queue.push({event:"fade",action:function(){m.fade(i,a,c,f)}}),m;i=Math.min(Math.max(0,parseFloat(i)),1),a=Math.min(Math.max(0,parseFloat(a)),1),c=parseFloat(c),m.volume(i,f);for(var h=m._getSoundIds(f),p=0;p<h.length;p++){var g=m._soundById(h[p]);if(g){if(f||m._stopFade(h[p]),m._webAudio&&!g._muted){var w=t.ctx.currentTime,C=w+c/1e3;g._volume=i,g._node.gain.setValueAtTime(i,w),g._node.gain.linearRampToValueAtTime(a,C)}m._startFadeInterval(g,i,a,c,h[p],typeof f>"u")}}return m},_startFadeInterval:function(i,a,c,f,m,h){var p=this,g=a,w=c-a,C=Math.abs(w/.01),O=Math.max(4,C>0?f/C:f),G=Date.now();i._fadeTo=c,i._interval=setInterval(function(){var q=(Date.now()-G)/f;G=Date.now(),g+=w*q,g=Math.round(g*100)/100,w<0?g=Math.max(c,g):g=Math.min(c,g),p._webAudio?i._volume=g:p.volume(g,i._id,!0),h&&(p._volume=g),(c<a&&g<=c||c>a&&g>=c)&&(clearInterval(i._interval),i._interval=null,i._fadeTo=null,p.volume(c,i._id),p._emit("fade",i._id))},O)},_stopFade:function(i){var a=this,c=a._soundById(i);return c&&c._interval&&(a._webAudio&&c._node.gain.cancelScheduledValues(t.ctx.currentTime),clearInterval(c._interval),c._interval=null,a.volume(c._fadeTo,i),c._fadeTo=null,a._emit("fade",i)),a},loop:function(){var i=this,a=arguments,c,f,m;if(a.length===0)return i._loop;if(a.length===1)if(typeof a[0]=="boolean")c=a[0],i._loop=c;else return m=i._soundById(parseInt(a[0],10)),m?m._loop:!1;else a.length===2&&(c=a[0],f=parseInt(a[1],10));for(var h=i._getSoundIds(f),p=0;p<h.length;p++)m=i._soundById(h[p]),m&&(m._loop=c,i._webAudio&&m._node&&m._node.bufferSource&&(m._node.bufferSource.loop=c,c&&(m._node.bufferSource.loopStart=m._start||0,m._node.bufferSource.loopEnd=m._stop,i.playing(h[p])&&(i.pause(h[p],!0),i.play(h[p],!0)))));return i},rate:function(){var i=this,a=arguments,c,f;if(a.length===0)f=i._sounds[0]._id;else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):c=parseFloat(a[0])}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));var p;if(typeof c=="number"){if(i._state!=="loaded"||i._playLock)return i._queue.push({event:"rate",action:function(){i.rate.apply(i,a)}}),i;typeof f>"u"&&(i._rate=c),f=i._getSoundIds(f);for(var g=0;g<f.length;g++)if(p=i._soundById(f[g]),p){i.playing(f[g])&&(p._rateSeek=i.seek(f[g]),p._playStart=i._webAudio?t.ctx.currentTime:p._playStart),p._rate=c,i._webAudio&&p._node&&p._node.bufferSource?p._node.bufferSource.playbackRate.setValueAtTime(c,t.ctx.currentTime):p._node&&(p._node.playbackRate=c);var w=i.seek(f[g]),C=(i._sprite[p._sprite][0]+i._sprite[p._sprite][1])/1e3-w,O=C*1e3/Math.abs(p._rate);(i._endTimers[f[g]]||!p._paused)&&(i._clearTimer(f[g]),i._endTimers[f[g]]=setTimeout(i._ended.bind(i,p),O)),i._emit("rate",p._id)}}else return p=i._soundById(f),p?p._rate:i._rate;return i},seek:function(){var i=this,a=arguments,c,f;if(a.length===0)i._sounds.length&&(f=i._sounds[0]._id);else if(a.length===1){var m=i._getSoundIds(),h=m.indexOf(a[0]);h>=0?f=parseInt(a[0],10):i._sounds.length&&(f=i._sounds[0]._id,c=parseFloat(a[0]))}else a.length===2&&(c=parseFloat(a[0]),f=parseInt(a[1],10));if(typeof f>"u")return 0;if(typeof c=="number"&&(i._state!=="loaded"||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,a)}}),i;var p=i._soundById(f);if(p)if(typeof c=="number"&&c>=0){var g=i.playing(f);g&&i.pause(f,!0),p._seek=c,p._ended=!1,i._clearTimer(f),!i._webAudio&&p._node&&!isNaN(p._node.duration)&&(p._node.currentTime=c);var w=function(){g&&i.play(f,!0),i._emit("seek",f)};if(g&&!i._webAudio){var C=function(){i._playLock?setTimeout(C,0):w()};setTimeout(C,0)}else w()}else if(i._webAudio){var O=i.playing(f)?t.ctx.currentTime-p._playStart:0,G=p._rateSeek?p._rateSeek-p._seek:0;return p._seek+(G+O*Math.abs(p._rate))}else return p._node.currentTime;return i},playing:function(i){var a=this;if(typeof i=="number"){var c=a._soundById(i);return c?!c._paused:!1}for(var f=0;f<a._sounds.length;f++)if(!a._sounds[f]._paused)return!0;return!1},duration:function(i){var a=this,c=a._duration,f=a._soundById(i);return f&&(c=a._sprite[f._sprite][1]/1e3),c},state:function(){return this._state},unload:function(){for(var i=this,a=i._sounds,c=0;c<a.length;c++)a[c]._paused||i.stop(a[c]._id),i._webAudio||(i._clearSound(a[c]._node),a[c]._node.removeEventListener("error",a[c]._errorFn,!1),a[c]._node.removeEventListener(t._canPlayEvent,a[c]._loadFn,!1),a[c]._node.removeEventListener("ended",a[c]._endFn,!1),t._releaseHtml5Audio(a[c]._node)),delete a[c]._node,i._clearTimer(a[c]._id);var f=t._howls.indexOf(i);f>=0&&t._howls.splice(f,1);var m=!0;for(c=0;c<t._howls.length;c++)if(t._howls[c]._src===i._src||i._src.indexOf(t._howls[c]._src)>=0){m=!1;break}return r&&m&&delete r[i._src],t.noAudio=!1,i._state="unloaded",i._sounds=[],i=null,null},on:function(i,a,c,f){var m=this,h=m["_on"+i];return typeof a=="function"&&h.push(f?{id:c,fn:a,once:f}:{id:c,fn:a}),m},off:function(i,a,c){var f=this,m=f["_on"+i],h=0;if(typeof a=="number"&&(c=a,a=null),a||c)for(h=0;h<m.length;h++){var p=c===m[h].id;if(a===m[h].fn&&p||!a&&p){m.splice(h,1);break}}else if(i)f["_on"+i]=[];else{var g=Object.keys(f);for(h=0;h<g.length;h++)g[h].indexOf("_on")===0&&Array.isArray(f[g[h]])&&(f[g[h]]=[])}return f},once:function(i,a,c){var f=this;return f.on(i,a,c,1),f},_emit:function(i,a,c){for(var f=this,m=f["_on"+i],h=m.length-1;h>=0;h--)(!m[h].id||m[h].id===a||i==="load")&&(setTimeout((function(p){p.call(this,a,c)}).bind(f,m[h].fn),0),m[h].once&&f.off(i,m[h].fn,m[h].id));return f._loadQueue(i),f},_loadQueue:function(i){var a=this;if(a._queue.length>0){var c=a._queue[0];c.event===i&&(a._queue.shift(),a._loadQueue()),i||c.action()}return a},_ended:function(i){var a=this,c=i._sprite;if(!a._webAudio&&i._node&&!i._node.paused&&!i._node.ended&&i._node.currentTime<i._stop)return setTimeout(a._ended.bind(a,i),100),a;var f=!!(i._loop||a._sprite[c][2]);if(a._emit("end",i._id),!a._webAudio&&f&&a.stop(i._id,!0).play(i._id),a._webAudio&&f){a._emit("play",i._id),i._seek=i._start||0,i._rateSeek=0,i._playStart=t.ctx.currentTime;var m=(i._stop-i._start)*1e3/Math.abs(i._rate);a._endTimers[i._id]=setTimeout(a._ended.bind(a,i),m)}return a._webAudio&&!f&&(i._paused=!0,i._ended=!0,i._seek=i._start||0,i._rateSeek=0,a._clearTimer(i._id),a._cleanBuffer(i._node),t._autoSuspend()),!a._webAudio&&!f&&a.stop(i._id,!0),a},_clearTimer:function(i){var a=this;if(a._endTimers[i]){if(typeof a._endTimers[i]!="function")clearTimeout(a._endTimers[i]);else{var c=a._soundById(i);c&&c._node&&c._node.removeEventListener("ended",a._endTimers[i],!1)}delete a._endTimers[i]}return a},_soundById:function(i){for(var a=this,c=0;c<a._sounds.length;c++)if(i===a._sounds[c]._id)return a._sounds[c];return null},_inactiveSound:function(){var i=this;i._drain();for(var a=0;a<i._sounds.length;a++)if(i._sounds[a]._ended)return i._sounds[a].reset();return new n(i)},_drain:function(){var i=this,a=i._pool,c=0,f=0;if(!(i._sounds.length<a)){for(f=0;f<i._sounds.length;f++)i._sounds[f]._ended&&c++;for(f=i._sounds.length-1;f>=0;f--){if(c<=a)return;i._sounds[f]._ended&&(i._webAudio&&i._sounds[f]._node&&i._sounds[f]._node.disconnect(0),i._sounds.splice(f,1),c--)}}},_getSoundIds:function(i){var a=this;if(typeof i>"u"){for(var c=[],f=0;f<a._sounds.length;f++)c.push(a._sounds[f]._id);return c}else return[i]},_refreshBuffer:function(i){var a=this;return i._node.bufferSource=t.ctx.createBufferSource(),i._node.bufferSource.buffer=r[a._src],i._panner?i._node.bufferSource.connect(i._panner):i._node.bufferSource.connect(i._node),i._node.bufferSource.loop=i._loop,i._loop&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop||0),i._node.bufferSource.playbackRate.setValueAtTime(i._rate,t.ctx.currentTime),a},_cleanBuffer:function(i){var a=this,c=t._navigator&&t._navigator.vendor.indexOf("Apple")>=0;if(!i.bufferSource)return a;if(t._scratchBuffer&&i.bufferSource&&(i.bufferSource.onended=null,i.bufferSource.disconnect(0),c))try{i.bufferSource.buffer=t._scratchBuffer}catch{}return i.bufferSource=null,a},_clearSound:function(i){var a=/MSIE |Trident\//.test(t._navigator&&t._navigator.userAgent);a||(i.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var n=function(i){this._parent=i,this.init()};n.prototype={init:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,a._sounds.push(i),i.create(),i},create:function(){var i=this,a=i._parent,c=t._muted||i._muted||i._parent._muted?0:i._volume;return a._webAudio?(i._node=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),i._node.gain.setValueAtTime(c,t.ctx.currentTime),i._node.paused=!0,i._node.connect(t.masterGain)):t.noAudio||(i._node=t._obtainHtml5Audio(),i._errorFn=i._errorListener.bind(i),i._node.addEventListener("error",i._errorFn,!1),i._loadFn=i._loadListener.bind(i),i._node.addEventListener(t._canPlayEvent,i._loadFn,!1),i._endFn=i._endListener.bind(i),i._node.addEventListener("ended",i._endFn,!1),i._node.src=a._src,i._node.preload=a._preload===!0?"auto":a._preload,i._node.volume=c*t.volume(),i._node.load()),i},reset:function(){var i=this,a=i._parent;return i._muted=a._muted,i._loop=a._loop,i._volume=a._volume,i._rate=a._rate,i._seek=0,i._rateSeek=0,i._paused=!0,i._ended=!0,i._sprite="__default",i._id=++t._counter,i},_errorListener:function(){var i=this;i._parent._emit("loaderror",i._id,i._node.error?i._node.error.code:0),i._node.removeEventListener("error",i._errorFn,!1)},_loadListener:function(){var i=this,a=i._parent;a._duration=Math.ceil(i._node.duration*10)/10,Object.keys(a._sprite).length===0&&(a._sprite={__default:[0,a._duration*1e3]}),a._state!=="loaded"&&(a._state="loaded",a._emit("load"),a._loadQueue()),i._node.removeEventListener(t._canPlayEvent,i._loadFn,!1)},_endListener:function(){var i=this,a=i._parent;a._duration===1/0&&(a._duration=Math.ceil(i._node.duration*10)/10,a._sprite.__default[1]===1/0&&(a._sprite.__default[1]=a._duration*1e3),a._ended(i)),i._node.removeEventListener("ended",i._endFn,!1)}};var r={},s=function(i){var a=i._src;if(r[a]){i._duration=r[a].duration,d(i);return}if(/^data:[^;]+;base64,/.test(a)){for(var c=atob(a.split(",")[1]),f=new Uint8Array(c.length),m=0;m<c.length;++m)f[m]=c.charCodeAt(m);u(f.buffer,i)}else{var h=new XMLHttpRequest;h.open(i._xhr.method,a,!0),h.withCredentials=i._xhr.withCredentials,h.responseType="arraybuffer",i._xhr.headers&&Object.keys(i._xhr.headers).forEach(function(p){h.setRequestHeader(p,i._xhr.headers[p])}),h.onload=function(){var p=(h.status+"")[0];if(p!=="0"&&p!=="2"&&p!=="3"){i._emit("loaderror",null,"Failed loading audio file with status: "+h.status+".");return}u(h.response,i)},h.onerror=function(){i._webAudio&&(i._html5=!0,i._webAudio=!1,i._sounds=[],delete r[a],i.load())},l(h)}},l=function(i){try{i.send()}catch{i.onerror()}},u=function(i,a){var c=function(){a._emit("loaderror",null,"Decoding audio data failed.")},f=function(m){m&&a._sounds.length>0?(r[a._src]=m,d(a,m)):c()};typeof Promise<"u"&&t.ctx.decodeAudioData.length===1?t.ctx.decodeAudioData(i).then(f).catch(c):t.ctx.decodeAudioData(i,f,c)},d=function(i,a){a&&!i._duration&&(i._duration=a.duration),Object.keys(i._sprite).length===0&&(i._sprite={__default:[0,i._duration*1e3]}),i._state!=="loaded"&&(i._state="loaded",i._emit("load"),i._loadQueue())},_=function(){if(t.usingWebAudio){try{typeof AudioContext<"u"?t.ctx=new AudioContext:typeof webkitAudioContext<"u"?t.ctx=new webkitAudioContext:t.usingWebAudio=!1}catch{t.usingWebAudio=!1}t.ctx||(t.usingWebAudio=!1);var i=/iP(hone|od|ad)/.test(t._navigator&&t._navigator.platform),a=t._navigator&&t._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),c=a?parseInt(a[1],10):null;if(i&&c&&c<9){var f=/safari/.test(t._navigator&&t._navigator.userAgent.toLowerCase());t._navigator&&!f&&(t.usingWebAudio=!1)}t.usingWebAudio&&(t.masterGain=typeof t.ctx.createGain>"u"?t.ctx.createGainNode():t.ctx.createGain(),t.masterGain.gain.setValueAtTime(t._muted?0:t._volume,t.ctx.currentTime),t.masterGain.connect(t.ctx.destination)),t._setup()}};typeof define=="function"&&define.amd&&define([],function(){return{Howler:t,Howl:e}}),typeof Dt<"u"&&(Dt.Howler=t,Dt.Howl=e),typeof global<"u"?(global.HowlerGlobal=o,global.Howler=t,global.Howl=e,global.Sound=n):typeof window<"u"&&(window.HowlerGlobal=o,window.Howler=t,window.Howl=e,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(t){var e=this;if(!e.ctx||!e.ctx.listener)return e;for(var n=e._howls.length-1;n>=0;n--)e._howls[n].stereo(t);return e},HowlerGlobal.prototype.pos=function(t,e,n){var r=this;if(!r.ctx||!r.ctx.listener)return r;if(e=typeof e!="number"?r._pos[1]:e,n=typeof n!="number"?r._pos[2]:n,typeof t=="number")r._pos=[t,e,n],typeof r.ctx.listener.positionX<"u"?(r.ctx.listener.positionX.setTargetAtTime(r._pos[0],Howler.ctx.currentTime,.1),r.ctx.listener.positionY.setTargetAtTime(r._pos[1],Howler.ctx.currentTime,.1),r.ctx.listener.positionZ.setTargetAtTime(r._pos[2],Howler.ctx.currentTime,.1)):r.ctx.listener.setPosition(r._pos[0],r._pos[1],r._pos[2]);else return r._pos;return r},HowlerGlobal.prototype.orientation=function(t,e,n,r,s,l){var u=this;if(!u.ctx||!u.ctx.listener)return u;var d=u._orientation;if(e=typeof e!="number"?d[1]:e,n=typeof n!="number"?d[2]:n,r=typeof r!="number"?d[3]:r,s=typeof s!="number"?d[4]:s,l=typeof l!="number"?d[5]:l,typeof t=="number")u._orientation=[t,e,n,r,s,l],typeof u.ctx.listener.forwardX<"u"?(u.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),u.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),u.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),u.ctx.listener.upX.setTargetAtTime(r,Howler.ctx.currentTime,.1),u.ctx.listener.upY.setTargetAtTime(s,Howler.ctx.currentTime,.1),u.ctx.listener.upZ.setTargetAtTime(l,Howler.ctx.currentTime,.1)):u.ctx.listener.setOrientation(t,e,n,r,s,l);else return d;return u},Howl.prototype.init=(function(t){return function(e){var n=this;return n._orientation=e.orientation||[1,0,0],n._stereo=e.stereo||null,n._pos=e.pos||null,n._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},n._onstereo=e.onstereo?[{fn:e.onstereo}]:[],n._onpos=e.onpos?[{fn:e.onpos}]:[],n._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}})(Howl.prototype.init),Howl.prototype.stereo=function(t,e){var n=this;if(!n._webAudio)return n;if(n._state!=="loaded")return n._queue.push({event:"stereo",action:function(){n.stereo(t,e)}}),n;var r=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof e>"u")if(typeof t=="number")n._stereo=t,n._pos=[t,0,0];else return n._stereo;for(var s=n._getSoundIds(e),l=0;l<s.length;l++){var u=n._soundById(s[l]);if(u)if(typeof t=="number")u._stereo=t,u._pos=[t,0,0],u._node&&(u._pannerAttr.panningModel="equalpower",(!u._panner||!u._panner.pan)&&o(u,r),r==="spatial"?typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):u._panner.setPosition(t,0,0):u._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",u._id);else return u._stereo}return n},Howl.prototype.pos=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"pos",action:function(){s.pos(t,e,n,r)}}),s;if(e=typeof e!="number"?0:e,n=typeof n!="number"?-.5:n,typeof r>"u")if(typeof t=="number")s._pos=[t,e,n];else return s._pos;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._pos=[t,e,n],d._node&&((!d._panner||d._panner.pan)&&o(d,"spatial"),typeof d._panner.positionX<"u"?(d._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.positionY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setPosition(t,e,n)),s._emit("pos",d._id);else return d._pos}return s},Howl.prototype.orientation=function(t,e,n,r){var s=this;if(!s._webAudio)return s;if(s._state!=="loaded")return s._queue.push({event:"orientation",action:function(){s.orientation(t,e,n,r)}}),s;if(e=typeof e!="number"?s._orientation[1]:e,n=typeof n!="number"?s._orientation[2]:n,typeof r>"u")if(typeof t=="number")s._orientation=[t,e,n];else return s._orientation;for(var l=s._getSoundIds(r),u=0;u<l.length;u++){var d=s._soundById(l[u]);if(d)if(typeof t=="number")d._orientation=[t,e,n],d._node&&(d._panner||(d._pos||(d._pos=s._pos||[0,0,-.5]),o(d,"spatial")),typeof d._panner.orientationX<"u"?(d._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),d._panner.orientationY.setValueAtTime(e,Howler.ctx.currentTime),d._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):d._panner.setOrientation(t,e,n)),s._emit("orientation",d._id);else return d._orientation}return s},Howl.prototype.pannerAttr=function(){var t=this,e=arguments,n,r,s;if(!t._webAudio)return t;if(e.length===0)return t._pannerAttr;if(e.length===1)if(typeof e[0]=="object")n=e[0],typeof r>"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}),t._pannerAttr={coneInnerAngle:typeof n.pannerAttr.coneInnerAngle<"u"?n.pannerAttr.coneInnerAngle:t._coneInnerAngle,coneOuterAngle:typeof n.pannerAttr.coneOuterAngle<"u"?n.pannerAttr.coneOuterAngle:t._coneOuterAngle,coneOuterGain:typeof n.pannerAttr.coneOuterGain<"u"?n.pannerAttr.coneOuterGain:t._coneOuterGain,distanceModel:typeof n.pannerAttr.distanceModel<"u"?n.pannerAttr.distanceModel:t._distanceModel,maxDistance:typeof n.pannerAttr.maxDistance<"u"?n.pannerAttr.maxDistance:t._maxDistance,refDistance:typeof n.pannerAttr.refDistance<"u"?n.pannerAttr.refDistance:t._refDistance,rolloffFactor:typeof n.pannerAttr.rolloffFactor<"u"?n.pannerAttr.rolloffFactor:t._rolloffFactor,panningModel:typeof n.pannerAttr.panningModel<"u"?n.pannerAttr.panningModel:t._panningModel});else return s=t._soundById(parseInt(e[0],10)),s?s._pannerAttr:t._pannerAttr;else e.length===2&&(n=e[0],r=parseInt(e[1],10));for(var l=t._getSoundIds(r),u=0;u<l.length;u++)if(s=t._soundById(l[u]),s){var d=s._pannerAttr;d={coneInnerAngle:typeof n.coneInnerAngle<"u"?n.coneInnerAngle:d.coneInnerAngle,coneOuterAngle:typeof n.coneOuterAngle<"u"?n.coneOuterAngle:d.coneOuterAngle,coneOuterGain:typeof n.coneOuterGain<"u"?n.coneOuterGain:d.coneOuterGain,distanceModel:typeof n.distanceModel<"u"?n.distanceModel:d.distanceModel,maxDistance:typeof n.maxDistance<"u"?n.maxDistance:d.maxDistance,refDistance:typeof n.refDistance<"u"?n.refDistance:d.refDistance,rolloffFactor:typeof n.rolloffFactor<"u"?n.rolloffFactor:d.rolloffFactor,panningModel:typeof n.panningModel<"u"?n.panningModel:d.panningModel};var _=s._panner;_||(s._pos||(s._pos=t._pos||[0,0,-.5]),o(s,"spatial"),_=s._panner),_.coneInnerAngle=d.coneInnerAngle,_.coneOuterAngle=d.coneOuterAngle,_.coneOuterGain=d.coneOuterGain,_.distanceModel=d.distanceModel,_.maxDistance=d.maxDistance,_.refDistance=d.refDistance,_.rolloffFactor=d.rolloffFactor,_.panningModel=d.panningModel}return t},Sound.prototype.init=(function(t){return function(){var e=this,n=e._parent;e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,t.call(this),e._stereo?n.stereo(e._stereo):e._pos&&n.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(t){return function(){var e=this,n=e._parent;return e._orientation=n._orientation,e._stereo=n._stereo,e._pos=n._pos,e._pannerAttr=n._pannerAttr,e._stereo?n.stereo(e._stereo):e._pos?n.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,n._refreshBuffer(e)),t.call(this)}})(Sound.prototype.reset);var o=function(t,e){e=e||"spatial",e==="spatial"?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,typeof t._panner.positionX<"u"?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),typeof t._panner.orientationX<"u"?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}})()});var It=(o,t)=>{let e=y(de),n=y(ye),r=e.getSplitShellEnabled(),s="/"+t.map(d=>d.path).join("/"),l=s.startsWith("/chartplotter"),u=s.startsWith("/dashboard");if(r&&u&&!l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["chartplotter",d??""])}if(!r&&l){let d=t.length>1?t[1].path:void 0;return n.createUrlTree(["dashboard",d??""])}return!0};var wr=[{path:"dashboard/:id",component:vn,canMatch:[It]},{path:"chartplotter/:id",loadComponent:()=>import("./chunk-4NJ3ZL5U.js").then(o=>o.SplitShellComponent),canMatch:[It]},{path:"settings",loadComponent:()=>import("./chunk-JCVEDDSQ.js").then(o=>o.SettingsComponent),title:"KIP - Settings"},{path:"options",loadComponent:()=>import("./chunk-35577QTX.js").then(o=>o.TabsComponent),title:"KIP - Options"},{path:"remote",loadComponent:()=>import("./chunk-NDOR4O4J.js").then(o=>o.RemoteControlComponent),title:"KIP - Remote Control"},{path:"help",loadComponent:()=>import("./chunk-TIWUK3AU.js").then(o=>o.AppHelpComponent),title:"KIP - Help"},{path:"data",loadComponent:()=>import("./chunk-2DBQEP6W.js").then(o=>o.DataInspectorComponent),title:"KIP - Data Inspector"},{path:"login",loadComponent:()=>import("./chunk-KZW5Z46K.js").then(o=>o.WidgetLoginComponent),title:"Login"},{path:"**",component:vn,canMatch:[It]}];var Ar={production:!0};var Ir=ni(bn());function Ho(o,t){if(o&1){let e=K();b(0,"div",1)(1,"button",2),F("click",function(){I(e);let r=L();return D(r.action())}),M(2),T()()}if(o&2){let e=L();x(2),Qe(" ",e.data.action," ")}}var qo=["label"];function $o(o,t){}var Uo=Math.pow(2,31)-1,Je=class{_overlayRef;instance;containerInstance;_afterDismissed=new Ae;_afterOpened=new Ae;_onAction=new Ae;_durationTimeoutId;_dismissedByAction=!1;constructor(t,e){this._overlayRef=e,this.containerInstance=t,t._onExit.subscribe(()=>this._finishDismiss())}dismiss(){this._afterDismissed.closed||this.containerInstance.exit(),clearTimeout(this._durationTimeoutId)}dismissWithAction(){this._onAction.closed||(this._dismissedByAction=!0,this._onAction.next(),this._onAction.complete(),this.dismiss()),clearTimeout(this._durationTimeoutId)}closeWithAction(){this.dismissWithAction()}_dismissAfter(t){this._durationTimeoutId=setTimeout(()=>this.dismiss(),Math.min(t,Uo))}_open(){this._afterOpened.closed||(this._afterOpened.next(),this._afterOpened.complete())}_finishDismiss(){this._overlayRef.dispose(),this._onAction.closed||this._onAction.complete(),this._afterDismissed.next({dismissedByAction:this._dismissedByAction}),this._afterDismissed.complete(),this._dismissedByAction=!1}afterDismissed(){return this._afterDismissed}afterOpened(){return this.containerInstance._onEnter}onAction(){return this._onAction}},Tr=new rn("MatSnackBarData"),ze=class{politeness="polite";announcementMessage="";viewContainerRef;duration=0;panelClass;direction;data=null;horizontalPosition="center";verticalPosition="bottom"},jo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarLabel",""]],hostAttrs:[1,"mat-mdc-snack-bar-label","mdc-snackbar__label"]})}return o})(),Qo=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarActions",""]],hostAttrs:[1,"mat-mdc-snack-bar-actions","mdc-snackbar__actions"]})}return o})(),Go=(()=>{class o{static \u0275fac=function(n){return new(n||o)};static \u0275dir=pt({type:o,selectors:[["","matSnackBarAction",""]],hostAttrs:[1,"mat-mdc-snack-bar-action","mdc-snackbar__action"]})}return o})(),Wo=(()=>{class o{snackBarRef=y(Je);data=y(Tr);constructor(){}action(){this.snackBarRef.dismissWithAction()}get hasAction(){return!!this.data.action}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["simple-snack-bar"]],hostAttrs:[1,"mat-mdc-simple-snack-bar"],exportAs:["matSnackBar"],decls:3,vars:2,consts:[["matSnackBarLabel",""],["matSnackBarActions",""],["matButton","","matSnackBarAction","",3,"click"]],template:function(n,r){n&1&&(b(0,"div",0),M(1),T(),$(2,Ho,3,1,"div",1)),n&2&&(x(),Qe(" ",r.data.message,`
|
|
2
2
|
`),x(),U(r.hasAction?2:-1))},dependencies:[Ke,jo,Qo,Go],styles:[`.mat-mdc-simple-snack-bar{display:flex}
|
|
3
|
-
`],encapsulation:2,changeDetection:0})}return o})(),
|
|
4
|
-
`],encapsulation:2})}return o})();function Yo(){return new ze}var Zo=new
|
|
5
|
-
`+JSON.stringify(e)),{aSev:0,vSev:0};let s=r.sound,l=r.visual;return(!e.value.method.includes(Le.Sound)||this._notificationConfig.sound[`mute${n.charAt(0).toUpperCase()+n.slice(1)}`]||this._isHowlIdMuted)&&(s=0),e.value.method.includes(Le.Visual)||(l=0),{aSev:s,vSev:l}}setSkMethod(e,n){this.requests.putRequest(`${e}.method`,n,mn.create())}setSkState(e,n){this.requests.putRequest(`${e}.state`,n,mn.create())}observerNotificationsInfo(){return this._alarmsInfo$.pipe(xe(e=>{let n=!1,r=!1;switch(e.visualSev){case 1:n=!0;break;case 2:r=!0;break}return Jn(X({},e),{isWarn:n,isAlarmEmergency:r})}))}getPlayer(e){if(this._players.has(e))return this._players.get(e);let n=Jo[e];if(!n)return console.warn("[Notification Service] Unknown track id",e),this.getPlayer(1e3);let r=new kr.Howl({src:[`assets/${n}.mp3`],autoplay:!1,preload:!0,loop:!0,onloaderror:(s,l)=>{console.log("[Notification Service] load error track:",e,l)},onplayerror:(s,l)=>{console.log("[Notification Service] play locked track:",e,l),r.once("unlock",()=>r.play())}});return this._players.set(e,r),r}mutePlayer(e){if(this._activeAlarmSoundtrack!=null&&this._activeAlarmSoundtrack!==1e3){let n=this._players.get(this._activeAlarmSoundtrack);n&&this._activeHowlId!=null&&n.mute(e,this._activeHowlId)}this._isHowlIdMuted=e,this.updateNotificationsState()}playAlarm(e){if(this._activeAlarmSoundtrack===e)return;if(this._activeAlarmSoundtrack!=null&&this._players.get(this._activeAlarmSoundtrack)?.stop(),e===1e3){this._activeAlarmSoundtrack=1e3,this._activeHowlId=null;return}let n=this.getPlayer(e);this._activeAlarmSoundtrack=e,this._activeHowlId=n.play(),n.mute(this._isHowlIdMuted,this._activeHowlId)}observeNotificationConfiguration(){return this._notificationConfig$.asObservable()}ngOnDestroy(){this._notificationSettingsSubscription?.unsubscribe(),this._resetServiceSubscription?.unsubscribe(),this._notificationDataStreamSubscription?.unsubscribe(),this._notificationMetaStreamSubscription?.unsubscribe(),this._notificationConfig$.complete(),this._notifications$.complete(),this._alarmsInfo$.complete();for(let e of this._players.values())try{e.unload()}catch{}this._players.clear()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var ea=(o,t)=>t.path;function ta(o,t){o&1&&(b(0,"mat-icon"),M(1,"info"),T())}function na(o,t){o&1&&(b(0,"mat-icon"),M(1,"info"),T())}function ia(o,t){o&1&&(b(0,"mat-icon",3),M(1,"report"),T())}function ra(o,t){o&1&&(b(0,"mat-icon",4),M(1,"warning"),T())}function oa(o,t){o&1&&(b(0,"mat-icon",5),M(1,"error"),T())}function aa(o,t){o&1&&(b(0,"mat-icon",6),M(1,"emergency_home"),T())}function sa(o,t){if(o&1){let e=K();b(0,"div",2),$(1,ta,2,0,"mat-icon")(2,na,2,0,"mat-icon")(3,ia,2,0,"mat-icon",3)(4,ra,2,0,"mat-icon",4)(5,oa,2,0,"mat-icon",5)(6,aa,2,0,"mat-icon",6),b(7,"div",7),M(8),T(),b(9,"div",8),M(10),vi(11,"slice"),T(),b(12,"div",9),M(13),T(),b(14,"button",10),F("click",function(){let r=I(e).$implicit,s=L();return D(s.silence(r.path))}),b(15,"mat-icon"),M(16,"music_off"),T()(),b(17,"button",11),F("click",function(){let r=I(e).$implicit,s=L();return D(s.clear(r.path))}),b(18,"mat-icon"),M(19,"published_with_changes"),T()()(),ee(20,"mat-divider",12)}if(o&2){let e,n=t.$implicit;x(),U((e=n.value.state)==="nominal"?1:e==="normal"?2:e==="alert"?3:e==="warn"?4:e==="alarm"?5:e==="emergency"?6:-1),x(7),je(n.value.state),x(2),Qe(" ",bi(11,5,n.path,14)," "),x(3),je(n.value.message),x(),ue("disabled",!(n.value.method!=null&&n.value.method.includes("sound")))}}function la(o,t){o&1&&(b(0,"mat-list-item",13)(1,"span",15),M(2,"Notifications Disabled"),T(),b(3,"span")(4,"i"),M(5,"*Enable notifications in Settings."),T()()())}function ca(o,t){o&1&&(b(0,"mat-list-item",14)(1,"i"),M(2,'"No Notification"'),T()())}function ua(o,t){if(o&1&&$(0,la,6,0,"mat-list-item",13)(1,ca,3,0,"mat-list-item",14),o&2){let e=L();U(e.notificationConfig().disableNotifications?0:1)}}function da(o,t){if(o&1){let e=K();b(0,"button",17),F("click",function(){I(e);let r=L(2);return D(r.mutePlayer(!r.isMuted))}),b(1,"span",18),M(2,"volume_up"),T(),M(3," Unmute Audio "),T()}}function fa(o,t){if(o&1){let e=K();b(0,"button",17),F("click",function(){I(e);let r=L(2);return D(r.mutePlayer(!r.isMuted))}),b(1,"span",18),M(2,"volume_off"),T(),M(3," Mute Audio "),T()}}function ma(o,t){if(o&1&&$(0,da,4,0,"button",16)(1,fa,4,0,"button",16),o&2){let e=L();U(e.isMuted?0:1)}}var Pr=(()=>{class o{_notificationsService=y(be);_notifications$=this._notificationsService.observeNotifications();notificationConfig=te(this._notificationsService.observeNotificationConfiguration(),{requireSync:!0});menuNotifications=te(ii([this._notifications$,this._notificationsService.observeNotificationConfiguration()]).pipe(xe(([e,n])=>{let r=[];return n.devices.showNormalState||r.push(ke.Normal),n.devices.showNominalState||r.push(ke.Nominal),e.filter(s=>s.value&&s.value.state&&!r.includes(s.value.state)).filter(s=>s.value&&s.value.method&&s.value.method.includes(Le.Visual))})),{requireSync:!0,equal:We});isMuted=!1;mutePlayer(e){this.isMuted=e,this._notificationsService.mutePlayer(e)}silence(e){this._notificationsService.setSkMethod(e,[Le.Visual])}clear(e){this._notificationsService.setSkState(e,ke.Normal)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["menu-notifications"]],decls:6,vars:2,consts:[[1,"menu-item-container"],[1,"actions-container","actions-bottom-container"],[1,"notification-container"],[1,"icon-alert-color"],[1,"icon-warn-color"],[1,"icon-alarm-color"],[1,"icon-emergency-color"],[1,"notification-title"],[1,"notification-path","scrollable-text"],[1,"notification-text"],["mat-icon-button","",1,"notification-action-btn",3,"click","disabled"],["mat-icon-button","",1,"notification-action-btn",3,"click"],[1,"notification-divider"],["lines","3","disabled","true",2,"text-align","center"],["disabled","true",2,"text-align","center"],["matListItemTitle",""],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button"],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button",3,"click"],[1,"material-icons"]],template:function(n,r){n&1&&(b(0,"mat-list",0),Oe(1,sa,21,8,null,null,ea,!1,ua,2,1),T(),b(4,"div",1),$(5,ma,2,1),T()),n&2&&(x(),Ie(r.menuNotifications()),x(4),U(r.notificationConfig().disableNotifications?-1:5))},dependencies:[lr,ar,sr,Zi,or,pe,Ke,Hi,xt,mr,fr,ve,Fe,Ei],styles:[".notification-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;padding:2px 10px 7px;scroll-behavior:smooth}mat-icon[_ngcontent-%COMP%]{margin-right:10px}.scrollable-text[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.scrollable-text[_ngcontent-%COMP%]:hover{overflow:auto;white-space:normal;word-wrap:break-word}.notification-title[_ngcontent-%COMP%]{text-transform:capitalize;font-size:var(--mat-sys-headline-small-size);width:calc(100% - 34px)}.notification-path[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-size);word-break:break-all;width:100%}.notification-text[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-line-height);font-style:italic;width:100%;overflow:auto;white-space:normal;word-wrap:break-word}.notification-action-btn[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container)}.notification-btn-container[_ngcontent-%COMP%]{display:inline-block;width:50%;height:48px;text-align:center}.menu-item-container[_ngcontent-%COMP%]{width:230px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;height:calc(100% - 48px)}.notification-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;background-color:var(--mat-sys-surface-container)}.actions-container[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column}.actions-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:48px}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large))}.icon-alert-color[_ngcontent-%COMP%]{color:var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{color:var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{color:var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:transparent}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.notification-divider[_ngcontent-%COMP%]{padding-top:10px}"],changeDetection:0})}return o})();var pa=["badgeButton"],Nr=(()=>{class o{badgeButton=St.required("badgeButton");_notifications=y(be);notificationsInfo=te(this._notifications.observerNotificationsInfo());openNotificationMenu(){let e=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(e)}onKeyDown(e){let n=e.key?.toLowerCase();(n==="enter"||n===" "||n==="spacebar")&&(e.preventDefault(),this.openNotificationMenu())}focus(){try{let e=this.badgeButton&&this.badgeButton(),n=e&&e.nativeElement;n&&typeof n.focus=="function"&&n.focus()}catch{}}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["notification-badge"]],viewQuery:function(n,r){n&1&&yt(r.badgeButton,pa,5),n&2&&vt()},decls:5,vars:7,consts:[["badgeButton",""],["mat-fab","","role","button","aria-label","Open notifications",1,"layout-action-btn",3,"click","keydown"],["aria-hidden","false","matBadgeSize","large","matBadgePosition","after","matBadgeOverlap","true",1,"icon-alert-color",3,"matBadgeHidden","matBadge"]],template:function(n,r){if(n&1){let s=K();b(0,"div")(1,"button",1,0),F("click",function(){return I(s),D(r.openNotificationMenu())})("keydown",function(u){return I(s),D(r.onKeyDown(u))}),b(3,"mat-icon",2),M(4,"notifications "),T()()()}n&2&&(x(),bt("warn",r.notificationsInfo().isWarn)("alarm-emergency-blink",r.notificationsInfo().isAlarmEmergency),_t("aria-haspopup",!0),x(2),ue("matBadgeHidden",!r.notificationsInfo().alarmCount)("matBadge",r.notificationsInfo().alarmCount))},dependencies:[pe,qi,ve,Fe,xt,nr],styles:["[_nghost-%COMP%]{display:block}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}.icon-alert-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:var(--mat-sys-primary)}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}"]})}return o})();var xr=(()=>{class o{overlayRef=null;overlay=y(Wi);injector=y(Te);open(){if(this.overlayRef)return;this.overlayRef=this.overlay.create({hasBackdrop:!1,panelClass:"notification-overlay-panel",positionStrategy:this.overlay.position().global().bottom("20px").left("20px"),scrollStrategy:this.overlay.scrollStrategies.reposition()});let e=new Ze(Nr,null,this.injector),n=this.overlayRef.attach(e);try{let r=n&&n.instance;if(r&&typeof r.focus=="function")r.focus();else{let s=this.overlayRef.overlayElement,l=s&&s.querySelector("button[mat-fab], .layout-action-btn");l&&typeof l.focus=="function"&&l.focus()}}catch{}}close(){try{this.overlayRef&&this.overlayRef.dispose()}catch(e){console.warn("[NotificationOverlayService] dispose failed",e)}finally{this.overlayRef=null}}toggle(e){e?this.open():this.close()}isOpen(){return!!this.overlayRef}ngOnDestroy(){try{this.overlayRef&&this.overlayRef.dispose()}catch{}finally{this.overlayRef=null}}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ha(o,t){if(o&1){let e=K();b(0,"button",12),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("toggleFullScreen"))}),b(1,"span",10),M(2,"fullscreen"),T()()}}function _a(o,t){if(o&1){let e=K();b(0,"button",12),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("toggleFullScreen"))}),b(1,"span",10),M(2,"close_fullscreen"),T()()}}function ga(o,t){if(o&1&&$(0,ha,3,0,"button",11)(1,_a,3,0,"button",11),o&2){let e=L();U(e.uiEvent.fullscreenStatus()?1:0)}}function ya(o,t){if(o&1){let e=K();b(0,"button",14),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("nightMode"))}),b(1,"span",10),M(2,"mode_night"),T()()}}function va(o,t){if(o&1){let e=K();b(0,"button",14),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("nightMode"))}),b(1,"span",10),M(2,"light_mode"),T()()}}function ba(o,t){if(o&1&&$(0,ya,3,0,"button",13)(1,va,3,0,"button",13),o&2){let e=L();U(e.app.isNightMode()?1:0)}}function Sa(o,t){if(o&1){let e=K();b(0,"tile-large-icon",15,1),F("click",function(){let r=I(e).$index,s=L();return D(s.navigateToDashboard(r))}),T()}if(o&2){let e=t.$implicit;ue("active",e.active)("svgIcon",e.svgIcon)("iconSize",e.iconSize)("label",e.label)}}var Or=(()=>{class o{actionsSidenav=wi.required();_router=y(ye);uiEvent=y(Ot);dashboard=y(Re);app=y(Ct);_settings=y(de);isAutoNightMode=te(this._settings.getAutoNightModeAsO(),{requireSync:!0});_initialDashboardMatch=(()=>{let n=this._router.parseUrl(this._router.url).root.children.primary,r=n?n.segments.map(s=>s.path):[];return r.length===0||r[0]==="dashboard"||r[0]==="chartplotter"})();isDashboardContext=te(this._router.events.pipe(dt(e=>e instanceof Tt),oi(null),xe(()=>{let n=this._router.parseUrl(this._router.url).root.children.primary,r=n?n.segments.map(s=>s.path):[];return r.length===0||r[0]==="dashboard"||r[0]==="chartplotter"}),ri()),{initialValue:this._initialDashboardMatch});menuItems=Si(()=>{let e=this.dashboard.dashboards(),n=this.dashboard.activeDashboard();return e.map((r,s)=>({id:Number(r.id),active:s===n,pinned:!1,svgIcon:r.icon||"dashboard-dashboard",iconSize:60,label:r.name||`Dashboard ${s+1}`}))});ngAfterViewInit(){this.uiEvent.addHotkeyListener((e,n)=>this.handleKeyDown(e,n),{ctrlKey:!0,shiftKey:!0,keys:["e","f","n"]})}ngOnDestroy(){this.uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(e,n){switch(e){case"e":this.onActionItem("layout");break;case"f":this.onActionItem("toggleFullScreen");break;case"n":this.onActionItem("nightMode");break;default:break}}onActionItem(e){switch(this.actionsSidenav().close(),e){case"toggleFullScreen":this.uiEvent.toggleFullScreen();break;case"settings":this._router.navigate(["/settings"]);break;case"layout":this.dashboard.setStaticDashboard(!1);break;case"nightMode":this.app.isNightMode.set(!this.app.isNightMode()),this.app.toggleDayNightMode();break;default:break}}navigateToDashboard(e){this.actionsSidenav().close(),this._router.navigate([`dashboard/${e}`])}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["menu-actions"]],inputs:{actionsSidenav:[1,"actionsSidenav"]},decls:14,vars:3,consts:[["tileContainer",""],["tile",""],[1,"actions-container"],[1,"actions-top-container"],["mat-flat-button","","tabindex","0",1,"action-button","home-btn",3,"click"],["height","24px","width","24px","svgIcon","kip","aria-hidden","false",1,"home-icon",2,"height","24px","width","24px"],[1,"menu-item-container"],["tabindex","0",3,"active","svgIcon","iconSize","label"],[1,"actions-bottom-container"],["mat-flat-button","",1,"action-button",2,"width","135px",3,"click","disabled"],[1,"material-icons"],["mat-flat-button","","tabindex","0",1,"action-button"],["mat-flat-button","","tabindex","0",1,"action-button",3,"click"],["mat-flat-button","",1,"action-button"],["mat-flat-button","",1,"action-button",3,"click"],["tabindex","0",3,"click","active","svgIcon","iconSize","label"]],template:function(n,r){if(n&1){let s=K();b(0,"div",2)(1,"div",3),$(2,ga,2,1),$(3,ba,2,1),b(4,"button",4),F("click",function(){return I(s),D(r.onActionItem("settings"))}),ee(5,"mat-icon",5),T()(),b(6,"div",6,0),Oe(8,Sa,2,4,"tile-large-icon",7,gt),T(),b(10,"div",8)(11,"button",9),F("click",function(){return I(s),D(r.onActionItem("layout"))}),b(12,"span",10),M(13,"lock_open"),T()()()()}n&2&&(x(2),U(r.uiEvent.fullscreenSupported()?2:-1),x(),U(r.isAutoNightMode()?-1:3),x(5),Ie(r.menuItems()),x(3),ue("disabled",!r.isDashboardContext()))},dependencies:[ve,Fe,pe,Ke,ur],styles:[".actions-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:135px}.actions-top-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.actions-bottom-container[_ngcontent-%COMP%]{height:48px;width:100%}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;flex:1 1 48px;min-height:0;overflow:hidden;border:1px solid var(--mat-sidenav-container-background-color, var(--mat-sys-surface))}.home-btn[_ngcontent-%COMP%]{--mat-icon-button-icon-size: 24px;--mat-button-filled-icon-offset: 0px;--mat-button-filled-icon-spacing: 0px;--mat-button-filled-label-text-size: 0px}.home-icon[_ngcontent-%COMP%] .mat-mdc-unelevated-button[_ngcontent-%COMP%] > .mat-icon[_ngcontent-%COMP%]{font-size:0px}.full-size[_ngcontent-%COMP%]{width:135px}.menu-item-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;padding:3px 1px;gap:5px;width:135px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}"]})}return o})();var wa=["upgradeMessages"];function Aa(o,t){if(o&1&&(b(0,"li"),M(1),T()),o&2){let e=t.$implicit;x(),je(e)}}function Ta(o,t){if(o&1&&(b(0,"ul",11,1),Oe(2,Aa,2,1,"li",null,gt),T()),o&2){let e=L(2);x(2),Ie(e.upgrade.messages())}}function Ea(o,t){if(o&1&&(b(0,"div",7)(1,"div",8),ee(2,"mat-progress-spinner",9),b(3,"div",10)(4,"h3"),M(5,"Upgrading Configuration\u2026"),T(),b(6,"p"),M(7,"Please wait a moment while we migrate your dashboards and widgets."),T(),$(8,Ta,4,0,"ul",11),T()()()),o&2){let e=L();x(8),U(e.upgrade.messages().length?8:-1)}}var Dr=(()=>{class o{_snackBar=y(Er);_deltaService=y(Be);_connectionStateMachine=y(De);_app=y(Ct);_dashboard=y(Re);_notifications=y(be);_uiEvent=y(Ot);_dialog=y(rr);appSettingsService=y(de);authenticationService=y(ge);_dataSet=y(Nt);_responsive=y(kt);_destroyRef=y(li);_notificationOverlay=y(xr);_router=y(ye);upgrade=y(ir);upgradeMessagesRef=St("upgradeMessages");notificationHowl;_upgradeShown=!1;actionsSidenavOpened=fn(!1);notificationsSidenavOpened=fn(!1);notificationsInfo=te(this._notifications.observerNotificationsInfo());dashboardVisible=ci(!1);isPhonePortrait;scheduledOpen=null;OPEN_DELAY_MS=300;_swipeLeftHandler=()=>this.onSwipeLeft();_swipeRightHandler=()=>this.onSwipeRight();_hotkeyHandler=e=>this.handleKeyDown(e);constructor(){Ge(()=>{if(this.appSettingsService.configUpgrade()){let e=this.appSettingsService.getConfigVersion();e===11&&this.upgrade.runUpgrade(e),e||this._upgradeShown||(this._upgradeShown=!0,this._dialog.openFrameDialog({title:"Upgrade Instructions",component:"upgrade-config"},!0).pipe(Xe(this._destroyRef)).subscribe())}}),Ge(()=>{let e=this.upgrade.messages();if(this.upgrade.upgrading()&&e.length&&this.upgradeMessagesRef()){let n=this.upgradeMessagesRef().nativeElement;n.scrollTop=n.scrollHeight}});try{this.dashboardVisible.set(this.isUrlDashboard(this._router.url))}catch{}this._router.events.pipe(dt(e=>e instanceof Tt),Xe(this._destroyRef)).subscribe(e=>{try{this.dashboardVisible.set(this.isUrlDashboard(e.urlAfterRedirects||e.url))}catch{}}),Ge(()=>{let e=this.dashboardVisible()&&this._dashboard.isDashboardStatic()&&this.notificationsInfo().alarmCount>0;if(this.notificationsSidenavOpened()){this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch{}return}if(e){if(this.scheduledOpen)return;this.scheduledOpen=window.setTimeout(()=>{this.scheduledOpen=null;try{this._notificationOverlay.open()}catch{}},this.OPEN_DELAY_MS)}else{this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch{}}}),Ge(()=>{if(this.notificationsSidenavOpened())try{this._notificationOverlay.close()}catch{}}),this.isPhonePortrait=te(this._responsive.observe(Mt.HandsetPortrait)),this._connectionStateMachine.status$.pipe(Xe(this._destroyRef)).subscribe(e=>this.displayConnectionsStatusNotification(e)),this._app.getSnackbarAppNotifications().pipe(Xe(this._destroyRef)).subscribe(e=>{this._snackBar.open(e.message,e.action,{duration:e.duration,verticalPosition:"top"}),!this.appSettingsService.getNotificationConfig().sound.disableSound&&!e.silent&&(this.notificationHowl||(this.notificationHowl=new Ir.Howl({src:["assets/notification.mp3"],preload:!0,volume:.3})),this.notificationHowl.stop(),this.notificationHowl.play())})}isUrlDashboard(e){if(!e)return!1;let n=e.split("?")[0].replace(/\/+$/,"");return n==="/dashboard"||/^\/dashboard(\/\d+)?$/.test(n)||n==="/"}ngOnInit(){this._uiEvent.addGestureListeners(this._swipeLeftHandler,this._swipeRightHandler)}ngAfterViewInit(){this._uiEvent.addHotkeyListener(this._hotkeyHandler,{ctrlKey:!0,keys:["arrowright","arrowleft"]})}handleKeyDown(e){switch(e){case"arrowright":this.onSwipeRight();break;case"arrowleft":this.onSwipeLeft();break;case"escape":this.backdropClicked();break}}escapeKeyPressed(e){e=e.toLowerCase(),e==="escape"&&this.backdropClicked()}displayConnectionsStatusNotification(e){let n=e.message;switch(e.operation){case 0:this._app.sendSnackbarNotification(n,5e3,!0);break;case 1:case 2:break;case 3:this._app.sendSnackbarNotification(n,3e3,!1,"");break;case 4:this._app.sendSnackbarNotification(n,3e3,!0,"");break;case 5:this._app.sendSnackbarNotification(n,0,!1);break;default:console.error("[AppComponent] Unknown operation code:",e.operation),this._app.sendSnackbarNotification(`Unknown connection status: ${e.state}`,0,!1)}}onSwipeRight(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.set(!0)):(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.update(e=>!e)))}backdropClicked(){this.notificationsSidenavOpened.update(e=>e?!e:!1),this.actionsSidenavOpened.update(e=>e?!e:!1)}onSwipeLeft(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.set(!0)):(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.update(e=>!e)))}ngOnDestroy(){this._uiEvent.removeGestureListeners(this._swipeLeftHandler,this._swipeRightHandler),this._uiEvent.removeHotkeyListener(this._hotkeyHandler),this.notificationHowl?.unload(),this.notificationHowl=void 0,this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["app-root"]],viewQuery:function(n,r){n&1&&yt(r.upgradeMessagesRef,wa,5),n&2&&vt()},inputs:{actionsSidenavOpened:[1,"actionsSidenavOpened"],notificationsSidenavOpened:[1,"notificationsSidenavOpened"]},outputs:{actionsSidenavOpened:"actionsSidenavOpenedChange",notificationsSidenavOpened:"notificationsSidenavOpenedChange"},decls:9,vars:6,consts:[["actionsSidenav",""],["upgradeMessages",""],["kipGestures","",1,"sidenav-container",3,"swipeleft","swiperight","backdropClick","mode","bridgeUiEvents"],["mode","over","position","start","autoFocus","true","disableClose","",1,"sidenav-notifications",3,"openedChange","keydown","opened"],["mode","over","position","end","autoFocus","true","disableClose","",1,"sidenav-actions",3,"openedChange","keydown","opened"],[3,"actionsSidenav"],[1,"router-outlet-container"],["role","alert","aria-live","polite",1,"config-upgrade-overlay"],[1,"config-upgrade-card"],["diameter","46","mode","indeterminate"],[1,"config-upgrade-text"],[1,"config-upgrade-messages"]],template:function(n,r){if(n&1){let s=K();b(0,"mat-sidenav-container",2),F("swipeleft",function(){return I(s),D(r.onSwipeLeft())})("swiperight",function(){return I(s),D(r.onSwipeRight())})("backdropClick",function(){return I(s),D(r.backdropClicked())}),b(1,"mat-sidenav",3),dn("openedChange",function(u){return I(s),un(r.notificationsSidenavOpened,u)||(r.notificationsSidenavOpened=u),D(u)}),F("keydown",function(u){return I(s),D(r.escapeKeyPressed(u.key))}),ee(2,"menu-notifications"),T(),b(3,"mat-sidenav",4,0),dn("openedChange",function(u){return I(s),un(r.actionsSidenavOpened,u)||(r.actionsSidenavOpened=u),D(u)}),F("keydown",function(u){return I(s),D(r.escapeKeyPressed(u.key))}),ee(5,"menu-actions",5),T(),b(6,"mat-sidenav-content"),ee(7,"router-outlet",6),T()(),$(8,Ea,9,1,"div",7)}if(n&2){let s=yi(4);ue("mode","horizontal")("bridgeUiEvents",!0),x(),cn("opened",r.notificationsSidenavOpened),x(2),cn("opened",r.actionsSidenavOpened),x(2),ue("actionsSidenav",s),x(3),U(r.upgrade.upgrading()?8:-1)}},dependencies:[Pr,Or,pe,Sr,ve,Li,Di,gr,hr,_r,pr,Ti,gn,vr,yr],styles:[".sidenav-container[_ngcontent-%COMP%]{height:100%;width:100%}mat-sidenav-content[_ngcontent-%COMP%]{overflow-y:hidden;overflow-x:hidden}mat-sidenav.sidenav-notifications[_ngcontent-%COMP%]{width:230px;z-index:1200}mat-sidenav.sidenav-actions[_ngcontent-%COMP%]{width:135px;z-index:1200;overflow-x:hidden}.config-upgrade-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#00000073;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:2000;pointer-events:all}.config-upgrade-card[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:18px;padding:20px 24px;width:clamp(300px,60vw,640px);background:var(--kip-background, #1f1f1f);border:1px solid rgba(255,255,255,.18);border-radius:14px;color:var(--kip-contrast-color, #fff);box-shadow:0 6px 22px #0000008c}.config-upgrade-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:1.05rem;font-weight:600;letter-spacing:.5px}.config-upgrade-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 10px;font-size:.8rem;opacity:.85}.config-upgrade-messages[_ngcontent-%COMP%]{list-style:disc;margin:0;padding-left:18px;max-height:180px;font-size:.68rem;line-height:1.25;scrollbar-width:thin;overflow-y:auto}.config-upgrade-messages[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:2px}"]})}return o})();function Rr(o){return new N(3e3,!1)}function ka(){return new N(3100,!1)}function Ca(){return new N(3101,!1)}function Ma(o){return new N(3001,!1)}function Pa(o){return new N(3003,!1)}function Na(o){return new N(3004,!1)}function Lr(o,t){return new N(3005,!1)}function Br(){return new N(3006,!1)}function Vr(){return new N(3007,!1)}function Kr(o,t){return new N(3008,!1)}function zr(o){return new N(3002,!1)}function Hr(o,t,e,n,r){return new N(3010,!1)}function qr(){return new N(3011,!1)}function $r(){return new N(3012,!1)}function Ur(){return new N(3200,!1)}function jr(){return new N(3202,!1)}function Qr(){return new N(3013,!1)}function Gr(o){return new N(3014,!1)}function Wr(o){return new N(3015,!1)}function Xr(o){return new N(3016,!1)}function Yr(o,t){return new N(3404,!1)}function xa(o){return new N(3502,!1)}function Zr(o){return new N(3503,!1)}function Jr(){return new N(3300,!1)}function eo(o){return new N(3504,!1)}function to(o){return new N(3301,!1)}function no(o,t){return new N(3302,!1)}function io(o){return new N(3303,!1)}function ro(o,t){return new N(3400,!1)}function oo(o){return new N(3401,!1)}function ao(o){return new N(3402,!1)}function so(o,t){return new N(3505,!1)}function he(o){switch(o.length){case 0:return new Ee;case 1:return o[0];default:return new Et(o)}}function En(o,t,e=new Map,n=new Map){let r=[],s=[],l=-1,u=null;if(t.forEach(d=>{let _=d.get("offset"),i=_==l,a=i&&u||new Map;d.forEach((c,f)=>{let m=f,h=c;if(f!=="offset")switch(m=o.normalizePropertyName(m,r),h){case Ye:h=e.get(f);break;case ne:h=n.get(f);break;default:h=o.normalizeStyleValue(f,m,h,r);break}a.set(m,h)}),i||s.push(a),u=a,l=_}),r.length)throw xa(r);return s}function Dt(o,t,e,n){switch(t){case"start":o.onStart(()=>n(e&&wn(e,"start",o)));break;case"done":o.onDone(()=>n(e&&wn(e,"done",o)));break;case"destroy":o.onDestroy(()=>n(e&&wn(e,"destroy",o)));break}}function wn(o,t,e){let n=e.totalTime,r=!!e.disabled,s=Rt(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,n??o.totalTime,r),l=o._data;return l!=null&&(s._data=l),s}function Rt(o,t,e,n,r="",s=0,l){return{element:o,triggerName:t,fromState:e,toState:n,phaseName:r,totalTime:s,disabled:!!l}}function j(o,t,e){let n=o.get(t);return n||o.set(t,n=e),n}function kn(o){let t=o.indexOf(":"),e=o.substring(1,t),n=o.slice(t+1);return[e,n]}var Oa=typeof document>"u"?null:document.documentElement;function Ft(o){let t=o.parentNode||o.host||null;return t===Oa?null:t}function Ia(o){return o.substring(1,6)=="ebkit"}var Ce=null,Fr=!1;function lo(o){Ce||(Ce=Da()||{},Fr=Ce.style?"WebkitAppearance"in Ce.style:!1);let t=!0;return Ce.style&&!Ia(o)&&(t=o in Ce.style,!t&&Fr&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in Ce.style)),t}function Da(){return typeof document<"u"?document.body:null}function Cn(o,t){for(;t;){if(t===o)return!0;t=Ft(t)}return!1}function Mn(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let n=o.querySelector(t);return n?[n]:[]}var Ra=1e3,Pn="{{",Fa="}}",Nn="ng-enter",Lt="ng-leave",et="ng-trigger",tt=".ng-trigger",xn="ng-animating",Bt=".ng-animating";function fe(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:An(parseFloat(t[1]),t[2])}function An(o,t){switch(t){case"s":return o*Ra;default:return o}}function nt(o,t,e){return o.hasOwnProperty("duration")?o:Ba(o,t,e)}var La=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Ba(o,t,e){let n,r=0,s="";if(typeof o=="string"){let l=o.match(La);if(l===null)return t.push(Rr(o)),{duration:0,delay:0,easing:""};n=An(parseFloat(l[1]),l[2]);let u=l[3];u!=null&&(r=An(parseFloat(u),l[4]));let d=l[5];d&&(s=d)}else n=o;if(!e){let l=!1,u=t.length;n<0&&(t.push(ka()),l=!0),r<0&&(t.push(Ca()),l=!0),l&&t.splice(u,0,Rr(o))}return{duration:n,delay:r,easing:s}}function co(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function re(o,t,e){t.forEach((n,r)=>{let s=Vt(r);e&&!e.has(r)&&e.set(r,o.style[s]),o.style[s]=n})}function Se(o,t){t.forEach((e,n)=>{let r=Vt(n);o.style[r]=""})}function He(o){return Array.isArray(o)?o.length==1?o[0]:Bi(o):o}function uo(o,t,e){let n=t.params||{},r=On(o);r.length&&r.forEach(s=>{n.hasOwnProperty(s)||e.push(Ma(s))})}var Tn=new RegExp(`${Pn}\\s*(.+?)\\s*${Fa}`,"g");function On(o){let t=[];if(typeof o=="string"){let e;for(;e=Tn.exec(o);)t.push(e[1]);Tn.lastIndex=0}return t}function qe(o,t,e){let n=`${o}`,r=n.replace(Tn,(s,l)=>{let u=t[l];return u==null&&(e.push(Pa(l)),u=""),u.toString()});return r==n?o:r}var Va=/-+([a-z0-9])/g;function Vt(o){return o.replace(Va,(...t)=>t[1].toUpperCase())}function fo(o,t){return o===0||t===0}function mo(o,t,e){if(e.size&&t.length){let n=t[0],r=[];if(e.forEach((s,l)=>{n.has(l)||r.push(l),n.set(l,s)}),r.length)for(let s=1;s<t.length;s++){let l=t[s];r.forEach(u=>l.set(u,Kt(o,u)))}}return t}function Q(o,t,e){switch(t.type){case k.Trigger:return o.visitTrigger(t,e);case k.State:return o.visitState(t,e);case k.Transition:return o.visitTransition(t,e);case k.Sequence:return o.visitSequence(t,e);case k.Group:return o.visitGroup(t,e);case k.Animate:return o.visitAnimate(t,e);case k.Keyframes:return o.visitKeyframes(t,e);case k.Style:return o.visitStyle(t,e);case k.Reference:return o.visitReference(t,e);case k.AnimateChild:return o.visitAnimateChild(t,e);case k.AnimateRef:return o.visitAnimateRef(t,e);case k.Query:return o.visitQuery(t,e);case k.Stagger:return o.visitStagger(t,e);default:throw Na(t.type)}}function Kt(o,t){return window.getComputedStyle(o)[t]}var Wn=(()=>{class o{validateStyleProperty(e){return lo(e)}containsElement(e,n){return Cn(e,n)}getParentElement(e){return Ft(e)}query(e,n,r){return Mn(e,n,r)}computeStyle(e,n,r){return r||""}animate(e,n,r,s,l,u=[],d){return new Ee(r,s)}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})(),Pe=class{static NOOP=new Wn},Ne=class{};var Ka=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Ut=class extends Ne{normalizePropertyName(t,e){return Vt(t)}normalizeStyleValue(t,e,n,r){let s="",l=n.toString().trim();if(Ka.has(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let u=n.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&r.push(Lr(t,n))}return l+s}};var jt="*";function za(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(n=>Ha(n,e,t)):e.push(o),e}function Ha(o,t,e){if(o[0]==":"){let d=qa(o,e);if(typeof d=="function"){t.push(d);return}o=d}let n=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return e.push(Wr(o)),t;let r=n[1],s=n[2],l=n[3];t.push(po(r,l));let u=r==jt&&l==jt;s[0]=="<"&&!u&&t.push(po(l,r))}function qa(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,n)=>parseFloat(n)>parseFloat(e);case":decrement":return(e,n)=>parseFloat(n)<parseFloat(e);default:return t.push(Xr(o)),"* => *"}}var zt=new Set(["true","1"]),Ht=new Set(["false","0"]);function po(o,t){let e=zt.has(o)||Ht.has(o),n=zt.has(t)||Ht.has(t);return(r,s)=>{let l=o==jt||o==r,u=t==jt||t==s;return!l&&e&&typeof r=="boolean"&&(l=r?zt.has(o):Ht.has(o)),!u&&n&&typeof s=="boolean"&&(u=s?zt.has(t):Ht.has(t)),l&&u}}var To=":self",$a=new RegExp(`s*${To}s*,?`,"g");function Eo(o,t,e,n){return new Bn(o).build(t,e,n)}var ho="",Bn=class{_driver;constructor(t){this._driver=t}build(t,e,n){let r=new Vn(e);return this._resetContextStyleTimingState(r),Q(this,He(t),r)}_resetContextStyleTimingState(t){t.currentQuerySelector=ho,t.collectedStyles=new Map,t.collectedStyles.set(ho,new Map),t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,r=e.depCount=0,s=[],l=[];return t.name.charAt(0)=="@"&&e.errors.push(Br()),t.definitions.forEach(u=>{if(this._resetContextStyleTimingState(e),u.type==k.State){let d=u,_=d.name;_.toString().split(/\s*,\s*/).forEach(i=>{d.name=i,s.push(this.visitState(d,e))}),d.name=_}else if(u.type==k.Transition){let d=this.visitTransition(u,e);n+=d.queryCount,r+=d.depCount,l.push(d)}else e.errors.push(Vr())}),{type:k.Trigger,name:t.name,states:s,transitions:l,queryCount:n,depCount:r,options:null}}visitState(t,e){let n=this.visitStyle(t.styles,e),r=t.options&&t.options.params||null;if(n.containsDynamicStyles){let s=new Set,l=r||{};n.styles.forEach(u=>{u instanceof Map&&u.forEach(d=>{On(d).forEach(_=>{l.hasOwnProperty(_)||s.add(_)})})}),s.size&&e.errors.push(Kr(t.name,[...s.values()]))}return{type:k.State,name:t.name,style:n,options:r?{params:r}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let n=Q(this,He(t.animation),e),r=za(t.expr,e.errors);return{type:k.Transition,matchers:r,animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Me(t.options)}}visitSequence(t,e){return{type:k.Sequence,steps:t.steps.map(n=>Q(this,n,e)),options:Me(t.options)}}visitGroup(t,e){let n=e.currentTime,r=0,s=t.steps.map(l=>{e.currentTime=n;let u=Q(this,l,e);return r=Math.max(r,e.currentTime),u});return e.currentTime=r,{type:k.Group,steps:s,options:Me(t.options)}}visitAnimate(t,e){let n=Ga(t.timings,e.errors);e.currentAnimateTimings=n;let r,s=t.styles?t.styles:pn({});if(s.type==k.Keyframes)r=this.visitKeyframes(s,e);else{let l=t.styles,u=!1;if(!l){u=!0;let _={};n.easing&&(_.easing=n.easing),l=pn(_)}e.currentTime+=n.duration+n.delay;let d=this.visitStyle(l,e);d.isEmptyStep=u,r=d}return e.currentAnimateTimings=null,{type:k.Animate,timings:n,style:r,options:null}}visitStyle(t,e){let n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){let n=[],r=Array.isArray(t.styles)?t.styles:[t.styles];for(let u of r)typeof u=="string"?u===ne?n.push(u):e.errors.push(zr(u)):n.push(new Map(Object.entries(u)));let s=!1,l=null;return n.forEach(u=>{if(u instanceof Map&&(u.has("easing")&&(l=u.get("easing"),u.delete("easing")),!s)){for(let d of u.values())if(d.toString().indexOf(Pn)>=0){s=!0;break}}}),{type:k.Style,styles:n,easing:l,offset:t.offset,containsDynamicStyles:s,options:null}}_validateStyleAst(t,e){let n=e.currentAnimateTimings,r=e.currentTime,s=e.currentTime;n&&s>0&&(s-=n.duration+n.delay),t.styles.forEach(l=>{typeof l!="string"&&l.forEach((u,d)=>{let _=e.collectedStyles.get(e.currentQuerySelector),i=_.get(d),a=!0;i&&(s!=r&&s>=i.startTime&&r<=i.endTime&&(e.errors.push(Hr(d,i.startTime,i.endTime,s,r)),a=!1),s=i.startTime),a&&_.set(d,{startTime:s,endTime:r}),e.options&&uo(u,e.options,e.errors)})})}visitKeyframes(t,e){let n={type:k.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(qr()),n;let r=1,s=0,l=[],u=!1,d=!1,_=0,i=t.steps.map(g=>{let w=this._makeStyleAst(g,e),C=w.offset!=null?w.offset:Qa(w.styles),O=0;return C!=null&&(s++,O=w.offset=C),d=d||O<0||O>1,u=u||O<_,_=O,l.push(O),w});d&&e.errors.push($r()),u&&e.errors.push(Ur());let a=t.steps.length,c=0;s>0&&s<a?e.errors.push(jr()):s==0&&(c=r/(a-1));let f=a-1,m=e.currentTime,h=e.currentAnimateTimings,p=h.duration;return i.forEach((g,w)=>{let C=c>0?w==f?1:c*w:l[w],O=C*p;e.currentTime=m+h.delay+O,h.duration=O,this._validateStyleAst(g,e),g.offset=C,n.styles.push(g)}),n}visitReference(t,e){return{type:k.Reference,animation:Q(this,He(t.animation),e),options:Me(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:k.AnimateChild,options:Me(t.options)}}visitAnimateRef(t,e){return{type:k.AnimateRef,animation:this.visitReference(t.animation,e),options:Me(t.options)}}visitQuery(t,e){let n=e.currentQuerySelector,r=t.options||{};e.queryCount++,e.currentQuery=t;let[s,l]=Ua(t.selector);e.currentQuerySelector=n.length?n+" "+s:s,j(e.collectedStyles,e.currentQuerySelector,new Map);let u=Q(this,He(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:k.Query,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:l,animation:u,originalSelector:t.selector,options:Me(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(Qr());let n=t.timings==="full"?{duration:0,delay:0,easing:"full"}:nt(t.timings,e.errors,!0);return{type:k.Stagger,animation:Q(this,He(t.animation),e),timings:n,options:null}}};function Ua(o){let t=!!o.split(/\s*,\s*/).find(e=>e==To);return t&&(o=o.replace($a,"")),o=o.replace(/@\*/g,tt).replace(/@\w+/g,e=>tt+"-"+e.slice(1)).replace(/:animating/g,Bt),[o,t]}function ja(o){return o?X({},o):null}var Vn=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(t){this.errors=t}};function Qa(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let n=e;t=parseFloat(n.get("offset")),n.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function Ga(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let s=nt(o,t).duration;return In(s,0,"")}let e=o;if(e.split(/\s+/).some(s=>s.charAt(0)=="{"&&s.charAt(1)=="{")){let s=In(0,0,"");return s.dynamic=!0,s.strValue=e,s}let r=nt(e,t);return In(r.duration,r.delay,r.easing)}function Me(o){return o?(o=X({},o),o.params&&(o.params=ja(o.params))):o={},o}function In(o,t,e){return{duration:o,delay:t,easing:e}}function Xn(o,t,e,n,r,s,l=null,u=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:n,duration:r,delay:s,totalTime:r+s,easing:l,subTimeline:u}}var rt=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},Wa=1,Xa=":enter",Ya=new RegExp(Xa,"g"),Za=":leave",Ja=new RegExp(Za,"g");function ko(o,t,e,n,r,s=new Map,l=new Map,u,d,_=[]){return new Kn().buildKeyframes(o,t,e,n,r,s,l,u,d,_)}var Kn=class{buildKeyframes(t,e,n,r,s,l,u,d,_,i=[]){_=_||new rt;let a=new zn(t,e,_,r,s,i,[]);a.options=d;let c=d.delay?fe(d.delay):0;a.currentTimeline.delayNextStep(c),a.currentTimeline.setStyles([l],null,a.errors,d),Q(this,n,a);let f=a.timelines.filter(m=>m.containsAnimation());if(f.length&&u.size){let m;for(let h=f.length-1;h>=0;h--){let p=f[h];if(p.element===e){m=p;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([u],null,a.errors,d)}return f.length?f.map(m=>m.buildKeyframes()):[Xn(e,[],[],[],0,c,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let n=e.subInstructions.get(e.element);if(n){let r=e.createSubContext(t.options),s=e.currentTimeline.currentTime,l=this._visitSubInstructions(n,r,r.options);s!=l&&e.transformIntoNewTimeline(l)}e.previousNode=t}visitAnimateRef(t,e){let n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,n),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,n){for(let r of t){let s=r?.delay;if(s){let l=typeof s=="number"?s:fe(qe(s,r?.params??{},e.errors));n.delayNextStep(l)}}}_visitSubInstructions(t,e,n){let s=e.currentTimeline.currentTime,l=n.duration!=null?fe(n.duration):null,u=n.delay!=null?fe(n.delay):null;return l!==0&&t.forEach(d=>{let _=e.appendInstructionToTimeline(d,l,u);s=Math.max(s,_.duration+_.delay)}),s}visitReference(t,e){e.updateOptions(t.options,!0),Q(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let n=e.subContextCount,r=e,s=t.options;if(s&&(s.params||s.delay)&&(r=e.createSubContext(s),r.transformIntoNewTimeline(),s.delay!=null)){r.previousNode.type==k.Style&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=Qt);let l=fe(s.delay);r.delayNextStep(l)}t.steps.length&&(t.steps.forEach(l=>Q(this,l,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>n&&r.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let n=[],r=e.currentTimeline.currentTime,s=t.options&&t.options.delay?fe(t.options.delay):0;t.steps.forEach(l=>{let u=e.createSubContext(t.options);s&&u.delayNextStep(s),Q(this,l,u),r=Math.max(r,u.currentTimeline.currentTime),n.push(u.currentTimeline)}),n.forEach(l=>e.currentTimeline.mergeTimelineCollectedStyles(l)),e.transformIntoNewTimeline(r),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let n=t.strValue,r=e.params?qe(n,e.params,e.errors):n;return nt(r,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let n=e.currentAnimateTimings=this._visitTiming(t.timings,e),r=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),r.snapshotCurrentStyles());let s=t.style;s.type==k.Keyframes?this.visitKeyframes(s,e):(e.incrementTime(n.duration),this.visitStyle(s,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let n=e.currentTimeline,r=e.currentAnimateTimings;!r&&n.hasCurrentStyleProperties()&&n.forwardFrame();let s=r&&r.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(s):n.setStyles(t.styles,s,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let n=e.currentAnimateTimings,r=e.currentTimeline.duration,s=n.duration,u=e.createSubContext().currentTimeline;u.easing=n.easing,t.styles.forEach(d=>{let _=d.offset||0;u.forwardTime(_*s),u.setStyles(d.styles,d.easing,e.errors,e.options),u.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(u),e.transformIntoNewTimeline(r+s),e.previousNode=t}visitQuery(t,e){let n=e.currentTimeline.currentTime,r=t.options||{},s=r.delay?fe(r.delay):0;s&&(e.previousNode.type===k.Style||n==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Qt);let l=n,u=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!r.optional,e.errors);e.currentQueryTotal=u.length;let d=null;u.forEach((_,i)=>{e.currentQueryIndex=i;let a=e.createSubContext(t.options,_);s&&a.delayNextStep(s),_===e.element&&(d=a.currentTimeline),Q(this,t.animation,a),a.currentTimeline.applyStylesToKeyframe();let c=a.currentTimeline.currentTime;l=Math.max(l,c)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(l),d&&(e.currentTimeline.mergeTimelineCollectedStyles(d),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let n=e.parentContext,r=e.currentTimeline,s=t.timings,l=Math.abs(s.duration),u=l*(e.currentQueryTotal-1),d=l*e.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":d=u-d;break;case"full":d=n.currentStaggerTime;break}let i=e.currentTimeline;d&&i.delayNextStep(d);let a=i.currentTime;Q(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=r.currentTime-a+(r.startTime-n.currentTimeline.startTime)}},Qt={},zn=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Qt;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,n,r,s,l,u,d){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=s,this.errors=l,this.timelines=u,this.currentTimeline=d||new Gt(this._driver,e,0),u.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let n=t,r=this.options;n.duration!=null&&(r.duration=fe(n.duration)),n.delay!=null&&(r.delay=fe(n.delay));let s=n.params;if(s){let l=r.params;l||(l=this.options.params={}),Object.keys(s).forEach(u=>{(!e||!l.hasOwnProperty(u))&&(l[u]=qe(s[u],l,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let n=t.params={};Object.keys(e).forEach(r=>{n[r]=e[r]})}}return t}createSubContext(t=null,e,n){let r=e||this.element,s=new o(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,n||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(t),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(t){return this.previousNode=Qt,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){let r={duration:e??t.duration,delay:this.currentTimeline.currentTime+(n??0)+t.delay,easing:""},s=new Hn(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,r,t.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,r,s,l){let u=[];if(r&&u.push(this.element),t.length>0){t=t.replace(Ya,"."+this._enterClassName),t=t.replace(Ja,"."+this._leaveClassName);let d=n!=1,_=this._driver.query(this.element,t,d);n!==0&&(_=n<0?_.slice(_.length+n,_.length):_.slice(0,n)),u.push(..._)}return!s&&u.length==0&&l.push(Gr(e)),u}},Gt=class o{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(t,e,n,r){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=r,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=Wa,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,n]of this._globalTimelineStyles)this._backFill.set(e,n||ne),this._currentKeyframe.set(e,ne);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,r){e&&this._previousKeyframe.set("easing",e);let s=r&&r.params||{},l=es(t,this._globalTimelineStyles);for(let[u,d]of l){let _=qe(d,s,n);this._pendingStyles.set(u,_),this._localTimelineStyles.has(u)||this._backFill.set(u,this._globalTimelineStyles.get(u)??ne),this._updateStyle(u,_)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,n)=>{let r=this._styleSummary.get(n);(!r||e.time>r.time)&&this._updateStyle(n,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,n=this._keyframes.size===1&&this.duration===0,r=[];this._keyframes.forEach((u,d)=>{let _=new Map([...this._backFill,...u]);_.forEach((i,a)=>{i===Ye?t.add(a):i===ne&&e.add(a)}),n||_.set("offset",d/this.duration),r.push(_)});let s=[...t.values()],l=[...e.values()];if(n){let u=r[0],d=new Map(u);u.set("offset",0),d.set("offset",1),r=[u,d]}return Xn(this.element,r,s,l,this.duration,this.startTime,this.easing,!1)}},Hn=class extends Gt{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,n,r,s,l,u=!1){super(t,e,l.delay),this.keyframes=n,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=u,this.timings={duration:l.duration,delay:l.delay,easing:l.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:r}=this.timings;if(this._stretchStartingKeyframe&&e){let s=[],l=n+e,u=e/l,d=new Map(t[0]);d.set("offset",0),s.push(d);let _=new Map(t[0]);_.set("offset",_o(u)),s.push(_);let i=t.length-1;for(let a=1;a<=i;a++){let c=new Map(t[a]),f=c.get("offset"),m=e+f*n;c.set("offset",_o(m/l)),s.push(c)}n=l,e=0,r="",t=s}return Xn(this.element,t,this.preStyleProps,this.postStyleProps,n,e,r,!0)}};function _o(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function es(o,t){let e=new Map,n;return o.forEach(r=>{if(r==="*"){n??=t.keys();for(let s of n)e.set(s,ne)}else for(let[s,l]of r)e.set(s,l)}),e}function go(o,t,e,n,r,s,l,u,d,_,i,a,c){return{type:0,element:o,triggerName:t,isRemovalTransition:r,fromState:e,fromStyles:s,toState:n,toStyles:l,timelines:u,queriedElements:d,preStyleProps:_,postStyleProps:i,totalTime:a,errors:c}}var Dn={},Wt=class{_triggerName;ast;_stateStyles;constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,r){return ts(this.ast.matchers,t,e,n,r)}buildStyles(t,e,n){let r=this._stateStyles.get("*");return t!==void 0&&(r=this._stateStyles.get(t?.toString())||r),r?r.buildStyles(e,n):new Map}build(t,e,n,r,s,l,u,d,_,i){let a=[],c=this.ast.options&&this.ast.options.params||Dn,f=u&&u.params||Dn,m=this.buildStyles(n,f,a),h=d&&d.params||Dn,p=this.buildStyles(r,h,a),g=new Set,w=new Map,C=new Map,O=r==="void",G={params:Co(h,c),delay:this.ast.options?.delay},q=i?[]:ko(t,e,this.ast.animation,s,l,m,p,G,_,a),B=0;return q.forEach(E=>{B=Math.max(E.duration+E.delay,B)}),a.length?go(e,this._triggerName,n,r,O,m,p,[],[],w,C,B,a):(q.forEach(E=>{let ae=E.element,me=j(w,ae,new Set);E.preStyleProps.forEach(se=>me.add(se));let st=j(C,ae,new Set);E.postStyleProps.forEach(se=>st.add(se)),ae!==e&&g.add(ae)}),go(e,this._triggerName,n,r,O,m,p,q,[...g.values()],w,C,B))}};function ts(o,t,e,n,r){return o.some(s=>s(t,e,n,r))}function Co(o,t){let e=X({},t);return Object.entries(o).forEach(([n,r])=>{r!=null&&(e[n]=r)}),e}var qn=class{styles;defaultParams;normalizer;constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){let n=new Map,r=Co(t,this.defaultParams);return this.styles.styles.forEach(s=>{typeof s!="string"&&s.forEach((l,u)=>{l&&(l=qe(l,r,e));let d=this.normalizer.normalizePropertyName(u,e);l=this.normalizer.normalizeStyleValue(u,d,l,e),n.set(u,l)})}),n}};function ns(o,t,e){return new $n(o,t,e)}var $n=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,e.states.forEach(r=>{let s=r.options&&r.options.params||{};this.states.set(r.name,new qn(r.style,s,n))}),yo(this.states,"true","1"),yo(this.states,"false","0"),e.transitions.forEach(r=>{this.transitionFactories.push(new Wt(t,r,this.states))}),this.fallbackTransition=is(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,r){return this.transitionFactories.find(l=>l.match(t,e,n,r))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}};function is(o,t,e){let n=[(l,u)=>!0],r={type:k.Sequence,steps:[],options:null},s={type:k.Transition,animation:r,matchers:n,options:null,queryCount:0,depCount:0};return new Wt(o,s,t)}function yo(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var rs=new rt,Un=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n}register(t,e){let n=[],r=[],s=Eo(this._driver,e,n,r);if(n.length)throw Zr(n);this._animations.set(t,s)}_buildPlayer(t,e,n){let r=t.element,s=En(this._normalizer,t.keyframes,e,n);return this._driver.animate(r,s,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){let r=[],s=this._animations.get(t),l,u=new Map;if(s?(l=ko(this._driver,e,s,Nn,Lt,new Map,new Map,n,rs,r),l.forEach(i=>{let a=j(u,i.element,new Map);i.postStyleProps.forEach(c=>a.set(c,null))})):(r.push(Jr()),l=[]),r.length)throw eo(r);u.forEach((i,a)=>{i.forEach((c,f)=>{i.set(f,this._driver.computeStyle(a,f,ne))})});let d=l.map(i=>{let a=u.get(i.element);return this._buildPlayer(i,new Map,a)}),_=he(d);return this._playersById.set(t,_),_.onDestroy(()=>this.destroy(t)),this.players.push(_),_}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw to(t);return e}listen(t,e,n,r){let s=Rt(e,"","","");return Dt(this._getPlayer(t),n,s,r),()=>{}}command(t,e,n,r){if(n=="register"){this.register(t,r[0]);return}if(n=="create"){let l=r[0]||{};this.create(t,e,l);return}let s=this._getPlayer(t);switch(n){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t);break}}},vo="ng-animate-queued",os=".ng-animate-queued",Rn="ng-animate-disabled",as=".ng-animate-disabled",ss="ng-star-inserted",ls=".ng-star-inserted",cs=[],Mo={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},us={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},oe="__ng_removed",ot=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let n=t&&t.hasOwnProperty("value"),r=n?t.value:t;if(this.value=fs(r),n){let s=t,{value:l}=s,u=ei(s,["value"]);this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let n=this.options.params;Object.keys(e).forEach(r=>{n[r]==null&&(n[r]=e[r])})}}},it="void",Fn=new ot(it),jn=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this._hostClassName="ng-tns-"+t,Z(e,this._hostClassName)}listen(t,e,n,r){if(!this._triggers.has(e))throw no(n,e);if(n==null||n.length==0)throw io(e);if(!ms(n))throw ro(n,e);let s=j(this._elementListeners,t,[]),l={name:e,phase:n,callback:r};s.push(l);let u=j(this._engine.statesByElement,t,new Map);return u.has(e)||(Z(t,et),Z(t,et+"-"+e),u.set(e,Fn)),()=>{this._engine.afterFlush(()=>{let d=s.indexOf(l);d>=0&&s.splice(d,1),this._triggers.has(e)||u.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw oo(t);return e}trigger(t,e,n,r=!0){let s=this._getTrigger(e),l=new at(this.id,e,t),u=this._engine.statesByElement.get(t);u||(Z(t,et),Z(t,et+"-"+e),this._engine.statesByElement.set(t,u=new Map));let d=u.get(e),_=new ot(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&d&&_.absorbOptions(d.options),u.set(e,_),d||(d=Fn),!(_.value===it)&&d.value===_.value){if(!_s(d.params,_.params)){let h=[],p=s.matchStyles(d.value,d.params,h),g=s.matchStyles(_.value,_.params,h);h.length?this._engine.reportError(h):this._engine.afterFlush(()=>{Se(t,p),re(t,g)})}return}let c=j(this._engine.playersByElement,t,[]);c.forEach(h=>{h.namespaceId==this.id&&h.triggerName==e&&h.queued&&h.destroy()});let f=s.matchTransition(d.value,_.value,t,_.params),m=!1;if(!f){if(!r)return;f=s.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:f,fromState:d,toState:_,player:l,isFallbackTransition:m}),m||(Z(t,vo),l.onStart(()=>{$e(t,vo)})),l.onDone(()=>{let h=this.players.indexOf(l);h>=0&&this.players.splice(h,1);let p=this._engine.playersByElement.get(t);if(p){let g=p.indexOf(l);g>=0&&p.splice(g,1)}}),this.players.push(l),c.push(l),l}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(r=>r.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(n=>n.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let n=this._engine.driver.query(t,tt,!0);n.forEach(r=>{if(r[oe])return;let s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(l=>l.triggerLeaveAnimation(r,e,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(t,e,n,r){let s=this._engine.statesByElement.get(t),l=new Map;if(s){let u=[];if(s.forEach((d,_)=>{if(l.set(_,d.value),this._triggers.has(_)){let i=this.trigger(t,_,it,r);i&&u.push(i)}}),u.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,l),n&&he(u).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){let r=new Set;e.forEach(s=>{let l=s.name;if(r.has(l))return;r.add(l);let d=this._triggers.get(l).fallbackTransition,_=n.get(l)||Fn,i=new ot(it),a=new at(this.id,l,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:l,transition:d,fromState:_,toState:i,player:a,isFallbackTransition:!0})})}}removeNode(t,e){let n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let r=!1;if(n.totalAnimations){let s=n.players.length?n.playersByQueriedElement.get(t):[];if(s&&s.length)r=!0;else{let l=t;for(;l=l.parentNode;)if(n.statesByElement.get(l)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(t),r)n.markElementAsRemoved(this.id,t,!1,e);else{let s=t[oe];(!s||s===Mo)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){Z(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(n=>{let r=n.player;if(r.destroyed)return;let s=n.element,l=this._elementListeners.get(s);l&&l.forEach(u=>{if(u.name==n.triggerName){let d=Rt(s,n.triggerName,n.fromState.value,n.toState.value);d._data=t,Dt(n.player,u.phase,d,u.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):e.push(n)}),this._queue=[],e.sort((n,r)=>{let s=n.transition.ast.depCount,l=r.transition.ast.depCount;return s==0||l==0?s-l:this._engine.driver.containsElement(n.element,r.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Qn=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(n=>{n.queued&&t.push(n)})}),t}createNamespace(t,e){let n=new jn(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){let n=this._namespaceList,r=this.namespacesByHostElement;if(n.length-1>=0){let l=!1,u=this.driver.getParentElement(e);for(;u;){let d=r.get(u);if(d){let _=n.indexOf(d);n.splice(_+1,0,t),l=!0;break}u=this.driver.getParentElement(u)}l||n.unshift(t)}else n.push(t);return r.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(t);this.namespacesByHostElement.delete(n.hostElement);let r=this._namespaceList.indexOf(n);r>=0&&this._namespaceList.splice(r,1),n.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,n=this.statesByElement.get(t);if(n){for(let r of n.values())if(r.namespaceId){let s=this._fetchNamespace(r.namespaceId);s&&e.add(s)}}return e}trigger(t,e,n,r){if(qt(e)){let s=this._fetchNamespace(t);if(s)return s.trigger(e,n,r),!0}return!1}insertNode(t,e,n,r){if(!qt(e))return;let s=e[oe];if(s&&s.setForRemoval){s.setForRemoval=!1,s.setForMove=!0;let l=this.collectedLeaveElements.indexOf(e);l>=0&&this.collectedLeaveElements.splice(l,1)}if(t){let l=this._fetchNamespace(t);l&&l.insertNode(e,n)}r&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Z(t,Rn)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$e(t,Rn))}removeNode(t,e,n){if(qt(e)){let r=t?this._fetchNamespace(t):null;r?r.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n);let s=this.namespacesByHostElement.get(e);s&&s.id!==t&&s.removeNode(e,n)}else this._onRemovalComplete(e,n)}markElementAsRemoved(t,e,n,r,s){this.collectedLeaveElements.push(e),e[oe]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:s}}listen(t,e,n,r,s){return qt(e)?this._fetchNamespace(t).listen(e,n,r,s):()=>{}}_buildInstruction(t,e,n,r,s){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e,s)}destroyInnerAnimations(t){let e=this.driver.query(t,tt,!0);e.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,Bt,!0),e.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return he(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[oe];if(e&&e.setForRemoval){if(t[oe]=Mo,e.namespaceId){this.destroyInnerAnimations(t);let n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(Rn)&&this.markElementAsDisabled(t,!1),this.driver.query(t,as,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,r)=>this._balanceNamespaceList(n,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let r=this.collectedEnterElements[n];Z(r,ss)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{e=this._flushAnimations(n,t)}finally{for(let r=0;r<n.length;r++)n[r]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let r=this.collectedLeaveElements[n];this.processLeaveNode(r)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],e.length?he(e).onDone(()=>{n.forEach(r=>r())}):n.forEach(r=>r())}}reportError(t){throw ao(t)}_flushAnimations(t,e){let n=new rt,r=[],s=new Map,l=[],u=new Map,d=new Map,_=new Map,i=new Set;this.disabledNodes.forEach(v=>{i.add(v);let S=this.driver.query(v,os,!0);for(let A=0;A<S.length;A++)i.add(S[A])});let a=this.bodyNode,c=Array.from(this.statesByElement.keys()),f=wo(c,this.collectedEnterElements),m=new Map,h=0;f.forEach((v,S)=>{let A=Nn+h++;m.set(S,A),v.forEach(P=>Z(P,A))});let p=[],g=new Set,w=new Set;for(let v=0;v<this.collectedLeaveElements.length;v++){let S=this.collectedLeaveElements[v],A=S[oe];A&&A.setForRemoval&&(p.push(S),g.add(S),A.hasAnimation?this.driver.query(S,ls,!0).forEach(P=>g.add(P)):w.add(S))}let C=new Map,O=wo(c,Array.from(g));O.forEach((v,S)=>{let A=Lt+h++;C.set(S,A),v.forEach(P=>Z(P,A))}),t.push(()=>{f.forEach((v,S)=>{let A=m.get(S);v.forEach(P=>$e(P,A))}),O.forEach((v,S)=>{let A=C.get(S);v.forEach(P=>$e(P,A))}),p.forEach(v=>{this.processLeaveNode(v)})});let G=[],q=[];for(let v=this._namespaceList.length-1;v>=0;v--)this._namespaceList[v].drainQueuedTransitions(e).forEach(A=>{let P=A.player,V=A.element;if(G.push(P),this.collectedEnterElements.length){let z=V[oe];if(z&&z.setForMove){if(z.previousTriggersValues&&z.previousTriggersValues.has(A.triggerName)){let we=z.previousTriggersValues.get(A.triggerName),Y=this.statesByElement.get(A.element);if(Y&&Y.has(A.triggerName)){let ct=Y.get(A.triggerName);ct.value=we,Y.set(A.triggerName,ct)}}P.destroy();return}}let ce=!a||!this.driver.containsElement(a,V),W=C.get(V),_e=m.get(V),R=this._buildInstruction(A,n,_e,W,ce);if(R.errors&&R.errors.length){q.push(R);return}if(ce){P.onStart(()=>Se(V,R.fromStyles)),P.onDestroy(()=>re(V,R.toStyles)),r.push(P);return}if(A.isFallbackTransition){P.onStart(()=>Se(V,R.fromStyles)),P.onDestroy(()=>re(V,R.toStyles)),r.push(P);return}let Zn=[];R.timelines.forEach(z=>{z.stretchStartingKeyframe=!0,this.disabledNodes.has(z.element)||Zn.push(z)}),R.timelines=Zn,n.append(V,R.timelines);let Bo={instruction:R,player:P,element:V};l.push(Bo),R.queriedElements.forEach(z=>j(u,z,[]).push(P)),R.preStyleProps.forEach((z,we)=>{if(z.size){let Y=d.get(we);Y||d.set(we,Y=new Set),z.forEach((ct,en)=>Y.add(en))}}),R.postStyleProps.forEach((z,we)=>{let Y=_.get(we);Y||_.set(we,Y=new Set),z.forEach((ct,en)=>Y.add(en))})});if(q.length){let v=[];q.forEach(S=>{v.push(so(S.triggerName,S.errors))}),G.forEach(S=>S.destroy()),this.reportError(v)}let B=new Map,E=new Map;l.forEach(v=>{let S=v.element;n.has(S)&&(E.set(S,S),this._beforeAnimationBuild(v.player.namespaceId,v.instruction,B))}),r.forEach(v=>{let S=v.element;this._getPreviousPlayers(S,!1,v.namespaceId,v.triggerName,null).forEach(P=>{j(B,S,[]).push(P),P.destroy()})});let ae=p.filter(v=>Ao(v,d,_)),me=new Map;So(me,this.driver,w,_,ne).forEach(v=>{Ao(v,d,_)&&ae.push(v)});let se=new Map;f.forEach((v,S)=>{So(se,this.driver,new Set(v),d,Ye)}),ae.forEach(v=>{let S=me.get(v),A=se.get(v);me.set(v,new Map([...S?.entries()??[],...A?.entries()??[]]))});let le=[],lt=[],Yn={};l.forEach(v=>{let{element:S,player:A,instruction:P}=v;if(n.has(S)){if(i.has(S)){A.onDestroy(()=>re(S,P.toStyles)),A.disabled=!0,A.overrideTotalTime(P.totalTime),r.push(A);return}let V=Yn;if(E.size>1){let W=S,_e=[];for(;W=W.parentNode;){let R=E.get(W);if(R){V=R;break}_e.push(W)}_e.forEach(R=>E.set(R,V))}let ce=this._buildAnimation(A.namespaceId,P,B,s,se,me);if(A.setRealPlayer(ce),V===Yn)le.push(A);else{let W=this.playersByElement.get(V);W&&W.length&&(A.parentPlayer=he(W)),r.push(A)}}else Se(S,P.fromStyles),A.onDestroy(()=>re(S,P.toStyles)),lt.push(A),i.has(S)&&r.push(A)}),lt.forEach(v=>{let S=s.get(v.element);if(S&&S.length){let A=he(S);v.setRealPlayer(A)}}),r.forEach(v=>{v.parentPlayer?v.syncPlayerEvents(v.parentPlayer):v.destroy()});for(let v=0;v<p.length;v++){let S=p[v],A=S[oe];if($e(S,Lt),A&&A.hasAnimation)continue;let P=[];if(u.size){let ce=u.get(S);ce&&ce.length&&P.push(...ce);let W=this.driver.query(S,Bt,!0);for(let _e=0;_e<W.length;_e++){let R=u.get(W[_e]);R&&R.length&&P.push(...R)}}let V=P.filter(ce=>!ce.destroyed);V.length?ps(this,S,V):this.processLeaveNode(S)}return p.length=0,le.forEach(v=>{this.players.push(v),v.onDone(()=>{v.destroy();let S=this.players.indexOf(v);this.players.splice(S,1)}),v.play()}),le}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,r,s){let l=[];if(e){let u=this.playersByQueriedElement.get(t);u&&(l=u)}else{let u=this.playersByElement.get(t);if(u){let d=!s||s==it;u.forEach(_=>{_.queued||!d&&_.triggerName!=r||l.push(_)})}}return(n||r)&&(l=l.filter(u=>!(n&&n!=u.namespaceId||r&&r!=u.triggerName))),l}_beforeAnimationBuild(t,e,n){let r=e.triggerName,s=e.element,l=e.isRemovalTransition?void 0:t,u=e.isRemovalTransition?void 0:r;for(let d of e.timelines){let _=d.element,i=_!==s,a=j(n,_,[]);this._getPreviousPlayers(_,i,l,u,e.toState).forEach(f=>{let m=f.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),f.destroy(),a.push(f)})}Se(s,e.fromStyles)}_buildAnimation(t,e,n,r,s,l){let u=e.triggerName,d=e.element,_=[],i=new Set,a=new Set,c=e.timelines.map(m=>{let h=m.element;i.add(h);let p=h[oe];if(p&&p.removedBeforeQueried)return new Ee(m.duration,m.delay);let g=h!==d,w=hs((n.get(h)||cs).map(B=>B.getRealPlayer())).filter(B=>{let E=B;return E.element?E.element===h:!1}),C=s.get(h),O=l.get(h),G=En(this._normalizer,m.keyframes,C,O),q=this._buildPlayer(m,G,w);if(m.subTimeline&&r&&a.add(h),g){let B=new at(t,u,h);B.setRealPlayer(q),_.push(B)}return q});_.forEach(m=>{j(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>ds(this.playersByQueriedElement,m.element,m))}),i.forEach(m=>Z(m,xn));let f=he(c);return f.onDestroy(()=>{i.forEach(m=>$e(m,xn)),re(d,e.toStyles)}),a.forEach(m=>{j(r,m,[]).push(f)}),f}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Ee(t.duration,t.delay)}},at=class{namespaceId;triggerName;element;_player=new Ee;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,n)=>{e.forEach(r=>Dt(t,n,void 0,r))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){j(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function ds(o,t,e){let n=o.get(t);if(n){if(n.length){let r=n.indexOf(e);n.splice(r,1)}n.length==0&&o.delete(t)}return n}function fs(o){return o??null}function qt(o){return o&&o.nodeType===1}function ms(o){return o=="start"||o=="done"}function bo(o,t){let e=o.style.display;return o.style.display=t??"none",e}function So(o,t,e,n,r){let s=[];e.forEach(d=>s.push(bo(d)));let l=[];n.forEach((d,_)=>{let i=new Map;d.forEach(a=>{let c=t.computeStyle(_,a,r);i.set(a,c),(!c||c.length==0)&&(_[oe]=us,l.push(_))}),o.set(_,i)});let u=0;return e.forEach(d=>bo(d,s[u++])),l}function wo(o,t){let e=new Map;if(o.forEach(u=>e.set(u,[])),t.length==0)return e;let n=1,r=new Set(t),s=new Map;function l(u){if(!u)return n;let d=s.get(u);if(d)return d;let _=u.parentNode;return e.has(_)?d=_:r.has(_)?d=n:d=l(_),s.set(u,d),d}return t.forEach(u=>{let d=l(u);d!==n&&e.get(d).push(u)}),e}function Z(o,t){o.classList?.add(t)}function $e(o,t){o.classList?.remove(t)}function ps(o,t,e){he(e).onDone(()=>o.processLeaveNode(t))}function hs(o){let t=[];return Po(o,t),t}function Po(o,t){for(let e=0;e<o.length;e++){let n=o[e];n instanceof Et?Po(n.players,t):t.push(n)}}function _s(o,t){let e=Object.keys(o),n=Object.keys(t);if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r];if(!t.hasOwnProperty(s)||o[s]!==t[s])return!1}return!0}function Ao(o,t,e){let n=e.get(o);if(!n)return!1;let r=t.get(o);return r?n.forEach(s=>r.add(s)):t.set(o,n),e.delete(o),!0}var Ue=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,n){this._driver=e,this._normalizer=n,this._transitionEngine=new Qn(t.body,e,n),this._timelineEngine=new Un(t.body,e,n),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(t,e,n,r,s){let l=t+"-"+r,u=this._triggerCache[l];if(!u){let d=[],_=[],i=Eo(this._driver,s,d,_);if(d.length)throw Yr(r,d);u=ns(r,i,this._normalizer),this._triggerCache[l]=u}this._transitionEngine.registerTrigger(e,r,u)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)}onRemove(t,e,n){this._transitionEngine.removeNode(t,e,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,r){if(n.charAt(0)=="@"){let[s,l]=kn(n),u=r;this._timelineEngine.command(s,e,l,u)}else this._transitionEngine.trigger(t,e,n,r)}listen(t,e,n,r,s){if(n.charAt(0)=="@"){let[l,u]=kn(n);return this._timelineEngine.listen(l,e,u,s)}return this._transitionEngine.listen(t,e,n,r,s)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function gs(o,t){let e=null,n=null;return Array.isArray(t)&&t.length?(e=Ln(t[0]),t.length>1&&(n=Ln(t[t.length-1]))):t instanceof Map&&(e=Ln(t)),e||n?new ys(o,e,n):null}var ys=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,n,r){this._element=e,this._startStyles=n,this._endStyles=r;let s=o.initialStylesByElement.get(e);s||o.initialStylesByElement.set(e,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&re(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(re(this._element,this._initialStyles),this._endStyles&&(re(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Se(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Se(this._element,this._endStyles),this._endStyles=null),re(this._element,this._initialStyles),this._state=3)}}return o})();function Ln(o){let t=null;return o.forEach((e,n)=>{vs(n)&&(t=t||new Map,t.set(n,e))}),t}function vs(o){return o==="display"||o==="position"}var Xt=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,n,r){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=r,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(n=>{e.push(Object.fromEntries(n))}),e}_triggerWebAnimation(t,e,n){return t.animate(this._convertKeyframesToObject(e),n)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,r)=>{r!=="offset"&&t.set(r,this._finished?n:Kt(this.element,r))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}},Yt=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return Cn(t,e)}getParentElement(t){return Ft(t)}query(t,e,n){return Mn(t,e,n)}computeStyle(t,e,n){return Kt(t,e)}animate(t,e,n,r,s,l=[]){let u=r==0?"both":"forwards",d={duration:n,delay:r,fill:u};s&&(d.easing=s);let _=new Map,i=l.filter(f=>f instanceof Xt);fo(n,r)&&i.forEach(f=>{f.currentSnapshot.forEach((m,h)=>_.set(h,m))});let a=co(e).map(f=>new Map(f));a=mo(t,a,_);let c=gs(t,a);return new Xt(t,a,d,c)}};var $t="@",No="@.disabled",Zt=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,n,r){this.namespaceId=t,this.delegate=e,this.engine=n,this._onDestroy=r}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,r=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,r)}removeChild(t,e,n){this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,r){this.delegate.setAttribute(t,e,n,r)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,r){this.delegate.setStyle(t,e,n,r)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==$t&&e==No?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n,r){return this.delegate.listen(t,e,n,r)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Gn=class extends Zt{factory;constructor(t,e,n,r,s){super(e,n,r,s),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==$t?e.charAt(1)=="."&&e==No?(n=n===void 0?!0:!!n,this.disableAnimations(t,n)):this.engine.process(this.namespaceId,t,e.slice(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n,r){if(e.charAt(0)==$t){let s=bs(t),l=e.slice(1),u="";return l.charAt(0)!=$t&&([l,u]=Ss(l)),this.engine.listen(this.namespaceId,s,l,u,d=>{let _=d._data||-1;this.factory.scheduleListenerCallback(_,n,d)})}return this.delegate.listen(t,e,n,r)}};function bs(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Ss(o){let t=o.indexOf("."),e=o.substring(0,t),n=o.slice(t+1);return[e,n]}var Jt=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,e.onRemovalComplete=(r,s)=>{s?.removeChild(null,r)}}createRenderer(t,e){let r=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let _=this._rendererCache,i=_.get(r);if(!i){let a=()=>_.delete(r);i=new Zt("",r,this.engine,a),_.set(r,i)}return i}let s=e.id,l=e.id+"-"+this._currentId;this._currentId++,this.engine.register(l,t);let u=_=>{Array.isArray(_)?_.forEach(u):this.engine.registerTrigger(s,l,t,_.name,_)};return e.data.animation.forEach(u),new Gn(this,l,r,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(n));return}let r=this._animationCallbacksBuffer;r.length==0&&queueMicrotask(()=>{this._zone.run(()=>{r.forEach(s=>{let[l,u]=s;l(u)}),this._animationCallbacksBuffer=[]})}),r.push([e,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var As=(()=>{class o extends Ue{constructor(e,n,r){super(e,n,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||o)(ft(mt),ft(Pe),ft(Ne))};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();function Ts(){return new Ut}function Es(o,t,e){return new Jt(o,t,e)}var xo=[{provide:Ne,useFactory:Ts},{provide:Ue,useClass:As},{provide:mi,useFactory:Es,deps:[xi,Ue,ht]}],iu=[{provide:Pe,useClass:Wn},{provide:rn,useValue:"NoopAnimations"},...xo],ks=[{provide:Pe,useFactory:()=>new Yt},{provide:rn,useFactory:()=>"BrowserAnimations"},...xo];function Oo(){return pi("NgEagerAnimations"),[...ks]}var Io=11,Do="connectionConfig",Ro=(()=>{class o{config;isLoggedIn=null;loggedInSubscription=null;connection=y(wt);auth=y(ge);connectionStateMachine=y(De);router=y(ye);delta=y(Be);data=y(Ve);storage=y(At);constructor(){this.loggedInSubscription=this.auth.isLoggedIn$.subscribe(e=>{this.isLoggedIn=e})}initNetworkServices(){return tn(this,null,function*(){this.loadLocalStorageConfig(),this.preloadFonts();try{this.config?.signalKUrl!==void 0&&this.config.signalKUrl!==null&&(yield this.connection.initializeConnection({url:this.config.signalKUrl,new:!1},this.config.proxyEnabled,this.config.signalKSubscribeAll)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.config?.loginName&&this.config?.loginPassword&&(yield this.login()),this.isLoggedIn&&this.config?.useSharedConfig&&(this.storage.activeConfigFileVersion=Io,this.storage.sharedConfigName=this.config.sharedConfigName,yield this.storage.getConfig("user",this.config.sharedConfigName,Io,!0)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.router.navigate(["/login"])}catch(e){return e.status===0?console.warn("[AppInit Network Service] Initialization failed. Network error. Redirecting to settings page."):e.status===401?console.warn("[AppInit Network Service] Initialization failed. Unauthorized access. Redirecting to login page."):console.warn("[AppInit Network Service] Initialization failed. Error: ",JSON.stringify(e)),Promise.reject("[AppInit Network Service] Startup completed with connection issue.")}finally{console.log("[AppInit Network Service] Initialization completed"),this.connectionStateMachine.enableWebSocketMode(),this.connectionStateMachine.isHTTPConnected()&&(console.log("[AppInit Network Service] Starting WebSocket connection after initialization"),this.connectionStateMachine.startWebSocketConnection())}})}login(){return tn(this,null,function*(){if(!this.isLoggedIn&&this.config.useSharedConfig&&this.config.loginName&&this.config.loginPassword)try{yield this.auth.login({usr:this.config.loginName,pwd:this.config.loginPassword})}catch(e){throw e.status===0?this.router.navigate(["/settings"]):e.status===401&&this.router.navigate(["/login"]),e}})}setLocalStorageConfig(){localStorage.setItem(Do,JSON.stringify(this.config))}loadLocalStorageConfig(){this.config=JSON.parse(localStorage.getItem(Do)),this.config?this.config.signalKUrl||(this.config.signalKUrl=window.location.origin,this.setLocalStorageConfig(),console.log(`[AppInit Network Service] Config found with no server URL. Setting Auto-Discovery URL: ${this.config.signalKUrl}`)):(this.config=Ci,this.config.signalKUrl=window.location.origin,console.log(`[AppInit Network Service] Connection Configuration not found. Creating configuration using Auto-Discovery URL: ${this.config.signalKUrl}`),this.setLocalStorageConfig()),this.config.configVersion==9&&(this.config.configVersion=10,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 9 to 10")),this.config.configVersion==10&&(this.config.configVersion=11,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 10 to 11")),this.config.configVersion==11&&(this.config.configVersion=12,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 11 to 12"))}preloadFonts(){let e=[{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2)",options:{weight:"500",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2)",options:{weight:"500",style:"normal"}}];for(let{family:n,src:r,options:s}of e){let l=new FontFace(n,r,s);l.load().then(()=>document.fonts.add(l)).catch(u=>console.log(`[AppInit Network Service] Error loading fonts: ${u}`))}}ngOnDestroy(){this.loggedInSubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();var Fo=(()=>{class o{auth=y(ge);authToken=null;authTokenSubscription=null;constructor(){this.authTokenSubscription=this.auth.authToken$.subscribe(e=>{this.authToken=e})}intercept(e,n){let r=e.clone();return this.authToken&&(r=e.clone({headers:e.headers.set("authorization","JWT "+this.authToken.token)})),n.handle(r)}ngOnDestroy(){this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();var Lo=(()=>{class o extends Pt{_createContainer(){let e=document.createElement("div");e.classList.add("cdk-overlay-container"),(document.getElementById("app-filter-wrapper")||document.querySelector("app-root")||document.body).appendChild(e),this._containerElement=e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=ui(o)))(r||o)}})();static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();Ar.production&&void 0;Oi(Dr,{providers:[si(Ii),{provide:Mi,useClass:Fo,multi:!0},{provide:Xi,useValue:{hasBackdrop:!0,disableClose:!1,autoFocus:"first-tabbable",delayFocusTrap:!0,backdropClass:"dialogBackdrop"}},{provide:Yi,useValue:{appearance:"outline",floatLabel:"always",subscriptSizing:"dynamic"}},{provide:dr,useValue:{showDelay:1500,hideDelay:0}},ge,Ve,wt,Be,De,Nt,Re,Ji,de,be,tr,At,br(),Pi(Ni()),Ri(wr,Fi()),Oo(),{provide:Pt,useClass:Lo},gi(()=>new Ro().initNetworkServices().then(()=>{}).catch(()=>{}))]});
|
|
3
|
+
`],encapsulation:2,changeDetection:0})}return o})(),Sn="_mat-snack-bar-enter",wn="_mat-snack-bar-exit",Xo=(()=>{class o extends ji{_ngZone=y(ht);_elementRef=y(fi);_changeDetectorRef=y(Ti);_platform=y(Ki);_animationsDisabled=_n();snackBarConfig=y(ze);_document=y(mt);_trackedModals=new Set;_enterFallback;_exitFallback;_injector=y(Te);_announceDelay=150;_announceTimeoutId;_destroyed=!1;_portalOutlet;_onAnnounce=new Ae;_onExit=new Ae;_onEnter=new Ae;_animationState="void";_live;_label;_role;_liveElementId=y(Hi).getId("mat-snack-bar-container-live-");constructor(){super();let e=this.snackBarConfig;e.politeness==="assertive"&&!e.announcementMessage?this._live="assertive":e.politeness==="off"?this._live="off":this._live="polite",this._platform.FIREFOX&&(this._live==="polite"&&(this._role="status"),this._live==="assertive"&&(this._role="alert"))}attachComponentPortal(e){this._assertNotAttached();let n=this._portalOutlet.attachComponentPortal(e);return this._afterPortalAttached(),n}attachTemplatePortal(e){this._assertNotAttached();let n=this._portalOutlet.attachTemplatePortal(e);return this._afterPortalAttached(),n}attachDomPortal=e=>{this._assertNotAttached();let n=this._portalOutlet.attachDomPortal(e);return this._afterPortalAttached(),n};onAnimationEnd(e){e===wn?this._completeExit():e===Sn&&(clearTimeout(this._enterFallback),this._ngZone.run(()=>{this._onEnter.next(),this._onEnter.complete()}))}enter(){this._destroyed||(this._animationState="visible",this._changeDetectorRef.markForCheck(),this._changeDetectorRef.detectChanges(),this._screenReaderAnnounce(),this._animationsDisabled?an(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(Sn)))},{injector:this._injector}):(clearTimeout(this._enterFallback),this._enterFallback=setTimeout(()=>{this._elementRef.nativeElement.classList.add("mat-snack-bar-fallback-visible"),this.onAnimationEnd(Sn)},200)))}exit(){return this._destroyed?ii(void 0):(this._ngZone.run(()=>{this._animationState="hidden",this._changeDetectorRef.markForCheck(),this._elementRef.nativeElement.setAttribute("mat-exit",""),clearTimeout(this._announceTimeoutId),this._animationsDisabled?an(()=>{this._ngZone.run(()=>queueMicrotask(()=>this.onAnimationEnd(wn)))},{injector:this._injector}):(clearTimeout(this._exitFallback),this._exitFallback=setTimeout(()=>this.onAnimationEnd(wn),200))}),this._onExit)}ngOnDestroy(){this._destroyed=!0,this._clearFromModals(),this._completeExit()}_completeExit(){clearTimeout(this._exitFallback),queueMicrotask(()=>{this._onExit.next(),this._onExit.complete()})}_afterPortalAttached(){let e=this._elementRef.nativeElement,n=this.snackBarConfig.panelClass;n&&(Array.isArray(n)?n.forEach(l=>e.classList.add(l)):e.classList.add(n)),this._exposeToModals();let r=this._label.nativeElement,s="mdc-snackbar__label";r.classList.toggle(s,!r.querySelector(`.${s}`))}_exposeToModals(){let e=this._liveElementId,n=this._document.querySelectorAll('body > .cdk-overlay-container [aria-modal="true"]');for(let r=0;r<n.length;r++){let s=n[r],l=s.getAttribute("aria-owns");this._trackedModals.add(s),l?l.indexOf(e)===-1&&s.setAttribute("aria-owns",l+" "+e):s.setAttribute("aria-owns",e)}}_clearFromModals(){this._trackedModals.forEach(e=>{let n=e.getAttribute("aria-owns");if(n){let r=n.replace(this._liveElementId,"").trim();r.length>0?e.setAttribute("aria-owns",r):e.removeAttribute("aria-owns")}}),this._trackedModals.clear()}_assertNotAttached(){this._portalOutlet.hasAttached()}_screenReaderAnnounce(){this._announceTimeoutId||this._ngZone.runOutsideAngular(()=>{this._announceTimeoutId=setTimeout(()=>{if(this._destroyed)return;let e=this._elementRef.nativeElement,n=e.querySelector("[aria-hidden]"),r=e.querySelector("[aria-live]");if(n&&r){let s=null;this._platform.isBrowser&&document.activeElement instanceof HTMLElement&&n.contains(document.activeElement)&&(s=document.activeElement),n.removeAttribute("aria-hidden"),r.appendChild(n),s?.focus(),this._onAnnounce.next(),this._onAnnounce.complete()}},this._announceDelay)})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["mat-snack-bar-container"]],viewQuery:function(n,r){if(n&1&&(sn(gn,7),sn(qo,7)),n&2){let s;ln(s=cn())&&(r._portalOutlet=s.first),ln(s=cn())&&(r._label=s.first)}},hostAttrs:[1,"mdc-snackbar","mat-mdc-snack-bar-container"],hostVars:6,hostBindings:function(n,r){n&1&&F("animationend",function(l){return r.onAnimationEnd(l.animationName)})("animationcancel",function(l){return r.onAnimationEnd(l.animationName)}),n&2&&bt("mat-snack-bar-container-enter",r._animationState==="visible")("mat-snack-bar-container-exit",r._animationState==="hidden")("mat-snack-bar-container-animations-enabled",!r._animationsDisabled)},features:[_i],decls:6,vars:3,consts:[["label",""],[1,"mdc-snackbar__surface","mat-mdc-snackbar-surface"],[1,"mat-mdc-snack-bar-label"],["aria-hidden","true"],["cdkPortalOutlet",""]],template:function(n,r){n&1&&(b(0,"div",1)(1,"div",2,0)(3,"div",3),gi(4,$o,0,0,"ng-template",4),T(),ee(5,"div"),T()()),n&2&&(x(5),_t("aria-live",r._live)("role",r._role)("id",r._liveElementId))},dependencies:[gn],styles:[`@keyframes _mat-snack-bar-enter{from{transform:scale(0.8);opacity:0}to{transform:scale(1);opacity:1}}@keyframes _mat-snack-bar-exit{from{opacity:1}to{opacity:0}}.mat-mdc-snack-bar-container{display:flex;align-items:center;justify-content:center;box-sizing:border-box;-webkit-tap-highlight-color:rgba(0,0,0,0);margin:8px}.mat-mdc-snack-bar-handset .mat-mdc-snack-bar-container{width:100vw}.mat-snack-bar-container-animations-enabled{opacity:0}.mat-snack-bar-container-animations-enabled.mat-snack-bar-fallback-visible{opacity:1}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-enter{animation:_mat-snack-bar-enter 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-snack-bar-container-animations-enabled.mat-snack-bar-container-exit{animation:_mat-snack-bar-exit 75ms cubic-bezier(0.4, 0, 1, 1) forwards}.mat-mdc-snackbar-surface{box-shadow:0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 6px 10px 0px rgba(0, 0, 0, 0.14), 0px 1px 18px 0px rgba(0, 0, 0, 0.12);display:flex;align-items:center;justify-content:flex-start;box-sizing:border-box;padding-left:0;padding-right:8px}[dir=rtl] .mat-mdc-snackbar-surface{padding-right:0;padding-left:8px}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{min-width:344px;max-width:672px}.mat-mdc-snack-bar-handset .mat-mdc-snackbar-surface{width:100%;min-width:0}@media(forced-colors: active){.mat-mdc-snackbar-surface{outline:solid 1px}}.mat-mdc-snack-bar-container .mat-mdc-snackbar-surface{color:var(--mat-snack-bar-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-snack-bar-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-snack-bar-container-color, var(--mat-sys-inverse-surface))}.mdc-snackbar__label{width:100%;flex-grow:1;box-sizing:border-box;margin:0;padding:14px 8px 14px 16px}[dir=rtl] .mdc-snackbar__label{padding-left:8px;padding-right:16px}.mat-mdc-snack-bar-container .mdc-snackbar__label{font-family:var(--mat-snack-bar-supporting-text-font, var(--mat-sys-body-medium-font));font-size:var(--mat-snack-bar-supporting-text-size, var(--mat-sys-body-medium-size));font-weight:var(--mat-snack-bar-supporting-text-weight, var(--mat-sys-body-medium-weight));line-height:var(--mat-snack-bar-supporting-text-line-height, var(--mat-sys-body-medium-line-height))}.mat-mdc-snack-bar-actions{display:flex;flex-shrink:0;align-items:center;box-sizing:border-box}.mat-mdc-snack-bar-handset,.mat-mdc-snack-bar-container,.mat-mdc-snack-bar-label{flex:1 1 auto}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled){--mat-button-text-state-layer-color: currentColor;--mat-button-text-ripple-color: currentColor}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled).mat-unthemed{color:var(--mat-snack-bar-button-color, var(--mat-sys-inverse-primary))}.mat-mdc-snack-bar-container .mat-mdc-button.mat-mdc-snack-bar-action:not(:disabled) .mat-ripple-element{opacity:.1}
|
|
4
|
+
`],encapsulation:2})}return o})();function Yo(){return new ze}var Zo=new rn("mat-snack-bar-default-options",{providedIn:"root",factory:Yo}),Er=(()=>{class o{_live=y(zi);_injector=y(Te);_breakpointObserver=y(kt);_parentSnackBar=y(o,{optional:!0,skipSelf:!0});_defaultConfig=y(Zo);_animationsDisabled=_n();_snackBarRefAtThisLevel=null;simpleSnackBarComponent=Wo;snackBarContainerComponent=Xo;handsetCssClass="mat-mdc-snack-bar-handset";get _openedSnackBarRef(){let e=this._parentSnackBar;return e?e._openedSnackBarRef:this._snackBarRefAtThisLevel}set _openedSnackBarRef(e){this._parentSnackBar?this._parentSnackBar._openedSnackBarRef=e:this._snackBarRefAtThisLevel=e}constructor(){}openFromComponent(e,n){return this._attach(e,n)}openFromTemplate(e,n){return this._attach(e,n)}open(e,n="",r){let s=X(X({},this._defaultConfig),r);return s.data={message:e,action:n},s.announcementMessage===e&&(s.announcementMessage=void 0),this.openFromComponent(this.simpleSnackBarComponent,s)}dismiss(){this._openedSnackBarRef&&this._openedSnackBarRef.dismiss()}ngOnDestroy(){this._snackBarRefAtThisLevel&&this._snackBarRefAtThisLevel.dismiss()}_attachSnackBarContainer(e,n){let r=n&&n.viewContainerRef&&n.viewContainerRef.injector,s=Te.create({parent:r||this._injector,providers:[{provide:ze,useValue:n}]}),l=new Ze(this.snackBarContainerComponent,n.viewContainerRef,s),u=e.attach(l);return u.instance.snackBarConfig=n,u.instance}_attach(e,n){let r=X(X(X({},new ze),this._defaultConfig),n),s=this._createOverlay(r),l=this._attachSnackBarContainer(s,r),u=new Je(l,s);if(e instanceof mi){let d=new Ui(e,null,{$implicit:r.data,snackBarRef:u});u.instance=l.attachTemplatePortal(d)}else{let d=this._createInjector(r,u),_=new Ze(e,void 0,d),i=l.attachComponentPortal(_);u.instance=i.instance}return this._breakpointObserver.observe(Mt.HandsetPortrait).pipe(si(s.detachments())).subscribe(d=>{s.overlayElement.classList.toggle(this.handsetCssClass,d.matches)}),r.announcementMessage&&l._onAnnounce.subscribe(()=>{this._live.announce(r.announcementMessage,r.politeness)}),this._animateSnackBar(u,r),this._openedSnackBarRef=u,this._openedSnackBarRef}_animateSnackBar(e,n){e.afterDismissed().subscribe(()=>{this._openedSnackBarRef==e&&(this._openedSnackBarRef=null),n.announcementMessage&&this._live.clear()}),n.duration&&n.duration>0&&e.afterOpened().subscribe(()=>e._dismissAfter(n.duration)),this._openedSnackBarRef?(this._openedSnackBarRef.afterDismissed().subscribe(()=>{e.containerInstance.enter()}),this._openedSnackBarRef.dismiss()):e.containerInstance.enter()}_createOverlay(e){let n=new Qi;n.direction=e.direction;let r=Gi(this._injector),s=e.direction==="rtl",l=e.horizontalPosition==="left"||e.horizontalPosition==="start"&&!s||e.horizontalPosition==="end"&&s,u=!l&&e.horizontalPosition!=="center";return l?r.left("0"):u?r.right("0"):r.centerHorizontally(),e.verticalPosition==="top"?r.top("0"):r.bottom("0"),n.positionStrategy=r,n.disableAnimations=this._animationsDisabled,Wi(this._injector,n)}_createInjector(e,n){let r=e&&e.viewContainerRef&&e.viewContainerRef.injector;return Te.create({parent:r||this._injector,providers:[{provide:Je,useValue:n},{provide:Tr,useValue:e.data}]})}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var kr=ni(bn());var Jo={1e3:"notification",1001:"alert",1002:"warn",1003:"alarm",1004:"emergency"},be=(()=>{class o{settings=y(de);data=y(Ve);requests=y(tr);static ALARM_SEVERITIES={normal:{sound:0,visual:0},nominal:{sound:0,visual:0},alert:{sound:1,visual:0},warn:{sound:2,visual:1},alarm:{sound:3,visual:2},emergency:{sound:4,visual:2}};_notificationSettingsSubscription=null;_notificationDataStreamSubscription=null;_notificationMetaStreamSubscription=null;_resetServiceSubscription=null;_notificationConfig;_notificationConfig$=new ut(Ci);_notifications=[];_notifications$=new ut([]);_alarmsInfo$=new ut({audioSev:0,visualSev:0,alarmCount:0,isMuted:!1});_players=new Map;_activeAlarmSoundtrack=null;_activeHowlId=null;_isHowlIdMuted=!1;_lastEmittedValue=null;constructor(){this._notificationSettingsSubscription=this.settings.getNotificationServiceConfigAsO().subscribe(e=>{this._notificationConfig=e,this.reset(),this._notificationConfig$.next(e),this._notificationConfig.disableNotifications&&!this._notificationDataStreamSubscription?.closed&&this.stopNotificationStream(),!this._notificationConfig.disableNotifications&&(this._notificationDataStreamSubscription===null||this._notificationDataStreamSubscription?.closed)&&this.startNotificationStream(),this._notificationConfig.sound.disableSound?this.playAlarm(1e3):this.updateNotificationsState()}),this._resetServiceSubscription=this.data.isResetService().subscribe(e=>{e&&this.reset()}),this.getPlayer(1e3)}startNotificationStream(){this._notificationDataStreamSubscription=this.data.getNotificationMsgObservable().subscribe(e=>this.processNotificationDeltaMsg(e)),this._notificationMetaStreamSubscription=this.data.getNotificationMetaObservable().subscribe(e=>this.processNotificationDeltaMeta(e))}stopNotificationStream(){this._notificationDataStreamSubscription?.unsubscribe(),this._notificationMetaStreamSubscription?.unsubscribe(),this.reset()}reset(){this._notificationConfig.disableNotifications&&(this._notifications=[],this._notifications$.next([])),this.updateNotificationsState()}observeNotifications(){return this._notifications$}addValue(e){this._notifications.push({path:e.path,value:e.value}),this.updateNotificationsState(),this._notifications$.next(this._notifications)}updateValue(e){let n=this._notifications.find(r=>r.path==e.path);n?(n.value=X({},e.value),this.updateNotificationsState(),this._notifications$.next(this._notifications)):console.log("[Notification Service] Update path not found for: "+e.path)}deleteValue(e){let n=this._notifications.find(r=>r.path==e);n?(delete n.value,this.updateNotificationsState(),this._notifications$.next(this._notifications)):console.log("[Notification Service] Notification to delete not found for: "+e)}updateNotificationsState(){let e=0,n=0,r=0;for(let l of this._notifications){if(!l.value||!("method"in l.value)||l.value.method.length===0||l.value.state===ke.Normal&&!this._notificationConfig.devices.showNormalState||l.value.state===ke.Nominal&&!this._notificationConfig.devices.showNominalState)continue;r++;let{aSev:u,vSev:d}=this.getNotificationSeverity(l);e=Math.max(e,u),n=Math.max(n,d)}this._notificationConfig.sound.disableSound||this.playAlarm(1e3+e);let s={audioSev:e,visualSev:n,alarmCount:r,isMuted:this._isHowlIdMuted};We(s,this._lastEmittedValue)||(this._alarmsInfo$.next(s),this._lastEmittedValue=s)}processNotificationDeltaMsg(e){if(!e.path.startsWith("notifications.security"))if(e.value===null)this.deleteValue(e.path);else{let n=this._notifications.find(r=>r.path==e.path);n?(!n.value||n.value.state!==e.value.state||n.value.message!==e.value.message||!We(n.value.method,e.value.method))&&this.updateValue(e):this.addValue(e)}}processNotificationDeltaMeta(e){let n=this._notifications.find(r=>r.path==e.path);n?n.meta=e.meta:this._notifications.push({path:e.path,meta:e.meta}),this._notifications$.next(this._notifications)}getNotificationSeverity(e){let n=e.value.state,r=o.ALARM_SEVERITIES[n];if(!r)return console.log(`[Notification Service] Unknown Notification State
|
|
5
|
+
`+JSON.stringify(e)),{aSev:0,vSev:0};let s=r.sound,l=r.visual;return(!e.value.method.includes(Le.Sound)||this._notificationConfig.sound[`mute${n.charAt(0).toUpperCase()+n.slice(1)}`]||this._isHowlIdMuted)&&(s=0),e.value.method.includes(Le.Visual)||(l=0),{aSev:s,vSev:l}}setSkMethod(e,n){this.requests.putRequest(`${e}.method`,n,pn.create())}setSkState(e,n){this.requests.putRequest(`${e}.state`,n,pn.create())}observerNotificationsInfo(){return this._alarmsInfo$.pipe(xe(e=>{let n=!1,r=!1;switch(e.visualSev){case 1:n=!0;break;case 2:r=!0;break}return ei(X({},e),{isWarn:n,isAlarmEmergency:r})}))}getPlayer(e){if(this._players.has(e))return this._players.get(e);let n=Jo[e];if(!n)return console.warn("[Notification Service] Unknown track id",e),this.getPlayer(1e3);let r=new kr.Howl({src:[`assets/${n}.mp3`],autoplay:!1,preload:!0,loop:!0,onloaderror:(s,l)=>{console.log("[Notification Service] load error track:",e,l)},onplayerror:(s,l)=>{console.log("[Notification Service] play locked track:",e,l),r.once("unlock",()=>r.play())}});return this._players.set(e,r),r}mutePlayer(e){if(this._activeAlarmSoundtrack!=null&&this._activeAlarmSoundtrack!==1e3){let n=this._players.get(this._activeAlarmSoundtrack);n&&this._activeHowlId!=null&&n.mute(e,this._activeHowlId)}this._isHowlIdMuted=e,this.updateNotificationsState()}playAlarm(e){if(this._activeAlarmSoundtrack===e)return;if(this._activeAlarmSoundtrack!=null&&this._players.get(this._activeAlarmSoundtrack)?.stop(),e===1e3){this._activeAlarmSoundtrack=1e3,this._activeHowlId=null;return}let n=this.getPlayer(e);this._activeAlarmSoundtrack=e,this._activeHowlId=n.play(),n.mute(this._isHowlIdMuted,this._activeHowlId)}observeNotificationConfiguration(){return this._notificationConfig$.asObservable()}ngOnDestroy(){this._notificationSettingsSubscription?.unsubscribe(),this._resetServiceSubscription?.unsubscribe(),this._notificationDataStreamSubscription?.unsubscribe(),this._notificationMetaStreamSubscription?.unsubscribe(),this._notificationConfig$.complete(),this._notifications$.complete(),this._alarmsInfo$.complete();for(let e of this._players.values())try{e.unload()}catch{}this._players.clear()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();var ea=(o,t)=>t.path;function ta(o,t){o&1&&(b(0,"mat-icon"),M(1,"info"),T())}function na(o,t){o&1&&(b(0,"mat-icon"),M(1,"info"),T())}function ia(o,t){o&1&&(b(0,"mat-icon",3),M(1,"report"),T())}function ra(o,t){o&1&&(b(0,"mat-icon",4),M(1,"warning"),T())}function oa(o,t){o&1&&(b(0,"mat-icon",5),M(1,"error"),T())}function aa(o,t){o&1&&(b(0,"mat-icon",6),M(1,"emergency_home"),T())}function sa(o,t){if(o&1){let e=K();b(0,"div",2),$(1,ta,2,0,"mat-icon")(2,na,2,0,"mat-icon")(3,ia,2,0,"mat-icon",3)(4,ra,2,0,"mat-icon",4)(5,oa,2,0,"mat-icon",5)(6,aa,2,0,"mat-icon",6),b(7,"div",7),M(8),T(),b(9,"div",8),M(10),bi(11,"slice"),T(),b(12,"div",9),M(13),T(),b(14,"button",10),F("click",function(){let r=I(e).$implicit,s=L();return D(s.silence(r.path))}),b(15,"mat-icon"),M(16,"music_off"),T()(),b(17,"button",11),F("click",function(){let r=I(e).$implicit,s=L();return D(s.clear(r.path))}),b(18,"mat-icon"),M(19,"published_with_changes"),T()()(),ee(20,"mat-divider",12)}if(o&2){let e,n=t.$implicit;x(),U((e=n.value.state)==="nominal"?1:e==="normal"?2:e==="alert"?3:e==="warn"?4:e==="alarm"?5:e==="emergency"?6:-1),x(7),je(n.value.state),x(2),Qe(" ",Si(11,5,n.path,14)," "),x(3),je(n.value.message),x(),ue("disabled",!(n.value.method!=null&&n.value.method.includes("sound")))}}function la(o,t){o&1&&(b(0,"mat-list-item",13)(1,"span",15),M(2,"Notifications Disabled"),T(),b(3,"span")(4,"i"),M(5,"*Enable notifications in Settings."),T()()())}function ca(o,t){o&1&&(b(0,"mat-list-item",14)(1,"i"),M(2,'"No Notification"'),T()())}function ua(o,t){if(o&1&&$(0,la,6,0,"mat-list-item",13)(1,ca,3,0,"mat-list-item",14),o&2){let e=L();U(e.notificationConfig().disableNotifications?0:1)}}function da(o,t){if(o&1){let e=K();b(0,"button",17),F("click",function(){I(e);let r=L(2);return D(r.mutePlayer(!r.isMuted))}),b(1,"span",18),M(2,"volume_up"),T(),M(3," Unmute Audio "),T()}}function fa(o,t){if(o&1){let e=K();b(0,"button",17),F("click",function(){I(e);let r=L(2);return D(r.mutePlayer(!r.isMuted))}),b(1,"span",18),M(2,"volume_off"),T(),M(3," Mute Audio "),T()}}function ma(o,t){if(o&1&&$(0,da,4,0,"button",16)(1,fa,4,0,"button",16),o&2){let e=L();U(e.isMuted?0:1)}}var Pr=(()=>{class o{_notificationsService=y(be);_notifications$=this._notificationsService.observeNotifications();notificationConfig=te(this._notificationsService.observeNotificationConfiguration(),{requireSync:!0});menuNotifications=te(ri([this._notifications$,this._notificationsService.observeNotificationConfiguration()]).pipe(xe(([e,n])=>{let r=[];return n.devices.showNormalState||r.push(ke.Normal),n.devices.showNominalState||r.push(ke.Nominal),e.filter(s=>s.value&&s.value.state&&!r.includes(s.value.state)).filter(s=>s.value&&s.value.method&&s.value.method.includes(Le.Visual))})),{requireSync:!0,equal:We});isMuted=!1;mutePlayer(e){this.isMuted=e,this._notificationsService.mutePlayer(e)}silence(e){this._notificationsService.setSkMethod(e,[Le.Visual])}clear(e){this._notificationsService.setSkState(e,ke.Normal)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["menu-notifications"]],decls:6,vars:2,consts:[[1,"menu-item-container"],[1,"actions-container","actions-bottom-container"],[1,"notification-container"],[1,"icon-alert-color"],[1,"icon-warn-color"],[1,"icon-alarm-color"],[1,"icon-emergency-color"],[1,"notification-title"],[1,"notification-path","scrollable-text"],[1,"notification-text"],["mat-icon-button","",1,"notification-action-btn",3,"click","disabled"],["mat-icon-button","",1,"notification-action-btn",3,"click"],[1,"notification-divider"],["lines","3","disabled","true",2,"text-align","center"],["disabled","true",2,"text-align","center"],["matListItemTitle",""],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button"],["mat-flat-button","","matTooltip","Temporally toggle all notification audio. To permanently disable/enable notification audio, use the configuration settings option",1,"action-button",3,"click"],[1,"material-icons"]],template:function(n,r){n&1&&(b(0,"mat-list",0),Oe(1,sa,21,8,null,null,ea,!1,ua,2,1),T(),b(4,"div",1),$(5,ma,2,1),T()),n&2&&(x(),Ie(r.menuNotifications()),x(4),U(r.notificationConfig().disableNotifications?-1:5))},dependencies:[cr,sr,lr,Ji,ar,pe,Ke,qi,xt,mr,fr,ve,Fe,ki],styles:[".notification-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-evenly;padding:2px 10px 7px;scroll-behavior:smooth}mat-icon[_ngcontent-%COMP%]{margin-right:10px}.scrollable-text[_ngcontent-%COMP%]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.scrollable-text[_ngcontent-%COMP%]:hover{overflow:auto;white-space:normal;word-wrap:break-word}.notification-title[_ngcontent-%COMP%]{text-transform:capitalize;font-size:var(--mat-sys-headline-small-size);width:calc(100% - 34px)}.notification-path[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-size);word-break:break-all;width:100%}.notification-text[_ngcontent-%COMP%]{font-size:var(--mat-sys-body-small-line-height);font-style:italic;width:100%;overflow:auto;white-space:normal;word-wrap:break-word}.notification-action-btn[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container)}.notification-btn-container[_ngcontent-%COMP%]{display:inline-block;width:50%;height:48px;text-align:center}.menu-item-container[_ngcontent-%COMP%]{width:230px;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;height:calc(100% - 48px)}.notification-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;background-color:var(--mat-sys-surface-container)}.actions-container[_ngcontent-%COMP%]{display:grid;grid-auto-flow:column}.actions-bottom-container[_ngcontent-%COMP%]{position:absolute;bottom:0;width:100%;height:48px}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;border-bottom-right-radius:var(--mat-sidenav-container-shape, var(--mat-sys-corner-large))}.icon-alert-color[_ngcontent-%COMP%]{color:var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{color:var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{color:var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:transparent}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}.notification-divider[_ngcontent-%COMP%]{padding-top:10px}"],changeDetection:0})}return o})();var pa=["badgeButton"],Nr=(()=>{class o{badgeButton=St.required("badgeButton");_notifications=y(be);notificationsInfo=te(this._notifications.observerNotificationsInfo());openNotificationMenu(){let e=new Event("openRightSidenav",{bubbles:!0,cancelable:!0});window.document.dispatchEvent(e)}onKeyDown(e){let n=e.key?.toLowerCase();(n==="enter"||n===" "||n==="spacebar")&&(e.preventDefault(),this.openNotificationMenu())}focus(){try{let e=this.badgeButton&&this.badgeButton(),n=e&&e.nativeElement;n&&typeof n.focus=="function"&&n.focus()}catch{}}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["notification-badge"]],viewQuery:function(n,r){n&1&&yt(r.badgeButton,pa,5),n&2&&vt()},decls:5,vars:7,consts:[["badgeButton",""],["mat-fab","","role","button","aria-label","Open notifications",1,"layout-action-btn",3,"click","keydown"],["aria-hidden","false","matBadgeSize","large","matBadgePosition","after","matBadgeOverlap","true",1,"icon-alert-color",3,"matBadgeHidden","matBadge"]],template:function(n,r){if(n&1){let s=K();b(0,"div")(1,"button",1,0),F("click",function(){return I(s),D(r.openNotificationMenu())})("keydown",function(u){return I(s),D(r.onKeyDown(u))}),b(3,"mat-icon",2),M(4,"notifications "),T()()()}n&2&&(x(),bt("warn",r.notificationsInfo().isWarn)("alarm-emergency-blink",r.notificationsInfo().isAlarmEmergency),_t("aria-haspopup",!0),x(2),ue("matBadgeHidden",!r.notificationsInfo().alarmCount)("matBadge",r.notificationsInfo().alarmCount))},dependencies:[pe,$i,ve,Fe,xt,ir],styles:["[_nghost-%COMP%]{display:block}.layout-action-btn[_ngcontent-%COMP%]{color:var(--mat-sys-on-primary);background-color:var(--mat-sys-primary)}.icon-alert-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alert-color)}.icon-warn-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-warn-color)}.icon-alarm-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-alarm-color)}.icon-emergency-color[_ngcontent-%COMP%]{--mat-list-list-item-leading-icon-color: var(--kip-zone-emergency-color)}.alarm-emergency-blink[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking-emergency 1.5s infinite}@keyframes _ngcontent-%COMP%_blinking-emergency{0%{background-color:var(--kip-zone-alarm-color)}50%{background-color:var(--mat-sys-primary)}to{background-color:var(--kip-zone-alarm-color)}}.warn[_ngcontent-%COMP%]{color:var(--kip-zone-warn-color)}"]})}return o})();var xr=(()=>{class o{overlayRef=null;overlay=y(Xi);injector=y(Te);open(){if(this.overlayRef)return;this.overlayRef=this.overlay.create({hasBackdrop:!1,panelClass:"notification-overlay-panel",positionStrategy:this.overlay.position().global().bottom("20px").left("20px"),scrollStrategy:this.overlay.scrollStrategies.reposition()});let e=new Ze(Nr,null,this.injector),n=this.overlayRef.attach(e);try{let r=n&&n.instance;if(r&&typeof r.focus=="function")r.focus();else{let s=this.overlayRef.overlayElement,l=s&&s.querySelector("button[mat-fab], .layout-action-btn");l&&typeof l.focus=="function"&&l.focus()}}catch{}}close(){try{this.overlayRef&&this.overlayRef.dispose()}catch(e){console.warn("[NotificationOverlayService] dispose failed",e)}finally{this.overlayRef=null}}toggle(e){e?this.open():this.close()}isOpen(){return!!this.overlayRef}ngOnDestroy(){try{this.overlayRef&&this.overlayRef.dispose()}catch{}finally{this.overlayRef=null}}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function ha(o,t){if(o&1){let e=K();b(0,"button",12),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("toggleFullScreen"))}),b(1,"span",10),M(2,"fullscreen"),T()()}}function _a(o,t){if(o&1){let e=K();b(0,"button",12),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("toggleFullScreen"))}),b(1,"span",10),M(2,"close_fullscreen"),T()()}}function ga(o,t){if(o&1&&$(0,ha,3,0,"button",11)(1,_a,3,0,"button",11),o&2){let e=L();U(e.uiEvent.fullscreenStatus()?1:0)}}function ya(o,t){if(o&1){let e=K();b(0,"button",14),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("nightMode"))}),b(1,"span",10),M(2,"mode_night"),T()()}}function va(o,t){if(o&1){let e=K();b(0,"button",14),F("click",function(){I(e);let r=L(2);return D(r.onActionItem("nightMode"))}),b(1,"span",10),M(2,"light_mode"),T()()}}function ba(o,t){if(o&1&&$(0,ya,3,0,"button",13)(1,va,3,0,"button",13),o&2){let e=L();U(e.app.isNightMode()?1:0)}}function Sa(o,t){if(o&1){let e=K();b(0,"tile-large-icon",15,1),F("click",function(){let r=I(e).$index,s=L();return D(s.navigateToDashboard(r))}),T()}if(o&2){let e=t.$implicit;ue("active",e.active)("svgIcon",e.svgIcon)("iconSize",e.iconSize)("label",e.label)}}var Or=(()=>{class o{actionsSidenav=Ai.required();_router=y(ye);uiEvent=y(Ot);dashboard=y(Re);app=y(Ct);_settings=y(de);isAutoNightMode=te(this._settings.getAutoNightModeAsO(),{requireSync:!0});_initialDashboardMatch=(()=>{let n=this._router.parseUrl(this._router.url).root.children.primary,r=n?n.segments.map(s=>s.path):[];return r.length===0||r[0]==="dashboard"||r[0]==="chartplotter"})();isDashboardContext=te(this._router.events.pipe(dt(e=>e instanceof Tt),ai(null),xe(()=>{let n=this._router.parseUrl(this._router.url).root.children.primary,r=n?n.segments.map(s=>s.path):[];return r.length===0||r[0]==="dashboard"||r[0]==="chartplotter"}),oi()),{initialValue:this._initialDashboardMatch});menuItems=wi(()=>{let e=this.dashboard.dashboards(),n=this.dashboard.activeDashboard();return e.map((r,s)=>({id:Number(r.id),active:s===n,pinned:!1,svgIcon:r.icon||"dashboard-dashboard",iconSize:60,label:r.name||`Dashboard ${s+1}`}))});ngAfterViewInit(){this.uiEvent.addHotkeyListener((e,n)=>this.handleKeyDown(e,n),{ctrlKey:!0,shiftKey:!0,keys:["e","f","n"]})}ngOnDestroy(){this.uiEvent.removeHotkeyListener(this.handleKeyDown.bind(this))}handleKeyDown(e,n){switch(e){case"e":this.onActionItem("layout");break;case"f":this.onActionItem("toggleFullScreen");break;case"n":this.onActionItem("nightMode");break;default:break}}onActionItem(e){switch(this.actionsSidenav().close(),e){case"toggleFullScreen":this.uiEvent.toggleFullScreen();break;case"settings":this._router.navigate(["/settings"]);break;case"layout":this.dashboard.setStaticDashboard(!1);break;case"nightMode":this.app.isNightMode.set(!this.app.isNightMode()),this.app.toggleDayNightMode();break;default:break}}navigateToDashboard(e){this.actionsSidenav().close(),this._router.navigate([`dashboard/${e}`])}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["menu-actions"]],inputs:{actionsSidenav:[1,"actionsSidenav"]},decls:14,vars:3,consts:[["tileContainer",""],["tile",""],[1,"actions-container"],[1,"actions-top-container"],["mat-flat-button","","tabindex","0",1,"action-button","home-btn",3,"click"],["height","24px","width","24px","svgIcon","kip","aria-hidden","false",1,"home-icon",2,"height","24px","width","24px"],[1,"menu-item-container"],["tabindex","0",3,"active","svgIcon","iconSize","label"],[1,"actions-bottom-container"],["mat-flat-button","",1,"action-button",2,"width","135px",3,"click","disabled"],[1,"material-icons"],["mat-flat-button","","tabindex","0",1,"action-button"],["mat-flat-button","","tabindex","0",1,"action-button",3,"click"],["mat-flat-button","",1,"action-button"],["mat-flat-button","",1,"action-button",3,"click"],["tabindex","0",3,"click","active","svgIcon","iconSize","label"]],template:function(n,r){if(n&1){let s=K();b(0,"div",2)(1,"div",3),$(2,ga,2,1),$(3,ba,2,1),b(4,"button",4),F("click",function(){return I(s),D(r.onActionItem("settings"))}),ee(5,"mat-icon",5),T()(),b(6,"div",6,0),Oe(8,Sa,2,4,"tile-large-icon",7,gt),T(),b(10,"div",8)(11,"button",9),F("click",function(){return I(s),D(r.onActionItem("layout"))}),b(12,"span",10),M(13,"lock_open"),T()()()()}n&2&&(x(2),U(r.uiEvent.fullscreenSupported()?2:-1),x(),U(r.isAutoNightMode()?-1:3),x(5),Ie(r.menuItems()),x(3),ue("disabled",!r.isDashboardContext()))},dependencies:[ve,Fe,pe,Ke,ur],styles:[".actions-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;width:135px}.actions-top-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.actions-bottom-container[_ngcontent-%COMP%]{height:48px;width:100%}.action-button[_ngcontent-%COMP%]{border-radius:0;height:48px;flex:1 1 48px;min-height:0;overflow:hidden;border:1px solid var(--mat-sidenav-container-background-color, var(--mat-sys-surface))}.home-btn[_ngcontent-%COMP%]{--mat-icon-button-icon-size: 24px;--mat-button-filled-icon-offset: 0px;--mat-button-filled-icon-spacing: 0px;--mat-button-filled-label-text-size: 0px}.home-icon[_ngcontent-%COMP%] .mat-mdc-unelevated-button[_ngcontent-%COMP%] > .mat-icon[_ngcontent-%COMP%]{font-size:0px}.full-size[_ngcontent-%COMP%]{width:135px}.menu-item-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;padding:3px 1px;gap:5px;width:135px;overflow-y:auto;scrollbar-width:none;overflow-x:hidden;scroll-behavior:smooth;flex:1 1 auto;min-height:0}"]})}return o})();var wa=["upgradeMessages"];function Aa(o,t){if(o&1&&(b(0,"li"),M(1),T()),o&2){let e=t.$implicit;x(),je(e)}}function Ta(o,t){if(o&1&&(b(0,"ul",11,1),Oe(2,Aa,2,1,"li",null,gt),T()),o&2){let e=L(2);x(2),Ie(e.upgrade.messages())}}function Ea(o,t){if(o&1&&(b(0,"div",7)(1,"div",8),ee(2,"mat-progress-spinner",9),b(3,"div",10)(4,"h3"),M(5,"Upgrading Configuration\u2026"),T(),b(6,"p"),M(7,"Please wait a moment while we migrate your dashboards and widgets."),T(),$(8,Ta,4,0,"ul",11),T()()()),o&2){let e=L();x(8),U(e.upgrade.messages().length?8:-1)}}var Dr=(()=>{class o{_snackBar=y(Er);_deltaService=y(Be);_connectionStateMachine=y(De);_app=y(Ct);_dashboard=y(Re);_notifications=y(be);_uiEvent=y(Ot);_dialog=y(or);appSettingsService=y(de);authenticationService=y(ge);_dataSet=y(Nt);_responsive=y(kt);_destroyRef=y(ci);_notificationOverlay=y(xr);_router=y(ye);upgrade=y(rr);upgradeMessagesRef=St("upgradeMessages");notificationHowl;_upgradeShown=!1;actionsSidenavOpened=mn(!1);notificationsSidenavOpened=mn(!1);notificationsInfo=te(this._notifications.observerNotificationsInfo());dashboardVisible=ui(!1);isPhonePortrait;scheduledOpen=null;OPEN_DELAY_MS=300;_swipeLeftHandler=()=>this.onSwipeLeft();_swipeRightHandler=()=>this.onSwipeRight();_hotkeyHandler=e=>this.handleKeyDown(e);constructor(){Ge(()=>{if(this.appSettingsService.configUpgrade()){let e=this.appSettingsService.getConfigVersion();e===11&&this.upgrade.runUpgrade(e),e||this._upgradeShown||(this._upgradeShown=!0,this._dialog.openFrameDialog({title:"Upgrade Instructions",component:"upgrade-config"},!0).pipe(Xe(this._destroyRef)).subscribe())}}),Ge(()=>{let e=this.upgrade.messages();if(this.upgrade.upgrading()&&e.length&&this.upgradeMessagesRef()){let n=this.upgradeMessagesRef().nativeElement;n.scrollTop=n.scrollHeight}});try{this.dashboardVisible.set(this.isUrlDashboard(this._router.url))}catch{}this._router.events.pipe(dt(e=>e instanceof Tt),Xe(this._destroyRef)).subscribe(e=>{try{this.dashboardVisible.set(this.isUrlDashboard(e.urlAfterRedirects||e.url))}catch{}}),Ge(()=>{let e=this.dashboardVisible()&&this._dashboard.isDashboardStatic()&&this.notificationsInfo().alarmCount>0;if(this.notificationsSidenavOpened()){this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch{}return}if(e){if(this.scheduledOpen)return;this.scheduledOpen=window.setTimeout(()=>{this.scheduledOpen=null;try{this._notificationOverlay.open()}catch{}},this.OPEN_DELAY_MS)}else{this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null);try{this._notificationOverlay.close()}catch{}}}),Ge(()=>{if(this.notificationsSidenavOpened())try{this._notificationOverlay.close()}catch{}}),this.isPhonePortrait=te(this._responsive.observe(Mt.HandsetPortrait)),this._connectionStateMachine.status$.pipe(Xe(this._destroyRef)).subscribe(e=>this.displayConnectionsStatusNotification(e)),this._app.getSnackbarAppNotifications().pipe(Xe(this._destroyRef)).subscribe(e=>{this._snackBar.open(e.message,e.action,{duration:e.duration,verticalPosition:"top"}),!this.appSettingsService.getNotificationConfig().sound.disableSound&&!e.silent&&(this.notificationHowl||(this.notificationHowl=new Ir.Howl({src:["assets/notification.mp3"],preload:!0,volume:.3})),this.notificationHowl.stop(),this.notificationHowl.play())})}isUrlDashboard(e){if(!e)return!1;let n=e.split("?")[0].replace(/\/+$/,"");return n==="/dashboard"||/^\/dashboard(\/\d+)?$/.test(n)||n==="/"}ngOnInit(){this._uiEvent.addGestureListeners(this._swipeLeftHandler,this._swipeRightHandler)}ngAfterViewInit(){this._uiEvent.addHotkeyListener(this._hotkeyHandler,{ctrlKey:!0,keys:["arrowright","arrowleft"]})}handleKeyDown(e){switch(e){case"arrowright":this.onSwipeRight();break;case"arrowleft":this.onSwipeLeft();break;case"escape":this.backdropClicked();break}}escapeKeyPressed(e){e=e.toLowerCase(),e==="escape"&&this.backdropClicked()}displayConnectionsStatusNotification(e){let n=e.message;switch(e.operation){case 0:this._app.sendSnackbarNotification(n,5e3,!0);break;case 1:case 2:break;case 3:this._app.sendSnackbarNotification(n,3e3,!1,"");break;case 4:this._app.sendSnackbarNotification(n,3e3,!0,"");break;case 5:this._app.sendSnackbarNotification(n,0,!1);break;default:console.error("[AppComponent] Unknown operation code:",e.operation),this._app.sendSnackbarNotification(`Unknown connection status: ${e.state}`,0,!1)}}onSwipeRight(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.set(!0)):(this.actionsSidenavOpened.set(!1),this.notificationsSidenavOpened.update(e=>!e)))}backdropClicked(){this.notificationsSidenavOpened.update(e=>e?!e:!1),this.actionsSidenavOpened.update(e=>e?!e:!1)}onSwipeLeft(){this._dashboard.isDashboardStatic()&&!this._uiEvent.isDragging()&&(this.isPhonePortrait().matches?(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.set(!0)):(this.notificationsSidenavOpened.set(!1),this.actionsSidenavOpened.update(e=>!e)))}ngOnDestroy(){this._uiEvent.removeGestureListeners(this._swipeLeftHandler,this._swipeRightHandler),this._uiEvent.removeHotkeyListener(this._hotkeyHandler),this.notificationHowl?.unload(),this.notificationHowl=void 0,this.scheduledOpen&&(clearTimeout(this.scheduledOpen),this.scheduledOpen=null)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=J({type:o,selectors:[["app-root"]],viewQuery:function(n,r){n&1&&yt(r.upgradeMessagesRef,wa,5),n&2&&vt()},inputs:{actionsSidenavOpened:[1,"actionsSidenavOpened"],notificationsSidenavOpened:[1,"notificationsSidenavOpened"]},outputs:{actionsSidenavOpened:"actionsSidenavOpenedChange",notificationsSidenavOpened:"notificationsSidenavOpenedChange"},decls:9,vars:6,consts:[["actionsSidenav",""],["upgradeMessages",""],["kipGestures","",1,"sidenav-container",3,"swipeleft","swiperight","backdropClick","mode","bridgeUiEvents"],["mode","over","position","start","autoFocus","true","disableClose","",1,"sidenav-notifications",3,"openedChange","keydown","opened"],["mode","over","position","end","autoFocus","true","disableClose","",1,"sidenav-actions",3,"openedChange","keydown","opened"],[3,"actionsSidenav"],[1,"router-outlet-container"],["role","alert","aria-live","polite",1,"config-upgrade-overlay"],[1,"config-upgrade-card"],["diameter","46","mode","indeterminate"],[1,"config-upgrade-text"],[1,"config-upgrade-messages"]],template:function(n,r){if(n&1){let s=K();b(0,"mat-sidenav-container",2),F("swipeleft",function(){return I(s),D(r.onSwipeLeft())})("swiperight",function(){return I(s),D(r.onSwipeRight())})("backdropClick",function(){return I(s),D(r.backdropClicked())}),b(1,"mat-sidenav",3),fn("openedChange",function(u){return I(s),dn(r.notificationsSidenavOpened,u)||(r.notificationsSidenavOpened=u),D(u)}),F("keydown",function(u){return I(s),D(r.escapeKeyPressed(u.key))}),ee(2,"menu-notifications"),T(),b(3,"mat-sidenav",4,0),fn("openedChange",function(u){return I(s),dn(r.actionsSidenavOpened,u)||(r.actionsSidenavOpened=u),D(u)}),F("keydown",function(u){return I(s),D(r.escapeKeyPressed(u.key))}),ee(5,"menu-actions",5),T(),b(6,"mat-sidenav-content"),ee(7,"router-outlet",6),T()(),$(8,Ea,9,1,"div",7)}if(n&2){let s=vi(4);ue("mode","horizontal")("bridgeUiEvents",!0),x(),un("opened",r.notificationsSidenavOpened),x(2),un("opened",r.actionsSidenavOpened),x(2),ue("actionsSidenav",s),x(3),U(r.upgrade.upgrading()?8:-1)}},dependencies:[Pr,Or,pe,Sr,ve,Bi,Ri,gr,hr,_r,pr,Ei,yn,vr,yr],styles:[".sidenav-container[_ngcontent-%COMP%]{height:100%;width:100%}mat-sidenav-content[_ngcontent-%COMP%]{overflow-y:hidden;overflow-x:hidden}mat-sidenav.sidenav-notifications[_ngcontent-%COMP%]{width:230px;z-index:1200}mat-sidenav.sidenav-actions[_ngcontent-%COMP%]{width:135px;z-index:1200;overflow-x:hidden}.config-upgrade-overlay[_ngcontent-%COMP%]{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:#00000073;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);z-index:2000;pointer-events:all}.config-upgrade-card[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:18px;padding:20px 24px;width:clamp(300px,60vw,640px);background:var(--kip-background, #1f1f1f);border:1px solid rgba(255,255,255,.18);border-radius:14px;color:var(--kip-contrast-color, #fff);box-shadow:0 6px 22px #0000008c}.config-upgrade-text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 4px;font-size:1.05rem;font-weight:600;letter-spacing:.5px}.config-upgrade-text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0 0 10px;font-size:.8rem;opacity:.85}.config-upgrade-messages[_ngcontent-%COMP%]{list-style:disc;margin:0;padding-left:18px;max-height:180px;font-size:.68rem;line-height:1.25;scrollbar-width:thin;overflow-y:auto}.config-upgrade-messages[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:2px}"]})}return o})();function Rr(o){return new N(3e3,!1)}function ka(){return new N(3100,!1)}function Ca(){return new N(3101,!1)}function Ma(o){return new N(3001,!1)}function Pa(o){return new N(3003,!1)}function Na(o){return new N(3004,!1)}function Lr(o,t){return new N(3005,!1)}function Br(){return new N(3006,!1)}function Vr(){return new N(3007,!1)}function Kr(o,t){return new N(3008,!1)}function zr(o){return new N(3002,!1)}function Hr(o,t,e,n,r){return new N(3010,!1)}function qr(){return new N(3011,!1)}function $r(){return new N(3012,!1)}function Ur(){return new N(3200,!1)}function jr(){return new N(3202,!1)}function Qr(){return new N(3013,!1)}function Gr(o){return new N(3014,!1)}function Wr(o){return new N(3015,!1)}function Xr(o){return new N(3016,!1)}function Yr(o,t){return new N(3404,!1)}function xa(o){return new N(3502,!1)}function Zr(o){return new N(3503,!1)}function Jr(){return new N(3300,!1)}function eo(o){return new N(3504,!1)}function to(o){return new N(3301,!1)}function no(o,t){return new N(3302,!1)}function io(o){return new N(3303,!1)}function ro(o,t){return new N(3400,!1)}function oo(o){return new N(3401,!1)}function ao(o){return new N(3402,!1)}function so(o,t){return new N(3505,!1)}function he(o){switch(o.length){case 0:return new Ee;case 1:return o[0];default:return new Et(o)}}function kn(o,t,e=new Map,n=new Map){let r=[],s=[],l=-1,u=null;if(t.forEach(d=>{let _=d.get("offset"),i=_==l,a=i&&u||new Map;d.forEach((c,f)=>{let m=f,h=c;if(f!=="offset")switch(m=o.normalizePropertyName(m,r),h){case Ye:h=e.get(f);break;case ne:h=n.get(f);break;default:h=o.normalizeStyleValue(f,m,h,r);break}a.set(m,h)}),i||s.push(a),u=a,l=_}),r.length)throw xa(r);return s}function Rt(o,t,e,n){switch(t){case"start":o.onStart(()=>n(e&&An(e,"start",o)));break;case"done":o.onDone(()=>n(e&&An(e,"done",o)));break;case"destroy":o.onDestroy(()=>n(e&&An(e,"destroy",o)));break}}function An(o,t,e){let n=e.totalTime,r=!!e.disabled,s=Ft(o.element,o.triggerName,o.fromState,o.toState,t||o.phaseName,n??o.totalTime,r),l=o._data;return l!=null&&(s._data=l),s}function Ft(o,t,e,n,r="",s=0,l){return{element:o,triggerName:t,fromState:e,toState:n,phaseName:r,totalTime:s,disabled:!!l}}function j(o,t,e){let n=o.get(t);return n||o.set(t,n=e),n}function Cn(o){let t=o.indexOf(":"),e=o.substring(1,t),n=o.slice(t+1);return[e,n]}var Oa=typeof document>"u"?null:document.documentElement;function Lt(o){let t=o.parentNode||o.host||null;return t===Oa?null:t}function Ia(o){return o.substring(1,6)=="ebkit"}var Ce=null,Fr=!1;function lo(o){Ce||(Ce=Da()||{},Fr=Ce.style?"WebkitAppearance"in Ce.style:!1);let t=!0;return Ce.style&&!Ia(o)&&(t=o in Ce.style,!t&&Fr&&(t="Webkit"+o.charAt(0).toUpperCase()+o.slice(1)in Ce.style)),t}function Da(){return typeof document<"u"?document.body:null}function Mn(o,t){for(;t;){if(t===o)return!0;t=Lt(t)}return!1}function Pn(o,t,e){if(e)return Array.from(o.querySelectorAll(t));let n=o.querySelector(t);return n?[n]:[]}var Ra=1e3,Nn="{{",Fa="}}",xn="ng-enter",Bt="ng-leave",et="ng-trigger",tt=".ng-trigger",On="ng-animating",Vt=".ng-animating";function fe(o){if(typeof o=="number")return o;let t=o.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Tn(parseFloat(t[1]),t[2])}function Tn(o,t){switch(t){case"s":return o*Ra;default:return o}}function nt(o,t,e){return o.hasOwnProperty("duration")?o:Ba(o,t,e)}var La=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function Ba(o,t,e){let n,r=0,s="";if(typeof o=="string"){let l=o.match(La);if(l===null)return t.push(Rr(o)),{duration:0,delay:0,easing:""};n=Tn(parseFloat(l[1]),l[2]);let u=l[3];u!=null&&(r=Tn(parseFloat(u),l[4]));let d=l[5];d&&(s=d)}else n=o;if(!e){let l=!1,u=t.length;n<0&&(t.push(ka()),l=!0),r<0&&(t.push(Ca()),l=!0),l&&t.splice(u,0,Rr(o))}return{duration:n,delay:r,easing:s}}function co(o){return o.length?o[0]instanceof Map?o:o.map(t=>new Map(Object.entries(t))):[]}function re(o,t,e){t.forEach((n,r)=>{let s=Kt(r);e&&!e.has(r)&&e.set(r,o.style[s]),o.style[s]=n})}function Se(o,t){t.forEach((e,n)=>{let r=Kt(n);o.style[r]=""})}function He(o){return Array.isArray(o)?o.length==1?o[0]:Vi(o):o}function uo(o,t,e){let n=t.params||{},r=In(o);r.length&&r.forEach(s=>{n.hasOwnProperty(s)||e.push(Ma(s))})}var En=new RegExp(`${Nn}\\s*(.+?)\\s*${Fa}`,"g");function In(o){let t=[];if(typeof o=="string"){let e;for(;e=En.exec(o);)t.push(e[1]);En.lastIndex=0}return t}function qe(o,t,e){let n=`${o}`,r=n.replace(En,(s,l)=>{let u=t[l];return u==null&&(e.push(Pa(l)),u=""),u.toString()});return r==n?o:r}var Va=/-+([a-z0-9])/g;function Kt(o){return o.replace(Va,(...t)=>t[1].toUpperCase())}function fo(o,t){return o===0||t===0}function mo(o,t,e){if(e.size&&t.length){let n=t[0],r=[];if(e.forEach((s,l)=>{n.has(l)||r.push(l),n.set(l,s)}),r.length)for(let s=1;s<t.length;s++){let l=t[s];r.forEach(u=>l.set(u,zt(o,u)))}}return t}function Q(o,t,e){switch(t.type){case k.Trigger:return o.visitTrigger(t,e);case k.State:return o.visitState(t,e);case k.Transition:return o.visitTransition(t,e);case k.Sequence:return o.visitSequence(t,e);case k.Group:return o.visitGroup(t,e);case k.Animate:return o.visitAnimate(t,e);case k.Keyframes:return o.visitKeyframes(t,e);case k.Style:return o.visitStyle(t,e);case k.Reference:return o.visitReference(t,e);case k.AnimateChild:return o.visitAnimateChild(t,e);case k.AnimateRef:return o.visitAnimateRef(t,e);case k.Query:return o.visitQuery(t,e);case k.Stagger:return o.visitStagger(t,e);default:throw Na(t.type)}}function zt(o,t){return window.getComputedStyle(o)[t]}var Xn=(()=>{class o{validateStyleProperty(e){return lo(e)}containsElement(e,n){return Mn(e,n)}getParentElement(e){return Lt(e)}query(e,n,r){return Pn(e,n,r)}computeStyle(e,n,r){return r||""}animate(e,n,r,s,l,u=[],d){return new Ee(r,s)}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})(),Pe=class{static NOOP=new Xn},Ne=class{};var Ka=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),jt=class extends Ne{normalizePropertyName(t,e){return Kt(t)}normalizeStyleValue(t,e,n,r){let s="",l=n.toString().trim();if(Ka.has(e)&&n!==0&&n!=="0")if(typeof n=="number")s="px";else{let u=n.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&r.push(Lr(t,n))}return l+s}};var Qt="*";function za(o,t){let e=[];return typeof o=="string"?o.split(/\s*,\s*/).forEach(n=>Ha(n,e,t)):e.push(o),e}function Ha(o,t,e){if(o[0]==":"){let d=qa(o,e);if(typeof d=="function"){t.push(d);return}o=d}let n=o.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(n==null||n.length<4)return e.push(Wr(o)),t;let r=n[1],s=n[2],l=n[3];t.push(po(r,l));let u=r==Qt&&l==Qt;s[0]=="<"&&!u&&t.push(po(l,r))}function qa(o,t){switch(o){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,n)=>parseFloat(n)>parseFloat(e);case":decrement":return(e,n)=>parseFloat(n)<parseFloat(e);default:return t.push(Xr(o)),"* => *"}}var Ht=new Set(["true","1"]),qt=new Set(["false","0"]);function po(o,t){let e=Ht.has(o)||qt.has(o),n=Ht.has(t)||qt.has(t);return(r,s)=>{let l=o==Qt||o==r,u=t==Qt||t==s;return!l&&e&&typeof r=="boolean"&&(l=r?Ht.has(o):qt.has(o)),!u&&n&&typeof s=="boolean"&&(u=s?Ht.has(t):qt.has(t)),l&&u}}var To=":self",$a=new RegExp(`s*${To}s*,?`,"g");function Eo(o,t,e,n){return new Vn(o).build(t,e,n)}var ho="",Vn=class{_driver;constructor(t){this._driver=t}build(t,e,n){let r=new Kn(e);return this._resetContextStyleTimingState(r),Q(this,He(t),r)}_resetContextStyleTimingState(t){t.currentQuerySelector=ho,t.collectedStyles=new Map,t.collectedStyles.set(ho,new Map),t.currentTime=0}visitTrigger(t,e){let n=e.queryCount=0,r=e.depCount=0,s=[],l=[];return t.name.charAt(0)=="@"&&e.errors.push(Br()),t.definitions.forEach(u=>{if(this._resetContextStyleTimingState(e),u.type==k.State){let d=u,_=d.name;_.toString().split(/\s*,\s*/).forEach(i=>{d.name=i,s.push(this.visitState(d,e))}),d.name=_}else if(u.type==k.Transition){let d=this.visitTransition(u,e);n+=d.queryCount,r+=d.depCount,l.push(d)}else e.errors.push(Vr())}),{type:k.Trigger,name:t.name,states:s,transitions:l,queryCount:n,depCount:r,options:null}}visitState(t,e){let n=this.visitStyle(t.styles,e),r=t.options&&t.options.params||null;if(n.containsDynamicStyles){let s=new Set,l=r||{};n.styles.forEach(u=>{u instanceof Map&&u.forEach(d=>{In(d).forEach(_=>{l.hasOwnProperty(_)||s.add(_)})})}),s.size&&e.errors.push(Kr(t.name,[...s.values()]))}return{type:k.State,name:t.name,style:n,options:r?{params:r}:null}}visitTransition(t,e){e.queryCount=0,e.depCount=0;let n=Q(this,He(t.animation),e),r=za(t.expr,e.errors);return{type:k.Transition,matchers:r,animation:n,queryCount:e.queryCount,depCount:e.depCount,options:Me(t.options)}}visitSequence(t,e){return{type:k.Sequence,steps:t.steps.map(n=>Q(this,n,e)),options:Me(t.options)}}visitGroup(t,e){let n=e.currentTime,r=0,s=t.steps.map(l=>{e.currentTime=n;let u=Q(this,l,e);return r=Math.max(r,e.currentTime),u});return e.currentTime=r,{type:k.Group,steps:s,options:Me(t.options)}}visitAnimate(t,e){let n=Ga(t.timings,e.errors);e.currentAnimateTimings=n;let r,s=t.styles?t.styles:hn({});if(s.type==k.Keyframes)r=this.visitKeyframes(s,e);else{let l=t.styles,u=!1;if(!l){u=!0;let _={};n.easing&&(_.easing=n.easing),l=hn(_)}e.currentTime+=n.duration+n.delay;let d=this.visitStyle(l,e);d.isEmptyStep=u,r=d}return e.currentAnimateTimings=null,{type:k.Animate,timings:n,style:r,options:null}}visitStyle(t,e){let n=this._makeStyleAst(t,e);return this._validateStyleAst(n,e),n}_makeStyleAst(t,e){let n=[],r=Array.isArray(t.styles)?t.styles:[t.styles];for(let u of r)typeof u=="string"?u===ne?n.push(u):e.errors.push(zr(u)):n.push(new Map(Object.entries(u)));let s=!1,l=null;return n.forEach(u=>{if(u instanceof Map&&(u.has("easing")&&(l=u.get("easing"),u.delete("easing")),!s)){for(let d of u.values())if(d.toString().indexOf(Nn)>=0){s=!0;break}}}),{type:k.Style,styles:n,easing:l,offset:t.offset,containsDynamicStyles:s,options:null}}_validateStyleAst(t,e){let n=e.currentAnimateTimings,r=e.currentTime,s=e.currentTime;n&&s>0&&(s-=n.duration+n.delay),t.styles.forEach(l=>{typeof l!="string"&&l.forEach((u,d)=>{let _=e.collectedStyles.get(e.currentQuerySelector),i=_.get(d),a=!0;i&&(s!=r&&s>=i.startTime&&r<=i.endTime&&(e.errors.push(Hr(d,i.startTime,i.endTime,s,r)),a=!1),s=i.startTime),a&&_.set(d,{startTime:s,endTime:r}),e.options&&uo(u,e.options,e.errors)})})}visitKeyframes(t,e){let n={type:k.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(qr()),n;let r=1,s=0,l=[],u=!1,d=!1,_=0,i=t.steps.map(g=>{let w=this._makeStyleAst(g,e),C=w.offset!=null?w.offset:Qa(w.styles),O=0;return C!=null&&(s++,O=w.offset=C),d=d||O<0||O>1,u=u||O<_,_=O,l.push(O),w});d&&e.errors.push($r()),u&&e.errors.push(Ur());let a=t.steps.length,c=0;s>0&&s<a?e.errors.push(jr()):s==0&&(c=r/(a-1));let f=a-1,m=e.currentTime,h=e.currentAnimateTimings,p=h.duration;return i.forEach((g,w)=>{let C=c>0?w==f?1:c*w:l[w],O=C*p;e.currentTime=m+h.delay+O,h.duration=O,this._validateStyleAst(g,e),g.offset=C,n.styles.push(g)}),n}visitReference(t,e){return{type:k.Reference,animation:Q(this,He(t.animation),e),options:Me(t.options)}}visitAnimateChild(t,e){return e.depCount++,{type:k.AnimateChild,options:Me(t.options)}}visitAnimateRef(t,e){return{type:k.AnimateRef,animation:this.visitReference(t.animation,e),options:Me(t.options)}}visitQuery(t,e){let n=e.currentQuerySelector,r=t.options||{};e.queryCount++,e.currentQuery=t;let[s,l]=Ua(t.selector);e.currentQuerySelector=n.length?n+" "+s:s,j(e.collectedStyles,e.currentQuerySelector,new Map);let u=Q(this,He(t.animation),e);return e.currentQuery=null,e.currentQuerySelector=n,{type:k.Query,selector:s,limit:r.limit||0,optional:!!r.optional,includeSelf:l,animation:u,originalSelector:t.selector,options:Me(t.options)}}visitStagger(t,e){e.currentQuery||e.errors.push(Qr());let n=t.timings==="full"?{duration:0,delay:0,easing:"full"}:nt(t.timings,e.errors,!0);return{type:k.Stagger,animation:Q(this,He(t.animation),e),timings:n,options:null}}};function Ua(o){let t=!!o.split(/\s*,\s*/).find(e=>e==To);return t&&(o=o.replace($a,"")),o=o.replace(/@\*/g,tt).replace(/@\w+/g,e=>tt+"-"+e.slice(1)).replace(/:animating/g,Vt),[o,t]}function ja(o){return o?X({},o):null}var Kn=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(t){this.errors=t}};function Qa(o){if(typeof o=="string")return null;let t=null;if(Array.isArray(o))o.forEach(e=>{if(e instanceof Map&&e.has("offset")){let n=e;t=parseFloat(n.get("offset")),n.delete("offset")}});else if(o instanceof Map&&o.has("offset")){let e=o;t=parseFloat(e.get("offset")),e.delete("offset")}return t}function Ga(o,t){if(o.hasOwnProperty("duration"))return o;if(typeof o=="number"){let s=nt(o,t).duration;return Dn(s,0,"")}let e=o;if(e.split(/\s+/).some(s=>s.charAt(0)=="{"&&s.charAt(1)=="{")){let s=Dn(0,0,"");return s.dynamic=!0,s.strValue=e,s}let r=nt(e,t);return Dn(r.duration,r.delay,r.easing)}function Me(o){return o?(o=X({},o),o.params&&(o.params=ja(o.params))):o={},o}function Dn(o,t,e){return{duration:o,delay:t,easing:e}}function Yn(o,t,e,n,r,s,l=null,u=!1){return{type:1,element:o,keyframes:t,preStyleProps:e,postStyleProps:n,duration:r,delay:s,totalTime:r+s,easing:l,subTimeline:u}}var rt=class{_map=new Map;get(t){return this._map.get(t)||[]}append(t,e){let n=this._map.get(t);n||this._map.set(t,n=[]),n.push(...e)}has(t){return this._map.has(t)}clear(){this._map.clear()}},Wa=1,Xa=":enter",Ya=new RegExp(Xa,"g"),Za=":leave",Ja=new RegExp(Za,"g");function ko(o,t,e,n,r,s=new Map,l=new Map,u,d,_=[]){return new zn().buildKeyframes(o,t,e,n,r,s,l,u,d,_)}var zn=class{buildKeyframes(t,e,n,r,s,l,u,d,_,i=[]){_=_||new rt;let a=new Hn(t,e,_,r,s,i,[]);a.options=d;let c=d.delay?fe(d.delay):0;a.currentTimeline.delayNextStep(c),a.currentTimeline.setStyles([l],null,a.errors,d),Q(this,n,a);let f=a.timelines.filter(m=>m.containsAnimation());if(f.length&&u.size){let m;for(let h=f.length-1;h>=0;h--){let p=f[h];if(p.element===e){m=p;break}}m&&!m.allowOnlyTimelineStyles()&&m.setStyles([u],null,a.errors,d)}return f.length?f.map(m=>m.buildKeyframes()):[Yn(e,[],[],[],0,c,"",!1)]}visitTrigger(t,e){}visitState(t,e){}visitTransition(t,e){}visitAnimateChild(t,e){let n=e.subInstructions.get(e.element);if(n){let r=e.createSubContext(t.options),s=e.currentTimeline.currentTime,l=this._visitSubInstructions(n,r,r.options);s!=l&&e.transformIntoNewTimeline(l)}e.previousNode=t}visitAnimateRef(t,e){let n=e.createSubContext(t.options);n.transformIntoNewTimeline(),this._applyAnimationRefDelays([t.options,t.animation.options],e,n),this.visitReference(t.animation,n),e.transformIntoNewTimeline(n.currentTimeline.currentTime),e.previousNode=t}_applyAnimationRefDelays(t,e,n){for(let r of t){let s=r?.delay;if(s){let l=typeof s=="number"?s:fe(qe(s,r?.params??{},e.errors));n.delayNextStep(l)}}}_visitSubInstructions(t,e,n){let s=e.currentTimeline.currentTime,l=n.duration!=null?fe(n.duration):null,u=n.delay!=null?fe(n.delay):null;return l!==0&&t.forEach(d=>{let _=e.appendInstructionToTimeline(d,l,u);s=Math.max(s,_.duration+_.delay)}),s}visitReference(t,e){e.updateOptions(t.options,!0),Q(this,t.animation,e),e.previousNode=t}visitSequence(t,e){let n=e.subContextCount,r=e,s=t.options;if(s&&(s.params||s.delay)&&(r=e.createSubContext(s),r.transformIntoNewTimeline(),s.delay!=null)){r.previousNode.type==k.Style&&(r.currentTimeline.snapshotCurrentStyles(),r.previousNode=Gt);let l=fe(s.delay);r.delayNextStep(l)}t.steps.length&&(t.steps.forEach(l=>Q(this,l,r)),r.currentTimeline.applyStylesToKeyframe(),r.subContextCount>n&&r.transformIntoNewTimeline()),e.previousNode=t}visitGroup(t,e){let n=[],r=e.currentTimeline.currentTime,s=t.options&&t.options.delay?fe(t.options.delay):0;t.steps.forEach(l=>{let u=e.createSubContext(t.options);s&&u.delayNextStep(s),Q(this,l,u),r=Math.max(r,u.currentTimeline.currentTime),n.push(u.currentTimeline)}),n.forEach(l=>e.currentTimeline.mergeTimelineCollectedStyles(l)),e.transformIntoNewTimeline(r),e.previousNode=t}_visitTiming(t,e){if(t.dynamic){let n=t.strValue,r=e.params?qe(n,e.params,e.errors):n;return nt(r,e.errors)}else return{duration:t.duration,delay:t.delay,easing:t.easing}}visitAnimate(t,e){let n=e.currentAnimateTimings=this._visitTiming(t.timings,e),r=e.currentTimeline;n.delay&&(e.incrementTime(n.delay),r.snapshotCurrentStyles());let s=t.style;s.type==k.Keyframes?this.visitKeyframes(s,e):(e.incrementTime(n.duration),this.visitStyle(s,e),r.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=t}visitStyle(t,e){let n=e.currentTimeline,r=e.currentAnimateTimings;!r&&n.hasCurrentStyleProperties()&&n.forwardFrame();let s=r&&r.easing||t.easing;t.isEmptyStep?n.applyEmptyStep(s):n.setStyles(t.styles,s,e.errors,e.options),e.previousNode=t}visitKeyframes(t,e){let n=e.currentAnimateTimings,r=e.currentTimeline.duration,s=n.duration,u=e.createSubContext().currentTimeline;u.easing=n.easing,t.styles.forEach(d=>{let _=d.offset||0;u.forwardTime(_*s),u.setStyles(d.styles,d.easing,e.errors,e.options),u.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(u),e.transformIntoNewTimeline(r+s),e.previousNode=t}visitQuery(t,e){let n=e.currentTimeline.currentTime,r=t.options||{},s=r.delay?fe(r.delay):0;s&&(e.previousNode.type===k.Style||n==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Gt);let l=n,u=e.invokeQuery(t.selector,t.originalSelector,t.limit,t.includeSelf,!!r.optional,e.errors);e.currentQueryTotal=u.length;let d=null;u.forEach((_,i)=>{e.currentQueryIndex=i;let a=e.createSubContext(t.options,_);s&&a.delayNextStep(s),_===e.element&&(d=a.currentTimeline),Q(this,t.animation,a),a.currentTimeline.applyStylesToKeyframe();let c=a.currentTimeline.currentTime;l=Math.max(l,c)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(l),d&&(e.currentTimeline.mergeTimelineCollectedStyles(d),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=t}visitStagger(t,e){let n=e.parentContext,r=e.currentTimeline,s=t.timings,l=Math.abs(s.duration),u=l*(e.currentQueryTotal-1),d=l*e.currentQueryIndex;switch(s.duration<0?"reverse":s.easing){case"reverse":d=u-d;break;case"full":d=n.currentStaggerTime;break}let i=e.currentTimeline;d&&i.delayNextStep(d);let a=i.currentTime;Q(this,t.animation,e),e.previousNode=t,n.currentStaggerTime=r.currentTime-a+(r.startTime-n.currentTimeline.startTime)}},Gt={},Hn=class o{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Gt;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(t,e,n,r,s,l,u,d){this._driver=t,this.element=e,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=s,this.errors=l,this.timelines=u,this.currentTimeline=d||new Wt(this._driver,e,0),u.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(t,e){if(!t)return;let n=t,r=this.options;n.duration!=null&&(r.duration=fe(n.duration)),n.delay!=null&&(r.delay=fe(n.delay));let s=n.params;if(s){let l=r.params;l||(l=this.options.params={}),Object.keys(s).forEach(u=>{(!e||!l.hasOwnProperty(u))&&(l[u]=qe(s[u],l,this.errors))})}}_copyOptions(){let t={};if(this.options){let e=this.options.params;if(e){let n=t.params={};Object.keys(e).forEach(r=>{n[r]=e[r]})}}return t}createSubContext(t=null,e,n){let r=e||this.element,s=new o(this._driver,r,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(r,n||0));return s.previousNode=this.previousNode,s.currentAnimateTimings=this.currentAnimateTimings,s.options=this._copyOptions(),s.updateOptions(t),s.currentQueryIndex=this.currentQueryIndex,s.currentQueryTotal=this.currentQueryTotal,s.parentContext=this,this.subContextCount++,s}transformIntoNewTimeline(t){return this.previousNode=Gt,this.currentTimeline=this.currentTimeline.fork(this.element,t),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(t,e,n){let r={duration:e??t.duration,delay:this.currentTimeline.currentTime+(n??0)+t.delay,easing:""},s=new qn(this._driver,t.element,t.keyframes,t.preStyleProps,t.postStyleProps,r,t.stretchStartingKeyframe);return this.timelines.push(s),r}incrementTime(t){this.currentTimeline.forwardTime(this.currentTimeline.duration+t)}delayNextStep(t){t>0&&this.currentTimeline.delayNextStep(t)}invokeQuery(t,e,n,r,s,l){let u=[];if(r&&u.push(this.element),t.length>0){t=t.replace(Ya,"."+this._enterClassName),t=t.replace(Ja,"."+this._leaveClassName);let d=n!=1,_=this._driver.query(this.element,t,d);n!==0&&(_=n<0?_.slice(_.length+n,_.length):_.slice(0,n)),u.push(..._)}return!s&&u.length==0&&l.push(Gr(e)),u}},Wt=class o{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(t,e,n,r){this._driver=t,this.element=e,this.startTime=n,this._elementTimelineStylesLookup=r,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(t){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+t),e&&this.snapshotCurrentStyles()):this.startTime+=t}fork(t,e){return this.applyStylesToKeyframe(),new o(this._driver,t,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=Wa,this._loadKeyframe()}forwardTime(t){this.applyStylesToKeyframe(),this.duration=t,this._loadKeyframe()}_updateStyle(t,e){this._localTimelineStyles.set(t,e),this._globalTimelineStyles.set(t,e),this._styleSummary.set(t,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(t){t&&this._previousKeyframe.set("easing",t);for(let[e,n]of this._globalTimelineStyles)this._backFill.set(e,n||ne),this._currentKeyframe.set(e,ne);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(t,e,n,r){e&&this._previousKeyframe.set("easing",e);let s=r&&r.params||{},l=es(t,this._globalTimelineStyles);for(let[u,d]of l){let _=qe(d,s,n);this._pendingStyles.set(u,_),this._localTimelineStyles.has(u)||this._backFill.set(u,this._globalTimelineStyles.get(u)??ne),this._updateStyle(u,_)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((t,e)=>{this._currentKeyframe.set(e,t)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((t,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,t)}))}snapshotCurrentStyles(){for(let[t,e]of this._localTimelineStyles)this._pendingStyles.set(t,e),this._updateStyle(t,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let t=[];for(let e in this._currentKeyframe)t.push(e);return t}mergeTimelineCollectedStyles(t){t._styleSummary.forEach((e,n)=>{let r=this._styleSummary.get(n);(!r||e.time>r.time)&&this._updateStyle(n,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let t=new Set,e=new Set,n=this._keyframes.size===1&&this.duration===0,r=[];this._keyframes.forEach((u,d)=>{let _=new Map([...this._backFill,...u]);_.forEach((i,a)=>{i===Ye?t.add(a):i===ne&&e.add(a)}),n||_.set("offset",d/this.duration),r.push(_)});let s=[...t.values()],l=[...e.values()];if(n){let u=r[0],d=new Map(u);u.set("offset",0),d.set("offset",1),r=[u,d]}return Yn(this.element,r,s,l,this.duration,this.startTime,this.easing,!1)}},qn=class extends Wt{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(t,e,n,r,s,l,u=!1){super(t,e,l.delay),this.keyframes=n,this.preStyleProps=r,this.postStyleProps=s,this._stretchStartingKeyframe=u,this.timings={duration:l.duration,delay:l.delay,easing:l.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let t=this.keyframes,{delay:e,duration:n,easing:r}=this.timings;if(this._stretchStartingKeyframe&&e){let s=[],l=n+e,u=e/l,d=new Map(t[0]);d.set("offset",0),s.push(d);let _=new Map(t[0]);_.set("offset",_o(u)),s.push(_);let i=t.length-1;for(let a=1;a<=i;a++){let c=new Map(t[a]),f=c.get("offset"),m=e+f*n;c.set("offset",_o(m/l)),s.push(c)}n=l,e=0,r="",t=s}return Yn(this.element,t,this.preStyleProps,this.postStyleProps,n,e,r,!0)}};function _o(o,t=3){let e=Math.pow(10,t-1);return Math.round(o*e)/e}function es(o,t){let e=new Map,n;return o.forEach(r=>{if(r==="*"){n??=t.keys();for(let s of n)e.set(s,ne)}else for(let[s,l]of r)e.set(s,l)}),e}function go(o,t,e,n,r,s,l,u,d,_,i,a,c){return{type:0,element:o,triggerName:t,isRemovalTransition:r,fromState:e,fromStyles:s,toState:n,toStyles:l,timelines:u,queriedElements:d,preStyleProps:_,postStyleProps:i,totalTime:a,errors:c}}var Rn={},Xt=class{_triggerName;ast;_stateStyles;constructor(t,e,n){this._triggerName=t,this.ast=e,this._stateStyles=n}match(t,e,n,r){return ts(this.ast.matchers,t,e,n,r)}buildStyles(t,e,n){let r=this._stateStyles.get("*");return t!==void 0&&(r=this._stateStyles.get(t?.toString())||r),r?r.buildStyles(e,n):new Map}build(t,e,n,r,s,l,u,d,_,i){let a=[],c=this.ast.options&&this.ast.options.params||Rn,f=u&&u.params||Rn,m=this.buildStyles(n,f,a),h=d&&d.params||Rn,p=this.buildStyles(r,h,a),g=new Set,w=new Map,C=new Map,O=r==="void",G={params:Co(h,c),delay:this.ast.options?.delay},q=i?[]:ko(t,e,this.ast.animation,s,l,m,p,G,_,a),B=0;return q.forEach(E=>{B=Math.max(E.duration+E.delay,B)}),a.length?go(e,this._triggerName,n,r,O,m,p,[],[],w,C,B,a):(q.forEach(E=>{let ae=E.element,me=j(w,ae,new Set);E.preStyleProps.forEach(se=>me.add(se));let st=j(C,ae,new Set);E.postStyleProps.forEach(se=>st.add(se)),ae!==e&&g.add(ae)}),go(e,this._triggerName,n,r,O,m,p,q,[...g.values()],w,C,B))}};function ts(o,t,e,n,r){return o.some(s=>s(t,e,n,r))}function Co(o,t){let e=X({},t);return Object.entries(o).forEach(([n,r])=>{r!=null&&(e[n]=r)}),e}var $n=class{styles;defaultParams;normalizer;constructor(t,e,n){this.styles=t,this.defaultParams=e,this.normalizer=n}buildStyles(t,e){let n=new Map,r=Co(t,this.defaultParams);return this.styles.styles.forEach(s=>{typeof s!="string"&&s.forEach((l,u)=>{l&&(l=qe(l,r,e));let d=this.normalizer.normalizePropertyName(u,e);l=this.normalizer.normalizeStyleValue(u,d,l,e),n.set(u,l)})}),n}};function ns(o,t,e){return new Un(o,t,e)}var Un=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(t,e,n){this.name=t,this.ast=e,this._normalizer=n,e.states.forEach(r=>{let s=r.options&&r.options.params||{};this.states.set(r.name,new $n(r.style,s,n))}),yo(this.states,"true","1"),yo(this.states,"false","0"),e.transitions.forEach(r=>{this.transitionFactories.push(new Xt(t,r,this.states))}),this.fallbackTransition=is(t,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(t,e,n,r){return this.transitionFactories.find(l=>l.match(t,e,n,r))||null}matchStyles(t,e,n){return this.fallbackTransition.buildStyles(t,e,n)}};function is(o,t,e){let n=[(l,u)=>!0],r={type:k.Sequence,steps:[],options:null},s={type:k.Transition,animation:r,matchers:n,options:null,queryCount:0,depCount:0};return new Xt(o,s,t)}function yo(o,t,e){o.has(t)?o.has(e)||o.set(e,o.get(t)):o.has(e)&&o.set(t,o.get(e))}var rs=new rt,jn=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(t,e,n){this.bodyNode=t,this._driver=e,this._normalizer=n}register(t,e){let n=[],r=[],s=Eo(this._driver,e,n,r);if(n.length)throw Zr(n);this._animations.set(t,s)}_buildPlayer(t,e,n){let r=t.element,s=kn(this._normalizer,t.keyframes,e,n);return this._driver.animate(r,s,t.duration,t.delay,t.easing,[],!0)}create(t,e,n={}){let r=[],s=this._animations.get(t),l,u=new Map;if(s?(l=ko(this._driver,e,s,xn,Bt,new Map,new Map,n,rs,r),l.forEach(i=>{let a=j(u,i.element,new Map);i.postStyleProps.forEach(c=>a.set(c,null))})):(r.push(Jr()),l=[]),r.length)throw eo(r);u.forEach((i,a)=>{i.forEach((c,f)=>{i.set(f,this._driver.computeStyle(a,f,ne))})});let d=l.map(i=>{let a=u.get(i.element);return this._buildPlayer(i,new Map,a)}),_=he(d);return this._playersById.set(t,_),_.onDestroy(()=>this.destroy(t)),this.players.push(_),_}destroy(t){let e=this._getPlayer(t);e.destroy(),this._playersById.delete(t);let n=this.players.indexOf(e);n>=0&&this.players.splice(n,1)}_getPlayer(t){let e=this._playersById.get(t);if(!e)throw to(t);return e}listen(t,e,n,r){let s=Ft(e,"","","");return Rt(this._getPlayer(t),n,s,r),()=>{}}command(t,e,n,r){if(n=="register"){this.register(t,r[0]);return}if(n=="create"){let l=r[0]||{};this.create(t,e,l);return}let s=this._getPlayer(t);switch(n){case"play":s.play();break;case"pause":s.pause();break;case"reset":s.reset();break;case"restart":s.restart();break;case"finish":s.finish();break;case"init":s.init();break;case"setPosition":s.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(t);break}}},vo="ng-animate-queued",os=".ng-animate-queued",Fn="ng-animate-disabled",as=".ng-animate-disabled",ss="ng-star-inserted",ls=".ng-star-inserted",cs=[],Mo={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},us={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},oe="__ng_removed",ot=class{namespaceId;value;options;get params(){return this.options.params}constructor(t,e=""){this.namespaceId=e;let n=t&&t.hasOwnProperty("value"),r=n?t.value:t;if(this.value=fs(r),n){let s=t,{value:l}=s,u=ti(s,["value"]);this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(t){let e=t.params;if(e){let n=this.options.params;Object.keys(e).forEach(r=>{n[r]==null&&(n[r]=e[r])})}}},it="void",Ln=new ot(it),Qn=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(t,e,n){this.id=t,this.hostElement=e,this._engine=n,this._hostClassName="ng-tns-"+t,Z(e,this._hostClassName)}listen(t,e,n,r){if(!this._triggers.has(e))throw no(n,e);if(n==null||n.length==0)throw io(e);if(!ms(n))throw ro(n,e);let s=j(this._elementListeners,t,[]),l={name:e,phase:n,callback:r};s.push(l);let u=j(this._engine.statesByElement,t,new Map);return u.has(e)||(Z(t,et),Z(t,et+"-"+e),u.set(e,Ln)),()=>{this._engine.afterFlush(()=>{let d=s.indexOf(l);d>=0&&s.splice(d,1),this._triggers.has(e)||u.delete(e)})}}register(t,e){return this._triggers.has(t)?!1:(this._triggers.set(t,e),!0)}_getTrigger(t){let e=this._triggers.get(t);if(!e)throw oo(t);return e}trigger(t,e,n,r=!0){let s=this._getTrigger(e),l=new at(this.id,e,t),u=this._engine.statesByElement.get(t);u||(Z(t,et),Z(t,et+"-"+e),this._engine.statesByElement.set(t,u=new Map));let d=u.get(e),_=new ot(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&d&&_.absorbOptions(d.options),u.set(e,_),d||(d=Ln),!(_.value===it)&&d.value===_.value){if(!_s(d.params,_.params)){let h=[],p=s.matchStyles(d.value,d.params,h),g=s.matchStyles(_.value,_.params,h);h.length?this._engine.reportError(h):this._engine.afterFlush(()=>{Se(t,p),re(t,g)})}return}let c=j(this._engine.playersByElement,t,[]);c.forEach(h=>{h.namespaceId==this.id&&h.triggerName==e&&h.queued&&h.destroy()});let f=s.matchTransition(d.value,_.value,t,_.params),m=!1;if(!f){if(!r)return;f=s.fallbackTransition,m=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:e,transition:f,fromState:d,toState:_,player:l,isFallbackTransition:m}),m||(Z(t,vo),l.onStart(()=>{$e(t,vo)})),l.onDone(()=>{let h=this.players.indexOf(l);h>=0&&this.players.splice(h,1);let p=this._engine.playersByElement.get(t);if(p){let g=p.indexOf(l);g>=0&&p.splice(g,1)}}),this.players.push(l),c.push(l),l}deregister(t){this._triggers.delete(t),this._engine.statesByElement.forEach(e=>e.delete(t)),this._elementListeners.forEach((e,n)=>{this._elementListeners.set(n,e.filter(r=>r.name!=t))})}clearElementCache(t){this._engine.statesByElement.delete(t),this._elementListeners.delete(t);let e=this._engine.playersByElement.get(t);e&&(e.forEach(n=>n.destroy()),this._engine.playersByElement.delete(t))}_signalRemovalForInnerTriggers(t,e){let n=this._engine.driver.query(t,tt,!0);n.forEach(r=>{if(r[oe])return;let s=this._engine.fetchNamespacesByElement(r);s.size?s.forEach(l=>l.triggerLeaveAnimation(r,e,!1,!0)):this.clearElementCache(r)}),this._engine.afterFlushAnimationsDone(()=>n.forEach(r=>this.clearElementCache(r)))}triggerLeaveAnimation(t,e,n,r){let s=this._engine.statesByElement.get(t),l=new Map;if(s){let u=[];if(s.forEach((d,_)=>{if(l.set(_,d.value),this._triggers.has(_)){let i=this.trigger(t,_,it,r);i&&u.push(i)}}),u.length)return this._engine.markElementAsRemoved(this.id,t,!0,e,l),n&&he(u).onDone(()=>this._engine.processLeaveNode(t)),!0}return!1}prepareLeaveAnimationListeners(t){let e=this._elementListeners.get(t),n=this._engine.statesByElement.get(t);if(e&&n){let r=new Set;e.forEach(s=>{let l=s.name;if(r.has(l))return;r.add(l);let d=this._triggers.get(l).fallbackTransition,_=n.get(l)||Ln,i=new ot(it),a=new at(this.id,l,t);this._engine.totalQueuedPlayers++,this._queue.push({element:t,triggerName:l,transition:d,fromState:_,toState:i,player:a,isFallbackTransition:!0})})}}removeNode(t,e){let n=this._engine;if(t.childElementCount&&this._signalRemovalForInnerTriggers(t,e),this.triggerLeaveAnimation(t,e,!0))return;let r=!1;if(n.totalAnimations){let s=n.players.length?n.playersByQueriedElement.get(t):[];if(s&&s.length)r=!0;else{let l=t;for(;l=l.parentNode;)if(n.statesByElement.get(l)){r=!0;break}}}if(this.prepareLeaveAnimationListeners(t),r)n.markElementAsRemoved(this.id,t,!1,e);else{let s=t[oe];(!s||s===Mo)&&(n.afterFlush(()=>this.clearElementCache(t)),n.destroyInnerAnimations(t),n._onRemovalComplete(t,e))}}insertNode(t,e){Z(t,this._hostClassName)}drainQueuedTransitions(t){let e=[];return this._queue.forEach(n=>{let r=n.player;if(r.destroyed)return;let s=n.element,l=this._elementListeners.get(s);l&&l.forEach(u=>{if(u.name==n.triggerName){let d=Ft(s,n.triggerName,n.fromState.value,n.toState.value);d._data=t,Rt(n.player,u.phase,d,u.callback)}}),r.markedForDestroy?this._engine.afterFlush(()=>{r.destroy()}):e.push(n)}),this._queue=[],e.sort((n,r)=>{let s=n.transition.ast.depCount,l=r.transition.ast.depCount;return s==0||l==0?s-l:this._engine.driver.containsElement(n.element,r.element)?1:-1})}destroy(t){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,t)}},Gn=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(t,e)=>{};_onRemovalComplete(t,e){this.onRemovalComplete(t,e)}constructor(t,e,n){this.bodyNode=t,this.driver=e,this._normalizer=n}get queuedPlayers(){let t=[];return this._namespaceList.forEach(e=>{e.players.forEach(n=>{n.queued&&t.push(n)})}),t}createNamespace(t,e){let n=new Qn(t,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(n,e):(this.newHostElements.set(e,n),this.collectEnterElement(e)),this._namespaceLookup[t]=n}_balanceNamespaceList(t,e){let n=this._namespaceList,r=this.namespacesByHostElement;if(n.length-1>=0){let l=!1,u=this.driver.getParentElement(e);for(;u;){let d=r.get(u);if(d){let _=n.indexOf(d);n.splice(_+1,0,t),l=!0;break}u=this.driver.getParentElement(u)}l||n.unshift(t)}else n.push(t);return r.set(e,t),t}register(t,e){let n=this._namespaceLookup[t];return n||(n=this.createNamespace(t,e)),n}registerTrigger(t,e,n){let r=this._namespaceLookup[t];r&&r.register(e,n)&&this.totalAnimations++}destroy(t,e){t&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let n=this._fetchNamespace(t);this.namespacesByHostElement.delete(n.hostElement);let r=this._namespaceList.indexOf(n);r>=0&&this._namespaceList.splice(r,1),n.destroy(e),delete this._namespaceLookup[t]}))}_fetchNamespace(t){return this._namespaceLookup[t]}fetchNamespacesByElement(t){let e=new Set,n=this.statesByElement.get(t);if(n){for(let r of n.values())if(r.namespaceId){let s=this._fetchNamespace(r.namespaceId);s&&e.add(s)}}return e}trigger(t,e,n,r){if($t(e)){let s=this._fetchNamespace(t);if(s)return s.trigger(e,n,r),!0}return!1}insertNode(t,e,n,r){if(!$t(e))return;let s=e[oe];if(s&&s.setForRemoval){s.setForRemoval=!1,s.setForMove=!0;let l=this.collectedLeaveElements.indexOf(e);l>=0&&this.collectedLeaveElements.splice(l,1)}if(t){let l=this._fetchNamespace(t);l&&l.insertNode(e,n)}r&&this.collectEnterElement(e)}collectEnterElement(t){this.collectedEnterElements.push(t)}markElementAsDisabled(t,e){e?this.disabledNodes.has(t)||(this.disabledNodes.add(t),Z(t,Fn)):this.disabledNodes.has(t)&&(this.disabledNodes.delete(t),$e(t,Fn))}removeNode(t,e,n){if($t(e)){let r=t?this._fetchNamespace(t):null;r?r.removeNode(e,n):this.markElementAsRemoved(t,e,!1,n);let s=this.namespacesByHostElement.get(e);s&&s.id!==t&&s.removeNode(e,n)}else this._onRemovalComplete(e,n)}markElementAsRemoved(t,e,n,r,s){this.collectedLeaveElements.push(e),e[oe]={namespaceId:t,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1,previousTriggersValues:s}}listen(t,e,n,r,s){return $t(e)?this._fetchNamespace(t).listen(e,n,r,s):()=>{}}_buildInstruction(t,e,n,r,s){return t.transition.build(this.driver,t.element,t.fromState.value,t.toState.value,n,r,t.fromState.options,t.toState.options,e,s)}destroyInnerAnimations(t){let e=this.driver.query(t,tt,!0);e.forEach(n=>this.destroyActiveAnimationsForElement(n)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(t,Vt,!0),e.forEach(n=>this.finishActiveQueriedAnimationOnElement(n)))}destroyActiveAnimationsForElement(t){let e=this.playersByElement.get(t);e&&e.forEach(n=>{n.queued?n.markedForDestroy=!0:n.destroy()})}finishActiveQueriedAnimationOnElement(t){let e=this.playersByQueriedElement.get(t);e&&e.forEach(n=>n.finish())}whenRenderingDone(){return new Promise(t=>{if(this.players.length)return he(this.players).onDone(()=>t());t()})}processLeaveNode(t){let e=t[oe];if(e&&e.setForRemoval){if(t[oe]=Mo,e.namespaceId){this.destroyInnerAnimations(t);let n=this._fetchNamespace(e.namespaceId);n&&n.clearElementCache(t)}this._onRemovalComplete(t,e.setForRemoval)}t.classList?.contains(Fn)&&this.markElementAsDisabled(t,!1),this.driver.query(t,as,!0).forEach(n=>{this.markElementAsDisabled(n,!1)})}flush(t=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((n,r)=>this._balanceNamespaceList(n,r)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let n=0;n<this.collectedEnterElements.length;n++){let r=this.collectedEnterElements[n];Z(r,ss)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let n=[];try{e=this._flushAnimations(n,t)}finally{for(let r=0;r<n.length;r++)n[r]()}}else for(let n=0;n<this.collectedLeaveElements.length;n++){let r=this.collectedLeaveElements[n];this.processLeaveNode(r)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(n=>n()),this._flushFns=[],this._whenQuietFns.length){let n=this._whenQuietFns;this._whenQuietFns=[],e.length?he(e).onDone(()=>{n.forEach(r=>r())}):n.forEach(r=>r())}}reportError(t){throw ao(t)}_flushAnimations(t,e){let n=new rt,r=[],s=new Map,l=[],u=new Map,d=new Map,_=new Map,i=new Set;this.disabledNodes.forEach(v=>{i.add(v);let S=this.driver.query(v,os,!0);for(let A=0;A<S.length;A++)i.add(S[A])});let a=this.bodyNode,c=Array.from(this.statesByElement.keys()),f=wo(c,this.collectedEnterElements),m=new Map,h=0;f.forEach((v,S)=>{let A=xn+h++;m.set(S,A),v.forEach(P=>Z(P,A))});let p=[],g=new Set,w=new Set;for(let v=0;v<this.collectedLeaveElements.length;v++){let S=this.collectedLeaveElements[v],A=S[oe];A&&A.setForRemoval&&(p.push(S),g.add(S),A.hasAnimation?this.driver.query(S,ls,!0).forEach(P=>g.add(P)):w.add(S))}let C=new Map,O=wo(c,Array.from(g));O.forEach((v,S)=>{let A=Bt+h++;C.set(S,A),v.forEach(P=>Z(P,A))}),t.push(()=>{f.forEach((v,S)=>{let A=m.get(S);v.forEach(P=>$e(P,A))}),O.forEach((v,S)=>{let A=C.get(S);v.forEach(P=>$e(P,A))}),p.forEach(v=>{this.processLeaveNode(v)})});let G=[],q=[];for(let v=this._namespaceList.length-1;v>=0;v--)this._namespaceList[v].drainQueuedTransitions(e).forEach(A=>{let P=A.player,V=A.element;if(G.push(P),this.collectedEnterElements.length){let z=V[oe];if(z&&z.setForMove){if(z.previousTriggersValues&&z.previousTriggersValues.has(A.triggerName)){let we=z.previousTriggersValues.get(A.triggerName),Y=this.statesByElement.get(A.element);if(Y&&Y.has(A.triggerName)){let ct=Y.get(A.triggerName);ct.value=we,Y.set(A.triggerName,ct)}}P.destroy();return}}let ce=!a||!this.driver.containsElement(a,V),W=C.get(V),_e=m.get(V),R=this._buildInstruction(A,n,_e,W,ce);if(R.errors&&R.errors.length){q.push(R);return}if(ce){P.onStart(()=>Se(V,R.fromStyles)),P.onDestroy(()=>re(V,R.toStyles)),r.push(P);return}if(A.isFallbackTransition){P.onStart(()=>Se(V,R.fromStyles)),P.onDestroy(()=>re(V,R.toStyles)),r.push(P);return}let Jn=[];R.timelines.forEach(z=>{z.stretchStartingKeyframe=!0,this.disabledNodes.has(z.element)||Jn.push(z)}),R.timelines=Jn,n.append(V,R.timelines);let Bo={instruction:R,player:P,element:V};l.push(Bo),R.queriedElements.forEach(z=>j(u,z,[]).push(P)),R.preStyleProps.forEach((z,we)=>{if(z.size){let Y=d.get(we);Y||d.set(we,Y=new Set),z.forEach((ct,tn)=>Y.add(tn))}}),R.postStyleProps.forEach((z,we)=>{let Y=_.get(we);Y||_.set(we,Y=new Set),z.forEach((ct,tn)=>Y.add(tn))})});if(q.length){let v=[];q.forEach(S=>{v.push(so(S.triggerName,S.errors))}),G.forEach(S=>S.destroy()),this.reportError(v)}let B=new Map,E=new Map;l.forEach(v=>{let S=v.element;n.has(S)&&(E.set(S,S),this._beforeAnimationBuild(v.player.namespaceId,v.instruction,B))}),r.forEach(v=>{let S=v.element;this._getPreviousPlayers(S,!1,v.namespaceId,v.triggerName,null).forEach(P=>{j(B,S,[]).push(P),P.destroy()})});let ae=p.filter(v=>Ao(v,d,_)),me=new Map;So(me,this.driver,w,_,ne).forEach(v=>{Ao(v,d,_)&&ae.push(v)});let se=new Map;f.forEach((v,S)=>{So(se,this.driver,new Set(v),d,Ye)}),ae.forEach(v=>{let S=me.get(v),A=se.get(v);me.set(v,new Map([...S?.entries()??[],...A?.entries()??[]]))});let le=[],lt=[],Zn={};l.forEach(v=>{let{element:S,player:A,instruction:P}=v;if(n.has(S)){if(i.has(S)){A.onDestroy(()=>re(S,P.toStyles)),A.disabled=!0,A.overrideTotalTime(P.totalTime),r.push(A);return}let V=Zn;if(E.size>1){let W=S,_e=[];for(;W=W.parentNode;){let R=E.get(W);if(R){V=R;break}_e.push(W)}_e.forEach(R=>E.set(R,V))}let ce=this._buildAnimation(A.namespaceId,P,B,s,se,me);if(A.setRealPlayer(ce),V===Zn)le.push(A);else{let W=this.playersByElement.get(V);W&&W.length&&(A.parentPlayer=he(W)),r.push(A)}}else Se(S,P.fromStyles),A.onDestroy(()=>re(S,P.toStyles)),lt.push(A),i.has(S)&&r.push(A)}),lt.forEach(v=>{let S=s.get(v.element);if(S&&S.length){let A=he(S);v.setRealPlayer(A)}}),r.forEach(v=>{v.parentPlayer?v.syncPlayerEvents(v.parentPlayer):v.destroy()});for(let v=0;v<p.length;v++){let S=p[v],A=S[oe];if($e(S,Bt),A&&A.hasAnimation)continue;let P=[];if(u.size){let ce=u.get(S);ce&&ce.length&&P.push(...ce);let W=this.driver.query(S,Vt,!0);for(let _e=0;_e<W.length;_e++){let R=u.get(W[_e]);R&&R.length&&P.push(...R)}}let V=P.filter(ce=>!ce.destroyed);V.length?ps(this,S,V):this.processLeaveNode(S)}return p.length=0,le.forEach(v=>{this.players.push(v),v.onDone(()=>{v.destroy();let S=this.players.indexOf(v);this.players.splice(S,1)}),v.play()}),le}afterFlush(t){this._flushFns.push(t)}afterFlushAnimationsDone(t){this._whenQuietFns.push(t)}_getPreviousPlayers(t,e,n,r,s){let l=[];if(e){let u=this.playersByQueriedElement.get(t);u&&(l=u)}else{let u=this.playersByElement.get(t);if(u){let d=!s||s==it;u.forEach(_=>{_.queued||!d&&_.triggerName!=r||l.push(_)})}}return(n||r)&&(l=l.filter(u=>!(n&&n!=u.namespaceId||r&&r!=u.triggerName))),l}_beforeAnimationBuild(t,e,n){let r=e.triggerName,s=e.element,l=e.isRemovalTransition?void 0:t,u=e.isRemovalTransition?void 0:r;for(let d of e.timelines){let _=d.element,i=_!==s,a=j(n,_,[]);this._getPreviousPlayers(_,i,l,u,e.toState).forEach(f=>{let m=f.getRealPlayer();m.beforeDestroy&&m.beforeDestroy(),f.destroy(),a.push(f)})}Se(s,e.fromStyles)}_buildAnimation(t,e,n,r,s,l){let u=e.triggerName,d=e.element,_=[],i=new Set,a=new Set,c=e.timelines.map(m=>{let h=m.element;i.add(h);let p=h[oe];if(p&&p.removedBeforeQueried)return new Ee(m.duration,m.delay);let g=h!==d,w=hs((n.get(h)||cs).map(B=>B.getRealPlayer())).filter(B=>{let E=B;return E.element?E.element===h:!1}),C=s.get(h),O=l.get(h),G=kn(this._normalizer,m.keyframes,C,O),q=this._buildPlayer(m,G,w);if(m.subTimeline&&r&&a.add(h),g){let B=new at(t,u,h);B.setRealPlayer(q),_.push(B)}return q});_.forEach(m=>{j(this.playersByQueriedElement,m.element,[]).push(m),m.onDone(()=>ds(this.playersByQueriedElement,m.element,m))}),i.forEach(m=>Z(m,On));let f=he(c);return f.onDestroy(()=>{i.forEach(m=>$e(m,On)),re(d,e.toStyles)}),a.forEach(m=>{j(r,m,[]).push(f)}),f}_buildPlayer(t,e,n){return e.length>0?this.driver.animate(t.element,e,t.duration,t.delay,t.easing,n):new Ee(t.duration,t.delay)}},at=class{namespaceId;triggerName;element;_player=new Ee;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(t,e,n){this.namespaceId=t,this.triggerName=e,this.element=n}setRealPlayer(t){this._containsRealPlayer||(this._player=t,this._queuedCallbacks.forEach((e,n)=>{e.forEach(r=>Rt(t,n,void 0,r))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(t.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(t){this.totalTime=t}syncPlayerEvents(t){let e=this._player;e.triggerCallback&&t.onStart(()=>e.triggerCallback("start")),t.onDone(()=>this.finish()),t.onDestroy(()=>this.destroy())}_queueEvent(t,e){j(this._queuedCallbacks,t,[]).push(e)}onDone(t){this.queued&&this._queueEvent("done",t),this._player.onDone(t)}onStart(t){this.queued&&this._queueEvent("start",t),this._player.onStart(t)}onDestroy(t){this.queued&&this._queueEvent("destroy",t),this._player.onDestroy(t)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(t){this.queued||this._player.setPosition(t)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(t){let e=this._player;e.triggerCallback&&e.triggerCallback(t)}};function ds(o,t,e){let n=o.get(t);if(n){if(n.length){let r=n.indexOf(e);n.splice(r,1)}n.length==0&&o.delete(t)}return n}function fs(o){return o??null}function $t(o){return o&&o.nodeType===1}function ms(o){return o=="start"||o=="done"}function bo(o,t){let e=o.style.display;return o.style.display=t??"none",e}function So(o,t,e,n,r){let s=[];e.forEach(d=>s.push(bo(d)));let l=[];n.forEach((d,_)=>{let i=new Map;d.forEach(a=>{let c=t.computeStyle(_,a,r);i.set(a,c),(!c||c.length==0)&&(_[oe]=us,l.push(_))}),o.set(_,i)});let u=0;return e.forEach(d=>bo(d,s[u++])),l}function wo(o,t){let e=new Map;if(o.forEach(u=>e.set(u,[])),t.length==0)return e;let n=1,r=new Set(t),s=new Map;function l(u){if(!u)return n;let d=s.get(u);if(d)return d;let _=u.parentNode;return e.has(_)?d=_:r.has(_)?d=n:d=l(_),s.set(u,d),d}return t.forEach(u=>{let d=l(u);d!==n&&e.get(d).push(u)}),e}function Z(o,t){o.classList?.add(t)}function $e(o,t){o.classList?.remove(t)}function ps(o,t,e){he(e).onDone(()=>o.processLeaveNode(t))}function hs(o){let t=[];return Po(o,t),t}function Po(o,t){for(let e=0;e<o.length;e++){let n=o[e];n instanceof Et?Po(n.players,t):t.push(n)}}function _s(o,t){let e=Object.keys(o),n=Object.keys(t);if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let s=e[r];if(!t.hasOwnProperty(s)||o[s]!==t[s])return!1}return!0}function Ao(o,t,e){let n=e.get(o);if(!n)return!1;let r=t.get(o);return r?n.forEach(s=>r.add(s)):t.set(o,n),e.delete(o),!0}var Ue=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(t,e)=>{};constructor(t,e,n){this._driver=e,this._normalizer=n,this._transitionEngine=new Gn(t.body,e,n),this._timelineEngine=new jn(t.body,e,n),this._transitionEngine.onRemovalComplete=(r,s)=>this.onRemovalComplete(r,s)}registerTrigger(t,e,n,r,s){let l=t+"-"+r,u=this._triggerCache[l];if(!u){let d=[],_=[],i=Eo(this._driver,s,d,_);if(d.length)throw Yr(r,d);u=ns(r,i,this._normalizer),this._triggerCache[l]=u}this._transitionEngine.registerTrigger(e,r,u)}register(t,e){this._transitionEngine.register(t,e)}destroy(t,e){this._transitionEngine.destroy(t,e)}onInsert(t,e,n,r){this._transitionEngine.insertNode(t,e,n,r)}onRemove(t,e,n){this._transitionEngine.removeNode(t,e,n)}disableAnimations(t,e){this._transitionEngine.markElementAsDisabled(t,e)}process(t,e,n,r){if(n.charAt(0)=="@"){let[s,l]=Cn(n),u=r;this._timelineEngine.command(s,e,l,u)}else this._transitionEngine.trigger(t,e,n,r)}listen(t,e,n,r,s){if(n.charAt(0)=="@"){let[l,u]=Cn(n);return this._timelineEngine.listen(l,e,u,s)}return this._transitionEngine.listen(t,e,n,r,s)}flush(t=-1){this._transitionEngine.flush(t)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(t){this._transitionEngine.afterFlushAnimationsDone(t)}};function gs(o,t){let e=null,n=null;return Array.isArray(t)&&t.length?(e=Bn(t[0]),t.length>1&&(n=Bn(t[t.length-1]))):t instanceof Map&&(e=Bn(t)),e||n?new ys(o,e,n):null}var ys=(()=>{class o{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,n,r){this._element=e,this._startStyles=n,this._endStyles=r;let s=o.initialStylesByElement.get(e);s||o.initialStylesByElement.set(e,s=new Map),this._initialStyles=s}start(){this._state<1&&(this._startStyles&&re(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(re(this._element,this._initialStyles),this._endStyles&&(re(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(o.initialStylesByElement.delete(this._element),this._startStyles&&(Se(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Se(this._element,this._endStyles),this._endStyles=null),re(this._element,this._initialStyles),this._state=3)}}return o})();function Bn(o){let t=null;return o.forEach((e,n)=>{vs(n)&&(t=t||new Map,t.set(n,e))}),t}function vs(o){return o==="display"||o==="position"}var Yt=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(t,e,n,r){this.element=t,this.keyframes=e,this.options=n,this._specialStyles=r,this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(t=>t()),this._onDoneFns=[])}init(){this._buildPlayer(),this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return;this._initialized=!0;let t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:new Map;let e=()=>this._onFinish();this.domPlayer.addEventListener("finish",e),this.onDestroy(()=>{this.domPlayer.removeEventListener("finish",e)})}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()}_convertKeyframesToObject(t){let e=[];return t.forEach(n=>{e.push(Object.fromEntries(n))}),e}_triggerWebAnimation(t,e,n){return t.animate(this._convertKeyframesToObject(e),n)}onStart(t){this._originalOnStartFns.push(t),this._onStartFns.push(t)}onDone(t){this._originalOnDoneFns.push(t),this._onDoneFns.push(t)}onDestroy(t){this._onDestroyFns.push(t)}play(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(t=>t()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),this.domPlayer.play()}pause(){this.init(),this.domPlayer.pause()}finish(){this.init(),this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish()}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer&&this.domPlayer.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(t=>t()),this._onDestroyFns=[])}setPosition(t){this.domPlayer===void 0&&this.init(),this.domPlayer.currentTime=t*this.time}getPosition(){return+(this.domPlayer.currentTime??0)/this.time}get totalTime(){return this._delay+this._duration}beforeDestroy(){let t=new Map;this.hasStarted()&&this._finalKeyframe.forEach((n,r)=>{r!=="offset"&&t.set(r,this._finished?n:zt(this.element,r))}),this.currentSnapshot=t}triggerCallback(t){let e=t==="start"?this._onStartFns:this._onDoneFns;e.forEach(n=>n()),e.length=0}},Zt=class{validateStyleProperty(t){return!0}validateAnimatableStyleProperty(t){return!0}containsElement(t,e){return Mn(t,e)}getParentElement(t){return Lt(t)}query(t,e,n){return Pn(t,e,n)}computeStyle(t,e,n){return zt(t,e)}animate(t,e,n,r,s,l=[]){let u=r==0?"both":"forwards",d={duration:n,delay:r,fill:u};s&&(d.easing=s);let _=new Map,i=l.filter(f=>f instanceof Yt);fo(n,r)&&i.forEach(f=>{f.currentSnapshot.forEach((m,h)=>_.set(h,m))});let a=co(e).map(f=>new Map(f));a=mo(t,a,_);let c=gs(t,a);return new Yt(t,a,d,c)}};var Ut="@",No="@.disabled",Jt=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(t,e,n,r){this.namespaceId=t,this.delegate=e,this.engine=n,this._onDestroy=r}get data(){return this.delegate.data}destroyNode(t){this.delegate.destroyNode?.(t)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(t,e){return this.delegate.createElement(t,e)}createComment(t){return this.delegate.createComment(t)}createText(t){return this.delegate.createText(t)}appendChild(t,e){this.delegate.appendChild(t,e),this.engine.onInsert(this.namespaceId,e,t,!1)}insertBefore(t,e,n,r=!0){this.delegate.insertBefore(t,e,n),this.engine.onInsert(this.namespaceId,e,t,r)}removeChild(t,e,n){this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(t,e){return this.delegate.selectRootElement(t,e)}parentNode(t){return this.delegate.parentNode(t)}nextSibling(t){return this.delegate.nextSibling(t)}setAttribute(t,e,n,r){this.delegate.setAttribute(t,e,n,r)}removeAttribute(t,e,n){this.delegate.removeAttribute(t,e,n)}addClass(t,e){this.delegate.addClass(t,e)}removeClass(t,e){this.delegate.removeClass(t,e)}setStyle(t,e,n,r){this.delegate.setStyle(t,e,n,r)}removeStyle(t,e,n){this.delegate.removeStyle(t,e,n)}setProperty(t,e,n){e.charAt(0)==Ut&&e==No?this.disableAnimations(t,!!n):this.delegate.setProperty(t,e,n)}setValue(t,e){this.delegate.setValue(t,e)}listen(t,e,n,r){return this.delegate.listen(t,e,n,r)}disableAnimations(t,e){this.engine.disableAnimations(t,e)}},Wn=class extends Jt{factory;constructor(t,e,n,r,s){super(e,n,r,s),this.factory=t,this.namespaceId=e}setProperty(t,e,n){e.charAt(0)==Ut?e.charAt(1)=="."&&e==No?(n=n===void 0?!0:!!n,this.disableAnimations(t,n)):this.engine.process(this.namespaceId,t,e.slice(1),n):this.delegate.setProperty(t,e,n)}listen(t,e,n,r){if(e.charAt(0)==Ut){let s=bs(t),l=e.slice(1),u="";return l.charAt(0)!=Ut&&([l,u]=Ss(l)),this.engine.listen(this.namespaceId,s,l,u,d=>{let _=d._data||-1;this.factory.scheduleListenerCallback(_,n,d)})}return this.delegate.listen(t,e,n,r)}};function bs(o){switch(o){case"body":return document.body;case"document":return document;case"window":return window;default:return o}}function Ss(o){let t=o.indexOf("."),e=o.substring(0,t),n=o.slice(t+1);return[e,n]}var en=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(t,e,n){this.delegate=t,this.engine=e,this._zone=n,e.onRemovalComplete=(r,s)=>{s?.removeChild(null,r)}}createRenderer(t,e){let r=this.delegate.createRenderer(t,e);if(!t||!e?.data?.animation){let _=this._rendererCache,i=_.get(r);if(!i){let a=()=>_.delete(r);i=new Jt("",r,this.engine,a),_.set(r,i)}return i}let s=e.id,l=e.id+"-"+this._currentId;this._currentId++,this.engine.register(l,t);let u=_=>{Array.isArray(_)?_.forEach(u):this.engine.registerTrigger(s,l,t,_.name,_)};return e.data.animation.forEach(u),new Wn(this,l,r,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(t,e,n){if(t>=0&&t<this._microtaskId){this._zone.run(()=>e(n));return}let r=this._animationCallbacksBuffer;r.length==0&&queueMicrotask(()=>{this._zone.run(()=>{r.forEach(s=>{let[l,u]=s;l(u)}),this._animationCallbacksBuffer=[]})}),r.push([e,n])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(t){this.engine.flush(),this.delegate.componentReplaced?.(t)}};var As=(()=>{class o extends Ue{constructor(e,n,r){super(e,n,r)}ngOnDestroy(){this.flush()}static \u0275fac=function(n){return new(n||o)(ft(mt),ft(Pe),ft(Ne))};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();function Ts(){return new jt}function Es(o,t,e){return new en(o,t,e)}var xo=[{provide:Ne,useFactory:Ts},{provide:Ue,useClass:As},{provide:pi,useFactory:Es,deps:[Oi,Ue,ht]}],iu=[{provide:Pe,useClass:Xn},{provide:on,useValue:"NoopAnimations"},...xo],ks=[{provide:Pe,useFactory:()=>new Zt},{provide:on,useFactory:()=>"BrowserAnimations"},...xo];function Oo(){return hi("NgEagerAnimations"),[...ks]}var Io=11,Do="connectionConfig",Ro=(()=>{class o{config;isLoggedIn=null;loggedInSubscription=null;connection=y(wt);auth=y(ge);connectionStateMachine=y(De);router=y(ye);delta=y(Be);data=y(Ve);storage=y(At);constructor(){this.loggedInSubscription=this.auth.isLoggedIn$.subscribe(e=>{this.isLoggedIn=e})}initNetworkServices(){return nn(this,null,function*(){this.loadLocalStorageConfig(),this.preloadFonts();try{this.config?.signalKUrl!==void 0&&this.config.signalKUrl!==null&&(yield this.connection.initializeConnection({url:this.config.signalKUrl,new:!1},this.config.proxyEnabled,this.config.signalKSubscribeAll)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.config?.loginName&&this.config?.loginPassword&&(yield this.login()),this.isLoggedIn&&this.config?.useSharedConfig&&(this.storage.activeConfigFileVersion=Io,this.storage.sharedConfigName=this.config.sharedConfigName,yield this.storage.getConfig("user",this.config.sharedConfigName,Io,!0)),!this.isLoggedIn&&this.config?.signalKUrl&&this.config?.useSharedConfig&&this.router.navigate(["/login"])}catch(e){return e.status===0?console.warn("[AppInit Network Service] Initialization failed. Network error. Redirecting to settings page."):e.status===401?console.warn("[AppInit Network Service] Initialization failed. Unauthorized access. Redirecting to login page."):console.warn("[AppInit Network Service] Initialization failed. Error: ",JSON.stringify(e)),Promise.reject("[AppInit Network Service] Startup completed with connection issue.")}finally{console.log("[AppInit Network Service] Initialization completed"),this.connectionStateMachine.enableWebSocketMode(),this.connectionStateMachine.isHTTPConnected()&&(console.log("[AppInit Network Service] Starting WebSocket connection after initialization"),this.connectionStateMachine.startWebSocketConnection())}})}login(){return nn(this,null,function*(){if(!this.isLoggedIn&&this.config.useSharedConfig&&this.config.loginName&&this.config.loginPassword)try{yield this.auth.login({usr:this.config.loginName,pwd:this.config.loginPassword})}catch(e){throw e.status===0?this.router.navigate(["/settings"]):e.status===401&&this.router.navigate(["/login"]),e}})}setLocalStorageConfig(){localStorage.setItem(Do,JSON.stringify(this.config))}loadLocalStorageConfig(){this.config=JSON.parse(localStorage.getItem(Do)),this.config?this.config.signalKUrl||(this.config.signalKUrl=window.location.origin,this.setLocalStorageConfig(),console.log(`[AppInit Network Service] Config found with no server URL. Setting Auto-Discovery URL: ${this.config.signalKUrl}`)):(this.config=Mi,this.config.signalKUrl=window.location.origin,console.log(`[AppInit Network Service] Connection Configuration not found. Creating configuration using Auto-Discovery URL: ${this.config.signalKUrl}`),this.setLocalStorageConfig()),this.config.configVersion==9&&(this.config.configVersion=10,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 9 to 10")),this.config.configVersion==10&&(this.config.configVersion=11,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 10 to 11")),this.config.configVersion==11&&(this.config.configVersion=12,this.setLocalStorageConfig(),console.log("[AppInit Network Service] Upgrading Connection version from 11 to 12"))}preloadFonts(){let e=[{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fChc4AMP6lbBP.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmSU5fBBc4AMP6lQ.woff2)",options:{weight:"300",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2)",options:{weight:"400",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fChc4AMP6lbBP.woff2)",options:{weight:"500",style:"normal"}},{family:"Roboto",src:"url(./assets/google-fonts/KFOlCnqEu92Fr1MmEU9fBBc4AMP6lQ.woff2)",options:{weight:"500",style:"normal"}}];for(let{family:n,src:r,options:s}of e){let l=new FontFace(n,r,s);l.load().then(()=>document.fonts.add(l)).catch(u=>console.log(`[AppInit Network Service] Error loading fonts: ${u}`))}}ngOnDestroy(){this.loggedInSubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();var Fo=(()=>{class o{auth=y(ge);authToken=null;authTokenSubscription=null;constructor(){this.authTokenSubscription=this.auth.authToken$.subscribe(e=>{this.authToken=e})}intercept(e,n){let r=e.clone();return this.authToken&&(r=e.clone({headers:e.headers.set("authorization","JWT "+this.authToken.token)})),n.handle(r)}ngOnDestroy(){this.authTokenSubscription?.unsubscribe()}static \u0275fac=function(n){return new(n||o)};static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();var Lo=(()=>{class o extends Pt{_createContainer(){let e=document.createElement("div");e.classList.add("cdk-overlay-container"),(document.getElementById("app-filter-wrapper")||document.querySelector("app-root")||document.body).appendChild(e),this._containerElement=e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=di(o)))(r||o)}})();static \u0275prov=H({token:o,factory:o.\u0275fac})}return o})();Ar.production&&void 0;Ii(Dr,{providers:[li(Di),{provide:Pi,useClass:Fo,multi:!0},{provide:Yi,useValue:{hasBackdrop:!0,disableClose:!1,autoFocus:"first-tabbable",delayFocusTrap:!0,backdropClass:"dialogBackdrop"}},{provide:Zi,useValue:{appearance:"outline",floatLabel:"always",subscriptSizing:"dynamic"}},{provide:dr,useValue:{showDelay:1500,hideDelay:0}},ge,Ve,wt,Be,De,Nt,Re,er,de,be,nr,At,br(),Ni(xi()),Fi(wr,Li()),Oo(),{provide:Pt,useClass:Lo},yi(()=>new Ro().initNetworkServices().then(()=>{}).catch(()=>{}))]});
|