@camera.ui/browser 0.0.70 → 0.0.71

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/dist/bundle.js CHANGED
@@ -1 +1 @@
1
- var t={275:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",h="[object Map]",l="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",m="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",O="[object Int16Array]",k="[object Int32Array]",A="[object Uint8Array]",T="[object Uint8ClampedArray]",x="[object Uint16Array]",j="[object Uint32Array]",C=/\w*$/,R=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,D={};D[s]=D["[object Array]"]=D[v]=D[w]=D[o]=D[a]=D[S]=D[_]=D[E]=D[O]=D[k]=D[h]=D[l]=D[f]=D[p]=D[g]=D[y]=D[b]=D[A]=D[T]=D[x]=D[j]=!0,D["[object Error]"]=D[c]=D[m]=!1;var B="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,F="object"==typeof self&&self&&self.Object===Object&&self,N=B||F||Function("return this")(),P=e&&!e.nodeType&&e,z=P&&t&&!t.nodeType&&t,I=z&&z.exports===P;function U(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function q(t,e,n,r){var i=-1,s=t?t.length:0;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function W(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function H(t,e){return function(n){return t(e(n))}}function $(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var G,J=Array.prototype,K=Function.prototype,Y=Object.prototype,X=N["__core-js_shared__"],Q=(G=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Z=K.toString,tt=Y.hasOwnProperty,et=Y.toString,nt=RegExp("^"+Z.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=I?N.Buffer:void 0,it=N.Symbol,st=N.Uint8Array,ot=H(Object.getPrototypeOf,Object),at=Object.create,ct=Y.propertyIsEnumerable,ut=J.splice,ht=Object.getOwnPropertySymbols,lt=rt?rt.isBuffer:void 0,ft=H(Object.keys,Object),dt=Nt(N,"DataView"),pt=Nt(N,"Map"),gt=Nt(N,"Promise"),yt=Nt(N,"Set"),bt=Nt(N,"WeakMap"),mt=Nt(Object,"create"),vt=Mt(dt),wt=Mt(pt),St=Mt(gt),_t=Mt(yt),Et=Mt(bt),Ot=it?it.prototype:void 0,kt=Ot?Ot.valueOf:void 0;function At(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Tt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function xt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jt(t){this.__data__=new Tt(t)}function Ct(t,e,n){var r=t[e];tt.call(t,e)&&qt(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function Rt(t,e){for(var n=t.length;n--;)if(qt(t[n][0],e))return n;return-1}function Lt(t,e,n,r,i,d,m){var R;if(r&&(R=d?r(t,i,d,m):r(t)),void 0!==R)return R;if(!Gt(t))return t;var L=Vt(t);if(L){if(R=function(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!e)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,R)}else{var B=zt(t),F=B==c||B==u;if(Ht(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(B==f||B==s||F&&!d){if(V(t))return d?t:{};if(R=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:Gt(e=ot(t))?at(e):{};var e}(F?{}:t),!e)return function(t,e){return Bt(t,Pt(t),e)}(t,function(t,e){return t&&Bt(e,Jt(e),t)}(R,t))}else{if(!D[B])return d?t:{};R=function(t,e,n,r){var i,s=t.constructor;switch(e){case v:return Dt(t);case o:case a:return new s(+t);case w:return function(t,e){var n=e?Dt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,r);case S:case _:case E:case O:case k:case A:case T:case x:case j:return function(t,e){var n=e?Dt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,r);case h:return function(t,e,n){return q(e?n(W(t),!0):W(t),U,new t.constructor)}(t,r,n);case l:case y:return new s(t);case p:return function(t){var e=new t.constructor(t.source,C.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,n){return q(e?n($(t),!0):$(t),M,new t.constructor)}(t,r,n);case b:return i=t,kt?Object(kt.call(i)):{}}}(t,B,Lt,e)}}m||(m=new jt);var N=m.get(t);if(N)return N;if(m.set(t,R),!L)var P=n?function(t){return function(t,e,n){var r=e(t);return Vt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Jt,Pt)}(t):Jt(t);return function(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n););}(P||t,(function(i,s){P&&(i=t[s=i]),Ct(R,s,Lt(i,e,n,r,s,t,m))})),R}function Dt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Bt(t,e,n,r){n||(n={});for(var i=-1,s=e.length;++i<s;){var o=e[i],a=r?r(n[o],t[o],o,n,t):void 0;Ct(n,o,void 0===a?t[o]:a)}return n}function Ft(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Gt(t)||(e=t,Q&&Q in e))&&($t(t)||V(t)?nt:R).test(Mt(t));var e}(n)?n:void 0}At.prototype.clear=function(){this.__data__=mt?mt(null):{}},At.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},At.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return tt.call(e,t)?e[t]:void 0},At.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:tt.call(e,t)},At.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,n=Rt(e,t);return!(n<0||(n==e.length-1?e.pop():ut.call(e,n,1),0))},Tt.prototype.get=function(t){var e=this.__data__,n=Rt(e,t);return n<0?void 0:e[n][1]},Tt.prototype.has=function(t){return Rt(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var n=this.__data__,r=Rt(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new At,map:new(pt||Tt),string:new At}},xt.prototype.delete=function(t){return Ft(this,t).delete(t)},xt.prototype.get=function(t){return Ft(this,t).get(t)},xt.prototype.has=function(t){return Ft(this,t).has(t)},xt.prototype.set=function(t,e){return Ft(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Tt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Tt){var r=n.__data__;if(!pt||r.length<199)return r.push([t,e]),this;n=this.__data__=new xt(r)}return n.set(t,e),this};var Pt=ht?H(ht,Object):function(){return[]},zt=function(t){return et.call(t)};function It(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Y)}function Mt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function qt(t,e){return t===e||t!=t&&e!=e}(dt&&zt(new dt(new ArrayBuffer(1)))!=w||pt&&zt(new pt)!=h||gt&&zt(gt.resolve())!=d||yt&&zt(new yt)!=g||bt&&zt(new bt)!=m)&&(zt=function(t){var e=et.call(t),n=e==f?t.constructor:void 0,r=n?Mt(n):void 0;if(r)switch(r){case vt:return w;case wt:return h;case St:return d;case _t:return g;case Et:return m}return e});var Vt=Array.isArray;function Wt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!$t(t)}var Ht=lt||function(){return!1};function $t(t){var e=Gt(t)?et.call(t):"";return e==c||e==u}function Gt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Wt(t)?function(t,e){var n=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Wt(t)}(t)&&tt.call(t,"callee")&&(!ct.call(t,"callee")||et.call(t)==s)}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!tt.call(t,o)||i&&("length"==o||It(o,r))||n.push(o);return n}(t):function(t){if(!Ut(t))return ft(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},512:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",h="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Null]",m="[object Object]",v="[object Promise]",w="[object Proxy]",S="[object RegExp]",_="[object Set]",E="[object String]",O="[object Undefined]",k="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",x=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[a]=C[c]=C[A]=C[h]=C[T]=C[l]=C[f]=C[d]=C[g]=C[y]=C[m]=C[S]=C[_]=C[E]=C[k]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,L="object"==typeof self&&self&&self.Object===Object&&self,D=R||L||Function("return this")(),B=e&&!e.nodeType&&e,F=B&&t&&!t.nodeType&&t,N=F&&F.exports===B,P=N&&R.process,z=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),I=z&&z.isTypedArray;function U(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function M(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function q(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var V,W,H,$=Array.prototype,G=Function.prototype,J=Object.prototype,K=D["__core-js_shared__"],Y=G.toString,X=J.hasOwnProperty,Q=(V=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Z=J.toString,tt=RegExp("^"+Y.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=N?D.Buffer:void 0,nt=D.Symbol,rt=D.Uint8Array,it=J.propertyIsEnumerable,st=$.splice,ot=nt?nt.toStringTag:void 0,at=Object.getOwnPropertySymbols,ct=et?et.isBuffer:void 0,ut=(W=Object.keys,H=Object,function(t){return W(H(t))}),ht=Ft(D,"DataView"),lt=Ft(D,"Map"),ft=Ft(D,"Promise"),dt=Ft(D,"Set"),pt=Ft(D,"WeakMap"),gt=Ft(Object,"create"),yt=It(ht),bt=It(lt),mt=It(ft),vt=It(dt),wt=It(pt),St=nt?nt.prototype:void 0,_t=St?St.valueOf:void 0;function Et(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function kt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function At(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new kt;++e<n;)this.add(t[e])}function Tt(t){var e=this.__data__=new Ot(t);this.size=e.size}function xt(t,e){for(var n=t.length;n--;)if(Ut(t[n][0],e))return n;return-1}function jt(t){return null==t?void 0===t?O:b:ot&&ot in Object(t)?function(t){var e=X.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch(t){}var i=Z.call(t);return r&&(e?t[ot]=n:delete t[ot]),i}(t):function(t){return Z.call(t)}(t)}function Ct(t){return Gt(t)&&jt(t)==a}function Rt(t,e,n,r,o){return t===e||(null==t||null==e||!Gt(t)&&!Gt(e)?t!=t&&e!=e:function(t,e,n,r,o,u){var d=qt(t),p=qt(e),b=d?c:Pt(t),v=p?c:Pt(e),w=(b=b==a?m:b)==m,O=(v=v==a?m:v)==m,k=b==v;if(k&&Vt(t)){if(!Vt(e))return!1;d=!0,w=!1}if(k&&!w)return u||(u=new Tt),d||Jt(t)?Lt(t,e,n,r,o,u):function(t,e,n,r,o,a,c){switch(n){case T:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case A:return!(t.byteLength!=e.byteLength||!a(new rt(t),new rt(e)));case h:case l:case y:return Ut(+t,+e);case f:return t.name==e.name&&t.message==e.message;case S:case E:return t==e+"";case g:var u=M;case _:var d=r&i;if(u||(u=q),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;r|=s,c.set(t,e);var b=Lt(u(t),u(e),r,o,a,c);return c.delete(t),b;case"[object Symbol]":if(_t)return _t.call(t)==_t.call(e)}return!1}(t,e,b,n,r,o,u);if(!(n&i)){var x=w&&X.call(t,"__wrapped__"),j=O&&X.call(e,"__wrapped__");if(x||j){var C=x?t.value():t,R=j?e.value():e;return u||(u=new Tt),o(C,R,n,r,u)}}return!!k&&(u||(u=new Tt),function(t,e,n,r,s,o){var a=n&i,c=Dt(t),u=c.length;if(u!=Dt(e).length&&!a)return!1;for(var h=u;h--;){var l=c[h];if(!(a?l in e:X.call(e,l)))return!1}var f=o.get(t);if(f&&o.get(e))return f==e;var d=!0;o.set(t,e),o.set(e,t);for(var p=a;++h<u;){var g=t[l=c[h]],y=e[l];if(r)var b=a?r(y,g,l,e,t,o):r(g,y,l,t,e,o);if(!(void 0===b?g===y||s(g,y,n,r,o):b)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var m=t.constructor,v=e.constructor;m==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,o,u))}(t,e,n,r,Rt,o))}function Lt(t,e,n,r,o,a){var c=n&i,u=t.length,h=e.length;if(u!=h&&!(c&&h>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var f=-1,d=!0,p=n&s?new At:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var g=t[f],y=e[f];if(r)var b=c?r(y,g,f,e,t,a):r(g,y,f,t,e,a);if(void 0!==b){if(b)continue;d=!1;break}if(p){if(!U(e,(function(t,e){if(i=e,!p.has(i)&&(g===t||o(g,t,n,r,a)))return p.push(e);var i}))){d=!1;break}}else if(g!==y&&!o(g,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Dt(t){return function(t,e,n){var r=e(t);return qt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Kt,Nt)}function Bt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!$t(t)||function(t){return!!Q&&Q in t}(t))&&(Wt(t)?tt:x).test(It(t))}(n)?n:void 0}Et.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},Et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Et.prototype.get=function(t){var e=this.__data__;if(gt){var n=e[t];return n===r?void 0:n}return X.call(e,t)?e[t]:void 0},Et.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:X.call(e,t)},Et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=gt&&void 0===e?r:e,this},Ot.prototype.clear=function(){this.__data__=[],this.size=0},Ot.prototype.delete=function(t){var e=this.__data__,n=xt(e,t);return!(n<0||(n==e.length-1?e.pop():st.call(e,n,1),--this.size,0))},Ot.prototype.get=function(t){var e=this.__data__,n=xt(e,t);return n<0?void 0:e[n][1]},Ot.prototype.has=function(t){return xt(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=xt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},kt.prototype.clear=function(){this.size=0,this.__data__={hash:new Et,map:new(lt||Ot),string:new Et}},kt.prototype.delete=function(t){var e=Bt(this,t).delete(t);return this.size-=e?1:0,e},kt.prototype.get=function(t){return Bt(this,t).get(t)},kt.prototype.has=function(t){return Bt(this,t).has(t)},kt.prototype.set=function(t,e){var n=Bt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},At.prototype.add=At.prototype.push=function(t){return this.__data__.set(t,r),this},At.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.clear=function(){this.__data__=new Ot,this.size=0},Tt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Tt.prototype.get=function(t){return this.__data__.get(t)},Tt.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!lt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kt(r)}return n.set(t,e),this.size=n.size,this};var Nt=at?function(t){return null==t?[]:(t=Object(t),function(e,n){for(var r=-1,i=null==e?0:e.length,s=0,o=[];++r<i;){var a=e[r];c=a,it.call(t,c)&&(o[s++]=a)}var c;return o}(at(t)))}:function(){return[]},Pt=jt;function zt(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||j.test(t))&&t>-1&&t%1==0&&t<e}function It(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ut(t,e){return t===e||t!=t&&e!=e}(ht&&Pt(new ht(new ArrayBuffer(1)))!=T||lt&&Pt(new lt)!=g||ft&&Pt(ft.resolve())!=v||dt&&Pt(new dt)!=_||pt&&Pt(new pt)!=k)&&(Pt=function(t){var e=jt(t),n=e==m?t.constructor:void 0,r=n?It(n):"";if(r)switch(r){case yt:return T;case bt:return g;case mt:return v;case vt:return _;case wt:return k}return e});var Mt=Ct(function(){return arguments}())?Ct:function(t){return Gt(t)&&X.call(t,"callee")&&!it.call(t,"callee")},qt=Array.isArray,Vt=ct||function(){return!1};function Wt(t){if(!$t(t))return!1;var e=jt(t);return e==d||e==p||e==u||e==w}function Ht(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function $t(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Gt(t){return null!=t&&"object"==typeof t}var Jt=I?function(t){return function(e){return t(e)}}(I):function(t){return Gt(t)&&Ht(t.length)&&!!C[jt(t)]};function Kt(t){return null!=(e=t)&&Ht(e.length)&&!Wt(e)?function(t,e){var n=qt(t),r=!n&&Mt(t),i=!n&&!r&&Vt(t),s=!n&&!r&&!i&&Jt(t),o=n||r||i||s,a=o?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!X.call(t,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||zt(u,c))||a.push(u);return a}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||J))return ut(t);var e,n,r=[];for(var i in Object(t))X.call(t,i)&&"constructor"!=i&&r.push(i);return r}(t);var e}t.exports=function(t,e){return Rt(t,e)}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={id:r,loaded:!1,exports:{}};return t[r](s,s.exports,n),s.loaded=!0,s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{n.d(r,{F:()=>hn,j:()=>fi});var t={};n.r(t),n.d(t,{hasBrowserEnv:()=>nt,hasStandardBrowserEnv:()=>rt,hasStandardBrowserWebWorkerEnv:()=>st});var e={};function i(t,e){return function(){return t.apply(e,arguments)}}n.r(e),n.d(e,{Decoder:()=>ni,Encoder:()=>ti,PacketType:()=>Zr,protocol:()=>Qr});const{toString:s}=Object.prototype,{getPrototypeOf:o}=Object,a=(t=>e=>{const n=s.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),c=t=>(t=t.toLowerCase(),e=>a(e)===t),u=t=>e=>typeof e===t,{isArray:h}=Array,l=u("undefined"),f=c("ArrayBuffer"),d=u("string"),p=u("function"),g=u("number"),y=t=>null!==t&&"object"==typeof t,b=t=>{if("object"!==a(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},m=c("Date"),v=c("File"),w=c("Blob"),S=c("FileList"),_=c("URLSearchParams");function E(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),h(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(r=0;r<s;r++)o=i[r],e.call(null,t[o],o,t)}}function O(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=t=>!l(t)&&t!==k,T=(x="undefined"!=typeof Uint8Array&&o(Uint8Array),t=>x&&t instanceof x);var x;const j=c("HTMLFormElement"),C=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),R=c("RegExp"),L=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};E(n,((n,i)=>{let s;!1!==(s=e(n,i,t))&&(r[i]=s||n)})),Object.defineProperties(t,r)},D="abcdefghijklmnopqrstuvwxyz",B="0123456789",F={DIGIT:B,ALPHA:D,ALPHA_DIGIT:D+D.toUpperCase()+B},N=c("AsyncFunction"),P={isArray:h,isArrayBuffer:f,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(t.constructor)&&p(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||p(t.append)&&("formdata"===(e=a(t))||"object"===e&&p(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&f(t.buffer),e},isString:d,isNumber:g,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:b,isUndefined:l,isDate:m,isFile:v,isBlob:w,isRegExp:R,isFunction:p,isStream:t=>y(t)&&p(t.pipe),isURLSearchParams:_,isTypedArray:T,isFileList:S,forEach:E,merge:function t(){const{caseless:e}=A(this)&&this||{},n={},r=(r,i)=>{const s=e&&O(n,i)||i;b(n[s])&&b(r)?n[s]=t(n[s],r):b(r)?n[s]=t({},r):h(r)?n[s]=r.slice():n[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&E(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(E(e,((e,r)=>{n&&p(e)?t[r]=i(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==n&&o(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:c,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(h(t))return t;let e=t.length;if(!g(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:L,freezeMethods:t=>{L(t,((e,n)=>{if(p(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];p(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return h(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:O,global:k,isContextDefined:A,ALPHABET:F,generateString:(t=16,e=F.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&p(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=h(t)?[]:{};return E(t,((t,e)=>{const s=n(t,r+1);!l(s)&&(i[e]=s)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:N,isThenable:t=>t&&(y(t)||p(t))&&p(t.then)&&p(t.catch)};function z(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}P.inherits(z,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const I=z.prototype,U={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{U[t]={value:t}})),Object.defineProperties(z,U),Object.defineProperty(I,"isAxiosError",{value:!0}),z.from=(t,e,n,r,i,s)=>{const o=Object.create(I);return P.toFlatObject(t,o,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),z.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const M=z;function q(t){return P.isPlainObject(t)||P.isArray(t)}function V(t){return P.endsWith(t,"[]")?t.slice(0,-2):t}function W(t,e,n){return t?t.concat(e).map((function(t,e){return t=V(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const H=P.toFlatObject(P,{},null,(function(t){return/^is[A-Z]/.test(t)})),$=function(t,e,n){if(!P.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!P.isUndefined(e[t])}))).metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&P.isSpecCompliantForm(e);if(!P.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(P.isDate(t))return t.toISOString();if(!a&&P.isBlob(t))throw new M("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(t)||P.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,i){let a=t;if(t&&!i&&"object"==typeof t)if(P.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(P.isArray(t)&&function(t){return P.isArray(t)&&!t.some(q)}(t)||(P.isFileList(t)||P.endsWith(n,"[]"))&&(a=P.toArray(t)))return n=V(n),a.forEach((function(t,r){!P.isUndefined(t)&&null!==t&&e.append(!0===o?W([n],r,s):null===o?n:n+"[]",c(t))})),!1;return!!q(t)||(e.append(W(i,n,s),c(t)),!1)}const h=[],l=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!P.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!P.isUndefined(n)){if(-1!==h.indexOf(n))throw Error("Circular reference detected in "+r.join("."));h.push(n),P.forEach(n,(function(n,s){!0===(!(P.isUndefined(n)||null===n)&&i.call(e,n,P.isString(s)?s.trim():s,r,l))&&t(n,r?r.concat(s):[s])})),h.pop()}}(t),e};function G(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function J(t,e){this._pairs=[],t&&$(t,this,e)}const K=J.prototype;K.append=function(t,e){this._pairs.push([t,e])},K.toString=function(t){const e=t?function(e){return t.call(this,e,G)}:G;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Y=J;function X(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(t,e,n){if(!e)return t;const r=n&&n.encode||X,i=n&&n.serialize;let s;if(s=i?i(e,n):P.isURLSearchParams(e)?e.toString():new Y(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}const Z=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Y,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nt="undefined"!=typeof window&&"undefined"!=typeof document,rt=(it="undefined"!=typeof navigator&&navigator.product,nt&&["ReactNative","NativeScript","NS"].indexOf(it)<0);var it;const st="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ot={...t,...et},at=function(t){function e(t,n,r,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;return s=!s&&P.isArray(r)?r.length:s,a?(P.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o):(r[s]&&P.isObject(r[s])||(r[s]=[]),e(t,n,r[s],i)&&P.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}(r[s])),!o)}if(P.isFormData(t)&&P.isFunction(t.entries)){const n={};return P.forEachEntry(t,((t,r)=>{e(function(t){return P.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},ct={transitional:tt,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=P.isObject(t);if(i&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return r?JSON.stringify(at(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return $(t,new ot.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return ot.isNode&&P.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=P.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return $(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(P.isString(t))try{return(0,JSON.parse)(t),P.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ct.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&P.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw M.from(t,M.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ot.classes.FormData,Blob:ot.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],(t=>{ct.headers[t]={}}));const ut=ct,ht=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lt=Symbol("internals");function ft(t){return t&&String(t).trim().toLowerCase()}function dt(t){return!1===t||null==t?t:P.isArray(t)?t.map(dt):String(t)}function pt(t,e,n,r,i){return P.isFunction(r)?r.call(this,e,n):(i&&(e=n),P.isString(e)?P.isString(r)?-1!==e.indexOf(r):P.isRegExp(r)?r.test(e):void 0:void 0)}class gt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=ft(e);if(!i)throw new Error("header name must be a non-empty string");const s=P.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=dt(t))}const s=(t,e)=>P.forEach(t,((t,n)=>i(t,n,e)));return P.isPlainObject(t)||t instanceof this.constructor?s(t,e):P.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?s((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&ht[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&i(e,t,n),this}get(t,e){if(t=ft(t)){const n=P.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(P.isFunction(e))return e.call(this,t,n);if(P.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ft(t)){const n=P.findKey(this,t);return!(!n||void 0===this[n]||e&&!pt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=ft(t)){const i=P.findKey(n,t);!i||e&&!pt(0,n[i],i,e)||(delete n[i],r=!0)}}return P.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!pt(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return P.forEach(this,((r,i)=>{const s=P.findKey(n,i);if(s)return e[s]=dt(r),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete e[i],e[o]=dt(r),n[o]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return P.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&P.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[lt]=this[lt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=ft(t);e[r]||(function(t,e){const n=P.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return P.isArray(t)?t.forEach(r):r(t),this}}gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(gt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),P.freezeMethods(gt);const yt=gt;function bt(t,e){const n=this||ut,r=e||n,i=yt.from(r.headers);let s=r.data;return P.forEach(t,(function(t){s=t.call(n,s,i.normalize(),e?e.status:void 0)})),i.normalize(),s}function mt(t){return!(!t||!t.__CANCEL__)}function vt(t,e,n){M.call(this,null==t?"canceled":t,M.ERR_CANCELED,e,n),this.name="CanceledError"}P.inherits(vt,M,{__CANCEL__:!0});const wt=vt,St=ot.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];P.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),P.isString(r)&&o.push("path="+r),P.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _t(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Et=ot.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=P.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0};function Ot(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[o];i||(i=c),n[s]=a,r[s]=c;let h=o,l=0;for(;h!==s;)l+=n[h++],h%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),c-i<e)return;const f=u&&c-u;return f?Math.round(1e3*l/f):void 0}}(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&s<=o?(o-s)/c:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const kt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const i=yt.from(t.headers).normalize();let s,o,{responseType:a,withXSRFToken:c}=t;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}if(P.isFormData(r))if(ot.hasStandardBrowserEnv||ot.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[t,...e]=o?o.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}let h=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(e+":"+n))}const l=_t(t.baseURL,t.url);function f(){if(!h)return;const r=yt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),u()}),(function(t){n(t),u()}),{data:a&&"text"!==a&&"json"!==a?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:t,request:h}),h=null}if(h.open(t.method.toUpperCase(),Q(l,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(n(new M("Request aborted",M.ECONNABORTED,t,h)),h=null)},h.onerror=function(){n(new M("Network Error",M.ERR_NETWORK,t,h)),h=null},h.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||tt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new M(e,r.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,h)),h=null},ot.hasStandardBrowserEnv&&(c&&P.isFunction(c)&&(c=c(t)),c||!1!==c&&Et(l))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&St.read(t.xsrfCookieName);e&&i.set(t.xsrfHeaderName,e)}void 0===r&&i.setContentType(null),"setRequestHeader"in h&&P.forEach(i.toJSON(),(function(t,e){h.setRequestHeader(e,t)})),P.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),a&&"json"!==a&&(h.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",Ot(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",Ot(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=e=>{h&&(n(!e||e.type?new wt(null,t,h):e),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const d=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);d&&-1===ot.protocols.indexOf(d)?n(new M("Unsupported protocol "+d+":",M.ERR_BAD_REQUEST,t)):h.send(r||null)}))},At={http:null,xhr:kt};P.forEach(At,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Tt=t=>`- ${t}`,xt=t=>P.isFunction(t)||null===t||!1===t,jt=t=>{t=P.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){let e;if(n=t[s],r=n,!xt(n)&&(r=At[(e=String(n)).toLowerCase()],void 0===r))throw new M(`Unknown adapter '${e}'`);if(r)break;i[e||"#"+s]=r}if(!r){const t=Object.entries(i).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(Tt).join("\n"):" "+Tt(t[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Ct(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new wt(null,t)}function Rt(t){return Ct(t),t.headers=yt.from(t.headers),t.data=bt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jt(t.adapter||ut.adapter)(t).then((function(e){return Ct(t),e.data=bt.call(t,t.transformResponse,e),e.headers=yt.from(e.headers),e}),(function(e){return mt(e)||(Ct(t),e&&e.response&&(e.response.data=bt.call(t,t.transformResponse,e.response),e.response.headers=yt.from(e.response.headers))),Promise.reject(e)}))}const Lt=t=>t instanceof yt?{...t}:t;function Dt(t,e){e=e||{};const n={};function r(t,e,n){return P.isPlainObject(t)&&P.isPlainObject(e)?P.merge.call({caseless:n},t,e):P.isPlainObject(e)?P.merge({},e):P.isArray(e)?e.slice():e}function i(t,e,n){return P.isUndefined(e)?P.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function s(t,e){if(!P.isUndefined(e))return r(void 0,e)}function o(t,e){return P.isUndefined(e)?P.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,i,s){return s in e?r(n,i):s in t?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e)=>i(Lt(t),Lt(e),!0)};return P.forEach(Object.keys(Object.assign({},t,e)),(function(r){const s=c[r]||i,o=s(t[r],e[r],r);P.isUndefined(o)&&s!==a||(n[r]=o)})),n}const Bt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Bt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Ft={};Bt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.6.8] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,s)=>{if(!1===t)throw new M(r(i," has been removed"+(e?" in "+e:"")),M.ERR_DEPRECATED);return e&&!Ft[i]&&(Ft[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,s)}};const Nt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const e=t[s],n=void 0===e||o(e,s,t);if(!0!==n)throw new M("option "+s+" must be "+n,M.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new M("Unknown option "+s,M.ERR_BAD_OPTION)}},validators:Bt},Pt=Nt.validators;class zt{constructor(t){this.defaults=t,this.interceptors={request:new Z,response:new Z}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Dt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;void 0!==n&&Nt.assertOptions(n,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),null!=r&&(P.isFunction(r)?e.paramsSerializer={serialize:r}:Nt.assertOptions(r,{encode:Pt.function,serialize:Pt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&P.merge(i.common,i[e.method]);i&&P.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=yt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let h,l=0;if(!a){const t=[Rt.bind(this),void 0];for(t.unshift.apply(t,o),t.push.apply(t,c),h=t.length,u=Promise.resolve(e);l<h;)u=u.then(t[l++],t[l++]);return u}h=o.length;let f=e;for(l=0;l<h;){const t=o[l++],e=o[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{u=Rt.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,h=c.length;l<h;)u=u.then(c[l++],c[l++]);return u}getUri(t){return Q(_t((t=Dt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}P.forEach(["delete","get","head","options"],(function(t){zt.prototype[t]=function(e,n){return this.request(Dt(n||{},{method:t,url:e,data:(n||{}).data}))}})),P.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(Dt(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}zt.prototype[t]=e(),zt.prototype[t+"Form"]=e(!0)}));const It=zt;class Ut{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new wt(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Ut((function(e){t=e})),cancel:t}}}const Mt=Ut,qt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qt).forEach((([t,e])=>{qt[e]=t}));const Vt=qt,Wt=function t(e){const n=new It(e),r=i(It.prototype.request,n);return P.extend(r,It.prototype,n,{allOwnKeys:!0}),P.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Dt(e,n))},r}(ut);Wt.Axios=It,Wt.CanceledError=wt,Wt.CancelToken=Mt,Wt.isCancel=mt,Wt.VERSION="1.6.8",Wt.toFormData=$,Wt.AxiosError=M,Wt.Cancel=Wt.CanceledError,Wt.all=function(t){return Promise.all(t)},Wt.spread=function(t){return function(e){return t.apply(null,e)}},Wt.isAxiosError=function(t){return P.isObject(t)&&!0===t.isAxiosError},Wt.mergeConfig=Dt,Wt.AxiosHeaders=yt,Wt.formToJSON=t=>at(P.isHTMLForm(t)?new FormData(t):t),Wt.getAdapter=jt,Wt.HttpStatusCode=Vt,Wt.default=Wt;const Ht=Wt;class $t{interceptor;constructor(t){this.interceptor=Ht.create({baseURL:`${t}/api`}),this.interceptor.interceptors.request.use((t=>{const e=Ht.CancelToken.source();return t.cancelToken=e.token,setTimeout((()=>{e.cancel("Timeout: request took more than 15 seconds")}),15e3),t}),(t=>Promise.reject(t)))}}var Gt=function(t,e){return Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Gt(t,e)};function Jt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Gt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Kt(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function Yt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function Qt(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Zt(t){return this instanceof Zt?(this.v=t,this):new Zt(t)}function te(t){return"function"==typeof t}function ee(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var ne=ee((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function re(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var ie=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=Yt(s),a=o.next();!a.done;a=o.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else s.remove(this);var c=this.initialTeardown;if(te(c))try{c()}catch(t){i=t instanceof ne?t.errors:[t]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var h=Yt(u),l=h.next();!l.done;l=h.next()){var f=l.value;try{ae(f)}catch(t){i=null!=i?i:[],t instanceof ne?i=Qt(Qt([],Xt(i)),Xt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new ne(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ae(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&re(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&re(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),se=ie.EMPTY;function oe(t){return t instanceof ie||t&&"closed"in t&&te(t.remove)&&te(t.add)&&te(t.unsubscribe)}function ae(t){te(t)?t():t.unsubscribe()}var ce={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ue={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=ue.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,Qt([t,e],Xt(n))):setTimeout.apply(void 0,Qt([t,e],Xt(n)))},clearTimeout:function(t){var e=ue.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function he(t){ue.setTimeout((function(){var e=ce.onUnhandledError;if(!e)throw t;e(t)}))}function le(){}var fe=de("C",void 0,void 0);function de(t,e,n){return{kind:t,value:e,error:n}}var pe=null;function ge(t){if(ce.useDeprecatedSynchronousErrorHandling){var e=!pe;if(e&&(pe={errorThrown:!1,error:null}),t(),e){var n=pe,r=n.errorThrown,i=n.error;if(pe=null,r)throw i}}else t()}var ye=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,oe(e)&&e.add(n)):n.destination=Ee,n}return Jt(e,t),e.create=function(t,e,n){return new we(t,e,n)},e.prototype.next=function(t){this.isStopped?_e(function(t){return de("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?_e(de("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?_e(fe,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ie),be=Function.prototype.bind;function me(t,e){return be.call(t,e)}var ve=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Se(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Se(t)}else Se(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Se(t)}},t}(),we=function(t){function e(e,n,r){var i,s,o=t.call(this)||this;return te(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&ce.useDeprecatedNextContext?((s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()},i={next:e.next&&me(e.next,s),error:e.error&&me(e.error,s),complete:e.complete&&me(e.complete,s)}):i=e,o.destination=new ve(i),o}return Jt(e,t),e}(ye);function Se(t){var e;ce.useDeprecatedSynchronousErrorHandling?(e=t,ce.useDeprecatedSynchronousErrorHandling&&pe&&(pe.errorThrown=!0,pe.error=e)):he(t)}function _e(t,e){var n=ce.onStoppedNotification;n&&ue.setTimeout((function(){return n(t,e)}))}var Ee={closed:!0,next:le,error:function(t){throw t},complete:le},Oe="function"==typeof Symbol&&Symbol.observable||"@@observable";function ke(t){return t}var Ae=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this,i=function(t){return t&&t instanceof ye||function(t){return t&&te(t.next)&&te(t.error)&&te(t.complete)}(t)&&oe(t)}(t)?t:new we(t,e,n);return ge((function(){var t=r,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?r._subscribe(i):r._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Te(e))((function(e,r){var i=new we({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Oe]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0===(n=t).length?ke:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=Te(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Te(t){var e;return null!==(e=null!=t?t:ce.Promise)&&void 0!==e?e:Promise}var xe=ee((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),je=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Jt(e,t),e.prototype.lift=function(t){var e=new Ce(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new xe},e.prototype.next=function(t){var e=this;ge((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Yt(e.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(t)}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ge((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;ge((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,s=n.observers;return r||i?se:(this.currentObservers=null,s.push(t),new ie((function(){e.currentObservers=null,re(s,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ae;return t.source=this,t},e.create=function(t,e){return new Ce(t,e)},e}(Ae),Ce=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Jt(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:se},e}(je),Re={now:function(){return(Re.delegate||Date).now()},delegate:void 0},Le=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Re);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return Jt(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,o=n._timestampProvider,a=n._windowTime;r||(i.push(e),!s&&i.push(o.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,s=(i?1:2)*e;if(e<1/0&&s<r.length&&r.splice(0,r.length-s),!i){for(var o=n.now(),a=0,c=1;c<r.length&&r[c]<=o;c+=2)a=c;a&&r.splice(0,a+1)}},e}(je),De=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Jt(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(je),Be=ee((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}}));function Fe(t){return function(e){if(function(t){return te(null==t?void 0:t.lift)}(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}var Ne=Array.isArray;function Pe(t,e,n,r,i){return new ze(t,e,n,r,i)}var ze=function(t){function e(e,n,r,i,s,o){var a=t.call(this,e)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Jt(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(ye);function Ie(t,e){return Fe((function(n,r){var i=0;n.subscribe(Pe(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Ue=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Me(t){return te(null==t?void 0:t.then)}function qe(t){return te(t[Oe])}function Ve(t){return Symbol.asyncIterator&&te(null==t?void 0:t[Symbol.asyncIterator])}function We(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var He="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function $e(t){return te(null==t?void 0:t[He])}function Ge(t){return function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){s.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof Zt?Promise.resolve(n.value.v).then(c,u):h(s[0][2],n)}catch(t){h(s[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function h(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}(this,arguments,(function(){var e,n,r;return Kt(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Zt(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,Zt(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Zt(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Je(t){return te(null==t?void 0:t.getReader)}function Ke(t){if(t instanceof Ae)return t;if(null!=t){if(qe(t))return i=t,new Ae((function(t){var e=i[Oe]();if(te(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ue(t))return r=t,new Ae((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Me(t))return n=t,new Ae((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,he)}));if(Ve(t))return Ye(t);if($e(t))return e=t,new Ae((function(t){var n,r;try{for(var i=Yt(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(t.next(o),t.closed)return}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(Je(t))return Ye(Ge(t))}var e,n,r,i;throw We(t)}function Ye(t){return new Ae((function(e){(function(t,e){var n,r,i,s,o,a,c,u;return o=this,a=void 0,u=function(){var o,a;return Kt(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=Yt(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}(t),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))},new((c=void 0)||(c=Promise))((function(t,e){function n(t){try{i(u.next(t))}catch(t){e(t)}}function r(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):function(t){return t instanceof c?t:new c((function(e){e(t)}))}(e.value).then(n,r)}i((u=u.apply(o,a||[])).next())}))})(t,e).catch((function(t){return e.error(t)}))}))}function Xe(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var s=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(s),!i)return s}function Qe(t,e,n){return void 0===n&&(n=1/0),te(e)?Qe((function(n,r){return Ie((function(t,i){return e(n,t,r,i)}))(Ke(t(n,r)))}),n):("number"==typeof e&&(n=e),Fe((function(e,r){return function(t,e,n,r,i,s,o,a){var c=[],u=0,h=0,l=!1,f=function(){!l||c.length||u||e.complete()},d=function(t){return u<r?p(t):c.push(t)},p=function(t){u++;var i=!1;Ke(n(t,h++)).subscribe(Pe(e,(function(t){e.next(t)}),(function(){i=!0}),void 0,(function(){if(i)try{u--;for(;c.length&&u<r;)t=void 0,t=c.shift(),p(t);f()}catch(t){e.error(t)}var t})))};return t.subscribe(Pe(e,d,(function(){l=!0,f()}))),function(){}}(e,r,t,n)})))}function Ze(t){return t[t.length-1]}function tn(t,e){return void 0===e&&(e=0),Fe((function(n,r){n.subscribe(Pe(r,(function(n){return Xe(r,t,(function(){return r.next(n)}),e)}),(function(){return Xe(r,t,(function(){return r.complete()}),e)}),(function(n){return Xe(r,t,(function(){return r.error(n)}),e)})))}))}function en(t,e){return void 0===e&&(e=0),Fe((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function nn(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ae((function(n){Xe(n,e,(function(){var r=t[Symbol.asyncIterator]();Xe(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function rn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return function(t){return t&&te(t.schedule)}(Ze(t))?t.pop():void 0}(t),r=function(t,e){return"number"==typeof Ze(t)?t.pop():1/0}(t);return t=function(t){return 1===t.length&&Ne(t[0])?t[0]:t}(t),Fe((function(e,i){(function(t){return void 0===t&&(t=1/0),Qe(ke,t)})(r)(function(t,e){return e?function(t,e){if(null!=t){if(qe(t))return function(t,e){return Ke(t).pipe(en(e),tn(e))}(t,e);if(Ue(t))return function(t,e){return new Ae((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Me(t))return function(t,e){return Ke(t).pipe(en(e),tn(e))}(t,e);if(Ve(t))return nn(t,e);if($e(t))return function(t,e){return new Ae((function(n){var r;return Xe(n,e,(function(){r=t[He](),Xe(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return te(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(Je(t))return function(t,e){return nn(Ge(t),e)}(t,e)}throw We(t)}(t,e):Ke(t)}(Qt([e],Xt(t)),n)).subscribe(i)}))}function sn(t,e){return void 0===e&&(e=ke),t=null!=t?t:on,Fe((function(n,r){var i,s=!0;n.subscribe(Pe(r,(function(n){var o=e(n);!s&&t(i,o)||(s=!1,i=o,r.next(n))})))}))}function on(t,e){return t===e}function an(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new je}:e,r=t.resetOnError,i=void 0===r||r,s=t.resetOnComplete,o=void 0===s||s,a=t.resetOnRefCountZero,c=void 0===a||a;return function(t){var e,r,s,a=0,u=!1,h=!1,l=function(){null==r||r.unsubscribe(),r=void 0},f=function(){l(),e=s=void 0,u=h=!1},d=function(){var t=e;f(),null==t||t.unsubscribe()};return Fe((function(t,p){a++,h||u||l();var g=s=null!=s?s:n();p.add((function(){0!=--a||h||u||(r=cn(d,c))})),g.subscribe(p),!e&&a>0&&(e=new we({next:function(t){return g.next(t)},error:function(t){h=!0,l(),r=cn(f,i,t),g.error(t)},complete:function(){u=!0,l(),r=cn(f,o),g.complete()}}),Ke(t).subscribe(e))}))(t)}}function cn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new we({next:function(){i.unsubscribe(),t()}});return Ke(e.apply(void 0,Qt([],Xt(n)))).subscribe(i)}}else t()}class un{subscriptions=[];additionalSubscriptions=[];addSubscriptions(...t){this.subscriptions.push(...t)}addAdditionalSubscriptions(...t){this.additionalSubscriptions.push(...t)}unsubscribe(){this.subscriptions.forEach((t=>t.unsubscribe()))}unsubscribeAdditional(){this.additionalSubscriptions.forEach((t=>t.unsubscribe()))}}class hn extends un{onCallAnswered=new Le(1);onCallEnded=new Le(1);onUsingOpus=new Le(1);micState=new De(!1);hasEnded=!1;cameraDevice;connection;logger;onMicrophoneEnabled=this.createStateObservable(this.micState);get isUsingOpus(){return t=this.onUsingOpus.pipe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return rn.apply(void 0,Qt([],Xt(t)))}(this.connection.onError.pipe(Ie((t=>{throw t}))))),new Promise((function(e,n){var r=new we({next:function(t){e(t),r.unsubscribe()},error:n,complete:function(){n(new Be)}});t.subscribe(r)}));var t}constructor(t,e,n){super(),this.cameraDevice=t,this.logger=e,this.connection=n,this.bindToConnection(n)}enableMicrophone(t){this.hasEnded||(this.connection.pc.enableMicrophone(t),this.micState.next(!0))}disableMicrophone(){this.hasEnded||(this.connection.pc.disableMicrophone(),this.micState.next(!1))}stop(){this.callEnded()}createStateObservable(t){return t.pipe(sn(((t,e)=>t===e)),an({connector:()=>new Le(1)}))}bindToConnection(t){this.addSubscriptions(t.onCallAnswered.subscribe((t=>{this.onUsingOpus.next(t.toLocaleLowerCase().includes(" opus/"))})),t.onCallEnded.subscribe((()=>this.callEnded())))}callEnded(){this.hasEnded||(this.hasEnded=!0,this.unsubscribe(),this.onCallEnded.next(),this.connection.stop())}}var ln=Array.isArray;var fn=["addListener","removeListener"],dn=["addEventListener","removeEventListener"],pn=["on","off"];function gn(t,e,n,r){if(te(n)&&(r=n,n=void 0),r)return gn(t,e,n).pipe((i=r,Ie((function(t){return function(t,e){return ln(e)?t.apply(void 0,Qt([],Xt(e))):t(e)}(i,t)}))));var i,s=Xt(function(t){return te(t.addEventListener)&&te(t.removeEventListener)}(t)?dn.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return te(t.addListener)&&te(t.removeListener)}(t)?fn.map(yn(t,e)):function(t){return te(t.on)&&te(t.off)}(t)?pn.map(yn(t,e)):[],2),o=s[0],a=s[1];if(!o&&Ue(t))return Qe((function(t){return gn(t,e,n)}))(Ke(t));if(!o)throw new TypeError("Invalid event target");return new Ae((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return a(e)}}))}function yn(t,e){return function(n){return function(r){return t[n](e,r)}}}function bn(t){const e=[];return t.forEach((t=>{t.urls.forEach((n=>{e.push({urls:n,username:t.username,credential:t.credential})}))})),e}class mn extends un{onIceCandidate=new je;onConnectionState=new Le(1);videoTransceiver;audioTransceiver;cameraDevice;logger;pc;videoElement;constructor(t,e,n,r){super(),this.cameraDevice=t,this.logger=r,this.videoElement=e,this.pc=new RTCPeerConnection({iceServers:bn(n)}),this.audioTransceiver=this.pc.addTransceiver("audio",{direction:"sendrecv"}),this.videoTransceiver=this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.onconnectionstatechange=()=>{this.logger.debug(this.cameraDevice.name,"connectionStateChange:",this.pc.connectionState),this.onConnectionState.next(this.pc.connectionState)},this.pc.oniceconnectionstatechange=()=>{this.logger.debug(this.cameraDevice.name,"iceconnectionstatechange:",this.pc.iceConnectionState)},this.pc.onicegatheringstatechange=()=>{this.logger.debug(this.cameraDevice.name,"icegatheringstatechange:",this.pc.iceGatheringState)},this.pc.onicecandidate=t=>{t.candidate&&this.onIceCandidate.next(t.candidate)},this.pc.ontrack=t=>{this.logger.debug(this.cameraDevice.name,"ontrack:",t.track),e.srcObject?e.srcObject.addTrack(t.track):e.srcObject=new MediaStream([t.track])}}enableMicrophone(t){this.audioTransceiver.sender.replaceTrack(t)}disableMicrophone(){this.audioTransceiver.sender.replaceTrack(null)}async createOffer(){const t=await this.pc.createOffer();return await this.pc.setLocalDescription(t),t}async acceptAnswer(t){await this.pc.setRemoteDescription(t)}addIceCandidate(t){return this.pc.addIceCandidate(t)}close(){this.videoElement.srcObject=null,this.pc.close(),this.unsubscribe()}}class vn extends un{onCallAnswered=new Le(1);onCallEnded=new Le(1);onError=new Le(1);onMessage=new Le;onWsOpen;pc;ws;onOfferSent=new Le(1);hasEnded=!1;cameraDevice;logger;constructor(t,e,n,r,i){super(),this.cameraDevice=t,this.logger=i;const s=t.sources.find((t=>t.name===e));if(!s)throw new Error(`Invalid source name ${e}`);this.ws=new WebSocket(s.urls.ws.webrtc),this.pc=new mn(t,n,r,i),this.onWsOpen=gn(this.ws,"open");const o=gn(this.ws,"message"),a=gn(this.ws,"error"),c=gn(this.ws,"close");var u,h;this.addSubscriptions(o.pipe((u=t=>{const e=JSON.parse(t.data);return this.onMessage.next(e),this.handleMessage(e).catch((t=>{throw this.onError.next(t),t}))},te(h)?Qe(u,h,1):Qe(u,1))).subscribe(),a.subscribe((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()})),c.subscribe((()=>{this.callEnded()})),this.cameraDevice.onConnected.subscribe((t=>{t||this.callEnded()})),this.onError.subscribe((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()})),this.onWsOpen.subscribe((()=>{this.initiateCall().catch((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()}))})),this.pc.onConnectionState.subscribe((t=>{"failed"===t&&(this.logger.error(this.cameraDevice.name,"Stream connection failed"),this.callEnded()),"closed"===t&&(this.logger.debug(this.cameraDevice.name,"Stream connection closed"),this.callEnded())})),this.pc.onIceCandidate.subscribe((async t=>{this.sendMessage({type:"webrtc/candidate",value:t.toJSON().candidate||""})})))}stop(){this.callEnded()}async initiateCall(){const{sdp:t}=await this.pc.createOffer();this.sendMessage({type:"webrtc/offer",value:t||""}),this.onOfferSent.next()}async handleMessage(t){switch(t.type){case"webrtc/answer":const e=t.value;return await this.pc.acceptAnswer({type:"answer",sdp:e}),void this.onCallAnswered.next(e);case"webrtc/candidate":return void await this.pc.addIceCandidate({candidate:t.value,sdpMid:"0"});case"error":throw new Error(t.value);default:throw new Error(t)}}sendMessage(t){this.hasEnded||this.ws.send(JSON.stringify(t))}callEnded(){this.hasEnded||(this.hasEnded=!0,this.unsubscribe(),this.onCallEnded.next(),this.pc.close(),this.ws.close())}}var wn=n(275),Sn=n.n(wn),_n=n(512),En=n.n(_n);const On="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,kn=new Set,An="object"==typeof process&&process?process:{},Tn=(t,e,n,r)=>{"function"==typeof An.emitWarning?An.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)};let xn=globalThis.AbortController,jn=globalThis.AbortSignal;if(void 0===xn){jn=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},xn=class{constructor(){e()}signal=new jn;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==An.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,Tn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const Cn=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Rn=t=>Cn(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ln:null:null;class Ln extends Array{constructor(t){super(t),this.fill(0)}}class Dn{heap;length;static#t=!1;static create(t){const e=Rn(t);if(!e)return[];Dn.#t=!0;const n=new Dn(t,e);return Dn.#t=!1,n}constructor(t,e){if(!Dn.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class Bn{#e;#n;#r;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#a;#c;#u;#h;#l;#f;#d;#p;#g;#y;#b;#m;#v;#w;#S;#_;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#v,sizes:t.#b,keyMap:t.#c,keyList:t.#u,valList:t.#h,next:t.#l,prev:t.#f,get head(){return t.#d},get tail(){return t.#p},free:t.#g,isBackgroundFetch:e=>t.#E(e),backgroundFetch:(e,n,r,i)=>t.#O(e,n,r,i),moveToTail:e=>t.#k(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#x(e)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#a}get size(){return this.#o}get fetchMethod(){return this.#s}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(t){const{max:e=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:l,maxSize:f=0,maxEntrySize:d=0,sizeCalculation:p,fetchMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:v,ignoreFetchAbort:w}=t;if(0!==e&&!Cn(e))throw new TypeError("max option must be a nonnegative integer");const S=e?Rn(e):Array;if(!S)throw new Error("invalid max value: "+e);if(this.#e=e,this.#n=f,this.maxEntrySize=d||this.#n,this.sizeCalculation=p,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=g,this.#S=!!g,this.#c=new Map,this.#u=new Array(e).fill(void 0),this.#h=new Array(e).fill(void 0),this.#l=new S(e),this.#f=new S(e),this.#d=0,this.#p=0,this.#g=Dn.create(e),this.#o=0,this.#a=0,"function"==typeof c&&(this.#r=c),"function"==typeof u?(this.#i=u,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#r,this.#_=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!l,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#n&&!Cn(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Cn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=Cn(r)||0===r?r:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Cn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(0===this.#e&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){const t="LRU_CACHE_UNBOUNDED";(t=>!kn.has(t))(t)&&(kn.add(t),Tn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,Bn))}}getRemainingTTL(t){return this.#c.has(t)?1/0:0}#C(){const t=new Ln(this.#e),e=new Ln(this.#e);this.#v=t,this.#m=e,this.#R=(n,r,i=On.now())=>{if(e[n]=0!==r?i:0,t[n]=r,0!==r&&this.ttlAutopurge){const t=setTimeout((()=>{this.#x(n)&&this.delete(this.#u[n])}),r+1);t.unref&&t.unref()}},this.#L=n=>{e[n]=0!==t[n]?On.now():0},this.#D=(i,s)=>{if(t[s]){const o=t[s],a=e[s];if(!o||!a)return;i.ttl=o,i.start=a,i.now=n||r();const c=i.now-a;i.remainingTTL=o-c}};let n=0;const r=()=>{const t=On.now();if(this.ttlResolution>0){n=t;const e=setTimeout((()=>n=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const s=this.#c.get(i);if(void 0===s)return 0;const o=t[s],a=e[s];return o&&a?o-((n||r())-a):1/0},this.#x=i=>{const s=e[i],o=t[i];return!!o&&!!s&&(n||r())-s>o}}#L=()=>{};#D=()=>{};#R=()=>{};#x=()=>!1;#j(){const t=new Ln(this.#e);this.#a=0,this.#b=t,this.#B=e=>{this.#a-=t[e],t[e]=0},this.#F=(t,e,n,r)=>{if(this.#E(e))return 0;if(!Cn(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(e,t),!Cn(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#N=(e,n,r)=>{if(t[e]=n,this.#n){const n=this.#n-t[e];for(;this.#a>n;)this.#P(!0)}this.#a+=t[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.#a)}}#B=t=>{};#N=(t,e,n)=>{};#F=(t,e,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#p;this.#z(e)&&(!t&&this.#x(e)||(yield e),e!==this.#d);)e=this.#f[e]}*#T({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#d;this.#z(e)&&(!t&&this.#x(e)||(yield e),e!==this.#p);)e=this.#l[e]}#z(t){return void 0!==t&&this.#c.get(this.#u[t])===t}*entries(){for(const t of this.#A())void 0===this.#h[t]||void 0===this.#u[t]||this.#E(this.#h[t])||(yield[this.#u[t],this.#h[t]])}*rentries(){for(const t of this.#T())void 0===this.#h[t]||void 0===this.#u[t]||this.#E(this.#h[t])||(yield[this.#u[t],this.#h[t]])}*keys(){for(const t of this.#A()){const e=this.#u[t];void 0===e||this.#E(this.#h[t])||(yield e)}}*rkeys(){for(const t of this.#T()){const e=this.#u[t];void 0===e||this.#E(this.#h[t])||(yield e)}}*values(){for(const t of this.#A())void 0===this.#h[t]||this.#E(this.#h[t])||(yield this.#h[t])}*rvalues(){for(const t of this.#T())void 0===this.#h[t]||this.#E(this.#h[t])||(yield this.#h[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const n of this.#A()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;if(void 0!==i&&t(i,this.#u[n],this))return this.get(this.#u[n],e)}}forEach(t,e=this){for(const n of this.#A()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#u[n],this)}}rforEach(t,e=this){for(const n of this.#T()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#u[n],this)}}purgeStale(){let t=!1;for(const e of this.#T({allowStale:!0}))this.#x(e)&&(this.delete(this.#u[e]),t=!0);return t}info(t){const e=this.#c.get(t);if(void 0===e)return;const n=this.#h[e],r=this.#E(n)?n.__staleWhileFetching:n;if(void 0===r)return;const i={value:r};if(this.#v&&this.#m){const t=this.#v[e],n=this.#m[e];if(t&&n){const e=t-(On.now()-n);i.ttl=e,i.start=Date.now()}}return this.#b&&(i.size=this.#b[e]),i}dump(){const t=[];for(const e of this.#A({allowStale:!0})){const n=this.#u[e],r=this.#h[e],i=this.#E(r)?r.__staleWhileFetching:r;if(void 0===i||void 0===n)continue;const s={value:i};if(this.#v&&this.#m){s.ttl=this.#v[e];const t=On.now()-this.#m[e];s.start=Math.floor(Date.now()-t)}this.#b&&(s.size=this.#b[e]),t.unshift([n,s])}return t}load(t){this.clear();for(const[e,n]of t){if(n.start){const t=Date.now()-n.start;n.start=On.now()-t}this.set(e,n.value,n)}}set(t,e,n={}){if(void 0===e)return this.delete(t),this;const{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const u=this.#F(t,e,n.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let h=0===this.#o?void 0:this.#c.get(t);if(void 0===h)h=0===this.#o?this.#p:0!==this.#g.length?this.#g.pop():this.#o===this.#e?this.#P(!1):this.#o,this.#u[h]=t,this.#h[h]=e,this.#c.set(t,h),this.#l[this.#p]=h,this.#f[h]=this.#p,this.#p=h,this.#o++,this.#N(h,u,a),a&&(a.set="add"),c=!1;else{this.#k(h);const n=this.#h[h];if(e!==n){if(this.#S&&this.#E(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=n;void 0===e||s||(this.#w&&this.#r?.(e,t,"set"),this.#_&&this.#y?.push([e,t,"set"]))}else s||(this.#w&&this.#r?.(n,t,"set"),this.#_&&this.#y?.push([n,t,"set"]));if(this.#B(h),this.#N(h,u,a),this.#h[h]=e,a){a.set="replace";const t=n&&this.#E(n)?n.__staleWhileFetching:n;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===r||this.#v||this.#C(),this.#v&&(c||this.#R(h,r,i),a&&this.#D(a,h)),!s&&this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}return this}pop(){try{for(;this.#o;){const t=this.#h[this.#d];if(this.#P(!0),this.#E(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}}}#P(t){const e=this.#d,n=this.#u[e],r=this.#h[e];return this.#S&&this.#E(r)?r.__abortController.abort(new Error("evicted")):(this.#w||this.#_)&&(this.#w&&this.#r?.(r,n,"evict"),this.#_&&this.#y?.push([r,n,"evict"])),this.#B(e),t&&(this.#u[e]=void 0,this.#h[e]=void 0,this.#g.push(e)),1===this.#o?(this.#d=this.#p=0,this.#g.length=0):this.#d=this.#l[e],this.#c.delete(n),this.#o--,e}has(t,e={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=e,i=this.#c.get(t);if(void 0!==i){const t=this.#h[i];if(this.#E(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#x(i))return n&&this.#L(i),r&&(r.has="hit",this.#D(r,i)),!0;r&&(r.has="stale",this.#D(r,i))}else r&&(r.has="miss");return!1}peek(t,e={}){const{allowStale:n=this.allowStale}=e,r=this.#c.get(t);if(void 0===r||!n&&this.#x(r))return;const i=this.#h[r];return this.#E(i)?i.__staleWhileFetching:i}#O(t,e,n,r){const i=void 0===e?void 0:this.#h[e];if(this.#E(i))return i;const s=new xn,{signal:o}=n;o?.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:r},c=(r,i=!1)=>{const{aborted:o}=s.signal,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(s.signal.reason);const l=h;return this.#h[e]===h&&(void 0===r?l.__staleWhileFetching?this.#h[e]=l.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,r,a.options))),r},u=r=>{const{aborted:i}=s.signal,o=i&&n.allowStaleOnFetchAbort,a=o||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,u=h;if(this.#h[e]===h&&(c&&void 0!==u.__staleWhileFetching?o||(this.#h[e]=u.__staleWhileFetching):this.delete(t)),a)return n.status&&void 0!==u.__staleWhileFetching&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r};n.status&&(n.status.fetchDispatched=!0);const h=new Promise(((e,r)=>{const o=this.#s?.(t,i,a);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),r),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(e(void 0),n.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=t),u(t)))),l=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,l,{...a.options,status:void 0}),e=this.#c.get(t)):this.#h[e]=l,l}#E(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof xn}async fetch(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:y,signal:b}=e;if(!this.#S)return y&&(y.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:y});const m={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:y,signal:b};let v=this.#c.get(t);if(void 0===v){y&&(y.fetch="miss");const e=this.#O(t,v,m,p);return e.__returned=e}{const e=this.#h[v];if(this.#E(e)){const t=n&&void 0!==e.__staleWhileFetching;return y&&(y.fetch="inflight",t&&(y.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#x(v);if(!g&&!i)return y&&(y.fetch="hit"),this.#k(v),r&&this.#L(v),y&&this.#D(y,v),e;const s=this.#O(t,v,m,p),o=void 0!==s.__staleWhileFetching&&n;return y&&(y.fetch=i?"stale":"refresh",o&&i&&(y.returnedStale=!0)),o?s.__staleWhileFetching:s.__returned=s}}get(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}=e,o=this.#c.get(t);if(void 0!==o){const e=this.#h[o],a=this.#E(e);return s&&this.#D(s,o),this.#x(o)?(s&&(s.get="stale"),a?(s&&n&&void 0!==e.__staleWhileFetching&&(s.returnedStale=!0),n?e.__staleWhileFetching:void 0):(i||this.delete(t),s&&n&&(s.returnedStale=!0),n?e:void 0)):(s&&(s.get="hit"),a?e.__staleWhileFetching:(this.#k(o),r&&this.#L(o),e))}s&&(s.get="miss")}#I(t,e){this.#f[e]=t,this.#l[t]=e}#k(t){t!==this.#p&&(t===this.#d?this.#d=this.#l[t]:this.#I(this.#f[t],this.#l[t]),this.#I(this.#p,t),this.#p=t)}delete(t){let e=!1;if(0!==this.#o){const n=this.#c.get(t);if(void 0!==n)if(e=!0,1===this.#o)this.clear();else{this.#B(n);const e=this.#h[n];if(this.#E(e)?e.__abortController.abort(new Error("deleted")):(this.#w||this.#_)&&(this.#w&&this.#r?.(e,t,"delete"),this.#_&&this.#y?.push([e,t,"delete"])),this.#c.delete(t),this.#u[n]=void 0,this.#h[n]=void 0,n===this.#p)this.#p=this.#f[n];else if(n===this.#d)this.#d=this.#l[n];else{const t=this.#f[n];this.#l[t]=this.#l[n];const e=this.#l[n];this.#f[e]=this.#f[n]}this.#o--,this.#g.push(n)}}if(this.#_&&this.#y?.length){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}return e}clear(){for(const t of this.#T({allowStale:!0})){const e=this.#h[t];if(this.#E(e))e.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#w&&this.#r?.(e,n,"delete"),this.#_&&this.#y?.push([e,n,"delete"])}}if(this.#c.clear(),this.#h.fill(void 0),this.#u.fill(void 0),this.#v&&this.#m&&(this.#v.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#d=0,this.#p=0,this.#g.length=0,this.#a=0,this.#o=0,this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}}}function Fn(){return Fe((function(t,e){var n,r=!1;t.subscribe(Pe(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))}))}function Nn(t,e){return Fe((function(n,r){var i=0;n.subscribe(Pe(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}class Pn{subscriptions=[];additionalSubscriptions=[];addSubscriptions(...t){this.subscriptions.push(...t)}addAdditionalSubscriptions(...t){this.additionalSubscriptions.push(...t)}unsubscribe(){this.subscriptions.forEach((t=>t.unsubscribe()))}unsubscribeAdditional(){this.additionalSubscriptions.forEach((t=>t.unsubscribe()))}}class zn extends Pn{logger;snapshotCache=new Bn({max:100,ttl:3e5});cameraSubject;cameraState=new De(!1);lightState=new De({state:!1,timestamp:0});motionState=new De({state:!1,timestamp:0,detections:[]});audioState=new De({state:!1,timestamp:0});objectState=new De({timestamp:0,detections:[]});doorbellState=new De({state:!1,timestamp:0});sirenState=new De({state:!1,timestamp:0});batteryState=new De({level:100,timestamp:0});onConnected=this.createStateObservable(this.cameraState);onLightSwitched=this.createStateObservable(this.lightState);onMotionDetected=this.createStateObservable(this.motionState);onAudioDetected=this.createStateObservable(this.audioState);onObjectDetected=this.createStateObservable(this.objectState);onDoorbellPressed=this.createStateObservable(this.doorbellState);onSirenDetected=this.createStateObservable(this.sirenState);onBatteryChanged=this.createStateObservable(this.batteryState);get id(){return this.cameraSubject.getValue()._id}get nativeId(){return this.cameraSubject.getValue().nativeId}get pluginId(){return this.cameraSubject.getValue().pluginId}get state(){return this.cameraState.getValue()}get disabled(){return this.cameraSubject.getValue().disabled}get name(){return this.cameraSubject.getValue().name}get type(){return this.cameraSubject.getValue().type}get info(){return Sn()(this.cameraSubject.getValue().info)}get isCloud(){return this.cameraSubject.getValue().isCloud}get hasLight(){return this.cameraSubject.getValue().hasLight}get hasSiren(){return this.cameraSubject.getValue().hasSiren}get hasBinarySensor(){return this.cameraSubject.getValue().hasBinarySensor}get hasBattery(){return this.cameraSubject.getValue().hasBattery}get hasMotionDetector(){return this.cameraSubject.getValue().hasMotionDetector}get hasAudioDetector(){return this.cameraSubject.getValue().hasAudioDetector}get hasObjectDetector(){return this.cameraSubject.getValue().hasObjectDetector}get hasPtz(){return this.cameraSubject.getValue().hasPtz}get hasPrebuffer(){return this.cameraSubject.getValue().hasPrebuffer}get hasIntercom(){return this.cameraSubject.getValue().hasIntercom}get motionZones(){return Sn()(this.cameraSubject.getValue().motionZones)}get objectZones(){return Sn()(this.cameraSubject.getValue().objectZones)}get sources(){return Sn()(this.cameraSubject.getValue().sources).map((t=>({...t,isPrebuffering:async()=>!1,getPrebufferRawUrl:async()=>{},getStreamInfo:async()=>{}})))}get streamSource(){return this.sources.find((t=>t.roles.includes("stream")))||this.sources[0]}get snapshotSource(){return this.sources.find((t=>t.roles.includes("snapshot")))||this.streamSource}get recordingSource(){return this.sources.find((t=>t.roles.includes("record")))||this.streamSource}get detectionSource(){return this.sources.find((t=>t.roles.includes("detect")))||this.streamSource}constructor(t,e){super(),this.logger=e,this.cameraSubject=new De(t),"native"===t.pluginId&&this.cameraState.next(!0)}getValue(t){switch(t){case"light":return Sn()(this.lightState.getValue());case"motion":return Sn()(this.motionState.getValue());case"audio":return Sn()(this.audioState.getValue());case"object":return Sn()(this.objectState.getValue());case"doorbell":return Sn()(this.doorbellState.getValue());case"siren":return Sn()(this.sirenState.getValue());case"battery":return Sn()(this.batteryState.getValue());default:throw new Error(`Unknown state: ${t}`)}}async updateState(t,e){switch(t){case"light":{const t=this.getLightState(e);t&&this.lightState.next(t)}break;case"motion":{const t=this.getMotionState(e);t&&this.motionState.next(t)}break;case"audio":{const t=this.getAudioState(e);t&&this.audioState.next(t)}break;case"object":{const t=this.getObjectState(e);t&&this.objectState.next(t)}break;case"doorbell":{const t=this.getDoorbellState(e);t&&this.doorbellState.next(t)}break;case"siren":{const t=this.getSirenState(e);t&&this.sirenState.next(t)}break;case"battery":{const t=this.getBatteryState(e);t&&this.batteryState.next(t)}break;default:throw new Error(`Unknown state: ${t}`)}}onStateChange(t){return this[`${t}State`].pipe(Fn(),Nn((([t,e])=>"boolean"==typeof t||"boolean"==typeof e?t!==e:!1===this.stateChanged(t,e))),Ie((([t,e])=>({oldState:t,newState:e}))),an({connector:()=>new Le(1)}))}onPropertyChange(t){return this.cameraSubject.pipe(Fn(),Nn((([e,n])=>!En()(e[t],n[t]))),Ie((([e,n])=>({oldData:e[t],newData:n[t]}))),an({connector:()=>new Le(1)}))}removeAllListeners(){this.lightState.complete(),this.motionState.complete(),this.audioState.complete(),this.objectState.complete(),this.doorbellState.complete(),this.sirenState.complete(),this.batteryState.complete(),this.cameraSubject.complete(),this.cameraState.complete()}getAudioState(t){if(this.hasAudioDetector)return{...t,db:t.db||this.audioState.getValue().db,timestamp:Date.now(),lastEvent:this.audioState.getValue()}}getMotionState(t){if(this.hasMotionDetector)return{...t,timestamp:Date.now(),lastEvent:this.motionState.getValue()}}getObjectState(t){if(this.hasBattery)return{...t,timestamp:Date.now(),lastEvent:this.objectState.getValue()}}getDoorbellState(t){if(this.hasBinarySensor)return{...t,timestamp:Date.now(),lastEvent:this.doorbellState.getValue()}}getLightState(t){if(this.hasLight)return{...t,timestamp:Date.now(),lastEvent:this.lightState.getValue()}}getSirenState(t){if(this.hasSiren)return{...t,level:t.level||this.sirenState.getValue().level,timestamp:Date.now(),lastEvent:this.sirenState.getValue()}}getBatteryState(t){if(this.hasBattery)return{...t,charging:t.charging||this.batteryState.getValue().charging,lowBattery:t.lowBattery||this.batteryState.getValue().lowBattery,timestamp:Date.now(),lastEvent:this.batteryState.getValue()}}createStateObservable(t){return t.pipe(sn(((t,e)=>"boolean"==typeof t||"boolean"==typeof e?t===e:!1===this.stateChanged(t,e))),an({connector:()=>new Le(1)}))}updateCamera(t){this.cameraSubject.next(t)}updateCameraState(t){this.cameraState.next(t)}stateChanged(t,e){return!(!t||!e||("boolean"==typeof t||"boolean"==typeof e?t===e:this.isAudioState(t)&&this.isAudioState(e)?t.state===e.state&&t.db===e.db:this.isMotionState(t)&&this.isMotionState(e)?t.state===e.state&&En()(t.detections,e.detections):this.isObjectState(t)&&this.isObjectState(e)?En()(t.detections,e.detections):this.isSirenState(t)&&this.isSirenState(e)?t.state===e.state&&t.level===e.level:t.state===e.state))}isAudioState(t){return"state"in t&&"db"in t}isMotionState(t){return"state"in t&&"detections"in t}isObjectState(t){return"detections"in t}isSirenState(t){return"state"in t&&"level"in t}isGenericState(t){return"state"in t}}class In extends zn{async snapshot(t=!1){const e=this.snapshotSource.urls.www.jpegSnapshot,n=this.snapshotCache.get(this.snapshotSource._id);if(!t&&n)return n;const r=await fetch(e);if(!r.ok)throw new Error("Status Code: "+r.status);const i=await r.arrayBuffer();return i.byteLength>0&&this.snapshotCache.set(this.snapshotSource._id,i),i}async createSession(t,e){const n=await this.getIceServers(),r=new vn(this,t,e,n,this.logger);return new hn(this,this.logger,r)}}class Un extends In{socketService;get sources(){return super.sources.map((t=>({...t,isPrebuffering:async e=>this.socketService.sendRequest({name:"cameraDevice",method:"isPrebuffering",args:[{sourceName:t.name,type:e,cameraId:this.id}]}),getPrebufferRawUrl:async e=>this.socketService.sendRequest({name:"cameraDevice",method:"getPrebufferRawUrl",args:[{sourceName:t.name,type:e}]}),getStreamInfo:async()=>this.socketService.sendRequest({name:"cameraDevice",method:"getStreamInfo",args:[{sourceName:t.name}]})})))}constructor(t,e,n){super(t,n),this.socketService=e,this.listenToMessages()}connect(){return this.socketService.sendRequest({name:"cameraDevice",method:"connect",args:[{cameraId:this.id}]})}disconnect(){return this.socketService.sendRequest({name:"cameraDevice",method:"disconnect",args:[{cameraId:this.id}]})}reboot(){return this.socketService.sendRequest({name:"cameraDevice",method:"reboot",args:[{cameraId:this.id}]})}getIceServers(){return this.socketService.sendRequest({name:"cameraDevice",method:"getIceServers",args:[{cameraId:this.id}]})}async updateState(t,e){let n=!1;switch(t){case"light":n=this.stateChanged(this.lightState.getValue(),this.getLightState(e));break;case"motion":n=this.stateChanged(this.motionState.getValue(),this.getMotionState(e));break;case"audio":n=this.stateChanged(this.audioState.getValue(),this.getAudioState(e));break;case"object":n=this.stateChanged(this.objectState.getValue(),this.getObjectState(e));break;case"doorbell":n=this.stateChanged(this.doorbellState.getValue(),this.getDoorbellState(e));break;case"siren":n=this.stateChanged(this.sirenState.getValue(),this.getSirenState(e));break;case"battery":n=this.stateChanged(this.batteryState.getValue(),this.getBatteryState(e));break;default:throw new Error(`Unknown state: ${t}`)}if(n)return this.socketService.sendRequest({name:"cameraDevice",method:"updateState",args:[{cameraId:this.id,stateName:t,eventData:e}]})}async refreshStates(){const t=await this.socketService.sendRequest({name:"cameraDevice",method:"refreshStates",args:[{cameraId:this.id}]});this.updateCamera(t.camera),this.updateCameraState(t.cameraState);for(const[e,n]of Object.entries(t.states))super.updateState(e,n)}async cleanup(){try{this.removeAllListeners(),this.unsubscribe()}catch{}}listenToMessages(){this.socketService.socket.on("updateState",(t=>{t.cameraId===this.id&&super.updateState(t.stateName,t.data.newEvent)})),this.socketService.socket.on("updateDevice",(t=>{if(t.cameraId===this.id)switch(t.type){case"removed":this.cleanup();break;case"updated":super.updateCamera(t.data);break;case"cameraState":super.updateCameraState(t.data)}}))}}class Mn{socketService;devices=new Map;logger;constructor(t,e){this.socketService=t,this.logger=e}async getCameraById(t){let e=await this.addOrGetCamera(t);if(!e){const n=await this.socketService.sendRequest({name:"deviceManager",method:"getCameraById",args:[{id:t}]});n&&(e=await this.addOrGetCamera(n))}return e}async getCameraByName(t){let e=Array.from(this.devices.values()).find((e=>e.name===t));if(!e){const n=await this.socketService.sendRequest({name:"deviceManager",method:"getCameraByName",args:[{name:t}]});n&&(e=await this.addOrGetCamera(n))}return e}async addOrGetCamera(t){let e;if("string"==typeof t)e=Array.from(this.devices.values()).find((e=>e.id===t||e.name===t));else{const n=t;this.devices.has(n._id)?e=this.devices.get(n._id):(e=new Un(n,this.socketService,this.logger),this.devices.set(n._id,e))}return await(e?.refreshStates()),e}}class qn{socketService;logger;constructor(t,e){this.socketService=t,this.logger=e}}class Vn{socketService;logger;constructor(t,e){this.socketService=t,this.logger=e}}const Wn=Object.create(null);Wn.open="0",Wn.close="1",Wn.ping="2",Wn.pong="3",Wn.message="4",Wn.upgrade="5",Wn.noop="6";const Hn=Object.create(null);Object.keys(Wn).forEach((t=>{Hn[Wn[t]]=t}));const $n={type:"error",data:"parser error"},Gn="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Jn="function"==typeof ArrayBuffer,Kn=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Yn=({type:t,data:e},n,r)=>Gn&&e instanceof Blob?n?r(e):Xn(e,r):Jn&&(e instanceof ArrayBuffer||Kn(e))?n?r(e):Xn(new Blob([e]),r):r(Wn[t]+(e||"")),Xn=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function Qn(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zn;const tr="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)tr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;const er="function"==typeof ArrayBuffer,nr=(t,e)=>{if("string"!=typeof t)return{type:"message",data:ir(t,e)};const n=t.charAt(0);return"b"===n?{type:"message",data:rr(t.substring(1),e)}:Hn[n]?t.length>1?{type:Hn[n],data:t.substring(1)}:{type:Hn[n]}:$n},rr=(t,e)=>{if(er){const n=(t=>{let e,n,r,i,s,o=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);const u=new ArrayBuffer(o),h=new Uint8Array(u);for(e=0;e<a;e+=4)n=tr[t.charCodeAt(e)],r=tr[t.charCodeAt(e+1)],i=tr[t.charCodeAt(e+2)],s=tr[t.charCodeAt(e+3)],h[c++]=n<<2|r>>4,h[c++]=(15&r)<<4|i>>2,h[c++]=(3&i)<<6|63&s;return u})(t);return ir(n,e)}return{base64:!0,data:t}},ir=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,sr=String.fromCharCode(30);let or;function ar(t){return t.reduce(((t,e)=>t+e.length),0)}function cr(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function ur(t){if(t)return function(t){for(var e in ur.prototype)t[e]=ur.prototype[e];return t}(t)}ur.prototype.on=ur.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},ur.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},ur.prototype.off=ur.prototype.removeListener=ur.prototype.removeAllListeners=ur.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},ur.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},ur.prototype.emitReserved=ur.prototype.emit,ur.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},ur.prototype.hasListeners=function(t){return!!this.listeners(t).length};const hr="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function lr(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})}const fr=hr.setTimeout,dr=hr.clearTimeout;function pr(t,e){e.useNativeTimers?(t.setTimeoutFn=fr.bind(hr),t.clearTimeoutFn=dr.bind(hr)):(t.setTimeoutFn=hr.setTimeout.bind(hr),t.clearTimeoutFn=hr.clearTimeout.bind(hr))}class gr extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class yr extends ur{constructor(t){super(),this.writable=!1,pr(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new gr(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=nr(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){const e=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}(t);return e.length?"?"+e:""}}const br="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),mr=64,vr={};let wr,Sr=0,_r=0;function Er(t){let e="";do{e=br[t%mr]+e,t=Math.floor(t/mr)}while(t>0);return e}function Or(){const t=Er(+new Date);return t!==wr?(Sr=0,wr=t):t+"."+Er(Sr++)}for(;_r<mr;_r++)vr[br[_r]]=_r;let kr=!1;try{kr="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const Ar=kr;function Tr(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||Ar))return new XMLHttpRequest}catch(t){}if(!e)try{return new(hr[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function xr(){}const jr=null!=new Tr({xdomain:!1}).responseType;class Cr extends ur{constructor(t,e){super(),pr(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;const e=lr(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new Tr(e);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&n.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var t;3===n.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=Cr.requestsCount++,Cr.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=xr,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete Cr.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Rr(){for(let t in Cr.requests)Cr.requests.hasOwnProperty(t)&&Cr.requests[t].abort()}Cr.requestsCount=0,Cr.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Rr):"function"==typeof addEventListener&&addEventListener("onpagehide"in hr?"pagehide":"unload",Rr,!1));const Lr="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),Dr=hr.WebSocket||hr.MozWebSocket,Br="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Fr={websocket:class extends yr{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=Br?{}:lr(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=Br?new Dr(t,e,n):e?new Dr(t,e):new Dr(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;Yn(n,this.supportsBinary,(t=>{try{this.ws.send(t)}catch(t){}r&&Lr((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=Or()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!Dr}},webtransport:class extends yr{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((t=>{this.onError("webtransport error",t)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((t=>{const e=function(t,e){or||(or=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(0===r){if(ar(n)<1)break;const t=cr(n,1);s=!(128&~t[0]),i=127&t[0],r=i<126?3:126===i?1:2}else if(1===r){if(ar(n)<2)break;const t=cr(n,2);i=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(ar(n)<8)break;const t=cr(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),s=e.getUint32(0);if(s>Math.pow(2,21)-1){a.enqueue($n);break}i=s*Math.pow(2,32)+e.getUint32(4),r=3}else{if(ar(n)<i)break;const t=cr(n,i);a.enqueue(nr(s?t:or.decode(t),e)),r=0}if(0===i||i>t){a.enqueue($n);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=new TransformStream({transform(t,e){!function(t,e){Gn&&t.data instanceof Blob?t.data.arrayBuffer().then(Qn).then(e):Jn&&(t.data instanceof ArrayBuffer||Kn(t.data))?e(Qn(t.data)):Yn(t,!1,(t=>{Zn||(Zn=new TextEncoder),e(Zn.encode(t))}))}(t,(n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const t=new DataView(i.buffer);t.setUint8(0,126),t.setUint16(1,r)}else{i=new Uint8Array(9);const t=new DataView(i.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(r))}t.data&&"string"!=typeof t.data&&(i[0]|=128),e.enqueue(i),e.enqueue(n)}))}});r.readable.pipeTo(t.writable),this.writer=r.writable.getWriter();const i=()=>{n.read().then((({done:t,value:e})=>{t||(this.onPacket(e),i())})).catch((t=>{}))};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then((()=>this.onOpen()))}))})))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;this.writer.write(n).then((()=>{r&&Lr((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends yr{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port}const e=t&&t.forceBase64;this.supportsBinary=jr&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,e)=>{const n=t.split(sr),r=[];for(let t=0;t<n.length;t++){const i=nr(n[t],e);if(r.push(i),"error"===i.type)break}return r})(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach(((t,s)=>{Yn(t,!1,(t=>{r[s]=t,++i===n&&e(r.join(sr))}))}))})(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=Or()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Cr(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}},Nr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Pr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zr(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=Nr.exec(t||""),s={},o=14;for(;o--;)s[Pr[o]]=i[o]||"";return-1!=n&&-1!=r&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(t,e){const n=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||n.splice(0,1),"/"==e.slice(-1)&&n.splice(n.length-1,1),n}(0,s.path),s.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(n[e]=r)})),n}(0,s.query),s}class Ir extends ur{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=zr(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=zr(e.host).host),pr(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new Fr[t](n)}open(){let t;if(this.opts.rememberUpgrade&&Ir.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(t=>this.onClose("transport close",t)))}probe(t){let e=this.createTransport(t),n=!1;Ir.priorWebsocketSuccess=!1;const r=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",(t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;Ir.priorWebsocketSuccess="websocket"===e.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(u(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}))}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}})))};function i(){n||(n=!0,u(),e.close(),e=null)}const s=t=>{const n=new Error("probe error: "+t);n.transport=e.name,i(),this.emitReserved("upgradeError",n)};function o(){s("transport closed")}function a(){s("socket closed")}function c(t){e&&t.name!==e.name&&i()}const u=()=>{e.removeListener("open",r),e.removeListener("error",s),e.removeListener("close",o),this.off("close",a),this.off("upgrading",c)};e.once("open",r),e.once("error",s),e.once("close",o),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{n||e.open()}),200):e.open()}onOpen(){if(this.readyState="open",Ir.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+="string"==typeof(e=r)?function(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}var e;return this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:t,data:e,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():t()})):this.upgrading?n():t()),this}onError(t){Ir.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}Ir.protocol=4,Ir.protocol;const Ur="function"==typeof ArrayBuffer,Mr=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,qr=Object.prototype.toString,Vr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===qr.call(Blob),Wr="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===qr.call(File);function Hr(t){return Ur&&(t instanceof ArrayBuffer||Mr(t))||Vr&&t instanceof Blob||Wr&&t instanceof File}function $r(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if($r(t[e]))return!0;return!1}if(Hr(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return $r(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&$r(t[e]))return!0;return!1}function Gr(t){const e=[],n=t.data,r=t;return r.data=Jr(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Jr(t,e){if(!t)return t;if(Hr(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Jr(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Jr(t[r],e));return n}return t}function Kr(t,e){return t.data=Yr(t.data,e),delete t.attachments,t}function Yr(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Yr(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Yr(t[n],e));return t}const Xr=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Qr=5;var Zr;!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(Zr||(Zr={}));class ti{constructor(t){this.replacer=t}encode(t){return t.type!==Zr.EVENT&&t.type!==Zr.ACK||!$r(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Zr.EVENT?Zr.BINARY_EVENT:Zr.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==Zr.BINARY_EVENT&&t.type!==Zr.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=Gr(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function ei(t){return"[object Object]"===Object.prototype.toString.call(t)}class ni extends ur{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===Zr.BINARY_EVENT;n||e.type===Zr.BINARY_ACK?(e.type=n?Zr.EVENT:Zr.ACK,this.reconstructor=new ri(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!Hr(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===Zr[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Zr.BINARY_EVENT||n.type===Zr.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const i=t.substring(r,e);if(i!=Number(i)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!ni.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case Zr.CONNECT:return ei(e);case Zr.DISCONNECT:return void 0===e;case Zr.CONNECT_ERROR:return"string"==typeof e||ei(e);case Zr.EVENT:case Zr.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Xr.indexOf(e[0]));case Zr.ACK:case Zr.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ri{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=Kr(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ii(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const si=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class oi extends ur{constructor(t,e,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ii(t,"open",this.onopen.bind(this)),ii(t,"packet",this.onpacket.bind(this)),ii(t,"error",this.onerror.bind(this)),ii(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(si.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:Zr.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++,r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const i=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))}),r),s=(...t)=>{this.io.clearTimeoutFn(i),e.apply(this,t)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...e){return new Promise(((n,r)=>{const i=(t,e)=>t?r(t):n(e);i.withError=!0,e.push(i),this.emit(t,...e)}))}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...r)=>{if(n===this._queue[0])return null!==t?n.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth((t=>{this._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Zr.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((t=>{if(!this.sendBuffer.some((e=>String(e.id)===t))){const e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}}))}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Zr.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Zr.EVENT:case Zr.BINARY_EVENT:this.onevent(t);break;case Zr.ACK:case Zr.BINARY_ACK:this.onack(t);break;case Zr.DISCONNECT:this.ondisconnect();break;case Zr.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,e.packet({type:Zr.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>{this.notifyOutgoingListeners(t),this.packet(t)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Zr.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}function ai(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ai.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+n:t-n}return 0|Math.min(t,this.max)},ai.prototype.reset=function(){this.attempts=0},ai.prototype.setMin=function(t){this.ms=t},ai.prototype.setMax=function(t){this.max=t},ai.prototype.setJitter=function(t){this.jitter=t};class ci extends ur{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,pr(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new ai({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ir(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ii(e,"open",(function(){n.onopen(),t&&t()})),i=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},s=ii(e,"error",i);if(!1!==this._timeout){const t=this._timeout,n=this.setTimeoutFn((()=>{r(),i(new Error("timeout")),e.close()}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ii(t,"ping",this.onping.bind(this)),ii(t,"data",this.ondata.bind(this)),ii(t,"error",this.onerror.bind(this)),ii(t,"close",this.onclose.bind(this)),ii(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){Lr((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new oi(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()})))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ui={};function hi(t,e){"object"==typeof t&&(e=t,t=void 0);const n=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=zr(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(t,(e=e||{}).path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=ui[i]&&s in ui[i].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||o?a=new ci(r,e):(ui[i]||(ui[i]=new ci(r,e)),a=ui[i]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(hi,{Manager:ci,Socket:oi,io:hi,connect:hi});class li{manager;token;get socket(){return this.manager.socket("/proxy",{auth:{token:`Bearer ${this.token}`}})}constructor(t,e){const n=t.replace("https://","wss://").replace("http://","ws://");this.token=e,this.manager=new ci(n,{reconnection:!0,reconnectionDelay:500,rejectUnauthorized:!1,autoConnect:!0,transports:["websocket"]})}sendRequest(t){return new Promise(((e,n)=>{this.socket.emit("request",t,(t=>{t.success?e(t.data):n(t.error)}))}))}close(){this.socket.emit("end"),this.socket.removeAllListeners(),this.socket.disconnect()}}class fi{api;socketService;config;logger;token;deviceManager;pluginsManager;systemManager;constructor(t){this.config=t,this.logger=t.logger||console,this.api=new $t(t.endpoint)}async connect(){return this.deviceManager&&this.pluginsManager&&this.systemManager||(this.cleanUpClient(),await this.login(),this.token=this.token||this.config.token,this.socketService=new li(this.config.endpoint,this.token),this.deviceManager=new Mn(this.socketService,this.logger),this.pluginsManager=new qn(this.socketService,this.logger),this.systemManager=new Vn(this.socketService,this.logger),this.checkSession()),{deviceManager:this.deviceManager,pluginsManager:this.pluginsManager,systemManager:this.systemManager}}async disconnect(){this.socketService?.close(),this.cleanUpClient(),this.config.username&&this.config.password&&await this.api.interceptor.post("/auth/logout",void 0,{headers:{Authorization:`Bearer ${this.token}`}})}async updateCredentials(t){this.config={...this.config,...t},this.socketService&&await this.disconnect(),await this.connect()}async login(){if(this.config.username&&this.config.password)try{const t=await this.api.interceptor.post("/auth/login",{username:this.config.username,password:this.config.password});this.token=t.data.access_token}catch(t){throw 401===t.response?.status?new Error("Invalid credentials"):new Error(`Failed to get token: ${t.message}`)}else if(this.config.token&&!this.config.skipCheck)try{await this.api.interceptor.get("/auth/check",{headers:{Authorization:`Bearer ${this.config.token}`}})}catch(t){throw new Error(`Invalid token: ${t.message}`)}this.token=this.token||this.config.token}getDeviceManager(){return this.deviceManager}getPluginsManager(){return this.pluginsManager}getSystemManager(){return this.systemManager}checkSession(){this.socketService?.socket.removeListener("invalidToken"),this.socketService?.socket.on("invalidToken",(async t=>{t===this.token&&await this.disconnect()}))}cleanUpClient(){this.deviceManager=void 0,this.pluginsManager=void 0,this.systemManager=void 0}}var di,pi,gi;!function(t){t.READY="ready",t.STARTING="starting",t.STARTED="started",t.STOPPED="stopped",t.ERROR="error",t.UNKNOWN="unknown",t.DISABLED="disabled"}(di||(di={})),function(t){t.START="start",t.STOP="stop"}(pi||(pi={})),function(t){t.READY="ready",t.RESTARTING="restarting",t.STARTING="starting",t.STARTED="started",t.STOPPED="stopped",t.ERROR="error",t.UNKNOWN="unknown"}(gi||(gi={}))})();var i=r.F,s=r.j;export{i as BrowserStreamingSession,s as CameraUiClient};
1
+ var t={275:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=9007199254740991,s="[object Arguments]",o="[object Boolean]",a="[object Date]",c="[object Function]",u="[object GeneratorFunction]",h="[object Map]",l="[object Number]",f="[object Object]",d="[object Promise]",p="[object RegExp]",g="[object Set]",y="[object String]",b="[object Symbol]",m="[object WeakMap]",v="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",O="[object Int16Array]",k="[object Int32Array]",A="[object Uint8Array]",T="[object Uint8ClampedArray]",x="[object Uint16Array]",j="[object Uint32Array]",C=/\w*$/,R=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,D={};D[s]=D["[object Array]"]=D[v]=D[w]=D[o]=D[a]=D[S]=D[_]=D[E]=D[O]=D[k]=D[h]=D[l]=D[f]=D[p]=D[g]=D[y]=D[b]=D[A]=D[T]=D[x]=D[j]=!0,D["[object Error]"]=D[c]=D[m]=!1;var B="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,F="object"==typeof self&&self&&self.Object===Object&&self,N=B||F||Function("return this")(),P=e&&!e.nodeType&&e,z=P&&t&&!t.nodeType&&t,I=z&&z.exports===P;function U(t,e){return t.set(e[0],e[1]),t}function M(t,e){return t.add(e),t}function q(t,e,n,r){var i=-1,s=t?t.length:0;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function V(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function W(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function H(t,e){return function(n){return t(e(n))}}function $(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var G,J=Array.prototype,K=Function.prototype,Y=Object.prototype,X=N["__core-js_shared__"],Q=(G=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||""))?"Symbol(src)_1."+G:"",Z=K.toString,tt=Y.hasOwnProperty,et=Y.toString,nt=RegExp("^"+Z.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=I?N.Buffer:void 0,it=N.Symbol,st=N.Uint8Array,ot=H(Object.getPrototypeOf,Object),at=Object.create,ct=Y.propertyIsEnumerable,ut=J.splice,ht=Object.getOwnPropertySymbols,lt=rt?rt.isBuffer:void 0,ft=H(Object.keys,Object),dt=Nt(N,"DataView"),pt=Nt(N,"Map"),gt=Nt(N,"Promise"),yt=Nt(N,"Set"),bt=Nt(N,"WeakMap"),mt=Nt(Object,"create"),vt=Mt(dt),wt=Mt(pt),St=Mt(gt),_t=Mt(yt),Et=Mt(bt),Ot=it?it.prototype:void 0,kt=Ot?Ot.valueOf:void 0;function At(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Tt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function xt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jt(t){this.__data__=new Tt(t)}function Ct(t,e,n){var r=t[e];tt.call(t,e)&&qt(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function Rt(t,e){for(var n=t.length;n--;)if(qt(t[n][0],e))return n;return-1}function Lt(t,e,n,r,i,d,m){var R;if(r&&(R=d?r(t,i,d,m):r(t)),void 0!==R)return R;if(!Gt(t))return t;var L=Vt(t);if(L){if(R=function(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&tt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!e)return function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(t,R)}else{var B=zt(t),F=B==c||B==u;if(Ht(t))return function(t,e){if(e)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,e);if(B==f||B==s||F&&!d){if(V(t))return d?t:{};if(R=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:Gt(e=ot(t))?at(e):{};var e}(F?{}:t),!e)return function(t,e){return Bt(t,Pt(t),e)}(t,function(t,e){return t&&Bt(e,Jt(e),t)}(R,t))}else{if(!D[B])return d?t:{};R=function(t,e,n,r){var i,s=t.constructor;switch(e){case v:return Dt(t);case o:case a:return new s(+t);case w:return function(t,e){var n=e?Dt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,r);case S:case _:case E:case O:case k:case A:case T:case x:case j:return function(t,e){var n=e?Dt(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,r);case h:return function(t,e,n){return q(e?n(W(t),!0):W(t),U,new t.constructor)}(t,r,n);case l:case y:return new s(t);case p:return function(t){var e=new t.constructor(t.source,C.exec(t));return e.lastIndex=t.lastIndex,e}(t);case g:return function(t,e,n){return q(e?n($(t),!0):$(t),M,new t.constructor)}(t,r,n);case b:return i=t,kt?Object(kt.call(i)):{}}}(t,B,Lt,e)}}m||(m=new jt);var N=m.get(t);if(N)return N;if(m.set(t,R),!L)var P=n?function(t){return function(t,e,n){var r=e(t);return Vt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Jt,Pt)}(t):Jt(t);return function(t,e){for(var n=-1,r=t?t.length:0;++n<r&&!1!==e(t[n],n););}(P||t,(function(i,s){P&&(i=t[s=i]),Ct(R,s,Lt(i,e,n,r,s,t,m))})),R}function Dt(t){var e=new t.constructor(t.byteLength);return new st(e).set(new st(t)),e}function Bt(t,e,n,r){n||(n={});for(var i=-1,s=e.length;++i<s;){var o=e[i],a=r?r(n[o],t[o],o,n,t):void 0;Ct(n,o,void 0===a?t[o]:a)}return n}function Ft(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Nt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Gt(t)||(e=t,Q&&Q in e))&&($t(t)||V(t)?nt:R).test(Mt(t));var e}(n)?n:void 0}At.prototype.clear=function(){this.__data__=mt?mt(null):{}},At.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},At.prototype.get=function(t){var e=this.__data__;if(mt){var n=e[t];return n===r?void 0:n}return tt.call(e,t)?e[t]:void 0},At.prototype.has=function(t){var e=this.__data__;return mt?void 0!==e[t]:tt.call(e,t)},At.prototype.set=function(t,e){return this.__data__[t]=mt&&void 0===e?r:e,this},Tt.prototype.clear=function(){this.__data__=[]},Tt.prototype.delete=function(t){var e=this.__data__,n=Rt(e,t);return!(n<0||(n==e.length-1?e.pop():ut.call(e,n,1),0))},Tt.prototype.get=function(t){var e=this.__data__,n=Rt(e,t);return n<0?void 0:e[n][1]},Tt.prototype.has=function(t){return Rt(this.__data__,t)>-1},Tt.prototype.set=function(t,e){var n=this.__data__,r=Rt(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},xt.prototype.clear=function(){this.__data__={hash:new At,map:new(pt||Tt),string:new At}},xt.prototype.delete=function(t){return Ft(this,t).delete(t)},xt.prototype.get=function(t){return Ft(this,t).get(t)},xt.prototype.has=function(t){return Ft(this,t).has(t)},xt.prototype.set=function(t,e){return Ft(this,t).set(t,e),this},jt.prototype.clear=function(){this.__data__=new Tt},jt.prototype.delete=function(t){return this.__data__.delete(t)},jt.prototype.get=function(t){return this.__data__.get(t)},jt.prototype.has=function(t){return this.__data__.has(t)},jt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Tt){var r=n.__data__;if(!pt||r.length<199)return r.push([t,e]),this;n=this.__data__=new xt(r)}return n.set(t,e),this};var Pt=ht?H(ht,Object):function(){return[]},zt=function(t){return et.call(t)};function It(t,e){return!!(e=null==e?i:e)&&("number"==typeof t||L.test(t))&&t>-1&&t%1==0&&t<e}function Ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Y)}function Mt(t){if(null!=t){try{return Z.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function qt(t,e){return t===e||t!=t&&e!=e}(dt&&zt(new dt(new ArrayBuffer(1)))!=w||pt&&zt(new pt)!=h||gt&&zt(gt.resolve())!=d||yt&&zt(new yt)!=g||bt&&zt(new bt)!=m)&&(zt=function(t){var e=et.call(t),n=e==f?t.constructor:void 0,r=n?Mt(n):void 0;if(r)switch(r){case vt:return w;case wt:return h;case St:return d;case _t:return g;case Et:return m}return e});var Vt=Array.isArray;function Wt(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}(t.length)&&!$t(t)}var Ht=lt||function(){return!1};function $t(t){var e=Gt(t)?et.call(t):"";return e==c||e==u}function Gt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Jt(t){return Wt(t)?function(t,e){var n=Vt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Wt(t)}(t)&&tt.call(t,"callee")&&(!ct.call(t,"callee")||et.call(t)==s)}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,i=!!r;for(var o in t)!e&&!tt.call(t,o)||i&&("length"==o||It(o,r))||n.push(o);return n}(t):function(t){if(!Ut(t))return ft(t);var e=[];for(var n in Object(t))tt.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},512:(t,e,n)=>{t=n.nmd(t);var r="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",h="[object Boolean]",l="[object Date]",f="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Null]",m="[object Object]",v="[object Promise]",w="[object Proxy]",S="[object RegExp]",_="[object Set]",E="[object String]",O="[object Undefined]",k="[object WeakMap]",A="[object ArrayBuffer]",T="[object DataView]",x=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,C={};C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C[a]=C[c]=C[A]=C[h]=C[T]=C[l]=C[f]=C[d]=C[g]=C[y]=C[m]=C[S]=C[_]=C[E]=C[k]=!1;var R="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,L="object"==typeof self&&self&&self.Object===Object&&self,D=R||L||Function("return this")(),B=e&&!e.nodeType&&e,F=B&&t&&!t.nodeType&&t,N=F&&F.exports===B,P=N&&R.process,z=function(){try{return P&&P.binding&&P.binding("util")}catch(t){}}(),I=z&&z.isTypedArray;function U(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function M(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function q(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var V,W,H,$=Array.prototype,G=Function.prototype,J=Object.prototype,K=D["__core-js_shared__"],Y=G.toString,X=J.hasOwnProperty,Q=(V=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Z=J.toString,tt=RegExp("^"+Y.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=N?D.Buffer:void 0,nt=D.Symbol,rt=D.Uint8Array,it=J.propertyIsEnumerable,st=$.splice,ot=nt?nt.toStringTag:void 0,at=Object.getOwnPropertySymbols,ct=et?et.isBuffer:void 0,ut=(W=Object.keys,H=Object,function(t){return W(H(t))}),ht=Ft(D,"DataView"),lt=Ft(D,"Map"),ft=Ft(D,"Promise"),dt=Ft(D,"Set"),pt=Ft(D,"WeakMap"),gt=Ft(Object,"create"),yt=It(ht),bt=It(lt),mt=It(ft),vt=It(dt),wt=It(pt),St=nt?nt.prototype:void 0,_t=St?St.valueOf:void 0;function Et(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function kt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function At(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new kt;++e<n;)this.add(t[e])}function Tt(t){var e=this.__data__=new Ot(t);this.size=e.size}function xt(t,e){for(var n=t.length;n--;)if(Ut(t[n][0],e))return n;return-1}function jt(t){return null==t?void 0===t?O:b:ot&&ot in Object(t)?function(t){var e=X.call(t,ot),n=t[ot];try{t[ot]=void 0;var r=!0}catch(t){}var i=Z.call(t);return r&&(e?t[ot]=n:delete t[ot]),i}(t):function(t){return Z.call(t)}(t)}function Ct(t){return Gt(t)&&jt(t)==a}function Rt(t,e,n,r,o){return t===e||(null==t||null==e||!Gt(t)&&!Gt(e)?t!=t&&e!=e:function(t,e,n,r,o,u){var d=qt(t),p=qt(e),b=d?c:Pt(t),v=p?c:Pt(e),w=(b=b==a?m:b)==m,O=(v=v==a?m:v)==m,k=b==v;if(k&&Vt(t)){if(!Vt(e))return!1;d=!0,w=!1}if(k&&!w)return u||(u=new Tt),d||Jt(t)?Lt(t,e,n,r,o,u):function(t,e,n,r,o,a,c){switch(n){case T:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case A:return!(t.byteLength!=e.byteLength||!a(new rt(t),new rt(e)));case h:case l:case y:return Ut(+t,+e);case f:return t.name==e.name&&t.message==e.message;case S:case E:return t==e+"";case g:var u=M;case _:var d=r&i;if(u||(u=q),t.size!=e.size&&!d)return!1;var p=c.get(t);if(p)return p==e;r|=s,c.set(t,e);var b=Lt(u(t),u(e),r,o,a,c);return c.delete(t),b;case"[object Symbol]":if(_t)return _t.call(t)==_t.call(e)}return!1}(t,e,b,n,r,o,u);if(!(n&i)){var x=w&&X.call(t,"__wrapped__"),j=O&&X.call(e,"__wrapped__");if(x||j){var C=x?t.value():t,R=j?e.value():e;return u||(u=new Tt),o(C,R,n,r,u)}}return!!k&&(u||(u=new Tt),function(t,e,n,r,s,o){var a=n&i,c=Dt(t),u=c.length;if(u!=Dt(e).length&&!a)return!1;for(var h=u;h--;){var l=c[h];if(!(a?l in e:X.call(e,l)))return!1}var f=o.get(t);if(f&&o.get(e))return f==e;var d=!0;o.set(t,e),o.set(e,t);for(var p=a;++h<u;){var g=t[l=c[h]],y=e[l];if(r)var b=a?r(y,g,l,e,t,o):r(g,y,l,t,e,o);if(!(void 0===b?g===y||s(g,y,n,r,o):b)){d=!1;break}p||(p="constructor"==l)}if(d&&!p){var m=t.constructor,v=e.constructor;m==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v||(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,o,u))}(t,e,n,r,Rt,o))}function Lt(t,e,n,r,o,a){var c=n&i,u=t.length,h=e.length;if(u!=h&&!(c&&h>u))return!1;var l=a.get(t);if(l&&a.get(e))return l==e;var f=-1,d=!0,p=n&s?new At:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var g=t[f],y=e[f];if(r)var b=c?r(y,g,f,e,t,a):r(g,y,f,t,e,a);if(void 0!==b){if(b)continue;d=!1;break}if(p){if(!U(e,(function(t,e){if(i=e,!p.has(i)&&(g===t||o(g,t,n,r,a)))return p.push(e);var i}))){d=!1;break}}else if(g!==y&&!o(g,y,n,r,a)){d=!1;break}}return a.delete(t),a.delete(e),d}function Dt(t){return function(t,e,n){var r=e(t);return qt(t)?r:function(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}(r,n(t))}(t,Kt,Nt)}function Bt(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!$t(t)||function(t){return!!Q&&Q in t}(t))&&(Wt(t)?tt:x).test(It(t))}(n)?n:void 0}Et.prototype.clear=function(){this.__data__=gt?gt(null):{},this.size=0},Et.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Et.prototype.get=function(t){var e=this.__data__;if(gt){var n=e[t];return n===r?void 0:n}return X.call(e,t)?e[t]:void 0},Et.prototype.has=function(t){var e=this.__data__;return gt?void 0!==e[t]:X.call(e,t)},Et.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=gt&&void 0===e?r:e,this},Ot.prototype.clear=function(){this.__data__=[],this.size=0},Ot.prototype.delete=function(t){var e=this.__data__,n=xt(e,t);return!(n<0||(n==e.length-1?e.pop():st.call(e,n,1),--this.size,0))},Ot.prototype.get=function(t){var e=this.__data__,n=xt(e,t);return n<0?void 0:e[n][1]},Ot.prototype.has=function(t){return xt(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=xt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},kt.prototype.clear=function(){this.size=0,this.__data__={hash:new Et,map:new(lt||Ot),string:new Et}},kt.prototype.delete=function(t){var e=Bt(this,t).delete(t);return this.size-=e?1:0,e},kt.prototype.get=function(t){return Bt(this,t).get(t)},kt.prototype.has=function(t){return Bt(this,t).has(t)},kt.prototype.set=function(t,e){var n=Bt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},At.prototype.add=At.prototype.push=function(t){return this.__data__.set(t,r),this},At.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.clear=function(){this.__data__=new Ot,this.size=0},Tt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Tt.prototype.get=function(t){return this.__data__.get(t)},Tt.prototype.has=function(t){return this.__data__.has(t)},Tt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var r=n.__data__;if(!lt||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new kt(r)}return n.set(t,e),this.size=n.size,this};var Nt=at?function(t){return null==t?[]:(t=Object(t),function(e,n){for(var r=-1,i=null==e?0:e.length,s=0,o=[];++r<i;){var a=e[r];c=a,it.call(t,c)&&(o[s++]=a)}var c;return o}(at(t)))}:function(){return[]},Pt=jt;function zt(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||j.test(t))&&t>-1&&t%1==0&&t<e}function It(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ut(t,e){return t===e||t!=t&&e!=e}(ht&&Pt(new ht(new ArrayBuffer(1)))!=T||lt&&Pt(new lt)!=g||ft&&Pt(ft.resolve())!=v||dt&&Pt(new dt)!=_||pt&&Pt(new pt)!=k)&&(Pt=function(t){var e=jt(t),n=e==m?t.constructor:void 0,r=n?It(n):"";if(r)switch(r){case yt:return T;case bt:return g;case mt:return v;case vt:return _;case wt:return k}return e});var Mt=Ct(function(){return arguments}())?Ct:function(t){return Gt(t)&&X.call(t,"callee")&&!it.call(t,"callee")},qt=Array.isArray,Vt=ct||function(){return!1};function Wt(t){if(!$t(t))return!1;var e=jt(t);return e==d||e==p||e==u||e==w}function Ht(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function $t(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Gt(t){return null!=t&&"object"==typeof t}var Jt=I?function(t){return function(e){return t(e)}}(I):function(t){return Gt(t)&&Ht(t.length)&&!!C[jt(t)]};function Kt(t){return null!=(e=t)&&Ht(e.length)&&!Wt(e)?function(t,e){var n=qt(t),r=!n&&Mt(t),i=!n&&!r&&Vt(t),s=!n&&!r&&!i&&Jt(t),o=n||r||i||s,a=o?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var u in t)!e&&!X.call(t,u)||o&&("length"==u||i&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||zt(u,c))||a.push(u);return a}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||J))return ut(t);var e,n,r=[];for(var i in Object(t))X.call(t,i)&&"constructor"!=i&&r.push(i);return r}(t);var e}t.exports=function(t,e){return Rt(t,e)}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={id:r,loaded:!1,exports:{}};return t[r](s,s.exports,n),s.loaded=!0,s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{n.d(r,{F:()=>hn,j:()=>fi});var t={};n.r(t),n.d(t,{hasBrowserEnv:()=>nt,hasStandardBrowserEnv:()=>rt,hasStandardBrowserWebWorkerEnv:()=>st});var e={};function i(t,e){return function(){return t.apply(e,arguments)}}n.r(e),n.d(e,{Decoder:()=>ni,Encoder:()=>ti,PacketType:()=>Zr,protocol:()=>Qr});const{toString:s}=Object.prototype,{getPrototypeOf:o}=Object,a=(t=>e=>{const n=s.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),c=t=>(t=t.toLowerCase(),e=>a(e)===t),u=t=>e=>typeof e===t,{isArray:h}=Array,l=u("undefined"),f=c("ArrayBuffer"),d=u("string"),p=u("function"),g=u("number"),y=t=>null!==t&&"object"==typeof t,b=t=>{if("object"!==a(t))return!1;const e=o(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Symbol.toStringTag in t||Symbol.iterator in t)},m=c("Date"),v=c("File"),w=c("Blob"),S=c("FileList"),_=c("URLSearchParams");function E(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),h(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(r=0;r<s;r++)o=i[r],e.call(null,t[o],o,t)}}function O(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=t=>!l(t)&&t!==k,T=(x="undefined"!=typeof Uint8Array&&o(Uint8Array),t=>x&&t instanceof x);var x;const j=c("HTMLFormElement"),C=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),R=c("RegExp"),L=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};E(n,((n,i)=>{let s;!1!==(s=e(n,i,t))&&(r[i]=s||n)})),Object.defineProperties(t,r)},D="abcdefghijklmnopqrstuvwxyz",B="0123456789",F={DIGIT:B,ALPHA:D,ALPHA_DIGIT:D+D.toUpperCase()+B},N=c("AsyncFunction"),P={isArray:h,isArrayBuffer:f,isBuffer:function(t){return null!==t&&!l(t)&&null!==t.constructor&&!l(t.constructor)&&p(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||p(t.append)&&("formdata"===(e=a(t))||"object"===e&&p(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&f(t.buffer),e},isString:d,isNumber:g,isBoolean:t=>!0===t||!1===t,isObject:y,isPlainObject:b,isUndefined:l,isDate:m,isFile:v,isBlob:w,isRegExp:R,isFunction:p,isStream:t=>y(t)&&p(t.pipe),isURLSearchParams:_,isTypedArray:T,isFileList:S,forEach:E,merge:function t(){const{caseless:e}=A(this)&&this||{},n={},r=(r,i)=>{const s=e&&O(n,i)||i;b(n[s])&&b(r)?n[s]=t(n[s],r):b(r)?n[s]=t({},r):h(r)?n[s]=r.slice():n[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&E(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(E(e,((e,r)=>{n&&p(e)?t[r]=i(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,s,a;const c={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)a=i[s],r&&!r(a,t,e)||c[a]||(e[a]=t[a],c[a]=!0);t=!1!==n&&o(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:a,kindOfTest:c,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(h(t))return t;let e=t.length;if(!g(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:L,freezeMethods:t=>{L(t,((e,n)=>{if(p(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];p(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return h(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:O,global:k,isContextDefined:A,ALPHABET:F,generateString:(t=16,e=F.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n},isSpecCompliantForm:function(t){return!!(t&&p(t.append)&&"FormData"===t[Symbol.toStringTag]&&t[Symbol.iterator])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(y(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const i=h(t)?[]:{};return E(t,((t,e)=>{const s=n(t,r+1);!l(s)&&(i[e]=s)})),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:N,isThenable:t=>t&&(y(t)||p(t))&&p(t.then)&&p(t.catch)};function z(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}P.inherits(z,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:P.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const I=z.prototype,U={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{U[t]={value:t}})),Object.defineProperties(z,U),Object.defineProperty(I,"isAxiosError",{value:!0}),z.from=(t,e,n,r,i,s)=>{const o=Object.create(I);return P.toFlatObject(t,o,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),z.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const M=z;function q(t){return P.isPlainObject(t)||P.isArray(t)}function V(t){return P.endsWith(t,"[]")?t.slice(0,-2):t}function W(t,e,n){return t?t.concat(e).map((function(t,e){return t=V(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}const H=P.toFlatObject(P,{},null,(function(t){return/^is[A-Z]/.test(t)})),$=function(t,e,n){if(!P.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=P.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!P.isUndefined(e[t])}))).metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&P.isSpecCompliantForm(e);if(!P.isFunction(i))throw new TypeError("visitor must be a function");function c(t){if(null===t)return"";if(P.isDate(t))return t.toISOString();if(!a&&P.isBlob(t))throw new M("Blob is not supported. Use a Buffer instead.");return P.isArrayBuffer(t)||P.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function u(t,n,i){let a=t;if(t&&!i&&"object"==typeof t)if(P.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(P.isArray(t)&&function(t){return P.isArray(t)&&!t.some(q)}(t)||(P.isFileList(t)||P.endsWith(n,"[]"))&&(a=P.toArray(t)))return n=V(n),a.forEach((function(t,r){!P.isUndefined(t)&&null!==t&&e.append(!0===o?W([n],r,s):null===o?n:n+"[]",c(t))})),!1;return!!q(t)||(e.append(W(i,n,s),c(t)),!1)}const h=[],l=Object.assign(H,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!P.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!P.isUndefined(n)){if(-1!==h.indexOf(n))throw Error("Circular reference detected in "+r.join("."));h.push(n),P.forEach(n,(function(n,s){!0===(!(P.isUndefined(n)||null===n)&&i.call(e,n,P.isString(s)?s.trim():s,r,l))&&t(n,r?r.concat(s):[s])})),h.pop()}}(t),e};function G(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function J(t,e){this._pairs=[],t&&$(t,this,e)}const K=J.prototype;K.append=function(t,e){this._pairs.push([t,e])},K.toString=function(t){const e=t?function(e){return t.call(this,e,G)}:G;return this._pairs.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Y=J;function X(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(t,e,n){if(!e)return t;const r=n&&n.encode||X,i=n&&n.serialize;let s;if(s=i?i(e,n):P.isURLSearchParams(e)?e.toString():new Y(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}const Z=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){P.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},et={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Y,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},nt="undefined"!=typeof window&&"undefined"!=typeof document,rt=(it="undefined"!=typeof navigator&&navigator.product,nt&&["ReactNative","NativeScript","NS"].indexOf(it)<0);var it;const st="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ot={...t,...et},at=function(t){function e(t,n,r,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;return s=!s&&P.isArray(r)?r.length:s,a?(P.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o):(r[s]&&P.isObject(r[s])||(r[s]=[]),e(t,n,r[s],i)&&P.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}(r[s])),!o)}if(P.isFormData(t)&&P.isFunction(t.entries)){const n={};return P.forEachEntry(t,((t,r)=>{e(function(t){return P.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null},ct={transitional:tt,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=P.isObject(t);if(i&&P.isHTMLForm(t)&&(t=new FormData(t)),P.isFormData(t))return r?JSON.stringify(at(t)):t;if(P.isArrayBuffer(t)||P.isBuffer(t)||P.isStream(t)||P.isFile(t)||P.isBlob(t))return t;if(P.isArrayBufferView(t))return t.buffer;if(P.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return $(t,new ot.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return ot.isNode&&P.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=P.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return $(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(P.isString(t))try{return(0,JSON.parse)(t),P.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||ct.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(t&&P.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw M.from(t,M.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ot.classes.FormData,Blob:ot.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};P.forEach(["delete","get","head","post","put","patch"],(t=>{ct.headers[t]={}}));const ut=ct,ht=P.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),lt=Symbol("internals");function ft(t){return t&&String(t).trim().toLowerCase()}function dt(t){return!1===t||null==t?t:P.isArray(t)?t.map(dt):String(t)}function pt(t,e,n,r,i){return P.isFunction(r)?r.call(this,e,n):(i&&(e=n),P.isString(e)?P.isString(r)?-1!==e.indexOf(r):P.isRegExp(r)?r.test(e):void 0:void 0)}class gt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=ft(e);if(!i)throw new Error("header name must be a non-empty string");const s=P.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=dt(t))}const s=(t,e)=>P.forEach(t,((t,n)=>i(t,n,e)));return P.isPlainObject(t)||t instanceof this.constructor?s(t,e):P.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())?s((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach((function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&ht[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e):null!=t&&i(e,t,n),this}get(t,e){if(t=ft(t)){const n=P.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(P.isFunction(e))return e.call(this,t,n);if(P.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ft(t)){const n=P.findKey(this,t);return!(!n||void 0===this[n]||e&&!pt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=ft(t)){const i=P.findKey(n,t);!i||e&&!pt(0,n[i],i,e)||(delete n[i],r=!0)}}return P.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!pt(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return P.forEach(this,((r,i)=>{const s=P.findKey(n,i);if(s)return e[s]=dt(r),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete e[i],e[o]=dt(r),n[o]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return P.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&P.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[lt]=this[lt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=ft(t);e[r]||(function(t,e){const n=P.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})}))}(n,t),e[r]=!0)}return P.isArray(t)?t.forEach(r):r(t),this}}gt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),P.reduceDescriptors(gt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),P.freezeMethods(gt);const yt=gt;function bt(t,e){const n=this||ut,r=e||n,i=yt.from(r.headers);let s=r.data;return P.forEach(t,(function(t){s=t.call(n,s,i.normalize(),e?e.status:void 0)})),i.normalize(),s}function mt(t){return!(!t||!t.__CANCEL__)}function vt(t,e,n){M.call(this,null==t?"canceled":t,M.ERR_CANCELED,e,n),this.name="CanceledError"}P.inherits(vt,M,{__CANCEL__:!0});const wt=vt,St=ot.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];P.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),P.isString(r)&&o.push("path="+r),P.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function _t(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const Et=ot.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function r(n){let r=n;return t&&(e.setAttribute("href",r),r=e.href),e.setAttribute("href",r),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname}}return n=r(window.location.href),function(t){const e=P.isString(t)?r(t):t;return e.protocol===n.protocol&&e.host===n.host}}():function(){return!0};function Ot(t,e){let n=0;const r=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const c=Date.now(),u=r[o];i||(i=c),n[s]=a,r[s]=c;let h=o,l=0;for(;h!==s;)l+=n[h++],h%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),c-i<e)return;const f=u&&c-u;return f?Math.round(1e3*l/f):void 0}}(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:c||void 0,estimated:c&&o&&s<=o?(o-s)/c:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const kt="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){let r=t.data;const i=yt.from(t.headers).normalize();let s,o,{responseType:a,withXSRFToken:c}=t;function u(){t.cancelToken&&t.cancelToken.unsubscribe(s),t.signal&&t.signal.removeEventListener("abort",s)}if(P.isFormData(r))if(ot.hasStandardBrowserEnv||ot.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if(!1!==(o=i.getContentType())){const[t,...e]=o?o.split(";").map((t=>t.trim())).filter(Boolean):[];i.setContentType([t||"multipart/form-data",...e].join("; "))}let h=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"",n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(e+":"+n))}const l=_t(t.baseURL,t.url);function f(){if(!h)return;const r=yt.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());!function(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}((function(t){e(t),u()}),(function(t){n(t),u()}),{data:a&&"text"!==a&&"json"!==a?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:r,config:t,request:h}),h=null}if(h.open(t.method.toUpperCase(),Q(l,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,"onloadend"in h?h.onloadend=f:h.onreadystatechange=function(){h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))&&setTimeout(f)},h.onabort=function(){h&&(n(new M("Request aborted",M.ECONNABORTED,t,h)),h=null)},h.onerror=function(){n(new M("Network Error",M.ERR_NETWORK,t,h)),h=null},h.ontimeout=function(){let e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const r=t.transitional||tt;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),n(new M(e,r.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,h)),h=null},ot.hasStandardBrowserEnv&&(c&&P.isFunction(c)&&(c=c(t)),c||!1!==c&&Et(l))){const e=t.xsrfHeaderName&&t.xsrfCookieName&&St.read(t.xsrfCookieName);e&&i.set(t.xsrfHeaderName,e)}void 0===r&&i.setContentType(null),"setRequestHeader"in h&&P.forEach(i.toJSON(),(function(t,e){h.setRequestHeader(e,t)})),P.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),a&&"json"!==a&&(h.responseType=t.responseType),"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",Ot(t.onDownloadProgress,!0)),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",Ot(t.onUploadProgress)),(t.cancelToken||t.signal)&&(s=e=>{h&&(n(!e||e.type?new wt(null,t,h):e),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(s),t.signal&&(t.signal.aborted?s():t.signal.addEventListener("abort",s)));const d=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(l);d&&-1===ot.protocols.indexOf(d)?n(new M("Unsupported protocol "+d+":",M.ERR_BAD_REQUEST,t)):h.send(r||null)}))},At={http:null,xhr:kt};P.forEach(At,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Tt=t=>`- ${t}`,xt=t=>P.isFunction(t)||null===t||!1===t,jt=t=>{t=P.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){let e;if(n=t[s],r=n,!xt(n)&&(r=At[(e=String(n)).toLowerCase()],void 0===r))throw new M(`Unknown adapter '${e}'`);if(r)break;i[e||"#"+s]=r}if(!r){const t=Object.entries(i).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(Tt).join("\n"):" "+Tt(t[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function Ct(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new wt(null,t)}function Rt(t){return Ct(t),t.headers=yt.from(t.headers),t.data=bt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jt(t.adapter||ut.adapter)(t).then((function(e){return Ct(t),e.data=bt.call(t,t.transformResponse,e),e.headers=yt.from(e.headers),e}),(function(e){return mt(e)||(Ct(t),e&&e.response&&(e.response.data=bt.call(t,t.transformResponse,e.response),e.response.headers=yt.from(e.response.headers))),Promise.reject(e)}))}const Lt=t=>t instanceof yt?{...t}:t;function Dt(t,e){e=e||{};const n={};function r(t,e,n){return P.isPlainObject(t)&&P.isPlainObject(e)?P.merge.call({caseless:n},t,e):P.isPlainObject(e)?P.merge({},e):P.isArray(e)?e.slice():e}function i(t,e,n){return P.isUndefined(e)?P.isUndefined(t)?void 0:r(void 0,t,n):r(t,e,n)}function s(t,e){if(!P.isUndefined(e))return r(void 0,e)}function o(t,e){return P.isUndefined(e)?P.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,i,s){return s in e?r(n,i):s in t?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e)=>i(Lt(t),Lt(e),!0)};return P.forEach(Object.keys(Object.assign({},t,e)),(function(r){const s=c[r]||i,o=s(t[r],e[r],r);P.isUndefined(o)&&s!==a||(n[r]=o)})),n}const Bt={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Bt[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));const Ft={};Bt.transitional=function(t,e,n){function r(t,e){return"[Axios v1.6.8] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,s)=>{if(!1===t)throw new M(r(i," has been removed"+(e?" in "+e:"")),M.ERR_DEPRECATED);return e&&!Ft[i]&&(Ft[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,s)}};const Nt={assertOptions:function(t,e,n){if("object"!=typeof t)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const e=t[s],n=void 0===e||o(e,s,t);if(!0!==n)throw new M("option "+s+" must be "+n,M.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new M("Unknown option "+s,M.ERR_BAD_OPTION)}},validators:Bt},Pt=Nt.validators;class zt{constructor(t){this.defaults=t,this.interceptors={request:new Z,response:new Z}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=Dt(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;void 0!==n&&Nt.assertOptions(n,{silentJSONParsing:Pt.transitional(Pt.boolean),forcedJSONParsing:Pt.transitional(Pt.boolean),clarifyTimeoutError:Pt.transitional(Pt.boolean)},!1),null!=r&&(P.isFunction(r)?e.paramsSerializer={serialize:r}:Nt.assertOptions(r,{encode:Pt.function,serialize:Pt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&P.merge(i.common,i[e.method]);i&&P.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]})),e.headers=yt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(t){c.push(t.fulfilled,t.rejected)}));let h,l=0;if(!a){const t=[Rt.bind(this),void 0];for(t.unshift.apply(t,o),t.push.apply(t,c),h=t.length,u=Promise.resolve(e);l<h;)u=u.then(t[l++],t[l++]);return u}h=o.length;let f=e;for(l=0;l<h;){const t=o[l++],e=o[l++];try{f=t(f)}catch(t){e.call(this,t);break}}try{u=Rt.call(this,f)}catch(t){return Promise.reject(t)}for(l=0,h=c.length;l<h;)u=u.then(c[l++],c[l++]);return u}getUri(t){return Q(_t((t=Dt(this.defaults,t)).baseURL,t.url),t.params,t.paramsSerializer)}}P.forEach(["delete","get","head","options"],(function(t){zt.prototype[t]=function(e,n){return this.request(Dt(n||{},{method:t,url:e,data:(n||{}).data}))}})),P.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,i){return this.request(Dt(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}zt.prototype[t]=e(),zt.prototype[t+"Form"]=e(!0)}));const It=zt;class Ut{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,i){n.reason||(n.reason=new wt(t,r,i),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}static source(){let t;return{token:new Ut((function(e){t=e})),cancel:t}}}const Mt=Ut,qt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qt).forEach((([t,e])=>{qt[e]=t}));const Vt=qt,Wt=function t(e){const n=new It(e),r=i(It.prototype.request,n);return P.extend(r,It.prototype,n,{allOwnKeys:!0}),P.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(Dt(e,n))},r}(ut);Wt.Axios=It,Wt.CanceledError=wt,Wt.CancelToken=Mt,Wt.isCancel=mt,Wt.VERSION="1.6.8",Wt.toFormData=$,Wt.AxiosError=M,Wt.Cancel=Wt.CanceledError,Wt.all=function(t){return Promise.all(t)},Wt.spread=function(t){return function(e){return t.apply(null,e)}},Wt.isAxiosError=function(t){return P.isObject(t)&&!0===t.isAxiosError},Wt.mergeConfig=Dt,Wt.AxiosHeaders=yt,Wt.formToJSON=t=>at(P.isHTMLForm(t)?new FormData(t):t),Wt.getAdapter=jt,Wt.HttpStatusCode=Vt,Wt.default=Wt;const Ht=Wt;class $t{interceptor;constructor(t){this.interceptor=Ht.create({baseURL:`${t}/api`}),this.interceptor.interceptors.request.use((t=>{const e=Ht.CancelToken.source();return t.cancelToken=e.token,setTimeout((()=>{e.cancel("Timeout: request took more than 15 seconds")}),15e3),t}),(t=>Promise.reject(t)))}}var Gt=function(t,e){return Gt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},Gt(t,e)};function Jt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Gt(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Kt(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function Yt(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function Qt(t,e,n){if(n||2===arguments.length)for(var r,i=0,s=e.length;i<s;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function Zt(t){return this instanceof Zt?(this.v=t,this):new Zt(t)}function te(t){return"function"==typeof t}function ee(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var ne=ee((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function re(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var ie=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var o=Yt(s),a=o.next();!a.done;a=o.next())a.value.remove(this)}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}else s.remove(this);var c=this.initialTeardown;if(te(c))try{c()}catch(t){i=t instanceof ne?t.errors:[t]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var h=Yt(u),l=h.next();!l.done;l=h.next()){var f=l.value;try{ae(f)}catch(t){i=null!=i?i:[],t instanceof ne?i=Qt(Qt([],Xt(i)),Xt(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}if(i)throw new ne(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ae(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&re(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&re(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),se=ie.EMPTY;function oe(t){return t instanceof ie||t&&"closed"in t&&te(t.remove)&&te(t.add)&&te(t.unsubscribe)}function ae(t){te(t)?t():t.unsubscribe()}var ce={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ue={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=ue.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,Qt([t,e],Xt(n))):setTimeout.apply(void 0,Qt([t,e],Xt(n)))},clearTimeout:function(t){var e=ue.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function he(t){ue.setTimeout((function(){var e=ce.onUnhandledError;if(!e)throw t;e(t)}))}function le(){}var fe=de("C",void 0,void 0);function de(t,e,n){return{kind:t,value:e,error:n}}var pe=null;function ge(t){if(ce.useDeprecatedSynchronousErrorHandling){var e=!pe;if(e&&(pe={errorThrown:!1,error:null}),t(),e){var n=pe,r=n.errorThrown,i=n.error;if(pe=null,r)throw i}}else t()}var ye=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,oe(e)&&e.add(n)):n.destination=Ee,n}return Jt(e,t),e.create=function(t,e,n){return new we(t,e,n)},e.prototype.next=function(t){this.isStopped?_e(function(t){return de("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?_e(de("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?_e(fe,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ie),be=Function.prototype.bind;function me(t,e){return be.call(t,e)}var ve=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Se(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Se(t)}else Se(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Se(t)}},t}(),we=function(t){function e(e,n,r){var i,s,o=t.call(this)||this;return te(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:o&&ce.useDeprecatedNextContext?((s=Object.create(e)).unsubscribe=function(){return o.unsubscribe()},i={next:e.next&&me(e.next,s),error:e.error&&me(e.error,s),complete:e.complete&&me(e.complete,s)}):i=e,o.destination=new ve(i),o}return Jt(e,t),e}(ye);function Se(t){var e;ce.useDeprecatedSynchronousErrorHandling?(e=t,ce.useDeprecatedSynchronousErrorHandling&&pe&&(pe.errorThrown=!0,pe.error=e)):he(t)}function _e(t,e){var n=ce.onStoppedNotification;n&&ue.setTimeout((function(){return n(t,e)}))}var Ee={closed:!0,next:le,error:function(t){throw t},complete:le},Oe="function"==typeof Symbol&&Symbol.observable||"@@observable";function ke(t){return t}var Ae=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this,i=function(t){return t&&t instanceof ye||function(t){return t&&te(t.next)&&te(t.error)&&te(t.complete)}(t)&&oe(t)}(t)?t:new we(t,e,n);return ge((function(){var t=r,e=t.operator,n=t.source;i.add(e?e.call(i,n):n?r._subscribe(i):r._trySubscribe(i))})),i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=Te(e))((function(e,r){var i=new we({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Oe]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(0===(n=t).length?ke:1===n.length?n[0]:function(t){return n.reduce((function(t,e){return e(t)}),t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=Te(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function Te(t){var e;return null!==(e=null!=t?t:ce.Promise)&&void 0!==e?e:Promise}var xe=ee((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),je=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Jt(e,t),e.prototype.lift=function(t){var e=new Ce(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new xe},e.prototype.next=function(t){var e=this;ge((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Yt(e.currentObservers),s=i.next();!s.done;s=i.next())s.value.next(t)}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;ge((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;ge((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,s=n.observers;return r||i?se:(this.currentObservers=null,s.push(t),new ie((function(){e.currentObservers=null,re(s,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ae;return t.source=this,t},e.create=function(t,e){return new Ce(t,e)},e}(Ae),Ce=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Jt(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:se},e}(je),Re={now:function(){return(Re.delegate||Date).now()},delegate:void 0},Le=function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=Re);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}return Jt(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,o=n._timestampProvider,a=n._windowTime;r||(i.push(e),!s&&i.push(o.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,s=(i?1:2)*e;if(e<1/0&&s<r.length&&r.splice(0,r.length-s),!i){for(var o=n.now(),a=0,c=1;c<r.length&&r[c]<=o;c+=2)a=c;a&&r.splice(0,a+1)}},e}(je),De=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return Jt(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(je),Be=ee((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}}));function Fe(t){return function(e){if(function(t){return te(null==t?void 0:t.lift)}(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}var Ne=Array.isArray;function Pe(t,e,n,r,i){return new ze(t,e,n,r,i)}var ze=function(t){function e(e,n,r,i,s,o){var a=t.call(this,e)||this;return a.onFinalize=s,a.shouldUnsubscribe=o,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Jt(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(ye);function Ie(t,e){return Fe((function(n,r){var i=0;n.subscribe(Pe(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Ue=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function Me(t){return te(null==t?void 0:t.then)}function qe(t){return te(t[Oe])}function Ve(t){return Symbol.asyncIterator&&te(null==t?void 0:t[Symbol.asyncIterator])}function We(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var He="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function $e(t){return te(null==t?void 0:t[He])}function Ge(t){return function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){s.push([t,e,n,r])>1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof Zt?Promise.resolve(n.value.v).then(c,u):h(s[0][2],n)}catch(t){h(s[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function h(t,e){t(e),s.shift(),s.length&&a(s[0][0],s[0][1])}}(this,arguments,(function(){var e,n,r;return Kt(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,Zt(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,Zt(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,Zt(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Je(t){return te(null==t?void 0:t.getReader)}function Ke(t){if(t instanceof Ae)return t;if(null!=t){if(qe(t))return i=t,new Ae((function(t){var e=i[Oe]();if(te(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Ue(t))return r=t,new Ae((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(Me(t))return n=t,new Ae((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,he)}));if(Ve(t))return Ye(t);if($e(t))return e=t,new Ae((function(t){var n,r;try{for(var i=Yt(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(t.next(o),t.closed)return}}catch(t){n={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(Je(t))return Ye(Ge(t))}var e,n,r,i;throw We(t)}function Ye(t){return new Ae((function(e){(function(t,e){var n,r,i,s,o,a,c,u;return o=this,a=void 0,u=function(){var o,a;return Kt(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=Yt(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){!function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)}(r,i,(e=t[n](e)).done,e.value)}))}}}(t),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))},new((c=void 0)||(c=Promise))((function(t,e){function n(t){try{i(u.next(t))}catch(t){e(t)}}function r(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):function(t){return t instanceof c?t:new c((function(e){e(t)}))}(e.value).then(n,r)}i((u=u.apply(o,a||[])).next())}))})(t,e).catch((function(t){return e.error(t)}))}))}function Xe(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var s=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(s),!i)return s}function Qe(t,e,n){return void 0===n&&(n=1/0),te(e)?Qe((function(n,r){return Ie((function(t,i){return e(n,t,r,i)}))(Ke(t(n,r)))}),n):("number"==typeof e&&(n=e),Fe((function(e,r){return function(t,e,n,r,i,s,o,a){var c=[],u=0,h=0,l=!1,f=function(){!l||c.length||u||e.complete()},d=function(t){return u<r?p(t):c.push(t)},p=function(t){u++;var i=!1;Ke(n(t,h++)).subscribe(Pe(e,(function(t){e.next(t)}),(function(){i=!0}),void 0,(function(){if(i)try{u--;for(;c.length&&u<r;)t=void 0,t=c.shift(),p(t);f()}catch(t){e.error(t)}var t})))};return t.subscribe(Pe(e,d,(function(){l=!0,f()}))),function(){}}(e,r,t,n)})))}function Ze(t){return t[t.length-1]}function tn(t,e){return void 0===e&&(e=0),Fe((function(n,r){n.subscribe(Pe(r,(function(n){return Xe(r,t,(function(){return r.next(n)}),e)}),(function(){return Xe(r,t,(function(){return r.complete()}),e)}),(function(n){return Xe(r,t,(function(){return r.error(n)}),e)})))}))}function en(t,e){return void 0===e&&(e=0),Fe((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function nn(t,e){if(!t)throw new Error("Iterable cannot be null");return new Ae((function(n){Xe(n,e,(function(){var r=t[Symbol.asyncIterator]();Xe(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function rn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=function(t){return function(t){return t&&te(t.schedule)}(Ze(t))?t.pop():void 0}(t),r=function(t,e){return"number"==typeof Ze(t)?t.pop():1/0}(t);return t=function(t){return 1===t.length&&Ne(t[0])?t[0]:t}(t),Fe((function(e,i){(function(t){return void 0===t&&(t=1/0),Qe(ke,t)})(r)(function(t,e){return e?function(t,e){if(null!=t){if(qe(t))return function(t,e){return Ke(t).pipe(en(e),tn(e))}(t,e);if(Ue(t))return function(t,e){return new Ae((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(Me(t))return function(t,e){return Ke(t).pipe(en(e),tn(e))}(t,e);if(Ve(t))return nn(t,e);if($e(t))return function(t,e){return new Ae((function(n){var r;return Xe(n,e,(function(){r=t[He](),Xe(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return te(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(Je(t))return function(t,e){return nn(Ge(t),e)}(t,e)}throw We(t)}(t,e):Ke(t)}(Qt([e],Xt(t)),n)).subscribe(i)}))}function sn(t,e){return void 0===e&&(e=ke),t=null!=t?t:on,Fe((function(n,r){var i,s=!0;n.subscribe(Pe(r,(function(n){var o=e(n);!s&&t(i,o)||(s=!1,i=o,r.next(n))})))}))}function on(t,e){return t===e}function an(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new je}:e,r=t.resetOnError,i=void 0===r||r,s=t.resetOnComplete,o=void 0===s||s,a=t.resetOnRefCountZero,c=void 0===a||a;return function(t){var e,r,s,a=0,u=!1,h=!1,l=function(){null==r||r.unsubscribe(),r=void 0},f=function(){l(),e=s=void 0,u=h=!1},d=function(){var t=e;f(),null==t||t.unsubscribe()};return Fe((function(t,p){a++,h||u||l();var g=s=null!=s?s:n();p.add((function(){0!=--a||h||u||(r=cn(d,c))})),g.subscribe(p),!e&&a>0&&(e=new we({next:function(t){return g.next(t)},error:function(t){h=!0,l(),r=cn(f,i,t),g.error(t)},complete:function(){u=!0,l(),r=cn(f,o),g.complete()}}),Ke(t).subscribe(e))}))(t)}}function cn(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new we({next:function(){i.unsubscribe(),t()}});return Ke(e.apply(void 0,Qt([],Xt(n)))).subscribe(i)}}else t()}class un{subscriptions=[];additionalSubscriptions=[];addSubscriptions(...t){this.subscriptions.push(...t)}addAdditionalSubscriptions(...t){this.additionalSubscriptions.push(...t)}unsubscribe(){this.subscriptions.forEach((t=>t.unsubscribe()))}unsubscribeAdditional(){this.additionalSubscriptions.forEach((t=>t.unsubscribe()))}}class hn extends un{onCallAnswered=new Le(1);onCallEnded=new Le(1);onUsingOpus=new Le(1);micState=new De(!1);hasEnded=!1;cameraDevice;connection;logger;onMicrophoneEnabled=this.createStateObservable(this.micState);get isUsingOpus(){return t=this.onUsingOpus.pipe(function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return rn.apply(void 0,Qt([],Xt(t)))}(this.connection.onError.pipe(Ie((t=>{throw t}))))),new Promise((function(e,n){var r=new we({next:function(t){e(t),r.unsubscribe()},error:n,complete:function(){n(new Be)}});t.subscribe(r)}));var t}constructor(t,e,n){super(),this.cameraDevice=t,this.logger=e,this.connection=n,this.bindToConnection(n)}enableMicrophone(t){this.hasEnded||(this.connection.pc.enableMicrophone(t),this.micState.next(!0))}disableMicrophone(){this.hasEnded||(this.connection.pc.disableMicrophone(),this.micState.next(!1))}stop(){this.callEnded()}createStateObservable(t){return t.pipe(sn(((t,e)=>t===e)),an({connector:()=>new Le(1)}))}bindToConnection(t){this.addSubscriptions(t.onCallAnswered.subscribe((t=>{this.onUsingOpus.next(t.toLocaleLowerCase().includes(" opus/"))})),t.onCallEnded.subscribe((()=>this.callEnded())))}callEnded(){this.hasEnded||(this.hasEnded=!0,this.unsubscribe(),this.onCallEnded.next(),this.connection.stop())}}var ln=Array.isArray;var fn=["addListener","removeListener"],dn=["addEventListener","removeEventListener"],pn=["on","off"];function gn(t,e,n,r){if(te(n)&&(r=n,n=void 0),r)return gn(t,e,n).pipe((i=r,Ie((function(t){return function(t,e){return ln(e)?t.apply(void 0,Qt([],Xt(e))):t(e)}(i,t)}))));var i,s=Xt(function(t){return te(t.addEventListener)&&te(t.removeEventListener)}(t)?dn.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return te(t.addListener)&&te(t.removeListener)}(t)?fn.map(yn(t,e)):function(t){return te(t.on)&&te(t.off)}(t)?pn.map(yn(t,e)):[],2),o=s[0],a=s[1];if(!o&&Ue(t))return Qe((function(t){return gn(t,e,n)}))(Ke(t));if(!o)throw new TypeError("Invalid event target");return new Ae((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return a(e)}}))}function yn(t,e){return function(n){return function(r){return t[n](e,r)}}}function bn(t){const e=[];return t.forEach((t=>{t.urls.forEach((n=>{e.push({urls:n,username:t.username,credential:t.credential})}))})),e}class mn extends un{onIceCandidate=new je;onConnectionState=new Le(1);videoTransceiver;audioTransceiver;cameraDevice;logger;pc;videoElement;constructor(t,e,n,r){super(),this.cameraDevice=t,this.logger=r,this.videoElement=e,this.pc=new RTCPeerConnection({iceServers:bn(n)}),this.audioTransceiver=this.pc.addTransceiver("audio",{direction:"sendrecv"}),this.videoTransceiver=this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.onconnectionstatechange=()=>{this.logger.debug(this.cameraDevice.name,"connectionStateChange:",this.pc.connectionState),this.onConnectionState.next(this.pc.connectionState)},this.pc.oniceconnectionstatechange=()=>{this.logger.debug(this.cameraDevice.name,"iceconnectionstatechange:",this.pc.iceConnectionState)},this.pc.onicegatheringstatechange=()=>{this.logger.debug(this.cameraDevice.name,"icegatheringstatechange:",this.pc.iceGatheringState)},this.pc.onicecandidate=t=>{t.candidate&&this.onIceCandidate.next(t.candidate)},this.pc.ontrack=t=>{this.logger.debug(this.cameraDevice.name,"ontrack:",t.track),e.srcObject?e.srcObject.addTrack(t.track):e.srcObject=new MediaStream([t.track])}}enableMicrophone(t){this.audioTransceiver.sender.replaceTrack(t)}disableMicrophone(){this.audioTransceiver.sender.replaceTrack(null)}async createOffer(){const t=await this.pc.createOffer();return await this.pc.setLocalDescription(t),t}async acceptAnswer(t){await this.pc.setRemoteDescription(t)}addIceCandidate(t){return this.pc.addIceCandidate(t)}close(){this.videoElement.srcObject=null,this.pc.close(),this.unsubscribe()}}class vn extends un{onCallAnswered=new Le(1);onCallEnded=new Le(1);onError=new Le(1);onMessage=new Le;onWsOpen;pc;ws;onOfferSent=new Le(1);hasEnded=!1;cameraDevice;logger;constructor(t,e,n,r,i){super(),this.cameraDevice=t,this.logger=i;const s=t.sources.find((t=>t.name===e));if(!s)throw new Error(`Invalid source name ${e}`);this.ws=new WebSocket(s.urls.ws.webrtc),this.pc=new mn(t,n,r,i),this.onWsOpen=gn(this.ws,"open");const o=gn(this.ws,"message"),a=gn(this.ws,"error"),c=gn(this.ws,"close");var u,h;this.addSubscriptions(o.pipe((u=t=>{const e=JSON.parse(t.data);return this.onMessage.next(e),this.handleMessage(e).catch((t=>{throw this.onError.next(t),t}))},te(h)?Qe(u,h,1):Qe(u,1))).subscribe(),a.subscribe((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()})),c.subscribe((()=>{this.callEnded()})),this.cameraDevice.onConnected.subscribe((t=>{t||this.callEnded()})),this.onError.subscribe((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()})),this.onWsOpen.subscribe((()=>{this.initiateCall().catch((t=>{this.logger.error(this.cameraDevice.name,t),this.callEnded()}))})),this.pc.onConnectionState.subscribe((t=>{"failed"===t&&(this.logger.error(this.cameraDevice.name,"Stream connection failed"),this.callEnded()),"closed"===t&&(this.logger.debug(this.cameraDevice.name,"Stream connection closed"),this.callEnded())})),this.pc.onIceCandidate.subscribe((async t=>{this.sendMessage({type:"webrtc/candidate",value:t.toJSON().candidate||""})})))}stop(){this.callEnded()}async initiateCall(){const{sdp:t}=await this.pc.createOffer();this.sendMessage({type:"webrtc/offer",value:t||""}),this.onOfferSent.next()}async handleMessage(t){switch(t.type){case"webrtc/answer":const e=t.value;return await this.pc.acceptAnswer({type:"answer",sdp:e}),void this.onCallAnswered.next(e);case"webrtc/candidate":return void await this.pc.addIceCandidate({candidate:t.value,sdpMid:"0"});case"error":throw new Error(t.value);default:throw new Error(t)}}sendMessage(t){this.hasEnded||this.ws.send(JSON.stringify(t))}callEnded(){this.hasEnded||(this.hasEnded=!0,this.unsubscribe(),this.onCallEnded.next(),this.pc.close(),this.ws.close())}}var wn=n(275),Sn=n.n(wn),_n=n(512),En=n.n(_n);const On="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,kn=new Set,An="object"==typeof process&&process?process:{},Tn=(t,e,n,r)=>{"function"==typeof An.emitWarning?An.emitWarning(t,e,n,r):console.error(`[${n}] ${e}: ${t}`)};let xn=globalThis.AbortController,jn=globalThis.AbortSignal;if(void 0===xn){jn=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},xn=class{constructor(){e()}signal=new jn;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==An.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,Tn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const Cn=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),Rn=t=>Cn(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ln:null:null;class Ln extends Array{constructor(t){super(t),this.fill(0)}}class Dn{heap;length;static#t=!1;static create(t){const e=Rn(t);if(!e)return[];Dn.#t=!0;const n=new Dn(t,e);return Dn.#t=!1,n}constructor(t,e){if(!Dn.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class Bn{#e;#n;#r;#i;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#a;#c;#u;#h;#l;#f;#d;#p;#g;#y;#b;#m;#v;#w;#S;#_;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#v,sizes:t.#b,keyMap:t.#c,keyList:t.#u,valList:t.#h,next:t.#l,prev:t.#f,get head(){return t.#d},get tail(){return t.#p},free:t.#g,isBackgroundFetch:e=>t.#E(e),backgroundFetch:(e,n,r,i)=>t.#O(e,n,r,i),moveToTail:e=>t.#k(e),indexes:e=>t.#A(e),rindexes:e=>t.#T(e),isStale:e=>t.#x(e)}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#a}get size(){return this.#o}get fetchMethod(){return this.#s}get dispose(){return this.#r}get disposeAfter(){return this.#i}constructor(t){const{max:e=0,ttl:n,ttlResolution:r=1,ttlAutopurge:i,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:h,noUpdateTTL:l,maxSize:f=0,maxEntrySize:d=0,sizeCalculation:p,fetchMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:v,ignoreFetchAbort:w}=t;if(0!==e&&!Cn(e))throw new TypeError("max option must be a nonnegative integer");const S=e?Rn(e):Array;if(!S)throw new Error("invalid max value: "+e);if(this.#e=e,this.#n=f,this.maxEntrySize=d||this.#n,this.sizeCalculation=p,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=g,this.#S=!!g,this.#c=new Map,this.#u=new Array(e).fill(void 0),this.#h=new Array(e).fill(void 0),this.#l=new S(e),this.#f=new S(e),this.#d=0,this.#p=0,this.#g=Dn.create(e),this.#o=0,this.#a=0,"function"==typeof c&&(this.#r=c),"function"==typeof u?(this.#i=u,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#r,this.#_=!!this.#i,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!l,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!m,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#n&&!Cn(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Cn(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#j()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=Cn(r)||0===r?r:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Cn(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(0===this.#e&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){const t="LRU_CACHE_UNBOUNDED";(t=>!kn.has(t))(t)&&(kn.add(t),Tn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,Bn))}}getRemainingTTL(t){return this.#c.has(t)?1/0:0}#C(){const t=new Ln(this.#e),e=new Ln(this.#e);this.#v=t,this.#m=e,this.#R=(n,r,i=On.now())=>{if(e[n]=0!==r?i:0,t[n]=r,0!==r&&this.ttlAutopurge){const t=setTimeout((()=>{this.#x(n)&&this.delete(this.#u[n])}),r+1);t.unref&&t.unref()}},this.#L=n=>{e[n]=0!==t[n]?On.now():0},this.#D=(i,s)=>{if(t[s]){const o=t[s],a=e[s];if(!o||!a)return;i.ttl=o,i.start=a,i.now=n||r();const c=i.now-a;i.remainingTTL=o-c}};let n=0;const r=()=>{const t=On.now();if(this.ttlResolution>0){n=t;const e=setTimeout((()=>n=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const s=this.#c.get(i);if(void 0===s)return 0;const o=t[s],a=e[s];return o&&a?o-((n||r())-a):1/0},this.#x=i=>{const s=e[i],o=t[i];return!!o&&!!s&&(n||r())-s>o}}#L=()=>{};#D=()=>{};#R=()=>{};#x=()=>!1;#j(){const t=new Ln(this.#e);this.#a=0,this.#b=t,this.#B=e=>{this.#a-=t[e],t[e]=0},this.#F=(t,e,n,r)=>{if(this.#E(e))return 0;if(!Cn(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(e,t),!Cn(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#N=(e,n,r)=>{if(t[e]=n,this.#n){const n=this.#n-t[e];for(;this.#a>n;)this.#P(!0)}this.#a+=t[e],r&&(r.entrySize=n,r.totalCalculatedSize=this.#a)}}#B=t=>{};#N=(t,e,n)=>{};#F=(t,e,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#p;this.#z(e)&&(!t&&this.#x(e)||(yield e),e!==this.#d);)e=this.#f[e]}*#T({allowStale:t=this.allowStale}={}){if(this.#o)for(let e=this.#d;this.#z(e)&&(!t&&this.#x(e)||(yield e),e!==this.#p);)e=this.#l[e]}#z(t){return void 0!==t&&this.#c.get(this.#u[t])===t}*entries(){for(const t of this.#A())void 0===this.#h[t]||void 0===this.#u[t]||this.#E(this.#h[t])||(yield[this.#u[t],this.#h[t]])}*rentries(){for(const t of this.#T())void 0===this.#h[t]||void 0===this.#u[t]||this.#E(this.#h[t])||(yield[this.#u[t],this.#h[t]])}*keys(){for(const t of this.#A()){const e=this.#u[t];void 0===e||this.#E(this.#h[t])||(yield e)}}*rkeys(){for(const t of this.#T()){const e=this.#u[t];void 0===e||this.#E(this.#h[t])||(yield e)}}*values(){for(const t of this.#A())void 0===this.#h[t]||this.#E(this.#h[t])||(yield this.#h[t])}*rvalues(){for(const t of this.#T())void 0===this.#h[t]||this.#E(this.#h[t])||(yield this.#h[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const n of this.#A()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;if(void 0!==i&&t(i,this.#u[n],this))return this.get(this.#u[n],e)}}forEach(t,e=this){for(const n of this.#A()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#u[n],this)}}rforEach(t,e=this){for(const n of this.#T()){const r=this.#h[n],i=this.#E(r)?r.__staleWhileFetching:r;void 0!==i&&t.call(e,i,this.#u[n],this)}}purgeStale(){let t=!1;for(const e of this.#T({allowStale:!0}))this.#x(e)&&(this.delete(this.#u[e]),t=!0);return t}info(t){const e=this.#c.get(t);if(void 0===e)return;const n=this.#h[e],r=this.#E(n)?n.__staleWhileFetching:n;if(void 0===r)return;const i={value:r};if(this.#v&&this.#m){const t=this.#v[e],n=this.#m[e];if(t&&n){const e=t-(On.now()-n);i.ttl=e,i.start=Date.now()}}return this.#b&&(i.size=this.#b[e]),i}dump(){const t=[];for(const e of this.#A({allowStale:!0})){const n=this.#u[e],r=this.#h[e],i=this.#E(r)?r.__staleWhileFetching:r;if(void 0===i||void 0===n)continue;const s={value:i};if(this.#v&&this.#m){s.ttl=this.#v[e];const t=On.now()-this.#m[e];s.start=Math.floor(Date.now()-t)}this.#b&&(s.size=this.#b[e]),t.unshift([n,s])}return t}load(t){this.clear();for(const[e,n]of t){if(n.start){const t=Date.now()-n.start;n.start=On.now()-t}this.set(e,n.value,n)}}set(t,e,n={}){if(void 0===e)return this.delete(t),this;const{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const u=this.#F(t,e,n.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let h=0===this.#o?void 0:this.#c.get(t);if(void 0===h)h=0===this.#o?this.#p:0!==this.#g.length?this.#g.pop():this.#o===this.#e?this.#P(!1):this.#o,this.#u[h]=t,this.#h[h]=e,this.#c.set(t,h),this.#l[this.#p]=h,this.#f[h]=this.#p,this.#p=h,this.#o++,this.#N(h,u,a),a&&(a.set="add"),c=!1;else{this.#k(h);const n=this.#h[h];if(e!==n){if(this.#S&&this.#E(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=n;void 0===e||s||(this.#w&&this.#r?.(e,t,"set"),this.#_&&this.#y?.push([e,t,"set"]))}else s||(this.#w&&this.#r?.(n,t,"set"),this.#_&&this.#y?.push([n,t,"set"]));if(this.#B(h),this.#N(h,u,a),this.#h[h]=e,a){a.set="replace";const t=n&&this.#E(n)?n.__staleWhileFetching:n;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===r||this.#v||this.#C(),this.#v&&(c||this.#R(h,r,i),a&&this.#D(a,h)),!s&&this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}return this}pop(){try{for(;this.#o;){const t=this.#h[this.#d];if(this.#P(!0),this.#E(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}}}#P(t){const e=this.#d,n=this.#u[e],r=this.#h[e];return this.#S&&this.#E(r)?r.__abortController.abort(new Error("evicted")):(this.#w||this.#_)&&(this.#w&&this.#r?.(r,n,"evict"),this.#_&&this.#y?.push([r,n,"evict"])),this.#B(e),t&&(this.#u[e]=void 0,this.#h[e]=void 0,this.#g.push(e)),1===this.#o?(this.#d=this.#p=0,this.#g.length=0):this.#d=this.#l[e],this.#c.delete(n),this.#o--,e}has(t,e={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=e,i=this.#c.get(t);if(void 0!==i){const t=this.#h[i];if(this.#E(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#x(i))return n&&this.#L(i),r&&(r.has="hit",this.#D(r,i)),!0;r&&(r.has="stale",this.#D(r,i))}else r&&(r.has="miss");return!1}peek(t,e={}){const{allowStale:n=this.allowStale}=e,r=this.#c.get(t);if(void 0===r||!n&&this.#x(r))return;const i=this.#h[r];return this.#E(i)?i.__staleWhileFetching:i}#O(t,e,n,r){const i=void 0===e?void 0:this.#h[e];if(this.#E(i))return i;const s=new xn,{signal:o}=n;o?.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:n,context:r},c=(r,i=!1)=>{const{aborted:o}=s.signal,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(s.signal.reason);const l=h;return this.#h[e]===h&&(void 0===r?l.__staleWhileFetching?this.#h[e]=l.__staleWhileFetching:this.delete(t):(n.status&&(n.status.fetchUpdated=!0),this.set(t,r,a.options))),r},u=r=>{const{aborted:i}=s.signal,o=i&&n.allowStaleOnFetchAbort,a=o||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,u=h;if(this.#h[e]===h&&(c&&void 0!==u.__staleWhileFetching?o||(this.#h[e]=u.__staleWhileFetching):this.delete(t)),a)return n.status&&void 0!==u.__staleWhileFetching&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r};n.status&&(n.status.fetchDispatched=!0);const h=new Promise(((e,r)=>{const o=this.#s?.(t,i,a);o&&o instanceof Promise&&o.then((t=>e(void 0===t?void 0:t)),r),s.signal.addEventListener("abort",(()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(e(void 0),n.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=t),u(t)))),l=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,l,{...a.options,status:void 0}),e=this.#c.get(t)):this.#h[e]=l,l}#E(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof xn}async fetch(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:l=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:y,signal:b}=e;if(!this.#S)return y&&(y.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:y});const m={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:l,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:y,signal:b};let v=this.#c.get(t);if(void 0===v){y&&(y.fetch="miss");const e=this.#O(t,v,m,p);return e.__returned=e}{const e=this.#h[v];if(this.#E(e)){const t=n&&void 0!==e.__staleWhileFetching;return y&&(y.fetch="inflight",t&&(y.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#x(v);if(!g&&!i)return y&&(y.fetch="hit"),this.#k(v),r&&this.#L(v),y&&this.#D(y,v),e;const s=this.#O(t,v,m,p),o=void 0!==s.__staleWhileFetching&&n;return y&&(y.fetch=i?"stale":"refresh",o&&i&&(y.returnedStale=!0)),o?s.__staleWhileFetching:s.__returned=s}}get(t,e={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:s}=e,o=this.#c.get(t);if(void 0!==o){const e=this.#h[o],a=this.#E(e);return s&&this.#D(s,o),this.#x(o)?(s&&(s.get="stale"),a?(s&&n&&void 0!==e.__staleWhileFetching&&(s.returnedStale=!0),n?e.__staleWhileFetching:void 0):(i||this.delete(t),s&&n&&(s.returnedStale=!0),n?e:void 0)):(s&&(s.get="hit"),a?e.__staleWhileFetching:(this.#k(o),r&&this.#L(o),e))}s&&(s.get="miss")}#I(t,e){this.#f[e]=t,this.#l[t]=e}#k(t){t!==this.#p&&(t===this.#d?this.#d=this.#l[t]:this.#I(this.#f[t],this.#l[t]),this.#I(this.#p,t),this.#p=t)}delete(t){let e=!1;if(0!==this.#o){const n=this.#c.get(t);if(void 0!==n)if(e=!0,1===this.#o)this.clear();else{this.#B(n);const e=this.#h[n];if(this.#E(e)?e.__abortController.abort(new Error("deleted")):(this.#w||this.#_)&&(this.#w&&this.#r?.(e,t,"delete"),this.#_&&this.#y?.push([e,t,"delete"])),this.#c.delete(t),this.#u[n]=void 0,this.#h[n]=void 0,n===this.#p)this.#p=this.#f[n];else if(n===this.#d)this.#d=this.#l[n];else{const t=this.#f[n];this.#l[t]=this.#l[n];const e=this.#l[n];this.#f[e]=this.#f[n]}this.#o--,this.#g.push(n)}}if(this.#_&&this.#y?.length){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}return e}clear(){for(const t of this.#T({allowStale:!0})){const e=this.#h[t];if(this.#E(e))e.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#w&&this.#r?.(e,n,"delete"),this.#_&&this.#y?.push([e,n,"delete"])}}if(this.#c.clear(),this.#h.fill(void 0),this.#u.fill(void 0),this.#v&&this.#m&&(this.#v.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#d=0,this.#p=0,this.#g.length=0,this.#a=0,this.#o=0,this.#_&&this.#y){const t=this.#y;let e;for(;e=t?.shift();)this.#i?.(...e)}}}function Fn(){return Fe((function(t,e){var n,r=!1;t.subscribe(Pe(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))}))}function Nn(t,e){return Fe((function(n,r){var i=0;n.subscribe(Pe(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}class Pn{subscriptions=[];additionalSubscriptions=[];addSubscriptions(...t){this.subscriptions.push(...t)}addAdditionalSubscriptions(...t){this.additionalSubscriptions.push(...t)}unsubscribe(){this.subscriptions.forEach((t=>t.unsubscribe()))}unsubscribeAdditional(){this.additionalSubscriptions.forEach((t=>t.unsubscribe()))}}class zn extends Pn{logger;snapshotCache=new Bn({max:100,ttl:3e5});cameraSubject;cameraState=new De(!1);lightState=new De({state:!1,timestamp:0});motionState=new De({state:!1,timestamp:0,detections:[]});audioState=new De({state:!1,timestamp:0});objectState=new De({timestamp:0,detections:[]});doorbellState=new De({state:!1,timestamp:0});sirenState=new De({state:!1,timestamp:0});batteryState=new De({level:100,timestamp:0});onConnected=this.createStateObservable(this.cameraState);onLightSwitched=this.createStateObservable(this.lightState);onMotionDetected=this.createStateObservable(this.motionState);onAudioDetected=this.createStateObservable(this.audioState);onObjectDetected=this.createStateObservable(this.objectState);onDoorbellPressed=this.createStateObservable(this.doorbellState);onSirenDetected=this.createStateObservable(this.sirenState);onBatteryChanged=this.createStateObservable(this.batteryState);get id(){return this.cameraSubject.getValue()._id}get nativeId(){return this.cameraSubject.getValue().nativeId}get pluginId(){return this.cameraSubject.getValue().pluginId}get state(){return this.cameraState.getValue()}get disabled(){return this.cameraSubject.getValue().disabled}get name(){return this.cameraSubject.getValue().name}get type(){return this.cameraSubject.getValue().type}get info(){return Sn()(this.cameraSubject.getValue().info)}get isCloud(){return this.cameraSubject.getValue().isCloud}get hasLight(){return this.cameraSubject.getValue().hasLight}get hasSiren(){return this.cameraSubject.getValue().hasSiren}get hasBinarySensor(){return this.cameraSubject.getValue().hasBinarySensor}get hasBattery(){return this.cameraSubject.getValue().hasBattery}get hasMotionDetector(){return this.cameraSubject.getValue().hasMotionDetector}get hasAudioDetector(){return this.cameraSubject.getValue().hasAudioDetector}get hasObjectDetector(){return this.cameraSubject.getValue().hasObjectDetector}get hasPtz(){return this.cameraSubject.getValue().hasPtz}get hasPrebuffer(){return this.cameraSubject.getValue().hasPrebuffer}get hasIntercom(){return this.cameraSubject.getValue().hasIntercom}get motionZones(){return Sn()(this.cameraSubject.getValue().motionZones)}get objectZones(){return Sn()(this.cameraSubject.getValue().objectZones)}get sources(){return Sn()(this.cameraSubject.getValue().sources).map((t=>({...t,isPrebuffering:async()=>!1,getPrebufferRawUrl:async()=>{},getStreamInfo:async()=>{}})))}get streamSource(){return this.sources.find((t=>t.roles.includes("stream")))||this.sources[0]}get snapshotSource(){return this.sources.find((t=>t.roles.includes("snapshot")))||this.streamSource}get recordingSource(){return this.sources.find((t=>t.roles.includes("record")))||this.streamSource}get detectionSource(){return this.sources.find((t=>t.roles.includes("detect")))||this.streamSource}constructor(t,e){super(),this.logger=e,this.cameraSubject=new De(t),"native"===t.pluginId&&this.cameraState.next(!0)}getValue(t){switch(t){case"light":return Sn()(this.lightState.getValue());case"motion":return Sn()(this.motionState.getValue());case"audio":return Sn()(this.audioState.getValue());case"object":return Sn()(this.objectState.getValue());case"doorbell":return Sn()(this.doorbellState.getValue());case"siren":return Sn()(this.sirenState.getValue());case"battery":return Sn()(this.batteryState.getValue());default:throw new Error(`Unknown state: ${t}`)}}async updateState(t,e){switch(t){case"light":{const t=this.getLightState(e);t&&this.lightState.next(t)}break;case"motion":{const t=this.getMotionState(e);t&&this.motionState.next(t)}break;case"audio":{const t=this.getAudioState(e);t&&this.audioState.next(t)}break;case"object":{const t=this.getObjectState(e);t&&this.objectState.next(t)}break;case"doorbell":{const t=this.getDoorbellState(e);t&&this.doorbellState.next(t)}break;case"siren":{const t=this.getSirenState(e);t&&this.sirenState.next(t)}break;case"battery":{const t=this.getBatteryState(e);t&&this.batteryState.next(t)}break;default:throw new Error(`Unknown state: ${t}`)}}onStateChange(t){return this[`${t}State`].pipe(Fn(),Nn((([t,e])=>"boolean"==typeof t||"boolean"==typeof e?t!==e:!1===this.stateChanged(t,e))),Ie((([t,e])=>({oldState:t,newState:e}))),an({connector:()=>new Le(1)}))}onPropertyChange(t){return this.cameraSubject.pipe(Fn(),Nn((([e,n])=>!En()(e[t],n[t]))),Ie((([e,n])=>({oldData:e[t],newData:n[t]}))),an({connector:()=>new Le(1)}))}removeAllListeners(){this.lightState.complete(),this.motionState.complete(),this.audioState.complete(),this.objectState.complete(),this.doorbellState.complete(),this.sirenState.complete(),this.batteryState.complete(),this.cameraSubject.complete(),this.cameraState.complete()}getAudioState(t){if(!this.hasAudioDetector)return;const e=this.getValue("audio");return delete e.lastEvent,{...t,db:t.db||this.audioState.getValue().db,timestamp:Date.now(),lastEvent:e}}getMotionState(t){if(!this.hasMotionDetector)return;const e=this.getValue("motion");return delete e.lastEvent,{...t,timestamp:Date.now(),lastEvent:e}}getObjectState(t){if(!this.hasBattery)return;const e=this.getValue("object");return delete e.lastEvent,{...t,timestamp:Date.now(),lastEvent:e}}getDoorbellState(t){if(!this.hasBinarySensor)return;const e=this.getValue("doorbell");return delete e.lastEvent,{...t,timestamp:Date.now(),lastEvent:e}}getLightState(t){if(!this.hasLight)return;const e=this.getValue("light");return delete e.lastEvent,{...t,timestamp:Date.now(),lastEvent:e}}getSirenState(t){if(!this.hasSiren)return;const e=this.getValue("siren");return delete e.lastEvent,{...t,level:t.level||this.sirenState.getValue().level,timestamp:Date.now(),lastEvent:e}}getBatteryState(t){if(!this.hasBattery)return;const e=this.getValue("battery");return delete e.lastEvent,{...t,charging:t.charging||this.batteryState.getValue().charging,lowBattery:t.lowBattery||this.batteryState.getValue().lowBattery,timestamp:Date.now(),lastEvent:e}}createStateObservable(t){return t.pipe(sn(((t,e)=>"boolean"==typeof t||"boolean"==typeof e?t===e:!1===this.stateChanged(t,e))),an({connector:()=>new Le(1)}))}updateCamera(t){this.cameraSubject.next(t)}updateCameraState(t){this.cameraState.next(t)}stateChanged(t,e){return!(!t||!e||("boolean"==typeof t||"boolean"==typeof e?t===e:this.isAudioState(t)&&this.isAudioState(e)?t.state===e.state&&t.db===e.db:this.isMotionState(t)&&this.isMotionState(e)?t.state===e.state&&En()(t.detections,e.detections):this.isObjectState(t)&&this.isObjectState(e)?En()(t.detections,e.detections):this.isSirenState(t)&&this.isSirenState(e)?t.state===e.state&&t.level===e.level:this.isBatteryState(t)&&this.isBatteryState(e)?t.level===e.level&&t.lowBattery===e.lowBattery&&t.charging===e.charging:t.state===e.state))}isAudioState(t){return"state"in t&&"db"in t}isMotionState(t){return"state"in t&&"detections"in t}isObjectState(t){return"detections"in t}isSirenState(t){return"state"in t&&"level"in t}isBatteryState(t){return!("state"in t)&&"level"in t&&("lowBattery"in t||"charging"in t)}isGenericState(t){return"state"in t}}class In extends zn{async snapshot(t=!1){const e=this.snapshotSource.urls.www.jpegSnapshot,n=this.snapshotCache.get(this.snapshotSource._id);if(!t&&n)return n;const r=await fetch(e);if(!r.ok)throw new Error("Status Code: "+r.status);const i=await r.arrayBuffer();return i.byteLength>0&&this.snapshotCache.set(this.snapshotSource._id,i),i}async createSession(t,e){const n=await this.getIceServers(),r=new vn(this,t,e,n,this.logger);return new hn(this,this.logger,r)}}class Un extends In{socketService;get sources(){return super.sources.map((t=>({...t,isPrebuffering:async e=>this.socketService.sendRequest({name:"cameraDevice",method:"isPrebuffering",args:[{sourceName:t.name,type:e,cameraId:this.id}]}),getPrebufferRawUrl:async e=>this.socketService.sendRequest({name:"cameraDevice",method:"getPrebufferRawUrl",args:[{sourceName:t.name,type:e}]}),getStreamInfo:async()=>this.socketService.sendRequest({name:"cameraDevice",method:"getStreamInfo",args:[{sourceName:t.name}]})})))}constructor(t,e,n){super(t,n),this.socketService=e,this.listenToMessages()}connect(){return this.socketService.sendRequest({name:"cameraDevice",method:"connect",args:[{cameraId:this.id}]})}disconnect(){return this.socketService.sendRequest({name:"cameraDevice",method:"disconnect",args:[{cameraId:this.id}]})}reboot(){return this.socketService.sendRequest({name:"cameraDevice",method:"reboot",args:[{cameraId:this.id}]})}getIceServers(){return this.socketService.sendRequest({name:"cameraDevice",method:"getIceServers",args:[{cameraId:this.id}]})}async updateState(t,e){let n=!1;switch(t){case"light":n=this.stateChanged(this.lightState.getValue(),this.getLightState(e));break;case"motion":n=this.stateChanged(this.motionState.getValue(),this.getMotionState(e));break;case"audio":n=this.stateChanged(this.audioState.getValue(),this.getAudioState(e));break;case"object":n=this.stateChanged(this.objectState.getValue(),this.getObjectState(e));break;case"doorbell":n=this.stateChanged(this.doorbellState.getValue(),this.getDoorbellState(e));break;case"siren":n=this.stateChanged(this.sirenState.getValue(),this.getSirenState(e));break;case"battery":n=this.stateChanged(this.batteryState.getValue(),this.getBatteryState(e));break;default:throw new Error(`Unknown state: ${t}`)}if(n)return super.updateState(t,e),this.socketService.sendRequest({name:"cameraDevice",method:"updateState",args:[{cameraId:this.id,stateName:t,eventData:e}]})}async refreshStates(){const t=await this.socketService.sendRequest({name:"cameraDevice",method:"refreshStates",args:[{cameraId:this.id}]});this.updateCamera(t.camera),this.updateCameraState(t.cameraState);for(const[e,n]of Object.entries(t.states))super.updateState(e,n)}async cleanup(){try{this.removeAllListeners(),this.unsubscribe()}catch{}}listenToMessages(){this.socketService.socket.on("updateState",(t=>{t.cameraId===this.id&&super.updateState(t.stateName,t.data.newEvent)})),this.socketService.socket.on("updateDevice",(t=>{if(t.cameraId===this.id)switch(t.type){case"removed":this.cleanup();break;case"updated":super.updateCamera(t.data);break;case"cameraState":super.updateCameraState(t.data)}}))}}class Mn{socketService;devices=new Map;logger;constructor(t,e){this.socketService=t,this.logger=e}async getCameraById(t){let e=await this.addOrGetCamera(t);if(!e){const n=await this.socketService.sendRequest({name:"deviceManager",method:"getCameraById",args:[{id:t}]});n&&(e=await this.addOrGetCamera(n))}return e}async getCameraByName(t){let e=Array.from(this.devices.values()).find((e=>e.name===t));if(!e){const n=await this.socketService.sendRequest({name:"deviceManager",method:"getCameraByName",args:[{name:t}]});n&&(e=await this.addOrGetCamera(n))}return e}async addOrGetCamera(t){let e;if("string"==typeof t)e=Array.from(this.devices.values()).find((e=>e.id===t||e.name===t));else{const n=t;this.devices.has(n._id)?e=this.devices.get(n._id):(e=new Un(n,this.socketService,this.logger),this.devices.set(n._id,e))}return await(e?.refreshStates()),e}}class qn{socketService;logger;constructor(t,e){this.socketService=t,this.logger=e}}class Vn{socketService;logger;constructor(t,e){this.socketService=t,this.logger=e}}const Wn=Object.create(null);Wn.open="0",Wn.close="1",Wn.ping="2",Wn.pong="3",Wn.message="4",Wn.upgrade="5",Wn.noop="6";const Hn=Object.create(null);Object.keys(Wn).forEach((t=>{Hn[Wn[t]]=t}));const $n={type:"error",data:"parser error"},Gn="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Jn="function"==typeof ArrayBuffer,Kn=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Yn=({type:t,data:e},n,r)=>Gn&&e instanceof Blob?n?r(e):Xn(e,r):Jn&&(e instanceof ArrayBuffer||Kn(e))?n?r(e):Xn(new Blob([e]),r):r(Wn[t]+(e||"")),Xn=(t,e)=>{const n=new FileReader;return n.onload=function(){const t=n.result.split(",")[1];e("b"+(t||""))},n.readAsDataURL(t)};function Qn(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let Zn;const tr="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)tr["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(t)]=t;const er="function"==typeof ArrayBuffer,nr=(t,e)=>{if("string"!=typeof t)return{type:"message",data:ir(t,e)};const n=t.charAt(0);return"b"===n?{type:"message",data:rr(t.substring(1),e)}:Hn[n]?t.length>1?{type:Hn[n],data:t.substring(1)}:{type:Hn[n]}:$n},rr=(t,e)=>{if(er){const n=(t=>{let e,n,r,i,s,o=.75*t.length,a=t.length,c=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);const u=new ArrayBuffer(o),h=new Uint8Array(u);for(e=0;e<a;e+=4)n=tr[t.charCodeAt(e)],r=tr[t.charCodeAt(e+1)],i=tr[t.charCodeAt(e+2)],s=tr[t.charCodeAt(e+3)],h[c++]=n<<2|r>>4,h[c++]=(15&r)<<4|i>>2,h[c++]=(3&i)<<6|63&s;return u})(t);return ir(n,e)}return{base64:!0,data:t}},ir=(t,e)=>"blob"===e?t instanceof Blob?t:new Blob([t]):t instanceof ArrayBuffer?t:t.buffer,sr=String.fromCharCode(30);let or;function ar(t){return t.reduce(((t,e)=>t+e.length),0)}function cr(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let i=0;i<e;i++)n[i]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function ur(t){if(t)return function(t){for(var e in ur.prototype)t[e]=ur.prototype[e];return t}(t)}ur.prototype.on=ur.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},ur.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},ur.prototype.off=ur.prototype.removeListener=ur.prototype.removeAllListeners=ur.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i<r.length;i++)if((n=r[i])===e||n.fn===e){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+t],this},ur.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,e)}return this},ur.prototype.emitReserved=ur.prototype.emit,ur.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},ur.prototype.hasListeners=function(t){return!!this.listeners(t).length};const hr="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function lr(t,...e){return e.reduce(((e,n)=>(t.hasOwnProperty(n)&&(e[n]=t[n]),e)),{})}const fr=hr.setTimeout,dr=hr.clearTimeout;function pr(t,e){e.useNativeTimers?(t.setTimeoutFn=fr.bind(hr),t.clearTimeoutFn=dr.bind(hr)):(t.setTimeoutFn=hr.setTimeout.bind(hr),t.clearTimeoutFn=hr.clearTimeout.bind(hr))}class gr extends Error{constructor(t,e,n){super(t),this.description=e,this.context=n,this.type="TransportError"}}class yr extends ur{constructor(t){super(),this.writable=!1,pr(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,n){return super.emitReserved("error",new gr(t,e,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=nr(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return-1===t.indexOf(":")?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(t){const e=function(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}(t);return e.length?"?"+e:""}}const br="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),mr=64,vr={};let wr,Sr=0,_r=0;function Er(t){let e="";do{e=br[t%mr]+e,t=Math.floor(t/mr)}while(t>0);return e}function Or(){const t=Er(+new Date);return t!==wr?(Sr=0,wr=t):t+"."+Er(Sr++)}for(;_r<mr;_r++)vr[br[_r]]=_r;let kr=!1;try{kr="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}const Ar=kr;function Tr(t){const e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||Ar))return new XMLHttpRequest}catch(t){}if(!e)try{return new(hr[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function xr(){}const jr=null!=new Tr({xdomain:!1}).responseType;class Cr extends ur{constructor(t,e){super(),pr(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t;const e=lr(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const n=this.xhr=new Tr(e);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let t in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(t)&&n.setRequestHeader(t,this.opts.extraHeaders[t])}}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var t;3===n.readyState&&(null===(t=this.opts.cookieJar)||void 0===t||t.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=Cr.requestsCount++,Cr.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=xr,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete Cr.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Rr(){for(let t in Cr.requests)Cr.requests.hasOwnProperty(t)&&Cr.requests[t].abort()}Cr.requestsCount=0,Cr.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Rr):"function"==typeof addEventListener&&addEventListener("onpagehide"in hr?"pagehide":"unload",Rr,!1));const Lr="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),Dr=hr.WebSocket||hr.MozWebSocket,Br="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Fr={websocket:class extends yr{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,n=Br?{}:lr(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=Br?new Dr(t,e,n):e?new Dr(t,e):new Dr(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;Yn(n,this.supportsBinary,(t=>{try{this.ws.send(t)}catch(t){}r&&Lr((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",e=this.query||{};return this.opts.timestampRequests&&(e[this.opts.timestampParam]=Or()),this.supportsBinary||(e.b64=1),this.createUri(t,e)}check(){return!!Dr}},webtransport:class extends yr{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((t=>{this.onError("webtransport error",t)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((t=>{const e=function(t,e){or||(or=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(0===r){if(ar(n)<1)break;const t=cr(n,1);s=!(128&~t[0]),i=127&t[0],r=i<126?3:126===i?1:2}else if(1===r){if(ar(n)<2)break;const t=cr(n,2);i=new DataView(t.buffer,t.byteOffset,t.length).getUint16(0),r=3}else if(2===r){if(ar(n)<8)break;const t=cr(n,8),e=new DataView(t.buffer,t.byteOffset,t.length),s=e.getUint32(0);if(s>Math.pow(2,21)-1){a.enqueue($n);break}i=s*Math.pow(2,32)+e.getUint32(4),r=3}else{if(ar(n)<i)break;const t=cr(n,i);a.enqueue(nr(s?t:or.decode(t),e)),r=0}if(0===i||i>t){a.enqueue($n);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=t.readable.pipeThrough(e).getReader(),r=new TransformStream({transform(t,e){!function(t,e){Gn&&t.data instanceof Blob?t.data.arrayBuffer().then(Qn).then(e):Jn&&(t.data instanceof ArrayBuffer||Kn(t.data))?e(Qn(t.data)):Yn(t,!1,(t=>{Zn||(Zn=new TextEncoder),e(Zn.encode(t))}))}(t,(n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const t=new DataView(i.buffer);t.setUint8(0,126),t.setUint16(1,r)}else{i=new Uint8Array(9);const t=new DataView(i.buffer);t.setUint8(0,127),t.setBigUint64(1,BigInt(r))}t.data&&"string"!=typeof t.data&&(i[0]|=128),e.enqueue(i),e.enqueue(n)}))}});r.readable.pipeTo(t.writable),this.writer=r.writable.getWriter();const i=()=>{n.read().then((({done:t,value:e})=>{t||(this.onPacket(e),i())})).catch((t=>{}))};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then((()=>this.onOpen()))}))})))}write(t){this.writable=!1;for(let e=0;e<t.length;e++){const n=t[e],r=e===t.length-1;this.writer.write(n).then((()=>{r&&Lr((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var t;null===(t=this.transport)||void 0===t||t.close()}},polling:class extends yr{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){const e="https:"===location.protocol;let n=location.port;n||(n=e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||n!==t.port}const e=t&&t.forceBase64;this.supportsBinary=jr&&!e,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,e)=>{const n=t.split(sr),r=[];for(let t=0;t<n.length;t++){const i=nr(n[t],e);if(r.push(i),"error"===i.type)break}return r})(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach(((t,s)=>{Yn(t,!1,(t=>{r[s]=t,++i===n&&e(r.join(sr))}))}))})(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const t=this.opts.secure?"https":"http",e=this.query||{};return!1!==this.opts.timestampRequests&&(e[this.opts.timestampParam]=Or()),this.supportsBinary||e.sid||(e.b64=1),this.createUri(t,e)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Cr(this.uri(),t)}doWrite(t,e){const n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}},Nr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Pr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zr(t){if(t.length>2e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");-1!=n&&-1!=r&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=Nr.exec(t||""),s={},o=14;for(;o--;)s[Pr[o]]=i[o]||"";return-1!=n&&-1!=r&&(s.source=e,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(t,e){const n=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||n.splice(0,1),"/"==e.slice(-1)&&n.splice(n.length-1,1),n}(0,s.path),s.queryKey=function(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(n[e]=r)})),n}(0,s.query),s}class Ir extends ur{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=zr(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=zr(e.host).host),pr(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},n=t.split("&");for(let t=0,r=n.length;t<r;t++){let r=n[t].split("=");e[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return e}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const n=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new Fr[t](n)}open(){let t;if(this.opts.rememberUpgrade&&Ir.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(t=>this.onClose("transport close",t)))}probe(t){let e=this.createTransport(t),n=!1;Ir.priorWebsocketSuccess=!1;const r=()=>{n||(e.send([{type:"ping",data:"probe"}]),e.once("packet",(t=>{if(!n)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;Ir.priorWebsocketSuccess="websocket"===e.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(u(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())}))}else{const t=new Error("probe error");t.transport=e.name,this.emitReserved("upgradeError",t)}})))};function i(){n||(n=!0,u(),e.close(),e=null)}const s=t=>{const n=new Error("probe error: "+t);n.transport=e.name,i(),this.emitReserved("upgradeError",n)};function o(){s("transport closed")}function a(){s("socket closed")}function c(t){e&&t.name!==e.name&&i()}const u=()=>{e.removeListener("open",r),e.removeListener("error",s),e.removeListener("close",o),this.off("close",a),this.off("upgrading",c)};e.once("open",r),e.once("error",s),e.once("close",o),this.once("close",a),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{n||e.open()}),200):e.open()}onOpen(){if(this.readyState="open",Ir.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(t+="string"==typeof(e=r)?function(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}(e):Math.ceil(1.33*(e.byteLength||e.size))),n>0&&t>this.maxPayload)return this.writeBuffer.slice(0,n);t+=2}var e;return this.writeBuffer}write(t,e,n){return this.sendPacket("message",t,e,n),this}send(t,e,n){return this.sendPacket("message",t,e,n),this}sendPacket(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:t,data:e,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},n=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():t()})):this.upgrading?n():t()),this}onError(t){Ir.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let n=0;const r=t.length;for(;n<r;n++)~this.transports.indexOf(t[n])&&e.push(t[n]);return e}}Ir.protocol=4,Ir.protocol;const Ur="function"==typeof ArrayBuffer,Mr=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,qr=Object.prototype.toString,Vr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===qr.call(Blob),Wr="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===qr.call(File);function Hr(t){return Ur&&(t instanceof ArrayBuffer||Mr(t))||Vr&&t instanceof Blob||Wr&&t instanceof File}function $r(t,e){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let e=0,n=t.length;e<n;e++)if($r(t[e]))return!0;return!1}if(Hr(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return $r(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&$r(t[e]))return!0;return!1}function Gr(t){const e=[],n=t.data,r=t;return r.data=Jr(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Jr(t,e){if(!t)return t;if(Hr(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=Jr(t[r],e);return n}if("object"==typeof t&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=Jr(t[r],e));return n}return t}function Kr(t,e){return t.data=Yr(t.data,e),delete t.attachments,t}function Yr(t,e){if(!t)return t;if(t&&!0===t._placeholder){if("number"==typeof t.num&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=Yr(t[n],e);else if("object"==typeof t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Yr(t[n],e));return t}const Xr=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],Qr=5;var Zr;!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(Zr||(Zr={}));class ti{constructor(t){this.replacer=t}encode(t){return t.type!==Zr.EVENT&&t.type!==Zr.ACK||!$r(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===Zr.EVENT?Zr.BINARY_EVENT:Zr.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==Zr.BINARY_EVENT&&t.type!==Zr.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=Gr(t),n=this.encodeAsString(e.packet),r=e.buffers;return r.unshift(n),r}}function ei(t){return"[object Object]"===Object.prototype.toString.call(t)}class ni extends ur{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const n=e.type===Zr.BINARY_EVENT;n||e.type===Zr.BINARY_ACK?(e.type=n?Zr.EVENT:Zr.ACK,this.reconstructor=new ri(e),0===e.attachments&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!Hr(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const n={type:Number(t.charAt(0))};if(void 0===Zr[n.type])throw new Error("unknown packet type "+n.type);if(n.type===Zr.BINARY_EVENT||n.type===Zr.BINARY_ACK){const r=e+1;for(;"-"!==t.charAt(++e)&&e!=t.length;);const i=t.substring(r,e);if(i!=Number(i)||"-"!==t.charAt(e))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===t.charAt(e+1)){const r=e+1;for(;++e&&","!==t.charAt(e)&&e!==t.length;);n.nsp=t.substring(r,e)}else n.nsp="/";const r=t.charAt(e+1);if(""!==r&&Number(r)==r){const r=e+1;for(;++e;){const n=t.charAt(e);if(null==n||Number(n)!=n){--e;break}if(e===t.length)break}n.id=Number(t.substring(r,e+1))}if(t.charAt(++e)){const r=this.tryParse(t.substr(e));if(!ni.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case Zr.CONNECT:return ei(e);case Zr.DISCONNECT:return void 0===e;case Zr.CONNECT_ERROR:return"string"==typeof e||ei(e);case Zr.EVENT:case Zr.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Xr.indexOf(e[0]));case Zr.ACK:case Zr.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ri{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const t=Kr(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function ii(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const si=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class oi extends ur{constructor(t,e,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[ii(t,"open",this.onopen.bind(this)),ii(t,"packet",this.onpacket.bind(this)),ii(t,"error",this.onerror.bind(this)),ii(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(si.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const n={type:Zr.EVENT,data:e,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++,r=e.pop();this._registerAckCallback(t,r),n.id=t}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(t,e){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[t]=e);const i=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))}),r),s=(...t)=>{this.io.clearTimeoutFn(i),e.apply(this,t)};s.withError=!0,this.acks[t]=s}emitWithAck(t,...e){return new Promise(((n,r)=>{const i=(t,e)=>t?r(t):n(e);i.withError=!0,e.push(i),this.emit(t,...e)}))}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...r)=>{if(n===this._queue[0])return null!==t?n.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(t)):(this._queue.shift(),e&&e(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||0===this._queue.length)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth((t=>{this._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Zr.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((t=>{if(!this.sendBuffer.some((e=>String(e.id)===t))){const e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}}))}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Zr.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Zr.EVENT:case Zr.BINARY_EVENT:this.onevent(t);break;case Zr.ACK:case Zr.BINARY_ACK:this.onack(t);break;case Zr.DISCONNECT:this.ondisconnect();break;case Zr.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let n=!1;return function(...r){n||(n=!0,e.packet({type:Zr.ACK,id:t,data:r}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>{this.notifyOutgoingListeners(t),this.packet(t)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Zr.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let n=0;n<e.length;n++)if(t===e[n])return e.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const n of e)n.apply(this,t.data)}}}function ai(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}ai.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+n:t-n}return 0|Math.min(t,this.max)},ai.prototype.reset=function(){this.attempts=0},ai.prototype.setMin=function(t){this.ms=t},ai.prototype.setMax=function(t){this.max=t},ai.prototype.setJitter=function(t){this.jitter=t};class ci extends ur{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(n=t,t=void 0),(n=n||{}).path=n.path||"/socket.io",this.opts=n,pr(this,n),this.reconnection(!1!==n.reconnection),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(r=n.randomizationFactor)&&void 0!==r?r:.5),this.backoff=new ai({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==n.timeout?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==n.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new Ir(this.uri,this.opts);const e=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=ii(e,"open",(function(){n.onopen(),t&&t()})),i=e=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",e),t?t(e):this.maybeReconnectOnOpen()},s=ii(e,"error",i);if(!1!==this._timeout){const t=this._timeout,n=this.setTimeoutFn((()=>{r(),i(new Error("timeout")),e.close()}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(ii(t,"ping",this.onping.bind(this)),ii(t,"data",this.ondata.bind(this)),ii(t,"error",this.onerror.bind(this)),ii(t,"close",this.onclose.bind(this)),ii(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){Lr((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let n=this.nsps[t];return n?this._autoConnect&&!n.active&&n.connect():(n=new oi(this,t,e),this.nsps[t]=n),n}_destroy(t){const e=Object.keys(this.nsps);for(const t of e)if(this.nsps[t].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let n=0;n<e.length;n++)this.engine.write(e[n],t.options)}cleanup(){this.subs.forEach((t=>t())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open((e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()})))}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const ui={};function hi(t,e){"object"==typeof t&&(e=t,t=void 0);const n=function(t,e="",n){let r=t;n=n||"undefined"!=typeof location&&location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==n?n.protocol+"//"+t:"https://"+t),r=zr(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(t,(e=e||{}).path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=ui[i]&&s in ui[i].nsps;let a;return e.forceNew||e["force new connection"]||!1===e.multiplex||o?a=new ci(r,e):(ui[i]||(ui[i]=new ci(r,e)),a=ui[i]),n.query&&!e.query&&(e.query=n.queryKey),a.socket(n.path,e)}Object.assign(hi,{Manager:ci,Socket:oi,io:hi,connect:hi});class li{manager;token;get socket(){return this.manager.socket("/proxy",{auth:{token:`Bearer ${this.token}`}})}constructor(t,e){const n=t.replace("https://","wss://").replace("http://","ws://");this.token=e,this.manager=new ci(n,{reconnection:!0,reconnectionDelay:500,rejectUnauthorized:!1,autoConnect:!0,transports:["websocket"]})}sendRequest(t){return new Promise(((e,n)=>{this.socket.emit("request",t,(t=>{t.success?e(t.data):n(t.error)}))}))}close(){this.socket.emit("end"),this.socket.removeAllListeners(),this.socket.disconnect()}}class fi{api;socketService;config;logger;token;deviceManager;pluginsManager;systemManager;constructor(t){this.config=t,this.logger=t.logger||console,this.api=new $t(t.endpoint)}async connect(){return this.deviceManager&&this.pluginsManager&&this.systemManager||(this.cleanUpClient(),await this.login(),this.token=this.token||this.config.token,this.socketService=new li(this.config.endpoint,this.token),this.deviceManager=new Mn(this.socketService,this.logger),this.pluginsManager=new qn(this.socketService,this.logger),this.systemManager=new Vn(this.socketService,this.logger),this.checkSession()),{deviceManager:this.deviceManager,pluginsManager:this.pluginsManager,systemManager:this.systemManager}}async disconnect(){this.socketService?.close(),this.cleanUpClient(),this.config.username&&this.config.password&&await this.api.interceptor.post("/auth/logout",void 0,{headers:{Authorization:`Bearer ${this.token}`}})}async updateCredentials(t){this.config={...this.config,...t},this.socketService&&await this.disconnect(),await this.connect()}async login(){if(this.config.username&&this.config.password)try{const t=await this.api.interceptor.post("/auth/login",{username:this.config.username,password:this.config.password});this.token=t.data.access_token}catch(t){throw 401===t.response?.status?new Error("Invalid credentials"):new Error(`Failed to get token: ${t.message}`)}else if(this.config.token&&!this.config.skipCheck)try{await this.api.interceptor.get("/auth/check",{headers:{Authorization:`Bearer ${this.config.token}`}})}catch(t){throw new Error(`Invalid token: ${t.message}`)}this.token=this.token||this.config.token}getDeviceManager(){return this.deviceManager}getPluginsManager(){return this.pluginsManager}getSystemManager(){return this.systemManager}checkSession(){this.socketService?.socket.removeListener("invalidToken"),this.socketService?.socket.on("invalidToken",(async t=>{t===this.token&&await this.disconnect()}))}cleanUpClient(){this.deviceManager=void 0,this.pluginsManager=void 0,this.systemManager=void 0}}var di,pi,gi;!function(t){t.READY="ready",t.STARTING="starting",t.STARTED="started",t.STOPPED="stopped",t.ERROR="error",t.UNKNOWN="unknown",t.DISABLED="disabled"}(di||(di={})),function(t){t.START="start",t.STOP="stop"}(pi||(pi={})),function(t){t.READY="ready",t.RESTARTING="restarting",t.STARTING="starting",t.STARTED="started",t.STOPPED="stopped",t.ERROR="error",t.UNKNOWN="unknown"}(gi||(gi={}))})();var i=r.F,s=r.j;export{i as BrowserStreamingSession,s as CameraUiClient};
@@ -1,5 +1,5 @@
1
1
  import { BrowserCameraDevice } from '../../../../../server/src/camera/base/cameraDeviceBrowser.js';
2
- import type { BaseLogger, Camera, CameraSource, IceServer, OnSetEvent, StateValues } from '../../../../../shared/types/index.js';
2
+ import type { BaseLogger, Camera, CameraSource, IceServer, SetValues } from '../../../../../shared/types/index.js';
3
3
  import type { SocketService } from '../socket.js';
4
4
  export declare class CameraDeviceProxy extends BrowserCameraDevice {
5
5
  private socketService;
@@ -9,7 +9,7 @@ export declare class CameraDeviceProxy extends BrowserCameraDevice {
9
9
  disconnect(): Promise<void>;
10
10
  reboot(): Promise<void>;
11
11
  getIceServers(): Promise<IceServer[]>;
12
- updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
12
+ updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
13
13
  refreshStates(): Promise<void>;
14
14
  cleanup(): Promise<void>;
15
15
  private listenToMessages;
@@ -1,7 +1,7 @@
1
- import { StreamingConnectionOptions } from '../streaming/peer-connection.js';
2
1
  import { StreamingSession } from '../streaming/streaming-session.js';
3
2
  import { BaseCameraDevice } from './index.js';
4
3
  import type { Frame } from '../../decoder/types.js';
4
+ import type { StreamingConnectionOptions } from '../streaming/peer-connection.js';
5
5
  import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions } from '../types.js';
6
6
  export declare abstract class CameraDevice extends BaseCameraDevice {
7
7
  private _delegate?;
@@ -2,7 +2,7 @@ import { LRUCache } from 'lru-cache';
2
2
  import { BehaviorSubject, Observable, Subscription } from 'rxjs';
3
3
  import type { Camera, CameraInformation, CameraPublicProperties, CameraType, CameraZone } from '../../api/database/types.js';
4
4
  import type { IceServer } from '../../services/config/types.js';
5
- import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraSource, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, OnSetEvent, SirenSetEvent, SirenState, State, StateValues } from '../types.js';
5
+ import type { AudioSetEvent, AudioState, BaseLogger, BatterySetEvent, BatteryState, CameraSource, DoorbellSetEvent, DoorbellState, LightSetEvent, LightState, MotionSetEvent, MotionState, ObjectSetEvent, ObjectState, SetValues, SirenSetEvent, SirenState, State, StateValues } from '../types.js';
6
6
  declare class Subscribed {
7
7
  private readonly subscriptions;
8
8
  private readonly additionalSubscriptions;
@@ -65,7 +65,7 @@ export declare abstract class BaseCameraDevice extends Subscribed {
65
65
  abstract getIceServers(): Promise<IceServer[]>;
66
66
  protected abstract cleanup(): void;
67
67
  getValue<T extends keyof StateValues>(stateName: T): StateValues[T];
68
- updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
68
+ updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
69
69
  onStateChange<T extends keyof StateValues>(stateName: T): Observable<{
70
70
  newState: StateValues[T];
71
71
  oldState: StateValues[T];
@@ -90,6 +90,7 @@ export declare abstract class BaseCameraDevice extends Subscribed {
90
90
  protected isMotionState(state: State): state is MotionState;
91
91
  protected isObjectState(state: State): state is ObjectState;
92
92
  protected isSirenState(state: State): state is SirenState;
93
+ protected isBatteryState(state: State): state is BatteryState;
93
94
  protected isGenericState(state: State): state is DoorbellState;
94
95
  }
95
96
  export {};
@@ -111,9 +111,9 @@ export interface ObjectDetection extends BaseDetection {
111
111
  lebel: string;
112
112
  boundingBox: [number, number, number, number];
113
113
  }
114
- export interface BaseState<T> {
114
+ export interface BaseState<T extends LightState | AudioState | MotionState | ObjectState | SirenState | BatteryState | DoorbellState> {
115
115
  timestamp: number;
116
- lastEvent?: T;
116
+ lastEvent?: Omit<T, 'lastEvent'>;
117
117
  }
118
118
  export interface MotionSetEvent {
119
119
  state: boolean;
@@ -158,9 +158,18 @@ export interface StateValues {
158
158
  siren: SirenState;
159
159
  battery: BatteryState;
160
160
  }
161
+ export interface SetValues {
162
+ light: LightSetEvent;
163
+ motion: MotionSetEvent;
164
+ audio: AudioSetEvent;
165
+ object: ObjectSetEvent;
166
+ doorbell: DoorbellSetEvent;
167
+ siren: SirenSetEvent;
168
+ battery: BatterySetEvent;
169
+ }
161
170
  export type CameraStateCallbacks = {
162
171
  [K in keyof StateValues]: (event: StateValues[K]) => void;
163
172
  };
164
173
  export type StateValue<T extends keyof StateValues> = StateValues[T];
165
- export type OnSetEvent<T extends keyof StateValues> = T extends 'light' ? LightSetEvent : T extends 'motion' ? MotionSetEvent : T extends 'audio' ? AudioSetEvent : T extends 'doorbell' ? DoorbellSetEvent : T extends 'siren' ? SirenSetEvent : T extends 'battery' ? BatterySetEvent : ObjectSetEvent;
174
+ export type SetValue<T extends keyof SetValues> = SetValues[T];
166
175
  export type OnChangeCallback<T extends keyof StateValues> = (newEvent: StateValues[T], oldEvent: StateValues[T]) => void;
@@ -4,8 +4,8 @@ export declare class Go2Rtc {
4
4
  private api;
5
5
  private logger;
6
6
  private configService;
7
- version?: string;
8
- os?: string;
7
+ version: string;
8
+ os: string;
9
9
  private started;
10
10
  private restarting;
11
11
  private manuallyKilled;
@@ -1,4 +1,4 @@
1
- import { NatsConnection, Subscription } from 'nats';
1
+ import { type NatsConnection, type Subscription } from 'nats';
2
2
  import { CameraDeviceProxy } from './proxy/cameraDevice.js';
3
3
  import { DeviceManagerProxy, PluginsManagerProxy, SystemManagerProxy } from './proxy/index.js';
4
4
  import { NatsServer } from './server.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  import type { Camera } from '../../api/database/types.js';
3
- import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions, OnSetEvent, PrebufferType, StateValues, StreamInfo } from '../../camera/types.js';
3
+ import type { CameraDelegate, CameraPrebufferDelegate, FfmpegOptions, PrebufferType, SetValues, StateValues, StreamInfo } from '../../camera/types.js';
4
4
  import type { FrameMetadata, FrameSession } from '../../decoder/types.js';
5
5
  import type { IceServer } from '../../services/config/types.js';
6
6
  import type { MessageQueue } from '../queue.js';
@@ -70,9 +70,9 @@ export declare class CameraDeviceProxy implements CameraDeviceProxyMethods {
70
70
  cameraId: string;
71
71
  pluginId: string;
72
72
  }): Promise<void>;
73
- updateState<T extends keyof StateValues>(data: {
73
+ updateState<T extends keyof SetValues>(data: {
74
74
  stateName: T;
75
- eventData: OnSetEvent<T>;
75
+ eventData: SetValues[T];
76
76
  cameraId: string;
77
77
  pluginId: string;
78
78
  }): Promise<void>;
@@ -1,7 +1,7 @@
1
1
  import type { Camera } from '../api/database/types.js';
2
2
  import type { CameraDevice } from '../camera/base/cameraDevice.js';
3
3
  import type { BrowserCameraDevice } from '../camera/base/cameraDeviceBrowser.js';
4
- import type { CameraConfig, FfmpegOptions, OnSetEvent, PrebufferType, StateValues, StreamInfo } from '../camera/types.js';
4
+ import type { CameraConfig, FfmpegOptions, PrebufferType, SetValues, StateValues, StreamInfo } from '../camera/types.js';
5
5
  import type { FrameMetadata, FrameSession } from '../decoder/types.js';
6
6
  import type { BasePlugin } from '../plugins/base.js';
7
7
  import type { CameraStorage } from '../plugins/node/cameraStorage.js';
@@ -144,9 +144,9 @@ export interface CameraDeviceProxyMethods {
144
144
  cameraId: string;
145
145
  pluginId: string;
146
146
  }): Promise<void>;
147
- updateState<T extends keyof StateValues>(data: {
147
+ updateState<T extends keyof SetValues>(data: {
148
148
  stateName: T;
149
- eventData: OnSetEvent<T>;
149
+ eventData: SetValues[T];
150
150
  cameraId: string;
151
151
  pluginId: string;
152
152
  }): void;
@@ -1,6 +1,6 @@
1
1
  import type { Namespace, Server } from 'socket.io';
2
2
  import type { SocketNsp } from '../api/websocket/types.js';
3
- import { StateValues } from '../camera/types.js';
3
+ import type { StateValues } from '../camera/types.js';
4
4
  import type { CameraDeviceListenerMessagePayload } from './types.js';
5
5
  export declare class WebsocketProxy {
6
6
  nsp: Namespace;
@@ -6,6 +6,7 @@ export declare class PluginManager {
6
6
  private logger;
7
7
  private api;
8
8
  private configService;
9
+ private pythonVersionsToInstall;
9
10
  plugins: Map<string, Plugin>;
10
11
  pluginWorkers: Map<string, PluginWorker>;
11
12
  searchPaths: Set<string>;
@@ -22,6 +23,7 @@ export declare class PluginManager {
22
23
  startPluginChild(pluginName: string): Promise<void>;
23
24
  stopPluginChild(pluginName: string): Promise<void>;
24
25
  initializePlugins(): Promise<void>;
26
+ installRequiredPythonEnvs(): Promise<void>;
25
27
  private loadInstalledPlugins;
26
28
  private removeOrphanedPlugins;
27
29
  private loadDefaultPaths;
@@ -1,6 +1,6 @@
1
1
  import { CameraDevice } from '../../../camera/base/cameraDevice.js';
2
2
  import type { Camera } from '../../../api/database/types.js';
3
- import type { CameraSource, OnSetEvent, StateValues } from '../../../camera/types.js';
3
+ import type { CameraSource, SetValues } from '../../../camera/types.js';
4
4
  import type { Frame } from '../../../decoder/types.js';
5
5
  import type { IceServer } from '../../../services/config/types.js';
6
6
  import type { PluginAPI } from '../api.js';
@@ -34,10 +34,11 @@ export declare class CameraDeviceProxy extends CameraDevice {
34
34
  generateFrames(): AsyncIterableIterator<Frame>;
35
35
  getFfmpegPath(): Promise<string>;
36
36
  getIceServers(): Promise<IceServer[]>;
37
- updateState<T extends keyof StateValues>(stateName: T, eventData: OnSetEvent<T>): Promise<void>;
37
+ updateState<T extends keyof SetValues>(stateName: T, eventData: SetValues[T]): Promise<void>;
38
38
  refreshStates(): Promise<void>;
39
39
  cleanup(): Promise<void>;
40
40
  private connectToServer;
41
+ private closeFrameSubscriber;
41
42
  private requestHandler;
42
43
  private listenToMessages;
43
44
  private onRequest;
@@ -1,4 +1,4 @@
1
- import { PythonInstaller } from '../../bin/python.js';
1
+ import { PythonInstaller } from '../utils/pythonInstaller.js';
2
2
  import { PluginConfigService } from './node/config.js';
3
3
  import type { PluginConstructor } from '../api.js';
4
4
  import type { CameraUiPlugin, IPackageJson } from '../api/types/index.js';
@@ -5,10 +5,10 @@ export declare class PythonInstaller {
5
5
  readonly python: PortablePython;
6
6
  readonly venvPath?: string;
7
7
  readonly installPath: string;
8
- private _version;
9
8
  private identifier;
10
9
  private logger;
11
10
  private configService;
11
+ private needsUpdate;
12
12
  get isInstalled(): boolean;
13
13
  get pluginPythonPath(): string;
14
14
  get serverPythonPath(): string;
@@ -24,6 +24,8 @@ export declare class PythonInstaller {
24
24
  updateServerDependencies(): Promise<void>;
25
25
  installPluginPackages(pkgs: string[]): Promise<string>;
26
26
  installServerPackages(pkgs: string[]): Promise<string>;
27
+ reinstallPluginPackes(pkgs: string[]): Promise<string>;
28
+ reinstallServerPackages(pkgs: string[]): Promise<string>;
27
29
  uninstallPluginPackages(pkgs: string[]): Promise<string>;
28
30
  uninstallServerPackages(pkgs: string[]): Promise<string>;
29
31
  private installPluginRequirements;
@@ -34,10 +36,12 @@ export declare class PythonInstaller {
34
36
  private installRequirements;
35
37
  private installPackages;
36
38
  private uninstallPackages;
37
- private getInstalledPackages;
39
+ private reinstallPackages;
38
40
  private ensureVenv;
39
41
  private createVenv;
40
42
  private removeVenv;
43
+ private removeOldVersions;
44
+ private getMajorMinorVersion;
41
45
  private cleanPackageName;
42
46
  private difference;
43
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camera.ui/browser",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "description": "camera.ui browser client",
5
5
  "author": "seydx (https://github.com/seydx/camera.ui)",
6
6
  "module": "./dist/bundle.js",
@@ -31,7 +31,7 @@
31
31
  "socket.io-client": "^4.7.5"
32
32
  },
33
33
  "devDependencies": {
34
- "@rushstack/eslint-patch": "^1.10.2",
34
+ "@rushstack/eslint-patch": "^1.10.3",
35
35
  "@swc/register": "^0.1.10",
36
36
  "@types/webrtc": "^0.0.43",
37
37
  "@typescript-eslint/eslint-plugin": "^7.9.0",
@@ -44,7 +44,7 @@
44
44
  "rimraf": "^5.0.7",
45
45
  "ts-loader": "^9.5.1",
46
46
  "typescript": "^5.4.5",
47
- "updates": "^16.0.1",
47
+ "updates": "^16.1.1",
48
48
  "utf-8-validate": "^6.0.4",
49
49
  "webpack": "^5.91.0",
50
50
  "webpack-cli": "^5.1.4"