@sentdm/voice-client 0.1.1 → 0.2.0

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.
@@ -0,0 +1,31 @@
1
+ import __pubnub from "pubnub";
2
+ var XT=Object.create;var Lv=Object.defineProperty;var jT=Object.getOwnPropertyDescriptor;var eA=Object.getOwnPropertyNames;var tA=Object.getPrototypeOf,nA=Object.prototype.hasOwnProperty;var Uv=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var p=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var rA=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of eA(t))!nA.call(e,i)&&i!==n&&Lv(e,i,{get:()=>t[i],enumerable:!(r=jT(t,i))||r.enumerable});return e};var iA=(e,t,n)=>(n=e!=null?XT(tA(e)):{},rA(t||!e||!e.__esModule?Lv(n,"default",{value:e,enumerable:!0}):n,e));var Lt=p(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.Direction=void 0;var Wv;(function(e){e[e.Inbound=0]="Inbound",e[e.Outbound=1]="Outbound"})(Wv||(ys.Direction=Wv={}))});var ct=p(Cs=>{"use strict";Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SessionState=void 0;var Hv;(function(e){e[e.Created=0]="Created",e[e.Initiating=1]="Initiating",e[e.Progress=2]="Progress",e[e.Established=3]="Established",e[e.Terminated=4]="Terminated"})(Hv||(Cs.SessionState=Hv={}))});var un=p(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.Event=void 0;var U0=class{constructor(t){this.subscribers=new Array,this.fire=n=>{this.subscribers.forEach(r=>r(n))},t&&this.add(t)}add(t){this.subscribers.push(t)}remove(t){let n=this.subscribers.indexOf(t);n>=0&&this.subscribers.splice(n,1)}clean(){this.subscribers=[]}};Es.Event=U0});var Kv=p(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.SessionDescription=cn.Source=cn.DescriptionType=void 0;var bs;(function(e){e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"})(bs||(cn.DescriptionType=bs={}));var Vv;(function(e){e[e.Local=1]="Local",e[e.Remote=2]="Remote"})(Vv||(cn.Source=Vv={}));var Ea=class e{constructor(t,n){this.type=t,this.sdp=n}asJson(){switch(this.type){case bs.Offer:return e.toJson(e.offer,this.sdp);case bs.Answer:return e.toJson(e.answer,this.sdp)}}static toJson(t,n){return JSON.stringify({type:t,sdp:n.toString()})}};cn.SessionDescription=Ea;Ea.answer="answer";Ea.offer="offer"});var dt=p(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.TerminationCause=void 0;var zv;(function(e){e[e.None=0]="None",e[e.Timeout=1]="Timeout",e[e.Canceled=2]="Canceled",e[e.Error=3]="Error",e[e.Denied=4]="Denied",e[e.HungUp=5]="HungUp",e[e.OtherPeerAccepted=6]="OtherPeerAccepted",e[e.Inactive=7]="Inactive",e[e.IceFailedToConnect=8]="IceFailedToConnect"})(zv||(Is.TerminationCause=zv={}))});var Ce=p(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ArgumentError=xt.InvalidOperationError=xt.UnhandledEventError=xt.ErrorBase=void 0;var zr=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};xt.ErrorBase=zr;var W0=class extends zr{constructor(t,n){super(n?`${t} (state: ${n})`:t)}};xt.UnhandledEventError=W0;var H0=class extends zr{};xt.InvalidOperationError=H0;var V0=class extends zr{constructor(t,n){super(`${t}, type: ${n}`)}};xt.ArgumentError=V0});var dn=p(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.SinchError=St.ErrorCode=St.ErrorMessage=St.ErrorType=void 0;var aA=Ce(),K0;(function(e){e[e.Generic=0]="Generic",e[e.Network=1]="Network",e[e.Session=2]="Session",e[e.Api=3]="Api",e[e.Persistence=4]="Persistence",e[e.Sip=5]="Sip",e[e.Http=6]="Http"})(K0||(St.ErrorType=K0={}));var Ts=class{};St.ErrorMessage=Ts;Ts.ICE_FAILED_TO_CONNECT="ICE failed to connect";var Gv;(function(e){e[e.Generic=1]="Generic",e[e.CallFailedToConnectIce=3002]="CallFailedToConnectIce",e[e.WebRtcAudioRecordInitFailed=3500]="WebRtcAudioRecordInitFailed",e[e.WebRtcAudioRecordStartFailed=3501]="WebRtcAudioRecordStartFailed",e[e.WebRtcAudioTrackInitFailed=3502]="WebRtcAudioTrackInitFailed",e[e.WebRtcAudioTrackStartFailed=3503]="WebRtcAudioTrackStartFailed"})(Gv||(St.ErrorCode=Gv={}));var z0=class extends aA.ErrorBase{constructor(t,n=500,r=K0.Generic,i){super(t),this.message=t,this.code=n,this.domain=r,this.isFatal=i}};St.SinchError=z0});var Qv=p(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0})});var Yv=p(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.Body=void 0;var oA=ws(),ln=class e{constructor(t,n){this.type=t,this.data=n}isMedia(){return this.type===e.mediaType}isSdp(){return this.type===e.sdpType&&this.data!=null}isClientEvent(){return this.type===e.clientEventType&&this.data!=null}isError(){return this.type===e.errorJsonType&&this.data!=null}static sdp(t){return new e(this.sdpType,t)}static client(t){return new e(this.clientType,t)}static media(t){return new e(this.mediaType,t)}static clientEvent(t){return new e(this.clientEventType,JSON.stringify({name:t}))}static error(t){return new e(this.errorJsonType,oA.Message.errorToJsonString(t))}};As.Body=ln;ln.clientType="client";ln.sdpType="sdp";ln.mediaType="media";ln.clientEventType="clientEvent";ln.errorJsonType="error/json"});var Xv=p($v=>{"use strict";Object.defineProperty($v,"__esModule",{value:!0})});var G0=p(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Method=void 0;var jv;(function(e){e[e.Undefined=0]="Undefined",e[e.Invite=1]="Invite",e[e.Ack=2]="Ack",e[e.Join=3]="Join",e[e.Joined=4]="Joined",e[e.Leave=5]="Leave",e[e.Deny=6]="Deny",e[e.Cancel=7]="Cancel",e[e.Update=8]="Update",e[e.Error=9]="Error",e[e.PeerEvent=10]="PeerEvent"})(jv||(Os.Method=jv={}))});var em=p(()=>{});var X=p((Ds,tm)=>{(function(e,t){typeof Ds=="object"?tm.exports=Ds=t():typeof define=="function"&&define.amd?define([],t):e.CryptoJS=t()})(Ds,function(){var e=e||(function(t,n){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<"u"&&global.crypto&&(r=global.crypto),!r&&typeof Uv=="function")try{r=em()}catch{}var i=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||(function(){function v(){}return function(g){var y;return v.prototype=g,y=new v,v.prototype=null,y}})(),s={},u=s.lib={},d=u.Base=(function(){return{extend:function(v){var g=a(this);return v&&g.mixIn(v),(!g.hasOwnProperty("init")||this.init===g.init)&&(g.init=function(){g.$super.init.apply(this,arguments)}),g.init.prototype=g,g.$super=this,g},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var g in v)v.hasOwnProperty(g)&&(this[g]=v[g]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),c=u.WordArray=d.extend({init:function(v,g){v=this.words=v||[],g!=n?this.sigBytes=g:this.sigBytes=v.length*4},toString:function(v){return(v||f).stringify(this)},concat:function(v){var g=this.words,y=v.words,S=this.sigBytes,b=v.sigBytes;if(this.clamp(),S%4)for(var I=0;I<b;I++){var A=y[I>>>2]>>>24-I%4*8&255;g[S+I>>>2]|=A<<24-(S+I)%4*8}else for(var w=0;w<b;w+=4)g[S+w>>>2]=y[w>>>2];return this.sigBytes+=b,this},clamp:function(){var v=this.words,g=this.sigBytes;v[g>>>2]&=4294967295<<32-g%4*8,v.length=t.ceil(g/4)},clone:function(){var v=d.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var g=[],y=0;y<v;y+=4)g.push(i());return new c.init(g,v)}}),o=s.enc={},f=o.Hex={stringify:function(v){for(var g=v.words,y=v.sigBytes,S=[],b=0;b<y;b++){var I=g[b>>>2]>>>24-b%4*8&255;S.push((I>>>4).toString(16)),S.push((I&15).toString(16))}return S.join("")},parse:function(v){for(var g=v.length,y=[],S=0;S<g;S+=2)y[S>>>3]|=parseInt(v.substr(S,2),16)<<24-S%8*4;return new c.init(y,g/2)}},m=o.Latin1={stringify:function(v){for(var g=v.words,y=v.sigBytes,S=[],b=0;b<y;b++){var I=g[b>>>2]>>>24-b%4*8&255;S.push(String.fromCharCode(I))}return S.join("")},parse:function(v){for(var g=v.length,y=[],S=0;S<g;S++)y[S>>>2]|=(v.charCodeAt(S)&255)<<24-S%4*8;return new c.init(y,g)}},_=o.Utf8={stringify:function(v){try{return decodeURIComponent(escape(m.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return m.parse(unescape(encodeURIComponent(v)))}},x=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=_.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var g,y=this._data,S=y.words,b=y.sigBytes,I=this.blockSize,A=I*4,w=b/A;v?w=t.ceil(w):w=t.max((w|0)-this._minBufferSize,0);var O=w*I,D=t.min(O*4,b);if(O){for(var T=0;T<O;T+=I)this._doProcessBlock(S,T);g=S.splice(0,O),y.sigBytes-=D}return new c.init(g,D)},clone:function(){var v=d.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0}),E=u.Hasher=x.extend({cfg:d.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){x.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var g=this._doFinalize();return g},blockSize:512/32,_createHelper:function(v){return function(g,y){return new v.init(y).finalize(g)}},_createHmacHelper:function(v){return function(g,y){return new C.HMAC.init(v,y).finalize(g)}}}),C=s.algo={};return s})(Math);return e})});var ba=p((Rs,nm)=>{(function(e,t){typeof Rs=="object"?nm.exports=Rs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Rs,function(e){return(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,s=n.x64={},u=s.Word=i.extend({init:function(c,o){this.high=c,this.low=o}}),d=s.WordArray=i.extend({init:function(c,o){c=this.words=c||[],o!=t?this.sigBytes=o:this.sigBytes=c.length*8},toX32:function(){for(var c=this.words,o=c.length,f=[],m=0;m<o;m++){var _=c[m];f.push(_.high),f.push(_.low)}return a.create(f,this.sigBytes)},clone:function(){for(var c=i.clone.call(this),o=c.words=this.words.slice(0),f=o.length,m=0;m<f;m++)o[m]=o[m].clone();return c}})})(),e})});var im=p((Fs,rm)=>{(function(e,t){typeof Fs=="object"?rm.exports=Fs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Fs,function(e){return(function(){if(typeof ArrayBuffer=="function"){var t=e,n=t.lib,r=n.WordArray,i=r.init,a=r.init=function(s){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),(s instanceof Int8Array||typeof Uint8ClampedArray<"u"&&s instanceof Uint8ClampedArray||s instanceof Int16Array||s instanceof Uint16Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Float32Array||s instanceof Float64Array)&&(s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),s instanceof Uint8Array){for(var u=s.byteLength,d=[],c=0;c<u;c++)d[c>>>2]|=s[c]<<24-c%4*8;i.call(this,d,u)}else i.apply(this,arguments)};a.prototype=r}})(),e.lib.WordArray})});var om=p((Ps,am)=>{(function(e,t){typeof Ps=="object"?am.exports=Ps=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ps,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc,a=i.Utf16=i.Utf16BE={stringify:function(u){for(var d=u.words,c=u.sigBytes,o=[],f=0;f<c;f+=2){var m=d[f>>>2]>>>16-f%4*8&65535;o.push(String.fromCharCode(m))}return o.join("")},parse:function(u){for(var d=u.length,c=[],o=0;o<d;o++)c[o>>>1]|=u.charCodeAt(o)<<16-o%2*16;return r.create(c,d*2)}};i.Utf16LE={stringify:function(u){for(var d=u.words,c=u.sigBytes,o=[],f=0;f<c;f+=2){var m=s(d[f>>>2]>>>16-f%4*8&65535);o.push(String.fromCharCode(m))}return o.join("")},parse:function(u){for(var d=u.length,c=[],o=0;o<d;o++)c[o>>>1]|=s(u.charCodeAt(o)<<16-o%2*16);return r.create(c,d*2)}};function s(u){return u<<8&4278255360|u>>>8&16711935}})(),e.enc.Utf16})});var fn=p((Ns,sm)=>{(function(e,t){typeof Ns=="object"?sm.exports=Ns=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ns,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc,a=i.Base64={stringify:function(u){var d=u.words,c=u.sigBytes,o=this._map;u.clamp();for(var f=[],m=0;m<c;m+=3)for(var _=d[m>>>2]>>>24-m%4*8&255,x=d[m+1>>>2]>>>24-(m+1)%4*8&255,E=d[m+2>>>2]>>>24-(m+2)%4*8&255,C=_<<16|x<<8|E,v=0;v<4&&m+v*.75<c;v++)f.push(o.charAt(C>>>6*(3-v)&63));var g=o.charAt(64);if(g)for(;f.length%4;)f.push(g);return f.join("")},parse:function(u){var d=u.length,c=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var f=0;f<c.length;f++)o[c.charCodeAt(f)]=f}var m=c.charAt(64);if(m){var _=u.indexOf(m);_!==-1&&(d=_)}return s(u,d,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(u,d,c){for(var o=[],f=0,m=0;m<d;m++)if(m%4){var _=c[u.charCodeAt(m-1)]<<m%4*2,x=c[u.charCodeAt(m)]>>>6-m%4*2,E=_|x;o[f>>>2]|=E<<24-f%4*8,f++}return r.create(o,f)}})(),e.enc.Base64})});var cm=p((Ms,um)=>{(function(e,t){typeof Ms=="object"?um.exports=Ms=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ms,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=t.enc,a=i.Base64url={stringify:function(u,d){d===void 0&&(d=!0);var c=u.words,o=u.sigBytes,f=d?this._safe_map:this._map;u.clamp();for(var m=[],_=0;_<o;_+=3)for(var x=c[_>>>2]>>>24-_%4*8&255,E=c[_+1>>>2]>>>24-(_+1)%4*8&255,C=c[_+2>>>2]>>>24-(_+2)%4*8&255,v=x<<16|E<<8|C,g=0;g<4&&_+g*.75<o;g++)m.push(f.charAt(v>>>6*(3-g)&63));var y=f.charAt(64);if(y)for(;m.length%4;)m.push(y);return m.join("")},parse:function(u,d){d===void 0&&(d=!0);var c=u.length,o=d?this._safe_map:this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var m=0;m<o.length;m++)f[o.charCodeAt(m)]=m}var _=o.charAt(64);if(_){var x=u.indexOf(_);x!==-1&&(c=x)}return s(u,c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(u,d,c){for(var o=[],f=0,m=0;m<d;m++)if(m%4){var _=c[u.charCodeAt(m-1)]<<m%4*2,x=c[u.charCodeAt(m)]>>>6-m%4*2,E=_|x;o[f>>>2]|=E<<24-f%4*8,f++}return r.create(o,f)}})(),e.enc.Base64url})});var hn=p((Bs,dm)=>{(function(e,t){typeof Bs=="object"?dm.exports=Bs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Bs,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,s=n.algo,u=[];(function(){for(var _=0;_<64;_++)u[_]=t.abs(t.sin(_+1))*4294967296|0})();var d=s.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(_,x){for(var E=0;E<16;E++){var C=x+E,v=_[C];_[C]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360}var g=this._hash.words,y=_[x+0],S=_[x+1],b=_[x+2],I=_[x+3],A=_[x+4],w=_[x+5],O=_[x+6],D=_[x+7],T=_[x+8],N=_[x+9],J=_[x+10],F=_[x+11],V=_[x+12],H=_[x+13],Z=_[x+14],j=_[x+15],R=g[0],M=g[1],B=g[2],P=g[3];R=c(R,M,B,P,y,7,u[0]),P=c(P,R,M,B,S,12,u[1]),B=c(B,P,R,M,b,17,u[2]),M=c(M,B,P,R,I,22,u[3]),R=c(R,M,B,P,A,7,u[4]),P=c(P,R,M,B,w,12,u[5]),B=c(B,P,R,M,O,17,u[6]),M=c(M,B,P,R,D,22,u[7]),R=c(R,M,B,P,T,7,u[8]),P=c(P,R,M,B,N,12,u[9]),B=c(B,P,R,M,J,17,u[10]),M=c(M,B,P,R,F,22,u[11]),R=c(R,M,B,P,V,7,u[12]),P=c(P,R,M,B,H,12,u[13]),B=c(B,P,R,M,Z,17,u[14]),M=c(M,B,P,R,j,22,u[15]),R=o(R,M,B,P,S,5,u[16]),P=o(P,R,M,B,O,9,u[17]),B=o(B,P,R,M,F,14,u[18]),M=o(M,B,P,R,y,20,u[19]),R=o(R,M,B,P,w,5,u[20]),P=o(P,R,M,B,J,9,u[21]),B=o(B,P,R,M,j,14,u[22]),M=o(M,B,P,R,A,20,u[23]),R=o(R,M,B,P,N,5,u[24]),P=o(P,R,M,B,Z,9,u[25]),B=o(B,P,R,M,I,14,u[26]),M=o(M,B,P,R,T,20,u[27]),R=o(R,M,B,P,H,5,u[28]),P=o(P,R,M,B,b,9,u[29]),B=o(B,P,R,M,D,14,u[30]),M=o(M,B,P,R,V,20,u[31]),R=f(R,M,B,P,w,4,u[32]),P=f(P,R,M,B,T,11,u[33]),B=f(B,P,R,M,F,16,u[34]),M=f(M,B,P,R,Z,23,u[35]),R=f(R,M,B,P,S,4,u[36]),P=f(P,R,M,B,A,11,u[37]),B=f(B,P,R,M,D,16,u[38]),M=f(M,B,P,R,J,23,u[39]),R=f(R,M,B,P,H,4,u[40]),P=f(P,R,M,B,y,11,u[41]),B=f(B,P,R,M,I,16,u[42]),M=f(M,B,P,R,O,23,u[43]),R=f(R,M,B,P,N,4,u[44]),P=f(P,R,M,B,V,11,u[45]),B=f(B,P,R,M,j,16,u[46]),M=f(M,B,P,R,b,23,u[47]),R=m(R,M,B,P,y,6,u[48]),P=m(P,R,M,B,D,10,u[49]),B=m(B,P,R,M,Z,15,u[50]),M=m(M,B,P,R,w,21,u[51]),R=m(R,M,B,P,V,6,u[52]),P=m(P,R,M,B,I,10,u[53]),B=m(B,P,R,M,J,15,u[54]),M=m(M,B,P,R,S,21,u[55]),R=m(R,M,B,P,T,6,u[56]),P=m(P,R,M,B,j,10,u[57]),B=m(B,P,R,M,O,15,u[58]),M=m(M,B,P,R,H,21,u[59]),R=m(R,M,B,P,A,6,u[60]),P=m(P,R,M,B,F,10,u[61]),B=m(B,P,R,M,b,15,u[62]),M=m(M,B,P,R,N,21,u[63]),g[0]=g[0]+R|0,g[1]=g[1]+M|0,g[2]=g[2]+B|0,g[3]=g[3]+P|0},_doFinalize:function(){var _=this._data,x=_.words,E=this._nDataBytes*8,C=_.sigBytes*8;x[C>>>5]|=128<<24-C%32;var v=t.floor(E/4294967296),g=E;x[(C+64>>>9<<4)+15]=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,x[(C+64>>>9<<4)+14]=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,_.sigBytes=(x.length+1)*4,this._process();for(var y=this._hash,S=y.words,b=0;b<4;b++){var I=S[b];S[b]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360}return y},clone:function(){var _=a.clone.call(this);return _._hash=this._hash.clone(),_}});function c(_,x,E,C,v,g,y){var S=_+(x&E|~x&C)+v+y;return(S<<g|S>>>32-g)+x}function o(_,x,E,C,v,g,y){var S=_+(x&C|E&~C)+v+y;return(S<<g|S>>>32-g)+x}function f(_,x,E,C,v,g,y){var S=_+(x^E^C)+v+y;return(S<<g|S>>>32-g)+x}function m(_,x,E,C,v,g,y){var S=_+(E^(x|~C))+v+y;return(S<<g|S>>>32-g)+x}n.MD5=a._createHelper(d),n.HmacMD5=a._createHmacHelper(d)})(Math),e.MD5})});var Z0=p((qs,lm)=>{(function(e,t){typeof qs=="object"?lm.exports=qs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(qs,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,s=[],u=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,c){for(var o=this._hash.words,f=o[0],m=o[1],_=o[2],x=o[3],E=o[4],C=0;C<80;C++){if(C<16)s[C]=d[c+C]|0;else{var v=s[C-3]^s[C-8]^s[C-14]^s[C-16];s[C]=v<<1|v>>>31}var g=(f<<5|f>>>27)+E+s[C];C<20?g+=(m&_|~m&x)+1518500249:C<40?g+=(m^_^x)+1859775393:C<60?g+=(m&_|m&x|_&x)-1894007588:g+=(m^_^x)-899497514,E=x,x=_,_=m<<30|m>>>2,m=f,f=g}o[0]=o[0]+f|0,o[1]=o[1]+m|0,o[2]=o[2]+_|0,o[3]=o[3]+x|0,o[4]=o[4]+E|0},_doFinalize:function(){var d=this._data,c=d.words,o=this._nDataBytes*8,f=d.sigBytes*8;return c[f>>>5]|=128<<24-f%32,c[(f+64>>>9<<4)+14]=Math.floor(o/4294967296),c[(f+64>>>9<<4)+15]=o,d.sigBytes=c.length*4,this._process(),this._hash},clone:function(){var d=i.clone.call(this);return d._hash=this._hash.clone(),d}});t.SHA1=i._createHelper(u),t.HmacSHA1=i._createHmacHelper(u)})(),e.SHA1})});var Js=p((ks,fm)=>{(function(e,t){typeof ks=="object"?fm.exports=ks=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(ks,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,s=n.algo,u=[],d=[];(function(){function f(E){for(var C=t.sqrt(E),v=2;v<=C;v++)if(!(E%v))return!1;return!0}function m(E){return(E-(E|0))*4294967296|0}for(var _=2,x=0;x<64;)f(_)&&(x<8&&(u[x]=m(t.pow(_,1/2))),d[x]=m(t.pow(_,1/3)),x++),_++})();var c=[],o=s.SHA256=a.extend({_doReset:function(){this._hash=new i.init(u.slice(0))},_doProcessBlock:function(f,m){for(var _=this._hash.words,x=_[0],E=_[1],C=_[2],v=_[3],g=_[4],y=_[5],S=_[6],b=_[7],I=0;I<64;I++){if(I<16)c[I]=f[m+I]|0;else{var A=c[I-15],w=(A<<25|A>>>7)^(A<<14|A>>>18)^A>>>3,O=c[I-2],D=(O<<15|O>>>17)^(O<<13|O>>>19)^O>>>10;c[I]=w+c[I-7]+D+c[I-16]}var T=g&y^~g&S,N=x&E^x&C^E&C,J=(x<<30|x>>>2)^(x<<19|x>>>13)^(x<<10|x>>>22),F=(g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25),V=b+F+T+d[I]+c[I],H=J+N;b=S,S=y,y=g,g=v+V|0,v=C,C=E,E=x,x=V+H|0}_[0]=_[0]+x|0,_[1]=_[1]+E|0,_[2]=_[2]+C|0,_[3]=_[3]+v|0,_[4]=_[4]+g|0,_[5]=_[5]+y|0,_[6]=_[6]+S|0,_[7]=_[7]+b|0},_doFinalize:function(){var f=this._data,m=f.words,_=this._nDataBytes*8,x=f.sigBytes*8;return m[x>>>5]|=128<<24-x%32,m[(x+64>>>9<<4)+14]=t.floor(_/4294967296),m[(x+64>>>9<<4)+15]=_,f.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var f=a.clone.call(this);return f._hash=this._hash.clone(),f}});n.SHA256=a._createHelper(o),n.HmacSHA256=a._createHmacHelper(o)})(Math),e.SHA256})});var pm=p((Ls,hm)=>{(function(e,t,n){typeof Ls=="object"?hm.exports=Ls=t(X(),Js()):typeof define=="function"&&define.amd?define(["./core","./sha256"],t):t(e.CryptoJS)})(Ls,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=t.algo,a=i.SHA256,s=i.SHA224=a.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=a._doFinalize.call(this);return u.sigBytes-=4,u}});t.SHA224=a._createHelper(s),t.HmacSHA224=a._createHmacHelper(s)})(),e.SHA224})});var Q0=p((Us,vm)=>{(function(e,t,n){typeof Us=="object"?vm.exports=Us=t(X(),ba()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],t):t(e.CryptoJS)})(Us,function(e){return(function(){var t=e,n=t.lib,r=n.Hasher,i=t.x64,a=i.Word,s=i.WordArray,u=t.algo;function d(){return a.create.apply(a,arguments)}var c=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],o=[];(function(){for(var m=0;m<80;m++)o[m]=d()})();var f=u.SHA512=r.extend({_doReset:function(){this._hash=new s.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(m,_){for(var x=this._hash.words,E=x[0],C=x[1],v=x[2],g=x[3],y=x[4],S=x[5],b=x[6],I=x[7],A=E.high,w=E.low,O=C.high,D=C.low,T=v.high,N=v.low,J=g.high,F=g.low,V=y.high,H=y.low,Z=S.high,j=S.low,R=b.high,M=b.low,B=I.high,P=I.low,de=A,se=w,Me=O,Q=D,ma=T,Hr=N,J0=J,ga=F,st=V,We=H,_s=Z,_a=j,xs=R,xa=M,L0=B,Sa=P,ut=0;ut<80;ut++){var $e,on,Ss=o[ut];if(ut<16)on=Ss.high=m[_+ut*2]|0,$e=Ss.low=m[_+ut*2+1]|0;else{var wv=o[ut-15],Vr=wv.high,ya=wv.low,JT=(Vr>>>1|ya<<31)^(Vr>>>8|ya<<24)^Vr>>>7,Ov=(ya>>>1|Vr<<31)^(ya>>>8|Vr<<24)^(ya>>>7|Vr<<25),Dv=o[ut-2],Kr=Dv.high,Ca=Dv.low,LT=(Kr>>>19|Ca<<13)^(Kr<<3|Ca>>>29)^Kr>>>6,Rv=(Ca>>>19|Kr<<13)^(Ca<<3|Kr>>>29)^(Ca>>>6|Kr<<26),Fv=o[ut-7],UT=Fv.high,WT=Fv.low,Pv=o[ut-16],HT=Pv.high,Nv=Pv.low;$e=Ov+WT,on=JT+UT+($e>>>0<Ov>>>0?1:0),$e=$e+Rv,on=on+LT+($e>>>0<Rv>>>0?1:0),$e=$e+Nv,on=on+HT+($e>>>0<Nv>>>0?1:0),Ss.high=on,Ss.low=$e}var VT=st&_s^~st&xs,Mv=We&_a^~We&xa,KT=de&Me^de&ma^Me&ma,zT=se&Q^se&Hr^Q&Hr,GT=(de>>>28|se<<4)^(de<<30|se>>>2)^(de<<25|se>>>7),Bv=(se>>>28|de<<4)^(se<<30|de>>>2)^(se<<25|de>>>7),ZT=(st>>>14|We<<18)^(st>>>18|We<<14)^(st<<23|We>>>9),QT=(We>>>14|st<<18)^(We>>>18|st<<14)^(We<<23|st>>>9),qv=c[ut],YT=qv.high,kv=qv.low,He=Sa+QT,sn=L0+ZT+(He>>>0<Sa>>>0?1:0),He=He+Mv,sn=sn+VT+(He>>>0<Mv>>>0?1:0),He=He+kv,sn=sn+YT+(He>>>0<kv>>>0?1:0),He=He+$e,sn=sn+on+(He>>>0<$e>>>0?1:0),Jv=Bv+zT,$T=GT+KT+(Jv>>>0<Bv>>>0?1:0);L0=xs,Sa=xa,xs=_s,xa=_a,_s=st,_a=We,We=ga+He|0,st=J0+sn+(We>>>0<ga>>>0?1:0)|0,J0=ma,ga=Hr,ma=Me,Hr=Q,Me=de,Q=se,se=He+Jv|0,de=sn+$T+(se>>>0<He>>>0?1:0)|0}w=E.low=w+se,E.high=A+de+(w>>>0<se>>>0?1:0),D=C.low=D+Q,C.high=O+Me+(D>>>0<Q>>>0?1:0),N=v.low=N+Hr,v.high=T+ma+(N>>>0<Hr>>>0?1:0),F=g.low=F+ga,g.high=J+J0+(F>>>0<ga>>>0?1:0),H=y.low=H+We,y.high=V+st+(H>>>0<We>>>0?1:0),j=S.low=j+_a,S.high=Z+_s+(j>>>0<_a>>>0?1:0),M=b.low=M+xa,b.high=R+xs+(M>>>0<xa>>>0?1:0),P=I.low=P+Sa,I.high=B+L0+(P>>>0<Sa>>>0?1:0)},_doFinalize:function(){var m=this._data,_=m.words,x=this._nDataBytes*8,E=m.sigBytes*8;_[E>>>5]|=128<<24-E%32,_[(E+128>>>10<<5)+30]=Math.floor(x/4294967296),_[(E+128>>>10<<5)+31]=x,m.sigBytes=_.length*4,this._process();var C=this._hash.toX32();return C},clone:function(){var m=r.clone.call(this);return m._hash=this._hash.clone(),m},blockSize:1024/32});t.SHA512=r._createHelper(f),t.HmacSHA512=r._createHmacHelper(f)})(),e.SHA512})});var gm=p((Ws,mm)=>{(function(e,t,n){typeof Ws=="object"?mm.exports=Ws=t(X(),ba(),Q0()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],t):t(e.CryptoJS)})(Ws,function(e){return(function(){var t=e,n=t.x64,r=n.Word,i=n.WordArray,a=t.algo,s=a.SHA512,u=a.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var d=s._doFinalize.call(this);return d.sigBytes-=16,d}});t.SHA384=s._createHelper(u),t.HmacSHA384=s._createHmacHelper(u)})(),e.SHA384})});var xm=p((Hs,_m)=>{(function(e,t,n){typeof Hs=="object"?_m.exports=Hs=t(X(),ba()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],t):t(e.CryptoJS)})(Hs,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,s=n.x64,u=s.Word,d=n.algo,c=[],o=[],f=[];(function(){for(var x=1,E=0,C=0;C<24;C++){c[x+5*E]=(C+1)*(C+2)/2%64;var v=E%5,g=(2*x+3*E)%5;x=v,E=g}for(var x=0;x<5;x++)for(var E=0;E<5;E++)o[x+5*E]=E+(2*x+3*E)%5*5;for(var y=1,S=0;S<24;S++){for(var b=0,I=0,A=0;A<7;A++){if(y&1){var w=(1<<A)-1;w<32?I^=1<<w:b^=1<<w-32}y&128?y=y<<1^113:y<<=1}f[S]=u.create(b,I)}})();var m=[];(function(){for(var x=0;x<25;x++)m[x]=u.create()})();var _=d.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var x=this._state=[],E=0;E<25;E++)x[E]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(x,E){for(var C=this._state,v=this.blockSize/2,g=0;g<v;g++){var y=x[E+2*g],S=x[E+2*g+1];y=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var b=C[g];b.high^=S,b.low^=y}for(var I=0;I<24;I++){for(var A=0;A<5;A++){for(var w=0,O=0,D=0;D<5;D++){var b=C[A+5*D];w^=b.high,O^=b.low}var T=m[A];T.high=w,T.low=O}for(var A=0;A<5;A++)for(var N=m[(A+4)%5],J=m[(A+1)%5],F=J.high,V=J.low,w=N.high^(F<<1|V>>>31),O=N.low^(V<<1|F>>>31),D=0;D<5;D++){var b=C[A+5*D];b.high^=w,b.low^=O}for(var H=1;H<25;H++){var w,O,b=C[H],Z=b.high,j=b.low,R=c[H];R<32?(w=Z<<R|j>>>32-R,O=j<<R|Z>>>32-R):(w=j<<R-32|Z>>>64-R,O=Z<<R-32|j>>>64-R);var M=m[o[H]];M.high=w,M.low=O}var B=m[0],P=C[0];B.high=P.high,B.low=P.low;for(var A=0;A<5;A++)for(var D=0;D<5;D++){var H=A+5*D,b=C[H],de=m[H],se=m[(A+1)%5+5*D],Me=m[(A+2)%5+5*D];b.high=de.high^~se.high&Me.high,b.low=de.low^~se.low&Me.low}var b=C[0],Q=f[I];b.high^=Q.high,b.low^=Q.low}},_doFinalize:function(){var x=this._data,E=x.words,C=this._nDataBytes*8,v=x.sigBytes*8,g=this.blockSize*32;E[v>>>5]|=1<<24-v%32,E[(t.ceil((v+1)/g)*g>>>5)-1]|=128,x.sigBytes=E.length*4,this._process();for(var y=this._state,S=this.cfg.outputLength/8,b=S/8,I=[],A=0;A<b;A++){var w=y[A],O=w.high,D=w.low;O=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,I.push(D),I.push(O)}return new i.init(I,S)},clone:function(){for(var x=a.clone.call(this),E=x._state=this._state.slice(0),C=0;C<25;C++)E[C]=E[C].clone();return x}});n.SHA3=a._createHelper(_),n.HmacSHA3=a._createHmacHelper(_)})(Math),e.SHA3})});var ym=p((Vs,Sm)=>{(function(e,t){typeof Vs=="object"?Sm.exports=Vs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Vs,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,s=n.algo,u=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),o=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),m=i.create([1352829926,1548603684,1836072691,2053994217,0]),_=s.RIPEMD160=a.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,b){for(var I=0;I<16;I++){var A=b+I,w=S[A];S[A]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360}var O=this._hash.words,D=f.words,T=m.words,N=u.words,J=d.words,F=c.words,V=o.words,H,Z,j,R,M,B,P,de,se,Me;B=H=O[0],P=Z=O[1],de=j=O[2],se=R=O[3],Me=M=O[4];for(var Q,I=0;I<80;I+=1)Q=H+S[b+N[I]]|0,I<16?Q+=x(Z,j,R)+D[0]:I<32?Q+=E(Z,j,R)+D[1]:I<48?Q+=C(Z,j,R)+D[2]:I<64?Q+=v(Z,j,R)+D[3]:Q+=g(Z,j,R)+D[4],Q=Q|0,Q=y(Q,F[I]),Q=Q+M|0,H=M,M=R,R=y(j,10),j=Z,Z=Q,Q=B+S[b+J[I]]|0,I<16?Q+=g(P,de,se)+T[0]:I<32?Q+=v(P,de,se)+T[1]:I<48?Q+=C(P,de,se)+T[2]:I<64?Q+=E(P,de,se)+T[3]:Q+=x(P,de,se)+T[4],Q=Q|0,Q=y(Q,V[I]),Q=Q+Me|0,B=Me,Me=se,se=y(de,10),de=P,P=Q;Q=O[1]+j+se|0,O[1]=O[2]+R+Me|0,O[2]=O[3]+M+B|0,O[3]=O[4]+H+P|0,O[4]=O[0]+Z+de|0,O[0]=Q},_doFinalize:function(){var S=this._data,b=S.words,I=this._nDataBytes*8,A=S.sigBytes*8;b[A>>>5]|=128<<24-A%32,b[(A+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,S.sigBytes=(b.length+1)*4,this._process();for(var w=this._hash,O=w.words,D=0;D<5;D++){var T=O[D];O[D]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}return w},clone:function(){var S=a.clone.call(this);return S._hash=this._hash.clone(),S}});function x(S,b,I){return S^b^I}function E(S,b,I){return S&b|~S&I}function C(S,b,I){return(S|~b)^I}function v(S,b,I){return S&I|b&~I}function g(S,b,I){return S^(b|~I)}function y(S,b){return S<<b|S>>>32-b}n.RIPEMD160=a._createHelper(_),n.HmacRIPEMD160=a._createHmacHelper(_)})(Math),e.RIPEMD160})});var zs=p((Ks,Cm)=>{(function(e,t){typeof Ks=="object"?Cm.exports=Ks=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ks,function(e){(function(){var t=e,n=t.lib,r=n.Base,i=t.enc,a=i.Utf8,s=t.algo,u=s.HMAC=r.extend({init:function(d,c){d=this._hasher=new d.init,typeof c=="string"&&(c=a.parse(c));var o=d.blockSize,f=o*4;c.sigBytes>f&&(c=d.finalize(c)),c.clamp();for(var m=this._oKey=c.clone(),_=this._iKey=c.clone(),x=m.words,E=_.words,C=0;C<o;C++)x[C]^=1549556828,E[C]^=909522486;m.sigBytes=_.sigBytes=f,this.reset()},reset:function(){var d=this._hasher;d.reset(),d.update(this._iKey)},update:function(d){return this._hasher.update(d),this},finalize:function(d){var c=this._hasher,o=c.finalize(d);c.reset();var f=c.finalize(this._oKey.clone().concat(o));return f}})})()})});var bm=p((Gs,Em)=>{(function(e,t,n){typeof Gs=="object"?Em.exports=Gs=t(X(),Js(),zs()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],t):t(e.CryptoJS)})(Gs,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,s=a.SHA256,u=a.HMAC,d=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:s,iterations:25e4}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,o){for(var f=this.cfg,m=u.create(f.hasher,c),_=i.create(),x=i.create([1]),E=_.words,C=x.words,v=f.keySize,g=f.iterations;E.length<v;){var y=m.update(o).finalize(x);m.reset();for(var S=y.words,b=S.length,I=y,A=1;A<g;A++){I=m.finalize(I),m.reset();for(var w=I.words,O=0;O<b;O++)S[O]^=w[O]}_.concat(y),C[0]++}return _.sigBytes=v*4,_}});t.PBKDF2=function(c,o,f){return d.create(f).compute(c,o)}})(),e.PBKDF2})});var Ut=p((Zs,Im)=>{(function(e,t,n){typeof Zs=="object"?Im.exports=Zs=t(X(),Z0(),zs()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],t):t(e.CryptoJS)})(Zs,function(e){return(function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,s=a.MD5,u=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:s,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,c){for(var o,f=this.cfg,m=f.hasher.create(),_=i.create(),x=_.words,E=f.keySize,C=f.iterations;x.length<E;){o&&m.update(o),o=m.update(d).finalize(c),m.reset();for(var v=1;v<C;v++)o=m.finalize(o),m.reset();_.concat(o)}return _.sigBytes=E*4,_}});t.EvpKDF=function(d,c,o){return u.create(o).compute(d,c)}})(),e.EvpKDF})});var ye=p((Qs,Tm)=>{(function(e,t,n){typeof Qs=="object"?Tm.exports=Qs=t(X(),Ut()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],t):t(e.CryptoJS)})(Qs,function(e){e.lib.Cipher||(function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,s=r.BufferedBlockAlgorithm,u=n.enc,d=u.Utf8,c=u.Base64,o=n.algo,f=o.EvpKDF,m=r.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(T,N){return this.create(this._ENC_XFORM_MODE,T,N)},createDecryptor:function(T,N){return this.create(this._DEC_XFORM_MODE,T,N)},init:function(T,N,J){this.cfg=this.cfg.extend(J),this._xformMode=T,this._key=N,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(T){return this._append(T),this._process()},finalize:function(T){T&&this._append(T);var N=this._doFinalize();return N},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:(function(){function T(N){return typeof N=="string"?D:A}return function(N){return{encrypt:function(J,F,V){return T(F).encrypt(N,J,F,V)},decrypt:function(J,F,V){return T(F).decrypt(N,J,F,V)}}}})()}),_=r.StreamCipher=m.extend({_doFinalize:function(){var T=this._process(!0);return T},blockSize:1}),x=n.mode={},E=r.BlockCipherMode=i.extend({createEncryptor:function(T,N){return this.Encryptor.create(T,N)},createDecryptor:function(T,N){return this.Decryptor.create(T,N)},init:function(T,N){this._cipher=T,this._iv=N}}),C=x.CBC=(function(){var T=E.extend();T.Encryptor=T.extend({processBlock:function(J,F){var V=this._cipher,H=V.blockSize;N.call(this,J,F,H),V.encryptBlock(J,F),this._prevBlock=J.slice(F,F+H)}}),T.Decryptor=T.extend({processBlock:function(J,F){var V=this._cipher,H=V.blockSize,Z=J.slice(F,F+H);V.decryptBlock(J,F),N.call(this,J,F,H),this._prevBlock=Z}});function N(J,F,V){var H,Z=this._iv;Z?(H=Z,this._iv=t):H=this._prevBlock;for(var j=0;j<V;j++)J[F+j]^=H[j]}return T})(),v=n.pad={},g=v.Pkcs7={pad:function(T,N){for(var J=N*4,F=J-T.sigBytes%J,V=F<<24|F<<16|F<<8|F,H=[],Z=0;Z<F;Z+=4)H.push(V);var j=a.create(H,F);T.concat(j)},unpad:function(T){var N=T.words[T.sigBytes-1>>>2]&255;T.sigBytes-=N}},y=r.BlockCipher=m.extend({cfg:m.cfg.extend({mode:C,padding:g}),reset:function(){var T;m.reset.call(this);var N=this.cfg,J=N.iv,F=N.mode;this._xformMode==this._ENC_XFORM_MODE?T=F.createEncryptor:(T=F.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==T?this._mode.init(this,J&&J.words):(this._mode=T.call(F,this,J&&J.words),this._mode.__creator=T)},_doProcessBlock:function(T,N){this._mode.processBlock(T,N)},_doFinalize:function(){var T,N=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(N.pad(this._data,this.blockSize),T=this._process(!0)):(T=this._process(!0),N.unpad(T)),T},blockSize:128/32}),S=r.CipherParams=i.extend({init:function(T){this.mixIn(T)},toString:function(T){return(T||this.formatter).stringify(this)}}),b=n.format={},I=b.OpenSSL={stringify:function(T){var N,J=T.ciphertext,F=T.salt;return F?N=a.create([1398893684,1701076831]).concat(F).concat(J):N=J,N.toString(c)},parse:function(T){var N,J=c.parse(T),F=J.words;return F[0]==1398893684&&F[1]==1701076831&&(N=a.create(F.slice(2,4)),F.splice(0,4),J.sigBytes-=16),S.create({ciphertext:J,salt:N})}},A=r.SerializableCipher=i.extend({cfg:i.extend({format:I}),encrypt:function(T,N,J,F){F=this.cfg.extend(F);var V=T.createEncryptor(J,F),H=V.finalize(N),Z=V.cfg;return S.create({ciphertext:H,key:J,iv:Z.iv,algorithm:T,mode:Z.mode,padding:Z.padding,blockSize:T.blockSize,formatter:F.format})},decrypt:function(T,N,J,F){F=this.cfg.extend(F),N=this._parse(N,F.format);var V=T.createDecryptor(J,F).finalize(N.ciphertext);return V},_parse:function(T,N){return typeof T=="string"?N.parse(T,this):T}}),w=n.kdf={},O=w.OpenSSL={execute:function(T,N,J,F,V){if(F||(F=a.random(64/8)),V)var H=f.create({keySize:N+J,hasher:V}).compute(T,F);else var H=f.create({keySize:N+J}).compute(T,F);var Z=a.create(H.words.slice(N),J*4);return H.sigBytes=N*4,S.create({key:H,iv:Z,salt:F})}},D=r.PasswordBasedCipher=A.extend({cfg:A.cfg.extend({kdf:O}),encrypt:function(T,N,J,F){F=this.cfg.extend(F);var V=F.kdf.execute(J,T.keySize,T.ivSize,F.salt,F.hasher);F.iv=V.iv;var H=A.encrypt.call(this,T,N,V.key,F);return H.mixIn(V),H},decrypt:function(T,N,J,F){F=this.cfg.extend(F),N=this._parse(N,F.format);var V=F.kdf.execute(J,T.keySize,T.ivSize,N.salt,F.hasher);F.iv=V.iv;var H=A.decrypt.call(this,T,N,V.key,F);return H}})})()})});var wm=p((Ys,Am)=>{(function(e,t,n){typeof Ys=="object"?Am.exports=Ys=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(Ys,function(e){return e.mode.CFB=(function(){var t=e.lib.BlockCipherMode.extend();t.Encryptor=t.extend({processBlock:function(r,i){var a=this._cipher,s=a.blockSize;n.call(this,r,i,s,a),this._prevBlock=r.slice(i,i+s)}}),t.Decryptor=t.extend({processBlock:function(r,i){var a=this._cipher,s=a.blockSize,u=r.slice(i,i+s);n.call(this,r,i,s,a),this._prevBlock=u}});function n(r,i,a,s){var u,d=this._iv;d?(u=d.slice(0),this._iv=void 0):u=this._prevBlock,s.encryptBlock(u,0);for(var c=0;c<a;c++)r[i+c]^=u[c]}return t})(),e.mode.CFB})});var Dm=p(($s,Om)=>{(function(e,t,n){typeof $s=="object"?Om.exports=$s=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})($s,function(e){return e.mode.CTR=(function(){var t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(r,i){var a=this._cipher,s=a.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0);var c=d.slice(0);a.encryptBlock(c,0),d[s-1]=d[s-1]+1|0;for(var o=0;o<s;o++)r[i+o]^=c[o]}});return t.Decryptor=n,t})(),e.mode.CTR})});var Fm=p((Xs,Rm)=>{(function(e,t,n){typeof Xs=="object"?Rm.exports=Xs=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(Xs,function(e){return e.mode.CTRGladman=(function(){var t=e.lib.BlockCipherMode.extend();function n(a){if((a>>24&255)===255){var s=a>>16&255,u=a>>8&255,d=a&255;s===255?(s=0,u===255?(u=0,d===255?d=0:++d):++u):++s,a=0,a+=s<<16,a+=u<<8,a+=d}else a+=1<<24;return a}function r(a){return(a[0]=n(a[0]))===0&&(a[1]=n(a[1])),a}var i=t.Encryptor=t.extend({processBlock:function(a,s){var u=this._cipher,d=u.blockSize,c=this._iv,o=this._counter;c&&(o=this._counter=c.slice(0),this._iv=void 0),r(o);var f=o.slice(0);u.encryptBlock(f,0);for(var m=0;m<d;m++)a[s+m]^=f[m]}});return t.Decryptor=i,t})(),e.mode.CTRGladman})});var Nm=p((js,Pm)=>{(function(e,t,n){typeof js=="object"?Pm.exports=js=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(js,function(e){return e.mode.OFB=(function(){var t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(r,i){var a=this._cipher,s=a.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),a.encryptBlock(d,0);for(var c=0;c<s;c++)r[i+c]^=d[c]}});return t.Decryptor=n,t})(),e.mode.OFB})});var Bm=p((eu,Mm)=>{(function(e,t,n){typeof eu=="object"?Mm.exports=eu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(eu,function(e){return e.mode.ECB=(function(){var t=e.lib.BlockCipherMode.extend();return t.Encryptor=t.extend({processBlock:function(n,r){this._cipher.encryptBlock(n,r)}}),t.Decryptor=t.extend({processBlock:function(n,r){this._cipher.decryptBlock(n,r)}}),t})(),e.mode.ECB})});var km=p((tu,qm)=>{(function(e,t,n){typeof tu=="object"?qm.exports=tu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(tu,function(e){return e.pad.AnsiX923={pad:function(t,n){var r=t.sigBytes,i=n*4,a=i-r%i,s=r+a-1;t.clamp(),t.words[s>>>2]|=a<<24-s%4*8,t.sigBytes+=a},unpad:function(t){var n=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=n}},e.pad.Ansix923})});var Lm=p((nu,Jm)=>{(function(e,t,n){typeof nu=="object"?Jm.exports=nu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(nu,function(e){return e.pad.Iso10126={pad:function(t,n){var r=n*4,i=r-t.sigBytes%r;t.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(t){var n=t.words[t.sigBytes-1>>>2]&255;t.sigBytes-=n}},e.pad.Iso10126})});var Wm=p((ru,Um)=>{(function(e,t,n){typeof ru=="object"?Um.exports=ru=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(ru,function(e){return e.pad.Iso97971={pad:function(t,n){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,n)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971})});var Vm=p((iu,Hm)=>{(function(e,t,n){typeof iu=="object"?Hm.exports=iu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(iu,function(e){return e.pad.ZeroPadding={pad:function(t,n){var r=n*4;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){for(var n=t.words,r=t.sigBytes-1,r=t.sigBytes-1;r>=0;r--)if(n[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},e.pad.ZeroPadding})});var zm=p((au,Km)=>{(function(e,t,n){typeof au=="object"?Km.exports=au=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(au,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})});var Zm=p((ou,Gm)=>{(function(e,t,n){typeof ou=="object"?Gm.exports=ou=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(ou,function(e){return(function(t){var n=e,r=n.lib,i=r.CipherParams,a=n.enc,s=a.Hex,u=n.format,d=u.Hex={stringify:function(c){return c.ciphertext.toString(s)},parse:function(c){var o=s.parse(c);return i.create({ciphertext:o})}}})(),e.format.Hex})});var Ym=p((su,Qm)=>{(function(e,t,n){typeof su=="object"?Qm.exports=su=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(su,function(e){return(function(){var t=e,n=t.lib,r=n.BlockCipher,i=t.algo,a=[],s=[],u=[],d=[],c=[],o=[],f=[],m=[],_=[],x=[];(function(){for(var v=[],g=0;g<256;g++)g<128?v[g]=g<<1:v[g]=g<<1^283;for(var y=0,S=0,g=0;g<256;g++){var b=S^S<<1^S<<2^S<<3^S<<4;b=b>>>8^b&255^99,a[y]=b,s[b]=y;var I=v[y],A=v[I],w=v[A],O=v[b]*257^b*16843008;u[y]=O<<24|O>>>8,d[y]=O<<16|O>>>16,c[y]=O<<8|O>>>24,o[y]=O;var O=w*16843009^A*65537^I*257^y*16843008;f[b]=O<<24|O>>>8,m[b]=O<<16|O>>>16,_[b]=O<<8|O>>>24,x[b]=O,y?(y=I^v[v[v[w^I]]],S^=v[v[S]]):y=S=1}})();var E=[0,1,2,4,8,16,32,64,128,27,54],C=i.AES=r.extend({_doReset:function(){var v;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var g=this._keyPriorReset=this._key,y=g.words,S=g.sigBytes/4,b=this._nRounds=S+6,I=(b+1)*4,A=this._keySchedule=[],w=0;w<I;w++)w<S?A[w]=y[w]:(v=A[w-1],w%S?S>6&&w%S==4&&(v=a[v>>>24]<<24|a[v>>>16&255]<<16|a[v>>>8&255]<<8|a[v&255]):(v=v<<8|v>>>24,v=a[v>>>24]<<24|a[v>>>16&255]<<16|a[v>>>8&255]<<8|a[v&255],v^=E[w/S|0]<<24),A[w]=A[w-S]^v);for(var O=this._invKeySchedule=[],D=0;D<I;D++){var w=I-D;if(D%4)var v=A[w];else var v=A[w-4];D<4||w<=4?O[D]=v:O[D]=f[a[v>>>24]]^m[a[v>>>16&255]]^_[a[v>>>8&255]]^x[a[v&255]]}}},encryptBlock:function(v,g){this._doCryptBlock(v,g,this._keySchedule,u,d,c,o,a)},decryptBlock:function(v,g){var y=v[g+1];v[g+1]=v[g+3],v[g+3]=y,this._doCryptBlock(v,g,this._invKeySchedule,f,m,_,x,s);var y=v[g+1];v[g+1]=v[g+3],v[g+3]=y},_doCryptBlock:function(v,g,y,S,b,I,A,w){for(var O=this._nRounds,D=v[g]^y[0],T=v[g+1]^y[1],N=v[g+2]^y[2],J=v[g+3]^y[3],F=4,V=1;V<O;V++){var H=S[D>>>24]^b[T>>>16&255]^I[N>>>8&255]^A[J&255]^y[F++],Z=S[T>>>24]^b[N>>>16&255]^I[J>>>8&255]^A[D&255]^y[F++],j=S[N>>>24]^b[J>>>16&255]^I[D>>>8&255]^A[T&255]^y[F++],R=S[J>>>24]^b[D>>>16&255]^I[T>>>8&255]^A[N&255]^y[F++];D=H,T=Z,N=j,J=R}var H=(w[D>>>24]<<24|w[T>>>16&255]<<16|w[N>>>8&255]<<8|w[J&255])^y[F++],Z=(w[T>>>24]<<24|w[N>>>16&255]<<16|w[J>>>8&255]<<8|w[D&255])^y[F++],j=(w[N>>>24]<<24|w[J>>>16&255]<<16|w[D>>>8&255]<<8|w[T&255])^y[F++],R=(w[J>>>24]<<24|w[D>>>16&255]<<16|w[T>>>8&255]<<8|w[N&255])^y[F++];v[g]=H,v[g+1]=Z,v[g+2]=j,v[g+3]=R},keySize:256/32});t.AES=r._createHelper(C)})(),e.AES})});var Xm=p((uu,$m)=>{(function(e,t,n){typeof uu=="object"?$m.exports=uu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(uu,function(e){return(function(){var t=e,n=t.lib,r=n.WordArray,i=n.BlockCipher,a=t.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],o=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=a.DES=i.extend({_doReset:function(){for(var E=this._key,C=E.words,v=[],g=0;g<56;g++){var y=s[g]-1;v[g]=C[y>>>5]>>>31-y%32&1}for(var S=this._subKeys=[],b=0;b<16;b++){for(var I=S[b]=[],A=d[b],g=0;g<24;g++)I[g/6|0]|=v[(u[g]-1+A)%28]<<31-g%6,I[4+(g/6|0)]|=v[28+(u[g+24]-1+A)%28]<<31-g%6;I[0]=I[0]<<1|I[0]>>>31;for(var g=1;g<7;g++)I[g]=I[g]>>>(g-1)*4+3;I[7]=I[7]<<5|I[7]>>>27}for(var w=this._invSubKeys=[],g=0;g<16;g++)w[g]=S[15-g]},encryptBlock:function(E,C){this._doCryptBlock(E,C,this._subKeys)},decryptBlock:function(E,C){this._doCryptBlock(E,C,this._invSubKeys)},_doCryptBlock:function(E,C,v){this._lBlock=E[C],this._rBlock=E[C+1],m.call(this,4,252645135),m.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),m.call(this,1,1431655765);for(var g=0;g<16;g++){for(var y=v[g],S=this._lBlock,b=this._rBlock,I=0,A=0;A<8;A++)I|=c[A][((b^y[A])&o[A])>>>0];this._lBlock=b,this._rBlock=S^I}var w=this._lBlock;this._lBlock=this._rBlock,this._rBlock=w,m.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),m.call(this,16,65535),m.call(this,4,252645135),E[C]=this._lBlock,E[C+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function m(E,C){var v=(this._lBlock>>>E^this._rBlock)&C;this._rBlock^=v,this._lBlock^=v<<E}function _(E,C){var v=(this._rBlock>>>E^this._lBlock)&C;this._lBlock^=v,this._rBlock^=v<<E}t.DES=i._createHelper(f);var x=a.TripleDES=i.extend({_doReset:function(){var E=this._key,C=E.words;if(C.length!==2&&C.length!==4&&C.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var v=C.slice(0,2),g=C.length<4?C.slice(0,2):C.slice(2,4),y=C.length<6?C.slice(0,2):C.slice(4,6);this._des1=f.createEncryptor(r.create(v)),this._des2=f.createEncryptor(r.create(g)),this._des3=f.createEncryptor(r.create(y))},encryptBlock:function(E,C){this._des1.encryptBlock(E,C),this._des2.decryptBlock(E,C),this._des3.encryptBlock(E,C)},decryptBlock:function(E,C){this._des3.decryptBlock(E,C),this._des2.encryptBlock(E,C),this._des1.decryptBlock(E,C)},keySize:192/32,ivSize:64/32,blockSize:64/32});t.TripleDES=i._createHelper(x)})(),e.TripleDES})});var eg=p((cu,jm)=>{(function(e,t,n){typeof cu=="object"?jm.exports=cu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(cu,function(e){return(function(){var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,a=i.RC4=r.extend({_doReset:function(){for(var d=this._key,c=d.words,o=d.sigBytes,f=this._S=[],m=0;m<256;m++)f[m]=m;for(var m=0,_=0;m<256;m++){var x=m%o,E=c[x>>>2]>>>24-x%4*8&255;_=(_+f[m]+E)%256;var C=f[m];f[m]=f[_],f[_]=C}this._i=this._j=0},_doProcessBlock:function(d,c){d[c]^=s.call(this)},keySize:256/32,ivSize:0});function s(){for(var d=this._S,c=this._i,o=this._j,f=0,m=0;m<4;m++){c=(c+1)%256,o=(o+d[c])%256;var _=d[c];d[c]=d[o],d[o]=_,f|=d[(d[c]+d[o])%256]<<24-m*8}return this._i=c,this._j=o,f}t.RC4=r._createHelper(a);var u=i.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)s.call(this)}});t.RC4Drop=r._createHelper(u)})(),e.RC4})});var ng=p((du,tg)=>{(function(e,t,n){typeof du=="object"?tg.exports=du=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(du,function(e){return(function(){var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,a=[],s=[],u=[],d=i.Rabbit=r.extend({_doReset:function(){for(var o=this._key.words,f=this.cfg.iv,m=0;m<4;m++)o[m]=(o[m]<<8|o[m]>>>24)&16711935|(o[m]<<24|o[m]>>>8)&4278255360;var _=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],x=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var m=0;m<4;m++)c.call(this);for(var m=0;m<8;m++)x[m]^=_[m+4&7];if(f){var E=f.words,C=E[0],v=E[1],g=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,y=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,S=g>>>16|y&4294901760,b=y<<16|g&65535;x[0]^=g,x[1]^=S,x[2]^=y,x[3]^=b,x[4]^=g,x[5]^=S,x[6]^=y,x[7]^=b;for(var m=0;m<4;m++)c.call(this)}},_doProcessBlock:function(o,f){var m=this._X;c.call(this),a[0]=m[0]^m[5]>>>16^m[3]<<16,a[1]=m[2]^m[7]>>>16^m[5]<<16,a[2]=m[4]^m[1]>>>16^m[7]<<16,a[3]=m[6]^m[3]>>>16^m[1]<<16;for(var _=0;_<4;_++)a[_]=(a[_]<<8|a[_]>>>24)&16711935|(a[_]<<24|a[_]>>>8)&4278255360,o[f+_]^=a[_]},blockSize:128/32,ivSize:64/32});function c(){for(var o=this._X,f=this._C,m=0;m<8;m++)s[m]=f[m];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<s[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<s[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<s[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<s[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<s[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<s[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<s[6]>>>0?1:0)|0,this._b=f[7]>>>0<s[7]>>>0?1:0;for(var m=0;m<8;m++){var _=o[m]+f[m],x=_&65535,E=_>>>16,C=((x*x>>>17)+x*E>>>15)+E*E,v=((_&4294901760)*_|0)+((_&65535)*_|0);u[m]=C^v}o[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,o[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,o[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,o[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,o[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,o[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,o[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,o[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}t.Rabbit=r._createHelper(d)})(),e.Rabbit})});var ig=p((lu,rg)=>{(function(e,t,n){typeof lu=="object"?rg.exports=lu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(lu,function(e){return(function(){var t=e,n=t.lib,r=n.StreamCipher,i=t.algo,a=[],s=[],u=[],d=i.RabbitLegacy=r.extend({_doReset:function(){var o=this._key.words,f=this.cfg.iv,m=this._X=[o[0],o[3]<<16|o[2]>>>16,o[1],o[0]<<16|o[3]>>>16,o[2],o[1]<<16|o[0]>>>16,o[3],o[2]<<16|o[1]>>>16],_=this._C=[o[2]<<16|o[2]>>>16,o[0]&4294901760|o[1]&65535,o[3]<<16|o[3]>>>16,o[1]&4294901760|o[2]&65535,o[0]<<16|o[0]>>>16,o[2]&4294901760|o[3]&65535,o[1]<<16|o[1]>>>16,o[3]&4294901760|o[0]&65535];this._b=0;for(var x=0;x<4;x++)c.call(this);for(var x=0;x<8;x++)_[x]^=m[x+4&7];if(f){var E=f.words,C=E[0],v=E[1],g=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,y=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,S=g>>>16|y&4294901760,b=y<<16|g&65535;_[0]^=g,_[1]^=S,_[2]^=y,_[3]^=b,_[4]^=g,_[5]^=S,_[6]^=y,_[7]^=b;for(var x=0;x<4;x++)c.call(this)}},_doProcessBlock:function(o,f){var m=this._X;c.call(this),a[0]=m[0]^m[5]>>>16^m[3]<<16,a[1]=m[2]^m[7]>>>16^m[5]<<16,a[2]=m[4]^m[1]>>>16^m[7]<<16,a[3]=m[6]^m[3]>>>16^m[1]<<16;for(var _=0;_<4;_++)a[_]=(a[_]<<8|a[_]>>>24)&16711935|(a[_]<<24|a[_]>>>8)&4278255360,o[f+_]^=a[_]},blockSize:128/32,ivSize:64/32});function c(){for(var o=this._X,f=this._C,m=0;m<8;m++)s[m]=f[m];f[0]=f[0]+1295307597+this._b|0,f[1]=f[1]+3545052371+(f[0]>>>0<s[0]>>>0?1:0)|0,f[2]=f[2]+886263092+(f[1]>>>0<s[1]>>>0?1:0)|0,f[3]=f[3]+1295307597+(f[2]>>>0<s[2]>>>0?1:0)|0,f[4]=f[4]+3545052371+(f[3]>>>0<s[3]>>>0?1:0)|0,f[5]=f[5]+886263092+(f[4]>>>0<s[4]>>>0?1:0)|0,f[6]=f[6]+1295307597+(f[5]>>>0<s[5]>>>0?1:0)|0,f[7]=f[7]+3545052371+(f[6]>>>0<s[6]>>>0?1:0)|0,this._b=f[7]>>>0<s[7]>>>0?1:0;for(var m=0;m<8;m++){var _=o[m]+f[m],x=_&65535,E=_>>>16,C=((x*x>>>17)+x*E>>>15)+E*E,v=((_&4294901760)*_|0)+((_&65535)*_|0);u[m]=C^v}o[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,o[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,o[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,o[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,o[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,o[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,o[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,o[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}t.RabbitLegacy=r._createHelper(d)})(),e.RabbitLegacy})});var og=p((fu,ag)=>{(function(e,t,n){typeof fu=="object"?ag.exports=fu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(fu,function(e){return(function(){var t=e,n=t.lib,r=n.BlockCipher,i=t.algo;let a=16,s=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function c(x,E){let C=E>>24&255,v=E>>16&255,g=E>>8&255,y=E&255,S=x.sbox[0][C]+x.sbox[1][v];return S=S^x.sbox[2][g],S=S+x.sbox[3][y],S}function o(x,E,C){let v=E,g=C,y;for(let S=0;S<a;++S)v=v^x.pbox[S],g=c(x,v)^g,y=v,v=g,g=y;return y=v,v=g,g=y,g=g^x.pbox[a],v=v^x.pbox[a+1],{left:v,right:g}}function f(x,E,C){let v=E,g=C,y;for(let S=a+1;S>1;--S)v=v^x.pbox[S],g=c(x,v)^g,y=v,v=g,g=y;return y=v,v=g,g=y,g=g^x.pbox[1],v=v^x.pbox[0],{left:v,right:g}}function m(x,E,C){for(let b=0;b<4;b++){x.sbox[b]=[];for(let I=0;I<256;I++)x.sbox[b][I]=u[b][I]}let v=0;for(let b=0;b<a+2;b++)x.pbox[b]=s[b]^E[v],v++,v>=C&&(v=0);let g=0,y=0,S=0;for(let b=0;b<a+2;b+=2)S=o(x,g,y),g=S.left,y=S.right,x.pbox[b]=g,x.pbox[b+1]=y;for(let b=0;b<4;b++)for(let I=0;I<256;I+=2)S=o(x,g,y),g=S.left,y=S.right,x.sbox[b][I]=g,x.sbox[b][I+1]=y;return!0}var _=i.Blowfish=r.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var x=this._keyPriorReset=this._key,E=x.words,C=x.sigBytes/4;m(d,E,C)}},encryptBlock:function(x,E){var C=o(d,x[E],x[E+1]);x[E]=C.left,x[E+1]=C.right},decryptBlock:function(x,E){var C=f(d,x[E],x[E+1]);x[E]=C.left,x[E+1]=C.right},blockSize:64/32,keySize:128/32,ivSize:64/32});t.Blowfish=r._createHelper(_)})(),e.Blowfish})});var Gn=p((hu,sg)=>{(function(e,t,n){typeof hu=="object"?sg.exports=hu=t(X(),ba(),im(),om(),fn(),cm(),hn(),Z0(),Js(),pm(),Q0(),gm(),xm(),ym(),zs(),bm(),Ut(),ye(),wm(),Dm(),Fm(),Nm(),Bm(),km(),Lm(),Wm(),Vm(),zm(),Zm(),Ym(),Xm(),eg(),ng(),ig(),og()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],t):e.CryptoJS=t(e.CryptoJS)})(hu,function(e){return e})});var $0=p(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.SymmetricKey=void 0;var sA=Gn(),Y0=class{constructor(t){this.key=sA.enc.Base64.parse(t)}};pu.SymmetricKey=Y0});var ft=p(lt=>{"use strict";var uA=lt&&lt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Ia=lt&&lt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&uA(t,e,n)};Object.defineProperty(lt,"__esModule",{value:!0});Ia(Qv(),lt);Ia(Yv(),lt);Ia(Xv(),lt);Ia(G0(),lt);Ia($0(),lt)});var ws=p(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.Message=Zr.HeaderBooleanValue=void 0;var ug=dt(),Wt=dn(),X0=ft(),Gr;(function(e){e.Yes="yes",e.No="no"})(Gr||(Zr.HeaderBooleanValue=Gr={}));var yt=class e{constructor(t,n,r,i,a){this.method=t,this.sessionId=n,this.from=r,this.body=i,this.values=a}isMethod(t){return this.method==t}static tryExtractSessionKey(t,n){var r;if(!((r=t.values)===null||r===void 0)&&r.key){try{n(new X0.SymmetricKey(t.values.key))}catch(i){return console.error(i),!1}return!0}return!1}getError(){var t;if(!((t=this.body)===null||t===void 0)&&t.isError()){let n=e.parseSinchErrorFromJson(this.body.data);if(n)return n}return this.getHeaderError()}getSdp(){var t,n,r,i;try{if(!((t=this.body)===null||t===void 0)&&t.isSdp())return!((n=this.body)===null||n===void 0)&&n.data?JSON.parse(this.body.data):null;if(!((r=this.values)===null||r===void 0)&&r.sdp)return JSON.parse((i=this.values)===null||i===void 0?void 0:i.sdp)}catch(a){return console.log(a),null}}getIceCandidate(){var t;return(t=this.getSdp())===null||t===void 0?void 0:t.cand}getTerminationCause(){if(this.isIceFailureFlagSet())return ug.TerminationCause.IceFailedToConnect;if(this.isFailureTermination())return ug.TerminationCause.Error}isIceFailureFlagSet(){return!this.values||!(e.KEY_ICE_FAILURE in this.values)?!1:this.values[e.KEY_ICE_FAILURE]===Gr.Yes}isFailureTermination(){return!this.values||!(e.KEY_FAILURE_TERMINATION in this.values)?!1:this.values[e.KEY_FAILURE_TERMINATION]===Gr.Yes}getHeaderError(){var t;let n=(t=this.values)===null||t===void 0?void 0:t[e.ERROR_JSON];if(n)return e.parseSinchErrorFromJson(n)}isDoNotDenyAllMessage(){var t;return this.method!=X0.Method.Deny?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_DENY_ALL])===Gr.No}isEarlyMedia(){var t;return this.method!=X0.Method.Ack?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_EARLY_MEDIA])===Gr.Yes}stringifiedValues(){return!this.values||Object.keys(this.values).length===0?"":JSON.stringify(this.values)}isAddressedToInstance(t){return!this.values||!("to"in this.values)?!0:this.values.to===t}static errorToJsonString(t){return JSON.stringify({code:t.code,reason:t.message.slice(0,e.MAX_ERROR_MESSAGE_JSON_LENGTH),domain:Wt.ErrorType[t.domain].toLowerCase(),isFatal:t.isFatal})}static parseSinchErrorFromJson(t){try{let n=JSON.parse(t);if(!n||typeof n!="object")return;let r=n,i=r.code,a=r.reason,s=r.isFatal,u=r.domain;if(i===void 0||typeof i!="number"||a===void 0||typeof a!="string")return;typeof u=="string"&&(u=u?.toLowerCase());let d=Wt.ErrorType.Generic;switch(u){case"network":d=Wt.ErrorType.Network;break;case"session":d=Wt.ErrorType.Session;break;case"api":d=Wt.ErrorType.Api;break;case"persistence":d=Wt.ErrorType.Persistence;break;case"sip":d=Wt.ErrorType.Sip;break;case"http":d=Wt.ErrorType.Http;break}return new Wt.SinchError(a,i,d,s)}catch{return}}};Zr.Message=yt;yt.KEY_ICE_FAILURE="iceFailed";yt.KEY_FAILURE_TERMINATION="failureterm";yt.KEY_DENY_ALL="denyall";yt.KEY_EARLY_MEDIA="earlymedia";yt.KEY_TIMEOUT="timeout";yt.ERROR_JSON="error_json";yt.MAX_ERROR_MESSAGE_JSON_LENGTH=256});var cg=p(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.ProtocolV10Factory=Yr.ProtocolV10=void 0;var cA=Gn(),Qr=ht(),dA=ft(),vu=class e{constructor(){this.Version="10",this.sessionBuffer=new Qr.SessionMessageBuffer}decode(t,n){let r=e.getMXPDataParts(t);if(r.partTotal==="1")return{transport:r,message:this.prepareMessage(r.data,r.sessionId,n)};{this.sessionBuffer.addTransportMessage(r);let i=this.sessionBuffer.getPayload(r);if(i)return{transport:r,message:this.prepareMessage(i,r.sessionId,n)}}return null}encode(t,n){let i=this.serialize(t),a=Qr.Codec.encrypt(i,n),s=Math.floor(1+a.length/3e4),u=s===1?"-":cA.lib.WordArray.random(16).toString(),d=new Array;for(let c=0;c<s;c++){let o=this.payloadSlice(a,c,3e4),f=this.buildTransportMessage(this.Version,t.sessionId,u,c,s,o);d.push(f)}return d}prepareMessage(t,n,r){try{let i=Qr.Codec.decrypt(t,r),a=JSON.parse(i),s=this.encodeClient(a),u=new dA.Body(a.bt,a.bd);return new Qr.Message(parseInt(a.md),n,s,u,a.nvps)}catch(i){throw i.name!=="MXPError"?new Qr.MXPError(Qr.MXPError.Codes.INVALID_MESSAGE,i):i}}encodeClient(t){return{cli:t.fc,channel:t.fs,instanceId:t.fi,userId:t.fu,deviceDescription:t.fd,domain:t.fdom}}buildTransportMessage(t,n,r,i,a,s){return`${t} ${n} ${r} ${i} ${a} ${s}`}static getMXPDataParts(t){let n=t.split(" ");return{version:n[0],sessionId:n[1],msgId:n[2],partNo:n[3],partTotal:n[4],data:n[5]}}payloadSlice(t,n,r){return t.substr(n*r,Math.min(r,t.length-n*r))}serialize(t){let n={};return n.md=t.method,n=this.addBody(t,n),n=this.addClient(t,n),n=this.addValues(t,n),JSON.stringify(n)}addBody(t,n){return t.body?Object.assign(Object.assign({},n),{bd:t.body.data,bt:t.body.type}):n}addClient(t,n){return t.from?Object.assign(Object.assign({},n),{fs:t.from.channel,fc:t.from.cli,fd:t.from.deviceDescription,fi:t.from.instanceId,fu:t.from.userId}):n}addValues(t,n){return t.values?Object.assign(Object.assign({},n),{nvps:t.values}):n}};Yr.ProtocolV10=vu;var j0=class{static create(){return new vu}};Yr.ProtocolV10Factory=j0});var dg=p(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.MXPError=void 0;var mu=class extends Error{constructor(t,n){super(),this.Messages={1:"Key used to decryption is invalid",2:"Decryption process has failed",3:"MXPMessage has invalid structure",4:"MXP Body has declared different body type than expected",5:"Error while parsing data in MXP Body object"},this.name="MXPError",this.code=t,this.message=`${this.Messages[t]} :: ${n}`,this.originalMessage=n}};gu.MXPError=mu;mu.Codes={INVALID_DECRYPTION_KEY:1,DECRYPTION_FAIL:2,INVALID_MESSAGE:3,INVALID_BODY_TYPE:4,BODY_PARSE_FAIL:5}});var lg=p(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.SessionMessageBuffer=void 0;var el=class{constructor(){this.messageBuffer={}}addTransportMessage(t){let{sessionId:n,msgId:r,partNo:i,data:a}=t;this.messageBuffer[n]||(this.messageBuffer[n]={}),this.messageBuffer[n][r]||(this.messageBuffer[n][r]={}),this.messageBuffer[n][r][i]=a}isComplete(t){let{sessionId:n,msgId:r,partTotal:i}=t;return Object.keys(this.messageBuffer[n][r]).length===parseInt(i)}getPayload(t){if(this.isComplete(t)){let n=[],{sessionId:r,msgId:i}=t;for(let a of Object.keys(this.messageBuffer[r][i]).sort())n.push(this.messageBuffer[r][i][a]);return n.join("")}else return null}};_u.SessionMessageBuffer=el});var Y=p(oe=>{"use strict";var $r=oe&&oe.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(oe,"__esModule",{value:!0});oe.TextApiResponse=oe.BlobApiResponse=oe.VoidApiResponse=oe.JSONApiResponse=oe.Configuration=oe.COLLECTION_FORMATS=oe.RequiredError=oe.BaseAPI=oe.BASE_PATH=void 0;oe.exists=fA;oe.querystring=sl;oe.mapValues=hA;oe.canConsumeForm=pA;oe.BASE_PATH="http://ocra.api.sinch.com/ocra".replace(/\/+$/,"");var lA=e=>typeof Blob<"u"&&e instanceof Blob,tl=class{constructor(t=new xu){this.configuration=t,this.fetchApi=(n,r)=>$r(this,void 0,void 0,function*(){let i={url:n,init:r};for(let s of this.middleware)s.pre&&(i=(yield s.pre(Object.assign({fetch:this.fetchApi},i)))||i);let a=yield this.configuration.fetchApi(i.url,i.init);for(let s of this.middleware)s.post&&(a=(yield s.post({fetch:this.fetchApi,url:n,init:r,response:a.clone()}))||a);return a}),this.middleware=t.middleware}withMiddleware(...t){let n=this.clone();return n.middleware=n.middleware.concat(...t),n}withPreMiddleware(...t){let n=t.map(r=>({pre:r}));return this.withMiddleware(...n)}withPostMiddleware(...t){let n=t.map(r=>({post:r}));return this.withMiddleware(...n)}request(t){return $r(this,void 0,void 0,function*(){let{url:n,init:r}=this.createFetchParams(t),i=yield this.fetchApi(n,r);if(i.status>=200&&i.status<300)return i;throw i})}createFetchParams(t){let n=this.configuration.basePath+t.path;t.query!==void 0&&Object.keys(t.query).length!==0&&(n+="?"+this.configuration.queryParamsStringify(t.query));let r=typeof FormData<"u"&&t.body instanceof FormData||t.body instanceof URLSearchParams||lA(t.body)?t.body:JSON.stringify(t.body),i=Object.assign({},this.configuration.headers,t.headers),a={method:t.method,headers:i,body:r,credentials:this.configuration.credentials};return{url:n,init:a}}clone(){let t=this.constructor,n=new t(this.configuration);return n.middleware=this.middleware.slice(),n}};oe.BaseAPI=tl;var nl=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}};oe.RequiredError=nl;oe.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};var xu=class{constructor(t={}){this.configuration=t}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:oe.BASE_PATH}get fetchApi(){return this.configuration.fetchApi||window.fetch.bind(window)}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||sl}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let t=this.configuration.apiKey;if(t)return typeof t=="function"?t:()=>t}get accessToken(){let t=this.configuration.accessToken;if(t)return typeof t=="function"?t:()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}};oe.Configuration=xu;function fA(e,t){let n=e[t];return n!=null}function sl(e,t=""){return Object.keys(e).map(n=>{let r=t+(t.length?`[${n}]`:n),i=e[n];if(i instanceof Array){let a=i.map(s=>encodeURIComponent(String(s))).join(`&${encodeURIComponent(r)}=`);return`${encodeURIComponent(r)}=${a}`}return i instanceof Object?sl(i,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`}).filter(n=>n.length>0).join("&")}function hA(e,t){return Object.keys(e).reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])}),{})}function pA(e){for(let t of e)if(t.contentType==="multipart/form-data")return!0;return!1}var rl=class{constructor(t,n=r=>r){this.raw=t,this.transformer=n}value(){return $r(this,void 0,void 0,function*(){return this.transformer(yield this.raw.json())})}};oe.JSONApiResponse=rl;var il=class{constructor(t){this.raw=t}value(){return $r(this,void 0,void 0,function*(){})}};oe.VoidApiResponse=il;var al=class{constructor(t){this.raw=t}value(){return $r(this,void 0,void 0,function*(){return yield this.raw.blob()})}};oe.BlobApiResponse=al;var ol=class{constructor(t){this.raw=t}value(){return $r(this,void 0,void 0,function*(){return yield this.raw.text()})}};oe.TextApiResponse=ol});var vg=p(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ApnPushProfileEnvironmentEnum=Ht.ApnPushProfileTokenTypeEnum=void 0;Ht.ApnPushProfileFromJSON=vA;Ht.ApnPushProfileFromJSONTyped=pg;Ht.ApnPushProfileToJSON=mA;var fg;(function(e){e.Voip="voip",e.Default="default"})(fg||(Ht.ApnPushProfileTokenTypeEnum=fg={}));var hg;(function(e){e.Development="development",e.Production="production"})(hg||(Ht.ApnPushProfileEnvironmentEnum=hg={}));function vA(e){return pg(e,!1)}function pg(e,t){return e==null?e:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}function mA(e){if(e!==void 0)return e===null?null:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}});var gg=p(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.AudioRouteEventFromJSON=gA;Ta.AudioRouteEventFromJSONTyped=mg;Ta.AudioRouteEventToJSON=_A;function gA(e){return mg(e,!1)}function mg(e,t){return e==null?e:{description:e.description,time:new Date(e.time)}}function _A(e){if(e!==void 0)return e===null?null:{description:e.description,time:e.time.toISOString()}}});var xg=p(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.AudioRouteEventLogFromJSON=xA;Aa.AudioRouteEventLogFromJSONTyped=_g;Aa.AudioRouteEventLogToJSON=SA;var Su=G();function xA(e){return _g(e,!1)}function _g(e,t){return e==null?e:{events:e.events.map(Su.AudioRouteEventFromJSON),eventsSemanticVersion:(0,Su.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function SA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Su.AudioRouteEventToJSON),eventsSemanticVersion:(0,Su.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var yg=p(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.BasicCallReportFromJSON=yA;wa.BasicCallReportFromJSONTyped=Sg;wa.BasicCallReportToJSON=CA;var pt=Y(),le=G();function yA(e){return Sg(e,!1)}function Sg(e,t){return e==null?e:{callId:e.callId,reportId:e.reportId,instance:(0,le.CallReportInstanceFromJSON)(e.instance),userId:e.userId,from:(0,pt.exists)(e,"from")?(0,le.OriginFromJSON)(e.from):void 0,to:(0,pt.exists)(e,"to")?(0,le.DestinationFromJSON)(e.to):void 0,direction:(0,le.DirectionFromJSON)(e.direction),publicCallHeaders:(0,pt.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,startTime:new Date(e.startTime),duration:e.duration,setupDuration:(0,pt.exists)(e,"setupDuration")?e.setupDuration:void 0,result:(0,le.CallResultFromJSON)(e.result),localDomain:(0,le.DomainFromJSON)(e.localDomain),remoteDomain:(0,pt.exists)(e,"remoteDomain")?(0,le.DomainFromJSON)(e.remoteDomain):void 0,requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,primaryMediaTransportType:(0,pt.exists)(e,"primaryMediaTransportType")?(0,le.PrimaryMediaTransportTypeFromJSON)(e.primaryMediaTransportType):void 0,primaryIpProtocolVersion:(0,pt.exists)(e,"primaryIpProtocolVersion")?(0,le.IpProtocolVersionFromJSON)(e.primaryIpProtocolVersion):void 0,connectionInfo:(0,pt.exists)(e,"connectionInfo")?e.connectionInfo.map(le.ConnectionInfoV2FromJSON):void 0,errors:(0,pt.exists)(e,"errors")?e.errors.map(le.ClientErrorFromJSON):void 0,pinnedPop:(0,pt.exists)(e,"pinnedPop")?e.pinnedPop:void 0,sdpSemantics:(0,pt.exists)(e,"sdpSemantics")?(0,le.SdpSemanticsFromJSON)(e.sdpSemantics):void 0}}function CA(e){if(e!==void 0)return e===null?null:{callId:e.callId,reportId:e.reportId,instance:(0,le.CallReportInstanceToJSON)(e.instance),userId:e.userId,from:(0,le.OriginToJSON)(e.from),to:(0,le.DestinationToJSON)(e.to),direction:(0,le.DirectionToJSON)(e.direction),publicCallHeaders:e.publicCallHeaders,startTime:e.startTime.toISOString(),duration:e.duration,setupDuration:e.setupDuration,result:(0,le.CallResultToJSON)(e.result),localDomain:(0,le.DomainToJSON)(e.localDomain),remoteDomain:(0,le.DomainToJSON)(e.remoteDomain),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,primaryMediaTransportType:(0,le.PrimaryMediaTransportTypeToJSON)(e.primaryMediaTransportType),primaryIpProtocolVersion:(0,le.IpProtocolVersionToJSON)(e.primaryIpProtocolVersion),connectionInfo:e.connectionInfo===void 0?void 0:e.connectionInfo.map(le.ConnectionInfoV2ToJSON),errors:e.errors===void 0?void 0:e.errors.map(le.ClientErrorToJSON),pinnedPop:e.pinnedPop,sdpSemantics:(0,le.SdpSemanticsToJSON)(e.sdpSemantics)}}});var Eg=p(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.CallInitiationRequestFromJSON=EA;Da.CallInitiationRequestFromJSONTyped=Cg;Da.CallInitiationRequestToJSON=bA;var Oa=Y(),yu=G();function EA(e){return Cg(e,!1)}function Cg(e,t){return e==null?e:{callId:e.callId,destination:(0,yu.DestinationFromJSON)(e.destination),rtcOffer:(0,yu.WebrtcRTCSessionDescriptionFromJSON)(e.rtcOffer),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,publicCallHeaders:(0,Oa.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,cli:(0,Oa.exists)(e,"cli")?e.cli:void 0,mxpInstanceId:(0,Oa.exists)(e,"mxpInstanceId")?e.mxpInstanceId:void 0,legacyMediaProxyEngage:(0,Oa.exists)(e,"legacyMediaProxyEngage")?e.legacyMediaProxyEngage:void 0,mxpClientEventsVersion:(0,Oa.exists)(e,"mxpClientEventsVersion")?e.mxpClientEventsVersion:void 0}}function bA(e){if(e!==void 0)return e===null?null:{callId:e.callId,destination:(0,yu.DestinationToJSON)(e.destination),rtcOffer:(0,yu.WebrtcRTCSessionDescriptionToJSON)(e.rtcOffer),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,publicCallHeaders:e.publicCallHeaders,cli:e.cli,mxpInstanceId:e.mxpInstanceId,legacyMediaProxyEngage:e.legacyMediaProxyEngage,mxpClientEventsVersion:e.mxpClientEventsVersion}}});var Tg=p(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.CallInitiationResponseFromJSON=IA;Ra.CallInitiationResponseFromJSONTyped=Ig;Ra.CallInitiationResponseToJSON=TA;var Cu=Y(),bg=G();function IA(e){return Ig(e,!1)}function Ig(e,t){return e==null?e:{callId:e.callId,mxpEncryptionKey:e.mxpEncryptionKey,mxpSignalChannel:e.mxpSignalChannel,instances:(0,Cu.exists)(e,"instances")?e.instances.map(bg.RemotePeerInstanceFromJSON):void 0,startTime:new Date(e.startTime),legacyRelayIceCandidates:(0,Cu.exists)(e,"legacyRelayIceCandidates")?e.legacyRelayIceCandidates:void 0,publicCallHeaders:(0,Cu.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,apiBaseUrl:(0,Cu.exists)(e,"apiBaseUrl")?e.apiBaseUrl:void 0}}function TA(e){if(e!==void 0)return e===null?null:{callId:e.callId,mxpEncryptionKey:e.mxpEncryptionKey,mxpSignalChannel:e.mxpSignalChannel,instances:e.instances===void 0?void 0:e.instances.map(bg.RemotePeerInstanceToJSON),startTime:e.startTime.toISOString(),legacyRelayIceCandidates:e.legacyRelayIceCandidates,publicCallHeaders:e.publicCallHeaders,apiBaseUrl:e.apiBaseUrl}}});var wg=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.CallQualityFromJSON=AA;Fa.CallQualityFromJSONTyped=Ag;Fa.CallQualityToJSON=wA;var Eu=G();function AA(e){return Ag(e,!1)}function Ag(e,t){return e==null?e:{warningEvents:e.warningEvents.map(Eu.WarningEventFromJSON),semanticVersion:(0,Eu.SemanticVersionFromJSON)(e.semanticVersion)}}function wA(e){if(e!==void 0)return e===null?null:{warningEvents:e.warningEvents.map(Eu.WarningEventToJSON),semanticVersion:(0,Eu.SemanticVersionToJSON)(e.semanticVersion)}}});var Dg=p(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.CallReportFromJSON=OA;Pa.CallReportFromJSONTyped=Og;Pa.CallReportToJSON=DA;var me=Y(),re=G();function OA(e){return Og(e,!1)}function Og(e,t){return e==null?e:{callId:e.callId,reportId:e.reportId,instance:(0,re.CallReportInstanceFromJSON)(e.instance),userId:e.userId,from:(0,me.exists)(e,"from")?(0,re.OriginFromJSON)(e.from):void 0,to:(0,me.exists)(e,"to")?(0,re.DestinationFromJSON)(e.to):void 0,direction:(0,re.DirectionFromJSON)(e.direction),publicCallHeaders:(0,me.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,startTime:new Date(e.startTime),duration:e.duration,setupDuration:(0,me.exists)(e,"setupDuration")?e.setupDuration:void 0,notifyingDuration:(0,me.exists)(e,"notifyingDuration")?e.notifyingDuration:void 0,ringingDuration:(0,me.exists)(e,"ringingDuration")?e.ringingDuration:void 0,connectingDuration:(0,me.exists)(e,"connectingDuration")?e.connectingDuration:void 0,acceptingDuration:(0,me.exists)(e,"acceptingDuration")?e.acceptingDuration:void 0,result:(0,re.CallResultFromJSON)(e.result),localDomain:(0,re.DomainFromJSON)(e.localDomain),remoteDomain:(0,me.exists)(e,"remoteDomain")?(0,re.DomainFromJSON)(e.remoteDomain):void 0,requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,isPendingCall:(0,me.exists)(e,"isPendingCall")?e.isPendingCall:void 0,primaryRemoteIceCandidate:(0,me.exists)(e,"primaryRemoteIceCandidate")?(0,re.IceCandidateFromJSON)(e.primaryRemoteIceCandidate):void 0,primaryLocalIceCandidate:(0,me.exists)(e,"primaryLocalIceCandidate")?(0,re.IceCandidateFromJSON)(e.primaryLocalIceCandidate):void 0,connectionInfo:(0,me.exists)(e,"connectionInfo")?e.connectionInfo.map(re.ConnectionInfoFromJSON):void 0,errors:(0,me.exists)(e,"errors")?e.errors.map(re.ClientErrorFromJSON):void 0,pinnedPop:(0,me.exists)(e,"pinnedPop")?e.pinnedPop:void 0,rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:(0,me.exists)(e,"mxpEventLog")?e.mxpEventLog:void 0,audioRouteEventLog:(0,me.exists)(e,"audioRouteEventLog")?(0,re.AudioRouteEventLogFromJSON)(e.audioRouteEventLog):void 0,callQuality:(0,me.exists)(e,"callQuality")?(0,re.CallQualityFromJSON)(e.callQuality):void 0,pushProvider:(0,me.exists)(e,"pushProvider")?(0,re.PushProviderFromJSON)(e.pushProvider):void 0,clientEvents:(0,me.exists)(e,"clientEvents")?(0,re.ClientEventsFromJSON)(e.clientEvents):void 0}}function DA(e){if(e!==void 0)return e===null?null:{callId:e.callId,reportId:e.reportId,instance:(0,re.CallReportInstanceToJSON)(e.instance),userId:e.userId,from:(0,re.OriginToJSON)(e.from),to:(0,re.DestinationToJSON)(e.to),direction:(0,re.DirectionToJSON)(e.direction),publicCallHeaders:e.publicCallHeaders,startTime:e.startTime.toISOString(),duration:e.duration,setupDuration:e.setupDuration,notifyingDuration:e.notifyingDuration,ringingDuration:e.ringingDuration,connectingDuration:e.connectingDuration,acceptingDuration:e.acceptingDuration,result:(0,re.CallResultToJSON)(e.result),localDomain:(0,re.DomainToJSON)(e.localDomain),remoteDomain:(0,re.DomainToJSON)(e.remoteDomain),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,isPendingCall:e.isPendingCall,primaryRemoteIceCandidate:(0,re.IceCandidateToJSON)(e.primaryRemoteIceCandidate),primaryLocalIceCandidate:(0,re.IceCandidateToJSON)(e.primaryLocalIceCandidate),connectionInfo:e.connectionInfo===void 0?void 0:e.connectionInfo.map(re.ConnectionInfoToJSON),errors:e.errors===void 0?void 0:e.errors.map(re.ClientErrorToJSON),pinnedPop:e.pinnedPop,rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:e.mxpEventLog,audioRouteEventLog:(0,re.AudioRouteEventLogToJSON)(e.audioRouteEventLog),callQuality:(0,re.CallQualityToJSON)(e.callQuality),pushProvider:(0,re.PushProviderToJSON)(e.pushProvider),clientEvents:(0,re.ClientEventsToJSON)(e.clientEvents)}}});var Pg=p(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.CallReportInstanceFromJSON=FA;Na.CallReportInstanceFromJSONTyped=Fg;Na.CallReportInstanceToJSON=PA;var RA=Y(),Rg=G();function FA(e){return Fg(e,!1)}function Fg(e,t){return e==null?e:{id:e.id,deviceId:(0,RA.exists)(e,"deviceId")?e.deviceId:void 0,version:(0,Rg.InstanceVersionDataFromJSON)(e.version)}}function PA(e){if(e!==void 0)return e===null?null:{id:e.id,deviceId:e.deviceId,version:(0,Rg.InstanceVersionDataToJSON)(e.version)}}});var Bg=p(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.CallResult=void 0;Zn.CallResultFromJSON=NA;Zn.CallResultFromJSONTyped=Mg;Zn.CallResultToJSON=MA;var Ng;(function(e){e.Failure="failure",e.Timeout="timeout",e.Canceled="canceled",e.NoAnswer="noAnswer",e.OtherPeerAnswered="otherPeerAnswered",e.Answered="answered",e.Denied="denied",e.Established="established"})(Ng||(Zn.CallResult=Ng={}));function NA(e){return Mg(e,!1)}function Mg(e,t){return e}function MA(e){return e}});var Jg=p(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.ClientErrorFromJSON=BA;Ma.ClientErrorFromJSONTyped=kg;Ma.ClientErrorToJSON=qA;var ul=Y(),qg=G();function BA(e){return kg(e,!1)}function kg(e,t){return e==null?e:{code:(0,ul.exists)(e,"code")?e.code:void 0,domain:(0,ul.exists)(e,"domain")?(0,qg.ClientErrorDomainFromJSON)(e.domain):void 0,message:(0,ul.exists)(e,"message")?e.message:void 0}}function qA(e){if(e!==void 0)return e===null?null:{code:e.code,domain:(0,qg.ClientErrorDomainToJSON)(e.domain),message:e.message}}});var Wg=p(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ClientErrorDomain=void 0;Qn.ClientErrorDomainFromJSON=kA;Qn.ClientErrorDomainFromJSONTyped=Ug;Qn.ClientErrorDomainToJSON=JA;var Lg;(function(e){e.Network="network",e.Http="http",e.Api="api",e.Mxp="mxp"})(Lg||(Qn.ClientErrorDomain=Lg={}));function kA(e){return Ug(e,!1)}function Ug(e,t){return e}function JA(e){return e}});var Vg=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ClientEventFromJSON=UA;Ba.ClientEventFromJSONTyped=Hg;Ba.ClientEventToJSON=WA;var LA=Y(),bu=G();function UA(e){return Hg(e,!1)}function Hg(e,t){return e==null?e:{type:(0,bu.EventTypeFromJSON)(e.type),name:e.name,time:new Date(e.time),result:(0,LA.exists)(e,"result")?(0,bu.EventResultFromJSON)(e.result):void 0}}function WA(e){if(e!==void 0)return e===null?null:{type:(0,bu.EventTypeToJSON)(e.type),name:e.name,time:e.time.toISOString(),result:(0,bu.EventResultToJSON)(e.result)}}});var zg=p(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.ClientEventsFromJSON=HA;qa.ClientEventsFromJSONTyped=Kg;qa.ClientEventsToJSON=VA;var Iu=G();function HA(e){return Kg(e,!1)}function Kg(e,t){return e==null?e:{events:e.events.map(Iu.ClientEventFromJSON),eventsSemanticVersion:(0,Iu.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function VA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Iu.ClientEventToJSON),eventsSemanticVersion:(0,Iu.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var Yg=p(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ConfigIceTransportPolicyEnum=void 0;Yn.ConfigFromJSON=KA;Yn.ConfigFromJSONTyped=Qg;Yn.ConfigToJSON=zA;var Gg=Y(),Xr=G(),Zg;(function(e){e.Relay="relay",e.Nohost="nohost",e.All="all"})(Zg||(Yn.ConfigIceTransportPolicyEnum=Zg={}));function KA(e){return Qg(e,!1)}function Qg(e,t){return e==null?e:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:(0,Gg.exists)(e,"iceTransportPolicy")?e.iceTransportPolicy:void 0,rtcProfile:(0,Xr.RtcProfileFromJSON)(e.rtcProfile),rtcConfig:(0,Xr.RtcConfigFromJSON)(e.rtcConfig),pushConfig:(0,Gg.exists)(e,"pushConfig")?(0,Xr.PushConfigFromJSON)(e.pushConfig):void 0}}function zA(e){if(e!==void 0)return e===null?null:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:e.iceTransportPolicy,rtcProfile:(0,Xr.RtcProfileToJSON)(e.rtcProfile),rtcConfig:(0,Xr.RtcConfigToJSON)(e.rtcConfig),pushConfig:(0,Xr.PushConfigToJSON)(e.pushConfig)}}});var Xg=p(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.ConnectionInfoFromJSON=GA;ka.ConnectionInfoFromJSONTyped=$g;ka.ConnectionInfoToJSON=ZA;var Tu=G();function GA(e){return $g(e,!1)}function $g(e,t){return e==null?e:{localIceCandidate:(0,Tu.IceCandidateFromJSON)(e.localIceCandidate),remoteIceCandidate:(0,Tu.IceCandidateFromJSON)(e.remoteIceCandidate),timestamp:new Date(e.timestamp)}}function ZA(e){if(e!==void 0)return e===null?null:{localIceCandidate:(0,Tu.IceCandidateToJSON)(e.localIceCandidate),remoteIceCandidate:(0,Tu.IceCandidateToJSON)(e.remoteIceCandidate),timestamp:e.timestamp.toISOString()}}});var n_=p($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.ConnectionInfoV2ProtocolEnum=void 0;$n.ConnectionInfoV2FromJSON=QA;$n.ConnectionInfoV2FromJSONTyped=t_;$n.ConnectionInfoV2ToJSON=YA;var Au=Y(),e_=G(),jg;(function(e){e.Udp="udp",e.Tcp="tcp"})(jg||($n.ConnectionInfoV2ProtocolEnum=jg={}));function QA(e){return t_(e,!1)}function t_(e,t){return e==null?e:{type:e.type,protocol:(0,Au.exists)(e,"protocol")?e.protocol:void 0,ipProtocolVersion:(0,Au.exists)(e,"ipProtocolVersion")?(0,e_.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,host:(0,Au.exists)(e,"host")?e.host:void 0,port:(0,Au.exists)(e,"port")?e.port:void 0,timestamp:new Date(e.timestamp)}}function YA(e){if(e!==void 0)return e===null?null:{type:e.type,protocol:e.protocol,ipProtocolVersion:(0,e_.IpProtocolVersionToJSON)(e.ipProtocolVersion),host:e.host,port:e.port,timestamp:e.timestamp.toISOString()}}});var a_=p(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.CreateInstanceRequestFromJSON=XA;Ja.CreateInstanceRequestFromJSONTyped=i_;Ja.CreateInstanceRequestToJSON=jA;var $A=Y(),r_=G();function XA(e){return i_(e,!1)}function i_(e,t){return e==null?e:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,r_.InstanceVersionDataFromJSON)(e.version),expireAt:(0,$A.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function jA(e){if(e!==void 0)return e===null?null:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,r_.InstanceVersionDataToJSON)(e.version),expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var s_=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.CreateInstanceResponseFromJSON=ew;La.CreateInstanceResponseFromJSONTyped=o_;La.CreateInstanceResponseToJSON=tw;var wu=G();function ew(e){return o_(e,!1)}function o_(e,t){return e==null?e:{instance:(0,wu.InstanceFromJSON)(e.instance),config:(0,wu.ConfigFromJSON)(e.config)}}function tw(e){if(e!==void 0)return e===null?null:{instance:(0,wu.InstanceToJSON)(e.instance),config:(0,wu.ConfigToJSON)(e.config)}}});var l_=p(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.DestinationTypeEnum=void 0;Xn.DestinationFromJSON=nw;Xn.DestinationFromJSONTyped=d_;Xn.DestinationToJSON=rw;var c_=G(),u_;(function(e){e.UserId="userId",e.Phonenumber="phonenumber",e.Conference="conference",e.Sip="sip"})(u_||(Xn.DestinationTypeEnum=u_={}));function nw(e){return d_(e,!1)}function d_(e,t){return e==null?e:{domain:(0,c_.DomainFromJSON)(e.domain),type:e.type,identity:e.identity}}function rw(e){if(e!==void 0)return e===null?null:{domain:(0,c_.DomainToJSON)(e.domain),type:e.type,identity:e.identity}}});var p_=p(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Direction=void 0;jn.DirectionFromJSON=iw;jn.DirectionFromJSONTyped=h_;jn.DirectionToJSON=aw;var f_;(function(e){e.Inbound="inbound",e.Outbound="outbound"})(f_||(jn.Direction=f_={}));function iw(e){return h_(e,!1)}function h_(e,t){return e}function aw(e){return e}});var g_=p(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.Domain=void 0;er.DomainFromJSON=ow;er.DomainFromJSONTyped=m_;er.DomainToJSON=sw;var v_;(function(e){e.Mxp="mxp",e.Pstn="pstn",e.Sip="sip",e.Conference="conference"})(v_||(er.Domain=v_={}));function ow(e){return m_(e,!1)}function m_(e,t){return e}function sw(e){return e}});var x_=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.ErrorResponseFromJSON=uw;Ua.ErrorResponseFromJSONTyped=__;Ua.ErrorResponseToJSON=cw;function uw(e){return __(e,!1)}function __(e,t){return e==null?e:{error:e.error}}function cw(e){if(e!==void 0)return e===null?null:{error:e.error}}});var b_=p(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.EventResultTypeEnum=void 0;tr.EventResultFromJSON=dw;tr.EventResultFromJSONTyped=E_;tr.EventResultToJSON=lw;var S_=Y(),C_=G(),y_;(function(e){e.Success="success",e.Failure="failure"})(y_||(tr.EventResultTypeEnum=y_={}));function dw(e){return E_(e,!1)}function E_(e,t){return e==null?e:{type:e.type,errorCode:(0,S_.exists)(e,"errorCode")?e.errorCode:void 0,errorDomain:(0,S_.exists)(e,"errorDomain")?(0,C_.ClientErrorDomainFromJSON)(e.errorDomain):void 0}}function lw(e){if(e!==void 0)return e===null?null:{type:e.type,errorCode:e.errorCode,errorDomain:(0,C_.ClientErrorDomainToJSON)(e.errorDomain)}}});var A_=p(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.EventType=void 0;nr.EventTypeFromJSON=fw;nr.EventTypeFromJSONTyped=T_;nr.EventTypeToJSON=hw;var I_;(function(e){e.ClientEventType="ClientEventType",e.EventResultType="EventResultType"})(I_||(nr.EventType=I_={}));function fw(e){return T_(e,!1)}function T_(e,t){return e}function hw(e){return e}});var O_=p(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.ExtendedCallReportFromJSON=pw;Wa.ExtendedCallReportFromJSONTyped=w_;Wa.ExtendedCallReportToJSON=vw;var Te=Y(),ee=G();function pw(e){return w_(e,!1)}function w_(e,t){return e==null?e:{callId:e.callId,reportId:e.reportId,instance:(0,ee.CallReportInstanceFromJSON)(e.instance),userId:e.userId,from:(0,Te.exists)(e,"from")?(0,ee.OriginFromJSON)(e.from):void 0,to:(0,Te.exists)(e,"to")?(0,ee.DestinationFromJSON)(e.to):void 0,direction:(0,ee.DirectionFromJSON)(e.direction),publicCallHeaders:(0,Te.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,startTime:new Date(e.startTime),duration:e.duration,setupDuration:(0,Te.exists)(e,"setupDuration")?e.setupDuration:void 0,result:(0,ee.CallResultFromJSON)(e.result),localDomain:(0,ee.DomainFromJSON)(e.localDomain),remoteDomain:(0,Te.exists)(e,"remoteDomain")?(0,ee.DomainFromJSON)(e.remoteDomain):void 0,requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,primaryMediaTransportType:(0,Te.exists)(e,"primaryMediaTransportType")?(0,ee.PrimaryMediaTransportTypeFromJSON)(e.primaryMediaTransportType):void 0,primaryIpProtocolVersion:(0,Te.exists)(e,"primaryIpProtocolVersion")?(0,ee.IpProtocolVersionFromJSON)(e.primaryIpProtocolVersion):void 0,connectionInfo:(0,Te.exists)(e,"connectionInfo")?e.connectionInfo.map(ee.ConnectionInfoV2FromJSON):void 0,errors:(0,Te.exists)(e,"errors")?e.errors.map(ee.ClientErrorFromJSON):void 0,pinnedPop:(0,Te.exists)(e,"pinnedPop")?e.pinnedPop:void 0,sdpSemantics:(0,Te.exists)(e,"sdpSemantics")?(0,ee.SdpSemanticsFromJSON)(e.sdpSemantics):void 0,rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:(0,Te.exists)(e,"mxpEventLog")?e.mxpEventLog:void 0,callQuality:(0,Te.exists)(e,"callQuality")?(0,ee.CallQualityFromJSON)(e.callQuality):void 0,audioRouteEventLog:(0,Te.exists)(e,"audioRouteEventLog")?(0,ee.AudioRouteEventLogFromJSON)(e.audioRouteEventLog):void 0,pushProvider:(0,Te.exists)(e,"pushProvider")?(0,ee.PushProviderFromJSON)(e.pushProvider):void 0,clientEvents:(0,Te.exists)(e,"clientEvents")?(0,ee.ClientEventsFromJSON)(e.clientEvents):void 0}}function vw(e){if(e!==void 0)return e===null?null:{callId:e.callId,reportId:e.reportId,instance:(0,ee.CallReportInstanceToJSON)(e.instance),userId:e.userId,from:(0,ee.OriginToJSON)(e.from),to:(0,ee.DestinationToJSON)(e.to),direction:(0,ee.DirectionToJSON)(e.direction),publicCallHeaders:e.publicCallHeaders,startTime:e.startTime.toISOString(),duration:e.duration,setupDuration:e.setupDuration,result:(0,ee.CallResultToJSON)(e.result),localDomain:(0,ee.DomainToJSON)(e.localDomain),remoteDomain:(0,ee.DomainToJSON)(e.remoteDomain),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,hadAudioStreams:e.hadAudioStreams,hadVideoStreams:e.hadVideoStreams,primaryMediaTransportType:(0,ee.PrimaryMediaTransportTypeToJSON)(e.primaryMediaTransportType),primaryIpProtocolVersion:(0,ee.IpProtocolVersionToJSON)(e.primaryIpProtocolVersion),connectionInfo:e.connectionInfo===void 0?void 0:e.connectionInfo.map(ee.ConnectionInfoV2ToJSON),errors:e.errors===void 0?void 0:e.errors.map(ee.ClientErrorToJSON),pinnedPop:e.pinnedPop,sdpSemantics:(0,ee.SdpSemanticsToJSON)(e.sdpSemantics),rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:e.mxpEventLog,callQuality:(0,ee.CallQualityToJSON)(e.callQuality),audioRouteEventLog:(0,ee.AudioRouteEventLogToJSON)(e.audioRouteEventLog),pushProvider:(0,ee.PushProviderToJSON)(e.pushProvider),clientEvents:(0,ee.ClientEventsToJSON)(e.clientEvents)}}});var R_=p(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.ExtendedCallReportAllOfFromJSON=mw;Va.ExtendedCallReportAllOfFromJSONTyped=D_;Va.ExtendedCallReportAllOfToJSON=gw;var Ha=Y(),pn=G();function mw(e){return D_(e,!1)}function D_(e,t){return e==null?e:{rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:(0,Ha.exists)(e,"mxpEventLog")?e.mxpEventLog:void 0,callQuality:(0,Ha.exists)(e,"callQuality")?(0,pn.CallQualityFromJSON)(e.callQuality):void 0,audioRouteEventLog:(0,Ha.exists)(e,"audioRouteEventLog")?(0,pn.AudioRouteEventLogFromJSON)(e.audioRouteEventLog):void 0,pushProvider:(0,Ha.exists)(e,"pushProvider")?(0,pn.PushProviderFromJSON)(e.pushProvider):void 0,clientEvents:(0,Ha.exists)(e,"clientEvents")?(0,pn.ClientEventsFromJSON)(e.clientEvents):void 0}}function gw(e){if(e!==void 0)return e===null?null:{rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:e.mxpEventLog,callQuality:(0,pn.CallQualityToJSON)(e.callQuality),audioRouteEventLog:(0,pn.AudioRouteEventLogToJSON)(e.audioRouteEventLog),pushProvider:(0,pn.PushProviderToJSON)(e.pushProvider),clientEvents:(0,pn.ClientEventsToJSON)(e.clientEvents)}}});var P_=p(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.FcmPushProfileFromJSON=_w;Ka.FcmPushProfileFromJSONTyped=F_;Ka.FcmPushProfileToJSON=xw;function _w(e){return F_(e,!1)}function F_(e,t){return e==null?e:{registrationId:e.registrationId,senderId:e.senderId}}function xw(e){if(e!==void 0)return e===null?null:{registrationId:e.registrationId,senderId:e.senderId}}});var M_=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.IceCandidateFromJSON=Sw;za.IceCandidateFromJSONTyped=N_;za.IceCandidateToJSON=yw;var rr=Y(),vn=G();function Sw(e){return N_(e,!1)}function N_(e,t){return e==null?e:{address:(0,rr.exists)(e,"address")?e.address:void 0,port:(0,rr.exists)(e,"port")?e.port:void 0,ipProtocolVersion:(0,rr.exists)(e,"ipProtocolVersion")?(0,vn.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,type:(0,rr.exists)(e,"type")?(0,vn.IceCandidateTypeFromJSON)(e.type):void 0,transportProtocol:(0,rr.exists)(e,"transportProtocol")?(0,vn.TransportProtocolFromJSON)(e.transportProtocol):void 0,relayProtocol:(0,rr.exists)(e,"relayProtocol")?(0,vn.RelayProtocolFromJSON)(e.relayProtocol):void 0,url:(0,rr.exists)(e,"url")?e.url:void 0}}function yw(e){if(e!==void 0)return e===null?null:{address:e.address,port:e.port,ipProtocolVersion:(0,vn.IpProtocolVersionToJSON)(e.ipProtocolVersion),type:(0,vn.IceCandidateTypeToJSON)(e.type),transportProtocol:(0,vn.TransportProtocolToJSON)(e.transportProtocol),relayProtocol:(0,vn.RelayProtocolToJSON)(e.relayProtocol),url:e.url}}});var k_=p(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.IceCandidateType=void 0;ir.IceCandidateTypeFromJSON=Cw;ir.IceCandidateTypeFromJSONTyped=q_;ir.IceCandidateTypeToJSON=Ew;var B_;(function(e){e.Host="host",e.Srflx="srflx",e.Prflx="prflx",e.Relay="relay",e.Local="local",e.Stun="stun"})(B_||(ir.IceCandidateType=B_={}));function Cw(e){return q_(e,!1)}function q_(e,t){return e}function Ew(e){return e}});var W_=p(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.IceServerCredentialTypeEnum=void 0;ar.IceServerFromJSON=bw;ar.IceServerFromJSONTyped=U_;ar.IceServerToJSON=Iw;var cl=Y(),L_=G(),J_;(function(e){e.Oauth="oauth",e.Password="password"})(J_||(ar.IceServerCredentialTypeEnum=J_={}));function bw(e){return U_(e,!1)}function U_(e,t){return e==null?e:{urls:e.urls,username:(0,cl.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,cl.exists)(e,"password")?e.password:void 0,oauthCredential:(0,cl.exists)(e,"oauthCredential")?(0,L_.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0,validUntil:new Date(e.validUntil)}}function Iw(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,L_.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential),validUntil:e.validUntil.toISOString()}}});var V_=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.IceServerAllOfFromJSON=Tw;Ga.IceServerAllOfFromJSONTyped=H_;Ga.IceServerAllOfToJSON=Aw;function Tw(e){return H_(e,!1)}function H_(e,t){return e==null?e:{validUntil:new Date(e.validUntil)}}function Aw(e){if(e!==void 0)return e===null?null:{validUntil:e.validUntil.toISOString()}}});var G_=p(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.IceServersResponseFromJSON=ww;Za.IceServersResponseFromJSONTyped=z_;Za.IceServersResponseToJSON=Ow;var K_=G();function ww(e){return z_(e,!1)}function z_(e,t){return e==null?e:{iceServers:e.iceServers.map(K_.IceServerFromJSON)}}function Ow(e){if(e!==void 0)return e===null?null:{iceServers:e.iceServers.map(K_.IceServerToJSON)}}});var Y_=p(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.InstanceFromJSON=Rw;Qa.InstanceFromJSONTyped=Q_;Qa.InstanceToJSON=Fw;var Dw=Y(),Z_=G();function Rw(e){return Q_(e,!1)}function Q_(e,t){return e==null?e:{id:e.id,secret:e.secret,deviceId:(0,Dw.exists)(e,"deviceId")?e.deviceId:void 0,expireAt:new Date(e.expireAt),capabilities:e.capabilities,version:(0,Z_.InstanceVersionDataFromJSON)(e.version)}}function Fw(e){if(e!==void 0)return e===null?null:{id:e.id,secret:e.secret,deviceId:e.deviceId,expireAt:e.expireAt.toISOString(),capabilities:e.capabilities,version:(0,Z_.InstanceVersionDataToJSON)(e.version)}}});var ex=p(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.InstanceVersionDataFromJSON=Pw;Ya.InstanceVersionDataFromJSONTyped=j_;Ya.InstanceVersionDataToJSON=Nw;var $_=Y(),X_=G();function Pw(e){return j_(e,!1)}function j_(e,t){return e==null?e:{platform:(0,X_.PlatformIdentifierFromJSON)(e.platform),os:e.os,osName:(0,$_.exists)(e,"osName")?e.osName:void 0,osVersion:(0,$_.exists)(e,"osVersion")?e.osVersion:void 0,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}function Nw(e){if(e!==void 0)return e===null?null:{platform:(0,X_.PlatformIdentifierToJSON)(e.platform),os:e.os,osName:e.osName,osVersion:e.osVersion,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}});var rx=p(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.IpProtocolVersion=void 0;or.IpProtocolVersionFromJSON=Mw;or.IpProtocolVersionFromJSONTyped=nx;or.IpProtocolVersionToJSON=Bw;var tx;(function(e){e.Ipv4="ipv4",e.Ipv6="ipv6",e.Unknown="unknown"})(tx||(or.IpProtocolVersion=tx={}));function Mw(e){return nx(e,!1)}function nx(e,t){return e}function Bw(e){return e}});var ox=p(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.MediaStreamType=void 0;sr.MediaStreamTypeFromJSON=qw;sr.MediaStreamTypeFromJSONTyped=ax;sr.MediaStreamTypeToJSON=kw;var ix;(function(e){e.Audio="audio",e.Video="video"})(ix||(sr.MediaStreamType=ix={}));function qw(e){return ax(e,!1)}function ax(e,t){return e}function kw(e){return e}});var ux=p($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.ModelErrorFromJSON=Lw;$a.ModelErrorFromJSONTyped=sx;$a.ModelErrorToJSON=Uw;var Jw=Y();function Lw(e){return sx(e,!1)}function sx(e,t){return e==null?e:{code:e.code,message:e.message,reference:(0,Jw.exists)(e,"reference")?e.reference:void 0}}function Uw(e){if(e!==void 0)return e===null?null:{code:e.code,message:e.message,reference:e.reference}}});var dx=p(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.MxpPubSubConfigFromJSON=Hw;Xa.MxpPubSubConfigFromJSONTyped=cx;Xa.MxpPubSubConfigToJSON=Vw;var Ww=Y();function Hw(e){return cx(e,!1)}function cx(e,t){return e==null?e:{hostname:e.hostname,signalSubscribeKey:e.signalSubscribeKey,signalPublishKey:e.signalPublishKey,broadcastSubscribeKey:e.broadcastSubscribeKey,pubnubClientId:(0,Ww.exists)(e,"pubnubClientId")?e.pubnubClientId:void 0}}function Vw(e){if(e!==void 0)return e===null?null:{hostname:e.hostname,signalSubscribeKey:e.signalSubscribeKey,signalPublishKey:e.signalPublishKey,broadcastSubscribeKey:e.broadcastSubscribeKey,pubnubClientId:e.pubnubClientId}}});var fx=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.OpaquePushProfileFromJSON=Kw;ja.OpaquePushProfileFromJSONTyped=lx;ja.OpaquePushProfileToJSON=zw;function Kw(e){return lx(e,!1)}function lx(e,t){return e==null?e:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}function zw(e){if(e!==void 0)return e===null?null:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}});var vx=p(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.OriginFromJSON=Zw;eo.OriginFromJSONTyped=px;eo.OriginToJSON=Qw;var Gw=Y(),hx=G();function Zw(e){return px(e,!1)}function px(e,t){return e==null?e:{domain:(0,Gw.exists)(e,"domain")?(0,hx.DomainFromJSON)(e.domain):void 0,identity:e.identity}}function Qw(e){if(e!==void 0)return e===null?null:{domain:(0,hx.DomainToJSON)(e.domain),identity:e.identity}}});var _x=p(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.PlatformIdentifier=void 0;ur.PlatformIdentifierFromJSON=Yw;ur.PlatformIdentifierFromJSONTyped=gx;ur.PlatformIdentifierToJSON=$w;var mx;(function(e){e.Ios="ios",e.Android="android",e.Js="js",e.Test="test"})(mx||(ur.PlatformIdentifier=mx={}));function Yw(e){return gx(e,!1)}function gx(e,t){return e}function $w(e){return e}});var yx=p(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.PrimaryMediaTransportType=void 0;cr.PrimaryMediaTransportTypeFromJSON=Xw;cr.PrimaryMediaTransportTypeFromJSONTyped=Sx;cr.PrimaryMediaTransportTypeToJSON=jw;var xx;(function(e){e.Proxy="proxy",e.P2p="p2p"})(xx||(cr.PrimaryMediaTransportType=xx={}));function Xw(e){return Sx(e,!1)}function Sx(e,t){return e}function jw(e){return e}});var bx=p(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.PushConfigFromJSON=eO;to.PushConfigFromJSONTyped=Ex;to.PushConfigToJSON=tO;var Cx=Y();function eO(e){return Ex(e,!1)}function Ex(e,t){return e==null?e:{fcmSenderId:(0,Cx.exists)(e,"fcmSenderId")?e.fcmSenderId:void 0,w3cApplicationServerKey:(0,Cx.exists)(e,"w3cApplicationServerKey")?e.w3cApplicationServerKey:void 0}}function tO(e){if(e!==void 0)return e===null?null:{fcmSenderId:e.fcmSenderId,w3cApplicationServerKey:e.w3cApplicationServerKey}}});var Ax=p(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.PushNotificationFromJSON=nO;no.PushNotificationFromJSONTyped=Tx;no.PushNotificationToJSON=rO;var Ix=G();function nO(e){return Tx(e,!1)}function Tx(e,t){return e==null?e:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(Ix.PushNotificationDestinationFromJSON)}}function rO(e){if(e!==void 0)return e===null?null:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(Ix.PushNotificationDestinationToJSON)}}});var Ox=p(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.PushNotificationDestinationFromJSON=iO;ro.PushNotificationDestinationFromJSONTyped=wx;ro.PushNotificationDestinationToJSON=aO;function iO(e){return wx(e,!1)}function wx(e,t){return e==null?e:{userId:e.userId,instanceId:e.instanceId}}function aO(e){if(e!==void 0)return e===null?null:{userId:e.userId,instanceId:e.instanceId}}});var Rx=p(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.PushProfileFromJSON=oO;io.PushProfileFromJSONTyped=Dx;io.PushProfileToJSON=sO;var jr=Y(),Ct=G();function oO(e){return Dx(e,!1)}function Dx(e,t){return e==null?e:{maxPayloadSize:(0,jr.exists)(e,"maxPayloadSize")?e.maxPayloadSize:void 0,apn:(0,jr.exists)(e,"apn")?e.apn.map(Ct.ApnPushProfileFromJSON):void 0,fcm:(0,jr.exists)(e,"fcm")?(0,Ct.FcmPushProfileFromJSON)(e.fcm):void 0,opaque:(0,jr.exists)(e,"opaque")?(0,Ct.OpaquePushProfileFromJSON)(e.opaque):void 0,upa:(0,jr.exists)(e,"upa")?(0,Ct.UpaPushProfileFromJSON)(e.upa):void 0,w3c:(0,jr.exists)(e,"w3c")?(0,Ct.W3CPushProfileFromJSON)(e.w3c):void 0}}function sO(e){if(e!==void 0)return e===null?null:{maxPayloadSize:e.maxPayloadSize,apn:e.apn===void 0?void 0:e.apn.map(Ct.ApnPushProfileToJSON),fcm:(0,Ct.FcmPushProfileToJSON)(e.fcm),opaque:(0,Ct.OpaquePushProfileToJSON)(e.opaque),upa:(0,Ct.UpaPushProfileToJSON)(e.upa),w3c:(0,Ct.W3CPushProfileToJSON)(e.w3c)}}});var Nx=p(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.PushProvider=void 0;dr.PushProviderFromJSON=uO;dr.PushProviderFromJSONTyped=Px;dr.PushProviderToJSON=cO;var Fx;(function(e){e.Apns="apns",e.Fcm="fcm",e.HuaweiHms="huawei-hms",e.W3c="w3c"})(Fx||(dr.PushProvider=Fx={}));function uO(e){return Px(e,!1)}function Px(e,t){return e}function cO(e){return e}});var qx=p(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.RelayProtocol=void 0;lr.RelayProtocolFromJSON=dO;lr.RelayProtocolFromJSONTyped=Bx;lr.RelayProtocolToJSON=lO;var Mx;(function(e){e.Udp="udp",e.Tcp="tcp",e.Tls="tls"})(Mx||(lr.RelayProtocol=Mx={}));function dO(e){return Bx(e,!1)}function Bx(e,t){return e}function lO(e){return e}});var Lx=p(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.RemotePeerInstanceFromJSON=fO;ao.RemotePeerInstanceFromJSONTyped=Jx;ao.RemotePeerInstanceToJSON=hO;var dl=Y(),kx=G();function fO(e){return Jx(e,!1)}function Jx(e,t){return e==null?e:{id:(0,dl.exists)(e,"id")?e.id:void 0,capabilities:(0,dl.exists)(e,"capabilities")?e.capabilities:void 0,pushProfile:(0,dl.exists)(e,"pushProfile")?(0,kx.RemotePeerInstancePushProfileFromJSON)(e.pushProfile):void 0}}function hO(e){if(e!==void 0)return e===null?null:{id:e.id,capabilities:e.capabilities,pushProfile:(0,kx.RemotePeerInstancePushProfileToJSON)(e.pushProfile)}}});var Wx=p(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.RemotePeerInstancePushProfileFromJSON=vO;oo.RemotePeerInstancePushProfileFromJSONTyped=Ux;oo.RemotePeerInstancePushProfileToJSON=mO;var pO=Y();function vO(e){return Ux(e,!1)}function Ux(e,t){return e==null?e:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:(0,pO.exists)(e,"legacyPushData")?e.legacyPushData:void 0}}function mO(e){if(e!==void 0)return e===null?null:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:e.legacyPushData}}});var Kx=p(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.RtcConfigFromJSON=_O;so.RtcConfigFromJSONTyped=Vx;so.RtcConfigToJSON=xO;var gO=Y(),Hx=G();function _O(e){return Vx(e,!1)}function Vx(e,t){return e==null?e:{mxpPubSubConfig:(0,Hx.MxpPubSubConfigFromJSON)(e.mxpPubSubConfig),legacyStunUrls:(0,gO.exists)(e,"legacyStunUrls")?e.legacyStunUrls:void 0}}function xO(e){if(e!==void 0)return e===null?null:{mxpPubSubConfig:(0,Hx.MxpPubSubConfigToJSON)(e.mxpPubSubConfig),legacyStunUrls:e.legacyStunUrls}}});var Gx=p(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.RtcProfileFromJSON=SO;uo.RtcProfileFromJSONTyped=zx;uo.RtcProfileToJSON=yO;function SO(e){return zx(e,!1)}function zx(e,t){return e==null?e:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}function yO(e){if(e!==void 0)return e===null?null:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}});var Yx=p(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.SdpSemantics=void 0;fr.SdpSemanticsFromJSON=CO;fr.SdpSemanticsFromJSONTyped=Qx;fr.SdpSemanticsToJSON=EO;var Zx;(function(e){e.PlanB="planB",e.UnifiedPlan="unifiedPlan"})(Zx||(fr.SdpSemantics=Zx={}));function CO(e){return Qx(e,!1)}function Qx(e,t){return e}function EO(e){return e}});var Xx=p(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.SemanticVersionFromJSON=bO;co.SemanticVersionFromJSONTyped=$x;co.SemanticVersionToJSON=IO;function bO(e){return $x(e,!1)}function $x(e,t){return e==null?e:{major:e.major,minor:e.minor}}function IO(e){if(e!==void 0)return e===null?null:{major:e.major,minor:e.minor}}});var t1=p(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.TransportProtocol=void 0;hr.TransportProtocolFromJSON=TO;hr.TransportProtocolFromJSONTyped=e1;hr.TransportProtocolToJSON=AO;var jx;(function(e){e.Tcp="tcp",e.Udp="udp"})(jx||(hr.TransportProtocol=jx={}));function TO(e){return e1(e,!1)}function e1(e,t){return e}function AO(e){return e}});var r1=p(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.UpaPushProfileFromJSON=wO;lo.UpaPushProfileFromJSONTyped=n1;lo.UpaPushProfileToJSON=OO;function wO(e){return n1(e,!1)}function n1(e,t){return e==null?e:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}function OO(e){if(e!==void 0)return e===null?null:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}});var o1=p(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.UpdateInstanceRequestFromJSON=DO;fo.UpdateInstanceRequestFromJSONTyped=a1;fo.UpdateInstanceRequestToJSON=RO;var i1=G();function DO(e){return a1(e,!1)}function a1(e,t){return e==null?e:{capabilities:e.capabilities,version:(0,i1.InstanceVersionDataFromJSON)(e.version)}}function RO(e){if(e!==void 0)return e===null?null:{capabilities:e.capabilities,version:(0,i1.InstanceVersionDataToJSON)(e.version)}}});var u1=p(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.UpdateInstanceTtlRequestFromJSON=PO;ho.UpdateInstanceTtlRequestFromJSONTyped=s1;ho.UpdateInstanceTtlRequestToJSON=NO;var FO=Y();function PO(e){return s1(e,!1)}function s1(e,t){return e==null?e:{expireAt:(0,FO.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function NO(e){if(e!==void 0)return e===null?null:{expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var d1=p(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.UpdateInstanceTtlResponseFromJSON=MO;po.UpdateInstanceTtlResponseFromJSONTyped=c1;po.UpdateInstanceTtlResponseToJSON=BO;function MO(e){return c1(e,!1)}function c1(e,t){return e==null?e:{instanceId:e.instanceId,expireAt:new Date(e.expireAt)}}function BO(e){if(e!==void 0)return e===null?null:{instanceId:e.instanceId,expireAt:e.expireAt.toISOString()}}});var f1=p(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.UserDebugInfoResponseFromJSON=qO;vo.UserDebugInfoResponseFromJSONTyped=l1;vo.UserDebugInfoResponseToJSON=kO;function qO(e){return l1(e,!1)}function l1(e,t){return e==null?e:{createdAt:new Date(e.createdAt),blocked:e.blocked,instanceCount:e.instanceCount,pushProfileCount:e.pushProfileCount,instanceIds:e.instanceIds}}function kO(e){if(e!==void 0)return e===null?null:{createdAt:e.createdAt.toISOString(),blocked:e.blocked,instanceCount:e.instanceCount,pushProfileCount:e.pushProfileCount,instanceIds:e.instanceIds}}});var v1=p(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.W3CPushProfileFromJSON=JO;mo.W3CPushProfileFromJSONTyped=p1;mo.W3CPushProfileToJSON=LO;var h1=G();function JO(e){return p1(e,!1)}function p1(e,t){return e==null?e:{endpoint:e.endpoint,keys:(0,h1.W3CPushProfileKeysFromJSON)(e.keys),expirationTime:new Date(e.expirationTime),applicationServerKey:e.applicationServerKey}}function LO(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,keys:(0,h1.W3CPushProfileKeysToJSON)(e.keys),expirationTime:e.expirationTime.toISOString(),applicationServerKey:e.applicationServerKey}}});var g1=p(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.W3CPushProfileKeysFromJSON=UO;go.W3CPushProfileKeysFromJSONTyped=m1;go.W3CPushProfileKeysToJSON=WO;function UO(e){return m1(e,!1)}function m1(e,t){return e==null?e:{p256dh:e.p256dh,auth:e.auth}}function WO(e){if(e!==void 0)return e===null?null:{p256dh:e.p256dh,auth:e.auth}}});var x1=p(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.WarningEventFromJSON=VO;_o.WarningEventFromJSONTyped=_1;_o.WarningEventToJSON=KO;var HO=Y(),ei=G();function VO(e){return _1(e,!1)}function _1(e,t){return e==null?e:{name:(0,ei.WarningEventNameFromJSON)(e.name),time:new Date(e.time),type:(0,ei.WarningEventTypeFromJSON)(e.type),mediaStreamType:(0,HO.exists)(e,"mediaStreamType")?(0,ei.MediaStreamTypeFromJSON)(e.mediaStreamType):void 0}}function KO(e){if(e!==void 0)return e===null?null:{name:(0,ei.WarningEventNameToJSON)(e.name),time:e.time.toISOString(),type:(0,ei.WarningEventTypeToJSON)(e.type),mediaStreamType:(0,ei.MediaStreamTypeToJSON)(e.mediaStreamType)}}});var C1=p(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.WarningEventName=void 0;pr.WarningEventNameFromJSON=zO;pr.WarningEventNameFromJSONTyped=y1;pr.WarningEventNameToJSON=GO;var S1;(function(e){e.HighRemoteInboundRtt="highRemoteInboundRtt",e.HighInboundJitter="highInboundJitter",e.HighInboundPacketLoss="highInboundPacketLoss",e.MissingMediaStream="missingMediaStream",e.ConstantInboundAudioLevel="constantInboundAudioLevel",e.ConstantOutboundAudioLevel="constantOutboundAudioLevel",e.LowOsOutputVolumeLevel="lowOSOutputVolumeLevel",e.ZeroInboundAudioLevel="zeroInboundAudioLevel",e.ZeroOutboundAudioLevel="zeroOutboundAudioLevel"})(S1||(pr.WarningEventName=S1={}));function zO(e){return y1(e,!1)}function y1(e,t){return e}function GO(e){return e}});var I1=p(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.WarningEventType=void 0;vr.WarningEventTypeFromJSON=ZO;vr.WarningEventTypeFromJSONTyped=b1;vr.WarningEventTypeToJSON=QO;var E1;(function(e){e.Trigger="trigger",e.Recover="recover"})(E1||(vr.WarningEventType=E1={}));function ZO(e){return b1(e,!1)}function b1(e,t){return e}function QO(e){return e}});var O1=p(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.WebrtcRTCIceServerCredentialTypeEnum=void 0;mr.WebrtcRTCIceServerFromJSON=YO;mr.WebrtcRTCIceServerFromJSONTyped=w1;mr.WebrtcRTCIceServerToJSON=$O;var ll=Y(),A1=G(),T1;(function(e){e.Oauth="oauth",e.Password="password"})(T1||(mr.WebrtcRTCIceServerCredentialTypeEnum=T1={}));function YO(e){return w1(e,!1)}function w1(e,t){return e==null?e:{urls:e.urls,username:(0,ll.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,ll.exists)(e,"password")?e.password:void 0,oauthCredential:(0,ll.exists)(e,"oauthCredential")?(0,A1.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0}}function $O(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,A1.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential)}}});var R1=p(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.WebrtcRTCOAuthCredentialFromJSON=XO;xo.WebrtcRTCOAuthCredentialFromJSONTyped=D1;xo.WebrtcRTCOAuthCredentialToJSON=jO;function XO(e){return D1(e,!1)}function D1(e,t){return e==null?e:{macKey:e.macKey,accessToken:e.accessToken}}function jO(e){if(e!==void 0)return e===null?null:{macKey:e.macKey,accessToken:e.accessToken}}});var P1=p(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.WebrtcRTCSessionDescriptionFromJSON=e2;So.WebrtcRTCSessionDescriptionFromJSONTyped=F1;So.WebrtcRTCSessionDescriptionToJSON=t2;function e2(e){return F1(e,!1)}function F1(e,t){return e==null?e:{type:e.type,sdp:e.sdp}}function t2(e){if(e!==void 0)return e===null?null:{type:e.type,sdp:e.sdp}}});var G=p(q=>{"use strict";var n2=q&&q.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),U=q&&q.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&n2(t,e,n)};Object.defineProperty(q,"__esModule",{value:!0});U(vg(),q);U(gg(),q);U(xg(),q);U(yg(),q);U(Eg(),q);U(Tg(),q);U(wg(),q);U(Dg(),q);U(Pg(),q);U(Bg(),q);U(Jg(),q);U(Wg(),q);U(Vg(),q);U(zg(),q);U(Yg(),q);U(Xg(),q);U(n_(),q);U(a_(),q);U(s_(),q);U(l_(),q);U(p_(),q);U(g_(),q);U(x_(),q);U(b_(),q);U(A_(),q);U(O_(),q);U(R_(),q);U(P_(),q);U(M_(),q);U(k_(),q);U(W_(),q);U(V_(),q);U(G_(),q);U(Y_(),q);U(ex(),q);U(rx(),q);U(ox(),q);U(ux(),q);U(dx(),q);U(fx(),q);U(vx(),q);U(_x(),q);U(yx(),q);U(bx(),q);U(Ax(),q);U(Ox(),q);U(Rx(),q);U(Nx(),q);U(qx(),q);U(Lx(),q);U(Wx(),q);U(Kx(),q);U(Gx(),q);U(Yx(),q);U(Xx(),q);U(t1(),q);U(r1(),q);U(o1(),q);U(u1(),q);U(d1(),q);U(f1(),q);U(v1(),q);U(g1(),q);U(x1(),q);U(C1(),q);U(I1(),q);U(O1(),q);U(R1(),q);U(P1(),q)});var B1=p(ti=>{"use strict";var N1=ti&&ti.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ti,"__esModule",{value:!0});ti.CallApi=void 0;var fl=Y(),M1=G(),hl=class extends fl.BaseAPI{initiateCallRaw(t){return N1(this,void 0,void 0,function*(){if(t.callInitiationRequest===null||t.callInitiationRequest===void 0)throw new fl.RequiredError("callInitiationRequest","Required parameter requestParameters.callInitiationRequest was null or undefined when calling initiateCall.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v2/calls",method:"POST",headers:r,query:n,body:(0,M1.CallInitiationRequestToJSON)(t.callInitiationRequest)});return new fl.JSONApiResponse(i,a=>(0,M1.CallInitiationResponseFromJSON)(a))})}initiateCall(t){return N1(this,void 0,void 0,function*(){return yield(yield this.initiateCallRaw(t)).value()})}};ti.CallApi=hl});var k1=p(ni=>{"use strict";var q1=ni&&ni.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ni,"__esModule",{value:!0});ni.CallReportApi=void 0;var pl=Y(),r2=G(),vl=class extends pl.BaseAPI{createCallReportRaw(t){return q1(this,void 0,void 0,function*(){if(t.callReport===null||t.callReport===void 0)throw new pl.RequiredError("callReport","Required parameter requestParameters.callReport was null or undefined when calling createCallReport.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v3/callReports",method:"POST",headers:r,query:n,body:(0,r2.CallReportToJSON)(t.callReport)});return new pl.VoidApiResponse(i)})}createCallReport(t){return q1(this,void 0,void 0,function*(){yield this.createCallReportRaw(t)})}};ni.CallReportApi=vl});var L1=p(ri=>{"use strict";var J1=ri&&ri.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ri,"__esModule",{value:!0});ri.ConfigApi=void 0;var Ou=Y(),i2=G(),ml=class extends Ou.BaseAPI{getConfigRaw(t){return J1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ou.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getConfig.");if(t.instanceId===null||t.instanceId===void 0)throw new Ou.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling getConfig.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/config".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"GET",headers:r,query:n});return new Ou.JSONApiResponse(i,a=>(0,i2.ConfigFromJSON)(a))})}getConfig(t){return J1(this,void 0,void 0,function*(){return yield(yield this.getConfigRaw(t)).value()})}};ri.ConfigApi=ml});var W1=p(ii=>{"use strict";var U1=ii&&ii.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ii,"__esModule",{value:!0});ii.DebugApi=void 0;var gl=Y(),a2=G(),_l=class extends gl.BaseAPI{getUserDebugInfoRaw(t){return U1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new gl.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getUserDebugInfo.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("jwtAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/debugInfo".replace("{userId}",encodeURIComponent(String(t.userId))),method:"GET",headers:r,query:n});return new gl.JSONApiResponse(i,a=>(0,a2.UserDebugInfoResponseFromJSON)(a))})}getUserDebugInfo(t){return U1(this,void 0,void 0,function*(){return yield(yield this.getUserDebugInfoRaw(t)).value()})}};ii.DebugApi=_l});var V1=p(ai=>{"use strict";var H1=ai&&ai.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ai,"__esModule",{value:!0});ai.FeatureFlagsApi=void 0;var Du=Y(),xl=class extends Du.BaseAPI{getFeatureFlagsRaw(t){return H1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Du.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getFeatureFlags.");if(t.instanceId===null||t.instanceId===void 0)throw new Du.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling getFeatureFlags.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/featureFlags".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"GET",headers:r,query:n});return new Du.JSONApiResponse(i)})}getFeatureFlags(t){return H1(this,void 0,void 0,function*(){return yield(yield this.getFeatureFlagsRaw(t)).value()})}};ai.FeatureFlagsApi=xl});var z1=p(oi=>{"use strict";var K1=oi&&oi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(oi,"__esModule",{value:!0});oi.IceApi=void 0;var Ru=Y(),o2=G(),Sl=class extends Ru.BaseAPI{getIceServersRaw(t){return K1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ru.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getIceServers.");if(t.instanceId===null||t.instanceId===void 0)throw new Ru.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling getIceServers.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/iceServers".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"GET",headers:r,query:n});return new Ru.JSONApiResponse(i,a=>(0,o2.IceServersResponseFromJSON)(a))})}getIceServers(t){return K1(this,void 0,void 0,function*(){return yield(yield this.getIceServersRaw(t)).value()})}};oi.IceApi=Sl});var G1=p(ci=>{"use strict";var si=ci&&ci.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ci,"__esModule",{value:!0});ci.InstanceApi=void 0;var Xe=Y(),ui=G(),yl=class extends Xe.BaseAPI{createInstanceRaw(t){return si(this,void 0,void 0,function*(){if(t.applicationKey===null||t.applicationKey===void 0)throw new Xe.RequiredError("applicationKey","Required parameter requestParameters.applicationKey was null or undefined when calling createInstance.");if(t.createInstanceRequest===null||t.createInstanceRequest===void 0)throw new Xe.RequiredError("createInstanceRequest","Required parameter requestParameters.createInstanceRequest was null or undefined when calling createInstance.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("jwtAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v2/applications/{applicationKey}/instances".replace("{applicationKey}",encodeURIComponent(String(t.applicationKey))),method:"POST",headers:r,query:n,body:(0,ui.CreateInstanceRequestToJSON)(t.createInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ui.CreateInstanceResponseFromJSON)(a))})}createInstance(t){return si(this,void 0,void 0,function*(){return yield(yield this.createInstanceRaw(t)).value()})}updateInstanceRaw(t){return si(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Xe.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling updateInstance.");if(t.instanceId===null||t.instanceId===void 0)throw new Xe.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling updateInstance.");if(t.updateInstanceRequest===null||t.updateInstanceRequest===void 0)throw new Xe.RequiredError("updateInstanceRequest","Required parameter requestParameters.updateInstanceRequest was null or undefined when calling updateInstance.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("jwtAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"PUT",headers:r,query:n,body:(0,ui.UpdateInstanceRequestToJSON)(t.updateInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ui.InstanceFromJSON)(a))})}updateInstance(t){return si(this,void 0,void 0,function*(){return yield(yield this.updateInstanceRaw(t)).value()})}updateInstanceTtlRaw(t){return si(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Xe.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling updateInstanceTtl.");if(t.instanceId===null||t.instanceId===void 0)throw new Xe.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling updateInstanceTtl.");if(t.updateInstanceTtlRequest===null||t.updateInstanceTtlRequest===void 0)throw new Xe.RequiredError("updateInstanceTtlRequest","Required parameter requestParameters.updateInstanceTtlRequest was null or undefined when calling updateInstanceTtl.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("jwtAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/expireAt".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"PUT",headers:r,query:n,body:(0,ui.UpdateInstanceTtlRequestToJSON)(t.updateInstanceTtlRequest)});return new Xe.JSONApiResponse(i,a=>(0,ui.UpdateInstanceTtlResponseFromJSON)(a))})}updateInstanceTtl(t){return si(this,void 0,void 0,function*(){return yield(yield this.updateInstanceTtlRaw(t)).value()})}};ci.InstanceApi=yl});var Z1=p(di=>{"use strict";var je=di&&di.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(di,"__esModule",{value:!0});di.PushApi=void 0;var Ee=Y(),Fu=G(),Cl=class extends Ee.BaseAPI{deleteAllUserPushProfilesRaw(t){return je(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ee.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling deleteAllUserPushProfiles.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("jwtAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/pushProfiles".replace("{userId}",encodeURIComponent(String(t.userId))),method:"DELETE",headers:r,query:n});return new Ee.VoidApiResponse(i)})}deleteAllUserPushProfiles(t){return je(this,void 0,void 0,function*(){yield this.deleteAllUserPushProfilesRaw(t)})}deletePushProfileRaw(t){return je(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ee.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling deletePushProfile.");if(t.instanceId===null||t.instanceId===void 0)throw new Ee.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling deletePushProfile.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/pushProfile".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"DELETE",headers:r,query:n});return new Ee.VoidApiResponse(i)})}deletePushProfile(t){return je(this,void 0,void 0,function*(){yield this.deletePushProfileRaw(t)})}getPushProfileRaw(t){return je(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ee.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getPushProfile.");if(t.instanceId===null||t.instanceId===void 0)throw new Ee.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling getPushProfile.");let n={},r={};if(this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/pushProfile".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"GET",headers:r,query:n});return new Ee.JSONApiResponse(i,a=>(0,Fu.PushProfileFromJSON)(a))})}getPushProfile(t){return je(this,void 0,void 0,function*(){return yield(yield this.getPushProfileRaw(t)).value()})}sendPushNotificationRaw(t){return je(this,void 0,void 0,function*(){if(t.pushNotification===null||t.pushNotification===void 0)throw new Ee.RequiredError("pushNotification","Required parameter requestParameters.pushNotification was null or undefined when calling sendPushNotification.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/pushNotifications",method:"POST",headers:r,query:n,body:(0,Fu.PushNotificationToJSON)(t.pushNotification)});return new Ee.VoidApiResponse(i)})}sendPushNotification(t){return je(this,void 0,void 0,function*(){yield this.sendPushNotificationRaw(t)})}sendPushNotificationsRaw(t){return je(this,void 0,void 0,function*(){if(t.pushNotification===null||t.pushNotification===void 0)throw new Ee.RequiredError("pushNotification","Required parameter requestParameters.pushNotification was null or undefined when calling sendPushNotifications.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v2/pushNotifications",method:"POST",headers:r,query:n,body:t.pushNotification.map(Fu.PushNotificationToJSON)});return new Ee.VoidApiResponse(i)})}sendPushNotifications(t){return je(this,void 0,void 0,function*(){yield this.sendPushNotificationsRaw(t)})}updatePushProfileRaw(t){return je(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Ee.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling updatePushProfile.");if(t.instanceId===null||t.instanceId===void 0)throw new Ee.RequiredError("instanceId","Required parameter requestParameters.instanceId was null or undefined when calling updatePushProfile.");if(t.pushProfile===null||t.pushProfile===void 0)throw new Ee.RequiredError("pushProfile","Required parameter requestParameters.pushProfile was null or undefined when calling updatePushProfile.");let n={},r={};if(r["Content-Type"]="application/json",this.configuration&&this.configuration.accessToken){let a=this.configuration.accessToken,s=typeof a=="function"?a("instanceAuth",[]):a;s&&(r.Authorization=`Bearer ${s}`)}let i=yield this.request({path:"/v1/users/{userId}/instances/{instanceId}/pushProfile".replace("{userId}",encodeURIComponent(String(t.userId))).replace("{instanceId}",encodeURIComponent(String(t.instanceId))),method:"PUT",headers:r,query:n,body:(0,Fu.PushProfileToJSON)(t.pushProfile)});return new Ee.VoidApiResponse(i)})}updatePushProfile(t){return je(this,void 0,void 0,function*(){yield this.updatePushProfileRaw(t)})}};di.PushApi=Cl});var El=p(Be=>{"use strict";var s2=Be&&Be.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),mn=Be&&Be.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&s2(t,e,n)};Object.defineProperty(Be,"__esModule",{value:!0});mn(B1(),Be);mn(k1(),Be);mn(L1(),Be);mn(W1(),Be);mn(V1(),Be);mn(z1(),Be);mn(G1(),Be);mn(Z1(),Be)});var qe=p(Vt=>{"use strict";var u2=Vt&&Vt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),bl=Vt&&Vt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&u2(t,e,n)};Object.defineProperty(Vt,"__esModule",{value:!0});bl(Y(),Vt);bl(El(),Vt);bl(G(),Vt)});var Q1=p(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.Codec=void 0;var De=Gn(),c2=qe(),Pu=ht(),Il=ft(),Tl=class{static encrypt(t,n){let r=De.lib.WordArray.random(16);return this.encodeWithIV(t,n,r)}static encodeWithIV(t,n,r){let i=De.lib.WordArray.create([]),a=De.enc.Utf8.parse(t),s=De.AES.encrypt(a,n.key,{iv:r,mode:De.mode.CBC,padding:De.pad.Pkcs7});return i.concat(r),i.concat(s.ciphertext),De.enc.Base64.stringify(i)}static decrypt(t,n){let r=De.enc.Base64.parse(t),i=De.lib.WordArray.create(r.words.slice(0,4)),a=De.lib.WordArray.create(r.words.slice(4)),s=De.enc.Base64.stringify(a);return De.AES.decrypt(s,n.key,{iv:i,mode:De.mode.CBC,padding:De.pad.Pkcs7}).toString(De.enc.Utf8).trim()}static encodeClient(t){let n={fs:t.channel,fc:t.cli,fd:t.deviceDescription,fi:t.instanceId,fu:t.userId};return new Il.Body(Il.Body.clientType,JSON.stringify(n))}static decodeClient(t){if(t.type!==Il.Body.clientType)throw new Pu.MXPError(Pu.MXPError.Codes.INVALID_BODY_TYPE);try{let n=JSON.parse(t.data);return{userId:n.fu,channel:n.fs,cli:n.fc,deviceDescription:n.fd,instanceId:n.fi,domain:c2.Domain.Mxp}}catch{throw new Pu.MXPError(Pu.MXPError.Codes.BODY_PARSE_FAIL)}}};Nu.Codec=Tl});var ht=p(Ve=>{"use strict";var d2=Ve&&Ve.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),gr=Ve&&Ve.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&d2(t,e,n)};Object.defineProperty(Ve,"__esModule",{value:!0});gr(ws(),Ve);gr(G0(),Ve);gr(cg(),Ve);gr($0(),Ve);gr(dg(),Ve);gr(lg(),Ve);gr(Q1(),Ve)});var Y1=p(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.JsepMessage=void 0;var l2=ht(),Al=class e{static mapType(t){return t.type?t.type:"candidate"}static mapPayload(t,n){return t=="candidate"?JSON.stringify(n):n.sdp}static tryParse(t,n){let r=t.getSdp(),i=new Array;if(r){let a=this.mapType(r);i.push(new e(a,this.mapPayload(a,r),t.from.instanceId))}return t.method==l2.Method.Join&&i.push(new e("join","",t.from.instanceId)),i.length==0?!1:(n(i),!0)}constructor(t,n,r){this.type=t,this.data=n,this.instanceId=r}get isOffer(){return this.type=="offer"}get isAnswer(){return this.type=="answer"}get isCandidate(){return this.type=="candidate"}get isJoin(){return this.type=="join"}};Mu.JsepMessage=Al});var yo=p(gn=>{"use strict";var f2=gn&&gn.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),$1=gn&&gn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&f2(t,e,n)};Object.defineProperty(gn,"__esModule",{value:!0});$1(Kv(),gn);$1(Y1(),gn)});var wl=p(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.markPipelineOwned=h2;Bu.isPipelineOwned=p2;var X1=new WeakSet;function h2(e){X1.add(e)}function p2(e){return X1.has(e)}});var j1=p(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.WebRTCFactory=void 0;var Ol=class{static createPeerConnection(t){return new RTCPeerConnection(t)}};qu.WebRTCFactory=Ol});var Ae=p(K=>{"use strict";var v2=K&&K.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(K,"__esModule",{value:!0});K.dual=K.getEndomorphismMonoid=K.SK=K.hole=K.constVoid=K.constUndefined=K.constNull=K.constFalse=K.constTrue=K.unsafeCoerce=K.apply=K.getRing=K.getSemiring=K.getMonoid=K.getSemigroup=K.getBooleanAlgebra=void 0;K.identity=Dl;K.constant=Co;K.flip=C2;K.flow=eS;K.tuple=E2;K.increment=b2;K.decrement=I2;K.absurd=tS;K.tupled=T2;K.untupled=A2;K.pipe=w2;K.not=D2;var m2=function(e){return function(){return{meet:function(t,n){return function(r){return e.meet(t(r),n(r))}},join:function(t,n){return function(r){return e.join(t(r),n(r))}},zero:function(){return e.zero},one:function(){return e.one},implies:function(t,n){return function(r){return e.implies(t(r),n(r))}},not:function(t){return function(n){return e.not(t(n))}}}}};K.getBooleanAlgebra=m2;var g2=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}};K.getSemigroup=g2;var _2=function(e){var t=(0,K.getSemigroup)(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};K.getMonoid=_2;var x2=function(e){return{add:function(t,n){return function(r){return e.add(t(r),n(r))}},zero:function(){return e.zero},mul:function(t,n){return function(r){return e.mul(t(r),n(r))}},one:function(){return e.one}}};K.getSemiring=x2;var S2=function(e){var t=(0,K.getSemiring)(e);return{add:t.add,mul:t.mul,one:t.one,zero:t.zero,sub:function(n,r){return function(i){return e.sub(n(i),r(i))}}}};K.getRing=S2;var y2=function(e){return function(t){return t(e)}};K.apply=y2;function Dl(e){return e}K.unsafeCoerce=Dl;function Co(e){return function(){return e}}K.constTrue=Co(!0);K.constFalse=Co(!1);K.constNull=Co(null);K.constUndefined=Co(void 0);K.constVoid=K.constUndefined;function C2(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length>1?e(t[1],t[0]):function(r){return e(r)(t[0])}}}function eS(e,t,n,r,i,a,s,u,d){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return s(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return u(s(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return d(u(s(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function E2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function b2(e){return e+1}function I2(e){return e-1}function tS(e){throw new Error("Called `absurd` function which should be uncallable")}function T2(e){return function(t){return e.apply(void 0,t)}}function A2(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function w2(e,t,n,r,i,a,s,u,d){switch(arguments.length){case 1:return e;case 2:return t(e);case 3:return n(t(e));case 4:return r(n(t(e)));case 5:return i(r(n(t(e))));case 6:return a(i(r(n(t(e)))));case 7:return s(a(i(r(n(t(e))))));case 8:return u(s(a(i(r(n(t(e)))))));case 9:return d(u(s(a(i(r(n(t(e))))))));default:{for(var c=arguments[0],o=1;o<arguments.length;o++)c=arguments[o](c);return c}}}K.hole=tS;var O2=function(e,t){return t};K.SK=O2;function D2(e){return function(t){return!e(t)}}var R2=function(){return{concat:function(e,t){return eS(e,t)},empty:Dl}};K.getEndomorphismMonoid=R2;var F2=function(e,t){var n=typeof e=="number"?function(r){return r.length>=e}:e;return function(){var r=Array.from(arguments);return n(arguments)?t.apply(this,r):function(i){return t.apply(void 0,v2([i],r,!1))}}};K.dual=F2});var _r=p(W=>{"use strict";var P2=W&&W.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};Object.defineProperty(W,"__esModule",{value:!0});W.flatMapReader=W.flatMapTask=W.flatMapIO=W.flatMapEither=W.flatMapOption=W.flatMapNullable=W.liftOption=W.liftNullable=W.fromReadonlyNonEmptyArray=W.has=W.emptyRecord=W.emptyReadonlyArray=W.tail=W.head=W.isNonEmpty=W.singleton=W.right=W.left=W.isRight=W.isLeft=W.some=W.none=W.isSome=W.isNone=void 0;var li=Ae(),N2=function(e){return e._tag==="None"};W.isNone=N2;var M2=function(e){return e._tag==="Some"};W.isSome=M2;W.none={_tag:"None"};var B2=function(e){return{_tag:"Some",value:e}};W.some=B2;var q2=function(e){return e._tag==="Left"};W.isLeft=q2;var k2=function(e){return e._tag==="Right"};W.isRight=k2;var J2=function(e){return{_tag:"Left",left:e}};W.left=J2;var L2=function(e){return{_tag:"Right",right:e}};W.right=L2;var U2=function(e){return[e]};W.singleton=U2;var W2=function(e){return e.length>0};W.isNonEmpty=W2;var H2=function(e){return e[0]};W.head=H2;var V2=function(e){return e.slice(1)};W.tail=V2;W.emptyReadonlyArray=[];W.emptyRecord={};W.has=Object.prototype.hasOwnProperty;var K2=function(e){return P2([e[0]],e.slice(1),!0)};W.fromReadonlyNonEmptyArray=K2;var z2=function(e){return function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=t.apply(void 0,r);return e.fromEither(a==null?(0,W.left)(n.apply(void 0,r)):(0,W.right)(a))}}};W.liftNullable=z2;var G2=function(e){return function(t,n){return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=t.apply(void 0,r);return e.fromEither((0,W.isNone)(a)?(0,W.left)(n.apply(void 0,r)):(0,W.right)(a.value))}}};W.liftOption=G2;var Z2=function(e,t){return(0,li.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftNullable)(e)(r,i))})};W.flatMapNullable=Z2;var Q2=function(e,t){return(0,li.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftOption)(e)(r,i))})};W.flatMapOption=Q2;var Y2=function(e,t){return(0,li.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};W.flatMapEither=Y2;var $2=function(e,t){return(0,li.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromIO(r(i))})})};W.flatMapIO=$2;var X2=function(e,t){return(0,li.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromTask(r(i))})})};W.flatMapTask=X2;var j2=function(e,t){return(0,li.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromReader(r(i))})})};W.flatMapReader=j2});var ku=p(Re=>{"use strict";var eD=Re&&Re.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),tD=Re&&Re.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nD=Re&&Re.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eD(t,e,n);return tD(t,e),t};Object.defineProperty(Re,"__esModule",{value:!0});Re.ap=aD;Re.apFirst=oD;Re.apSecond=sD;Re.apS=uD;Re.getApplySemigroup=cD;Re.sequenceT=lD;Re.sequenceS=hD;var rD=Ae(),iD=nD(_r());function aD(e,t){return function(n){return function(r){return e.ap(e.map(r,function(i){return function(a){return t.ap(i,a)}}),n)}}}function oD(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function sD(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function uD(e){return function(t,n){return function(r){return e.ap(e.map(r,function(i){return function(a){var s;return Object.assign({},i,(s={},s[t]=a,s))}}),n)}}}function cD(e){return function(t){return{concat:function(n,r){return e.ap(e.map(n,function(i){return function(a){return t.concat(i,a)}}),r)}}}}function Fl(e,t,n){return function(r){for(var i=Array(n.length+1),a=0;a<n.length;a++)i[a]=n[a];return i[n.length]=r,t===0?e.apply(null,i):Fl(e,t-1,i)}}var Rl={1:function(e){return[e]},2:function(e){return function(t){return[e,t]}},3:function(e){return function(t){return function(n){return[e,t,n]}}},4:function(e){return function(t){return function(n){return function(r){return[e,t,n,r]}}}},5:function(e){return function(t){return function(n){return function(r){return function(i){return[e,t,n,r,i]}}}}}};function dD(e){return iD.has.call(Rl,e)||(Rl[e]=Fl(rD.tuple,e-1,[])),Rl[e]}function lD(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=dD(r),a=e.map(t[0],i),s=1;s<r;s++)a=e.ap(a,t[s]);return a}}function fD(e){var t=e.length;switch(t){case 1:return function(n){var r;return r={},r[e[0]]=n,r};case 2:return function(n){return function(r){var i;return i={},i[e[0]]=n,i[e[1]]=r,i}};case 3:return function(n){return function(r){return function(i){var a;return a={},a[e[0]]=n,a[e[1]]=r,a[e[2]]=i,a}}};case 4:return function(n){return function(r){return function(i){return function(a){var s;return s={},s[e[0]]=n,s[e[1]]=r,s[e[2]]=i,s[e[3]]=a,s}}}};case 5:return function(n){return function(r){return function(i){return function(a){return function(s){var u;return u={},u[e[0]]=n,u[e[1]]=r,u[e[2]]=i,u[e[3]]=a,u[e[4]]=s,u}}}}};default:return Fl(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i={},a=0;a<t;a++)i[e[a]]=n[a];return i},t-1,[])}}function hD(e){return function(t){for(var n=Object.keys(t),r=n.length,i=fD(n),a=e.map(t[n[0]],i),s=1;s<r;s++)a=e.ap(a,t[n[s]]);return a}}});var Eo=p(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.map=nS;Kt.flap=vD;Kt.bindTo=mD;Kt.let=gD;Kt.getFunctorComposition=_D;Kt.as=rS;Kt.asUnit=xD;var pD=Ae();function nS(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function vD(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function mD(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function gD(e){return function(t,n){return function(r){return e.map(r,function(i){var a;return Object.assign({},i,(a={},a[t]=n(i),a))})}}}function _D(e,t){var n=nS(e,t);return{map:function(r,i){return(0,pD.pipe)(r,n(i))}}}function rS(e){return function(t,n){return e.map(t,function(){return n})}}function xD(e){var t=rS(e);return function(n){return t(n,void 0)}}});var Pl=p(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.getApplicativeMonoid=CD;Ju.getApplicativeComposition=ED;var iS=ku(),SD=Ae(),yD=Eo();function CD(e){var t=(0,iS.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function ED(e,t){var n=(0,yD.getFunctorComposition)(e,t).map,r=(0,iS.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,a){return(0,SD.pipe)(i,r(a))}}}});var Lu=p(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.chainFirst=bD;bo.tap=aS;bo.bind=ID;function bD(e){var t=aS(e);return function(n){return function(r){return t(r,n)}}}function aS(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}function ID(e){return function(t,n){return function(r){return e.chain(r,function(i){return e.map(n(i),function(a){var s;return Object.assign({},i,(s={},s[t]=a,s))})})}}}});var oS=p(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.tailRec=void 0;var TD=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};Uu.tailRec=TD});var Ml=p(be=>{"use strict";var AD=be&&be.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),wD=be&&be.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),OD=be&&be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&AD(t,e,n);return wD(t,e),t};Object.defineProperty(be,"__esModule",{value:!0});be.fromOption=uS;be.fromPredicate=RD;be.fromOptionK=cS;be.chainOptionK=FD;be.fromEitherK=Nl;be.chainEitherK=PD;be.chainFirstEitherK=ND;be.filterOrElse=MD;be.tapEither=dS;var DD=Lu(),sS=Ae(),xr=OD(_r());function uS(e){return function(t){return function(n){return e.fromEither(xr.isNone(n)?xr.left(t()):xr.right(n.value))}}}function RD(e){return function(t,n){return function(r){return e.fromEither(t(r)?xr.right(r):xr.left(n(r)))}}}function cS(e){var t=uS(e);return function(n){var r=t(n);return function(i){return(0,sS.flow)(i,r)}}}function FD(e,t){var n=cS(e);return function(r){var i=n(r);return function(a){return function(s){return t.chain(s,i(a))}}}}function Nl(e){return function(t){return(0,sS.flow)(t,e.fromEither)}}function PD(e,t){var n=Nl(e);return function(r){return function(i){return t.chain(i,n(r))}}}function ND(e,t){var n=dS(e,t);return function(r){return function(i){return n(i,r)}}}function MD(e,t){return function(n,r){return function(i){return t.chain(i,function(a){return e.fromEither(n(a)?xr.right(a):xr.left(r(a)))})}}}function dS(e,t){var n=Nl(e),r=(0,DD.tap)(t);return function(i,a){return r(i,n(a))}}});var ql=p($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.right=$.left=$.flap=$.Functor=$.Bifunctor=$.URI=$.bimap=$.mapLeft=$.map=$.separated=void 0;var Bl=Ae(),BD=Eo(),qD=function(e,t){return{left:e,right:t}};$.separated=qD;var kD=function(e,t){return(0,Bl.pipe)(e,(0,$.map)(t))},JD=function(e,t){return(0,Bl.pipe)(e,(0,$.mapLeft)(t))},LD=function(e,t,n){return(0,Bl.pipe)(e,(0,$.bimap)(t,n))},UD=function(e){return function(t){return(0,$.separated)((0,$.left)(t),e((0,$.right)(t)))}};$.map=UD;var WD=function(e){return function(t){return(0,$.separated)(e((0,$.left)(t)),(0,$.right)(t))}};$.mapLeft=WD;var HD=function(e,t){return function(n){return(0,$.separated)(e((0,$.left)(n)),t((0,$.right)(n)))}};$.bimap=HD;$.URI="Separated";$.Bifunctor={URI:$.URI,mapLeft:JD,bimap:LD};$.Functor={URI:$.URI,map:kD};$.flap=(0,BD.flap)($.Functor);var VD=function(e){return e.left};$.left=VD;var KD=function(e){return e.right};$.right=KD});var kl=p(vt=>{"use strict";var zD=vt&&vt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),GD=vt&&vt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),ZD=vt&&vt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&zD(t,e,n);return GD(t,e),t};Object.defineProperty(vt,"__esModule",{value:!0});vt.wiltDefault=QD;vt.witherDefault=YD;vt.filterE=$D;var lS=ZD(_r());function QD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.separate)}}}function YD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.compact)}}}function $D(e){return function(t){var n=e.wither(t);return function(r){return function(i){return n(i,function(a){return t.map(r(a),function(s){return s?lS.some(a):lS.none})})}}}}});var xS=p(l=>{"use strict";var XD=l&&l.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),jD=l&&l.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),hS=l&&l.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&XD(t,e,n);return jD(t,e),t};Object.defineProperty(l,"__esModule",{value:!0});l.match=l.foldW=l.matchW=l.isRight=l.isLeft=l.fromOption=l.fromPredicate=l.FromEither=l.MonadThrow=l.throwError=l.ChainRec=l.Extend=l.extend=l.Alt=l.alt=l.altW=l.Bifunctor=l.mapLeft=l.bimap=l.Traversable=l.sequence=l.traverse=l.Foldable=l.reduceRight=l.foldMap=l.reduce=l.Monad=l.Chain=l.Applicative=l.Apply=l.ap=l.apW=l.Pointed=l.of=l.asUnit=l.as=l.Functor=l.map=l.getAltValidation=l.getApplicativeValidation=l.getWitherable=l.getFilterable=l.getCompactable=l.getSemigroup=l.getEq=l.getShow=l.URI=l.flatMap=l.right=l.left=void 0;l.either=l.stringifyJSON=l.chainFirstW=l.chainFirst=l.chain=l.chainW=l.sequenceArray=l.traverseArray=l.traverseArrayWithIndex=l.traverseReadonlyArrayWithIndex=l.traverseReadonlyNonEmptyArrayWithIndex=l.ApT=l.apSW=l.apS=l.bindW=l.bind=l.let=l.bindTo=l.Do=l.exists=l.toUnion=l.chainNullableK=l.fromNullableK=l.tryCatchK=l.tryCatch=l.fromNullable=l.orElse=l.orElseW=l.swap=l.filterOrElseW=l.filterOrElse=l.flatMapOption=l.flatMapNullable=l.liftOption=l.liftNullable=l.chainOptionKW=l.chainOptionK=l.fromOptionK=l.duplicate=l.flatten=l.flattenW=l.tap=l.apSecondW=l.apSecond=l.apFirstW=l.apFirst=l.flap=l.getOrElse=l.getOrElseW=l.fold=void 0;l.getValidationMonoid=l.getValidationSemigroup=l.getApplyMonoid=l.getApplySemigroup=void 0;l.toError=O8;l.elem=_S;l.parseJSON=M8;l.getValidation=J8;var pS=Pl(),Io=ku(),vS=hS(Lu()),e8=oS(),To=Ml(),ge=Ae(),Ao=Eo(),et=hS(_r()),zt=ql(),fS=kl();l.left=et.left;l.right=et.right;l.flatMap=(0,ge.dual)(2,function(e,t){return(0,l.isLeft)(e)?e:t(e.right)});var we=function(e,t){return(0,ge.pipe)(e,(0,l.map)(t))},Sr=function(e,t){return(0,ge.pipe)(e,(0,l.ap)(t))},wo=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduce)(t,n))},Oo=function(e){return function(t,n){var r=(0,l.foldMap)(e);return(0,ge.pipe)(t,r(n))}},Do=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduceRight)(t,n))},Wu=function(e){var t=(0,l.traverse)(e);return function(n,r){return(0,ge.pipe)(n,t(r))}},Jl=function(e,t,n){return(0,ge.pipe)(e,(0,l.bimap)(t,n))},Ll=function(e,t){return(0,ge.pipe)(e,(0,l.mapLeft)(t))},mS=function(e,t){return(0,ge.pipe)(e,(0,l.alt)(t))},Ul=function(e,t){return(0,ge.pipe)(e,(0,l.extend)(t))},Wl=function(e,t){return(0,e8.tailRec)(t(e),function(n){return(0,l.isLeft)(n)?(0,l.right)((0,l.left)(n.left)):(0,l.isLeft)(n.right)?(0,l.left)(t(n.right.left)):(0,l.right)((0,l.right)(n.right.right))})};l.URI="Either";var t8=function(e,t){return{show:function(n){return(0,l.isLeft)(n)?"left(".concat(e.show(n.left),")"):"right(".concat(t.show(n.right),")")}}};l.getShow=t8;var n8=function(e,t){return{equals:function(n,r){return n===r||((0,l.isLeft)(n)?(0,l.isLeft)(r)&&e.equals(n.left,r.left):(0,l.isRight)(r)&&t.equals(n.right,r.right))}}};l.getEq=n8;var r8=function(e){return{concat:function(t,n){return(0,l.isLeft)(n)?t:(0,l.isLeft)(t)?n:(0,l.right)(e.concat(t.right,n.right))}}};l.getSemigroup=r8;var i8=function(e){var t=(0,l.left)(e.empty);return{URI:l.URI,_E:void 0,compact:function(n){return(0,l.isLeft)(n)?n:n.right._tag==="None"?t:(0,l.right)(n.right.value)},separate:function(n){return(0,l.isLeft)(n)?(0,zt.separated)(n,n):(0,l.isLeft)(n.right)?(0,zt.separated)((0,l.right)(n.right.left),t):(0,zt.separated)(t,(0,l.right)(n.right.right))}}};l.getCompactable=i8;var a8=function(e){var t=(0,l.left)(e.empty),n=(0,l.getCompactable)(e),r=n.compact,i=n.separate,a=function(u,d){return(0,l.isLeft)(u)||d(u.right)?u:t},s=function(u,d){return(0,l.isLeft)(u)?(0,zt.separated)(u,u):d(u.right)?(0,zt.separated)(t,(0,l.right)(u.right)):(0,zt.separated)((0,l.right)(u.right),t)};return{URI:l.URI,_E:void 0,map:we,compact:r,separate:i,filter:a,filterMap:function(u,d){if((0,l.isLeft)(u))return u;var c=d(u.right);return c._tag==="None"?t:(0,l.right)(c.value)},partition:s,partitionMap:function(u,d){if((0,l.isLeft)(u))return(0,zt.separated)(u,u);var c=d(u.right);return(0,l.isLeft)(c)?(0,zt.separated)((0,l.right)(c.left),t):(0,zt.separated)(t,(0,l.right)(c.right))}}};l.getFilterable=a8;var o8=function(e){var t=(0,l.getFilterable)(e),n=(0,l.getCompactable)(e);return{URI:l.URI,_E:void 0,map:we,compact:t.compact,separate:t.separate,filter:t.filter,filterMap:t.filterMap,partition:t.partition,partitionMap:t.partitionMap,traverse:Wu,sequence:l.sequence,reduce:wo,foldMap:Oo,reduceRight:Do,wither:(0,fS.witherDefault)(l.Traversable,n),wilt:(0,fS.wiltDefault)(l.Traversable,n)}};l.getWitherable=o8;var s8=function(e){return{URI:l.URI,_E:void 0,map:we,ap:function(t,n){return(0,l.isLeft)(t)?(0,l.isLeft)(n)?(0,l.left)(e.concat(t.left,n.left)):t:(0,l.isLeft)(n)?n:(0,l.right)(t.right(n.right))},of:l.of}};l.getApplicativeValidation=s8;var u8=function(e){return{URI:l.URI,_E:void 0,map:we,alt:function(t,n){if((0,l.isRight)(t))return t;var r=n();return(0,l.isLeft)(r)?(0,l.left)(e.concat(t.left,r.left)):r}}};l.getAltValidation=u8;var c8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t.right))}};l.map=c8;l.Functor={URI:l.URI,map:we};l.as=(0,ge.dual)(2,(0,Ao.as)(l.Functor));l.asUnit=(0,Ao.asUnit)(l.Functor);l.of=l.right;l.Pointed={URI:l.URI,of:l.of};var d8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.isLeft)(e)?e:(0,l.right)(t.right(e.right))}};l.apW=d8;l.ap=l.apW;l.Apply={URI:l.URI,map:we,ap:Sr};l.Applicative={URI:l.URI,map:we,ap:Sr,of:l.of};l.Chain={URI:l.URI,map:we,ap:Sr,chain:l.flatMap};l.Monad={URI:l.URI,map:we,ap:Sr,of:l.of,chain:l.flatMap};var l8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(e,n.right)}};l.reduce=l8;var f8=function(e){return function(t){return function(n){return(0,l.isLeft)(n)?e.empty:t(n.right)}}};l.foldMap=f8;var h8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(n.right,e)}};l.reduceRight=h8;l.Foldable={URI:l.URI,reduce:wo,foldMap:Oo,reduceRight:Do};var p8=function(e){return function(t){return function(n){return(0,l.isLeft)(n)?e.of((0,l.left)(n.left)):e.map(t(n.right),l.right)}}};l.traverse=p8;var v8=function(e){return function(t){return(0,l.isLeft)(t)?e.of((0,l.left)(t.left)):e.map(t.right,l.right)}};l.sequence=v8;l.Traversable={URI:l.URI,map:we,reduce:wo,foldMap:Oo,reduceRight:Do,traverse:Wu,sequence:l.sequence};var m8=function(e,t){return function(n){return(0,l.isLeft)(n)?(0,l.left)(e(n.left)):(0,l.right)(t(n.right))}};l.bimap=m8;var g8=function(e){return function(t){return(0,l.isLeft)(t)?(0,l.left)(e(t.left)):t}};l.mapLeft=g8;l.Bifunctor={URI:l.URI,bimap:Jl,mapLeft:Ll};var _8=function(e){return function(t){return(0,l.isLeft)(t)?e():t}};l.altW=_8;l.alt=l.altW;l.Alt={URI:l.URI,map:we,alt:mS};var x8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t))}};l.extend=x8;l.Extend={URI:l.URI,map:we,extend:Ul};l.ChainRec={URI:l.URI,map:we,ap:Sr,chain:l.flatMap,chainRec:Wl};l.throwError=l.left;l.MonadThrow={URI:l.URI,map:we,ap:Sr,of:l.of,chain:l.flatMap,throwError:l.throwError};l.FromEither={URI:l.URI,fromEither:ge.identity};l.fromPredicate=(0,To.fromPredicate)(l.FromEither);l.fromOption=(0,To.fromOption)(l.FromEither);l.isLeft=et.isLeft;l.isRight=et.isRight;var S8=function(e,t){return function(n){return(0,l.isLeft)(n)?e(n.left):t(n.right)}};l.matchW=S8;l.foldW=l.matchW;l.match=l.matchW;l.fold=l.match;var y8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t.right}};l.getOrElseW=y8;l.getOrElse=l.getOrElseW;l.flap=(0,Ao.flap)(l.Functor);l.apFirst=(0,Io.apFirst)(l.Apply);l.apFirstW=l.apFirst;l.apSecond=(0,Io.apSecond)(l.Apply);l.apSecondW=l.apSecond;l.tap=(0,ge.dual)(2,vS.tap(l.Chain));l.flattenW=(0,l.flatMap)(ge.identity);l.flatten=l.flattenW;l.duplicate=(0,l.extend)(ge.identity);l.fromOptionK=(0,To.fromOptionK)(l.FromEither);l.chainOptionK=(0,To.chainOptionK)(l.FromEither,l.Chain);l.chainOptionKW=l.chainOptionK;var Hu={fromEither:l.FromEither.fromEither};l.liftNullable=et.liftNullable(Hu);l.liftOption=et.liftOption(Hu);var gS={flatMap:l.flatMap};l.flatMapNullable=et.flatMapNullable(Hu,gS);l.flatMapOption=et.flatMapOption(Hu,gS);l.filterOrElse=(0,To.filterOrElse)(l.FromEither,l.Chain);l.filterOrElseW=l.filterOrElse;var C8=function(e){return(0,l.isLeft)(e)?(0,l.right)(e.left):(0,l.left)(e.right)};l.swap=C8;var E8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t}};l.orElseW=E8;l.orElse=l.orElseW;var b8=function(e){return function(t){return t==null?(0,l.left)(e):(0,l.right)(t)}};l.fromNullable=b8;var I8=function(e,t){try{return(0,l.right)(e())}catch(n){return(0,l.left)(t(n))}};l.tryCatch=I8;var T8=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(0,l.tryCatch)(function(){return e.apply(void 0,n)},t)}};l.tryCatchK=T8;var A8=function(e){var t=(0,l.fromNullable)(e);return function(n){return(0,ge.flow)(n,t)}};l.fromNullableK=A8;var w8=function(e){var t=(0,l.fromNullableK)(e);return function(n){return(0,l.flatMap)(t(n))}};l.chainNullableK=w8;l.toUnion=(0,l.foldW)(ge.identity,ge.identity);function O8(e){try{return e instanceof Error?e:new Error(String(e))}catch{return new Error}}function _S(e){return function(t,n){if(n===void 0){var r=_S(e);return function(i){return r(t,i)}}return(0,l.isLeft)(n)?!1:e.equals(t,n.right)}}var D8=function(e){return function(t){return(0,l.isLeft)(t)?!1:e(t.right)}};l.exists=D8;l.Do=(0,l.of)(et.emptyRecord);l.bindTo=(0,Ao.bindTo)(l.Functor);var R8=(0,Ao.let)(l.Functor);l.let=R8;l.bind=vS.bind(l.Chain);l.bindW=l.bind;l.apS=(0,Io.apS)(l.Apply);l.apSW=l.apS;l.ApT=(0,l.of)(et.emptyReadonlyArray);var F8=function(e){return function(t){var n=e(0,et.head(t));if((0,l.isLeft)(n))return n;for(var r=[n.right],i=1;i<t.length;i++){var a=e(i,t[i]);if((0,l.isLeft)(a))return a;r.push(a.right)}return(0,l.right)(r)}};l.traverseReadonlyNonEmptyArrayWithIndex=F8;var P8=function(e){var t=(0,l.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return et.isNonEmpty(n)?t(n):l.ApT}};l.traverseReadonlyArrayWithIndex=P8;l.traverseArrayWithIndex=l.traverseReadonlyArrayWithIndex;var N8=function(e){return(0,l.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};l.traverseArray=N8;l.sequenceArray=(0,l.traverseArray)(ge.identity);l.chainW=l.flatMap;l.chain=l.flatMap;l.chainFirst=l.tap;l.chainFirstW=l.tap;function M8(e,t){return(0,l.tryCatch)(function(){return JSON.parse(e)},t)}var B8=function(e,t){return(0,l.tryCatch)(function(){var n=JSON.stringify(e);if(typeof n!="string")throw new Error("Converting unsupported structure to JSON");return n},t)};l.stringifyJSON=B8;l.either={URI:l.URI,map:we,of:l.of,ap:Sr,chain:l.flatMap,reduce:wo,foldMap:Oo,reduceRight:Do,traverse:Wu,sequence:l.sequence,bimap:Jl,mapLeft:Ll,alt:mS,extend:Ul,chainRec:Wl,throwError:l.throwError};l.getApplySemigroup=(0,Io.getApplySemigroup)(l.Apply);l.getApplyMonoid=(0,pS.getApplicativeMonoid)(l.Applicative);var q8=function(e,t){return(0,Io.getApplySemigroup)((0,l.getApplicativeValidation)(e))(t)};l.getValidationSemigroup=q8;var k8=function(e,t){return(0,pS.getApplicativeMonoid)((0,l.getApplicativeValidation)(e))(t)};l.getValidationMonoid=k8;function J8(e){var t=(0,l.getApplicativeValidation)(e).ap,n=(0,l.getAltValidation)(e).alt;return{URI:l.URI,_E:void 0,map:we,of:l.of,chain:l.flatMap,bimap:Jl,mapLeft:Ll,reduce:wo,foldMap:Oo,reduceRight:Do,extend:Ul,traverse:Wu,sequence:l.sequence,chainRec:Wl,throwError:l.throwError,ap:t,alt:n}}});var _n=p(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.ClientEvent=fi.ClientEventName=void 0;var L8=qe(),SS;(function(e){e.OCRA_CALL_INIT_REQUEST="OCRA_CALL_INIT_REQUEST",e.OCRA_CALL_INIT_REQUEST_COMPLETE="OCRA_CALL_INIT_REQUEST_COMPLETE",e.SDK_API_ANSWER="SDK_API_ANSWER",e.SDK_API_CALL_STATE_ANSWERED="SDK_API_CALL_STATE_ANSWERED",e.SDK_API_CALL_STATE_ESTABLISHED="SDK_API_CALL_STATE_ESTABLISHED",e.SDK_API_CALL_USER_START="SDK_API_CALL_USER_START",e.SDK_API_CALL_STATE_PROGRESSING="SDK_API_CALL_STATE_PROGRESSING",e.SDK_API_CALL_STATE_RINGING="SDK_API_CALL_STATE_RINGING",e.SDK_API_CALL_TERMINATE="SDK_API_CALL_TERMINATE",e.SDK_ICE_FAILED_TERMINATE="SDK_ICE_FAILED_TERMINATE",e.SDK_CALL_MARKED_INACTIVE="SDK_CALL_MARKED_INACTIVE",e.SDK_DID_NOTIFY_INCOMING_CALL="SDK_DID_NOTIFY_INCOMING_CALL",e.SDK_DID_RESPECT_ONGOING_SINCH_CALL="SDK_DID_RESPECT_ONGOING_SINCH_CALL",e.WEBRTC_ICE_CONNECTION_CONNECTED="WEBRTC_ICE_CONNECTION_CONNECTED",e.WEBRTC_ICE_CONNECTION_COMPLETED="WEBRTC_ICE_CONNECTION_COMPLETED",e.WEBRTC_ICE_CONNECTION_DISCONNECTED="WEBRTC_ICE_CONNECTION_DISCONNECTED",e.WEBRTC_ICE_CONNECTION_FAILED="WEBRTC_ICE_CONNECTION_FAILED"})(SS||(fi.ClientEventName=SS={}));var Hl=class e{constructor(t,n,r,i){this.type=t,this.name=n,this.time=r,this.result=i}get data(){return{type:this.type,name:this.name,time:this.time,result:this.result}}static create(t,n,r,i){return new e(t,n,r,i)}static createClientEventType(t,n){return new e(L8.EventType.ClientEventType,t,new Date,n).data}};fi.ClientEvent=Hl});var Ro=p(Fe=>{"use strict";var hi=Fe&&Fe.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.PeerConnection=Fe.MAX_WAIT_DISCONNECTED_PC=Fe.SignalingState=Fe.IceConnectionState=Fe.IceTransportPolicy=void 0;var U8=wl(),W8=j1(),Vl=xS(),H8=Ae(),xn=_n(),yS;(function(e){e.Relay="relay",e.All="all"})(yS||(Fe.IceTransportPolicy=yS={}));var Gt;(function(e){e.New="new",e.Checking="checking",e.Connected="connected",e.Completed="completed",e.Failed="failed",e.Disconnected="disconnected",e.Closed="closed"})(Gt||(Fe.IceConnectionState=Gt={}));var Kl;(function(e){e.Closed="closed"})(Kl||(Fe.SignalingState=Kl={}));Fe.MAX_WAIT_DISCONNECTED_PC=1e3*60*5;var zl=class{constructor(t,n,r,i,a,s){this.observer=t,this.rtcConfiguration=n,this.inactivate=r,this.clientEventsCollector=i,this.userInstanceId=a,this.originalOffer=s,this.pendingRemoteCandidates=Array(),this.localCandidates=Array(),this.logClientEvents=u=>{switch(u){case Gt.Connected:{this.clientEventsCollector.addEvent(xn.ClientEvent.createClientEventType(xn.ClientEventName.WEBRTC_ICE_CONNECTION_CONNECTED));break}case Gt.Completed:{this.clientEventsCollector.addEvent(xn.ClientEvent.createClientEventType(xn.ClientEventName.WEBRTC_ICE_CONNECTION_COMPLETED));break}case Gt.Disconnected:{this.clientEventsCollector.addEvent(xn.ClientEvent.createClientEventType(xn.ClientEventName.WEBRTC_ICE_CONNECTION_DISCONNECTED));break}case Gt.Failed:{this.clientEventsCollector.addEvent(xn.ClientEvent.createClientEventType(xn.ClientEventName.WEBRTC_ICE_CONNECTION_FAILED));break}default:break}return u},this.getIceConnectionState=()=>this.pc.iceConnectionState,this.notifyCurrentIceStateObserver=u=>{var d;return(d=this.observer)===null||d===void 0||d.onIceConnectionStateChanged(u,this.instanceId),u},this.handleInactivateTimerState=u=>[Gt.Disconnected,Gt.Failed].includes(u)?(0,Vl.right)(u):(0,Vl.left)(u),this.whenRecovered=u=>(u===Gt.Connected&&this.clearAnyScheduledTimer(),u),this.whenDisconnectedOrFailed=u=>(this.clearAnyScheduledTimer(),this.timeoutID=this.setTimerToInactivate(Fe.MAX_WAIT_DISCONNECTED_PC,this.inactivate),u),this.logIceState=u=>{console.log(this.pc.iceConnectionState,this.pc.iceGatheringState,this.pc.signalingState,u)},this.onLocalIceCandidate=u=>{var d;u.candidate&&(this.instanceId?(d=this.observer)===null||d===void 0||d.onIceCandidate(this.instanceId,u.candidate):this.localCandidates.push(u.candidate))},this.addIceCandidate=u=>{this.pc.remoteDescription?(console.log("Adding ICE candidate to peer connection",{candidate:u}),this.pc.addIceCandidate(u).catch(d=>console.error("Failed to add candidate:",d))):(console.log("Remote description is not available yet. Caching the ICE candidate",{candidate:u}),this.pendingRemoteCandidates.push(u))},this.pc=this.createPeerConnection(),this.pc.onicecandidate=this.onLocalIceCandidate,this.pc.onnegotiationneeded=()=>hi(this,void 0,void 0,function*(){yield this.createOffer()}),this.pc.oniceconnectionstatechange=(0,H8.flow)(this.logIceState,this.getIceConnectionState,this.notifyCurrentIceStateObserver,this.handleInactivateTimerState,(0,Vl.match)(this.whenRecovered,this.whenDisconnectedOrFailed),this.logClientEvents),this.pc.onsignalingstatechange=u=>this.logIceState(u),this.pc.ontrack=u=>{var d;(d=this.observer)===null||d===void 0||d.onTrack(u,this.instanceId)}}clearAnyScheduledTimer(){this.timeoutID&&clearTimeout(this.timeoutID)}close(){this.observer=null,this.pc.close()}setTimerToInactivate(t,n){return setTimeout(n,t)}get transceivers(){return this.pc.getTransceivers()}enableSenderTracks(t,n){this.transceivers.filter(r=>r.sender.track&&r.sender.track.kind==n).forEach(r=>{r.sender.track&&(r.sender.track.enabled=t)})}getSenders(t){return this.transceivers.filter(n=>n.sender.track&&n.sender.track.kind==t).map(n=>n.sender)}insertDtmf(t){let n=!1;return this.getSenders("audio").forEach(r=>{var i;!((i=r.dtmf)===null||i===void 0)&&i.canInsertDTMF&&(r.dtmf.insertDTMF(t),n=!0)}),n}setLocalMedia(t){if(this.getSenders("audio").concat(this.getSenders("video")).length!==0)return this.replaceLocalMedia(t);for(let r of t.getTracks())t.mediaStream instanceof MediaStream?this.pc.addTrack(r,t.mediaStream):this.pc.addTrack(r)}replaceLocalMedia(t){let n=t.getTracks().find(s=>s.kind==="audio"),r=t.getTracks().find(s=>s.kind==="video"),i=this.getSenders("audio"),a=this.getSenders("video");this.replaceSenderTrack(i,n),this.replaceSenderTrack(a,r)}replaceSenderTrack(t,n){var r;if(!t||t.length===0||!n)return;let i=t[0],a=i.track;if(a===n)return;let s=(r=a?.enabled)!==null&&r!==void 0?r:!0;n.enabled=s,i.replaceTrack(n).then(()=>{a&&!(0,U8.isPipelineOwned)(a)&&a.stop()}).catch(u=>{console.error(`Failed to replace ${n.kind} track:`,u)})}get instanceId(){return this.userInstanceId}set instanceId(t){this.userInstanceId=t,t&&this.localCandidates.splice(0).forEach(n=>{var r;return(r=this.observer)===null||r===void 0?void 0:r.onIceCandidate(t,n)})}applyPendingRemoteCandidates(){if(!this.pc.remoteDescription){console.log("Skipping to apply pending remote candidates because remoteDescription is null");return}this.pendingRemoteCandidates.forEach(this.addIceCandidate),this.pendingRemoteCandidates.length=0}createPeerConnection(){return W8.WebRTCFactory.createPeerConnection(this.rtcConfiguration)}setPendingRemoteDesription(){return hi(this,void 0,void 0,function*(){if(this.pendingRemoteDescription)return this.setRemoteDescription(this.pendingRemoteDescription)})}setLocalDescription(t){return hi(this,void 0,void 0,function*(){var n;this.localDescription=t,yield this.pc.setLocalDescription(t),yield this.setPendingRemoteDesription(),this.originalOffer?this.originalOffer=void 0:(n=this.observer)===null||n===void 0||n.onSessionDescriptionCreated(t)})}createOffer(){return hi(this,void 0,void 0,function*(){this.remoteDescription=void 0;let t=yield this.pc.createOffer();yield this.setLocalDescription(this.originalOffer||t)})}createAnswer(){return hi(this,void 0,void 0,function*(){let t=yield this.pc.createAnswer();return yield this.setLocalDescription(t),t})}setRemoteDescription(t){return hi(this,void 0,void 0,function*(){if(t.type=="answer"){if(this.remoteDescription)return;if(!this.localDescription){this.pendingRemoteDescription=t;return}}this.pc.signalingState!==Kl.Closed&&(this.remoteDescription=t,yield this.pc.setRemoteDescription(t),this.applyPendingRemoteCandidates(),t.type=="offer"&&(yield this.createAnswer()))})}};Fe.PeerConnection=zl});var bS=p(pi=>{"use strict";var Sn=pi&&pi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(pi,"__esModule",{value:!0});pi.PeerConnectionClient=void 0;var V8=un(),CS=yo(),K8=Ro(),ES=Ro(),Gl=class e{static create(t,n,r,i,a,s,u){return new e(t,n,r,i,a,s,u)}constructor(t,n,r,i,a,s,u){this.mediaController=t,this.trackEvent=n,this.useRelayIceCandidatesOnly=r,this.inactivate=i,this.clientEventsCollector=a,this.observer=s,this.iceServers=u,this.DUMMY_INSTANCE_ID="",this.peerConnections=new Array,this.onLocalJsepMessage=new V8.Event,this.remoteStreams=new Map,this.pendingTracks=new Map,this.pendingRelayCandidates=new Array,this.enabledTracks=new Map,this.onSessionDescriptionFailed=d=>{console.error("Failed to create Session Description",d)},this.onTrack=(d,c)=>{var o;this.trackEvent.fire(d.track),this.instanceId===c?this.remoteMediaStream.addTrack(d.track):(this.pendingTracks.has(c)||this.pendingTracks.set(c,new Array),(o=this.pendingTracks.get(c))===null||o===void 0||o.push(d.track))},this.cleanup=()=>{this.peerConnections.forEach(d=>{d.clearAnyScheduledTimer(),d.close()})},this.onIceCandidate=(d,c)=>{c?.candidate&&this.onLocalJsepMessage.fire(new CS.JsepMessage("candidate",JSON.stringify({cand:c.candidate,sdpMLI:c.sdpMLineIndex,sdpMid:c.sdpMid}),d))},this.onJsepMessageReceived=d=>{d.forEach(c=>{c.isOffer||c.isAnswer?this.onJsepDescription(c):c.isCandidate?this.onJsepIceCandidate(c):c.isJoin&&c.instanceId&&this.setConnectedInstanceId(c.instanceId)})},this.remoteMediaStream=new MediaStream,this.shouldNotifyIceStateChanges=!1}setIceServers(t){this.iceServers=t}createCertificate(){return Sn(this,void 0,void 0,function*(){if(RTCPeerConnection.generateCertificate)return RTCPeerConnection.generateCertificate({name:"ECDSA",namedCurve:"P-256"})})}onCallAnswered(t){this.closeNonJoinedPCs(),this.startEmittingIceStateChanges()}onCallEstablished(t){this.enabledTracks.get("audio")!=!1&&this.enableSenderTracks(!0,"audio"),this.enabledTracks.get("video")!=!1&&this.enableSenderTracks(!0,"video")}onEarlyMedia(t){!t||this.instanceId||(this.setConnectedInstanceId(t),this.enabledTracks.get("audio")!=!1&&this.enableSenderTracks(!0,"audio"))}enableSenderTracks(t,n){this.enabledTracks.set(n,t),this.peerConnections.forEach(r=>{r.enableSenderTracks(t,n)})}updateMediaController(t){this.mediaController=t,this.peerConnections.forEach(n=>{n.setLocalMedia(t)})}start(){return Sn(this,void 0,void 0,function*(){this.certificate=yield this.createCertificate(),yield this.createPeerConnection(this.DUMMY_INSTANCE_ID)})}onSessionDescriptionCreated(t){t.sdp&&t.type&&(this.originalOffer=this.originalOffer||t,this.onLocalJsepMessage.fire(new CS.JsepMessage(t.type,t.sdp)))}insertDtmf(t){return Sn(this,void 0,void 0,function*(){let n=!1;return this.peerConnections.forEach(r=>n=n||r.insertDtmf(t)),n})}addPendingTracks(){var t;this.instanceId&&((t=this.pendingTracks.get(this.instanceId))===null||t===void 0||t.splice(0).forEach(n=>{this.remoteMediaStream.addTrack(n)}))}setConnectedInstanceId(t){this.instanceId=t,this.addPendingTracks(),this.addPendingRelayCandidates()}get remoteStream(){return this.remoteMediaStream}mapIceCandidate(t){let n=JSON.parse(t);return{candidate:n.cand,sdpMLineIndex:n.sdpMLI,sdpMid:n.sdpMid}}addPendingRelayCandidates(){var t;this.instanceId&&!((t=this.originalOffer)===null||t===void 0)&&t.sdp&&this.getPeerConnection(this.instanceId).then(r=>{this.pendingRelayCandidates.splice(0).forEach(i=>r.addIceCandidate(this.mapIceCandidate(i)))})}onJsepIceCandidate(t){return Sn(this,void 0,void 0,function*(){t.instanceId&&(yield this.getPeerConnection(t.instanceId)).addIceCandidate(this.mapIceCandidate(t.data))})}onJsepDescription(t){return Sn(this,void 0,void 0,function*(){t.instanceId&&(t.type=="offer"&&(this.instanceId=t.instanceId),yield(yield this.getPeerConnection(t.instanceId)).setRemoteDescription({sdp:t.data,type:t.type}))})}findPeerConnection(t){return this.peerConnections.find(n=>n.instanceId==t)}getDefaultPeerConnection(t){let n=this.findPeerConnection(this.DUMMY_INSTANCE_ID);return n&&(n.instanceId=t),n}getRTCConfig(){return{certificates:this.certificate?[this.certificate]:void 0,iceServers:this.iceServers,iceTransportPolicy:this.useRelayIceCandidatesOnly?ES.IceTransportPolicy.Relay:ES.IceTransportPolicy.All}}closeNonJoinedPCs(){this.peerConnections.forEach(t=>{t.instanceId!=this.instanceId&&(t.clearAnyScheduledTimer(),t.close())})}startEmittingIceStateChanges(){this.shouldNotifyIceStateChanges=!0;let t=this.instanceId;if(t==null){console.error("Failed to find remote peer connection instance. Remote instance id not known");return}let n=this.findPeerConnection(t);if(n==null){console.error(`Failed to find remote peer connection instance with id ${t}`);return}this.onIceConnectionStateChanged(n.getIceConnectionState())}createPeerConnection(t){return Sn(this,void 0,void 0,function*(){let n=new K8.PeerConnection(this,this.getRTCConfig(),this.inactivate,this.clientEventsCollector,t,this.originalOffer);return n.setLocalMedia(this.mediaController),this.enabledTracks.get("video")||n.enableSenderTracks(!1,"video"),this.enabledTracks.get("audio")||n.enableSenderTracks(!1,"audio"),this.peerConnections.push(n),n})}getPeerConnection(t){return Sn(this,void 0,void 0,function*(){var n,r;return(r=(n=this.findPeerConnection(t))!==null&&n!==void 0?n:this.getDefaultPeerConnection(t))!==null&&r!==void 0?r:this.createPeerConnection(t)})}onIceConnectionStateChanged(t,n){this.shouldNotifyIceStateChanges&&this.observer.onIceConnectionStateChanged(t),n&&this.observer.onEveryIceConnectionStateChange&&this.observer.onEveryIceConnectionStateChange(n,t)}setLegacyRelayCandidates(t){t.forEach(n=>this.pendingRelayCandidates.push(n))}getPeerConnectionStats(){return Sn(this,void 0,void 0,function*(){if(!this.instanceId)return console.error("Cannot get Webrtc stats. Instance id is not set"),null;let t=this.findPeerConnection(this.instanceId);if(!t)return console.error("Could not find peer connection for instance",{instanceId:this.instanceId}),null;try{return yield t.pc.getStats(null)}catch(n){return console.error("Failed to get statistics for peer connection",{instanceId:this.instanceId,error:n}),null}})}};pi.PeerConnectionClient=Gl});var IS=p(vi=>{"use strict";var z8=vi&&vi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(vi,"__esModule",{value:!0});vi.LocalAudioProcessor=void 0;var Zl=class{constructor(){this.owned=new Set}setListener(t){return z8(this,void 0,void 0,function*(){if(!t){if(!this.listener&&!this.ctx)return;this.teardown(),this.listener=void 0;return}let n=new AudioContext;try{yield n.audioWorklet.addModule(t.moduleUrl),yield n.resume()}catch(r){throw yield n.close(),r}this.teardown(),this.ctx=n,this.listener=t})}process(t){if(this.ctx&&this.listener&&t){if(this.workletNode&&t===this.audioSourceTrack&&this.audioOutputTrack)return this.audioOutputTrack;let r=this.buildGraph(this.ctx,this.listener,t);return this.audioSourceTrack=t,this.audioOutputTrack=r,r}if(!this.workletNode&&t===this.audioSourceTrack&&this.audioOutputTrack)return this.audioOutputTrack;let n=t?.clone();return n&&this.own(n),this.audioSourceTrack=t,this.audioOutputTrack=n,n}buildGraph(t,n,r){let i,a,s,u;try{i=r.clone(),a=t.createMediaStreamSource(new MediaStream([i])),s=new AudioWorkletNode(t,n.processorName,{processorOptions:n.processorOptions}),u=t.createMediaStreamDestination(),a.connect(s).connect(u)}catch(c){throw i?.stop(),a?.disconnect(),s?.disconnect(),c}if(n.onMessage){let c=n.onMessage;s.port.onmessage=o=>c(o.data)}this.teardownGraph(),this.sourceNode=a,this.workletNode=s,this.destinationNode=u,this.graphInputTrack=i;let d=u.stream.getAudioTracks()[0];return this.own(d),d}own(t){this.owned.forEach(n=>{n.readyState==="ended"&&this.owned.delete(n)}),this.owned.add(t)}teardownGraph(){var t,n,r,i;(t=this.sourceNode)===null||t===void 0||t.disconnect(),(n=this.workletNode)===null||n===void 0||n.disconnect(),(r=this.destinationNode)===null||r===void 0||r.disconnect(),(i=this.graphInputTrack)===null||i===void 0||i.stop(),this.sourceNode=void 0,this.workletNode=void 0,this.destinationNode=void 0,this.graphInputTrack=void 0}teardown(){var t;this.teardownGraph(),(t=this.ctx)===null||t===void 0||t.close(),this.ctx=void 0,this.audioSourceTrack=void 0,this.audioOutputTrack=void 0}dispose(t){this.teardown(),this.listener=void 0,this.owned.forEach(n=>{t.has(n)||n.stop()})}};vi.LocalAudioProcessor=Zl});var TS=p(mi=>{"use strict";var G8=mi&&mi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(mi,"__esModule",{value:!0});mi.LocalVideoProcessor=void 0;var Z8=wl(),Q8=1e4,Ql=class{constructor(){this.owned=new Set}setListener(t){return G8(this,void 0,void 0,function*(){var n,r;if(!t){if(!this.listener&&!this.worker)return;this.invalidate(),(n=this.worker)===null||n===void 0||n.terminate(),this.worker=void 0,this.listener=void 0;return}Y8();let i=new Worker(t.workerUrl);try{yield this.waitForReady(i)}catch(a){throw i.terminate(),a}this.invalidate(),(r=this.worker)===null||r===void 0||r.terminate(),this.worker=i,this.listener=t,this.attachListenerHandlers(i,t)})}attachListenerHandlers(t,n){let r=n.onMessage;t.onmessage=r?a=>r(a.data):null;let i=n.onError;t.onerror=a=>{i?i(a):console.error("Local video frame listener worker error:",a.message)}}processTrack(t){return!this.worker||!this.listener?(t!==this.rawTrack&&(this.outputTrack=t?.clone(),this.outputTrack&&this.own(this.outputTrack),this.rawTrack=t),this.outputTrack):(t!==this.rawTrack&&this.setupTransform(t),this.outputTrack)}dispose(t){var n;this.invalidate(),(n=this.worker)===null||n===void 0||n.terminate(),this.worker=void 0,this.listener=void 0,this.owned.forEach(r=>{t.has(r)||r.stop()})}waitForReady(t){return new Promise((n,r)=>{let i=setTimeout(()=>{r(new Error('LocalVideoProcessor: worker did not post { type: "ready" } within timeout'))},Q8);t.onerror=a=>{clearTimeout(i),r(new Error(`LocalVideoProcessor: worker failed to start: ${a.message||"worker script could not be loaded"}`,{cause:a}))},t.onmessage=a=>{var s;((s=a.data)===null||s===void 0?void 0:s.type)==="ready"&&(clearTimeout(i),n())}})}setupTransform(t){if(!t){this.invalidate();return}let n=this.worker,r=this.listener;if(!n||!r)return;let i=t.clone(),a;try{let s=new MediaStreamTrackProcessor({track:i});a=new MediaStreamTrackGenerator({kind:"video"}),n.postMessage({type:"transform",readable:s.readable,writable:a.writable,options:r.workerOptions},[s.readable,a.writable]),this.stopTransformInput(),this.transformInput=i,this.outputTrack=a,this.own(a),(0,Z8.markPipelineOwned)(a),this.rawTrack=t}catch(s){throw i.stop(),a?.stop(),s}}invalidate(){this.stopTransformInput(),this.rawTrack=void 0,this.outputTrack=void 0}stopTransformInput(){var t;(t=this.transformInput)===null||t===void 0||t.stop(),this.transformInput=void 0}own(t){this.owned.forEach(n=>{n.readyState==="ended"&&this.owned.delete(n)}),this.owned.add(t)}};mi.LocalVideoProcessor=Ql;function Y8(){if(typeof MediaStreamTrackProcessor>"u"||typeof MediaStreamTrackGenerator>"u")throw new Error("LocalVideoFrameListener requires the Insertable Streams API (MediaStreamTrackProcessor and MediaStreamTrackGenerator), which is unavailable in this browser.")}});var $l=p(gi=>{"use strict";var $8=gi&&gi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(gi,"__esModule",{value:!0});gi.MediaController=void 0;var Yl=class e{static create(t){return $8(this,void 0,void 0,function*(){return new e(t)})}constructor(t){this.stream=t}get mediaStream(){return this.stream}get hasAnyTracks(){return this.stream.getTracks().length>0}getTracks(){return this.stream.getTracks()}stop(){this.stream.getTracks().forEach(t=>t.stop())}};gi.MediaController=Yl});var AS=p(_i=>{"use strict";var X8=_i&&_i.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(_i,"__esModule",{value:!0});_i.LocalMediaPipeline=void 0;var j8=IS(),eR=TS(),tR=$l(),Xl=class{constructor(){this.audioProcessor=new j8.LocalAudioProcessor,this.videoProcessor=new eR.LocalVideoProcessor,this.disposed=!1,this.audioListenerUpdate=Promise.resolve(),this.videoListenerUpdate=Promise.resolve()}get rawMedia(){return this.raw}setRawMedia(t){if(this.disposed)return t.getTracks().forEach(r=>r.stop()),t;let n=this.deriveSenderMedia(t);return this.raw=t,n}deriveSenderMedia(t){let n=t.mediaStream;if(!(n instanceof MediaStream))return t;let r=this.audioProcessor.process(n.getAudioTracks()[0]),i=this.videoProcessor.processTrack(n.getVideoTracks()[0]);return this.reconcileOutgoing(r,i)}setAudioListener(t){let n=this.audioListenerUpdate.then(()=>this.installListener(this.audioProcessor,t));return this.audioListenerUpdate=n.catch(()=>{}),n}setVideoListener(t){let n=this.videoListenerUpdate.then(()=>this.installListener(this.videoProcessor,t));return this.videoListenerUpdate=n.catch(()=>{}),n}dispose(){this.disposed=!0;let t=this.outgoingTracks();this.audioProcessor.dispose(t),this.videoProcessor.dispose(t)}outgoingTracks(){var t;return new Set((t=this.out)===null||t===void 0?void 0:t.getTracks())}installListener(t,n){return X8(this,void 0,void 0,function*(){if(!this.disposed){if(yield t.setListener(n),this.disposed){t.dispose(this.outgoingTracks());return}try{this.publishDerived()}catch(r){t.dispose(this.outgoingTracks());try{this.publishDerived()}catch(i){console.error("Failed to restore unprocessed media after a listener install failure:",i)}throw r}}})}publishDerived(){var t;this.raw&&((t=this.onMediaChanged)===null||t===void 0||t.call(this,this.deriveSenderMedia(this.raw)))}reconcileOutgoing(t,n){return this.out||(this.out=new MediaStream),this.setOutgoingTrack(this.out.getAudioTracks()[0],t),this.setOutgoingTrack(this.out.getVideoTracks()[0],n),this.outController||(this.outController=new tR.MediaController(this.out)),this.outController}setOutgoingTrack(t,n){var r,i;t!==n&&(t&&((r=this.out)===null||r===void 0||r.removeTrack(t)),n&&((i=this.out)===null||i===void 0||i.addTrack(n)))}};_i.LocalMediaPipeline=Xl});var wS=p(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.Base64Helper=void 0;var yr=Gn(),jl=ue(),nR=Ce(),ef=class{static encode(t){let n;if(typeof t!="string")if(jl.TypeHelper.isPlainObject(t)||jl.TypeHelper.isArray(t))n=JSON.stringify(t);else throw new nR.ArgumentError("String to encode must be a string, a plain object or an array",(0,jl.nameof)(t));else n=t;let r=yr.enc.Utf8.parse(n),i=yr.enc.Base64.stringify(r);return this.makeURLSafe(i)}static encodeUnsafe(t){let n=yr.enc.Utf8.parse(t);return yr.enc.Base64.stringify(n)}static decode(t){return yr.enc.Base64.parse(t)}static decodeToString(t){return yr.enc.Base64.parse(t).toString(yr.enc.Utf8)}static makeURLSafe(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}static decodeUrlSafeToUint8Array(t){let n="=".repeat((4-t.length%4)%4);return this.decodeToUint8Array(t.replace(/-/g,"+").replace(/_/g,"/")+n)}static decodeToUint8Array(t){let n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}};Vu.Base64Helper=ef});var DS=p(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.CryptoHelper=void 0;var Ku=Gn(),OS=ue(),tf=class e{static convertUTF8ToByteArray(t){return Ku.enc.Utf8.parse(t)}static SHA256FromByteArray(t){return Ku.SHA256(t)}static HMAC_SHA256(t,n){let r=n;return OS.TypeHelper.isString(n)&&(r=OS.Base64Helper.decode(n)),Ku.HmacSHA256(e.convertUTF8ToByteArray(t),r)}static convertByteArrayToHex(t){return t.toString(Ku.enc.Hex)}};zu.CryptoHelper=tf});var RS=p(()=>{});var PS=p((Gu,FS)=>{(function(e,t){typeof Gu=="object"&&typeof FS<"u"?t(Gu):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(Gu,(function(e){"use strict";function t(v){let g=new Error(v);return g.source="ulid",g}let n="0123456789ABCDEFGHJKMNPQRSTVWXYZ",r=n.length,i=Math.pow(2,48)-1,a=10,s=16;function u(v,g,y){return g>v.length-1?v:v.substr(0,g)+y+v.substr(g+1)}function d(v){let g,y=v.length,S,b,I=r-1;for(;!g&&y-->=0;){if(S=v[y],b=n.indexOf(S),b===-1)throw t("incorrectly encoded string");if(b===I){v=u(v,y,n[0]);continue}g=u(v,y,n[b+1])}if(typeof g=="string")return g;throw t("cannot increment this string")}function c(v){let g=Math.floor(v()*r);return g===r&&(g=r-1),n.charAt(g)}function o(v,g){if(isNaN(v))throw new Error(v+" must be a number");if(v>i)throw t("cannot encode time greater than "+i);if(v<0)throw t("time must be positive");if(Number.isInteger(Number(v))===!1)throw t("time must be an integer");let y,S="";for(;g>0;g--)y=v%r,S=n.charAt(y)+S,v=(v-y)/r;return S}function f(v,g){let y="";for(;v>0;v--)y=c(g)+y;return y}function m(v){if(v.length!==a+s)throw t("malformed ulid");var g=v.substr(0,a).split("").reverse().reduce((y,S,b)=>{let I=n.indexOf(S);if(I===-1)throw t("invalid character found: "+S);return y+=I*Math.pow(r,b)},0);if(g>i)throw t("malformed ulid, timestamp too large");return g}function _(v=!1,g){g||(g=typeof window<"u"?window:null);let y=g&&(g.crypto||g.msCrypto);if(y)return()=>{let S=new Uint8Array(1);return y.getRandomValues(S),S[0]/255};try{let S=RS();return()=>S.randomBytes(1).readUInt8()/255}catch{}if(v){try{console.error("secure crypto unusable, falling back to insecure Math.random()!")}catch{}return()=>Math.random()}throw t("secure crypto unusable, insecure Math.random not allowed")}function x(v){return v||(v=_()),function(y){return isNaN(y)&&(y=Date.now()),o(y,a)+f(s,v)}}function E(v){v||(v=_());let g=0,y;return function(b){if(isNaN(b)&&(b=Date.now()),b<=g){let A=y=d(y);return o(g,a)+A}g=b;let I=y=f(s,v);return o(b,a)+I}}let C=x();e.decodeTime=m,e.detectPrng=_,e.encodeRandom=f,e.encodeTime=o,e.factory=x,e.incrementBase32=d,e.monotonicFactory=E,e.randomChar=c,e.replaceCharAt=u,e.ulid=C}))});var NS=p(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.StringHelper=void 0;var rR=Gn(),iR=PS(),nf=class{static random(t=16){return rR.lib.WordArray.random(t).toString()}static hexEncode(t){let n="",r;for(let i=0;i<t.length;i++)r=t.charCodeAt(i).toString(16),n+=`000${r}`.slice(-4);return n}static UUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})}static ULID(t){return(0,iR.ulid)(t)}};Zu.StringHelper=nf});var MS=p(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.EnvHelper=void 0;var rf=class{static getBrowserInfo(){let t=navigator.userAgent,n=t.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||t.match(/(applewebkit(?=\/))\/?\s*(\d+)/i)||[],r;return/trident/i.test(n[1])?(r=/\brv[ :]+(\d+)/g.exec(t)||[],"IE "+(r[1]||"")):n[1]==="Chrome"&&(r=t.match(/\bOPR\/(\d+)/),r!=null)?"Opera "+r[1]:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(r=t.match(/version\/(\d+)/i))!=null&&n.splice(1,1,r[1]),n.join("/").substring(0,50))}static getFullUserAgent(){return navigator.userAgent}static getPlatformInfo(){return navigator.platform}};Qu.EnvHelper=rf});var BS=p(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.TypeHelper=void 0;var af=class{static isPlainObject(t){return Object.prototype.toString.call(t)==="[object Object]"}static isArray(t){return Array.isArray(t)}static isString(t){return typeof t=="string"||t instanceof String}static isWordArray(t){return!!(t.words&&this.isArray(t.words)&&t.sigBytes)}static isDateObject(t){return Object.prototype.toString.call(t)==="[object Date]"}static isBoolean(t){return typeof t=="boolean"}static isNumber(t){return typeof t=="number"}};Yu.TypeHelper=af});var qS=p($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.DateHelper=void 0;var of=class{static formatISO8601BasicDateTime(t){return t.toISOString().replace(/(\.)(\d+)(Z)/,"$1$3").replace(/[-.:]/g,"")}};$u.DateHelper=of});var kS=p(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.PromiseHelper=void 0;var sf=class e{static getTimeoutPromise(t,n){return e.setTimeout(new Promise((r,i)=>{n().then(a=>r(a)).catch(a=>{i(a)})}),t)}static setTimeout(t,n){return Promise.race([t,new Promise((r,i)=>{setTimeout(()=>{i("Timeout executing promise")},n)})])}static sleep(t){return new Promise(n=>setTimeout(n,t))}};Xu.PromiseHelper=sf});var JS=p(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.pipeAsync=Et.pipe=Et.isEmpty=Et.nameof=void 0;var aR=e=>e.constructor.name;Et.nameof=aR;var oR=e=>e&&Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype;Et.isEmpty=oR;var sR=(...e)=>t=>e.reduce((n,r)=>r(n),t);Et.pipe=sR;var uR=(...e)=>t=>e.reduce((n,r)=>n.then(r),Promise.resolve(t));Et.pipeAsync=uR});var ue=p(ke=>{"use strict";var cR=ke&&ke.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),yn=ke&&ke.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&cR(t,e,n)};Object.defineProperty(ke,"__esModule",{value:!0});yn(wS(),ke);yn(DS(),ke);yn(NS(),ke);yn(MS(),ke);yn(BS(),ke);yn(qS(),ke);yn(kS(),ke);yn(JS(),ke)});var xi=p(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.EventFanout=void 0;var dR=ue(),uf=class{constructor(){this.idKey=dR.StringHelper.UUID(),this.idCounter=0,this.onEvent=t=>{this.listeners.forEach(n=>{this.listen(t,n)}),this.onEventProcessed(t)},this.listeners=new Array}addListener(t){this.setId(t),this.listeners.push(t)}removeListener(t){this.listeners=this.listeners.filter(n=>n[this.idKey]!=this.getId(t))}onEventProcessed(t){}setId(t){t[this.idKey]=++this.idCounter}getId(t){return t[this.idKey]}};ju.EventFanout=uf});var US=p(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0})});var HS=p(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.CallDirection=void 0;var WS;(function(e){e[e.INBOUND=1]="INBOUND",e[e.OUTBOUND=2]="OUTBOUND"})(WS||(ec.CallDirection=WS={}))});var cf=p(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.CallState=void 0;var VS;(function(e){e[e.Init=0]="Init",e[e.Progressing=1]="Progressing",e[e.Established=2]="Established",e[e.Ended=3]="Ended",e[e.Answered=4]="Answered",e[e.Ringing=5]="Ringing"})(VS||(tc.CallState=VS={}))});var nc=p(Zt=>{"use strict";var lR=Zt&&Zt.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),df=Zt&&Zt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&lR(t,e,n)};Object.defineProperty(Zt,"__esModule",{value:!0});df(US(),Zt);df(HS(),Zt);df(cf(),Zt)});var KS=p(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});var rc=ct(),lf=Ro(),fR=xi(),Fo=Lt(),hR=nc(),ff=class extends fR.EventFanout{constructor(t){super(),this.call=t,this.iceConnectionState=lf.IceConnectionState.New,this.issuedProgressing=!1,this.issuedEstablished=!1,this.issuedAccepted=!1,this.issuedAnswered=!1,this.listen=(n,r)=>{switch(n.state){case rc.SessionState.Terminated:r.onCallEnded&&r.onCallEnded(this.call);break;case rc.SessionState.Established:r.onCallAnswered&&r.onCallAnswered(this.call);break}}}setCurrentIceConnectionState(t){this.iceConnectionState=t,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination()}setPushNotificationRequestSent(){if(this.call.direction===Fo.Direction.Inbound){console.warn("Calling setPushNotificationRequestSent on Inbound call");return}this.issueCallProgressingIfNeeded()}setCallAccepted(){if(this.call.direction===Fo.Direction.Outbound){console.warn("Calling setCallAccepted on Outbound call");return}this.issueCallAcceptedIfNeeded()}onEventProcessed(t){switch(super.onEventProcessed(t),t.state){case rc.SessionState.Established:this.issuedAnswered=!0,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination();break;case rc.SessionState.Progress:this.issueCallProgressingIfNeeded(),this.issueCallRingingIfNeeded();break}}issueCallProgressingIfNeeded(){this.issuedProgressing||(this.issuedProgressing=!0,this.listeners.forEach(t=>{t.onCallProgressing&&this.call.direction===Fo.Direction.Outbound&&t.onCallProgressing(this.call)}))}issueCallRingingIfNeeded(){this.listeners.forEach(t=>{t.onCallRinging&&this.call.direction===Fo.Direction.Outbound&&t.onCallRinging(this.call)})}issueCallEstablishedIfNeeded(){this.issuedEstablished||!this.issuedAnswered||this.iceConnectionState!=lf.IceConnectionState.Connected||(this.issuedEstablished=!0,this.listeners.forEach(t=>{t.onCallEstablished&&t.onCallEstablished(this.call)}))}issueCallAcceptedIfNeeded(){this.issuedAccepted||(this.issuedAccepted=!0,this.listeners.forEach(t=>{t.onCallAccepted&&this.call.direction===Fo.Direction.Inbound&&t.onCallAccepted(this.call)}))}checkIceFailureTermination(){let t=this.call.state===hR.CallState.Ended;this.issuedAnswered&&!this.issuedEstablished&&!t&&this.iceConnectionState===lf.IceConnectionState.Failed&&this.call.terminateDueToIceFailure()}};hf.default=ff});var zS=p(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.TrackEventFanout=void 0;var pR=xi(),pf=class extends pR.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onRemoteTrack&&r.onRemoteTrack(this.call,n)}}};ic.TrackEventFanout=pf});var yi=p(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.FeatureFlagDefaults=Si.FeatureFlag=void 0;var ac;(function(e){e.IncludeMxpEventLog="CallReport.IncludeMxpEventLog",e.UseTurn="WebRtc.UseTurn"})(ac||(Si.FeatureFlag=ac={}));Si.FeatureFlagDefaults={[ac.IncludeMxpEventLog]:!1,[ac.UseTurn]:!1}});var ZS=p(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0})});var vf=p(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.Capability=void 0;var QS;(function(e){e.Push="push",e.PushV4="push.4",e.P2p="p2p",e.Ocra="ocra.1",e.IceProxy="ice-proxy.1",e.Turn="turn.2"})(QS||(oc.Capability=QS={}))});var sc=p(Cn=>{"use strict";var vR=Cn&&Cn.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),YS=Cn&&Cn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&vR(t,e,n)};Object.defineProperty(Cn,"__esModule",{value:!0});YS(ZS(),Cn);YS(vf(),Cn)});var mf=p(tt=>{"use strict";var mR=tt&&tt.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(tt,"__esModule",{value:!0});tt.toRTCIceServer=tt.createIceServerSetter=tt.onTurnFeatureFlagChanged=tt.createIceServerFetcher=void 0;var gR=yi(),_R=sc(),uc;(function(e){e.ValidUntil="validUntil",e.Password="password"})(uc||(uc={}));var xR=(e,t,n)=>()=>mR(void 0,void 0,void 0,function*(){try{let r=yield e.getIceServers({userId:t,instanceId:n});return r&&r.iceServers}catch(r){return console.error(r),[]}});tt.createIceServerFetcher=xR;var SR=e=>t=>{e.toggleCapability(_R.Capability.Turn,t.get(gR.FeatureFlag.UseTurn))};tt.onTurnFeatureFlagChanged=SR;var yR=e=>t=>{e.setIceServers(t)};tt.createIceServerSetter=yR;var CR=e=>e?e.map(t=>{let n={};for(let[r,i]of Object.entries(t))switch(r){case uc.Password:n.credential=i;break;case uc.ValidUntil:n.validUntil=typeof i=="string"?new Date(i):i;break;default:n[r]=i}return n}):[];tt.toRTCIceServer=CR});var cc=p(En=>{"use strict";var ER=En&&En.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),$S=En&&En.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&ER(t,e,n)};Object.defineProperty(En,"__esModule",{value:!0});$S(Ro(),En);$S(mf(),En)});var lc=p(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.CallEndCause=void 0;var XS;(function(e){e[e.None=0]="None",e[e.Timeout=1]="Timeout",e[e.Denied=2]="Denied",e[e.NoAnswer=3]="NoAnswer",e[e.Failure=4]="Failure",e[e.HungUp=5]="HungUp",e[e.Canceled=6]="Canceled",e[e.OtherDeviceAnswered=7]="OtherDeviceAnswered",e[e.Inactive=8]="Inactive"})(XS||(dc.CallEndCause=XS={}))});var jS=p(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.DefaultCallDetails=void 0;var gf=Lt(),bt=dt(),fc=dn(),bn=lc(),_f=class{constructor(t,n){this.call=t,this.session=n,this.hadVideoStream=!1,this.hadAudioStream=!1,this.requestedVideo=!1,this.requestedAudio=!0,this.startedTime=t.createdAt,this.requestedVideo=t.requestedVideo,this.direction=t.direction,t.addInternalListener(this)}get duration(){return this.calculateDurationMs(this.establishedTime,this.endedTime)}get setupDuration(){return this.calculateDurationMs(this.startedTime,this.progressTime)}get notifyingDuration(){return this.calculateDurationMs(this.progressTime,this.rungTime)}get ringingDuration(){var t,n,r;let i=this.direction===gf.Direction.Inbound?this.startedTime:this.rungTime,a=this.direction===gf.Direction.Outbound?(t=this.answeredTime)!==null&&t!==void 0?t:this.endedTime:(r=(n=this.acceptedTime)!==null&&n!==void 0?n:this.answeredTime)!==null&&r!==void 0?r:this.endedTime;return this.calculateDurationMs(i,a)}get acceptingDuration(){return this.calculateDurationMs(this.acceptedTime,this.answeredTime)}get connectingDuration(){var t;let n=this.direction===gf.Direction.Inbound?(t=this.acceptedTime)!==null&&t!==void 0?t:this.answeredTime:this.answeredTime;return this.calculateDurationMs(n,this.establishedTime)}get error(){return this.inferCallError()}get endCause(){return this.mapCallEndCause(this.session.terminationCause)}onCallEnded(t){this.endedTime=new Date,this.call.removeInternalListener(this)}onCallProgressing(t){this.progressTime=new Date}onCallRinging(t){this.rungTime=new Date}onCallAccepted(t){this.acceptedTime=new Date}onCallAnswered(t){this.answeredTime=new Date}onCallEstablished(t){this.establishedTime=new Date}onRemoteTrack(t,n){n.kind=="video"?this.hadVideoStream=!0:n.kind=="audio"&&(this.hadAudioStream=!0)}mapCallEndCause(t){switch(t){case bt.TerminationCause.Canceled:return bn.CallEndCause.Canceled;case bt.TerminationCause.Denied:return bn.CallEndCause.Denied;case bt.TerminationCause.Error:case bt.TerminationCause.IceFailedToConnect:return bn.CallEndCause.Failure;case bt.TerminationCause.HungUp:return bn.CallEndCause.HungUp;case bt.TerminationCause.None:return bn.CallEndCause.None;case bt.TerminationCause.Timeout:return bn.CallEndCause.NoAnswer;case bt.TerminationCause.OtherPeerAccepted:return bn.CallEndCause.OtherDeviceAnswered;case bt.TerminationCause.Inactive:return bn.CallEndCause.Inactive}}inferCallError(){return this.session.terminationCause===bt.TerminationCause.IceFailedToConnect?new fc.SinchError(fc.ErrorMessage.ICE_FAILED_TO_CONNECT,fc.ErrorCode.CallFailedToConnectIce,fc.ErrorType.Network):this.session.error}calculateDurationMs(t,n){return!t||!n?0:n.getTime()-t.getTime()}};hc.DefaultCallDetails=_f});var ey=p(pc=>{"use strict";Object.defineProperty(pc,"__esModule",{value:!0});pc.CallQualityWarningEventFanout=void 0;var bR=xi(),xf=class extends bR.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onCallQualityWarningEvent&&r.onCallQualityWarningEvent(this.call,n)}}};pc.CallQualityWarningEventFanout=xf});var Cr=p(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.CallQualityWarningMediaStreamType=void 0;var ty;(function(e){e.Audio="Audio",e.Video="Video"})(ty||(vc.CallQualityWarningMediaStreamType=ty={}))});var Qt=p(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.MediaType=Ci.RtcStatsTypes=void 0;var ny;(function(e){e.CandidatePair="candidate-pair",e.Codec="codec",e.InboundRtp="inbound-rtp",e.MediaSource="media-source",e.OutboundRtp="outbound-rtp",e.RemoteCandidate="remote-candidate",e.LocalCandidate="local-candidate",e.Track="track",e.RemoteInboundRtp="remote-inbound-rtp"})(ny||(Ci.RtcStatsTypes=ny={}));var ry;(function(e){e.Audio="audio",e.Video="video"})(ry||(Ci.MediaType=ry={}))});var It=p(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.getStatsWithType=IR;mc.calculateBufferSize=TR;var iy=Ce();function IR(e,t,n){let r=null;return e.forEach(i=>{i.type===t&&i.kind===n&&(r=i)}),r}function TR(e,t){if(e<=0)throw new iy.ArgumentError("timeSpanCoveredMs must be greater than 0","timeSpanCoveredMs");if(t<=0)throw new iy.ArgumentError("statsRequestIntervalMs must be greater than 0","statsRequestIntervalMs");return Math.ceil(e/t+.5)}});var Yt=p(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CallQualityWarningEventType=void 0;var ay;(function(e){e.Trigger="Trigger",e.Recover="Recover"})(ay||(gc.CallQualityWarningEventType=ay={}))});var oy=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.HighRemoteInboundRttWarningEvent=void 0;var Sf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highRemoteInboundRtt"}};_c.HighRemoteInboundRttWarningEvent=Sf});var Cf=p(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.BaseDetector=void 0;var AR=Yt(),yf=class{constructor(t){this.fanout=t,this._isInTriggeredState=!1,this._isActive=!1}get isInTriggeredState(){return this._isInTriggeredState}set isInTriggeredState(t){this._isInTriggeredState=t}get isActive(){return this._isActive}set isActive(t){this._isActive=t}emitWarning(t){this.isInTriggeredState=t.type===AR.CallQualityWarningEventType.Trigger,this.fanout.onEvent(t)}};xc.BaseDetector=yf});var Er=p(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.WebRtcStatsDetector=void 0;var wR=Cf(),Sc=class extends wR.BaseDetector{};yc.WebRtcStatsDetector=Sc;Sc.TIMESTAMP_KEY="timestamp"});var cy=p(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.HighRemoteInboundRttDetector=void 0;var Ef=Qt(),OR=It(),sy=Yt(),DR=Cr(),uy=oy(),RR=Er(),Po=class e extends RR.WebRtcStatsDetector{constructor(t,n){super(n),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===DR.CallQualityWarningMediaStreamType.Audio?Ef.MediaType.Audio:Ef.MediaType.Video,r=(0,OR.getStatsWithType)(t,Ef.RtcStatsTypes.RemoteInboundRtp,n),i=r?.[e.RTT_KEY];if(!i)return;let a=i*1e3;a>e.RTT_THRESHOLD_MS&&!this.isInTriggeredState?this.emitWarning(new uy.HighRemoteInboundRttWarningEvent(sy.CallQualityWarningEventType.Trigger,this.mediaStream)):a<=e.RTT_THRESHOLD_MS&&this.isInTriggeredState&&this.emitWarning(new uy.HighRemoteInboundRttWarningEvent(sy.CallQualityWarningEventType.Recover,this.mediaStream))}};Cc.HighRemoteInboundRttDetector=Po;Po.RTT_THRESHOLD_MS=300;Po.RTT_KEY="roundTripTime"});var bc=p(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.StatsBuffer=void 0;var FR=Ce(),bf=class{constructor(t,n=0,r=0){if(this.maxSize=t,this.samplesCountForWarning=n,this.threshold=r,this.buffer=[],this.bufferSum=0,n>t)throw new FR.ArgumentError("samplesCountForWarning cannot be greater than maxSize","samplesCountForWarning")}get isFull(){return this.buffer.length===this.maxSize}get allZeros(){return this.buffer.filter(t=>t===0).length===this.maxSize}get isAboveThreshold(){return this.buffer.length<this.maxSize?!1:this.buffer.filter(t=>t>this.threshold).length>=this.samplesCountForWarning}get average(){return this.bufferSum/this.buffer.length}get standardDeviation(){let t=this.average,n=this.buffer.reduce((r,i)=>r+Math.pow(i-t,2),0);return Math.sqrt(n/this.buffer.length)}add(t){if(this.bufferSum+=t,this.buffer.unshift(t),this.buffer.length>this.maxSize){let n=this.buffer.pop();n!==void 0&&(this.bufferSum-=n)}}};Ec.StatsBuffer=bf});var If=p(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.BufferedWarningDetector=void 0;var dy=Yt(),PR=bc(),NR=Er(),No=class extends NR.WebRtcStatsDetector{constructor(t,n,r,i){super(t),this.lastSampleTimestampMs=-1,this.buffer=new PR.StatsBuffer(n,r,i)}onNewMonitoredValue(t,n){t===void 0||n===void 0||n<=this.lastSampleTimestampMs||(this.lastSampleTimestampMs=n,this.buffer.add(t),this.buffer.isAboveThreshold&&!this.isInTriggeredState?this.emitWarning(this.warningEventWithType(dy.CallQualityWarningEventType.Trigger)):!this.buffer.isAboveThreshold&&this.isInTriggeredState&&this.emitWarning(this.warningEventWithType(dy.CallQualityWarningEventType.Recover)))}};Ic.BufferedWarningDetector=No;No.DEFAULT_BUFFER_SIZE=4;No.DEFAULT_SAMPLES_COUNT_FOR_WARNING=3});var ly=p(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.HighInboundJitterWarningEvent=void 0;var Tf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundJitter"}};Tc.HighInboundJitterWarningEvent=Tf});var fy=p(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.HighInboundJitterDetector=void 0;var MR=Cr(),Af=If(),BR=ly(),wf=Qt(),qR=It(),kR=Er(),Mo=class e extends Af.BufferedWarningDetector{constructor(t,n){super(n,Af.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,Af.BufferedWarningDetector.DEFAULT_SAMPLES_COUNT_FOR_WARNING,e.JITTER_THRESHOLD_MS),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===MR.CallQualityWarningMediaStreamType.Audio?wf.MediaType.Audio:wf.MediaType.Video,r=(0,qR.getStatsWithType)(t,wf.RtcStatsTypes.InboundRtp,n),i=r?.[e.JITTER_KEY],a=i!==void 0?i*1e3:void 0;this.onNewMonitoredValue(a,r?.[kR.WebRtcStatsDetector.TIMESTAMP_KEY])}warningEventWithType(t){return new BR.HighInboundJitterWarningEvent(t,this.mediaStream)}};Ac.HighInboundJitterDetector=Mo;Mo.JITTER_KEY="jitter";Mo.JITTER_THRESHOLD_MS=30});var hy=p(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.MissingMediaStreamWarningEvent=void 0;var Of=class{constructor(t){this.type=t,this.name="missingMediaStream"}};wc.MissingMediaStreamWarningEvent=Of});var my=p(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.MissingMediaStreamWarningDetector=void 0;var Oc=cc(),py=Yt(),vy=hy(),JR=Cf(),Dc=class e extends JR.BaseDetector{constructor(t){super(t),this.iceState=Oc.IceConnectionState.New}get isActive(){return super.isActive}set isActive(t){super.isActive=t,!t&&this.timeoutId?clearTimeout(this.timeoutId):t&&this.scheduleStateCheck()}onIceConnectionStateChanged(t){this.iceState=t,this.isActive&&this.scheduleStateCheck()}scheduleStateCheck(){this.timeoutId&&clearTimeout(this.timeoutId);let t=this.iceState==Oc.IceConnectionState.Connected?0:e.WARNING_EMISSION_DELAY_MS;t===0?this.performStateCheck():this.timeoutId=setTimeout(this.performStateCheck.bind(this),t)}performStateCheck(){this.iceState!==Oc.IceConnectionState.Connected&&!this.isInTriggeredState?this.emitWarning(new vy.MissingMediaStreamWarningEvent(py.CallQualityWarningEventType.Trigger)):this.iceState===Oc.IceConnectionState.Connected&&this.isInTriggeredState&&this.emitWarning(new vy.MissingMediaStreamWarningEvent(py.CallQualityWarningEventType.Recover))}};Rc.MissingMediaStreamWarningDetector=Dc;Dc.WARNING_EMISSION_DELAY_MS=2e3});var gy=p(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.HighInboundPacketLossWarningEvent=void 0;var Df=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundPacketLoss"}};Fc.HighInboundPacketLossWarningEvent=Df});var _y=p(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.HighInboundPacketLossDetector=void 0;var LR=Cr(),Rf=If(),Ff=Qt(),UR=Er(),WR=It(),HR=gy(),Ei=class e extends Rf.BufferedWarningDetector{constructor(t,n){super(n,Rf.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,Rf.BufferedWarningDetector.DEFAULT_SAMPLES_COUNT_FOR_WARNING,e.FRACTION_LOST_THRESHOLD),this.mediaStream=t,this.lastPacketsReceivedValue=0,this.lastPacketLostValue=0}onNewWebRtcStats(t){let n=this.mediaStream===LR.CallQualityWarningMediaStreamType.Audio?Ff.MediaType.Audio:Ff.MediaType.Video,r=(0,WR.getStatsWithType)(t,Ff.RtcStatsTypes.InboundRtp,n),i=r?.[UR.WebRtcStatsDetector.TIMESTAMP_KEY],a=r?.[e.PACKET_LOSS_KEY],s=r?.[e.PACKET_RECEIVED_KEY];if(a===void 0||s===void 0||i===void 0)return;let u=s-this.lastPacketsReceivedValue;if(u===0)return;let d=(a-this.lastPacketLostValue)/u;this.lastPacketLostValue=a,this.lastPacketsReceivedValue=s,this.onNewMonitoredValue(d,i)}warningEventWithType(t){return new HR.HighInboundPacketLossWarningEvent(t,this.mediaStream)}};Pc.HighInboundPacketLossDetector=Ei;Ei.PACKET_LOSS_KEY="packetsLost";Ei.PACKET_RECEIVED_KEY="packetsReceived";Ei.FRACTION_LOST_THRESHOLD=.01});var yy=p(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.ConstantAudioLevelDetector=void 0;var VR=It(),xy=Yt(),KR=bc(),Sy=Er(),bi=class e extends Sy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new KR.StatsBuffer((0,VR.calculateBufferSize)(e.AUDIO_STATS_COVERED_TIME_SPAN_MS,t))}onNewWebRtcStats(t){let n=this.handler.getAudioLevelStats(t),r=n?.[e.AUDIO_LEVEL_KEY],i=n?.[Sy.WebRtcStatsDetector.TIMESTAMP_KEY];r===void 0||i===void 0||i<=this.lastStatTimestamp||(this.lastStatTimestamp=i,this.handleNewAudioLevelValue(r))}handleNewAudioLevelValue(t){this.statsBuffer.add(t),this.statsBuffer.isFull&&(this.statsBuffer.standardDeviation<e.AUDIO_LEVEL_MIN_SD_THRESHOLD?this.isInTriggeredState||this.emitWarning(this.handler.createWarningEvent(xy.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(xy.CallQualityWarningEventType.Recover)))}};Nc.ConstantAudioLevelDetector=bi;bi.AUDIO_LEVEL_KEY="audioLevel";bi.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e4;bi.AUDIO_LEVEL_MIN_SD_THRESHOLD=.005});var Pf=p(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.CallQualityWarningController=void 0;var Mc=class e{constructor(t,n){this.call=n,this.missingMediaStreamWarningDetector=t.createMissingMediaStreamDetector(),this.webRtcStatsDectors=t.createWebRtcStatsDetectors()}onCallEstablished(t){this.missingMediaStreamWarningDetector.isActive=!0,this.startFetchingWebRTCStats()}onCallEnded(t){this.missingMediaStreamWarningDetector.isActive=!1,this.intervalId&&clearInterval(this.intervalId)}onIceConnectionStateChanged(t){this.missingMediaStreamWarningDetector.onIceConnectionStateChanged(t)}startFetchingWebRTCStats(){this.intervalId=setInterval(()=>{this.call.getPeerConnectionStats().then(t=>{t&&this.webRtcStatsDectors.forEach(n=>{t&&n.onNewWebRtcStats(t)})})},e.WEBRTC_FETCH_STATS_INTERVAL_MS)}};Bc.CallQualityWarningController=Mc;Mc.WEBRTC_FETCH_STATS_INTERVAL_MS=500});var Cy=p(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.ConstantInboundAudioLevelWarningEvent=void 0;var Nf=class{constructor(t){this.type=t,this.name="constantInboundAudioLevel"}};qc.ConstantInboundAudioLevelWarningEvent=Nf});var by=p(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.ConstantInboundAudioLevelDetectorHandler=void 0;var Ey=Qt(),zR=It(),GR=Cy(),Mf=class{getAudioLevelStats(t){return(0,zR.getStatsWithType)(t,Ey.RtcStatsTypes.InboundRtp,Ey.MediaType.Audio)}createWarningEvent(t){return new GR.ConstantInboundAudioLevelWarningEvent(t)}};kc.ConstantInboundAudioLevelDetectorHandler=Mf});var Iy=p(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ConstantOutboundAudioLevelWarningEvent=void 0;var Bf=class{constructor(t){this.type=t,this.name="constantOutboundAudioLevel"}};Jc.ConstantOutboundAudioLevelWarningEvent=Bf});var Ay=p(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.ConstantOutboundAudioLevelDetectorHandler=void 0;var Ty=Qt(),ZR=It(),QR=Iy(),qf=class{getAudioLevelStats(t){return(0,ZR.getStatsWithType)(t,Ty.RtcStatsTypes.MediaSource,Ty.MediaType.Audio)}createWarningEvent(t){return new QR.ConstantOutboundAudioLevelWarningEvent(t)}};Lc.ConstantOutboundAudioLevelDetectorHandler=qf});var Dy=p(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.ZeroAudioLevelDetector=void 0;var YR=It(),wy=Yt(),$R=bc(),Oy=Er(),Bo=class e extends Oy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new $R.StatsBuffer((0,YR.calculateBufferSize)(e.AUDIO_STATS_COVERED_TIME_SPAN_MS,t))}onNewWebRtcStats(t){let n=this.handler.getAudioLevelStats(t),r=n?.[e.AUDIO_LEVEL_KEY],i=n?.[Oy.WebRtcStatsDetector.TIMESTAMP_KEY];r===void 0||i===void 0||i<=this.lastStatTimestamp||(this.lastStatTimestamp=i,this.handleNewAudioLevelValue(r))}handleNewAudioLevelValue(t){this.statsBuffer.add(t),this.statsBuffer.isFull&&(this.statsBuffer.allZeros?this.isInTriggeredState||this.emitWarning(this.handler.createWarningEvent(wy.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(wy.CallQualityWarningEventType.Recover)))}};Uc.ZeroAudioLevelDetector=Bo;Bo.AUDIO_LEVEL_KEY="audioLevel";Bo.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e3});var Ry=p(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ZeroInboundAudioLevelWarningEvent=void 0;var kf=class{constructor(t){this.type=t,this.name="zeroInboundAudioLevel"}};Wc.ZeroInboundAudioLevelWarningEvent=kf});var Py=p(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ZeroInboundAudioLevelDetectorHandler=void 0;var Fy=Qt(),XR=It(),jR=Ry(),Jf=class{getAudioLevelStats(t){return(0,XR.getStatsWithType)(t,Fy.RtcStatsTypes.InboundRtp,Fy.MediaType.Audio)}createWarningEvent(t){return new jR.ZeroInboundAudioLevelWarningEvent(t)}};Hc.ZeroInboundAudioLevelDetectorHandler=Jf});var Ny=p(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ZeroOutboundAudioLevelWarningEvent=void 0;var Lf=class{constructor(t){this.type=t,this.name="zeroOutboundAudioLevel"}};Vc.ZeroOutboundAudioLevelWarningEvent=Lf});var By=p(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ZeroOutboundAudioLevelDetectorHandler=void 0;var My=Qt(),eF=It(),tF=Ny(),Uf=class{getAudioLevelStats(t){return(0,eF.getStatsWithType)(t,My.RtcStatsTypes.MediaSource,My.MediaType.Audio)}createWarningEvent(t){return new tF.ZeroOutboundAudioLevelWarningEvent(t)}};Kc.ZeroOutboundAudioLevelDetectorHandler=Uf});var Wy=p(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.CallQualityDetectorsFactory=void 0;var Ii=Cr(),qy=cy(),ky=fy(),nF=my(),Jy=_y(),Ly=yy(),zc=Pf(),rF=by(),iF=Ay(),Uy=Dy(),aF=Py(),oF=By(),Wf=class{constructor(t){this.fanout=t}createMissingMediaStreamDetector(){return new nF.MissingMediaStreamWarningDetector(this.fanout)}createWebRtcStatsDetectors(){return[new qy.HighRemoteInboundRttDetector(Ii.CallQualityWarningMediaStreamType.Audio,this.fanout),new qy.HighRemoteInboundRttDetector(Ii.CallQualityWarningMediaStreamType.Video,this.fanout),new ky.HighInboundJitterDetector(Ii.CallQualityWarningMediaStreamType.Audio,this.fanout),new ky.HighInboundJitterDetector(Ii.CallQualityWarningMediaStreamType.Video,this.fanout),new Jy.HighInboundPacketLossDetector(Ii.CallQualityWarningMediaStreamType.Audio,this.fanout),new Jy.HighInboundPacketLossDetector(Ii.CallQualityWarningMediaStreamType.Video,this.fanout),new Ly.ConstantAudioLevelDetector(zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new rF.ConstantInboundAudioLevelDetectorHandler,this.fanout),new Ly.ConstantAudioLevelDetector(zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new iF.ConstantOutboundAudioLevelDetectorHandler,this.fanout),new Uy.ZeroAudioLevelDetector(zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new aF.ZeroInboundAudioLevelDetectorHandler,this.fanout),new Uy.ZeroAudioLevelDetector(zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new oF.ZeroOutboundAudioLevelDetectorHandler,this.fanout)]}};Gc.CallQualityDetectorsFactory=Wf});var qo=p(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MxpClientEventsVersionKey=In.MxpClientEventsVersion=In.MxpClientEvent=void 0;var Hy;(function(e){e.EnteredEstablished="EnteredEstablished",e.IceConnected="IceConnected",e.IceCompleted="IceCompleted"})(Hy||(In.MxpClientEvent=Hy={}));In.MxpClientEventsVersion="2";In.MxpClientEventsVersionKey="cev"});var Vy=p(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.PublicCallListenerCallbackMapper=void 0;var sF=Lt(),Hf=class{constructor(){this.listeners=new Set}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}onCallAccepted(t){for(let n of this.listeners)n.onCallAnswered&&n.onCallAnswered(t)}onCallAnswered(t){if(t.direction===sF.Direction.Outbound)for(let n of this.listeners)n.onCallAnswered&&n.onCallAnswered(t)}onCallProgressing(t){for(let n of this.listeners)n.onCallProgressing&&n.onCallProgressing(t)}onCallRinging(t){for(let n of this.listeners)n.onCallRinging&&n.onCallRinging(t)}onCallEstablished(t){for(let n of this.listeners)n.onCallEstablished&&n.onCallEstablished(t)}onCallEnded(t){for(let n of this.listeners)n.onCallEnded&&n.onCallEnded(t)}onRemoteTrack(t,n){for(let r of this.listeners)r.onRemoteTrack&&r.onRemoteTrack(t,n)}onCallQualityWarningEvent(t,n){for(let r of this.listeners)r.onCallQualityWarningEvent&&r.onCallQualityWarningEvent(t,n)}};Zc.PublicCallListenerCallbackMapper=Hf});var Qc=p(Ai=>{"use strict";var Vf=Ai&&Ai.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.DefaultCall=void 0;var uF=Lt(),br=ct(),cF=bS(),dF=AS(),lF=KS(),fF=zS(),hF=un(),Ky=Ce(),Ti=nc(),pF=ue(),Kf=cc(),Tn=_n(),vF=jS(),zy=dt(),mF=ey(),gF=Wy(),Gy=qo(),_F=Vy(),zf=class{constructor(t,n,r,i,a,s,u,d,c){this.requestedVideo=t,this.session=n,this.mxpChannel=r,this.mediaController=i,this.useRelayIceCandidatesOnly=a,this.clientEventsCollector=s,this.callQualityCollector=u,this.iceServers=c,this.earlyMedia=!1,this.p2p=!0,this.createdAt=new Date,this.localMedia=new dF.LocalMediaPipeline,this.start=()=>Vf(this,void 0,void 0,function*(){yield this.peerConnectionClient.start(),this.withSession(o=>o.start())}),this.onTrackEvent=o=>{this.trackEvent.onEvent(o)},this.onInboundMessage=o=>{this.tryEnableEarlyMedia(o),this.withSession(f=>{f.onInboundMessage(o)})},this.onLocalJsepMessage=o=>{o.isCandidate?this.p2p&&this.withSession(f=>f.setLocalCandidate([o])):this.onLocalDescription(o)},this.publicCallListenerCallbackMapper=new _F.PublicCallListenerCallbackMapper,this.trackEvent=new fF.TrackEventFanout(this),this.callEventFanout=new lF.default(this),this.callQualityWarningEventFanout=new mF.CallQualityWarningEventFanout(this),this.callQualityWarningController=d.create(new gF.CallQualityDetectorsFactory(this.callQualityWarningEventFanout),this),this.callDetail=new vF.DefaultCallDetails(this,n),this.mediaController=this.localMedia.setRawMedia(i),this.peerConnectionClient=cF.PeerConnectionClient.create(this.mediaController,new hF.Event(this.onTrackEvent),this.useRelayIceCandidatesOnly,this.inactivate.bind(this),this.clientEventsCollector,this,this.iceServers),this.peerConnectionClient.onLocalJsepMessage.add(o=>this.onLocalJsepMessage(o)),this.localMedia.onMediaChanged=o=>this.applyDerivedMedia(o),n.onOutboundMessage=this.mxpChannel.sendOutboundMessage,n.onStateChanged=this.callEventFanout.onEvent,n.onJsepMessageReceived=o=>this.peerConnectionClient.onJsepMessageReceived(o.messages),r.onInboundMessage.add(this.onInboundMessage),this.addInternalListener(this.peerConnectionClient),this.addInternalListener(this.clientEventsCollector),this.addInternalListener(this.callQualityWarningController),this.addInternalListener(this.callQualityCollector),this.addInternalListener(this.publicCallListenerCallbackMapper),this.setIceServers=(0,Kf.createIceServerSetter)(this.peerConnectionClient)}answer(){return Vf(this,void 0,void 0,function*(){throw new Ky.InvalidOperationError("Answer can only be called on incoming call.")})}sendDtmf(t){if(!new RegExp("^[0-9#*abcdABCD]+$").test(t))throw new Ky.ArgumentError("Invalid DTMF keys",(0,pF.nameof)(t));this.peerConnectionClient.insertDtmf(t).catch(n=>{console.error(n)})}get localPeer(){return this.session.localPeer}mute(){this.muted=!0,this.enableSenderTracks(!1,"audio")}unmute(){this.muted=!1,this.enableSenderTracks(!0,"audio")}pauseVideo(){this.videoPaused=!0,this.enableSenderTracks(!1,"video")}resumeVideo(){this.videoPaused=!1,this.enableSenderTracks(!0,"video")}updateMediaController(t){let n=this.localMedia.rawMedia;this.applyDerivedMedia(this.localMedia.setRawMedia(t)),n&&n!==t&&n.mediaStream instanceof MediaStream&&n.getTracks().forEach(r=>r.stop())}setLocalAudioFrameListener(t){return this.localMedia.setAudioListener(t)}setLocalVideoFrameListener(t){return this.localMedia.setVideoListener(t)}applyDerivedMedia(t){this.peerConnectionClient.updateMediaController(t),this.mediaController=t}enableSenderTracks(t,n){this.peerConnectionClient.enableSenderTracks(t,n)}onIceConnectionStateChanged(t){this.callEventFanout.setCurrentIceConnectionState(t),this.callQualityWarningController.onIceConnectionStateChanged(t)}onEveryIceConnectionStateChange(t,n){switch(n){case Kf.IceConnectionState.Connected:this.emitClientEvent(Gy.MxpClientEvent.IceConnected,t);break;case Kf.IceConnectionState.Completed:this.emitClientEvent(Gy.MxpClientEvent.IceCompleted,t);break}}tryEnableEarlyMedia(t){this.earlyMedia||this.direction===uF.Direction.Outbound&&t.isEarlyMedia()&&(this.session.state!==br.SessionState.Initiating&&this.session.state!==br.SessionState.Progress||(this.earlyMedia=!0,this.peerConnectionClient.onEarlyMedia(t.from.instanceId)))}inactivate(){this.clientEventsCollector.addEvent(Tn.ClientEvent.createClientEventType(Tn.ClientEventName.SDK_CALL_MARKED_INACTIVE)),this.withSession(t=>t.terminateWithCause(zy.TerminationCause.Inactive))}onLocalDescription(t){this.withSession(n=>n.setLocalSessionDescription(t))}withSession(t){t(this.session)}setPushNotificationRequestSent(){this.callEventFanout.setPushNotificationRequestSent()}get incomingStream(){return this.peerConnectionClient.remoteStream}get outgoingStream(){return this.mediaController.mediaStream}addListener(t){this.publicCallListenerCallbackMapper.addListener(t)}removeListener(t){this.publicCallListenerCallbackMapper.removeListener(t)}performCallEndedCleanup(){var t;let n=this.localMedia.rawMedia;this.peerConnectionClient.cleanup(),this.localMedia.dispose(),(t=this.mediaController)===null||t===void 0||t.getTracks().forEach(r=>r.stop()),n?.getTracks().forEach(r=>r.stop())}mapState(t){switch(t){case br.SessionState.Created:case br.SessionState.Initiating:return this.details.progressTime?Ti.CallState.Progressing:Ti.CallState.Init;case br.SessionState.Progress:return Ti.CallState.Ringing;case br.SessionState.Established:return this.details.establishedTime?Ti.CallState.Established:Ti.CallState.Answered;case br.SessionState.Terminated:return Ti.CallState.Ended}}get state(){return this.mapState(this.session.state)}get id(){return this.session.id}get direction(){return this.session.direction}setHeaders(t){this.publicHeaders=t}get headers(){var t;return(t=this.publicHeaders)!==null&&t!==void 0?t:{}}get isEarlyMedia(){return this.earlyMedia}setLegacyRelayCandidates(t){this.peerConnectionClient.setLegacyRelayCandidates(t)}setMxpSignalingConfiguration(t,n){this.mxpChannel.configure(t,n)}hangup(t){this.clientEventsCollector.addEvent(Tn.ClientEvent.createClientEventType(Tn.ClientEventName.SDK_API_CALL_TERMINATE)),this.withSession(n=>n.terminate(t))}emitClientEvent(t,n){this.withSession(r=>r.sendClientEvent(t,n))}terminateDueToOngoingCall(){this.clientEventsCollector.addEvent(Tn.ClientEvent.createClientEventType(Tn.ClientEventName.SDK_DID_RESPECT_ONGOING_SINCH_CALL)),this.withSession(t=>t.terminate())}terminateDueToIceFailure(){this.clientEventsCollector.addEvent(Tn.ClientEvent.createClientEventType(Tn.ClientEventName.SDK_ICE_FAILED_TERMINATE)),this.withSession(t=>t.terminateWithCause(zy.TerminationCause.IceFailedToConnect))}addInternalListener(t){this.callEventFanout.addListener(t),this.trackEvent.addListener(t),this.callQualityWarningEventFanout.addListener(t)}removeInternalListener(t){this.callEventFanout.removeListener(t),this.trackEvent.removeListener(t),this.callQualityWarningEventFanout.removeListener(t)}get details(){return this.callDetail}getPeerConnectionStats(){return Vf(this,void 0,void 0,function*(){return yield this.peerConnectionClient.getPeerConnectionStats()})}};Ai.DefaultCall=zf});var Zy=p(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.RealTimeScheduler=void 0;var Gf=class{scheduleDelayed(t,n,r){let i=setTimeout(t,n);r?.subscribe(a=>{clearTimeout(i)})}};Yc.RealTimeScheduler=Gf});var Qy=p(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CancellationTokenSource=wi.CancellationError=void 0;var $c=class extends Error{constructor(){super(...arguments),this.name="CancellationError",this.message="The operation was cancelled"}};wi.CancellationError=$c;var Zf=class{constructor(){this.subscribers=new Array}subscribe(t){return this.cancellation?t(this.cancellation):this.subscribers.push(t),()=>{this.subscribers=this.subscribers.filter(n=>n!==t)}}cancel(t=new $c){this.cancellation=t,this.subscribers.splice(0).forEach(n=>n(t))}};wi.CancellationTokenSource=Zf});var Oi=p(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.TransitionSource=void 0;var Yy;(function(e){e[e.LocalAction=0]="LocalAction",e[e.RemotePeerMessage=1]="RemotePeerMessage"})(Yy||(Xc.TransitionSource=Yy={}))});var ko=p(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.TimerEventType=void 0;var $y;(function(e){e[e.Termination=0]="Termination",e[e.ACKWindowEnd=1]="ACKWindowEnd"})($y||(jc.TimerEventType=$y={}))});var eC=p(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.FsmState=void 0;var Xy=yo(),jy=dt(),ed=ct(),xF=ft(),SF=Ce(),Qf=Oi(),yF=ko(),Yf=class{constructor(t,n){this.fsmSessionState=t,this.transitions=n,this.callTerminationCause=jy.TerminationCause.None}get terminationCause(){return this.callTerminationCause}set terminationCause(t){this.callTerminationCause=t}get sessionState(){return this.fsmSessionState}get stateName(){return this.constructor.name}onInboundMessage(t){this.handleInboundMessage(t)||console.error(`Received unexpected message: ${xF.Method[t.method]} when in ${this.stateName} state. Ignoring...`)}onSessionDescription(t,n){Xy.Source.Local==t&&this.onLocalSessionDescription(n)}onCandidate(t,n){Xy.Source.Local==t&&this.onLocalCandidate(n)}onStateTimeout(t){t.type==yF.TimerEventType.Termination&&(this.onTimeout(t),this.transition(ed.SessionState.Terminated,Qf.TransitionSource.LocalAction))}onTimeout(t){}onException(t){console.log(`FsmState exception: ${t}`),this.transition(ed.SessionState.Terminated,Qf.TransitionSource.LocalAction)}terminate(t,n){t&&(this.callTerminationCause=jy.TerminationCause.Error),this.transition(ed.SessionState.Terminated,n??Qf.TransitionSource.LocalAction)}terminateWithCause(t,n){this.callTerminationCause=t,this.terminate(void 0,n)}accept(){this.onAccept()}enter(t,n){this.callTerminationCause=t.callTerminationCause,this.onEnter(n)}exit(t,n){t.sessionState==ed.SessionState.Terminated&&this.onWillTerminate(n),this.onExit(n)}transition(t,n){var r;(r=this.transitions)===null||r===void 0||r.transition(this,t,n)}onEnter(t){}onExit(t){}onWillTerminate(t){}handleInboundMessage(t){return!1}onAccept(){throw new SF.InvalidOperationError(`Accept() is not a valid action for current state (${this.stateName})`)}onLocalSessionDescription(t){}onLocalCandidate(t){}};td.FsmState=Yf});var nC=p(tC=>{"use strict";Object.defineProperty(tC,"__esModule",{value:!0})});var rC=p(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.FsmTransitions=void 0;var CF=mt(),$f=class{constructor(){this.entries=new Array,this.nullState=new CF.NullState}add(t,n,r){this.entries.push({from:t,to:n,next:r})}tryGetNext(t,n,r){let i=this.entries.find(a=>a.from==t.sessionState&&a.to==n);return i?(r(i.next),!0):(r(this.nullState),!1)}};nd.FsmTransitions=$f});var aC=p(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.NullState=void 0;var iC=ct(),EF=dt(),bF=mt(),Xf=class extends bF.FsmState{constructor(){super(iC.SessionState.Terminated)}throw(){throw new Error("Invalid state (null)")}get sessionState(){return this.throw(),iC.SessionState.Terminated}get terminationCause(){return this.throw(),EF.TerminationCause.None}onSessionDescription(t,n){this.throw()}onInboundMessage(t){this.throw()}onTimeout(t){this.throw()}onException(t){this.throw()}terminate(t){this.throw()}accept(){this.throw()}enter(t){this.throw()}exit(t){this.throw()}transition(t){this.throw()}onCandidate(t,n){this.throw()}};rd.NullState=Xf});var oC=p(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.TimerEvent=void 0;var jf=class e{constructor(t,n,r){this.id=t,this.description=n,this.type=r}equals(t){return t instanceof e&&t.id==this.id}getHashCode(){return this.id}toString(){return`TimerEvent(Id=${this.id}, ${this.description})`}};id.TimerEvent=jf});var mt=p(Ke=>{"use strict";var IF=Ke&&Ke.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Ir=Ke&&Ke.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&IF(t,e,n)};Object.defineProperty(Ke,"__esModule",{value:!0});Ir(Qy(),Ke);Ir(Ce(),Ke);Ir(eC(),Ke);Ir(nC(),Ke);Ir(rC(),Ke);Ir(aC(),Ke);Ir(oC(),Ke)});var Jo=p(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.SessionStateBase=void 0;var Tr=ft(),TF=mt(),AF=dt(),wF=ht(),eh=class extends TF.FsmState{get Session(){return this.session}constructor(t,n){super(t,n),this.CallSetupTimeoutMs=45e3,this.CallSetupTimeoutInboundMs=6e4,this.CallProgressTimeoutMs=1e4,this.CallACKWindowTimeoutMs=1e4,this.session=n}onTimeout(t){this.callTerminationCause=AF.TerminationCause.Timeout}terminateBasedOnMessage(t,n){var r;this.callTerminationCause=(r=t.getTerminationCause())!==null&&r!==void 0?r:n,this.session.terminate(t.getError())}onExit(t){this.Session.cancelScheduledTimeouts(this)}timeoutRelativeToStart(t){return this.Session.timeoutRelativeToStart(t)}sendJoined(t){this.sendOutboundMessage(this.Session.newMessage().method(Tr.Method.Joined).body(wF.Codec.encodeClient(t.from)).build())}sendError(t){let n=this.Session.newMessage().method(Tr.Method.Error);t&&n.body(Tr.Body.error(t)),this.sendOutboundMessage(n.build())}sendOutboundMessage(t){this.Session.sendOutboundMessage(t)}hasSentOutboundMessage(t){return this.Session.hasSentMessage(n=>n.method==t)}onLocalSessionDescription(t){this.sendOutboundMessage(this.Session.newMessage().method(Tr.Method.PeerEvent).body(Tr.Body.sdp(t.asJson())).build())}onLocalCandidate(t){t.forEach(n=>{let r=this.Session.newMessage().method(Tr.Method.PeerEvent).body(Tr.Body.sdp(n.data));n.instanceId&&r.values({to:n.instanceId}),this.sendOutboundMessage(r.build())})}};ad.SessionStateBase=eh});var sC=p(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.and=ae.or=ae.not=ae.Contravariant=ae.getMonoidAll=ae.getSemigroupAll=ae.getMonoidAny=ae.getSemigroupAny=ae.URI=ae.contramap=void 0;var Di=Ae(),OF=function(e,t){return(0,Di.pipe)(e,(0,ae.contramap)(t))},DF=function(e){return function(t){return(0,Di.flow)(e,t)}};ae.contramap=DF;ae.URI="Predicate";var RF=function(){return{concat:function(e,t){return(0,Di.pipe)(e,(0,ae.or)(t))}}};ae.getSemigroupAny=RF;var FF=function(){return{concat:(0,ae.getSemigroupAny)().concat,empty:Di.constFalse}};ae.getMonoidAny=FF;var PF=function(){return{concat:function(e,t){return(0,Di.pipe)(e,(0,ae.and)(t))}}};ae.getSemigroupAll=PF;var NF=function(){return{concat:(0,ae.getSemigroupAll)().concat,empty:Di.constTrue}};ae.getMonoidAll=NF;ae.Contravariant={URI:ae.URI,contramap:OF};var MF=function(e){return function(t){return!e(t)}};ae.not=MF;var BF=function(e){return function(t){return function(n){return t(n)||e(n)}}};ae.or=BF;var qF=function(e){return function(t){return function(n){return t(n)&&e(n)}}};ae.and=qF});var uC=p(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.concatAll=nt.endo=nt.filterSecond=nt.filterFirst=nt.reverse=void 0;var kF=function(e){return{concat:function(t,n){return e.concat(n,t)}}};nt.reverse=kF;var JF=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}};nt.filterFirst=JF;var LF=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}};nt.filterSecond=LF;var UF=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}};nt.endo=UF;var WF=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};nt.concatAll=WF});var cC=p(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.eqDate=z.eqNumber=z.eqString=z.eqBoolean=z.eq=z.strictEqual=z.getStructEq=z.getTupleEq=z.Contravariant=z.getMonoid=z.getSemigroup=z.eqStrict=z.URI=z.contramap=z.tuple=z.struct=z.fromEquals=void 0;var HF=Ae(),VF=function(e){return{equals:function(t,n){return t===n||e(t,n)}}};z.fromEquals=VF;var KF=function(e){return(0,z.fromEquals)(function(t,n){for(var r in e)if(!e[r].equals(t[r],n[r]))return!1;return!0})};z.struct=KF;var zF=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,z.fromEquals)(function(n,r){return e.every(function(i,a){return i.equals(n[a],r[a])})})};z.tuple=zF;var GF=function(e,t){return(0,HF.pipe)(e,(0,z.contramap)(t))},ZF=function(e){return function(t){return(0,z.fromEquals)(function(n,r){return t.equals(e(n),e(r))})}};z.contramap=ZF;z.URI="Eq";z.eqStrict={equals:function(e,t){return e===t}};var QF={equals:function(){return!0}},YF=function(){return{concat:function(e,t){return(0,z.fromEquals)(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}};z.getSemigroup=YF;var $F=function(){return{concat:(0,z.getSemigroup)().concat,empty:QF}};z.getMonoid=$F;z.Contravariant={URI:z.URI,contramap:GF};z.getTupleEq=z.tuple;z.getStructEq=z.struct;z.strictEqual=z.eqStrict.equals;z.eq=z.Contravariant;z.eqBoolean=z.eqStrict;z.eqString=z.eqStrict;z.eqNumber=z.eqStrict;z.eqDate={equals:function(e,t){return e.valueOf()===t.valueOf()}}});var dC=p(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.ordDate=k.ordNumber=k.ordString=k.ordBoolean=k.ord=k.getDualOrd=k.getTupleOrd=k.between=k.clamp=k.max=k.min=k.geq=k.leq=k.gt=k.lt=k.equals=k.trivial=k.Contravariant=k.getMonoid=k.getSemigroup=k.URI=k.contramap=k.reverse=k.tuple=k.fromCompare=k.equalsDefault=void 0;var XF=cC(),od=Ae(),jF=function(e){return function(t,n){return t===n||e(t,n)===0}};k.equalsDefault=jF;var e4=function(e){return{equals:(0,k.equalsDefault)(e),compare:function(t,n){return t===n?0:e(t,n)}}};k.fromCompare=e4;var t4=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(0,k.fromCompare)(function(n,r){for(var i=0;i<e.length-1;i++){var a=e[i].compare(n[i],r[i]);if(a!==0)return a}return e[i].compare(n[i],r[i])})};k.tuple=t4;var n4=function(e){return(0,k.fromCompare)(function(t,n){return e.compare(n,t)})};k.reverse=n4;var r4=function(e,t){return(0,od.pipe)(e,(0,k.contramap)(t))},i4=function(e){return function(t){return(0,k.fromCompare)(function(n,r){return t.compare(e(n),e(r))})}};k.contramap=i4;k.URI="Ord";var a4=function(){return{concat:function(e,t){return(0,k.fromCompare)(function(n,r){var i=e.compare(n,r);return i!==0?i:t.compare(n,r)})}}};k.getSemigroup=a4;var o4=function(){return{concat:(0,k.getSemigroup)().concat,empty:(0,k.fromCompare)(function(){return 0})}};k.getMonoid=o4;k.Contravariant={URI:k.URI,contramap:r4};k.trivial={equals:od.constTrue,compare:(0,od.constant)(0)};var s4=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}};k.equals=s4;var u4=function(e){return function(t,n){return e.compare(t,n)===-1}};k.lt=u4;var c4=function(e){return function(t,n){return e.compare(t,n)===1}};k.gt=c4;var d4=function(e){return function(t,n){return e.compare(t,n)!==1}};k.leq=d4;var l4=function(e){return function(t,n){return e.compare(t,n)!==-1}};k.geq=l4;var f4=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}};k.min=f4;var h4=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};k.max=h4;var p4=function(e){var t=(0,k.min)(e),n=(0,k.max)(e);return function(r,i){return function(a){return n(t(a,i),r)}}};k.clamp=p4;var v4=function(e){var t=(0,k.lt)(e),n=(0,k.gt)(e);return function(r,i){return function(a){return!(t(a,r)||n(a,i))}}};k.between=v4;k.getTupleOrd=k.tuple;k.getDualOrd=k.reverse;k.ord=k.Contravariant;function m4(e,t){return e<t?-1:e>t?1:0}var th={equals:XF.eqStrict.equals,compare:m4};k.ordBoolean=th;k.ordString=th;k.ordNumber=th;k.ordDate=(0,od.pipe)(k.ordNumber,(0,k.contramap)(function(e){return e.valueOf()}))});var pC=p(L=>{"use strict";var g4=L&&L.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),_4=L&&L.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),nh=L&&L.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&g4(t,e,n);return _4(t,e),t};Object.defineProperty(L,"__esModule",{value:!0});L.semigroupProduct=L.semigroupSum=L.semigroupString=L.getFunctionSemigroup=L.semigroupAny=L.semigroupAll=L.getIntercalateSemigroup=L.getMeetSemigroup=L.getJoinSemigroup=L.getDualSemigroup=L.getStructSemigroup=L.getTupleSemigroup=L.getFirstSemigroup=L.getLastSemigroup=L.getObjectSemigroup=L.semigroupVoid=L.concatAll=L.last=L.first=L.intercalate=L.tuple=L.struct=L.reverse=L.constant=L.max=L.min=void 0;L.fold=O4;var lC=Ae(),x4=nh(_r()),fC=nh(uC()),hC=nh(dC()),S4=function(e){return{concat:hC.min(e)}};L.min=S4;var y4=function(e){return{concat:hC.max(e)}};L.max=y4;var C4=function(e){return{concat:function(){return e}}};L.constant=C4;L.reverse=fC.reverse;var E4=function(e){return{concat:function(t,n){var r={};for(var i in e)x4.has.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}};L.struct=E4;var b4=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return{concat:function(n,r){return e.map(function(i,a){return i.concat(n[a],r[a])})}}};L.tuple=b4;var I4=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}};L.intercalate=I4;var T4=function(){return{concat:lC.identity}};L.first=T4;var A4=function(){return{concat:function(e,t){return t}}};L.last=A4;L.concatAll=fC.concatAll;L.semigroupVoid=(0,L.constant)(void 0);var w4=function(){return{concat:function(e,t){return Object.assign({},e,t)}}};L.getObjectSemigroup=w4;L.getLastSemigroup=L.last;L.getFirstSemigroup=L.first;L.getTupleSemigroup=L.tuple;L.getStructSemigroup=L.struct;L.getDualSemigroup=L.reverse;L.getJoinSemigroup=L.max;L.getMeetSemigroup=L.min;L.getIntercalateSemigroup=L.intercalate;function O4(e){var t=(0,L.concatAll)(e);return function(n,r){return r===void 0?t(n):t(n)(r)}}L.semigroupAll={concat:function(e,t){return e&&t}};L.semigroupAny={concat:function(e,t){return e||t}};L.getFunctionSemigroup=lC.getSemigroup;L.semigroupString={concat:function(e,t){return e+t}};L.semigroupSum={concat:function(e,t){return e+t}};L.semigroupProduct={concat:function(e,t){return e*t}}});var vC=p(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.guard=D4;function D4(e,t){return function(n){return n?t.of(void 0):e.zero()}}});var CC=p(h=>{"use strict";var R4=h&&h.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),F4=h&&h.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),mC=h&&h.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&R4(t,e,n);return F4(t,e),t};Object.defineProperty(h,"__esModule",{value:!0});h.throwError=h.Witherable=h.wilt=h.wither=h.Traversable=h.sequence=h.traverse=h.Filterable=h.partitionMap=h.partition=h.filterMap=h.filter=h.Compactable=h.separate=h.compact=h.Extend=h.extend=h.Alternative=h.guard=h.Zero=h.zero=h.Alt=h.alt=h.altW=h.orElse=h.Foldable=h.reduceRight=h.foldMap=h.reduce=h.Monad=h.Chain=h.flatMap=h.Applicative=h.Apply=h.ap=h.Pointed=h.of=h.asUnit=h.as=h.Functor=h.map=h.getMonoid=h.getOrd=h.getEq=h.getShow=h.URI=h.getRight=h.getLeft=h.some=h.none=void 0;h.getLastMonoid=h.getFirstMonoid=h.getApplyMonoid=h.getApplySemigroup=h.option=h.mapNullable=h.chainFirst=h.chain=h.sequenceArray=h.traverseArray=h.traverseArrayWithIndex=h.traverseReadonlyArrayWithIndex=h.traverseReadonlyNonEmptyArrayWithIndex=h.ApT=h.apS=h.bind=h.let=h.bindTo=h.Do=h.exists=h.toUndefined=h.toNullable=h.chainNullableK=h.fromNullableK=h.tryCatchK=h.tryCatch=h.fromNullable=h.chainFirstEitherK=h.chainEitherK=h.fromEitherK=h.duplicate=h.tapEither=h.tap=h.flatten=h.apSecond=h.apFirst=h.flap=h.getOrElse=h.getOrElseW=h.fold=h.match=h.foldW=h.matchW=h.isNone=h.isSome=h.FromEither=h.fromEither=h.MonadThrow=void 0;h.fromPredicate=B4;h.elem=yC;h.getRefinement=SP;var P4=Pl(),sd=ku(),gC=mC(Lu()),ih=Ml(),ce=Ae(),Uo=Eo(),Ar=mC(_r()),N4=sC(),_C=pC(),ah=ql(),xC=kl(),M4=vC();h.none=Ar.none;h.some=Ar.some;function B4(e){return function(t){return e(t)?(0,h.some)(t):h.none}}var q4=function(e){return e._tag==="Right"?h.none:(0,h.some)(e.left)};h.getLeft=q4;var k4=function(e){return e._tag==="Left"?h.none:(0,h.some)(e.right)};h.getRight=k4;var ze=function(e,t){return(0,ce.pipe)(e,(0,h.map)(t))},wr=function(e,t){return(0,ce.pipe)(e,(0,h.ap)(t))},ud=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduce)(t,n))},cd=function(e){var t=(0,h.foldMap)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},dd=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduceRight)(t,n))},oh=function(e){var t=(0,h.traverse)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},sh=function(e,t){return(0,ce.pipe)(e,(0,h.alt)(t))},Lo=function(e,t){return(0,ce.pipe)(e,(0,h.filter)(t))},uh=function(e,t){return(0,ce.pipe)(e,(0,h.filterMap)(t))},SC=function(e,t){return(0,ce.pipe)(e,(0,h.extend)(t))},ch=function(e,t){return(0,ce.pipe)(e,(0,h.partition)(t))},dh=function(e,t){return(0,ce.pipe)(e,(0,h.partitionMap)(t))};h.URI="Option";var J4=function(e){return{show:function(t){return(0,h.isNone)(t)?"none":"some(".concat(e.show(t.value),")")}}};h.getShow=J4;var L4=function(e){return{equals:function(t,n){return t===n||((0,h.isNone)(t)?(0,h.isNone)(n):(0,h.isNone)(n)?!1:e.equals(t.value,n.value))}}};h.getEq=L4;var U4=function(e){return{equals:(0,h.getEq)(e).equals,compare:function(t,n){return t===n?0:(0,h.isSome)(t)?(0,h.isSome)(n)?e.compare(t.value,n.value):1:(0,h.isSome)(n)?-1:0}}};h.getOrd=U4;var W4=function(e){return{concat:function(t,n){return(0,h.isNone)(t)?n:(0,h.isNone)(n)?t:(0,h.some)(e.concat(t.value,n.value))},empty:h.none}};h.getMonoid=W4;var H4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t.value))}};h.map=H4;h.Functor={URI:h.URI,map:ze};h.as=(0,ce.dual)(2,(0,Uo.as)(h.Functor));h.asUnit=(0,Uo.asUnit)(h.Functor);h.of=h.some;h.Pointed={URI:h.URI,of:h.of};var V4=function(e){return function(t){return(0,h.isNone)(t)||(0,h.isNone)(e)?h.none:(0,h.some)(t.value(e.value))}};h.ap=V4;h.Apply={URI:h.URI,map:ze,ap:wr};h.Applicative={URI:h.URI,map:ze,ap:wr,of:h.of};h.flatMap=(0,ce.dual)(2,function(e,t){return(0,h.isNone)(e)?h.none:t(e.value)});h.Chain={URI:h.URI,map:ze,ap:wr,chain:h.flatMap};h.Monad={URI:h.URI,map:ze,ap:wr,of:h.of,chain:h.flatMap};var K4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(e,n.value)}};h.reduce=K4;var z4=function(e){return function(t){return function(n){return(0,h.isNone)(n)?e.empty:t(n.value)}}};h.foldMap=z4;var G4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(n.value,e)}};h.reduceRight=G4;h.Foldable={URI:h.URI,reduce:ud,foldMap:cd,reduceRight:dd};h.orElse=(0,ce.dual)(2,function(e,t){return(0,h.isNone)(e)?t():e});h.altW=h.orElse;h.alt=h.orElse;h.Alt={URI:h.URI,map:ze,alt:sh};var Z4=function(){return h.none};h.zero=Z4;h.Zero={URI:h.URI,zero:h.zero};h.guard=(0,M4.guard)(h.Zero,h.Pointed);h.Alternative={URI:h.URI,map:ze,ap:wr,of:h.of,alt:sh,zero:h.zero};var Q4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t))}};h.extend=Q4;h.Extend={URI:h.URI,map:ze,extend:SC};h.compact=(0,h.flatMap)(ce.identity);var Y4=(0,ah.separated)(h.none,h.none),$4=function(e){return(0,h.isNone)(e)?Y4:(0,ah.separated)((0,h.getLeft)(e.value),(0,h.getRight)(e.value))};h.separate=$4;h.Compactable={URI:h.URI,compact:h.compact,separate:h.separate};var X4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)?t:h.none}};h.filter=X4;var j4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)}};h.filterMap=j4;var eP=function(e){return function(t){return(0,ah.separated)(Lo(t,(0,N4.not)(e)),Lo(t,e))}};h.partition=eP;var tP=function(e){return(0,ce.flow)((0,h.map)(e),h.separate)};h.partitionMap=tP;h.Filterable={URI:h.URI,map:ze,compact:h.compact,separate:h.separate,filter:Lo,filterMap:uh,partition:ch,partitionMap:dh};var nP=function(e){return function(t){return function(n){return(0,h.isNone)(n)?e.of(h.none):e.map(t(n.value),h.some)}}};h.traverse=nP;var rP=function(e){return function(t){return(0,h.isNone)(t)?e.of(h.none):e.map(t.value,h.some)}};h.sequence=rP;h.Traversable={URI:h.URI,map:ze,reduce:ud,foldMap:cd,reduceRight:dd,traverse:oh,sequence:h.sequence};var lh=(0,xC.witherDefault)(h.Traversable,h.Compactable),fh=(0,xC.wiltDefault)(h.Traversable,h.Compactable),iP=function(e){var t=lh(e);return function(n){return function(r){return t(r,n)}}};h.wither=iP;var aP=function(e){var t=fh(e);return function(n){return function(r){return t(r,n)}}};h.wilt=aP;h.Witherable={URI:h.URI,map:ze,reduce:ud,foldMap:cd,reduceRight:dd,traverse:oh,sequence:h.sequence,compact:h.compact,separate:h.separate,filter:Lo,filterMap:uh,partition:ch,partitionMap:dh,wither:lh,wilt:fh};var oP=function(){return h.none};h.throwError=oP;h.MonadThrow={URI:h.URI,map:ze,ap:wr,of:h.of,chain:h.flatMap,throwError:h.throwError};h.fromEither=h.getRight;h.FromEither={URI:h.URI,fromEither:h.fromEither};h.isSome=Ar.isSome;var sP=function(e){return e._tag==="None"};h.isNone=sP;var uP=function(e,t){return function(n){return(0,h.isNone)(n)?e():t(n.value)}};h.matchW=uP;h.foldW=h.matchW;h.match=h.matchW;h.fold=h.match;var cP=function(e){return function(t){return(0,h.isNone)(t)?e():t.value}};h.getOrElseW=cP;h.getOrElse=h.getOrElseW;h.flap=(0,Uo.flap)(h.Functor);h.apFirst=(0,sd.apFirst)(h.Apply);h.apSecond=(0,sd.apSecond)(h.Apply);h.flatten=h.compact;h.tap=(0,ce.dual)(2,gC.tap(h.Chain));h.tapEither=(0,ce.dual)(2,(0,ih.tapEither)(h.FromEither,h.Chain));h.duplicate=(0,h.extend)(ce.identity);h.fromEitherK=(0,ih.fromEitherK)(h.FromEither);h.chainEitherK=(0,ih.chainEitherK)(h.FromEither,h.Chain);h.chainFirstEitherK=h.tapEither;var dP=function(e){return e==null?h.none:(0,h.some)(e)};h.fromNullable=dP;var lP=function(e){try{return(0,h.some)(e())}catch{return h.none}};h.tryCatch=lP;var fP=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0,h.tryCatch)(function(){return e.apply(void 0,t)})}};h.tryCatchK=fP;var hP=function(e){return(0,ce.flow)(e,h.fromNullable)};h.fromNullableK=hP;var pP=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.fromNullable)(e(t.value))}};h.chainNullableK=pP;h.toNullable=(0,h.match)(ce.constNull,ce.identity);h.toUndefined=(0,h.match)(ce.constUndefined,ce.identity);function yC(e){return function(t,n){if(n===void 0){var r=yC(e);return function(i){return r(t,i)}}return(0,h.isNone)(n)?!1:e.equals(t,n.value)}}var vP=function(e){return function(t){return(0,h.isNone)(t)?!1:e(t.value)}};h.exists=vP;h.Do=(0,h.of)(Ar.emptyRecord);h.bindTo=(0,Uo.bindTo)(h.Functor);var mP=(0,Uo.let)(h.Functor);h.let=mP;h.bind=gC.bind(h.Chain);h.apS=(0,sd.apS)(h.Apply);h.ApT=(0,h.of)(Ar.emptyReadonlyArray);var gP=function(e){return function(t){var n=e(0,Ar.head(t));if((0,h.isNone)(n))return h.none;for(var r=[n.value],i=1;i<t.length;i++){var a=e(i,t[i]);if((0,h.isNone)(a))return h.none;r.push(a.value)}return(0,h.some)(r)}};h.traverseReadonlyNonEmptyArrayWithIndex=gP;var _P=function(e){var t=(0,h.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return Ar.isNonEmpty(n)?t(n):h.ApT}};h.traverseReadonlyArrayWithIndex=_P;h.traverseArrayWithIndex=h.traverseReadonlyArrayWithIndex;var xP=function(e){return(0,h.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};h.traverseArray=xP;h.sequenceArray=(0,h.traverseArray)(ce.identity);h.chain=h.flatMap;h.chainFirst=h.tap;function SP(e){return function(t){return(0,h.isSome)(e(t))}}h.mapNullable=h.chainNullableK;h.option={URI:h.URI,map:ze,of:h.of,ap:wr,chain:h.flatMap,reduce:ud,foldMap:cd,reduceRight:dd,traverse:oh,sequence:h.sequence,zero:h.zero,alt:sh,extend:SC,compact:h.compact,separate:h.separate,filter:Lo,filterMap:uh,partition:ch,partitionMap:dh,wither:lh,wilt:fh,throwError:h.throwError};h.getApplySemigroup=(0,sd.getApplySemigroup)(h.Apply);h.getApplyMonoid=(0,P4.getApplicativeMonoid)(h.Applicative);var yP=function(){return(0,h.getMonoid)((0,_C.first)())};h.getFirstMonoid=yP;var CP=function(){return(0,h.getMonoid)((0,_C.last)())};h.getLastMonoid=CP});var mh=p(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.EstablishedState=void 0;var hh=CC(),EP=Ae(),ph=ht(),Ri=ft(),bP=ct(),$t=dt(),IP=Jo(),TP=Oi(),EC=new Map([[$t.TerminationCause.None,{terminationCause:$t.TerminationCause.HungUp,headers:{extterm:ph.HeaderBooleanValue.Yes}}],[$t.TerminationCause.Inactive,{terminationCause:$t.TerminationCause.Inactive,headers:{inactive:ph.HeaderBooleanValue.Yes}}],[$t.TerminationCause.IceFailedToConnect,{terminationCause:$t.TerminationCause.IceFailedToConnect,headers:{iceFailed:ph.HeaderBooleanValue.Yes}}]]),vh=class extends IP.SessionStateBase{constructor(t){super(bP.SessionState.Established,t),this.toMessageContent=n=>EC.has(n)?(0,hh.some)(EC.get(n)):hh.none}setTerminationCauseAndLeave(t){this.terminationCause=t.terminationCause;let n=this.Session.newMessage().method(Ri.Method.Leave),r=t.headers?n.values(t.headers).build():n.build();this.sendOutboundMessage(r)}onWillTerminate(t){if(t!==TP.TransitionSource.RemotePeerMessage)if(this.terminationCause===$t.TerminationCause.Error){this.sendError(this.Session.error);return}else{this.sendMxpMessageForLocalTermination();return}}sendMxpMessageForLocalTermination(){(0,EP.pipe)(this.terminationCause,this.toMessageContent,(0,hh.match)(()=>{},t=>this.setTerminationCauseAndLeave(t)))}handleInboundMessage(t){switch(t.method){case Ri.Method.Leave:return this.terminateBasedOnMessage(t,$t.TerminationCause.HungUp),!0;case Ri.Method.Ack:return!0;case Ri.Method.Join:return this.sendJoined(t),!0;case Ri.Method.PeerEvent:return this.Session.emitJsepEvent(t),!0;case Ri.Method.Error:return this.terminateBasedOnMessage(t,$t.TerminationCause.Error),!0}return!1}};ld.EstablishedState=vh});var _h=p(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});fd.TerminatedState=void 0;var AP=ct(),wP=Jo(),gh=class extends wP.SessionStateBase{constructor(t){super(AP.SessionState.Terminated,t)}handleInboundMessage(t){return!0}};fd.TerminatedState=gh});var xh=p((u9,bC)=>{bC.exports=__pubnub});var IC=p(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.InvalidStateTransition=void 0;var OP=Ce(),Sh=class extends OP.ErrorBase{constructor(t,n){super(`Invalid transition ${t} -> ${n}`)}};hd.InvalidStateTransition=Sh});var TC=p(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.MessageBuilder=void 0;var DP=mt(),RP=ue(),FP=ws(),Wo=class{method(t){return this.mxpMethod=t,this}body(t){return this.mxpBody=t,this}from(t){return this.mxpFrom=t,this}values(t){return this.mxpValues=t,this}sessionId(t){return this.mxpSessionId=t,this}build(){if(!this.mxpMethod||!this.mxpSessionId||!this.mxpFrom)throw new DP.ArgumentError("Missing arguments",(0,RP.nameof)(this));return new FP.Message(this.mxpMethod,this.mxpSessionId,this.mxpFrom,this.mxpBody,this.mxpValues)}};pd.MessageBuilder=Wo;Wo.create=()=>new Wo});var Ch=p(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.Session=void 0;var PP=xh(),AC=ft(),vd=mt(),md=Ce(),NP=IC(),Fi=yo(),MP=dt(),BP=ct(),gd=un(),qP=TC(),kP=ue(),JP=Oi(),wC=ko(),yh=class e{constructor(t,n,r,i){if(this.mxpClient=t,this.sessionId=n,this.callDirection=r,this.scheduler=i,this.schedulerCancellations=new Map,this.fsmState=new vd.NullState,this.transitions=new vd.FsmTransitions,this.transitionDepth=0,this.pendingJsepMessages=new Array,this.mxpOutboundMessages=new Array,this.pendingInboundMessages=new Array,this.stateChangeEvents=new Array,this.pendingStateChangeEvents=new Array,this.jsepMessageReceivedEvent=new gd.Event,this.symmetricSessionKey=null,this.onSessionKey=new gd.Event,this.stateChanged=new gd.Event,this.outboundMessageEvent=new gd.Event,this.addJsepMessage=a=>{a.forEach(s=>this.pendingJsepMessages.push(s))},n.length<=0)throw new md.ArgumentError("Invalid session id",(0,kP.nameof)(n))}get localPeer(){return this.mxpClient}get id(){return this.sessionId}get direction(){return this.callDirection}get state(){return this.fsmState.sessionState}get terminationCause(){return this.fsmState.terminationCause}get error(){return this.sessionError}set error(t){this.sessionError=t}set onJsepMessageReceived(t){this.jsepMessageReceivedEvent.add(t)}get outboundMessages(){return this.mxpOutboundMessages}hasSessionKey(){return this.symmetricSessionKey!=null}get sessionKey(){return this.symmetricSessionKey}set sessionKey(t){this.symmetricSessionKey=t,t&&this.onSessionKey.fire()}start(){this.setStartedAt(),this.tryWithCurrentState(t=>t.transition(BP.SessionState.Initiating,JP.TransitionSource.LocalAction))}set onStateChanged(t){this.stateChanged.add(t)}set onOutboundMessage(t){this.outboundMessageEvent.add(t)}newMessage(){return qP.MessageBuilder.create().sessionId(this.sessionId).from(this.localPeer)}setInitialState(t){this.fsmState=t}setStartedAt(){if(this.startedAt)throw new md.InvalidOperationError("Started timestamp already set");this.startedAt=new Date}timeoutRelativeToStart(t){if(!this.startedAt)throw new md.InvalidOperationError("StartedAt not set");let n=Date.now();return this.startedAt.getTime()+t<n?0:t-(n-this.startedAt.getTime())}terminate(t){t&&(this.sessionError=t),this.tryWithCurrentState(n=>{n.terminate(t)})}terminateWithCause(t){this.tryWithCurrentState(n=>{n.terminateWithCause(t)})}onInboundMessage(t){if(t.sessionId!==this.sessionId)throw new md.InvalidOperationError("Message not intended for this Session (SessionId mismatch)");this.tryWithCurrentState(n=>{n.onInboundMessage(t)})}applyPendingInboundMessages(){this.pendingInboundMessages.splice(0).forEach(t=>{this.onInboundMessage(t)})}onTimeout(t){this.tryWithCurrentState(n=>{n.onTimeout(t)})}onACKWindowTimeout(t,n){}tryWithCurrentState(t){let n=this.fsmState;try{t(n)}catch(r){n.onException(r)}}sendClientEvent(t,n){let r=this.newMessage().method(AC.Method.PeerEvent).body(AC.Body.clientEvent(t));n&&r.values({to:n}),this.sendOutboundMessage(r.build())}sendOutboundMessage(t){var n;this.mxpOutboundMessages.push(t),(n=this.outboundMessageEvent)===null||n===void 0||n.fire(t)}hasSentMessage(t){return this.mxpOutboundMessages.find(t)!=null}transition(t,n,r){let i=this.fsmState;if(!this.transitions.tryGetNext(t,n,a=>{try{this.transitionDepth++,i.exit(a,r),this.fsmState=a,a.enter(i,r),this.pushStateChangeEvent(a),this.applyPendingInboundMessages(),this.fsmState!=a}finally{this.transitionDepth--}this.transitionDepth==0&&this.emitStateChangeEvents()}))throw new NP.InvalidStateTransition(t.sessionState,n)}emitStateChangeEvents(){this.stateChangeEvents.splice(0).forEach(t=>{this.tryEmitStateChangeEvent(t)})}tryEmitStateChangeEvent(t){this.emitStateChangeEvent(t)||this.pendingStateChangeEvents.push(t)}emitStateChangeEvent(t){this.applyPendingSessionStateChanges();let n=this.stateChanged;return n==null?!1:(n.fire(t),!0)}applyPendingSessionStateChanges(){let t=Object.assign([],this.pendingStateChangeEvents);this.pendingStateChangeEvents.length=0,t.forEach(n=>{this.tryEmitStateChangeEvent(n)})}pushStateChangeEvent(t){this.stateChangeEvents.push(this.createStateChangeEvent(t))}createStateChangeEvent(t){return e.createStateChangeEvent(this.sessionId,t)}static createStateChangeEvent(t,n){return n.terminationCause==MP.TerminationCause.None?{id:t,state:n.sessionState}:{id:t,state:n.sessionState,terminationCause:n.terminationCause}}emitPendingJsepEvents(){this.emitJsepEvents(this.pendingJsepMessages.splice(0))}emitJsepEvents(t){let n=this.jsepMessageReceivedEvent.fire;n!=null&&t.length>0&&n({id:this.sessionId,messages:t})}emitJsepEvent(t){Fi.JsepMessage.tryParse(t,n=>{this.emitJsepEvents(n)})}addPendingInboundMessage(t){this.pendingInboundMessages.push(t)}setLocalCandidate(t){this.tryWithCurrentState(n=>n.onCandidate(Fi.Source.Local,t))}setLocalSessionDescription(t){this.localDescription=new Fi.SessionDescription(t.isAnswer?Fi.DescriptionType.Answer:Fi.DescriptionType.Offer,t.data),this.tryWithCurrentState(n=>{this.localDescription&&n.onSessionDescription(Fi.Source.Local,this.localDescription)})}scheduleTimeout(t,n,r){let i=new vd.TimerEvent((0,PP.generateUUID)().toLowerCase(),`${t.constructor.name} (timeout: ${n}ms)`,r);this.scheduler.scheduleDelayed(()=>this.onScheduledTimeout(t,i),n,this.getCancellationToken(t))}getCancellationToken(t){let n=this.schedulerCancellations.get(t);return n||(n=new vd.CancellationTokenSource,this.schedulerCancellations.set(t,n)),n}cancelScheduledTimeouts(t){var n;(n=this.schedulerCancellations.get(t))===null||n===void 0||n.cancel()}onScheduledTimeout(t,n){switch(n.type){case wC.TimerEventType.Termination:t==this.fsmState&&t.onStateTimeout(n);break;case wC.TimerEventType.ACKWindowEnd:this.onACKWindowTimeout(t,n);break}}};_d.Session=yh});var RC=p(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.OutboundSession=void 0;var ve=ft(),LP=Jo(),Eh=ht(),DC=ue(),UP=mh(),WP=_h(),Tt=dt(),_e=ct(),HP=Ch(),OC=mt(),VP=Lt(),Ho=Oi(),xd=ko(),Vo=class extends LP.SessionStateBase{constructor(t,n){super(t,n)}sendCancelDueToTimeout(){this.sendOutboundMessage(this.Session.newMessage().method(ve.Method.Cancel).values({[Eh.Message.KEY_TIMEOUT]:Eh.HeaderBooleanValue.Yes}).build())}respondToInboundDeny(t){t.method==ve.Method.Deny&&this.sendOutboundMessage(this.Session.newMessage().method(ve.Method.Cancel).values({deny:Eh.HeaderBooleanValue.Yes}).build())}handleACKWindowRelevantMessage(t){if(t.method!=ve.Method.Deny&&t.method!=ve.Method.Error){console.error("Only DENY and ERROR messages are ACK window relevant");return}if(this.Session.removeProgressingInstance(t.from.instanceId),this.Session.shouldHandleACKRelevantMessageNow)return this.handleACKWindowRelevantMessageNow(t);if(t.method==ve.Method.Deny&&!t.isDoNotDenyAllMessage())return this.handleACKWindowRelevantMessageNow(t);this.Session.isAckWindowClosed||this.Session.addACKWindowDelayedMessage(t)}handleACKWindowRelevantMessageNow(t){switch(t.method){case ve.Method.Deny:return this.respondToInboundDeny(t),this.terminateBasedOnMessage(t,Tt.TerminationCause.Denied),!0;case ve.Method.Error:return this.terminateBasedOnMessage(t,Tt.TerminationCause.Error),!0}}},bh=class extends Vo{constructor(t){super(_e.SessionState.Created,t)}},Ih=class extends Vo{constructor(t){super(_e.SessionState.Initiating,t),this.inviteEmitted=!1,this.onLocalSessionDescription=n=>{this.Session.sessionKey&&n&&!this.inviteEmitted&&this.emitInvite(n,this.Session.sessionKey)},this.onSessionKey=()=>{this.Session.sessionKey&&this.Session.localDescription&&!this.inviteEmitted&&this.emitInvite(this.Session.localDescription,this.Session.sessionKey)}}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallACKWindowTimeoutMs),xd.TimerEventType.ACKWindowEnd),this.Session.scheduleTimeout(this,this.CallProgressTimeoutMs,xd.TimerEventType.Termination),this.Session.onSessionKey.add(this.onSessionKey)}onExit(t){this.Session.onSessionKey.remove(this.onSessionKey)}emitInvite(t,n){this.sendOutboundMessage(this.buildInvite(t,n)),this.inviteEmitted=!0}buildInvite(t,n){return this.Session.newMessage().method(ve.Method.Invite).body(ve.Body.sdp(t.asJson())).values({key:DC.Base64Helper.encode(n.key)}).build()}handleInboundMessage(t){switch(t.method){case ve.Method.Ack:return this.Session.addProgressingInstance(t.from.instanceId),this.transition(_e.SessionState.Progress,Ho.TransitionSource.RemotePeerMessage),this.Session.emitJsepEvent(t),!0;case ve.Method.Join:return this.Session.addProgressingInstance(t.from.instanceId),this.Session.addPendingInboundMessage(t),this.transition(_e.SessionState.Progress,Ho.TransitionSource.RemotePeerMessage),!0;case ve.Method.PeerEvent:return this.Session.addProgressingInstance(t.from.instanceId),this.Session.emitJsepEvent(t),!0;case ve.Method.Deny:case ve.Method.Error:return this.handleACKWindowRelevantMessage(t),!0}return!1}onWillTerminate(t){if(t!==Ho.TransitionSource.RemotePeerMessage)switch(this.terminationCause){case Tt.TerminationCause.Error:this.sendError(this.Session.error);return;case Tt.TerminationCause.Timeout:this.sendCancelDueToTimeout();return;case Tt.TerminationCause.None:this.terminationCause=Tt.TerminationCause.Canceled,this.sendOutboundMessage(this.Session.newMessage().method(ve.Method.Cancel).build());return}}},Th=class extends Vo{constructor(t){super(_e.SessionState.Progress,t)}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallSetupTimeoutMs),xd.TimerEventType.Termination),this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallACKWindowTimeoutMs),xd.TimerEventType.ACKWindowEnd)}handleInboundMessage(t){switch(t.method){case ve.Method.Join:this.sendJoined(t),this.Session.emitJsepEvent(t),this.transition(_e.SessionState.Established,Ho.TransitionSource.RemotePeerMessage);break;case ve.Method.PeerEvent:case ve.Method.Ack:this.Session.addProgressingInstance(t.from.instanceId),this.Session.emitJsepEvent(t);break;case ve.Method.Deny:case ve.Method.Error:this.handleACKWindowRelevantMessage(t);break;default:return!1}return!0}onExit(t){super.onExit(t),this.Session.closeACKWindowDroppingAllPendingMessages()}onWillTerminate(t){if(t!==Ho.TransitionSource.RemotePeerMessage)switch(this.terminationCause){case Tt.TerminationCause.Error:this.sendError(this.Session.error);return;case Tt.TerminationCause.Timeout:this.sendCancelDueToTimeout();return;case Tt.TerminationCause.None:this.terminationCause=Tt.TerminationCause.Canceled,this.sendOutboundMessage(this.Session.newMessage().method(ve.Method.Cancel).build());return}}},Ah=class extends HP.Session{get isAckWindowClosed(){return this._isAckWindowClosed}get instancesToACK(){return this._instancesToACK}set instancesToACK(t){this._instancesToACK=t}get shouldExpectMoreProgressingPeers(){return this.instancesToACK.size>0&&!this.isAckWindowClosed}get shouldHandleACKRelevantMessageNow(){return!this.shouldExpectMoreProgressingPeers&&!this.hasProgressingInstances}get hasProgressingInstances(){return this.progressingInstances.size>0}constructor(t,n,r){super(t,n,VP.Direction.Outbound,r),this.ackWindowDelayedMessages=new Array,this.progressingInstances=new Set,this._instancesToACK=new Set,this._isAckWindowClosed=!1;let i=new bh(this),a=new Ih(this),s=new Th(this),u=new UP.EstablishedState(this),d=new WP.TerminatedState(this);this.setInitialState(i);let c=this.transitions;c.add(_e.SessionState.Created,_e.SessionState.Terminated,d),c.add(_e.SessionState.Created,_e.SessionState.Initiating,a),c.add(_e.SessionState.Initiating,_e.SessionState.Progress,s),c.add(_e.SessionState.Initiating,_e.SessionState.Terminated,d),c.add(_e.SessionState.Progress,_e.SessionState.Terminated,d),c.add(_e.SessionState.Progress,_e.SessionState.Established,u),c.add(_e.SessionState.Established,_e.SessionState.Terminated,d)}configure(t){if(t.key.sigBytes<=0)throw new OC.ArgumentError("Invalid key (empty)",(0,DC.nameof)(t));if(this.sessionKey!=null)throw new OC.InvalidOperationError("Session encryption key already set");this.sessionKey=t}onACKWindowTimeout(t,n){this._isAckWindowClosed=!0,t==this.fsmState&&this.applyAckWindowDelayedMessages()}addProgressingInstance(t){this.progressingInstances.add(t)}removeProgressingInstance(t){this.progressingInstances.delete(t),this.instancesToACK.delete(t)}addACKWindowDelayedMessage(t){this.ackWindowDelayedMessages.push(t)}closeACKWindowDroppingAllPendingMessages(){this.ackWindowDelayedMessages.splice(0),this._isAckWindowClosed=!0}applyAckWindowDelayedMessages(){this.ackWindowDelayedMessages.splice(0).forEach(t=>{this.onInboundMessage(t)})}};Sd.OutboundSession=Ah});var yd=p((h9,PC)=>{var FC=PC.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v",t}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":"",t}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(FC).forEach(function(e){var t=FC[e];t.forEach(function(n){n.reg||(n.reg=/(.*)/),n.format||(n.format="%s")})})});var BC=p(Xt=>{var Pi=function(e){return String(Number(e))===e?Number(e):e},KP=function(e,t,n,r){if(r&&!n)t[r]=Pi(e[1]);else for(var i=0;i<n.length;i+=1)e[i+1]!=null&&(t[n[i]]=Pi(e[i+1]))},zP=function(e,t,n){var r=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:r&&!t[e.name]&&(t[e.name]={});var i=e.push?{}:r?t[e.name]:t;KP(n.match(e.reg),i,e.names,e.name),e.push&&t[e.push].push(i)},NC=yd(),GP=RegExp.prototype.test.bind(/^([a-z])=(.*)/);Xt.parse=function(e){var t={},n=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(GP).forEach(function(i){var a=i[0],s=i.slice(2);a==="m"&&(n.push({rtp:[],fmtp:[]}),r=n[n.length-1]);for(var u=0;u<(NC[a]||[]).length;u+=1){var d=NC[a][u];if(d.reg.test(s))return zP(d,r,s)}}),t.media=n,t};var MC=function(e,t){var n=t.split(/=(.+)/,2);return n.length===2?e[n[0]]=Pi(n[1]):n.length===1&&t.length>1&&(e[n[0]]=void 0),e};Xt.parseParams=function(e){return e.split(/;\s?/).reduce(MC,{})};Xt.parseFmtpConfig=Xt.parseParams;Xt.parsePayloads=function(e){return e.toString().split(" ").map(Number)};Xt.parseRemoteCandidates=function(e){for(var t=[],n=e.split(" ").map(Pi),r=0;r<n.length;r+=3)t.push({component:n[r],ip:n[r+1],port:n[r+2]});return t};Xt.parseImageAttributes=function(e){return e.split(" ").map(function(t){return t.substring(1,t.length-1).split(",").reduce(MC,{})})};Xt.parseSimulcastStreamList=function(e){return e.split(";").map(function(t){return t.split(",").map(function(n){var r,i=!1;return n[0]!=="~"?r=Pi(n):(r=Pi(n.substring(1,n.length)),i=!0),{scid:r,paused:i}})})}});var kC=p((v9,qC)=>{var wh=yd(),ZP=/%[sdv%]/g,QP=function(e){var t=1,n=arguments,r=n.length;return e.replace(ZP,function(i){if(t>=r)return i;var a=n[t];switch(t+=1,i){case"%%":return"%";case"%s":return String(a);case"%d":return Number(a);case"%v":return""}})},Ko=function(e,t,n){var r=t.format instanceof Function?t.format(t.push?n:n[t.name]):t.format,i=[e+"="+r];if(t.names)for(var a=0;a<t.names.length;a+=1){var s=t.names[a];t.name?i.push(n[t.name][s]):i.push(n[t.names[a]])}else i.push(n[t.name]);return QP.apply(null,i)},YP=["v","o","s","i","u","e","p","c","b","t","r","z","a"],$P=["i","c","b","a"];qC.exports=function(e,t){t=t||{},e.version==null&&(e.version=0),e.name==null&&(e.name=" "),e.media.forEach(function(a){a.payloads==null&&(a.payloads="")});var n=t.outerOrder||YP,r=t.innerOrder||$P,i=[];return n.forEach(function(a){wh[a].forEach(function(s){s.name in e&&e[s.name]!=null?i.push(Ko(a,s,e)):s.push in e&&e[s.push]!=null&&e[s.push].forEach(function(u){i.push(Ko(a,s,u))})})}),e.media.forEach(function(a){i.push(Ko("m",wh.m[0],a)),r.forEach(function(s){wh[s].forEach(function(u){u.name in a&&a[u.name]!=null?i.push(Ko(s,u,a)):u.push in a&&a[u.push]!=null&&a[u.push].forEach(function(d){i.push(Ko(s,u,d))})})})}),i.join(`\r
3
+ `)+`\r
4
+ `}});var JC=p(At=>{var Or=BC(),XP=kC(),jP=yd();At.grammar=jP;At.write=XP;At.parse=Or.parse;At.parseParams=Or.parseParams;At.parseFmtpConfig=Or.parseFmtpConfig;At.parsePayloads=Or.parsePayloads;At.parseRemoteCandidates=Or.parseRemoteCandidates;At.parseImageAttributes=Or.parseImageAttributes;At.parseSimulcastStreamList=Or.parseSimulcastStreamList});var Dh=p(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.Sdp=void 0;var eN=JC(),Oh=class e{static parse(t){return new e(eN.parse(t))}constructor(t){this.description=t}getMedia(t){return this.description.media.find(n=>n.type==t)}get video(){return this.getMedia("video")}get audio(){return this.getMedia("audio")}hasAudio(){return this.audio!=null}hasVideo(){return this.video!=null}};Cd.Sdp=Oh});var Rh=p(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.PushType=void 0;var LC;(function(e){e[e.Call=1]="Call"})(LC||(Ed.PushType=LC={}))});var Id=p(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.OcraPushService=An.PUSH_VERSION=An.REQUEST_VIDEO_FLAG=void 0;var tN=Ce(),nN=ue(),UC=sc(),rN=Td();An.REQUEST_VIDEO_FLAG=1;An.PUSH_VERSION=4;var bd=class{static getVersion(t,n){let r=n.toLowerCase().split(".")[0],i=t.filter(a=>a.startsWith(r)).map(a=>{let s=a.split(".");return s.length===2?Number(s[1]):0});return i.length===0?-1:Math.max(...i)}},zo=class e{constructor(t,n){this.userId=t,this.apiClient=n}unregisterPushToken(t){return this.apiClient.deletePushProfile({instanceId:t.id,userId:this.userId})}registerPushToken(t,n,r){let i=t.toJSON();if(i.endpoint&&i.keys)return this.apiClient.updatePushProfile({instanceId:r.id,userId:this.userId,pushProfile:{maxPayloadSize:e.MaxPayloadSize,w3c:{endpoint:i.endpoint,keys:{p256dh:i.keys.p256dh,auth:i.keys.auth},applicationServerKey:n,expirationTime:new Date(Date.now()+768*3600*1e3)}}});throw new tN.ArgumentError("Invalid subscription",(0,nN.nameof)(t))}getTemplateParameters(t){let n={sinch:(0,rN.generatePushPayload)(t)};return this.pushNotificationDisplayName&&(n.displayName=this.pushNotificationDisplayName),n}mapPushInstances(t,n){return n.filter(r=>r.capabilities&&bd.getVersion(r.capabilities,UC.Capability.Push)>=e.MinSupportedPushVersion).map(r=>this.mapPushInstance(t,r))}mapPushInstance(t,n){return{instanceId:n.id,userId:t}}sendPush(t,n){return this.apiClient.sendPushNotifications({pushNotification:[{collapseId:t.id,templateId:t.requestedVideo?"incoming_video_call":"incoming_call",templateParameters:this.getTemplateParameters(t),to:this.mapPushInstances(t.remoteUserId,n)}]})}getManagedPushRecipients(t){if(!t)return new Set;let n=t.filter(r=>r.capabilities&&bd.getVersion(r.capabilities,UC.Capability.Push)>=e.MinSupportedPushVersion&&r.pushProfile!=null).map(r=>{var i;return(i=r.id)!==null&&i!==void 0?i:""});return new Set(n)}};An.OcraPushService=zo;zo.MaxPayloadSize=3393;zo.MinSupportedPushVersion=4});var Td=p(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.PushPayload=void 0;Ni.getFlags=HC;Ni.generatePushPayload=oN;var iN=Rh(),WC=Id(),aN=qe();function HC(e){let t=0;return e.requestedVideo&&(t|=WC.REQUEST_VIDEO_FLAG),t}function oN(e){let t;if(!new Ad(WC.PUSH_VERSION,iN.PushType.Call,e.id,e.createdAt,e.localPeer.userId,HC(e),aN.Domain.Mxp,e.headers).tryEncode(r=>{t=r})||!t)throw new Error("Unable to create push payload");return t}var Ad=class e{constructor(t,n,r,i,a,s,u,d){this.version=t,this.type=n,this.sessionId=r,this.timestamp=i,this.userId=a,this.flags=s,this.domain=u,this.publicHeaders=d,this.supportedVersions=new Map([[4,this.getPayloadV4]])}static isValid(t){return t.version&&t.type&&t.session_id&&t.timestamp&&t.user_id}static tryDecode(t,n){try{let r=JSON.parse(t);return e.isValid(r)?(n(new e(r.version,r.type,r.session_id,new Date(r.timestamp*1e3),r.user_id,r.flags,r.domain,r.headers)),!0):!1}catch{return!1}}tryEncode(t){let n=this.getPayload();return n?(t(JSON.stringify(n)),!0):(console.log(`Unsupported push version ${this.version}`),!1)}getPayload(){var t;return(t=this.supportedVersions.get(this.version))===null||t===void 0?void 0:t.call(this)}getPayloadV4(){return{version:this.version,type:this.type,session_id:this.sessionId,timestamp:Math.round(this.timestamp.getTime()/1e3),user_id:this.userId,flags:this.flags,domain:this.domain,public_headers:this.publicHeaders}}};Ni.PushPayload=Ad});var qi=p(Bi=>{"use strict";var VC=Bi&&Bi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.OutboundCall=void 0;var sN=ht(),KC=qe(),uN=Qc(),cN=Dh(),dN=yi(),lN=Td(),Mi=_n(),wd=dn(),fN=qo(),Fh=class extends uN.DefaultCall{constructor(t,n,r,i,a,s,u,d,c,o,f,m,_){super(n,r,i,s,d,o,f,m,_),this.destination=t,this.pushSender=a,this.callInitiator=u,this.features=c,this.callInitiated=!1,this.generatePushPayload=()=>(0,lN.generatePushPayload)(this),this.onLocalDescription=x=>{this.callInitiated?this.withSession(E=>E.setLocalSessionDescription(x)):this.initiateCall(x.data)}}initiateCall(t){return VC(this,void 0,void 0,function*(){var n;try{let r=this.features.getFeatureFlag(dN.FeatureFlag.UseTurn);this.callInitiated=!0,this.clientEventsCollector.addEvent(Mi.ClientEvent.createClientEventType(Mi.ClientEventName.OCRA_CALL_INIT_REQUEST));let i=yield this.callInitiator.initiateCall({callInitiationRequest:{callId:this.id,destination:this.destination,requestedAudio:!0,requestedVideo:this.requestedVideo,rtcOffer:{type:"offer",sdp:t},publicCallHeaders:this.headers,legacyMediaProxyEngage:!r,mxpInstanceId:this.localPeer.instanceId,cli:this.localPeer.cli,mxpClientEventsVersion:Number(fN.MxpClientEventsVersion)}});this.clientEventsCollector.addEvent(Mi.ClientEvent.createClientEventType(Mi.ClientEventName.OCRA_CALL_INIT_REQUEST_COMPLETE)),i.publicCallHeaders!=null&&this.setHeaders(i.publicCallHeaders),i.apiBaseUrl!=null&&(this.callApiBaseUrl=i.apiBaseUrl),this.setMxpSignalingConfiguration(new sN.SymmetricKey(i.mxpEncryptionKey),i.mxpSignalChannel),i.legacyRelayIceCandidates&&this.setLegacyRelayCandidates(i.legacyRelayIceCandidates.map(a=>this.mapLegacyRelayCandidates(t,a)).filter(a=>a!=null)),!((n=i.instances)===null||n===void 0)&&n.length&&(this.sendPushNotifications(i.instances),this.setPushNotificationRequestSent()),this.withSession(a=>{a.instancesToACK=this.pushSender.getManagedPushRecipients(i.instances)})}catch(r){r instanceof wd.SinchError?(this.clientEventsCollector.addEvent(Mi.ClientEvent.createClientEventType(Mi.ClientEventName.OCRA_CALL_INIT_REQUEST_COMPLETE,{type:KC.EventResultTypeEnum.Failure,errorCode:r.code,errorDomain:KC.ClientErrorDomain.Http})),this.hangup(r)):this.hangup(new wd.SinchError(r.message,wd.ErrorCode.Generic,wd.ErrorType.Http))}})}sendPushNotifications(t){return VC(this,void 0,void 0,function*(){try{yield this.pushSender.sendPush(this,t)}catch(n){console.error("Failed to send push notification:",n)}})}mapLegacyRelayCandidates(t,n){let r=cN.Sdp.parse(t);if(r.description.media.length>0)return JSON.stringify({cand:n,sdpMLI:0,sdpMid:r.description.media[0].mid});console.error(`Invalid legacy relay candidate: ${n}`)}get remoteUserId(){return this.destination.identity}get remoteDomain(){return this.destination.domain}};Bi.OutboundCall=Fh});var Nh=p(wn=>{"use strict";var hN=wn&&wn.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(wn,"__esModule",{value:!0});wn.PubSubClientFactory=wn.PubSubClient=void 0;var Od=xh(),zC=un(),Dd=class{constructor(t,n,r){this.broadcastChannel=t,this.signalChannel=n,this.config=r,this.subscribers=new Array,this.onBroadcastMessage=new zC.Event,this.onSignalMessage=new zC.Event,this.broadcastFilters=new Array,this.broadcast=new Od({subscribeKey:r.broadcastSubscribeKey,ssl:!0,origin:r.hostname,uuid:Od.generateUUID()}),this.signal=new Od({subscribeKey:r.signalSubscribeKey,publishKey:r.signalPublishKey,ssl:!0,origin:r.hostname,uuid:Od.generateUUID()}),this.signal.addListener({message:i=>{let{message:a}=i;this.onSignalMessage.fire({message:a})}}),this.broadcast.addListener({message:i=>{let{message:a}=i;this.broadcastFilters.forEach(s=>{s(a)&&this.onBroadcastMessage.fire({message:a})})}})}subscribe(){this.subscribeOn(this.signal,this.signalChannel,0)}subscribeOn(t,n,r=0){this.subscribers.includes(n)||(this.subscribers.push(n),r>0?t.time((i,a)=>{let s=a.timetoken-r*1e4;t.subscribe({channels:[n],timetoken:s})}):t.subscribe({channels:[n]}))}publish(t,n){return hN(this,void 0,void 0,function*(){return yield this.signal.publish({channel:t,message:n})})}broadcastSubscribe(t){this.broadcastFilters.push(t),this.subscribeOn(this.broadcast,this.broadcastChannel,6e4)}cancel(){this.subscribers.splice(0),this.signal.unsubscribeAll(),this.broadcast.unsubscribeAll(),this.broadcastFilters.splice(0)}};wn.PubSubClient=Dd;var Ph=class{static create(t,n,r){return new Dd(t,n,r)}};wn.PubSubClientFactory=Ph});var Bh=p(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.MxpMessageChannel=void 0;var GC=un(),Rd=Ce(),ZC=ue(),Mh=class{constructor(t,n,r){this.sessionId=t,this.instanceId=n,this.protocol=r,this.onInboundMessage=new GC.Event,this.onOutboundMessage=new GC.Event,this.pendingInbound=new Array,this.pendingOutbound=new Array,this.sendOutboundMessage=i=>{if(!this.sessionKey){this.pendingOutbound.push(i);return}if(!this.channelId)throw new Rd.InvalidOperationError("No channelId configured");if(!this.onOutboundMessage)throw new Rd.InvalidOperationError("No outbound message event handler configured");this.logOutboundMessage(i),this.protocol.encode(i,this.sessionKey).forEach(a=>{this.channelId&&this.onOutboundMessage.fire({channelId:this.channelId,data:a,message:i})})}}configure(t,n){if(!n)throw new Rd.ArgumentError("Invalid channelId",(0,ZC.nameof)(n));this.sessionKey=t,this.channelId=n,this.processPendingOutbound()}isMessageForThisSession(t){return t==this.sessionId}handleInboundTransportMessage(t,n){let{message:r}=t;if(!r)throw new Rd.ArgumentError("Invalid input (empty)",(0,ZC.nameof)(r));if(!this.sessionKey){this.pendingInbound.push(t);return}this.processInboundTransportMessage(t,n)}processInboundTransportMessage(t,n){if(!this.sessionKey){console.log("Session key is not available, cannot process message");return}let{message:r}=t,i=this.protocol.decode(r,this.sessionKey);if(i){if(!this.isMessageForThisSession(i.transport.sessionId)){let a=`Received MXP message for another session: ${i.transport.sessionId}, silently ignore`;console.log(a),n?.addErrorEventLog({sessionId:i.transport.sessionId,localTimeStamp:Date.now().toString(),additionalInfo:JSON.stringify({error:a})});return}i.message.isAddressedToInstance(this.instanceId)?(n?.addReceivedEventLogForMessage(i.message),this.handleInboundMessage(i.message)):console.log("Message not for this instance:",i.message)}}handleInboundMessage(t){this.logInboundMessage(t),this.onInboundMessage.fire(t)}processPendingInbound(){this.pendingInbound.splice(0).forEach(t=>{this.processInboundTransportMessage(t)})}processPendingOutbound(){this.pendingOutbound.splice(0).forEach(t=>{this.sendOutboundMessage(t)})}logInboundMessage(t){console.log("Inbound MXP message",t)}logOutboundMessage(t){console.log("Outbound MXP message",t)}};Fd.MxpMessageChannel=Mh});var XC=p(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.InboundSession=void 0;var YC=ht(),Je=ft(),QC=qo(),pN=ue(),vN=Lt(),mN=mh(),$C=mt(),gN=ko(),Pd=Oi(),_N=yo(),xN=Ch(),xe=ct(),SN=Jo(),yN=_h(),Dr=dt(),Go=class extends SN.SessionStateBase{constructor(t,n){super(t,n)}},qh=class extends Go{constructor(t){super(xe.SessionState.Created,t)}},kh=class extends Go{constructor(t){super(xe.SessionState.Initiating,t)}handleInboundMessage(t){return t.isMethod(Je.Method.Invite)&&this.Session.processInvite(t)?(this.transition(xe.SessionState.Progress,Pd.TransitionSource.RemotePeerMessage),!0):!1}},Jh=class extends Go{constructor(t){super(xe.SessionState.Progress,t)}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallSetupTimeoutInboundMs),gN.TimerEventType.Termination),this.Session.emitPendingJsepEvents()}onWillTerminate(t){if(t!==Pd.TransitionSource.RemotePeerMessage)switch(this.terminationCause){case Dr.TerminationCause.Error:this.sendError(this.Session.error);return;case Dr.TerminationCause.Timeout:this.hasSentOutboundMessage(Je.Method.Join)&&this.sendOutboundMessage(this.Session.newMessage().method(Je.Method.Leave).build());return;case Dr.TerminationCause.None:this.terminationCause=Dr.TerminationCause.Denied,this.sendOutboundMessage(this.Session.newMessage().method(Je.Method.Deny).build())}}handleInboundMessage(t){switch(t.method){case Je.Method.Cancel:case Je.Method.Leave:return this.terminateBasedOnMessage(t,Dr.TerminationCause.Canceled),!0;case Je.Method.Error:return this.terminateBasedOnMessage(t,Dr.TerminationCause.Error),!0;case Je.Method.Joined:return t.body&&this.Session.isLocalPeer(YC.Codec.decodeClient(t.body))?this.transition(xe.SessionState.Established,Pd.TransitionSource.RemotePeerMessage):(this.terminationCause=Dr.TerminationCause.OtherPeerAccepted,this.transition(xe.SessionState.Terminated,Pd.TransitionSource.RemotePeerMessage)),!0;case Je.Method.PeerEvent:return this.Session.emitJsepEvent(t),!0;default:return!1}}onLocalSessionDescription(t){this.sendOutboundMessage(this.Session.newMessage().method(Je.Method.Ack).body(Je.Body.sdp(t.asJson())).values({[QC.MxpClientEventsVersionKey]:QC.MxpClientEventsVersion}).build())}onAccept(){let t=this.Session.localDescription;if(t==null)throw new $C.InvalidOperationError("Local Answer is not set. Cannot process accept()");this.sendOutboundMessage(this.Session.newMessage().method(Je.Method.Join).body(Je.Body.sdp(t.asJson())).build())}},Lh=class extends xN.Session{constructor(t,n,r){super(t,n,vN.Direction.Inbound,r),this.processInvite=o=>{if(o.method!=Je.Method.Invite)throw new $C.ArgumentError("Invalid method",(0,pN.nameof)(o));return!YC.Message.tryExtractSessionKey(o,f=>{this.sessionKey=f})||!_N.JsepMessage.tryParse(o,f=>this.addJsepMessage(f))?!1:(this.invite=o,!0)};let i=new qh(this),a=new kh(this),s=new Jh(this),u=new mN.EstablishedState(this),d=new yN.TerminatedState(this);this.setInitialState(i);let c=this.transitions;c.add(xe.SessionState.Created,xe.SessionState.Terminated,d),c.add(xe.SessionState.Created,xe.SessionState.Initiating,a),c.add(xe.SessionState.Initiating,xe.SessionState.Progress,s),c.add(xe.SessionState.Initiating,xe.SessionState.Terminated,d),c.add(xe.SessionState.Progress,xe.SessionState.Terminated,d),c.add(xe.SessionState.Progress,xe.SessionState.Established,u),c.add(xe.SessionState.Established,xe.SessionState.Terminated,d)}isLocalPeer(t){return t?this.localPeer.userId==t.userId&&this.localPeer.instanceId==t.instanceId:!1}accept(){this.tryWithCurrentState(t=>t.accept())}};Nd.InboundSession=Lh});var tE=p(ki=>{"use strict";var jC=ki&&ki.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ki,"__esModule",{value:!0});ki.InboundCall=void 0;var Md=ct(),CN=Qc(),eE=_n(),EN=1500,Uh=class extends CN.DefaultCall{constructor(t,n,r,i,a,s,u,d,c,o){super(t,r,i,a,s,u,d,c),this.origin=n,this.onAcceptedWithoutTracks=o,this.lastAnswerTime=Number.NEGATIVE_INFINITY}get remoteUserId(){return this.origin.identity}get remoteDomain(){return this.origin.domain}answer(){return jC(this,void 0,void 0,function*(){let t=Date.now();t-this.lastAnswerTime<EN||(this.lastAnswerTime=t,yield this.doAnswer())})}doAnswer(){return jC(this,void 0,void 0,function*(){this.mediaController.hasAnyTracks===!1&&(yield this.onAcceptedWithoutTracks(this)),this.withSession(t=>{let n=t.state;n===Md.SessionState.Progress?(this.clientEventsCollector.addEvent(eE.ClientEvent.createClientEventType(eE.ClientEventName.SDK_API_ANSWER)),t.accept()):(n===Md.SessionState.Created||n===Md.SessionState.Initiating)&&(t.onStateChanged=r=>{r.state==Md.SessionState.Progress&&this.doAnswer()})}),this.callEventFanout.setCallAccepted()})}};ki.InboundCall=Uh});var nE=p(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.ClientEventsCollector=void 0;var On=_n(),Wh=class{constructor(){this.clientEvents={events:[],eventsSemanticVersion:{major:1,minor:6}}}get events(){return this.clientEvents}addEvent(t){this.clientEvents.events.push(t)}onCallProgressing(t){this.addEvent(On.ClientEvent.createClientEventType(On.ClientEventName.SDK_API_CALL_STATE_PROGRESSING))}onCallRinging(t){this.addEvent(On.ClientEvent.createClientEventType(On.ClientEventName.SDK_API_CALL_STATE_RINGING))}onCallAnswered(t){this.addEvent(On.ClientEvent.createClientEventType(On.ClientEventName.SDK_API_CALL_STATE_ANSWERED))}onCallEstablished(t){this.addEvent(On.ClientEvent.createClientEventType(On.ClientEventName.SDK_API_CALL_STATE_ESTABLISHED))}};Bd.ClientEventsCollector=Wh});var iE=p(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.MxpEventsCollector=Dn.EventSubType=Dn.EventType=void 0;var wt=ht(),Ji;(function(e){e.In="IN",e.Out="OUT",e.Error="ERROR"})(Ji||(Dn.EventType=Ji={}));var rE=new Map([[wt.Method.Ack,"ACK"],[wt.Method.Cancel,"CANCEL"],[wt.Method.Deny,"DENY"],[wt.Method.Error,"ERROR"],[wt.Method.Invite,"INVITE"],[wt.Method.Join,"JOIN"],[wt.Method.Joined,"JOINED"],[wt.Method.Leave,"LEAVE"],[wt.Method.PeerEvent,"PEEREVENT"],[wt.Method.Undefined,"UNDEFINED"]]),jt;(function(e){e.RECEIVED="RECEIVED",e.IGNORED="IGNORED",e.WARNING="WARNING",e.SENDING="SENDING",e.SENDING_ABORTED="SENDING_ABORTED",e.SENDING_FAILED="SENDING_FAILED",e.SENT="SENT"})(jt||(Dn.EventSubType=jt={}));var Hh=class{constructor(){this.addSendingEventLog=this.addIgnoredWarningOrSendingEventLog(jt.SENDING),this.addSentEventLog=this.addSentOrReceivedEventLog(jt.SENT),this.addReceivedEventLog=this.addSentOrReceivedEventLog(jt.RECEIVED),this.addErrorEventLog=t=>{let{sessionId:n,localTimeStamp:r,additionalInfo:i}=t,a=[Ji.Error,jt.SENDING_FAILED,n,r,i];this.addEvent(a)},this.mxpEventLog={Version:"5",Events:[]}}addEvent(t){this.mxpEventLog.Events.push(t)}addIgnoredEventLog(){return this.addIgnoredWarningOrSendingEventLog(jt.IGNORED)}addWarningEventLog(){return this.addIgnoredWarningOrSendingEventLog(jt.WARNING)}addSendingEventLogForMessage(t){let{channelId:n,message:r}=t,{method:i,sessionId:a}=r,s=t.message.stringifiedValues();this.addSendingEventLog({sessionId:a,localTimeStamp:Date.now().toString(),messageType:i,headers:s,additionalInfo:this.extractAdditionalInfoFromMessage(r,n)})}addSentEventLogForMessage(t){let{channelId:n,message:r}=t,{method:i,sessionId:a}=r,s=t.message.stringifiedValues();this.addSentEventLog({sessionId:a,localTimeStamp:Date.now().toString(),pubsubTimeStamp:Date.now().toString(),messageType:i,headers:s,additionalInfo:this.extractAdditionalInfoFromMessage(r,n)})}addErrorEventLogForMessage(t){let{channelId:n,message:r}=t,{sessionId:i}=r;this.addErrorEventLog({sessionId:i,localTimeStamp:Date.now().toString(),additionalInfo:this.extractAdditionalInfoFromMessage(r,n)})}addReceivedEventLogForMessage(t){let{sessionId:n,method:r,values:i}=t;this.addReceivedEventLog({sessionId:n,localTimeStamp:Date.now().toString(),pubsubTimeStamp:Date.now().toString(),messageType:r,headers:i?JSON.stringify(i):"",additionalInfo:this.extractAdditionalInfoFromMessage(t,void 0)})}extractAdditionalInfoFromMessage(t,n){var r,i,a,s,u;let d=((r=t.body)===null||r===void 0?void 0:r.isClientEvent())===!0?(i=t.body)===null||i===void 0?void 0:i.data:void 0,c=((a=t.body)===null||a===void 0?void 0:a.isError())===!0?(s=t.body)===null||s===void 0?void 0:s.data:void 0;return JSON.stringify({body_type:(u=t.body)===null||u===void 0?void 0:u.type,channel:n,cand:t.getIceCandidate(),client_event:d,error_body:c})}addIgnoredWarningOrSendingEventLog(t){return n=>{let{sessionId:r,localTimeStamp:i,messageType:a,headers:s,additionalInfo:u}=n,d=[Ji.Out,t,r,i,rE.get(a),s,u];this.addEvent(d)}}addSentOrReceivedEventLog(t){return n=>{let{sessionId:r,localTimeStamp:i,pubsubTimeStamp:a,messageType:s,headers:u,additionalInfo:d}=n,c=[t===jt.RECEIVED?Ji.In:Ji.Out,t,r,i,a,rE.get(s),u,d];this.addEvent(c)}}get eventLog(){return this.mxpEventLog}get events(){return this.mxpEventLog.Events}};Dn.MxpEventsCollector=Hh});var aE=p(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});qd.CallQualityDataCollector=void 0;var Zo=qe(),bN=Yt(),IN=Cr(),TN=Ce(),AN=ue(),Vh=class{constructor(){this.callQuality={warningEvents:[],semanticVersion:{major:0,minor:3}}}get callQualityData(){return this.callQuality}onCallQualityWarningEvent(t,n){this.addToCallQualityWarningsArray(n)}addToCallQualityWarningsArray(t){try{this.callQuality.warningEvents.push(this.toOcraWarningEvent(t))}catch(n){console.error(`Error when converting ${t.name} to OCRA report type`,n)}}toOcraWarningEvent(t){let n=this.toOcraWarningMediaStreamType(t.mediaStreamType);return Object.assign({name:this.toOcraWarningEventName(t.name),time:new Date,type:this.toOcraWarningEventType(t.type)},n!==void 0&&{mediaStreamType:n})}toOcraWarningEventName(t){let n=Object.values(Zo.WarningEventName).find(r=>r===t);if(!n)throw new TN.ArgumentError(`Invalid WarningEventName. ${t} cannot be mapped to any Ocra event name`,(0,AN.nameof)(t));return n}toOcraWarningEventType(t){return t===bN.CallQualityWarningEventType.Recover?Zo.WarningEventType.Recover:Zo.WarningEventType.Trigger}toOcraWarningMediaStreamType(t){if(t)return t===IN.CallQualityWarningMediaStreamType.Video?Zo.MediaStreamType.Video:Zo.MediaStreamType.Audio}};qd.CallQualityDataCollector=Vh});var oE=p(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.DefaultCallQualityWarningControllerFactory=void 0;var wN=Pf(),Kh=class{create(t,n){return new wN.CallQualityWarningController(t,n)}};kd.DefaultCallQualityWarningControllerFactory=Kh});var Gh=p(Li=>{"use strict";var rt=Li&&Li.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Li,"__esModule",{value:!0});Li.CallClientInstance=void 0;var ON=Ae(),sE=ue(),Ot=G(),uE=Zy(),DN=RC(),Jd=Ce(),Ld=ht(),cE=ft(),RN=qi(),FN=Nh(),PN=Bh(),NN=XC(),MN=tE(),BN=Dh(),qN=cc(),dE=yi(),lE=nE(),fE=_n(),kN=iE(),hE=nc(),pE=aE(),vE=oE(),JN=qo(),zh=class e{constructor(t,n,r,i,a,s,u,d,c,o,f,m,_,x,E){this.userId=t,this.applicationKey=n,this.rtcConfig=r,this.fetchIceServers=i,this.callInitiator=a,this.rtcProfile=s,this.incomingCallEvent=u,this.pushSender=d,this.callReporter=c,this.webRtcStatsCollector=o,this.mediaManager=f,this.useRelayIceCandidatesOnly=m,this.features=_,this.instanceId=x,this.callerIdentifier=E,this.mxpChannels=new Map,this.calls=new Map,this.addListener=C=>{this.incomingCallEvent.addListener(C)},this.onBroadcastMessage=C=>{let{message:v}=C;try{let g=this.mxpProtocol.decode(v,new cE.SymmetricKey(this.rtcProfile.mxpEncryptionKey));g!==null&&g.message.method==cE.Method.Invite&&this.onInvite({message:g.message,pubsubTimeStamp:Date.now().toString()})}catch(g){console.error(g)}},this.onSignalMessage=C=>{var v;let{message:g}=C,y=Ld.ProtocolV10.getMXPDataParts(g);try{(v=this.getMxpChannel(y.sessionId))===null||v===void 0||v.handleInboundTransportMessage(C,this.mxpEventsCollector)}catch(S){console.error(S)}},this.sendOutboundMessage=C=>rt(this,void 0,void 0,function*(){var v,g,y;let{channelId:S,data:b}=C;(v=this.mxpEventsCollector)===null||v===void 0||v.addSendingEventLogForMessage(C);try{yield this.pubSubClient.publish(S,b),(g=this.mxpEventsCollector)===null||g===void 0||g.addSentEventLogForMessage(C)}catch{(y=this.mxpEventsCollector)===null||y===void 0||y.addErrorEventLogForMessage(C)}}),this.localPeer={userId:t,instanceId:this.instanceId,channel:s.mxpSignalChannel,deviceDescription:"js-sdk",cli:this.callerIdentifier,domain:Ot.Domain.Mxp},this.isMxpEventLogsEnabled=this.features.getFeatureFlag(dE.FeatureFlag.IncludeMxpEventLog),this.isTurnEnabled=this.features.getFeatureFlag(dE.FeatureFlag.UseTurn),r.legacyStunUrls&&!this.isTurnEnabled&&(this.stunUrls=r.legacyStunUrls),this.pubSubClient=this.createPubSubClient(s,r),this.pubSubClient.onSignalMessage.add(this.onSignalMessage),this.pubSubClient.onBroadcastMessage.add(this.onBroadcastMessage),this.mxpProtocol=Ld.ProtocolV10Factory.create(),this.joinIceServersAndStunUrls=(0,ON.flow)(qN.toRTCIceServer,C=>this.stunUrls?C.concat([{urls:this.stunUrls}]):C),this.getRTCIceServers=(0,sE.pipeAsync)(this.fetchIceServers,this.joinIceServersAndStunUrls)}removeEventListener(t){this.incomingCallEvent.removeListener(t)}newOutboundCall(t,n){return rt(this,void 0,void 0,function*(){let r=this.newCallId();this.mxpEventsCollector=this.createMxpEventsCollector();let i=new DN.OutboundSession(this.localPeer,r,new uE.RealTimeScheduler),a=yield this.mediaManager.createMediaController(!0,n),s=yield this.getRTCIceServers(),u=new RN.OutboundCall(t,n,i,this.getOrCreateMxpChannel(i),this.pushSender,a,this.callInitiator,this.useRelayIceCandidatesOnly,this.features,new lE.ClientEventsCollector,new pE.CallQualityDataCollector,new vE.DefaultCallQualityWarningControllerFactory,s);return this.addCallListener(u),this.storeCall(u),u})}ensureCallNotExists(t){if(this.calls.has(t))throw new Jd.InvalidOperationError(`Call already exists (${t})`)}hasActiveCall(){for(let t of this.calls.values())if(t.state!=hE.CallState.Ended)return!0;return!1}hasVideo(t){return BN.Sdp.parse(t.getSdp().sdp).hasVideo()}createMxpEventsCollector(){return this.isMxpEventLogsEnabled?new kN.MxpEventsCollector:void 0}newInboundCall(t){return rt(this,void 0,void 0,function*(){this.ensureCallNotExists(t.sessionId),this.mxpEventsCollector=this.createMxpEventsCollector();let n=this.hasVideo(t),r=new NN.InboundSession(this.localPeer,t.sessionId,new uE.RealTimeScheduler),i=yield this.mediaManager.createMediaController(!0,n),a={identity:t.from.userId,domain:t.from.domain},s=new MN.InboundCall(n,a,r,this.getOrCreateMxpChannel(r),i,this.useRelayIceCandidatesOnly,new lE.ClientEventsCollector,new pE.CallQualityDataCollector,new vE.DefaultCallQualityWarningControllerFactory,this.onAcceptedWithoutTracks.bind(this));return s.remoteUserDisplayName=t.from.cli,this.addCallListener(s),this.storeCall(s),s})}addCallListener(t){let n={onCallEstablished:()=>{this.webRtcStatsCollector.startStatsCollection(t),t.emitClientEvent(JN.MxpClientEvent.EnteredEstablished)},onCallEnded:r=>rt(this,void 0,void 0,function*(){var i;r.performCallEndedCleanup(),this.cancelSubscription(),this.webRtcStatsCollector.stopStatsCollection();let a=this.webRtcStatsCollector.getStats(),s=this.webRtcStatsCollector.getConnectionInfos();try{yield this.callReporter.submitCallReport(r,a,s,r.callQualityCollector.callQualityData,r.clientEventsCollector.events,(i=this.mxpEventsCollector)===null||i===void 0?void 0:i.eventLog)}catch(u){console.error("Failed to submit call report:",u)}finally{this.webRtcStatsCollector.reset(),r.removeListener(n)}})};t.addListener(n)}storeCall(t){this.calls.set(t.id,t)}newCallId(){return sE.StringHelper.UUID()}getMxpChannel(t){return this.mxpChannels.get(t)}getOrCreateMxpChannel(t){if(this.mxpChannels.has(t.id))return this.mxpChannels.get(t.id);{let n=this.createMxpChannel(t);return n.onOutboundMessage.add(this.sendOutboundMessage),n}}createMxpChannel(t){if(this.mxpChannels.has(t.id))throw new Jd.InvalidOperationError("MXP message channel already exists");let n=new PN.MxpMessageChannel(t.id,t.localPeer.instanceId,this.mxpProtocol);return this.mxpChannels.set(t.id,n),n}startSubscription(){this.pubSubClient.subscribe()}static isMxpCall(t){var n;return Ot.Domain.Mxp==((n=t.destination)===null||n===void 0?void 0:n.domain)}call(t,n,r){return rt(this,void 0,void 0,function*(){var i;this.startSubscription();let a=yield this.newOutboundCall(t,n);return r&&a.setHeaders(r),a.p2p=e.isMxpCall(a),a.clientEventsCollector.addEvent(fE.ClientEvent.createClientEventType(fE.ClientEventName.SDK_API_CALL_USER_START)),yield a.start(),(i=this.getMxpChannel(a.id))===null||i===void 0||i.processPendingInbound(),a})}cancelSubscription(){this.pubSubClient.cancel()}onInvite(t){return rt(this,void 0,void 0,function*(){var n,r,i,a,s;let u=null,{message:d}=t;if(!d.isAddressedToInstance(this.instanceId)){console.log("Received MXP Invite not addressed for this instance");return}let c=this.hasActiveCall();this.startSubscription();let o=yield this.newInboundCall(d);if((n=this.mxpEventsCollector)===null||n===void 0||n.addReceivedEventLogForMessage(d),!Ld.Message.tryExtractSessionKey(d,m=>o.setMxpSignalingConfiguration(m,d.from.channel)))return;!((r=d.values)===null||r===void 0)&&r.ph&&o.setHeaders(JSON.parse((i=d.values)===null||i===void 0?void 0:i.ph)),!((a=d.values)===null||a===void 0)&&a.ocrbu&&(o.callApiBaseUrl=d.values.ocrbu),!((s=d.values)===null||s===void 0)&&s.ris&&(u=JSON.parse(d.values.ris)),o.setIceServers(this.joinIceServersAndStunUrls(u||[])),yield o.start();let f=this.getMxpChannel(o.id);if(f)f.processPendingInbound(),f.handleInboundMessage(d);else throw new Jd.InvalidOperationError("Unable to get message channel");if(c){o.terminateDueToOngoingCall();return}this.incomingCallEvent.onEvent(o)})}createPubSubClient(t,n){return FN.PubSubClientFactory.create(t.mxpBroadcastChannel,t.mxpSignalChannel,{hostname:n.mxpPubSubConfig.hostname,broadcastSubscribeKey:n.mxpPubSubConfig.broadcastSubscribeKey,signalSubscribeKey:n.mxpPubSubConfig.signalSubscribeKey,signalPublishKey:n.mxpPubSubConfig.signalPublishKey})}handleCallPushPayload(t){this.pubSubClient.broadcastSubscribe(n=>Ld.ProtocolV10.getMXPDataParts(n).sessionId==t.callNotificationResult.callId)}callUser(t,n,r){return rt(this,void 0,void 0,function*(){return yield this.call({identity:t,domain:Ot.Domain.Mxp,type:Ot.DestinationTypeEnum.UserId},n,r)})}callSip(t,n,r){return rt(this,void 0,void 0,function*(){return yield this.call({identity:t,domain:Ot.Domain.Sip,type:Ot.DestinationTypeEnum.Sip},n,r)})}callConference(t,n,r){return rt(this,void 0,void 0,function*(){return yield this.call({identity:t,domain:Ot.Domain.Conference,type:Ot.DestinationTypeEnum.Conference},n,r)})}callPhoneNumber(t,n){return rt(this,void 0,void 0,function*(){return yield this.call({identity:t,domain:Ot.Domain.Pstn,type:Ot.DestinationTypeEnum.Phonenumber},!1,n)})}getCall(t){return this.calls.get(t)}set audioConstraints(t){this.mediaManager.audioTrackConstraints=t??void 0,this.updateActiveCallTrackConstraints()}set videoConstraints(t){this.mediaManager.videoTrackConstraints=t??void 0,this.updateActiveCallTrackConstraints()}updateActiveCallTrackConstraints(){return rt(this,void 0,void 0,function*(){for(let t of this.calls.values())t.state!=hE.CallState.Ended&&t.updateMediaController(yield this.mediaManager.createMediaController(!0,t.requestedVideo))})}onAcceptedWithoutTracks(t){return rt(this,void 0,void 0,function*(){let n=yield this.mediaManager.createMediaController(!0,t.requestedVideo);if(!n.hasAnyTracks)return Promise.reject(new Jd.InvalidOperationError("Could not get media tracks. Make sure you have granted required media permissions."));t.updateMediaController(n)})}};Li.CallClientInstance=zh});var mE=p(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});Ud.WebRTCStats=void 0;var Zh=class{constructor(){this.statsReport=new Map,this.connectionInfos=[]}convertStatsReportToJSON(){let t={};return this.statsReport.forEach((n,r)=>{t[r]=n}),JSON.stringify(t)}getStats(){let t={};return this.statsReport.forEach((n,r)=>{t[r]=n}),t}getStatsAsJson(){return this.statsReport.size===0?null:this.convertStatsReportToJSON()}};Ud.WebRTCStats=Zh});var _E=p(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.CallDestination=void 0;var en=qe(),gE=qi(),Qh=class e{constructor(t,n){this.call=t,this.localUserId=n,this.destinationDomain=this.call instanceof gE.OutboundCall?this.call.remoteDomain:en.Domain.Mxp,this.destinationUser=this.call instanceof gE.OutboundCall?this.call.remoteUserId:this.localUserId,this.destinationType=e.getDestinationTypeByDomain(this.destinationDomain)}static getDestinationTypeByDomain(t){switch(t){case en.Domain.Mxp:return en.DestinationTypeEnum.UserId;case en.Domain.Conference:return en.DestinationTypeEnum.Conference;case en.Domain.Pstn:return en.DestinationTypeEnum.Phonenumber;case en.Domain.Sip:return en.DestinationTypeEnum.Sip;default:console.error("Received a domain with no matching domain type",{domain:t});return}}getDestination(){if(!(!this.destinationType||!this.destinationUser))return{domain:this.destinationDomain,type:this.destinationType,identity:this.destinationUser}}};Wd.CallDestination=Qh});var SE=p(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.CallOrigin=void 0;var LN=qe(),xE=qi(),Yh=class{constructor(t,n){this.call=t,this.localUserId=n,this.originDomain=this.call instanceof xE.OutboundCall?LN.Domain.Mxp:this.call.remoteDomain,this.originUser=this.call instanceof xE.OutboundCall?this.localUserId:this.call.remoteUserId}getOrigin(){if(!(!this.originDomain||!this.originUser))return{domain:this.originDomain,identity:this.originUser}}};Hd.CallOrigin=Yh});var Xh=p(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.CallReportUtils=void 0;var pe=qe(),yE=qe(),UN=Lt(),CE=dn(),Rn=lc(),WN=qi(),HN=_E(),VN=SE(),$h=class e{static getCallResult(t){switch(t.details.endCause){case Rn.CallEndCause.Canceled:return pe.CallResult.Canceled;case Rn.CallEndCause.Denied:return pe.CallResult.Denied;case Rn.CallEndCause.Failure:return pe.CallResult.Failure;case Rn.CallEndCause.HungUp:case Rn.CallEndCause.Inactive:return e.inferHungUpResult(t.details);case Rn.CallEndCause.NoAnswer:case Rn.CallEndCause.Timeout:return pe.CallResult.NoAnswer;case Rn.CallEndCause.OtherDeviceAnswered:return pe.CallResult.OtherPeerAnswered;default:return pe.CallResult.Failure}}static getCallReportDirection(t){return t.direction==UN.Direction.Inbound?yE.Direction.Inbound:yE.Direction.Outbound}static getDurationInSeconds(t){return t/1e3}static getClientErrors(t){return t==null?void 0:[{message:t.message,code:t.code,domain:e.getClientErrorDomain(t.domain)}]}static getClientErrorDomain(t){switch(t){case CE.ErrorType.Http:return pe.ClientErrorDomain.Http;case CE.ErrorType.Network:return pe.ClientErrorDomain.Network;default:return}}static getRemoteDomain(t){return t instanceof WN.OutboundCall?t.destination.domain:t.remoteDomain}static getCallDestination(t,n){return new HN.CallDestination(t,n).getDestination()}static getCallOrigin(t,n){return new VN.CallOrigin(t,n).getOrigin()}static getCallReportInstance(t){return{version:t.version,id:t.id}}static getIceCandidate(t){return{address:t.address,port:t.port,type:this.getIceCandidateType(t.candidateType),ipProtocolVersion:this.getIpVersion(t.address),transportProtocol:this.getIceTransportProtocol(t.protocol),relayProtocol:this.getRelayProtocol(t.relayProtocol),url:t.url}}static getPrimaryIceCandidate({connectionInfos:t,isLocal:n}){let r=d=>n?d.localIceCandidate:d.remoteIceCandidate,i=t.map(r),a=new Map;i.forEach(d=>{var c;let o=this.getIceCandidateHash(d);a.set(o,[(((c=a.get(o))===null||c===void 0?void 0:c[0])||0)+1,d])});let s,u=0;for(let[,d]of a)d[0]>u&&(u=d[0],s=d[1]);return s}static filterSubsequentSameConnectionInfos(t){let n=[],r;for(let i of t)r&&this.isConnectionInfoEqual(r,i)||(r=i,n.push(i));return n}static isConnectionInfoEqual(t,n){return this.getIceCandidateHash(t.localIceCandidate)==this.getIceCandidateHash(n.localIceCandidate)&&this.getIceCandidateHash(t.remoteIceCandidate)===this.getIceCandidateHash(n.remoteIceCandidate)}static getIceCandidateHash(t){return`${t.address}:${t.port}:${t.ipProtocolVersion}:${t.type}:${t.transportProtocol}`}static getIceCandidateType(t){switch(t){case"host":return pe.IceCandidateType.Host;case"prflx":return pe.IceCandidateType.Prflx;case"relay":return pe.IceCandidateType.Relay;case"srflx":return pe.IceCandidateType.Srflx}}static getIceTransportProtocol(t){switch(t){case"udp":return pe.TransportProtocol.Udp;case"tcp":return pe.TransportProtocol.Tcp}}static getRelayProtocol(t){if(t!=null)switch(t.toLowerCase()){case"udp":return pe.RelayProtocol.Udp;case"tcp":return pe.RelayProtocol.Tcp;case"tls":return pe.RelayProtocol.Tls;default:return}}static getIpVersion(t){return t===void 0?pe.IpProtocolVersion.Unknown:t.split(".").length-1==3?pe.IpProtocolVersion.Ipv4:t.split(":").length-1>=1?pe.IpProtocolVersion.Ipv6:pe.IpProtocolVersion.Unknown}static inferHungUpResult(t){return t.establishedTime!=null?pe.CallResult.Established:pe.CallResult.Answered}};Vd.CallReportUtils=$h});var IE=p(Se=>{"use strict";var KN=Se&&Se.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Se,"__esModule",{value:!0});Se.CumulativeValues=Se.WebRTCStatsCollector=Se.OUTBOUND_RTP_VIDEO_STATS=Se.OUTBOUND_RTP_AUDIO_STATS=Se.INBOUND_RTP_VIDEO_STATS=Se.INBOUND_RTP_AUDIO_STATS=void 0;var Pe=Qt(),EE=mE(),bE=Xh(),zN=2e3,GN=10,ZN=1e4;Se.INBOUND_RTP_AUDIO_STATS=["actualBitrate","audioLevel","bytesReceived","codec","concealedSamples","concealmentEvents","currentRoundTripTime","jitter","packetsLost","packetsReceived","timestamp","totalSamplesDuration","totalSamplesReceived"];Se.INBOUND_RTP_VIDEO_STATS=["actualBitrate","bytesReceived","codec","currentRoundTripTime","frameHeight","frameWidth","framesDecoded","framesDropped","framesReceived","packetsLost","packetsReceived","qpSum","timestamp"];Se.OUTBOUND_RTP_AUDIO_STATS=["actualBitrate","audioLevel","bytesSent","codec","currentRoundTripTime","packetsSent","timestamp","totalSamplesDuration"];Se.OUTBOUND_RTP_VIDEO_STATS=["actualBitrate","bytesSent","codec","currentRoundTripTime","frameHeight","frameWidth","framesEncoded","framesSent","hugeFramesSent","packetsSent","qpSum","timestamp"];var QN={[Pe.RtcStatsTypes.InboundRtp]:{[Pe.MediaType.Audio]:{STATS:Se.INBOUND_RTP_AUDIO_STATS},[Pe.MediaType.Video]:{STATS:Se.INBOUND_RTP_VIDEO_STATS}},[Pe.RtcStatsTypes.OutboundRtp]:{[Pe.MediaType.Audio]:{STATS:Se.OUTBOUND_RTP_AUDIO_STATS},[Pe.MediaType.Video]:{STATS:Se.OUTBOUND_RTP_VIDEO_STATS}}},jh=class{constructor(){this.getPropertyValuesFromNames=(t,n)=>t.map(r=>n[r]),this.candidatePair={},this.codec=new Map,this.cumulativeValues=new Map,this.mediaSource=new Map,this.rawStatsReport=new Map,this.remoteCandidates=new Map,this.localCandidates=new Map,this.tracks=new Map,this.webRtcStats=new EE.WebRTCStats}startStatsCollection(t){let n=0;this.intervalId=setInterval(()=>{n++,n>GN?(clearInterval(this.intervalId),this.collectStats(t),this.intervalId=setInterval(()=>this.collectStats(t),ZN)):this.collectStats(t)},zN)}stopStatsCollection(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}reset(){this.candidatePair={},this.codec=new Map,this.cumulativeValues=new Map,this.mediaSource=new Map,this.rawStatsReport=new Map,this.remoteCandidates=new Map,this.localCandidates=new Map,this.tracks=new Map,this.webRtcStats=new EE.WebRTCStats}getStats(){return this.webRtcStats.getStats()}getConnectionInfos(){return this.webRtcStats.connectionInfos}addCodec(t,n){let r=this.codec.get(t);r&&(n.codec=r.mimeType)}addRTT(t){var n;t.currentRoundTripTime=(n=this.candidatePair)===null||n===void 0?void 0:n.currentRoundTripTime}addAudioLevelAndTotalSamplesDuration(t){let n=t.trackId,r=this.tracks.get(n);if(!r)return;let i=r.mediaSourceId,a=this.mediaSource.get(i);a&&(t.audioLevel=a.audioLevel,t.totalSamplesDuration=a.totalSamplesDuration)}addActualBitrate(t){let n=t.id,r=t.timestamp,i=t.bytesReceived?t.bytesReceived:t.bytesSent,a=this.cumulativeValues.get(n);a.addValue(r,i*8),t.actualBitrate=a.getCurrentAverageValue()}addRequiredProps(){this.rawStatsReport.forEach(t=>{this.addCodec(t.codecId,t),this.addRTT(t),this.addAudioLevelAndTotalSamplesDuration(t),this.addActualBitrate(t)})}updateStatsReport(){let t=this.webRtcStats.statsReport;this.rawStatsReport.forEach((n,r)=>{var i;let a=t.get(r),s=(i=n.mediaType)!==null&&i!==void 0?i:n.kind,u=n.type,d=QN[u][s].STATS,c=this.getPropertyValuesFromNames(d,n);a?a.values.push(c):t.set(r,{id:r,mediaType:s,type:u,names:d,values:[c]})})}updateConnectionInfo(){let t=this.candidatePair.localCandidateId,n=this.candidatePair.remoteCandidateId,r=this.localCandidates.get(t),i=this.remoteCandidates.get(n);if(r==null||i==null)return;let a={localIceCandidate:bE.CallReportUtils.getIceCandidate(r),remoteIceCandidate:bE.CallReportUtils.getIceCandidate(i),timestamp:new Date};this.webRtcStats.connectionInfos.push(a)}collectStats(t){return KN(this,void 0,void 0,function*(){try{let n=yield t.getPeerConnectionStats();if(!n)return;n.forEach(r=>{switch(r.type){case Pe.RtcStatsTypes.Codec:{this.codec.set(r.id,{codecId:r.id,mimeType:r.mimeType});break}case Pe.RtcStatsTypes.CandidatePair:{r.state==="succeeded"&&(this.candidatePair=r);break}case Pe.RtcStatsTypes.Track:{this.tracks.set(r.id,r);break}case Pe.RtcStatsTypes.MediaSource:{r.kind===Pe.MediaType.Audio&&this.mediaSource.set(r.id,r);break}case Pe.RtcStatsTypes.RemoteCandidate:{this.remoteCandidates.set(r.id,this.createCandidate(r));break}case Pe.RtcStatsTypes.LocalCandidate:{this.localCandidates.set(r.id,this.createCandidate(r));break}case Pe.RtcStatsTypes.InboundRtp:case Pe.RtcStatsTypes.OutboundRtp:{this.cumulativeValues.has(r.id)||this.cumulativeValues.set(r.id,new Kd),this.rawStatsReport.set(r.id,r);break}default:break}}),this.addRequiredProps(),this.updateStatsReport(),this.updateConnectionInfo()}catch(n){console.error(n)}})}createCandidate(t){let n=t.id,r=t.type,i=t.candidateType,a=t.protocol,s=t.address,u=t.port,d=t.timestamp,c=t.relayProtocol,o=t.url;return{id:n,timestamp:d,type:r,candidateType:i,protocol:a,address:s,port:u,relayProtocol:c,url:o}}};Se.WebRTCStatsCollector=jh;var Kd=class{constructor(){this.previousTimestamp=0,this.previousValue=0,this.currentAverageValue=0}reset(t,n){this.previousTimestamp=t,this.previousValue=n,this.currentAverageValue=n}addValue(t,n){if(n>this.previousValue&&t>this.previousTimestamp&&this.previousTimestamp!==0){let r=(t-this.previousTimestamp)/1e6;this.currentAverageValue=(n-this.previousValue)/r,this.previousTimestamp=t,this.previousValue=n}else this.reset(t,n)}getCurrentAverageValue(){return this.currentAverageValue}};Se.CumulativeValues=Kd});var AE=p(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.CallClientEventFanout=void 0;var YN=xi(),TE=_n(),ep=class extends YN.EventFanout{constructor(t){super(),this.callClient=t,this.listen=(n,r)=>{n.clientEventsCollector.addEvent(TE.ClientEvent.createClientEventType(TE.ClientEventName.SDK_DID_NOTIFY_INCOMING_CALL)),r.onIncomingCall(this.callClient,n)}}};zd.CallClientEventFanout=ep});var wE=p(Fn=>{"use strict";var Qo=Fn&&Fn.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.CallClientFactory=Fn.DefaultCallClient=void 0;var $N=Gh(),XN=IE(),jN=AE(),Gd=class{constructor(t,n,r){this.userId=t,this.applicationKey=n,this.mediaManager=r,this.pendingEventListeners=new Array}getCall(t){return this.callclient.getCall(t)}init(t,n,r,i,a,s,u,d,c,o){this.instance=new $N.CallClientInstance(this.userId,this.applicationKey,r,i,t,n,new jN.CallClientEventFanout(this),s,a,new XN.WebRTCStatsCollector,this.mediaManager,u,d,c,o),this.pendingEventListeners.forEach(this.instance.addListener),this.pendingEventListeners=[]}get callclient(){if(this.instance)return this.instance;throw new Error("Invalid operation")}handleCallPushPayload(t){t.callNotificationResult.hasTimedOut()||this.callclient.handleCallPushPayload(t)}callUser(t,n){return Qo(this,void 0,void 0,function*(){return this.callclient.callUser(t,!1,n)})}callUserVideo(t,n){return Qo(this,void 0,void 0,function*(){return this.callclient.callUser(t,!0,n)})}callPhoneNumber(t,n){return Qo(this,void 0,void 0,function*(){return this.callclient.callPhoneNumber(t,n)})}callSip(t,n){return Qo(this,void 0,void 0,function*(){return this.callclient.callSip(t,!1,n)})}callConference(t,n){return Qo(this,void 0,void 0,function*(){return this.callclient.callConference(t,!1,n)})}addListener(t){var n;this.instance?(n=this.instance)===null||n===void 0||n.addListener(t):this.pendingEventListeners.push(t)}removeListener(t){var n;(n=this.instance)===null||n===void 0||n.removeEventListener(t)}setAudioTrackConstraints(t){this.callclient.audioConstraints=t}setVideoTrackConstraints(t){this.callclient.videoConstraints=t}getInstance(){return this.instance}};Fn.DefaultCallClient=Gd;var tp=class{static create(t,n,r){return new Gd(t,n,r)}};Fn.CallClientFactory=tp});var np=p(OE=>{"use strict";Object.defineProperty(OE,"__esModule",{value:!0})});var RE=p(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0})});var FE=p(Le=>{"use strict";var eM=Le&&Le.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Pn=Le&&Le.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&eM(t,e,n)};Object.defineProperty(Le,"__esModule",{value:!0});Pn(Qc(),Le);Pn(wE(),Le);Pn(np(),Le);Pn(RE(),Le);Pn(Bh(),Le);Pn(qi(),Le);Pn(Nh(),Le);Pn(Gh(),Le)});var PE=p(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.DeviceVersion=void 0;var tM=qe(),rp=ue(),ip=class{constructor(t){this.application=t,this.platform=tM.PlatformIdentifier.Js,this.os=rp.EnvHelper.getPlatformInfo(),this.deviceModelId=rp.EnvHelper.getFullUserAgent(),this.deviceModelName=rp.EnvHelper.getBrowserInfo()}equals(t){return t==null?!1:this.application===t.application&&this.os===t.os&&this.deviceModelId===t.deviceModelId&&this.deviceModelName===t.deviceModelName}};Zd.DeviceVersion=ip});var ME=p(NE=>{"use strict";Object.defineProperty(NE,"__esModule",{value:!0})});var qE=p(BE=>{"use strict";Object.defineProperty(BE,"__esModule",{value:!0})});var kE=p(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.Context=void 0;var ap=class{constructor(t){if(this.context=t,!this.context.init.method)throw Error("Invalid RequestContext");this.method=this.context.init.method,this.url=new URL(this.context.url),this.content=this.context.init.body}get headers(){return this.context.init.headers}addHeader(t,n){this.headers[t]=n}};Qd.Context=ap});var JE=p(Ui=>{"use strict";var nM=Ui&&Ui.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.InstanceRequestSignatureV1Authentication=void 0;var rM=ue(),iM=Yd(),aM=kE(),op=class{constructor(t,n,r){this.instanceCredentials=t,this.userInstance=n,this.prolong=r,this.pre=i=>nM(this,void 0,void 0,function*(){iM.SignatureV1RequestSigner.sign(new aM.Context(i),this.instanceCredentials.applicationKey,this.instanceCredentials.username,this.instanceCredentials.instance.id,this.secret)}),this.secret=rM.Base64Helper.decode(t.instance.secret)}get credentials(){return this.instanceCredentials}get instance(){return this.userInstance}get id(){return this.userInstance.instance.id}};Ui.InstanceRequestSignatureV1Authentication=op});var LE=p(Wi=>{"use strict";var oM=Wi&&Wi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Wi,"__esModule",{value:!0});Wi.JwtAuthentication=void 0;var sp=class{constructor(t){this.jwt=t,this.pre=n=>oM(this,void 0,void 0,function*(){n.init.headers.Authorization=`Bearer ${this.jwt}`})}};Wi.JwtAuthentication=sp});var WE=p(UE=>{"use strict";Object.defineProperty(UE,"__esModule",{value:!0})});var HE=p($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.SignatureV1=void 0;var tn=ue(),Yo=class e{static signature(t,n){let r=t.headers[e.XSinDateHeader],i=e.buildCanonicalRequest(t),a=e.buildStringToSign(i,r),s=e.deriveSigningKey(r,n);return e.computeSignature(s,a)}static buildCanonicalRequest(t){let n=[];return n.push(t.method.toUpperCase()),n.push(`
5
+ `),n.push(e.buildCanonicalURI(t.url.pathname)),n.push(`
6
+ `),n.push(`
7
+ `),n.push(e.buildCanonicalRequiredHeaders(t)),n.push(`
8
+ `),n.push(e.buildRequestBodyHash(t.content)),n.join("")}static buildCanonicalURI(t){if(!t)return"/";let n=t.split("/"),r=[];for(let i of n)r.push(encodeURIComponent(i));return r.join("/")}static buildCanonicalRequiredHeaders(t){let n=[],r=t.method.toUpperCase(),i=[e.XSinDateHeader];(r==="POST"||r==="PUT"||r==="PATCH")&&i.push("Content-Type");for(let a of i.sort()){let s=t.headers[a];s&&(n.push(a.toLowerCase()),n.push(":"),n.push(s.replace(/\s{2,}/g," ")),n.push(`
9
+ `))}return n.join("")}static buildRequestBodyHash(t){if(t){let n=tn.CryptoHelper.convertUTF8ToByteArray(t);return tn.CryptoHelper.convertByteArrayToHex(tn.CryptoHelper.SHA256FromByteArray(n))}else return e.emptyRequestBodySha256}static buildStringToSign(t,n){let r=[],i=tn.CryptoHelper.convertUTF8ToByteArray(t);return r.push(n),r.push(`
10
+ `),r.push(tn.CryptoHelper.convertByteArrayToHex(tn.CryptoHelper.SHA256FromByteArray(i))),r.join("")}static deriveSigningKey(t,n){return tn.CryptoHelper.HMAC_SHA256(t,n)}static computeSignature(t,n){let r=tn.CryptoHelper.HMAC_SHA256(n,t);return tn.CryptoHelper.convertByteArrayToHex(r)}static sortObject(t){let n={};for(let r of Object.keys(t).sort((i,a)=>i.localeCompare(a)))n[r]=t[r];return n}};$d.SignatureV1=Yo;Yo.emptyRequestBodySha256="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";Yo.XSinDateHeader="x-sin-date"});var KE=p(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.SignatureV1RequestSigner=void 0;var VE=ue(),up=Yd(),cp=class{static sign(t,n,r,i,a){t.headers[up.SignatureV1.XSinDateHeader]||(t.headers[up.SignatureV1.XSinDateHeader]=VE.DateHelper.formatISO8601BasicDateTime(new Date)),t.addHeader("Authorization",`instance-v1 ${n} ${VE.Base64Helper.encodeUnsafe(r)} ${i} ${up.SignatureV1.signature(t,a)}`)}};Xd.SignatureV1RequestSigner=cp});var Yd=p(Ge=>{"use strict";var sM=Ge&&Ge.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Rr=Ge&&Ge.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&sM(t,e,n)};Object.defineProperty(Ge,"__esModule",{value:!0});Rr(ME(),Ge);Rr(qE(),Ge);Rr(JE(),Ge);Rr(LE(),Ge);Rr(WE(),Ge);Rr(HE(),Ge);Rr(KE(),Ge)});var lp=p(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.ClientRegistration=void 0;var dp=class{constructor(t,n){this.register=t,this.registerFailed=n}};jd.ClientRegistration=dp});var GE=p(e0=>{"use strict";Object.defineProperty(e0,"__esModule",{value:!0});e0.JWT=void 0;var zE=ue(),uM=Ce(),$o=class e{constructor(t){this.claims=t}static parse(t){let n=t.split(".");if(n.length!=3)throw new uM.ArgumentError(`Inavlid JWT: ${t}`,(0,zE.nameof)(t));let r=JSON.parse(new TextDecoder().decode(zE.Base64Helper.decodeUrlSafeToUint8Array(n[1])));return new e(r)}getClaim(t){return this.claims[t]}get instanceExpireAt(){let t=this.getClaim(e.INSTANCE_EXP_KEY);return t?new Date(t*1e3):void 0}get iat(){return this.getClaim(e.ISSUED_AT_KEY)}get instanceTtl(){var t;return(((t=this.getClaim(e.INSTANCE_EXP_KEY))!==null&&t!==void 0?t:Number.MAX_VALUE)-this.iat)*1e3}};e0.JWT=$o;$o.INSTANCE_EXP_KEY="sinch:rtc:instance:exp";$o.ISSUED_AT_KEY="iat"});var hp=p(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.TimeServiceFactory=Hi.TimeService=void 0;var t0=class{get now(){return new Date}};Hi.TimeService=t0;var fp=class{static create(){return new t0}};Hi.TimeServiceFactory=fp});var pp=p(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.UserInstance=void 0;var cM=hp(),n0=class e{static parse(t){var n;let r=JSON.parse(t);return new e(Object.assign(Object.assign({},r.instance),{expireAt:!((n=r.instance)===null||n===void 0)&&n.expireAt?new Date(Date.parse(r.instance.expireAt)):void 0}),r.config,new Date(Date.parse(r.iat)))}constructor(t,n,r){this.instance=t,this.config=n,this.iat=r,this.timeService=cM.TimeServiceFactory.create()}hasExpired(){return this.instance.expireAt!=null&&this.instance.expireAt.getTime()<this.timeService.now.getTime()}isShortLived(t){return this.Ttl<=(t+1)*e.DAY_IN_MS}get Ttl(){var t,n;return!((t=this.instance)===null||t===void 0)&&t.expireAt?((n=this.instance)===null||n===void 0?void 0:n.expireAt.getTime())-this.iat.getTime():Number.MAX_VALUE}shouldProlong(t){return this.expiresIn()<=(this.isShortLived(t)?this.Ttl/2:t*e.DAY_IN_MS)}expiresIn(){return this.instance.expireAt?this.instance.expireAt.getTime()-this.timeService.now.getTime():Number.MAX_VALUE}get id(){return this.instance.id}toString(){return JSON.stringify({instance:this.instance,config:this.config,iat:this.iat})}};r0.UserInstance=n0;n0.DAY_IN_MS=24*3600*1e3});var mp=p(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.KeyValueStorage=void 0;var vp=class{constructor(t,n){this.storage=t,this.prefix=n}get(t){let n=this.storage.getItem(this.prefix+t);if(n)return JSON.parse(n)}set(t,n){this.storage.setItem(this.prefix+t,JSON.stringify(n))}remove(t){this.storage.removeItem(this.prefix+t)}};i0.KeyValueStorage=vp});var ZE=p(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.SettingStorage=void 0;var dM=mp(),Xo=class e extends dM.KeyValueStorage{constructor(t){super(t,e.SETTING_PREFIX)}get applicationServerKey(){return this.get(e.SETTING_KEY_APPLICATION_SERVER_KEY)}set applicationServerKey(t){this.set(e.SETTING_KEY_APPLICATION_SERVER_KEY,t)}};a0.SettingStorage=Xo;Xo.SETTING_KEY_APPLICATION_SERVER_KEY="ApplicationServerKey";Xo.SETTING_PREFIX="sinch:settings:"});var QE=p(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.UserInstanceStorage=void 0;var lM=pp(),o0=class e{constructor(t,n,r){this.storage=t,this.appKey=n,this.userId=r}prefix(t){return`sinch:${t}:${this.appKey}:${this.userId}`}set(t){let n=this.prefix(e.INSTANCE_PREFIX);this.storage.setItem(n,t.toString())}get(){return this.getUserInstance(this.prefix(e.INSTANCE_PREFIX))}remove(){this.storage.removeItem(e.INSTANCE_PREFIX)}getUserInstance(t){let n=this.storage.getItem(t);if(n)return lM.UserInstance.parse(n)}};s0.UserInstanceStorage=o0;o0.INSTANCE_PREFIX="instance:"});var _p=p(u0=>{"use strict";var Vi;Object.defineProperty(u0,"__esModule",{value:!0});u0.FeatureStorage=void 0;var fM=mp(),gp=yi(),Nn=class extends fM.KeyValueStorage{constructor(t){super(t,Vi.FEATURE_PREFIX)}setApplicationConfig(t,n){this.userId=t,this.applicationKey=n}getFeatureFlag(t){let n=this.getPrefixedFeatureFlagKey(t);return this.get(n)}setFeatureFlag(t,n){if(!this.isApplicationConfigSet()){console.error("Attempting to persist feature flags without user instance");return}this.set(this.getPrefixedFeatureFlagKey(t),n)}isEmpty(){return Object.keys(gp.FeatureFlag).every(t=>{let n=gp.FeatureFlag[t];return typeof this.getFeatureFlag(n)>"u"})}removeAll(){Vi.STORAGE_KEYS.forEach(t=>{this.remove(this.getPrefixedFeatureFlagKey(t))})}get lastRefreshedAt(){let t=this.get(Vi.LAST_REFRESHED_AT);return t||0}set lastRefreshedAt(t){this.set(Vi.LAST_REFRESHED_AT,t)}isApplicationConfigSet(){return this.userId&&this.applicationKey}getPrefixedFeatureFlagKey(t){return`${this.applicationKey}:${this.userId}:${t}`}};u0.FeatureStorage=Nn;Vi=Nn;Nn.FEATURE_PREFIX="sinch:features:";Nn.LAST_REFRESHED_AT="LastRefreshedAt";Nn.REFRESH_INTERVAL_MS=3600*1e3*48;Nn.STORAGE_KEYS=[...Object.entries(gp.FeatureFlag).map(e=>e[1]),Vi.LAST_REFRESHED_AT]});var d0=p(c0=>{"use strict";Object.defineProperty(c0,"__esModule",{value:!0});c0.StorageFactory=void 0;var hM=ZE(),pM=QE(),vM=_p(),xp=class{static createInstanceStorage(t,n){var r;return new pM.UserInstanceStorage((r=this.storage)!==null&&r!==void 0?r:localStorage,t,n)}static createSettingStorage(){var t;return new hM.SettingStorage((t=this.storage)!==null&&t!==void 0?t:localStorage)}static createFeatureStorage(){var t;return new vM.FeatureStorage((t=this.storage)!==null&&t!==void 0?t:localStorage)}};c0.StorageFactory=xp});var f0=p(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});l0.VERSION=void 0;l0.VERSION="2.49.11"});var jE=p(Ki=>{"use strict";var Dt=Ki&&Ki.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.InstanceController=void 0;var mM=PE(),Sp=vf(),yp=Yd(),jo=ue(),YE=lp(),$E=GE(),XE=Ce(),gM=pp(),_M=d0(),xM=f0(),Mn=class e{constructor(t,n,r,i){this.applicationKey=t,this.userId=n,this.clientEvent=r,this.api=i,this.DefaultCapabilities=[Sp.Capability.P2p,Sp.Capability.IceProxy,Sp.Capability.Ocra],this.deviceId=jo.StringHelper.UUID(),this.userInstance=null,this.createNewInstanceAuthentication=()=>Dt(this,void 0,void 0,function*(){if(yield this.createInstance(),this.authentication)return this.authentication;throw Error("Unable to create instance")}),this.prolongInstance=()=>Dt(this,void 0,void 0,function*(){return jo.PromiseHelper.setTimeout(new Promise((a,s)=>{this.clientEvent.onEvent({eventType:"registration",context:new YE.ClientRegistration(u=>Dt(this,void 0,void 0,function*(){this.updateInstanceExpiresAt(this.userId,u).then(()=>a()).catch(d=>{s(d)})}),()=>{s("onCredentialsRequired failed.")})})}),e.REGISTRATION_TIMEOUT_MS)}),this.storage=_M.StorageFactory.createInstanceStorage(this.applicationKey,this.userId),this.deviceVersion=new mM.DeviceVersion(e.APPLICATION_VERSION),this.capabilities=this.DefaultCapabilities,this.updateInstanceTtlWindowDays=e.UPDATE_INSTANCE_TTL_WINDOW_DAYS_DEFAULT,this.callUpdateInstanceApi=this.callUpdateInstanceApi.bind(this),this.setUpdatedInstance=this.setUpdatedInstance.bind(this),this.storeInstance=this.storeInstance.bind(this),this.updateInstance=(0,jo.pipeAsync)(this.callUpdateInstanceApi,this.setUpdatedInstance,this.storeInstance)}removeInstance(){this.storage.remove()}setInstance(t){this.instance&&this.removeInstance(),this.storage.set(t),this.userInstance=t,this.authentication=new yp.InstanceRequestSignatureV1Authentication({applicationKey:this.applicationKey,username:this.userId,instance:this.userInstance.instance},t,this.prolongInstance),this.api.setInstanceAuthentication(this.authentication,this.createNewInstanceAuthentication)}get instance(){return this.userInstance}toggleCapability(t,n){let r=this.capabilities.length;n?this.capabilities.push(t):this.capabilities=this.capabilities.filter(i=>i!==t),r!==this.capabilities.length&&this.scheduleInstanceUpdate()}isCapabilityEnabled(t){return this.capabilities.includes(t)}setUpdateInstanceTtlWindow(t){t&&(this.updateInstanceTtlWindowDays=t)}start(){return Dt(this,void 0,void 0,function*(){let t=this.storage.get();if(t)if(t.hasExpired())this.removeInstance();else return this.setInstance(t),this.updateInstanceIfNecessary(),t.instance;if(this.clientEvent.hasListeners())return this.createInstance();throw new XE.InvalidOperationError("No listener registered for onCredentialsRequired")})}prolongInstanceIfNeeded(){return Dt(this,void 0,void 0,function*(){this.instance&&this.instance.shouldProlong(this.updateInstanceTtlWindowDays)&&(yield this.prolongInstance())})}terminate(){this.updateInstanceTimeoutId&&clearTimeout(this.updateInstanceTimeoutId)}createInstance(){return Dt(this,void 0,void 0,function*(){return jo.PromiseHelper.setTimeout(new Promise((t,n)=>{this.clientEvent.onEvent({eventType:"registration",context:new YE.ClientRegistration(r=>Dt(this,void 0,void 0,function*(){this.register(r).then(i=>t(i)).catch(i=>{n(i)})}),()=>{n("onCredentialsRequired failed.")})})}),e.REGISTRATION_TIMEOUT_MS)})}updateInstanceIfNecessary(){let t=this.instance;if(!t){console.error("Error during updating instance, current instance not set");return}this.deviceVersion.equals(t.instance.version)||this.scheduleInstanceUpdate()}scheduleInstanceUpdate(){this.updateInstanceTimeoutId||(this.updateInstanceTimeoutId=setTimeout(()=>{this.updateInstanceTimeoutId=void 0,this.updateInstance()},e.UPDATE_INSTANCE_DELAY_MS))}register(t){return Dt(this,void 0,void 0,function*(){let n=$E.JWT.parse(t);this.validateExpireAt(n);let r=yield this.api.createInstance(new yp.JwtAuthentication(t),{applicationKey:this.applicationKey,createInstanceRequest:{userId:this.userId,deviceId:this.deviceId,capabilities:this.capabilities,version:this.deviceVersion,expireAt:n.instanceExpireAt}});return this.setInstance(new gM.UserInstance(Object.assign({},r.instance),r.config,new Date(n.iat*1e3))),r.instance})}validateExpireAt(t){if(t.instanceTtl<e.MIN_TTL_MS)throw new XE.ArgumentError("instance TTL has to be greater than 48h",(0,jo.nameof)(t))}storeInstance(){this.instance&&this.storage.set(this.instance)}setUpdatedInstance(t){if(!(!t||!this.instance))return this.instance.instance=t,t}callUpdateInstanceApi(){return Dt(this,void 0,void 0,function*(){if(!this.instance)return;let{id:t}=this.instance.instance;return yield this.api.updateInstance({userId:this.userId,instanceId:t,updateInstanceRequest:{capabilities:this.capabilities,version:this.deviceVersion}})})}updateInstanceExpiresAt(t,n){return Dt(this,void 0,void 0,function*(){if(this.instance){let r=$E.JWT.parse(n);this.validateExpireAt(r);let i=yield this.api.updateInstanceTtl(new yp.JwtAuthentication(n),{instanceId:this.instance.instance.id,userId:t,updateInstanceTtlRequest:{expireAt:r.instanceExpireAt}});this.instance.iat=new Date(r.iat*1e3),this.instance.instance.expireAt=i.expireAt,this.storeInstance()}})}};Ki.InstanceController=Mn;Mn.MIN_TTL_MS=48*3600*1e3;Mn.REGISTRATION_TIMEOUT_MS=4e3;Mn.APPLICATION_VERSION=xM.VERSION;Mn.UPDATE_INSTANCE_DELAY_MS=500;Mn.UPDATE_INSTANCE_TTL_WINDOW_DAYS_DEFAULT=180});var eb=p(Bn=>{"use strict";var h0=Bn&&Bn.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.ServiceWorkerFactory=Bn.PushServiceWorker=void 0;var SM=ue(),es=class e{constructor(t,n,r){this.name=t,this.serviceWorker=n,this.registrationOptions=r}register(){return h0(this,void 0,void 0,function*(){this.registration=yield this.serviceWorker.register(this.name,this.registrationOptions)})}unregister(){return h0(this,void 0,void 0,function*(){this.registration&&(yield this.registration.unregister(),this.registration=void 0)})}subscribe(t){let n=SM.Base64Helper.decodeUrlSafeToUint8Array(t),r=new Uint8Array(n);return this.serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})}unsubscribe(t){return h0(this,void 0,void 0,function*(){(yield t.unsubscribe())||console.log("Unable to unsubscribe push notifications")})}getSubscription(){return this.serviceWorkerRegistration.pushManager.getSubscription()}showNotification(t,n){this.serviceWorkerRegistration.showNotification(t,n)}addEventListener(t){this.registration&&this.serviceWorker.addEventListener("message",n=>{t.fire(n.data)})}isPushManagerAvailable(){return this.serviceWorkerRegistration.pushManager!==void 0&&this.serviceWorkerRegistration.pushManager!==null}arePushPermissionsExplicitlyDenied(){return h0(this,void 0,void 0,function*(){return(yield this.serviceWorkerRegistration.pushManager.permissionState({userVisibleOnly:!0}))===e.PERMISSION_DENIED})}get serviceWorkerRegistration(){if(!this.registration)throw new Error("No registered ServiceWorker");return this.registration}};Bn.PushServiceWorker=es;es.PERMISSION_DENIED="denied";var p0=class{static create(t,n){if(!this.serviceWorker)throw Error(`Unable to register ServiceWorker: ${t}`);return new es(t,this.serviceWorker,n)}};Bn.ServiceWorkerFactory=p0;p0.serviceWorker=typeof navigator<"u"?navigator.serviceWorker:void 0});var Cp=p(zi=>{"use strict";var v0=zi&&zi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(zi,"__esModule",{value:!0});zi.W3CPushWorker=void 0;var yM=d0(),CM=un(),EM=eb(),ts=class e{constructor(t,n,r){this.pushService=n,this.pushEvent=new CM.Event,this.settings=yM.StorageFactory.createSettingStorage(),this.pushServiceWorker=EM.ServiceWorkerFactory.create(t,r)}showNotification(t,n){this.pushServiceWorker.showNotification(t,n)}register(){return v0(this,void 0,void 0,function*(){yield this.pushServiceWorker.register(),this.pushServiceWorker.addEventListener(this.pushEvent)})}unregister(){return v0(this,void 0,void 0,function*(){yield this.pushServiceWorker.unregister(),this.pushEvent.clean()})}addEventListener(t){this.pushEvent.add(t)}start(t,n){return v0(this,void 0,void 0,function*(){yield this.assertPushEnvironment();let r=yield this.pushServiceWorker.getSubscription();r?this.settings.applicationServerKey!=t&&(yield this.pushServiceWorker.unsubscribe(r),r=yield this.pushServiceWorker.subscribe(t)):r=yield this.pushServiceWorker.subscribe(t),this.settings.applicationServerKey=t,yield this.pushService.registerPushToken(r,t,n)})}assertPushEnvironment(){return v0(this,void 0,void 0,function*(){if(!this.pushServiceWorker.isPushManagerAvailable())throw new Error(e.ERROR_MANAGER_NOT_AVAILABLE);if(yield this.pushServiceWorker.arePushPermissionsExplicitlyDenied())throw new Error(e.ERROR_PERMISSIONS_DENIED)})}};zi.W3CPushWorker=ts;ts.ERROR_MANAGER_NOT_AVAILABLE="PushManager not available. Make sure you're using properly configured application on browser that supports push notifications.";ts.ERROR_PERMISSIONS_DENIED="Push notifications permissions denied. Make sure you allow push notifications."});var tb=p(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.PushFactory=void 0;var bM=Id(),IM=Cp(),Ep=class{static createPushWorker(t,n,r){return new IM.W3CPushWorker(t,n,r)}static createPushService(t,n){return new bM.OcraPushService(t,n)}};m0.PushFactory=Ep});var nb=p(g0=>{"use strict";Object.defineProperty(g0,"__esModule",{value:!0});g0.DefaultNotificationResult=void 0;var TM=mt(),AM=Td(),ns=class e{constructor(t,n){this.notificationDisplayName=n,this.valid=!1,this.valid=t?AM.PushPayload.tryDecode(t,r=>{this.message=r}):!1}isValid(){return this.valid}get displayName(){return this.notificationDisplayName}get callNotificationResult(){if(!this.valid||!this.message)throw new TM.InvalidOperationError("Cannot return CallNotificationResult for non-valid push notification.");return{callId:this.message.sessionId,remoteUserId:this.message.userId,isVideoOffered:()=>this.isFlagSet(e.VIDEO_OFFERED_FLAG),hasTimedOut:()=>this.message?new Date().getTime()-this.message.timestamp.getTime()>e.PUSH_TIMEOUT_MS:!1,headers:this.message.publicHeaders,domain:this.message.domain}}isFlagSet(t){var n,r;return!((n=this.message)===null||n===void 0)&&n.flags?(((r=this.message)===null||r===void 0?void 0:r.flags)&t)!=0:!1}};g0.DefaultNotificationResult=ns;ns.VIDEO_OFFERED_FLAG=1;ns.PUSH_TIMEOUT_MS=6e4});var bp=p(rb=>{"use strict";Object.defineProperty(rb,"__esModule",{value:!0})});var ib=p(it=>{"use strict";var wM=it&&it.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),Gi=it&&it.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&wM(t,e,n)};Object.defineProperty(it,"__esModule",{value:!0});Gi(Cp(),it);Gi(tb(),it);Gi(Id(),it);Gi(nb(),it);Gi(bp(),it);Gi(Rh(),it)});var ab=p(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.ClientEventFanout=void 0;var OM=xi(),DM=dn(),Ip=class extends OM.EventFanout{constructor(t){super(),this.client=t}listen(t,n){var r;switch(t.eventType){case"failed":n.onClientFailed(this.client,new DM.SinchError(t.context));break;case"started":n.onClientStarted(this.client);break;case"registration":n.onCredentialsRequired(this.client,t.context);break;case"terminated":(r=n.onClientStopped)===null||r===void 0||r.call(n,this.client);break}}hasListeners(){return this.listeners.length>0}};_0.ClientEventFanout=Ip});var ob=p(Zi=>{"use strict";var RM=Zi&&Zi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.CallReporter=void 0;var FM=qe(),PM=ue(),Oe=Xh(),Tp=class{constructor(t,n,r){this.userId=t,this.instance=n,this.apiClient=r}createCallReport(t,n,r,i,a,s){var u;let d=t.details,c=(u=d?.acceptingDuration)!==null&&u!==void 0?u:0;return{reportId:PM.StringHelper.UUID(),callId:t.id,userId:this.userId,result:Oe.CallReportUtils.getCallResult(t),errors:Oe.CallReportUtils.getClientErrors(d.error),from:Oe.CallReportUtils.getCallOrigin(t,this.userId),to:Oe.CallReportUtils.getCallDestination(t,this.userId),direction:Oe.CallReportUtils.getCallReportDirection(t),instance:Oe.CallReportUtils.getCallReportInstance(this.instance),duration:Oe.CallReportUtils.getDurationInSeconds(d.duration),setupDuration:Oe.CallReportUtils.getDurationInSeconds(d.setupDuration),notifyingDuration:Oe.CallReportUtils.getDurationInSeconds(d.notifyingDuration),ringingDuration:Oe.CallReportUtils.getDurationInSeconds(d.ringingDuration),acceptingDuration:Oe.CallReportUtils.getDurationInSeconds(c),connectingDuration:Oe.CallReportUtils.getDurationInSeconds(d.connectingDuration),hadAudioStreams:d.hadAudioStream,hadVideoStreams:d.hadVideoStream,requestedVideo:d.requestedVideo,requestedAudio:d.requestedAudio,localDomain:FM.Domain.Mxp,remoteDomain:Oe.CallReportUtils.getRemoteDomain(t),startTime:d.startedTime,connectionInfo:Oe.CallReportUtils.filterSubsequentSameConnectionInfos(r),primaryLocalIceCandidate:Oe.CallReportUtils.getPrimaryIceCandidate({connectionInfos:r,isLocal:!0}),primaryRemoteIceCandidate:Oe.CallReportUtils.getPrimaryIceCandidate({connectionInfos:r,isLocal:!1}),publicCallHeaders:t.headers,rtcStatisticsReport:n,clientEvents:a,mxpEventLog:s,callQuality:i}}submitCallReport(t,n,r,i,a,s){return RM(this,void 0,void 0,function*(){let u=this.createCallReport(t,n,r,i,a,s);yield this.apiClient.createCallReport({callReport:u},t.callApiBaseUrl)})}};Zi.CallReporter=Tp});var sb=p(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.CorrelationContext=void 0;var NM=ue(),Ap=class{constructor(t,n,r){this.userId=t,this.instanceId=n,this.callId=r}Append(t,n,r){return t.length>0&&(t=t.concat(",")),t=t.concat(n,"=",r),t}toHttpHeader(){let t="";return this.userId&&(t=this.Append(t,"userId",NM.Base64Helper.encode(this.userId))),this.instanceId&&(t=this.Append(t,"instanceId",this.instanceId)),this.callId&&(t=this.Append(t,"callId",this.callId)),t}};x0.CorrelationContext=Ap});var cb=p(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0})});var db=p(Qi=>{"use strict";var MM=Qi&&Qi.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.SinchRequestHeaders=void 0;var wp=class{constructor(t){this.requestHeaders=t,this.pre=n=>MM(this,void 0,void 0,function*(){for(let[r,i]of Object.entries(this.requestHeaders))n.init.headers[r]=i})}};Qi.SinchRequestHeaders=wp});var fb=p(qn=>{"use strict";var BM=qn&&qn.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),lb=qn&&qn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&BM(t,e,n)};Object.defineProperty(qn,"__esModule",{value:!0});lb(cb(),qn);lb(db(),qn)});var Pb=p((Sk,Xi)=>{"use strict";function $i(e){let t=e.length;for(;--t>=0;)e[t]=0}var qM=0,_b=1,kM=2,JM=3,LM=258,Mp=29,us=256,is=us+1+Mp,Yi=30,Bp=19,xb=2*is+1,Fr=15,Op=16,UM=7,qp=256,Sb=16,yb=17,Cb=18,Pp=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),S0=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),WM=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Eb=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),HM=512,nn=new Array((is+2)*2);$i(nn);var rs=new Array(Yi*2);$i(rs);var as=new Array(HM);$i(as);var os=new Array(LM-JM+1);$i(os);var kp=new Array(Mp);$i(kp);var y0=new Array(Yi);$i(y0);function Dp(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var bb,Ib,Tb;function Rp(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}var Ab=e=>e<256?as[e]:as[256+(e>>>7)],ss=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Ue=(e,t,n)=>{e.bi_valid>Op-n?(e.bi_buf|=t<<e.bi_valid&65535,ss(e,e.bi_buf),e.bi_buf=t>>Op-e.bi_valid,e.bi_valid+=n-Op):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Rt=(e,t,n)=>{Ue(e,n[t*2],n[t*2+1])},wb=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},VM=e=>{e.bi_valid===16?(ss(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},KM=(e,t)=>{let n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,u=t.stat_desc.extra_base,d=t.stat_desc.max_length,c,o,f,m,_,x,E=0;for(m=0;m<=Fr;m++)e.bl_count[m]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<xb;c++)o=e.heap[c],m=n[n[o*2+1]*2+1]+1,m>d&&(m=d,E++),n[o*2+1]=m,!(o>r)&&(e.bl_count[m]++,_=0,o>=u&&(_=s[o-u]),x=n[o*2],e.opt_len+=x*(m+_),a&&(e.static_len+=x*(i[o*2+1]+_)));if(E!==0){do{for(m=d-1;e.bl_count[m]===0;)m--;e.bl_count[m]--,e.bl_count[m+1]+=2,e.bl_count[d]--,E-=2}while(E>0);for(m=d;m!==0;m--)for(o=e.bl_count[m];o!==0;)f=e.heap[--c],!(f>r)&&(n[f*2+1]!==m&&(e.opt_len+=(m-n[f*2+1])*n[f*2],n[f*2+1]=m),o--)}},Ob=(e,t,n)=>{let r=new Array(Fr+1),i=0,a,s;for(a=1;a<=Fr;a++)i=i+n[a-1]<<1,r[a]=i;for(s=0;s<=t;s++){let u=e[s*2+1];u!==0&&(e[s*2]=wb(r[u]++,u))}},zM=()=>{let e,t,n,r,i,a=new Array(Fr+1);for(n=0,r=0;r<Mp-1;r++)for(kp[r]=n,e=0;e<1<<Pp[r];e++)os[n++]=r;for(os[n-1]=r,i=0,r=0;r<16;r++)for(y0[r]=i,e=0;e<1<<S0[r];e++)as[i++]=r;for(i>>=7;r<Yi;r++)for(y0[r]=i<<7,e=0;e<1<<S0[r]-7;e++)as[256+i++]=r;for(t=0;t<=Fr;t++)a[t]=0;for(e=0;e<=143;)nn[e*2+1]=8,e++,a[8]++;for(;e<=255;)nn[e*2+1]=9,e++,a[9]++;for(;e<=279;)nn[e*2+1]=7,e++,a[7]++;for(;e<=287;)nn[e*2+1]=8,e++,a[8]++;for(Ob(nn,is+1,a),e=0;e<Yi;e++)rs[e*2+1]=5,rs[e*2]=wb(e,5);bb=new Dp(nn,Pp,us+1,is,Fr),Ib=new Dp(rs,S0,0,Yi,Fr),Tb=new Dp(new Array(0),WM,0,Bp,UM)},Db=e=>{let t;for(t=0;t<is;t++)e.dyn_ltree[t*2]=0;for(t=0;t<Yi;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Bp;t++)e.bl_tree[t*2]=0;e.dyn_ltree[qp*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Rb=e=>{e.bi_valid>8?ss(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},hb=(e,t,n,r)=>{let i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]},Fp=(e,t,n)=>{let r=e.heap[n],i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&hb(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!hb(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},pb=(e,t,n)=>{let r,i,a=0,s,u;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+a++]&255,r+=(e.pending_buf[e.sym_buf+a++]&255)<<8,i=e.pending_buf[e.sym_buf+a++],r===0?Rt(e,i,t):(s=os[i],Rt(e,s+us+1,t),u=Pp[s],u!==0&&(i-=kp[s],Ue(e,i,u)),r--,s=Ab(r),Rt(e,s,n),u=S0[s],u!==0&&(r-=y0[s],Ue(e,r,u)));while(a<e.sym_next);Rt(e,qp,t)},Np=(e,t)=>{let n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,s,u,d=-1,c;for(e.heap_len=0,e.heap_max=xb,s=0;s<a;s++)n[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):n[s*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,n[c*2]=1,e.depth[c]=0,e.opt_len--,i&&(e.static_len-=r[c*2+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)Fp(e,n,s);c=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Fp(e,n,1),u=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=u,n[c*2]=n[s*2]+n[u*2],e.depth[c]=(e.depth[s]>=e.depth[u]?e.depth[s]:e.depth[u])+1,n[s*2+1]=n[u*2+1]=c,e.heap[1]=c++,Fp(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],KM(e,t),Ob(n,d,e.bl_count)},vb=(e,t,n)=>{let r,i=-1,a,s=t[1],u=0,d=7,c=4;for(s===0&&(d=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=s,s=t[(r+1)*2+1],!(++u<d&&a===s)&&(u<c?e.bl_tree[a*2]+=u:a!==0?(a!==i&&e.bl_tree[a*2]++,e.bl_tree[Sb*2]++):u<=10?e.bl_tree[yb*2]++:e.bl_tree[Cb*2]++,u=0,i=a,s===0?(d=138,c=3):a===s?(d=6,c=3):(d=7,c=4))},mb=(e,t,n)=>{let r,i=-1,a,s=t[1],u=0,d=7,c=4;for(s===0&&(d=138,c=3),r=0;r<=n;r++)if(a=s,s=t[(r+1)*2+1],!(++u<d&&a===s)){if(u<c)do Rt(e,a,e.bl_tree);while(--u!==0);else a!==0?(a!==i&&(Rt(e,a,e.bl_tree),u--),Rt(e,Sb,e.bl_tree),Ue(e,u-3,2)):u<=10?(Rt(e,yb,e.bl_tree),Ue(e,u-3,3)):(Rt(e,Cb,e.bl_tree),Ue(e,u-11,7));u=0,i=a,s===0?(d=138,c=3):a===s?(d=6,c=3):(d=7,c=4)}},GM=e=>{let t;for(vb(e,e.dyn_ltree,e.l_desc.max_code),vb(e,e.dyn_dtree,e.d_desc.max_code),Np(e,e.bl_desc),t=Bp-1;t>=3&&e.bl_tree[Eb[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},ZM=(e,t,n,r)=>{let i;for(Ue(e,t-257,5),Ue(e,n-1,5),Ue(e,r-4,4),i=0;i<r;i++)Ue(e,e.bl_tree[Eb[i]*2+1],3);mb(e,e.dyn_ltree,t-1),mb(e,e.dyn_dtree,n-1)},QM=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<us;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0},gb=!1,YM=e=>{gb||(zM(),gb=!0),e.l_desc=new Rp(e.dyn_ltree,bb),e.d_desc=new Rp(e.dyn_dtree,Ib),e.bl_desc=new Rp(e.bl_tree,Tb),e.bi_buf=0,e.bi_valid=0,Db(e)},Fb=(e,t,n,r)=>{Ue(e,(qM<<1)+(r?1:0),3),Rb(e),ss(e,n),ss(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},$M=e=>{Ue(e,_b<<1,3),Rt(e,qp,nn),VM(e)},XM=(e,t,n,r)=>{let i,a,s=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=QM(e)),Np(e,e.l_desc),Np(e,e.d_desc),s=GM(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?Fb(e,t,n,r):e.strategy===4||a===i?(Ue(e,(_b<<1)+(r?1:0),3),pb(e,nn,rs)):(Ue(e,(kM<<1)+(r?1:0),3),ZM(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),pb(e,e.dyn_ltree,e.dyn_dtree)),Db(e),r&&Rb(e)},jM=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(os[n]+us+1)*2]++,e.dyn_dtree[Ab(t)*2]++),e.sym_next===e.sym_end);Xi.exports._tr_init=YM;Xi.exports._tr_stored_block=Fb;Xi.exports._tr_flush_block=XM;Xi.exports._tr_tally=jM;Xi.exports._tr_align=$M});var Jp=p((yk,Nb)=>{"use strict";var e6=(e,t,n,r)=>{let i=e&65535|0,a=e>>>16&65535|0,s=0;for(;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[r++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0};Nb.exports=e6});var Lp=p((Ck,Mb)=>{"use strict";var t6=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},n6=new Uint32Array(t6()),r6=(e,t,n,r)=>{let i=n6,a=r+n;e^=-1;for(let s=r;s<a;s++)e=e>>>8^i[(e^t[s])&255];return e^-1};Mb.exports=r6});var C0=p((Ek,Bb)=>{"use strict";Bb.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var kn=p((bk,qb)=>{"use strict";qb.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var Gb=p((Ik,Mt)=>{"use strict";var{_tr_init:i6,_tr_stored_block:Hp,_tr_flush_block:a6,_tr_tally:Wn,_tr_align:o6}=Pb(),Ub=Jp(),Jn=Lp(),s6=C0(),{Z_NO_FLUSH:Hn,Z_PARTIAL_FLUSH:u6,Z_FULL_FLUSH:c6,Z_FINISH:at,Z_BLOCK:kb,Z_OK:Ie,Z_STREAM_END:Jb,Z_STREAM_ERROR:Pt,Z_DATA_ERROR:d6,Z_BUF_ERROR:Up,Z_DEFAULT_COMPRESSION:l6,Z_FILTERED:f6,Z_HUFFMAN_ONLY:E0,Z_RLE:h6,Z_FIXED:p6,Z_DEFAULT_STRATEGY:v6,Z_UNKNOWN:m6,Z_DEFLATED:b0}=kn(),g6=9,_6=15,x6=8,S6=29,y6=256,Vp=y6+1+S6,C6=30,E6=19,b6=2*Vp+1,I6=15,te=3,Un=258,Nt=Un+te+1,T6=32,ea=42,Yp=57,Kp=69,zp=73,Gp=91,Zp=103,Pr=113,ds=666,Ne=1,na=2,Mr=3,ra=4,A6=3,Nr=(e,t)=>(e.msg=s6[t],t),Lb=e=>e*2-(e>4?9:0),Ln=e=>{let t=e.length;for(;--t>=0;)e[t]=0},w6=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)},$p=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Br=(e,t)=>{let n;if(e.legacy_hash)n=e.ins_h=$p(e,e.ins_h,e.window[t+te-1]);else{let i=e.window,a=i[t]|i[t+1]<<8|i[t+2]<<16|i[t+3]<<24;n=e.ins_h=Math.imul(a,66521)+66521>>>16&e.hash_mask}let r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},Ze=e=>{let t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Qe=(e,t)=>{a6(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ze(e.strm)},ne=(e,t)=>{e.pending_buf[e.pending++]=t},cs=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},Qp=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=Ub(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Jn(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},Wb=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,a,s=e.prev_length,u=e.nice_match,d=e.strstart>e.w_size-Nt?e.strstart-(e.w_size-Nt):0,c=e.window,o=e.w_mask,f=e.prev,m=e.strstart+Un,_=c[r+s-1],x=c[r+s];e.prev_length>=e.good_match&&(n>>=2),u>e.lookahead&&(u=e.lookahead);do if(i=t,!(c[i+s]!==x||c[i+s-1]!==_||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&r<m);if(a=Un-(m-r),r=m-Un,a>s){if(e.match_start=t,s=a,a>=u)break;_=c[r+s-1],x=c[r+s]}}while((t=f[t&o])>d&&--n!==0);return s<=e.lookahead?s:e.lookahead},ta=e=>{let t=e.w_size,n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Nt)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),w6(e),r+=t),e.strm.avail_in===0)break;if(n=Qp(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.legacy_hash){if(e.lookahead+e.insert>=te)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=$p(e,e.ins_h,e.window[i+1]);e.insert&&(Br(e,i),i++,e.insert--,!(e.lookahead+e.insert<te)););}else if(e.lookahead+e.insert>te)for(i=e.strstart-e.insert;e.insert&&(Br(e,i),i++,e.insert--,!(e.lookahead+e.insert<=te)););}while(e.lookahead<Nt&&e.strm.avail_in!==0)},Hb=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,a,s=0,u=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a||(a=e.strm.avail_out-a,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>a&&(r=a),r<n&&(r===0&&t!==at||t===Hn||r!==i+e.strm.avail_in)))break;s=t===at&&r===i+e.strm.avail_in?1:0,Hp(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Ze(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(Qp(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(s===0);return u-=e.strm.avail_in,u&&(u>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=u&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-u,e.strm.next_in),e.strstart),e.strstart+=u,e.insert+=u>e.w_size-e.insert?e.w_size-e.insert:u),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?ra:t!==Hn&&t!==at&&e.strm.avail_in===0&&e.strstart===e.block_start?na:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(Qp(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,n=a>e.w_size?e.w_size:a,i=e.strstart-e.block_start,(i>=n||(i||t===at)&&t!==Hn&&e.strm.avail_in===0&&i<=a)&&(r=i>a?a:i,s=t===at&&e.strm.avail_in===0&&r===i?1:0,Hp(e,e.block_start,r,s),e.block_start+=r,Ze(e.strm)),s?Mr:Ne)},Wp=(e,t)=>{let n,r;for(;;){if(e.lookahead<Nt){if(ta(e),e.lookahead<Nt&&t===Hn)return Ne;if(e.lookahead===0)break}if(n=0,e.lookahead>=te&&(n=Br(e,e.strstart)),n!==0&&e.strstart-n<=e.w_size-Nt&&(e.match_length=Wb(e,n)),e.match_length>=te)if(r=Wn(e,e.strstart-e.match_start,e.match_length-te),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=te){e.match_length--;do e.strstart++,n=Br(e,e.strstart);while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=$p(e,e.ins_h,e.window[e.strstart+1]));else r=Wn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Qe(e,!1),e.strm.avail_out===0))return Ne}return e.insert=e.strstart<te-1?e.strstart:te-1,t===at?(Qe(e,!0),e.strm.avail_out===0?Mr:ra):e.sym_next&&(Qe(e,!1),e.strm.avail_out===0)?Ne:na},ji=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Nt){if(ta(e),e.lookahead<Nt&&t===Hn)return Ne;if(e.lookahead===0)break}if(n=0,e.lookahead>=te&&(n=Br(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=te-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Nt&&(e.match_length=Wb(e,n),e.match_length<=5&&(e.strategy===f6||e.match_length===te&&e.strstart-e.match_start>4096)&&(e.match_length=te-1)),e.prev_length>=te&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-te,r=Wn(e,e.strstart-1-e.prev_match,e.prev_length-te),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(n=Br(e,e.strstart));while(--e.prev_length!==0);if(e.match_available=0,e.match_length=te-1,e.strstart++,r&&(Qe(e,!1),e.strm.avail_out===0))return Ne}else if(e.match_available){if(r=Wn(e,0,e.window[e.strstart-1]),r&&Qe(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ne}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Wn(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<te-1?e.strstart:te-1,t===at?(Qe(e,!0),e.strm.avail_out===0?Mr:ra):e.sym_next&&(Qe(e,!1),e.strm.avail_out===0)?Ne:na},O6=(e,t)=>{let n,r,i,a,s=e.window;for(;;){if(e.lookahead<=Un){if(ta(e),e.lookahead<=Un&&t===Hn)return Ne;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=te&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=e.strstart+Un;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=Un-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=te?(n=Wn(e,1,e.match_length-te),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Wn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Qe(e,!1),e.strm.avail_out===0))return Ne}return e.insert=0,t===at?(Qe(e,!0),e.strm.avail_out===0?Mr:ra):e.sym_next&&(Qe(e,!1),e.strm.avail_out===0)?Ne:na},D6=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(ta(e),e.lookahead===0)){if(t===Hn)return Ne;break}if(e.match_length=0,n=Wn(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Qe(e,!1),e.strm.avail_out===0))return Ne}return e.insert=0,t===at?(Qe(e,!0),e.strm.avail_out===0?Mr:ra):e.sym_next&&(Qe(e,!1),e.strm.avail_out===0)?Ne:na};function Ft(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var ls=[new Ft(0,0,0,0,Hb),new Ft(4,4,8,4,Wp),new Ft(4,5,16,8,Wp),new Ft(4,6,32,32,Wp),new Ft(4,4,16,16,ji),new Ft(8,16,32,32,ji),new Ft(8,16,128,128,ji),new Ft(8,32,128,256,ji),new Ft(32,128,258,1024,ji),new Ft(32,258,258,4096,ji)],R6=e=>{e.window_size=2*e.w_size,Ln(e.head),e.max_lazy_match=ls[e.level].max_lazy,e.good_match=ls[e.level].good_length,e.nice_match=ls[e.level].nice_length,e.max_chain_length=ls[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=te-1,e.match_available=0,e.ins_h=0};function F6(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b0,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(b6*2),this.dyn_dtree=new Uint16Array((2*C6+1)*2),this.bl_tree=new Uint16Array((2*E6+1)*2),Ln(this.dyn_ltree),Ln(this.dyn_dtree),Ln(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(I6+1),this.heap=new Uint16Array(2*Vp+1),Ln(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Vp+1),Ln(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var fs=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==ea&&t.status!==Yp&&t.status!==Kp&&t.status!==zp&&t.status!==Gp&&t.status!==Zp&&t.status!==Pr&&t.status!==ds?1:0},Vb=e=>{if(fs(e))return Nr(e,Pt);e.total_in=e.total_out=0,e.data_type=m6;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Yp:t.wrap?ea:Pr,e.adler=t.wrap===2?0:1,t.last_flush=-2,i6(t),Ie},Kb=e=>{let t=Vb(e);return t===Ie&&R6(e.state),t},P6=(e,t)=>fs(e)||e.state.wrap!==2?Pt:(e.state.gzhead=t,Ie),zb=(e,t,n,r,i,a,s)=>{if(!e)return Pt;let u=1;if(t===l6&&(t=6),r<0?(u=0,r=-r):r>15&&(u=2,r-=16),i<1||i>g6||n!==b0||r<8||r>15||t<0||t>9||a<0||a>p6||r===8&&u!==1)return Nr(e,Pt);r===8&&(r=9);let d=new F6;return e.state=d,d.strm=e,d.status=ea,d.wrap=u,d.gzhead=null,d.w_bits=r,d.w_size=1<<d.w_bits,d.w_mask=d.w_size-1,d.legacy_hash=s?1:0,d.hash_bits=i+7,!d.legacy_hash&&d.hash_bits<15&&(d.hash_bits=15),d.hash_size=1<<d.hash_bits,d.hash_mask=d.hash_size-1,d.hash_shift=~~((d.hash_bits+te-1)/te),d.window=new Uint8Array(d.w_size*2),d.head=new Uint16Array(d.hash_size),d.prev=new Uint16Array(d.w_size),d.lit_bufsize=1<<i+6,d.pending_buf_size=d.lit_bufsize*4,d.pending_buf=new Uint8Array(d.pending_buf_size),d.sym_buf=d.lit_bufsize,d.sym_end=(d.lit_bufsize-1)*3,d.level=t,d.strategy=a,d.method=n,Kb(e)},N6=(e,t)=>zb(e,t,b0,_6,x6,v6),M6=(e,t)=>{if(fs(e)||t>kb||t<0)return e?Nr(e,Pt):Pt;let n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===ds&&t!==at)return Nr(e,e.avail_out===0?Up:Pt);let r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Ze(e),e.avail_out===0)return n.last_flush=-1,Ie}else if(e.avail_in===0&&Lb(t)<=Lb(r)&&t!==at)return Nr(e,Up);if(n.status===ds&&e.avail_in!==0)return Nr(e,Up);if(n.status===ea&&n.wrap===0&&(n.status=Pr),n.status===ea){let i=b0+(n.w_bits-8<<4)<<8,a=-1;if(n.strategy>=E0||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=T6),i+=31-i%31,cs(n,i),n.strstart!==0&&(cs(n,e.adler>>>16),cs(n,e.adler&65535)),e.adler=1,n.status=Pr,Ze(e),n.pending!==0)return n.last_flush=-1,Ie}if(n.status===Yp){if(e.adler=0,ne(n,31),ne(n,139),ne(n,8),n.gzhead)ne(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),ne(n,n.gzhead.time&255),ne(n,n.gzhead.time>>8&255),ne(n,n.gzhead.time>>16&255),ne(n,n.gzhead.time>>24&255),ne(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),ne(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(ne(n,n.gzhead.extra.length&255),ne(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Jn(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Kp;else if(ne(n,0),ne(n,0),ne(n,0),ne(n,0),ne(n,0),ne(n,n.level===9?2:n.strategy>=E0||n.level<2?4:0),ne(n,A6),n.status=Pr,Ze(e),n.pending!==0)return n.last_flush=-1,Ie}if(n.status===Kp){if(n.gzhead.extra){let i=n.pending,a=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+a>n.pending_buf_size;){let u=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+u),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=u,Ze(e),n.pending!==0)return n.last_flush=-1,Ie;i=0,a-=u}let s=new Uint8Array(n.gzhead.extra);n.pending_buf.set(s.subarray(n.gzindex,n.gzindex+a),n.pending),n.pending+=a,n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=zp}if(n.status===zp){if(n.gzhead.name){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i)),Ze(e),n.pending!==0)return n.last_flush=-1,Ie;i=0}n.gzindex<n.gzhead.name.length?a=n.gzhead.name.charCodeAt(n.gzindex++)&255:a=0,ne(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=Gp}if(n.status===Gp){if(n.gzhead.comment){let i=n.pending,a;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i)),Ze(e),n.pending!==0)return n.last_flush=-1,Ie;i=0}n.gzindex<n.gzhead.comment.length?a=n.gzhead.comment.charCodeAt(n.gzindex++)&255:a=0,ne(n,a)}while(a!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=Jn(e.adler,n.pending_buf,n.pending-i,i))}n.status=Zp}if(n.status===Zp){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Ze(e),n.pending!==0))return n.last_flush=-1,Ie;ne(n,e.adler&255),ne(n,e.adler>>8&255),e.adler=0}if(n.status=Pr,Ze(e),n.pending!==0)return n.last_flush=-1,Ie}if(e.avail_in!==0||n.lookahead!==0||t!==Hn&&n.status!==ds){let i=n.level===0?Hb(n,t):n.strategy===E0?D6(n,t):n.strategy===h6?O6(n,t):ls[n.level].func(n,t);if((i===Mr||i===ra)&&(n.status=ds),i===Ne||i===Mr)return e.avail_out===0&&(n.last_flush=-1),Ie;if(i===na&&(t===u6?o6(n):t!==kb&&(Hp(n,0,0,!1),t===c6&&(Ln(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Ze(e),e.avail_out===0))return n.last_flush=-1,Ie}return t!==at?Ie:n.wrap<=0?Jb:(n.wrap===2?(ne(n,e.adler&255),ne(n,e.adler>>8&255),ne(n,e.adler>>16&255),ne(n,e.adler>>24&255),ne(n,e.total_in&255),ne(n,e.total_in>>8&255),ne(n,e.total_in>>16&255),ne(n,e.total_in>>24&255)):(cs(n,e.adler>>>16),cs(n,e.adler&65535)),Ze(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ie:Jb)},B6=e=>{if(fs(e))return Pt;let t=e.state.status;return e.state=null,t===Pr?Nr(e,d6):Ie},q6=(e,t)=>{let n=t.length;if(fs(e))return Pt;let r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==ea||r.lookahead)return Pt;if(i===1&&(e.adler=Ub(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(Ln(r.head),r.strstart=0,r.block_start=0,r.insert=0);let d=new Uint8Array(r.w_size);d.set(t.subarray(n-r.w_size,n),0),t=d,n=r.w_size}let a=e.avail_in,s=e.next_in,u=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,ta(r);r.lookahead>=te;){let d=r.strstart,c=r.lookahead-(te-1);do Br(r,d),d++;while(--c);r.strstart=d,r.lookahead=te-1,ta(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=te-1,r.match_available=0,e.next_in=s,e.input=u,e.avail_in=a,r.wrap=i,Ie};Mt.exports.deflateInit=N6;Mt.exports.deflateInit2=zb;Mt.exports.deflateReset=Kb;Mt.exports.deflateResetKeep=Vb;Mt.exports.deflateSetHeader=P6;Mt.exports.deflate=M6;Mt.exports.deflateEnd=B6;Mt.exports.deflateSetDictionary=q6;Mt.exports.deflateInfo="pako deflate (from Nodeca project)"});var jp=p((Tk,Xp)=>{"use strict";var k6=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);Xp.exports.assign=function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(let r in n)k6(n,r)&&(e[r]=n[r])}}return e};Xp.exports.flattenChunks=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;let n=new Uint8Array(t);for(let r=0,i=0,a=e.length;r<a;r++){let s=e[r];n.set(s,i),i+=s.length}return n}});var ev=p((Ak,I0)=>{"use strict";var Zb=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Zb=!1}var hs=new Uint8Array(256);for(let e=0;e<256;e++)hs[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;hs[254]=hs[255]=1;I0.exports.string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,a,s=e.length,u=0;for(i=0;i<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(u),a=0,i=0;a<u;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<s&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};var J6=(e,t)=>{if(t<65534&&e.subarray&&Zb)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};I0.exports.buf2string=(e,t)=>{let n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i,a=new Array(n*2);for(i=0,r=0;r<n;){let s=e[r++];if(s<128){a[i++]=s;continue}let u=hs[s];if(u>4){a[i++]=65533,r+=u-1;continue}for(s&=u===2?31:u===3?15:7;u>1&&r<n;)s=s<<6|e[r++]&63,u--;if(u>1){a[i++]=65533;continue}s<65536?a[i++]=s:(s-=65536,a[i++]=55296|s>>10&1023,a[i++]=56320|s&1023)}return J6(a,i)};I0.exports.utf8border=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+hs[e[n]]>t?n:t}});var tv=p((wk,Qb)=>{"use strict";function L6(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Qb.exports=L6});var jb=p((Ok,ia)=>{"use strict";var ps=Gb(),Yb=jp(),$b=ev(),nv=C0(),U6=tv(),Xb=Object.prototype.toString,{Z_NO_FLUSH:W6,Z_SYNC_FLUSH:H6,Z_FULL_FLUSH:V6,Z_FINISH:K6,Z_OK:T0,Z_STREAM_END:z6,Z_DEFAULT_COMPRESSION:G6,Z_DEFAULT_STRATEGY:Z6,Z_DEFLATED:Q6}=kn(),Y6={level:G6,method:Q6,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z6,legacyHash:!0};function vs(e){this.options=Yb.assign({},Y6,e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new U6,this.strm.avail_out=0;let n=ps.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy,t.legacyHash);if(n!==T0)throw new Error(nv[n]);if(t.header&&ps.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=$b.string2buf(t.dictionary):Xb.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=ps.deflateSetDictionary(this.strm,r),n!==T0)throw new Error(nv[n]);this._dict_set=!0}}vs.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?K6:W6,typeof e=="string"?n.input=$b.string2buf(e):Xb.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(a===H6||a===V6)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=ps.deflate(n,a),i===z6)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=ps.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===T0;if(n.avail_out===0){this.onData(n.output);continue}if(a>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};vs.prototype.onData=function(e){this.chunks.push(e)};vs.prototype.onEnd=function(e){e===T0&&(this.result=Yb.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function rv(e,t){let n=new vs(t);if(n.push(e,!0),n.err)throw n.msg||nv[n.err];return n.result}function $6(e,t){return t=t||{},t.raw=!0,rv(e,t)}function X6(e,t){return t=t||{},t.gzip=!0,rv(e,t)}ia.exports.Deflate=vs;ia.exports.deflate=rv;ia.exports.deflateRaw=$6;ia.exports.gzip=X6;ia.exports.constants=kn()});var tI=p((Dk,eI)=>{"use strict";eI.exports=function(t,n){let r,i,a,s,u,d,c,o,f,m,_,x,E,C,v,g,y,S,b,I,A,w,O,D,T=t.state;r=t.next_in,O=t.input,i=r+(t.avail_in-5),a=t.next_out,D=t.output,s=a-(n-t.avail_out),u=a+(t.avail_out-257),d=T.dmax,c=T.wsize,o=T.whave,f=T.wnext,m=T.window,_=T.hold,x=T.bits,E=T.lencode,C=T.distcode,v=(1<<T.lenbits)-1,g=(1<<T.distbits)-1;e:do{x<15&&(_+=O[r++]<<x,x+=8,_+=O[r++]<<x,x+=8),y=E[_&v];t:for(;;){if(S=y>>>24,_>>>=S,x-=S,S=y>>>16&255,S===0)D[a++]=y&65535;else if(S&16){b=y&65535,S&=15,S&&(x<S&&(_+=O[r++]<<x,x+=8),b+=_&(1<<S)-1,_>>>=S,x-=S),x<15&&(_+=O[r++]<<x,x+=8,_+=O[r++]<<x,x+=8),y=C[_&g];n:for(;;){if(S=y>>>24,_>>>=S,x-=S,S=y>>>16&255,S&16){if(I=y&65535,S&=15,x<S&&(_+=O[r++]<<x,x+=8,x<S&&(_+=O[r++]<<x,x+=8)),I+=_&(1<<S)-1,I>d){t.msg="invalid distance too far back",T.mode=16209;break e}if(_>>>=S,x-=S,S=a-s,I>S){if(S=I-S,S>o&&T.sane){t.msg="invalid distance too far back",T.mode=16209;break e}if(A=0,w=m,f===0){if(A+=c-S,S<b){b-=S;do D[a++]=m[A++];while(--S);A=a-I,w=D}}else if(f<S){if(A+=c+f-S,S-=f,S<b){b-=S;do D[a++]=m[A++];while(--S);if(A=0,f<b){S=f,b-=S;do D[a++]=m[A++];while(--S);A=a-I,w=D}}}else if(A+=f-S,S<b){b-=S;do D[a++]=m[A++];while(--S);A=a-I,w=D}for(;b>2;)D[a++]=w[A++],D[a++]=w[A++],D[a++]=w[A++],b-=3;b&&(D[a++]=w[A++],b>1&&(D[a++]=w[A++]))}else{A=a-I;do D[a++]=D[A++],D[a++]=D[A++],D[a++]=D[A++],b-=3;while(b>2);b&&(D[a++]=D[A++],b>1&&(D[a++]=D[A++]))}}else if((S&64)===0){y=C[(y&65535)+(_&(1<<S)-1)];continue n}else{t.msg="invalid distance code",T.mode=16209;break e}break}}else if((S&64)===0){y=E[(y&65535)+(_&(1<<S)-1)];continue t}else if(S&32){T.mode=16191;break e}else{t.msg="invalid literal/length code",T.mode=16209;break e}break}}while(r<i&&a<u);b=x>>3,r-=b,x-=b<<3,_&=(1<<x)-1,t.next_in=r,t.next_out=a,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=a<u?257+(u-a):257-(a-u),T.hold=_,T.bits=x}});var rI=p((Rk,nI)=>{"use strict";var j6=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),e3=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),t3=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),n3=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),r3=(e,t,n,r,i,a,s,u)=>{let d=u.bits,c=0,o=0,f=0,m=0,_=0,x=0,E=0,C=0,v=0,g=0,y,S,b,I,A,w=null,O,D=new Uint16Array(16),T=new Uint16Array(16),N=null,J,F,V;for(c=0;c<=15;c++)D[c]=0;for(o=0;o<r;o++)D[t[n+o]]++;for(_=d,m=15;m>=1&&D[m]===0;m--);if(_>m&&(_=m),m===0)return i[a++]=1<<24|64<<16|0,i[a++]=1<<24|64<<16|0,u.bits=1,0;for(f=1;f<m&&D[f]===0;f++);for(_<f&&(_=f),C=1,c=1;c<=15;c++)if(C<<=1,C-=D[c],C<0)return-1;if(C>0&&(e===0||m!==1))return-1;for(T[1]=0,c=1;c<15;c++)T[c+1]=T[c]+D[c];for(o=0;o<r;o++)t[n+o]!==0&&(s[T[t[n+o]]++]=o);if(e===0?(w=N=s,O=20):e===1?(w=j6,N=e3,O=257):(w=t3,N=n3,O=0),g=0,o=0,c=f,A=a,x=_,E=0,b=-1,v=1<<_,I=v-1,e===1&&v>852||e===2&&v>592)return 1;for(;;){J=c-E,s[o]+1<O?(F=0,V=s[o]):s[o]>=O?(F=N[s[o]-O],V=w[s[o]-O]):(F=96,V=0),y=1<<c-E,S=1<<x,f=S;do S-=y,i[A+(g>>E)+S]=J<<24|F<<16|V|0;while(S!==0);for(y=1<<c-1;g&y;)y>>=1;if(y!==0?(g&=y-1,g+=y):g=0,o++,--D[c]===0){if(c===m)break;c=t[n+s[o]]}if(c>_&&(g&I)!==b){for(E===0&&(E=_),A+=f,x=c-E,C=1<<x;x+E<m&&(C-=D[x+E],!(C<=0));)x++,C<<=1;if(v+=1<<x,e===1&&v>852||e===2&&v>592)return 1;b=g&I,i[b]=_<<24|x<<16|A-a|0}}return g!==0&&(i[A+g]=c-E<<24|64<<16|0),u.bits=_,0};nI.exports=r3});var kI=p((Fk,gt)=>{"use strict";var cv=Jp(),Bt=Lp(),i3=tI(),ms=rI(),a3=0,OI=1,DI=2,{Z_FINISH:iI,Z_BLOCK:o3,Z_TREES:A0,Z_OK:qr,Z_STREAM_END:s3,Z_NEED_DICT:u3,Z_STREAM_ERROR:ot,Z_DATA_ERROR:RI,Z_MEM_ERROR:dv,Z_BUF_ERROR:c3,Z_DEFLATED:aI}=kn(),R0=16180,oI=16181,sI=16182,uI=16183,cI=16184,dI=16185,lI=16186,fI=16187,hI=16188,pI=16189,D0=16190,rn=16191,iv=16192,vI=16193,av=16194,mI=16195,gI=16196,_I=16197,xI=16198,w0=16199,O0=16200,SI=16201,yI=16202,CI=16203,EI=16204,bI=16205,ov=16206,II=16207,TI=16208,fe=16209,lv=16210,FI=16211,d3=852,l3=592,f3=15,h3=f3,AI=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function p3(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var kr=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<R0||t.mode>FI?1:0},PI=e=>{if(kr(e))return ot;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=R0,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(d3),t.distcode=t.distdyn=new Int32Array(l3),t.sane=1,t.back=-1,qr},NI=e=>{if(kr(e))return ot;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,PI(e)},MI=(e,t)=>{let n;if(kr(e))return ot;let r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ot:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,NI(e))},BI=(e,t)=>{if(!e)return ot;let n=new p3;e.state=n,n.strm=e,n.window=null,n.mode=R0;let r=MI(e,t);return r!==qr&&(e.state=null),r},v3=e=>BI(e,h3),wI=!0,sv,uv,m3=e=>{if(wI){sv=new Int32Array(512),uv=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ms(OI,e.lens,0,288,sv,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ms(DI,e.lens,0,32,uv,0,e.work,{bits:5}),wI=!1}e.lencode=sv,e.lenbits=9,e.distcode=uv,e.distbits=5},qI=(e,t,n,r)=>{let i,a=e.state;return a.window===null&&(a.window=new Uint8Array(1<<a.wbits)),a.wsize===0&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0),r>=a.wsize?(a.window.set(t.subarray(n-a.wsize,n),0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),a.window.set(t.subarray(n-r,n-r+i),a.wnext),r-=i,r?(a.window.set(t.subarray(n-r,n),0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0},g3=(e,t)=>{let n,r,i,a,s,u,d,c,o,f,m,_,x,E,C=0,v,g,y,S,b,I,A,w,O=new Uint8Array(4),D,T,N=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(kr(e)||!e.output||!e.input&&e.avail_in!==0)return ot;n=e.state,n.mode===rn&&(n.mode=iv),s=e.next_out,i=e.output,d=e.avail_out,a=e.next_in,r=e.input,u=e.avail_in,c=n.hold,o=n.bits,f=u,m=d,w=qr;e:for(;;)switch(n.mode){case R0:if(n.wrap===0){n.mode=iv;break}for(;o<16;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(n.wrap&2&&c===35615){n.wbits===0&&(n.wbits=15),n.check=0,O[0]=c&255,O[1]=c>>>8&255,n.check=Bt(n.check,O,2,0),c=0,o=0,n.mode=oI;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=fe;break}if((c&15)!==aI){e.msg="unknown compression method",n.mode=fe;break}if(c>>>=4,o-=4,A=(c&15)+8,n.wbits===0&&(n.wbits=A),A>15||A>n.wbits){e.msg="invalid window size",n.mode=fe;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=c&512?pI:rn,c=0,o=0;break;case oI:for(;o<16;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(n.flags=c,(n.flags&255)!==aI){e.msg="unknown compression method",n.mode=fe;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=fe;break}n.head&&(n.head.text=c>>8&1),n.flags&512&&n.wrap&4&&(O[0]=c&255,O[1]=c>>>8&255,n.check=Bt(n.check,O,2,0)),c=0,o=0,n.mode=sI;case sI:for(;o<32;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.head&&(n.head.time=c),n.flags&512&&n.wrap&4&&(O[0]=c&255,O[1]=c>>>8&255,O[2]=c>>>16&255,O[3]=c>>>24&255,n.check=Bt(n.check,O,4,0)),c=0,o=0,n.mode=uI;case uI:for(;o<16;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.head&&(n.head.xflags=c&255,n.head.os=c>>8),n.flags&512&&n.wrap&4&&(O[0]=c&255,O[1]=c>>>8&255,n.check=Bt(n.check,O,2,0)),c=0,o=0,n.mode=cI;case cI:if(n.flags&1024){for(;o<16;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.length=c,n.head&&(n.head.extra_len=c),n.flags&512&&n.wrap&4&&(O[0]=c&255,O[1]=c>>>8&255,n.check=Bt(n.check,O,2,0)),c=0,o=0}else n.head&&(n.head.extra=null);n.mode=dI;case dI:if(n.flags&1024&&(_=n.length,_>u&&(_=u),_&&(n.head&&(A=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(a,a+_),A)),n.flags&512&&n.wrap&4&&(n.check=Bt(n.check,r,_,a)),u-=_,a+=_,n.length-=_),n.length))break e;n.length=0,n.mode=lI;case lI:if(n.flags&2048){if(u===0)break e;_=0;do A=r[a+_++],n.head&&A&&n.length<65536&&(n.head.name+=String.fromCharCode(A));while(A&&_<u);if(n.flags&512&&n.wrap&4&&(n.check=Bt(n.check,r,_,a)),u-=_,a+=_,A)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=fI;case fI:if(n.flags&4096){if(u===0)break e;_=0;do A=r[a+_++],n.head&&A&&n.length<65536&&(n.head.comment+=String.fromCharCode(A));while(A&&_<u);if(n.flags&512&&n.wrap&4&&(n.check=Bt(n.check,r,_,a)),u-=_,a+=_,A)break e}else n.head&&(n.head.comment=null);n.mode=hI;case hI:if(n.flags&512){for(;o<16;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(n.wrap&4&&c!==(n.check&65535)){e.msg="header crc mismatch",n.mode=fe;break}c=0,o=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=rn;break;case pI:for(;o<32;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}e.adler=n.check=AI(c),c=0,o=0,n.mode=D0;case D0:if(n.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=u,n.hold=c,n.bits=o,u3;e.adler=n.check=1,n.mode=rn;case rn:if(t===o3||t===A0)break e;case iv:if(n.last){c>>>=o&7,o-=o&7,n.mode=ov;break}for(;o<3;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}switch(n.last=c&1,c>>>=1,o-=1,c&3){case 0:n.mode=vI;break;case 1:if(m3(n),n.mode=w0,t===A0){c>>>=2,o-=2;break e}break;case 2:n.mode=gI;break;case 3:e.msg="invalid block type",n.mode=fe}c>>>=2,o-=2;break;case vI:for(c>>>=o&7,o-=o&7;o<32;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=fe;break}if(n.length=c&65535,c=0,o=0,n.mode=av,t===A0)break e;case av:n.mode=mI;case mI:if(_=n.length,_){if(_>u&&(_=u),_>d&&(_=d),_===0)break e;i.set(r.subarray(a,a+_),s),u-=_,a+=_,d-=_,s+=_,n.length-=_;break}n.mode=rn;break;case gI:for(;o<14;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(n.nlen=(c&31)+257,c>>>=5,o-=5,n.ndist=(c&31)+1,c>>>=5,o-=5,n.ncode=(c&15)+4,c>>>=4,o-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=fe;break}n.have=0,n.mode=_I;case _I:for(;n.have<n.ncode;){for(;o<3;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.lens[N[n.have++]]=c&7,c>>>=3,o-=3}for(;n.have<19;)n.lens[N[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,D={bits:n.lenbits},w=ms(a3,n.lens,0,19,n.lencode,0,n.work,D),n.lenbits=D.bits,w){e.msg="invalid code lengths set",n.mode=fe;break}n.have=0,n.mode=xI;case xI:for(;n.have<n.nlen+n.ndist;){for(;C=n.lencode[c&(1<<n.lenbits)-1],v=C>>>24,g=C>>>16&255,y=C&65535,!(v<=o);){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(y<16)c>>>=v,o-=v,n.lens[n.have++]=y;else{if(y===16){for(T=v+2;o<T;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(c>>>=v,o-=v,n.have===0){e.msg="invalid bit length repeat",n.mode=fe;break}A=n.lens[n.have-1],_=3+(c&3),c>>>=2,o-=2}else if(y===17){for(T=v+3;o<T;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}c>>>=v,o-=v,A=0,_=3+(c&7),c>>>=3,o-=3}else{for(T=v+7;o<T;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}c>>>=v,o-=v,A=0,_=11+(c&127),c>>>=7,o-=7}if(n.have+_>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=fe;break}for(;_--;)n.lens[n.have++]=A}}if(n.mode===fe)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=fe;break}if(n.lenbits=9,D={bits:n.lenbits},w=ms(OI,n.lens,0,n.nlen,n.lencode,0,n.work,D),n.lenbits=D.bits,w){e.msg="invalid literal/lengths set",n.mode=fe;break}if(n.distbits=6,n.distcode=n.distdyn,D={bits:n.distbits},w=ms(DI,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,D),n.distbits=D.bits,w){e.msg="invalid distances set",n.mode=fe;break}if(n.mode=w0,t===A0)break e;case w0:n.mode=O0;case O0:if(u>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=u,n.hold=c,n.bits=o,i3(e,m),s=e.next_out,i=e.output,d=e.avail_out,a=e.next_in,r=e.input,u=e.avail_in,c=n.hold,o=n.bits,n.mode===rn&&(n.back=-1);break}for(n.back=0;C=n.lencode[c&(1<<n.lenbits)-1],v=C>>>24,g=C>>>16&255,y=C&65535,!(v<=o);){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(g&&(g&240)===0){for(S=v,b=g,I=y;C=n.lencode[I+((c&(1<<S+b)-1)>>S)],v=C>>>24,g=C>>>16&255,y=C&65535,!(S+v<=o);){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}c>>>=S,o-=S,n.back+=S}if(c>>>=v,o-=v,n.back+=v,n.length=y,g===0){n.mode=bI;break}if(g&32){n.back=-1,n.mode=rn;break}if(g&64){e.msg="invalid literal/length code",n.mode=fe;break}n.extra=g&15,n.mode=SI;case SI:if(n.extra){for(T=n.extra;o<T;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,o-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=yI;case yI:for(;C=n.distcode[c&(1<<n.distbits)-1],v=C>>>24,g=C>>>16&255,y=C&65535,!(v<=o);){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if((g&240)===0){for(S=v,b=g,I=y;C=n.distcode[I+((c&(1<<S+b)-1)>>S)],v=C>>>24,g=C>>>16&255,y=C&65535,!(S+v<=o);){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}c>>>=S,o-=S,n.back+=S}if(c>>>=v,o-=v,n.back+=v,g&64){e.msg="invalid distance code",n.mode=fe;break}n.offset=y,n.extra=g&15,n.mode=CI;case CI:if(n.extra){for(T=n.extra;o<T;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,o-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=fe;break}n.mode=EI;case EI:if(d===0)break e;if(_=m-d,n.offset>_){if(_=n.offset-_,_>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=fe;break}_>n.wnext?(_-=n.wnext,x=n.wsize-_):x=n.wnext-_,_>n.length&&(_=n.length),E=n.window}else E=i,x=s-n.offset,_=n.length;_>d&&(_=d),d-=_,n.length-=_;do i[s++]=E[x++];while(--_);n.length===0&&(n.mode=O0);break;case bI:if(d===0)break e;i[s++]=n.length,d--,n.mode=O0;break;case ov:if(n.wrap){for(;o<32;){if(u===0)break e;u--,c|=r[a++]<<o,o+=8}if(m-=d,e.total_out+=m,n.total+=m,n.wrap&4&&m&&(e.adler=n.check=n.flags?Bt(n.check,i,m,s-m):cv(n.check,i,m,s-m)),m=d,n.wrap&4&&(n.flags?c:AI(c))!==n.check){e.msg="incorrect data check",n.mode=fe;break}c=0,o=0}n.mode=II;case II:if(n.wrap&&n.flags){for(;o<32;){if(u===0)break e;u--,c+=r[a++]<<o,o+=8}if(n.wrap&4&&c!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=fe;break}c=0,o=0}n.mode=TI;case TI:w=s3;break e;case fe:w=RI;break e;case lv:return dv;case FI:default:return ot}return e.next_out=s,e.avail_out=d,e.next_in=a,e.avail_in=u,n.hold=c,n.bits=o,(n.wsize||m!==e.avail_out&&n.mode<fe&&(n.mode<ov||t!==iI))&&qI(e,e.output,e.next_out,m-e.avail_out)?(n.mode=lv,dv):(f-=e.avail_in,m-=e.avail_out,e.total_in+=f,e.total_out+=m,n.total+=m,n.wrap&4&&m&&(e.adler=n.check=n.flags?Bt(n.check,i,m,e.next_out-m):cv(n.check,i,m,e.next_out-m)),e.data_type=n.bits+(n.last?64:0)+(n.mode===rn?128:0)+(n.mode===w0||n.mode===av?256:0),(f===0&&m===0||t===iI)&&w===qr&&(w=c3),w)},_3=e=>{if(kr(e))return ot;let t=e.state;return t.window&&(t.window=null),e.state=null,qr},x3=(e,t)=>{if(kr(e))return ot;let n=e.state;return(n.wrap&2)===0?ot:(n.head=t,t.done=!1,qr)},S3=(e,t)=>{let n=t.length,r,i,a;return kr(e)||(r=e.state,r.wrap!==0&&r.mode!==D0)?ot:r.mode===D0&&(i=1,i=cv(i,t,n,0),i!==r.check)?RI:(a=qI(e,t,n,n),a?(r.mode=lv,dv):(r.havedict=1,qr))};gt.exports.inflateReset=NI;gt.exports.inflateReset2=MI;gt.exports.inflateResetKeep=PI;gt.exports.inflateInit=v3;gt.exports.inflateInit2=BI;gt.exports.inflate=g3;gt.exports.inflateEnd=_3;gt.exports.inflateGetHeader=x3;gt.exports.inflateSetDictionary=S3;gt.exports.inflateInfo="pako inflate (from Nodeca project)"});var LI=p((Pk,JI)=>{"use strict";function y3(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}JI.exports=y3});var zI=p((Nk,oa)=>{"use strict";var qt=kI(),VI=jp(),pv=ev(),vv=C0(),C3=tv(),E3=LI(),KI=Object.prototype.toString,{Z_NO_FLUSH:b3,Z_FINISH:UI,Z_OK:aa,Z_STREAM_END:fv,Z_NEED_DICT:hv,Z_STREAM_ERROR:I3,Z_DATA_ERROR:WI,Z_MEM_ERROR:T3,Z_BUF_ERROR:HI}=kn(),A3={chunkSize:1024*64,windowBits:15,to:""};function gs(e){this.options=VI.assign({},A3,e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new C3,this.strm.avail_out=0;let n=qt.inflateInit2(this.strm,t.windowBits);if(n!==aa)throw new Error(vv[n]);if(this.header=new E3,qt.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=pv.string2buf(t.dictionary):KI.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=qt.inflateSetDictionary(this.strm,t.dictionary),n!==aa)))throw new Error(vv[n])}gs.prototype.push=function(e,t){let n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,s,u;if(this.ended)return!1;for(t===~~t?s=t:s=t===!0?UI:b3,KI.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),a=qt.inflate(n,s),a===hv&&i&&(a=qt.inflateSetDictionary(n,i),a===aa?a=qt.inflate(n,s):a===WI&&(a=hv));n.avail_in>0&&a===fv&&n.state.wrap&2&&n.state.flags!==0&&n.input[n.next_in]!==0;)qt.inflateReset(n),a=qt.inflate(n,s);switch(a){case I3:case WI:case hv:case T3:return this.onEnd(a),this.ended=!0,!1}if(u=n.avail_out,n.next_out&&(n.avail_out===0||a===fv||s>0))if(this.options.to==="string"){let d=pv.utf8border(n.output,n.next_out),c=n.next_out-d,o=pv.buf2string(n.output,d);n.next_out=c,n.avail_out=r-c,c&&n.output.set(n.output.subarray(d,d+c),0),this.onData(o)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out)),n.avail_out=0,n.next_out=0;if(!((a===aa||a===HI)&&u===0)){if(a===fv)return a=qt.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(n.avail_in===0){if(s===UI)return a=qt.inflateEnd(this.strm),this.onEnd(a===aa?HI:a),this.ended=!0,!1;break}}}return!0};gs.prototype.onData=function(e){this.chunks.push(e)};gs.prototype.onEnd=function(e){e===aa&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=VI.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function mv(e,t){let n=new gs(t);if(n.push(e,!0),n.err)throw n.msg||vv[n.err];return n.result}function w3(e,t){return t=t||{},t.raw=!0,mv(e,t)}oa.exports.Inflate=gs;oa.exports.inflate=mv;oa.exports.inflateRaw=w3;oa.exports.ungzip=mv;oa.exports.constants=kn()});var GI=p((Mk,kt)=>{"use strict";var{Deflate:O3,deflate:D3,deflateRaw:R3,gzip:F3}=jb(),{Inflate:P3,inflate:N3,inflateRaw:M3,ungzip:B3}=zI(),q3=kn();kt.exports.Deflate=O3;kt.exports.deflate=D3;kt.exports.deflateRaw=R3;kt.exports.gzip=F3;kt.exports.Inflate=P3;kt.exports.inflate=N3;kt.exports.inflateRaw=M3;kt.exports.ungzip=B3;kt.exports.constants=q3});var ZI=p(sa=>{"use strict";var k3=sa&&sa.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(sa,"__esModule",{value:!0});sa.GzipEncodingMiddleware=void 0;var J3=GI(),Jr=class e{constructor(){this.pre=t=>k3(this,void 0,void 0,function*(){if(!t.init.body)return;let n;if(typeof t.init.body===e.TYPE_OBJECT)n=JSON.stringify(t.init.body);else if(typeof t.init.body===e.TYPE_STRING)n=t.init.body;else{console.warn("Unsupported request body type for Gzip compression");return}let r=J3.gzip(n);t.init.headers&&(t.init.headers[e.CONTENT_ENCODING_HEADER]=e.CONTENT_ENCODING_GZIP),t.init.body=r})}};sa.GzipEncodingMiddleware=Jr;Jr.CONTENT_ENCODING_HEADER="Content-Encoding";Jr.CONTENT_ENCODING_GZIP="gzip";Jr.TYPE_OBJECT="object";Jr.TYPE_STRING="string"});var gv=p(ua=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});ua.OCRA_PATH=void 0;ua.buildOcraBaseUrl=U3;ua.OCRA_PATH="/ocra";var L3=e=>e.startsWith("http://")||e.startsWith("https://");function U3(e){let t=e.replace(/\/+$/,"");return(L3(t)?"":"https://")+t+ua.OCRA_PATH}});var QI=p(ca=>{"use strict";var W3=ca&&ca.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ca,"__esModule",{value:!0});ca.BaseUrlOverrideMiddleware=void 0;var H3=gv(),_v=class{constructor(t,n){this.originalBaseUrl=t,this.overrideBaseUrl=n,this.pre=r=>W3(this,void 0,void 0,function*(){if(!this.overrideBaseUrl)return;let i=(0,H3.buildOcraBaseUrl)(this.overrideBaseUrl);if(i===this.originalBaseUrl||!r.url.startsWith(this.originalBaseUrl))return;let a=r.url.slice(this.originalBaseUrl.length);return{url:i+a,init:r.init}})}};ca.BaseUrlOverrideMiddleware=_v});var XI=p(Jt=>{"use strict";var Ye=Jt&&Jt.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ApiClientFactory=Jt.OcraClient=Jt.InvalidInstanceAuthenticationError=void 0;var YI=ue(),V3=Ce(),K3=qe(),Lr=El(),$I=sb(),_t=fb(),Ur=dn(),z3=ZI(),G3=QI(),Z3=f0(),Q3="x-sin-request-id",Y3="x-sin-client-obj-id",$3="x-sin-cc",X3="x-sin-client-platform",j3="x-sin-client-version",da=class extends Error{constructor(t){super(`Invalid InstanceAuthentication, code: ${t.code}`),this.error=t}get code(){return this.error.code}};Jt.InvalidInstanceAuthenticationError=da;var an=class e{constructor(t){this.getRequestHeaders=n=>{let r={};return r[Q3]=YI.StringHelper.UUID(),r[Y3]=this.clientId,r[$3]=n.toHttpHeader(),r[X3]="js",r[j3]=Z3.VERSION,r},this.updateRequestInstance=n=>Object.assign(Object.assign({},n),{instanceId:this.authentication.instance.id}),this.clientId=YI.StringHelper.UUID(),this.basePath=t.basePath,this.instanceApi=new Lr.InstanceApi(t),this.callApi=new Lr.CallApi(t).withMiddleware(this),this.configApi=new Lr.ConfigApi(t).withMiddleware(this),this.iceApi=new Lr.IceApi(t).withMiddleware(this),this.callReportApi=new Lr.CallReportApi(t).withMiddleware(this),this.pushApi=new Lr.PushApi(t).withMiddleware(this),this.featureFlagsApi=new Lr.FeatureFlagsApi(t)}getDefaultCorrelationContext(){var t,n;return new $I.CorrelationContext((t=this.instanceAuthentication)===null||t===void 0?void 0:t.credentials.username,(n=this.instanceAuthentication)===null||n===void 0?void 0:n.instance.id)}deletePushProfile(t){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.pushApi.withMiddleware(this.authentication).withMiddleware(n).deletePushProfile(r)}),this.updateRequestInstance)}updatePushProfile(t){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.pushApi.withMiddleware(this.authentication).withMiddleware(n).updatePushProfile(r)}),this.updateRequestInstance)}sendPushNotifications(t){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.pushApi.withMiddleware(this.authentication).withMiddleware(n).sendPushNotifications(r)}))}initiateCall(t){let n=this.getDefaultCorrelationContext();n.callId=t.callInitiationRequest.callId;let r=new _t.SinchRequestHeaders(this.getRequestHeaders(n));return this.makeRequest(t,i=>Ye(this,void 0,void 0,function*(){return this.callApi.withMiddleware(this.authentication).withMiddleware(r).initiateCall(i)}))}getConfig(t){return Ye(this,void 0,void 0,function*(){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.configApi.withMiddleware(this.authentication).withMiddleware(n).getConfig(r)}),this.updateRequestInstance)})}getIceServers(t){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.iceApi.withMiddleware(this.authentication).withMiddleware(n).getIceServers(r)}),this.updateRequestInstance)}getFeatureFlags(t){return Ye(this,void 0,void 0,function*(){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.makeRequest(t,r=>Ye(this,void 0,void 0,function*(){return this.featureFlagsApi.withMiddleware(this.authentication).withMiddleware(n).getFeatureFlags(r)}),this.updateRequestInstance)})}createInstance(t,n){let r=new $I.CorrelationContext(n.createInstanceRequest.userId),i=new _t.SinchRequestHeaders(this.getRequestHeaders(r));return this.instanceApi.withMiddleware(t).withMiddleware(i).createInstance(n)}createCallReport(t,n){let r=this.getDefaultCorrelationContext();r.callId=t.callReport.callId;let i=new _t.SinchRequestHeaders(this.getRequestHeaders(r)),a=new z3.GzipEncodingMiddleware;return this.callReportApi.withMiddleware(this.authentication).withMiddleware(i).withMiddleware(a).withMiddleware(new G3.BaseUrlOverrideMiddleware(this.basePath,n)).createCallReport(t)}updateInstance(t){let n=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.instanceApi.withMiddleware(this.authentication).withMiddleware(n).updateInstance(t)}updateInstanceTtl(t,n){let r=new _t.SinchRequestHeaders(this.getRequestHeaders(this.getDefaultCorrelationContext()));return this.instanceApi.withMiddleware(t).withMiddleware(r).updateInstanceTtl(n)}setInstanceAuthentication(t,n){this.instanceAuthentication=t,this.onAuthenticationRequired=n}setUpdateInstanceTtlWindow(t){this.updateTtlWindowDays=t}get authentication(){if(this.instanceAuthentication)return this.instanceAuthentication;throw new V3.InvalidOperationError("Missing instance authentication")}pre(t){return Ye(this,void 0,void 0,function*(){this.validateInstanceTtl()})}post(t){return Ye(this,void 0,void 0,function*(){yield this.processOcraApiErrors(t.response)})}validateInstanceTtl(){if(this.hasAuthenticationExpired(this.authentication))throw new da({message:e.EXPIRED_AUTH_MESSAGE,code:1104})}processOcraApiErrors(t){return Ye(this,void 0,void 0,function*(){var n,r,i,a;if(!(t.status>=400))return;if(!((i=(r=(n=t.headers)===null||n===void 0?void 0:n.get(e.HEADER_CONTENT_TYPE))===null||r===void 0?void 0:r.includes(e.HEADER_VALUE_JSON_CONTENT_TYPE))!==null&&i!==void 0?i:!1))throw new Ur.SinchError(e.GENERAL_ERROR_MESSAGE,t.status||Ur.ErrorCode.Generic,Ur.ErrorType.Http);let d=yield t.json();throw this.isAuthenticationInvalid(t.status)&&((a=d.error)===null||a===void 0?void 0:a.code)==e.INVALID_INSTANCE_AUTHENTICATION_ERROR_CODE?new da(d.error):this.getSinchErrorFromJson(d,t.status)})}getSinchErrorFromJson(t,n){if(!(0,K3.exists)(t,"error"))return new Ur.SinchError(e.GENERAL_ERROR_MESSAGE,n,Ur.ErrorType.Http);let r=t.error,i=r.message,a=r.code;return new Ur.SinchError(i,a??n,Ur.ErrorType.Http)}isAuthenticationInvalid(t){return t==404||t==401}newInstanceAuthenticationRequired(t){return t instanceof da}hasAuthenticationExpired(t){return t.instance.hasExpired()}makeRequest(t,n,r){return Ye(this,void 0,void 0,function*(){try{return this.updateTtlWindowDays&&this.authentication.instance.shouldProlong(this.updateTtlWindowDays)&&(yield this.authentication.prolong()),yield n(t)}catch(i){if(this.newInstanceAuthenticationRequired(i)&&this.onAuthenticationRequired)return yield this.onAuthenticationRequired(),n(r?r(t):t);throw i}})}};Jt.OcraClient=an;an.GENERAL_ERROR_MESSAGE="Error while executing http request";an.EXPIRED_AUTH_MESSAGE="InstanceAuthentication expired";an.HEADER_CONTENT_TYPE="Content-Type";an.HEADER_VALUE_JSON_CONTENT_TYPE="application/json";an.INVALID_INSTANCE_AUTHENTICATION_ERROR_CODE=1104;var xv=class{static create(t){return new an(t)}};Jt.ApiClientFactory=xv});var nT=p(Vn=>{"use strict";var jI=Vn&&Vn.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Vn,"__esModule",{value:!0});Vn.FeaturesFactory=Vn.Features=void 0;var eT=un(),tT=mt(),Sv=_p(),eB=hp(),la=yi(),F0=ue(),P0=class{constructor(t){this.featureStorage=t,this.featureFlags=new Map,this.timeService=eB.TimeServiceFactory.create(),this.onFeatureChanged=new eT.Event}getFeatureFlag(t){return this.featureFlags.get(t)}initialiseFeatureFlags(){let t=this.featureStorage.isEmpty();Object.keys(la.FeatureFlag).forEach(n=>{let r=la.FeatureFlag[n],i=t?la.FeatureFlagDefaults[r]:this.featureStorage.getFeatureFlag(r);this.featureFlags.set(r,i??!1)})}shouldRefresh(){let t=this.featureStorage.getFeatureFlag(Sv.FeatureStorage.LAST_REFRESHED_AT);return t?this.timeService.now.getTime()-t>=Sv.FeatureStorage.REFRESH_INTERVAL_MS:!0}setUserInstance(t,n,r){this.userId=t,this.instanceId=n,this.featureStorage.setApplicationConfig(t,r),this.initialiseFeatureFlags()}refresh(t){return jI(this,void 0,void 0,function*(){let n=yield this.fetchFeatureFlags(t);this.updateAndPublishFeaturesIfNeeded(n)})}addListener(t){this.onFeatureChanged.add(t)}resetListeners(){this.onFeatureChanged=new eT.Event}fetchFeatureFlags(t){return jI(this,void 0,void 0,function*(){if(!this.userId)throw new tT.InvalidOperationError("Missing userId");if(!this.instanceId)throw new tT.InvalidOperationError("Missing instanceId");let n=new Map;try{let r=yield t.getFeatureFlags({userId:this.userId,instanceId:this.instanceId});for(let[i,a]of Object.entries(r))n.set(i,a)}catch(r){console.error("Could not fetch feature flags. Will use default values",{error:r}),n.clear()}return n})}updateFeatureFlags(t){this.featureFlags.forEach((n,r)=>{let i=t.get(r),a=la.FeatureFlagDefaults[r],s=F0.TypeHelper.isBoolean(i)||F0.TypeHelper.isNumber(i)&&typeof i==typeof a;this.featureFlags.set(r,s?i:la.FeatureFlagDefaults[r])})}updateAndPublishFeaturesIfNeeded(t){this.hasFeaturesChanged(t)&&(this.updateFeatureFlags(t),this.storeFeatures(),this.publishFeaturesChanged())}publishFeaturesChanged(){this.onFeatureChanged.fire(this.featureFlags)}hasFeaturesChanged(t){let n=Object.entries(la.FeatureFlag).reduce((r,i)=>{let a=this.featureStorage.getFeatureFlag(i[1]);return(F0.TypeHelper.isBoolean(a)||F0.TypeHelper.isNumber(a))&&r.set(i[1],a),r},new Map);if(t.size<n.size||!(t.size&&n.size))return!0;for(let[r,i]of t){let a=n.get(r);return a!==i||a===void 0&&!n.has(r)}}storeFeatures(){this.featureStorage.removeAll();for(let[t,n]of this.featureFlags)this.featureStorage.setFeatureFlag(t,n);this.featureStorage.setFeatureFlag(Sv.FeatureStorage.LAST_REFRESHED_AT,this.timeService.now.getTime())}};Vn.Features=P0;var yv=class{static create(t){return new P0(t)}};Vn.FeaturesFactory=yv});var aT=p(fa=>{"use strict";var Wr=fa&&fa.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(fa,"__esModule",{value:!0});fa.DefaultSinchClient=void 0;var tB=FE(),rT=sc(),nB=qe(),rB=jE(),Cv=mt(),Ev=ib(),iB=ab(),aB=ob(),oB=XI(),sB=gv(),bv=ue(),uB=nT(),cB=d0(),iT=mf(),N0=class{constructor(t){if(this.ServiceWorkerName="sw.js",this.isClientStarted=!1,this.useRelayIceCandidatesOnly=!1,this.isUsingManagedPush=!1,this.processExternalPushNotification=n=>{let r={sinch:n,name:"ForSmokeTests"};this.relayRemotePushNotification(r)},this.onPush=n=>{this.relayRemotePushNotification(n.data)},this.clientEvent=new iB.ClientEventFanout(this),this.features=uB.FeaturesFactory.create(cB.StorageFactory.createFeatureStorage()),!t||!t.applicationKey)throw new Error("Parameter appKey is required");this.applicationKey=t.applicationKey,this.userId=t.userId,this.callerIdentifier=t.callerIdentifier,this.apiClient=oB.ApiClientFactory.create(new nB.Configuration({basePath:(0,sB.buildOcraBaseUrl)(t.baseUrl),fetchApi:t.fetchApi})),this.instanceController=new rB.InstanceController(this.applicationKey,this.userId,this.clientEvent,this.apiClient),this.pushService=Ev.PushFactory.createPushService(this.userId,this.apiClient),this.defaultCallClient=tB.CallClientFactory.create(this.userId,this.applicationKey,t.mediaManager),this.onStartedAction=new Array,this.addTurnListener=(0,bv.pipe)(iT.onTurnFeatureFlagChanged,this.features.addListener.bind(this.features))}set pushNotificationDisplayName(t){if(t&&t.length>255)throw new Cv.ArgumentError("displayName must not exceed 255 bytes",(0,bv.nameof)(t));this.pushService.pushNotificationDisplayName=t}get pushNotificationDisplayName(){return this.pushService.pushNotificationDisplayName}setUseRelayIceCandidatesOnly(t){this.useRelayIceCandidatesOnly=t}start(t){return Wr(this,void 0,void 0,function*(){try{this.started(yield this.instanceController.start(),t)}catch(n){this.isClientStarted=!1,console.error(n),this.failed("Unable to create instance!")}})}setSupportManagedPush(t,n){return Wr(this,void 0,void 0,function*(){this.instanceController.toggleCapability(rT.Capability.PushV4,!0),this.isUsingManagedPush=!0,this.pushWorker=Ev.PushFactory.createPushWorker(t??this.ServiceWorkerName,this.pushService,n),yield this.pushWorker.register(),this.pushWorker.addEventListener(this.onPush)})}disableManagedPushSupport(){return Wr(this,void 0,void 0,function*(){var t;this.instanceController.toggleCapability(rT.Capability.PushV4,!1),this.isUsingManagedPush=!1,yield(t=this.pushWorker)===null||t===void 0?void 0:t.unregister(),this.pushWorker=void 0})}failed(t){return Wr(this,void 0,void 0,function*(){this.clientEvent.onEvent({eventType:"failed",context:t})})}setupPush(t,n){return Wr(this,void 0,void 0,function*(){if(!n)throw new Cv.InvalidOperationError("Missing public VAPID key");this.pushWorker&&(yield this.pushWorker.start(n,t))})}createAndSetUpCallReporter(t){return new aB.CallReporter(this.userId,t,this.apiClient)}started(t,n){return Wr(this,void 0,void 0,function*(){var r;try{if(this.instanceController.authentication){let i=n??(yield this.apiClient.getConfig({instanceId:t.id,userId:this.userId}));this.instanceConfigJson=JSON.stringify(i),this.setupConfigCheck(t,i),this.instanceController.setUpdateInstanceTtlWindow(i.updateInstanceTtlWindowDays),this.apiClient.setUpdateInstanceTtlWindow(i.updateInstanceTtlWindowDays),yield this.instanceController.prolongInstanceIfNeeded(),this.addTurnListener(this.instanceController);let a=(0,iT.createIceServerFetcher)(this.apiClient,this.userId,t.id);this.features.setUserInstance(this.userId,t.id,this.applicationKey);let s=this.createAndSetUpCallReporter(t);this.features.shouldRefresh()&&(yield this.features.refresh(this.apiClient)),this.isUsingManagedPush&&(yield this.setupPush(t,(r=i.pushConfig)===null||r===void 0?void 0:r.w3cApplicationServerKey)),this.defaultCallClient.init(this,i.rtcProfile,i.rtcConfig,a,s,this.pushService,this.useRelayIceCandidatesOnly,this.features,t.id,this.callerIdentifier),this.isClientStarted=!0,this.onStartedAction.splice(0).forEach(u=>u()),this.clientEvent.onEvent({eventType:"started"})}}catch(i){this.failed(i).catch(()=>{console.error(i)})}})}setupConfigCheck(t,n){var r,i;let s=setInterval(()=>Wr(this,void 0,void 0,function*(){var u;let d=yield this.apiClient.getConfig({instanceId:t.id,userId:this.userId}),c=JSON.stringify(d);if(this.instanceConfigJson!==c)for(this.clearInstanceConfigUpdateInterval();;){if(!(!((u=this.defaultCallClient.getInstance())===null||u===void 0)&&u.hasActiveCall())){console.log("New instance config - restarting client"),this.terminate(),this.start(d);break}yield bv.PromiseHelper.sleep(1e3)}}),n.configRefreshIntervalMs);this.instanceConfigUpdateInterval=(i=(r=s.unref)===null||r===void 0?void 0:r.call(s))!==null&&i!==void 0?i:s}clearInstanceConfigUpdateInterval(){this.instanceConfigUpdateInterval!=null&&(clearInterval(this.instanceConfigUpdateInterval),this.instanceConfigUpdateInterval=void 0)}addListener(t){this.clientEvent.addListener(t)}removeListener(t){this.clientEvent.removeListener(t)}initiateCall(t){if(this.isClientStarted)return this.apiClient.initiateCall(t);throw new Cv.InvalidOperationError("Can not initiate a call before authentication")}get callClient(){return this.defaultCallClient}terminate(){this.isClientStarted=!1,this.instanceController.terminate(),this.clearInstanceConfigUpdateInterval(),this.features.resetListeners(),this.clientEvent.onEvent({eventType:"terminated"})}get localUserId(){return this.userId}isStarted(){return this.isClientStarted}relayRemotePushNotification(t){let n=new Ev.DefaultNotificationResult(t.sinch,t.name);return n.isValid()&&(this.isStarted()?this.defaultCallClient.handleCallPushPayload(n):(this.onStartedAction.push(()=>this.defaultCallClient.handleCallPushPayload(n)),this.start())),n}showPushNotification(t,n){var r;(r=this.pushWorker)===null||r===void 0||r.showNotification(t,n)}};fa.DefaultSinchClient=N0;typeof window<"u"&&(window.SinchClient=N0)});var oT=p(ha=>{"use strict";var dB=ha&&ha.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ha,"__esModule",{value:!0});ha.DefaultMediaStreamFactory=void 0;var Iv=class{constructor(t){this.videoConstraints=t}create(t){return dB(this,void 0,void 0,function*(){return this.validateMediaDevices(),navigator.mediaDevices.getUserMedia({audio:this.toConstraint(t.audio),video:this.toConstraint(t.video,this.videoConstraints)}).catch(n=>t.video?(console.log("Call using video failed. Attempting audio call",{error:n}),this.create({audio:t.audio,video:!1})):(console.error(n),Promise.resolve(new MediaStream)))})}validateMediaDevices(){if(!navigator?.mediaDevices)throw new Error("Browser does not support RTC")}toConstraint(t,n){if(t!==void 0)return typeof t=="boolean"?t?n??!0:!1:t}getMediaStream(t){return this.create(t)}};ha.DefaultMediaStreamFactory=Iv});var sT=p(pa=>{"use strict";var lB=pa&&pa.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(pa,"__esModule",{value:!0});pa.MediaManager=void 0;var fB=$l(),Tv=class{constructor(t){this.mediaStreamFactory=t}createMediaController(t,n){return lB(this,void 0,void 0,function*(){var r,i;let a=t?(r=this.audioTrackConstraints)!==null&&r!==void 0?r:!0:!1,s=n?(i=this.videoTrackConstraints)!==null&&i!==void 0?i:!0:!1,u=yield this.mediaStreamFactory.getMediaStream({audio:a,video:s});return fB.MediaController.create(u)})}};pa.MediaManager=Tv});var uT=p(va=>{"use strict";var hB=va&&va.__awaiter||function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function u(o){try{c(r.next(o))}catch(f){s(f)}}function d(o){try{c(r.throw(o))}catch(f){s(f)}}function c(o){o.done?a(o.value):i(o.value).then(u,d)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(va,"__esModule",{value:!0});va.DefaultSinchClientBuilder=void 0;var pB=aT(),vB=oT(),mB=sT(),Kn=ue(),zn=Ce(),Av=class{userId(t){if(!t)throw new zn.ArgumentError("userId must not be null or empty",(0,Kn.nameof)(t));return this.clientUserId=t,this}applicationKey(t){if(!t)throw new zn.ArgumentError("applicastionKey must not be null or empty",(0,Kn.nameof)(t));return this.clientApplicationKey=t,this}environmentHost(t){if(!t)throw new zn.ArgumentError("environmentHost must not be null or empty",(0,Kn.nameof)(t));return this.clientEnvironmentHost=t,this}callerIdentifier(t){if(!t)throw new zn.ArgumentError("callerIdentifier must not be null or empty",(0,Kn.nameof)(t));return this.clientCallerIdentifier=t,this}fetchApi(t){if(!t)throw new zn.ArgumentError("fetchApi must not be null",(0,Kn.nameof)(t));return this.clientFetchApi=t,this}mediaStreamFactory(t){return this.clientMediaStreamFactory=t,this}videoConfiguration(t){return this.clientVideoConstraints=t,this}silentMediaStream(){let t=new AudioContext,r=t.createOscillator().connect(t.createMediaStreamDestination());return this.mediaStreamFactory({getMediaStream:i=>hB(this,void 0,void 0,function*(){return new MediaStream([Object.assign(r.stream.getAudioTracks()[0],{enabled:!1})])})}),this}getDefaultMediaStreamFactory(){var t;return new vB.DefaultMediaStreamFactory((t=this.clientVideoConstraints)!==null&&t!==void 0?t:{width:{ideal:640},height:{ideal:480}})}build(){var t;if(!this.clientApplicationKey)throw new zn.ArgumentError("applicationKey must be set",(0,Kn.nameof)(this.clientApplicationKey));if(!this.clientUserId)throw new zn.ArgumentError("userId must be set",(0,Kn.nameof)(this.clientUserId));if(!this.clientEnvironmentHost)throw new zn.ArgumentError("environmentHost must be set",(0,Kn.nameof)(this.clientEnvironmentHost));return new pB.DefaultSinchClient({applicationKey:this.clientApplicationKey,userId:this.clientUserId,baseUrl:this.clientEnvironmentHost,callerIdentifier:this.clientCallerIdentifier,fetchApi:this.clientFetchApi,mediaManager:new mB.MediaManager((t=this.clientMediaStreamFactory)!==null&&t!==void 0?t:this.getDefaultMediaStreamFactory())})}};va.DefaultSinchClientBuilder=Av});var cT=p(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});B0.Sinch=void 0;var gB=uT(),_B=f0(),M0=class{static getSinchClientBuilder(){return new gB.DefaultSinchClientBuilder}static get version(){return _B.VERSION}};B0.Sinch=M0;typeof window<"u"&&(window.Sinch=M0)});var lT=p(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0})});var hT=p(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0})});var vT=p(pT=>{"use strict";Object.defineProperty(pT,"__esModule",{value:!0})});var gT=p(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0})});var xT=p(_T=>{"use strict";Object.defineProperty(_T,"__esModule",{value:!0})});var yT=p(ST=>{"use strict";Object.defineProperty(ST,"__esModule",{value:!0})});var ET=p(CT=>{"use strict";Object.defineProperty(CT,"__esModule",{value:!0})});var IT=p(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0})});var AT=p(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});q0.Domain=void 0;var TT;(function(e){e.Mxp="mxp",e.Pstn="pstn",e.Sip="sip",e.Conference="conference"})(TT||(q0.Domain=TT={}))});var OT=p(wT=>{"use strict";Object.defineProperty(wT,"__esModule",{value:!0})});var RT=p(DT=>{"use strict";Object.defineProperty(DT,"__esModule",{value:!0})});var PT=p(FT=>{"use strict";Object.defineProperty(FT,"__esModule",{value:!0})});var MT=p(NT=>{"use strict";Object.defineProperty(NT,"__esModule",{value:!0})});var qT=p(BT=>{"use strict";Object.defineProperty(BT,"__esModule",{value:!0})});var kT=p(ie=>{"use strict";var xB=ie&&ie.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),he=ie&&ie.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&xB(t,e,n)};Object.defineProperty(ie,"__esModule",{value:!0});he(cT(),ie);he(lT(),ie);he(hT(),ie);he(vT(),ie);he(dn(),ie);he(gT(),ie);he(np(),ie);he(xT(),ie);he(yT(),ie);he(ET(),ie);he(lc(),ie);he(cf(),ie);he(lp(),ie);he(IT(),ie);he(bp(),ie);he(AT(),ie);he(OT(),ie);he(RT(),ie);he(PT(),ie);he(Lt(),ie);he(MT(),ie);he(Cr(),ie);he(Yt(),ie);he(qT(),ie)});var k0=iA(kT());var export_CallEndCause=k0.CallEndCause;var export_CallQualityWarningEventType=k0.CallQualityWarningEventType;var export_ErrorType=k0.ErrorType;var export_Sinch=k0.Sinch;export{export_CallEndCause as CallEndCause,export_CallQualityWarningEventType as CallQualityWarningEventType,export_ErrorType as ErrorType,export_Sinch as Sinch};
11
+ /*! Bundled license information:
12
+
13
+ crypto-js/ripemd160.js:
14
+ (** @preserve
15
+ (c) 2012 by Cédric Mesnil. All rights reserved.
16
+
17
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
18
+
19
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
20
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ *)
24
+
25
+ crypto-js/mode-ctr-gladman.js:
26
+ (** @preserve
27
+ * Counter block mode compatible with Dr Brian Gladman fileenc.c
28
+ * derived from CryptoJS.mode.CTR
29
+ * Jan Hruby jhruby.web@gmail.com
30
+ *)
31
+ */