@sentdm/voice-client 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/adapter/sinch-rtc.js +1 -1
- package/adapter/sinch-rtc.mjs +1 -1
- package/package.json +2 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/adapter/sinch-rtc.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var YT=Object.create;var Cs=Object.defineProperty;var $T=Object.getOwnPropertyDescriptor;var XT=Object.getOwnPropertyNames;var jT=Object.getPrototypeOf,eA=Object.prototype.hasOwnProperty;var p=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},tA=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})},Lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of XT(t))!eA.call(e,i)&&i!==n&&Cs(e,i,{get:()=>t[i],enumerable:!(r=$T(t,i))||r.enumerable});return e};var nA=(e,t,n)=>(n=e!=null?YT(jT(e)):{},Lv(t||!e||!e.__esModule?Cs(n,"default",{value:e,enumerable:!0}):n,e)),rA=e=>Lv(Cs({},"__esModule",{value:!0}),e);var Lt=p(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.Direction=void 0;var Uv;(function(e){e[e.Inbound=0]="Inbound",e[e.Outbound=1]="Outbound"})(Uv||(Es.Direction=Uv={}))});var ct=p(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.SessionState=void 0;var Wv;(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"})(Wv||(bs.SessionState=Wv={}))});var un=p(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.Event=void 0;var W0=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=[]}};Is.Event=W0});var Vv=p(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.SessionDescription=cn.Source=cn.DescriptionType=void 0;var Ts;(function(e){e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"})(Ts||(cn.DescriptionType=Ts={}));var Hv;(function(e){e[e.Local=1]="Local",e[e.Remote=2]="Remote"})(Hv||(cn.Source=Hv={}));var ba=class e{constructor(t,n){this.type=t,this.sdp=n}asJson(){switch(this.type){case Ts.Offer:return e.toJson(e.offer,this.sdp);case Ts.Answer:return e.toJson(e.answer,this.sdp)}}static toJson(t,n){return JSON.stringify({type:t,sdp:n.toString()})}};cn.SessionDescription=ba;ba.answer="answer";ba.offer="offer"});var dt=p(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.TerminationCause=void 0;var Kv;(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"})(Kv||(As.TerminationCause=Kv={}))});var Ce=p(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ArgumentError=xt.InvalidOperationError=xt.UnhandledEventError=xt.ErrorBase=void 0;var Gr=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};xt.ErrorBase=Gr;var H0=class extends Gr{constructor(t,n){super(n?`${t} (state: ${n})`:t)}};xt.UnhandledEventError=H0;var V0=class extends Gr{};xt.InvalidOperationError=V0;var K0=class extends Gr{constructor(t,n){super(`${t}, type: ${n}`)}};xt.ArgumentError=K0});var dn=p(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.SinchError=St.ErrorCode=St.ErrorMessage=St.ErrorType=void 0;var iA=Ce(),z0;(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"})(z0||(St.ErrorType=z0={}));var ws=class{};St.ErrorMessage=ws;ws.ICE_FAILED_TO_CONNECT="ICE failed to connect";var zv;(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"})(zv||(St.ErrorCode=zv={}));var G0=class extends iA.ErrorBase{constructor(t,n=500,r=z0.Generic,i){super(t),this.message=t,this.code=n,this.domain=r,this.isFatal=i}};St.SinchError=G0});var Zv=p(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0})});var Qv=p(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Body=void 0;var aA=Ds(),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,aA.Message.errorToJsonString(t))}};Os.Body=ln;ln.clientType="client";ln.sdpType="sdp";ln.mediaType="media";ln.clientEventType="clientEvent";ln.errorJsonType="error/json"});var $v=p(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0})});var Z0=p(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.Method=void 0;var Xv;(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"})(Xv||(Rs.Method=Xv={}))});var jv=p(()=>{});var X=p((Fs,em)=>{(function(e,t){typeof Fs=="object"?em.exports=Fs=t():typeof define=="function"&&define.amd?define([],t):e.CryptoJS=t()})(Fs,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 require=="function")try{r=jv()}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 Ia=p((Ps,tm)=>{(function(e,t){typeof Ps=="object"?tm.exports=Ps=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ps,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 rm=p((Ns,nm)=>{(function(e,t){typeof Ns=="object"?nm.exports=Ns=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ns,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 am=p((Ms,im)=>{(function(e,t){typeof Ms=="object"?im.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.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((Bs,om)=>{(function(e,t){typeof Bs=="object"?om.exports=Bs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Bs,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 um=p((qs,sm)=>{(function(e,t){typeof qs=="object"?sm.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=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((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){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 Q0=p((Js,dm)=>{(function(e,t){typeof Js=="object"?dm.exports=Js=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Js,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 Us=p((Ls,lm)=>{(function(e,t){typeof Ls=="object"?lm.exports=Ls=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Ls,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 hm=p((Ws,fm)=>{(function(e,t,n){typeof Ws=="object"?fm.exports=Ws=t(X(),Us()):typeof define=="function"&&define.amd?define(["./core","./sha256"],t):t(e.CryptoJS)})(Ws,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 Y0=p((Hs,pm)=>{(function(e,t,n){typeof Hs=="object"?pm.exports=Hs=t(X(),Ia()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],t):t(e.CryptoJS)})(Hs,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,ga=T,Vr=N,L0=J,_a=F,st=V,We=H,xs=Z,xa=j,Ss=R,Sa=M,U0=B,ya=P,ut=0;ut<80;ut++){var $e,on,ys=o[ut];if(ut<16)on=ys.high=m[_+ut*2]|0,$e=ys.low=m[_+ut*2+1]|0;else{var wv=o[ut-15],Kr=wv.high,Ca=wv.low,qT=(Kr>>>1|Ca<<31)^(Kr>>>8|Ca<<24)^Kr>>>7,Ov=(Ca>>>1|Kr<<31)^(Ca>>>8|Kr<<24)^(Ca>>>7|Kr<<25),Dv=o[ut-2],zr=Dv.high,Ea=Dv.low,kT=(zr>>>19|Ea<<13)^(zr<<3|Ea>>>29)^zr>>>6,Rv=(Ea>>>19|zr<<13)^(Ea<<3|zr>>>29)^(Ea>>>6|zr<<26),Fv=o[ut-7],JT=Fv.high,LT=Fv.low,Pv=o[ut-16],UT=Pv.high,Nv=Pv.low;$e=Ov+LT,on=qT+JT+($e>>>0<Ov>>>0?1:0),$e=$e+Rv,on=on+kT+($e>>>0<Rv>>>0?1:0),$e=$e+Nv,on=on+UT+($e>>>0<Nv>>>0?1:0),ys.high=on,ys.low=$e}var WT=st&xs^~st&Ss,Mv=We&xa^~We&Sa,HT=de&Me^de&ga^Me&ga,VT=se&Q^se&Vr^Q&Vr,KT=(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),GT=(We>>>14|st<<18)^(We>>>18|st<<14)^(We<<23|st>>>9),qv=c[ut],ZT=qv.high,kv=qv.low,He=ya+GT,sn=U0+zT+(He>>>0<ya>>>0?1:0),He=He+Mv,sn=sn+WT+(He>>>0<Mv>>>0?1:0),He=He+kv,sn=sn+ZT+(He>>>0<kv>>>0?1:0),He=He+$e,sn=sn+on+(He>>>0<$e>>>0?1:0),Jv=Bv+VT,QT=KT+HT+(Jv>>>0<Bv>>>0?1:0);U0=Ss,ya=Sa,Ss=xs,Sa=xa,xs=st,xa=We,We=_a+He|0,st=L0+sn+(We>>>0<_a>>>0?1:0)|0,L0=ga,_a=Vr,ga=Me,Vr=Q,Me=de,Q=se,se=He+Jv|0,de=sn+QT+(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+Vr,v.high=T+ga+(N>>>0<Vr>>>0?1:0),F=g.low=F+_a,g.high=J+L0+(F>>>0<_a>>>0?1:0),H=y.low=H+We,y.high=V+st+(H>>>0<We>>>0?1:0),j=S.low=j+xa,S.high=Z+xs+(j>>>0<xa>>>0?1:0),M=b.low=M+Sa,b.high=R+Ss+(M>>>0<Sa>>>0?1:0),P=I.low=P+ya,I.high=B+U0+(P>>>0<ya>>>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 mm=p((Vs,vm)=>{(function(e,t,n){typeof Vs=="object"?vm.exports=Vs=t(X(),Ia(),Y0()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],t):t(e.CryptoJS)})(Vs,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 _m=p((Ks,gm)=>{(function(e,t,n){typeof Ks=="object"?gm.exports=Ks=t(X(),Ia()):typeof define=="function"&&define.amd?define(["./core","./x64-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.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 Sm=p((zs,xm)=>{(function(e,t){typeof zs=="object"?xm.exports=zs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(zs,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((Gs,ym)=>{(function(e,t){typeof Gs=="object"?ym.exports=Gs=t(X()):typeof define=="function"&&define.amd?define(["./core"],t):t(e.CryptoJS)})(Gs,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 Em=p((Qs,Cm)=>{(function(e,t,n){typeof Qs=="object"?Cm.exports=Qs=t(X(),Us(),Zs()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],t):t(e.CryptoJS)})(Qs,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((Ys,bm)=>{(function(e,t,n){typeof Ys=="object"?bm.exports=Ys=t(X(),Q0(),Zs()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],t):t(e.CryptoJS)})(Ys,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(($s,Im)=>{(function(e,t,n){typeof $s=="object"?Im.exports=$s=t(X(),Ut()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],t):t(e.CryptoJS)})($s,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 Am=p((Xs,Tm)=>{(function(e,t,n){typeof Xs=="object"?Tm.exports=Xs=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(Xs,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 Om=p((js,wm)=>{(function(e,t,n){typeof js=="object"?wm.exports=js=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(js,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 Rm=p((eu,Dm)=>{(function(e,t,n){typeof eu=="object"?Dm.exports=eu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(eu,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 Pm=p((tu,Fm)=>{(function(e,t,n){typeof tu=="object"?Fm.exports=tu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(tu,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 Mm=p((nu,Nm)=>{(function(e,t,n){typeof nu=="object"?Nm.exports=nu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(nu,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 qm=p((ru,Bm)=>{(function(e,t,n){typeof ru=="object"?Bm.exports=ru=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(ru,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 Jm=p((iu,km)=>{(function(e,t,n){typeof iu=="object"?km.exports=iu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(iu,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 Um=p((au,Lm)=>{(function(e,t,n){typeof au=="object"?Lm.exports=au=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(au,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 Hm=p((ou,Wm)=>{(function(e,t,n){typeof ou=="object"?Wm.exports=ou=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(ou,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 Km=p((su,Vm)=>{(function(e,t,n){typeof su=="object"?Vm.exports=su=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(su,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})});var Gm=p((uu,zm)=>{(function(e,t,n){typeof uu=="object"?zm.exports=uu=t(X(),ye()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],t):t(e.CryptoJS)})(uu,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 Qm=p((cu,Zm)=>{(function(e,t,n){typeof cu=="object"?Zm.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.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 $m=p((du,Ym)=>{(function(e,t,n){typeof du=="object"?Ym.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.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 jm=p((lu,Xm)=>{(function(e,t,n){typeof lu=="object"?Xm.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=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 tg=p((fu,eg)=>{(function(e,t,n){typeof fu=="object"?eg.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.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 rg=p((hu,ng)=>{(function(e,t,n){typeof hu=="object"?ng.exports=hu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(hu,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 ag=p((pu,ig)=>{(function(e,t,n){typeof pu=="object"?ig.exports=pu=t(X(),fn(),hn(),Ut(),ye()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)})(pu,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 Zn=p((vu,og)=>{(function(e,t,n){typeof vu=="object"?og.exports=vu=t(X(),Ia(),rm(),am(),fn(),um(),hn(),Q0(),Us(),hm(),Y0(),mm(),_m(),Sm(),Zs(),Em(),Ut(),ye(),Am(),Om(),Rm(),Pm(),Mm(),qm(),Jm(),Um(),Hm(),Km(),Gm(),Qm(),$m(),jm(),tg(),rg(),ag()):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)})(vu,function(e){return e})});var X0=p(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.SymmetricKey=void 0;var oA=Zn(),$0=class{constructor(t){this.key=oA.enc.Base64.parse(t)}};mu.SymmetricKey=$0});var ft=p(lt=>{"use strict";var sA=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]})),Ta=lt&<.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&sA(t,e,n)};Object.defineProperty(lt,"__esModule",{value:!0});Ta(Zv(),lt);Ta(Qv(),lt);Ta($v(),lt);Ta(Z0(),lt);Ta(X0(),lt)});var Ds=p(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Message=Qr.HeaderBooleanValue=void 0;var sg=dt(),Wt=dn(),j0=ft(),Zr;(function(e){e.Yes="yes",e.No="no"})(Zr||(Qr.HeaderBooleanValue=Zr={}));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 j0.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 sg.TerminationCause.IceFailedToConnect;if(this.isFailureTermination())return sg.TerminationCause.Error}isIceFailureFlagSet(){return!this.values||!(e.KEY_ICE_FAILURE in this.values)?!1:this.values[e.KEY_ICE_FAILURE]===Zr.Yes}isFailureTermination(){return!this.values||!(e.KEY_FAILURE_TERMINATION in this.values)?!1:this.values[e.KEY_FAILURE_TERMINATION]===Zr.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!=j0.Method.Deny?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_DENY_ALL])===Zr.No}isEarlyMedia(){var t;return this.method!=j0.Method.Ack?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_EARLY_MEDIA])===Zr.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}}};Qr.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 ug=p($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.ProtocolV10Factory=$r.ProtocolV10=void 0;var uA=Zn(),Yr=ht(),cA=ft(),gu=class e{constructor(){this.Version="10",this.sessionBuffer=new Yr.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=Yr.Codec.encrypt(i,n),s=Math.floor(1+a.length/3e4),u=s===1?"-":uA.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=Yr.Codec.decrypt(t,r),a=JSON.parse(i),s=this.encodeClient(a),u=new cA.Body(a.bt,a.bd);return new Yr.Message(parseInt(a.md),n,s,u,a.nvps)}catch(i){throw i.name!=="MXPError"?new Yr.MXPError(Yr.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}};$r.ProtocolV10=gu;var el=class{static create(){return new gu}};$r.ProtocolV10Factory=el});var cg=p(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.MXPError=void 0;var _u=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}};xu.MXPError=_u;_u.Codes={INVALID_DECRYPTION_KEY:1,DECRYPTION_FAIL:2,INVALID_MESSAGE:3,INVALID_BODY_TYPE:4,BODY_PARSE_FAIL:5}});var dg=p(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.SessionMessageBuffer=void 0;var tl=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}};Su.SessionMessageBuffer=tl});var Y=p(oe=>{"use strict";var Xr=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=lA;oe.querystring=ul;oe.mapValues=fA;oe.canConsumeForm=hA;oe.BASE_PATH="http://ocra.api.sinch.com/ocra".replace(/\/+$/,"");var dA=e=>typeof Blob<"u"&&e instanceof Blob,nl=class{constructor(t=new yu){this.configuration=t,this.fetchApi=(n,r)=>Xr(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 Xr(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||dA(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=nl;var rl=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}};oe.RequiredError=rl;oe.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};var yu=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||ul}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=yu;function lA(e,t){let n=e[t];return n!=null}function ul(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?ul(i,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`}).filter(n=>n.length>0).join("&")}function fA(e,t){return Object.keys(e).reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])}),{})}function hA(e){for(let t of e)if(t.contentType==="multipart/form-data")return!0;return!1}var il=class{constructor(t,n=r=>r){this.raw=t,this.transformer=n}value(){return Xr(this,void 0,void 0,function*(){return this.transformer(yield this.raw.json())})}};oe.JSONApiResponse=il;var al=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){})}};oe.VoidApiResponse=al;var ol=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){return yield this.raw.blob()})}};oe.BlobApiResponse=ol;var sl=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){return yield this.raw.text()})}};oe.TextApiResponse=sl});var pg=p(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ApnPushProfileEnvironmentEnum=Ht.ApnPushProfileTokenTypeEnum=void 0;Ht.ApnPushProfileFromJSON=pA;Ht.ApnPushProfileFromJSONTyped=hg;Ht.ApnPushProfileToJSON=vA;var lg;(function(e){e.Voip="voip",e.Default="default"})(lg||(Ht.ApnPushProfileTokenTypeEnum=lg={}));var fg;(function(e){e.Development="development",e.Production="production"})(fg||(Ht.ApnPushProfileEnvironmentEnum=fg={}));function pA(e){return hg(e,!1)}function hg(e,t){return e==null?e:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}function vA(e){if(e!==void 0)return e===null?null:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}});var mg=p(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.AudioRouteEventFromJSON=mA;Aa.AudioRouteEventFromJSONTyped=vg;Aa.AudioRouteEventToJSON=gA;function mA(e){return vg(e,!1)}function vg(e,t){return e==null?e:{description:e.description,time:new Date(e.time)}}function gA(e){if(e!==void 0)return e===null?null:{description:e.description,time:e.time.toISOString()}}});var _g=p(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.AudioRouteEventLogFromJSON=_A;wa.AudioRouteEventLogFromJSONTyped=gg;wa.AudioRouteEventLogToJSON=xA;var Cu=G();function _A(e){return gg(e,!1)}function gg(e,t){return e==null?e:{events:e.events.map(Cu.AudioRouteEventFromJSON),eventsSemanticVersion:(0,Cu.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function xA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Cu.AudioRouteEventToJSON),eventsSemanticVersion:(0,Cu.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var Sg=p(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.BasicCallReportFromJSON=SA;Oa.BasicCallReportFromJSONTyped=xg;Oa.BasicCallReportToJSON=yA;var pt=Y(),le=G();function SA(e){return xg(e,!1)}function xg(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 yA(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 Cg=p(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.CallInitiationRequestFromJSON=CA;Ra.CallInitiationRequestFromJSONTyped=yg;Ra.CallInitiationRequestToJSON=EA;var Da=Y(),Eu=G();function CA(e){return yg(e,!1)}function yg(e,t){return e==null?e:{callId:e.callId,destination:(0,Eu.DestinationFromJSON)(e.destination),rtcOffer:(0,Eu.WebrtcRTCSessionDescriptionFromJSON)(e.rtcOffer),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,publicCallHeaders:(0,Da.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,cli:(0,Da.exists)(e,"cli")?e.cli:void 0,mxpInstanceId:(0,Da.exists)(e,"mxpInstanceId")?e.mxpInstanceId:void 0,legacyMediaProxyEngage:(0,Da.exists)(e,"legacyMediaProxyEngage")?e.legacyMediaProxyEngage:void 0,mxpClientEventsVersion:(0,Da.exists)(e,"mxpClientEventsVersion")?e.mxpClientEventsVersion:void 0}}function EA(e){if(e!==void 0)return e===null?null:{callId:e.callId,destination:(0,Eu.DestinationToJSON)(e.destination),rtcOffer:(0,Eu.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 Ig=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.CallInitiationResponseFromJSON=bA;Fa.CallInitiationResponseFromJSONTyped=bg;Fa.CallInitiationResponseToJSON=IA;var bu=Y(),Eg=G();function bA(e){return bg(e,!1)}function bg(e,t){return e==null?e:{callId:e.callId,mxpEncryptionKey:e.mxpEncryptionKey,mxpSignalChannel:e.mxpSignalChannel,instances:(0,bu.exists)(e,"instances")?e.instances.map(Eg.RemotePeerInstanceFromJSON):void 0,startTime:new Date(e.startTime),legacyRelayIceCandidates:(0,bu.exists)(e,"legacyRelayIceCandidates")?e.legacyRelayIceCandidates:void 0,publicCallHeaders:(0,bu.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,apiBaseUrl:(0,bu.exists)(e,"apiBaseUrl")?e.apiBaseUrl:void 0}}function IA(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(Eg.RemotePeerInstanceToJSON),startTime:e.startTime.toISOString(),legacyRelayIceCandidates:e.legacyRelayIceCandidates,publicCallHeaders:e.publicCallHeaders,apiBaseUrl:e.apiBaseUrl}}});var Ag=p(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.CallQualityFromJSON=TA;Pa.CallQualityFromJSONTyped=Tg;Pa.CallQualityToJSON=AA;var Iu=G();function TA(e){return Tg(e,!1)}function Tg(e,t){return e==null?e:{warningEvents:e.warningEvents.map(Iu.WarningEventFromJSON),semanticVersion:(0,Iu.SemanticVersionFromJSON)(e.semanticVersion)}}function AA(e){if(e!==void 0)return e===null?null:{warningEvents:e.warningEvents.map(Iu.WarningEventToJSON),semanticVersion:(0,Iu.SemanticVersionToJSON)(e.semanticVersion)}}});var Og=p(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.CallReportFromJSON=wA;Na.CallReportFromJSONTyped=wg;Na.CallReportToJSON=OA;var me=Y(),re=G();function wA(e){return wg(e,!1)}function wg(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 OA(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 Fg=p(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.CallReportInstanceFromJSON=RA;Ma.CallReportInstanceFromJSONTyped=Rg;Ma.CallReportInstanceToJSON=FA;var DA=Y(),Dg=G();function RA(e){return Rg(e,!1)}function Rg(e,t){return e==null?e:{id:e.id,deviceId:(0,DA.exists)(e,"deviceId")?e.deviceId:void 0,version:(0,Dg.InstanceVersionDataFromJSON)(e.version)}}function FA(e){if(e!==void 0)return e===null?null:{id:e.id,deviceId:e.deviceId,version:(0,Dg.InstanceVersionDataToJSON)(e.version)}}});var Mg=p(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallResult=void 0;Qn.CallResultFromJSON=PA;Qn.CallResultFromJSONTyped=Ng;Qn.CallResultToJSON=NA;var Pg;(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"})(Pg||(Qn.CallResult=Pg={}));function PA(e){return Ng(e,!1)}function Ng(e,t){return e}function NA(e){return e}});var kg=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ClientErrorFromJSON=MA;Ba.ClientErrorFromJSONTyped=qg;Ba.ClientErrorToJSON=BA;var cl=Y(),Bg=G();function MA(e){return qg(e,!1)}function qg(e,t){return e==null?e:{code:(0,cl.exists)(e,"code")?e.code:void 0,domain:(0,cl.exists)(e,"domain")?(0,Bg.ClientErrorDomainFromJSON)(e.domain):void 0,message:(0,cl.exists)(e,"message")?e.message:void 0}}function BA(e){if(e!==void 0)return e===null?null:{code:e.code,domain:(0,Bg.ClientErrorDomainToJSON)(e.domain),message:e.message}}});var Ug=p(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ClientErrorDomain=void 0;Yn.ClientErrorDomainFromJSON=qA;Yn.ClientErrorDomainFromJSONTyped=Lg;Yn.ClientErrorDomainToJSON=kA;var Jg;(function(e){e.Network="network",e.Http="http",e.Api="api",e.Mxp="mxp"})(Jg||(Yn.ClientErrorDomain=Jg={}));function qA(e){return Lg(e,!1)}function Lg(e,t){return e}function kA(e){return e}});var Hg=p(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.ClientEventFromJSON=LA;qa.ClientEventFromJSONTyped=Wg;qa.ClientEventToJSON=UA;var JA=Y(),Tu=G();function LA(e){return Wg(e,!1)}function Wg(e,t){return e==null?e:{type:(0,Tu.EventTypeFromJSON)(e.type),name:e.name,time:new Date(e.time),result:(0,JA.exists)(e,"result")?(0,Tu.EventResultFromJSON)(e.result):void 0}}function UA(e){if(e!==void 0)return e===null?null:{type:(0,Tu.EventTypeToJSON)(e.type),name:e.name,time:e.time.toISOString(),result:(0,Tu.EventResultToJSON)(e.result)}}});var Kg=p(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.ClientEventsFromJSON=WA;ka.ClientEventsFromJSONTyped=Vg;ka.ClientEventsToJSON=HA;var Au=G();function WA(e){return Vg(e,!1)}function Vg(e,t){return e==null?e:{events:e.events.map(Au.ClientEventFromJSON),eventsSemanticVersion:(0,Au.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function HA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Au.ClientEventToJSON),eventsSemanticVersion:(0,Au.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var Qg=p($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.ConfigIceTransportPolicyEnum=void 0;$n.ConfigFromJSON=VA;$n.ConfigFromJSONTyped=Zg;$n.ConfigToJSON=KA;var zg=Y(),jr=G(),Gg;(function(e){e.Relay="relay",e.Nohost="nohost",e.All="all"})(Gg||($n.ConfigIceTransportPolicyEnum=Gg={}));function VA(e){return Zg(e,!1)}function Zg(e,t){return e==null?e:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:(0,zg.exists)(e,"iceTransportPolicy")?e.iceTransportPolicy:void 0,rtcProfile:(0,jr.RtcProfileFromJSON)(e.rtcProfile),rtcConfig:(0,jr.RtcConfigFromJSON)(e.rtcConfig),pushConfig:(0,zg.exists)(e,"pushConfig")?(0,jr.PushConfigFromJSON)(e.pushConfig):void 0}}function KA(e){if(e!==void 0)return e===null?null:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:e.iceTransportPolicy,rtcProfile:(0,jr.RtcProfileToJSON)(e.rtcProfile),rtcConfig:(0,jr.RtcConfigToJSON)(e.rtcConfig),pushConfig:(0,jr.PushConfigToJSON)(e.pushConfig)}}});var $g=p(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.ConnectionInfoFromJSON=zA;Ja.ConnectionInfoFromJSONTyped=Yg;Ja.ConnectionInfoToJSON=GA;var wu=G();function zA(e){return Yg(e,!1)}function Yg(e,t){return e==null?e:{localIceCandidate:(0,wu.IceCandidateFromJSON)(e.localIceCandidate),remoteIceCandidate:(0,wu.IceCandidateFromJSON)(e.remoteIceCandidate),timestamp:new Date(e.timestamp)}}function GA(e){if(e!==void 0)return e===null?null:{localIceCandidate:(0,wu.IceCandidateToJSON)(e.localIceCandidate),remoteIceCandidate:(0,wu.IceCandidateToJSON)(e.remoteIceCandidate),timestamp:e.timestamp.toISOString()}}});var t_=p(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ConnectionInfoV2ProtocolEnum=void 0;Xn.ConnectionInfoV2FromJSON=ZA;Xn.ConnectionInfoV2FromJSONTyped=e_;Xn.ConnectionInfoV2ToJSON=QA;var Ou=Y(),jg=G(),Xg;(function(e){e.Udp="udp",e.Tcp="tcp"})(Xg||(Xn.ConnectionInfoV2ProtocolEnum=Xg={}));function ZA(e){return e_(e,!1)}function e_(e,t){return e==null?e:{type:e.type,protocol:(0,Ou.exists)(e,"protocol")?e.protocol:void 0,ipProtocolVersion:(0,Ou.exists)(e,"ipProtocolVersion")?(0,jg.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,host:(0,Ou.exists)(e,"host")?e.host:void 0,port:(0,Ou.exists)(e,"port")?e.port:void 0,timestamp:new Date(e.timestamp)}}function QA(e){if(e!==void 0)return e===null?null:{type:e.type,protocol:e.protocol,ipProtocolVersion:(0,jg.IpProtocolVersionToJSON)(e.ipProtocolVersion),host:e.host,port:e.port,timestamp:e.timestamp.toISOString()}}});var i_=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.CreateInstanceRequestFromJSON=$A;La.CreateInstanceRequestFromJSONTyped=r_;La.CreateInstanceRequestToJSON=XA;var YA=Y(),n_=G();function $A(e){return r_(e,!1)}function r_(e,t){return e==null?e:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,n_.InstanceVersionDataFromJSON)(e.version),expireAt:(0,YA.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function XA(e){if(e!==void 0)return e===null?null:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,n_.InstanceVersionDataToJSON)(e.version),expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var o_=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.CreateInstanceResponseFromJSON=jA;Ua.CreateInstanceResponseFromJSONTyped=a_;Ua.CreateInstanceResponseToJSON=ew;var Du=G();function jA(e){return a_(e,!1)}function a_(e,t){return e==null?e:{instance:(0,Du.InstanceFromJSON)(e.instance),config:(0,Du.ConfigFromJSON)(e.config)}}function ew(e){if(e!==void 0)return e===null?null:{instance:(0,Du.InstanceToJSON)(e.instance),config:(0,Du.ConfigToJSON)(e.config)}}});var d_=p(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.DestinationTypeEnum=void 0;jn.DestinationFromJSON=tw;jn.DestinationFromJSONTyped=c_;jn.DestinationToJSON=nw;var u_=G(),s_;(function(e){e.UserId="userId",e.Phonenumber="phonenumber",e.Conference="conference",e.Sip="sip"})(s_||(jn.DestinationTypeEnum=s_={}));function tw(e){return c_(e,!1)}function c_(e,t){return e==null?e:{domain:(0,u_.DomainFromJSON)(e.domain),type:e.type,identity:e.identity}}function nw(e){if(e!==void 0)return e===null?null:{domain:(0,u_.DomainToJSON)(e.domain),type:e.type,identity:e.identity}}});var h_=p(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.Direction=void 0;er.DirectionFromJSON=rw;er.DirectionFromJSONTyped=f_;er.DirectionToJSON=iw;var l_;(function(e){e.Inbound="inbound",e.Outbound="outbound"})(l_||(er.Direction=l_={}));function rw(e){return f_(e,!1)}function f_(e,t){return e}function iw(e){return e}});var m_=p(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.Domain=void 0;tr.DomainFromJSON=aw;tr.DomainFromJSONTyped=v_;tr.DomainToJSON=ow;var p_;(function(e){e.Mxp="mxp",e.Pstn="pstn",e.Sip="sip",e.Conference="conference"})(p_||(tr.Domain=p_={}));function aw(e){return v_(e,!1)}function v_(e,t){return e}function ow(e){return e}});var __=p(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.ErrorResponseFromJSON=sw;Wa.ErrorResponseFromJSONTyped=g_;Wa.ErrorResponseToJSON=uw;function sw(e){return g_(e,!1)}function g_(e,t){return e==null?e:{error:e.error}}function uw(e){if(e!==void 0)return e===null?null:{error:e.error}}});var E_=p(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.EventResultTypeEnum=void 0;nr.EventResultFromJSON=cw;nr.EventResultFromJSONTyped=C_;nr.EventResultToJSON=dw;var x_=Y(),y_=G(),S_;(function(e){e.Success="success",e.Failure="failure"})(S_||(nr.EventResultTypeEnum=S_={}));function cw(e){return C_(e,!1)}function C_(e,t){return e==null?e:{type:e.type,errorCode:(0,x_.exists)(e,"errorCode")?e.errorCode:void 0,errorDomain:(0,x_.exists)(e,"errorDomain")?(0,y_.ClientErrorDomainFromJSON)(e.errorDomain):void 0}}function dw(e){if(e!==void 0)return e===null?null:{type:e.type,errorCode:e.errorCode,errorDomain:(0,y_.ClientErrorDomainToJSON)(e.errorDomain)}}});var T_=p(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.EventType=void 0;rr.EventTypeFromJSON=lw;rr.EventTypeFromJSONTyped=I_;rr.EventTypeToJSON=fw;var b_;(function(e){e.ClientEventType="ClientEventType",e.EventResultType="EventResultType"})(b_||(rr.EventType=b_={}));function lw(e){return I_(e,!1)}function I_(e,t){return e}function fw(e){return e}});var w_=p(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.ExtendedCallReportFromJSON=hw;Ha.ExtendedCallReportFromJSONTyped=A_;Ha.ExtendedCallReportToJSON=pw;var Te=Y(),ee=G();function hw(e){return A_(e,!1)}function A_(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 pw(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 D_=p(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ExtendedCallReportAllOfFromJSON=vw;Ka.ExtendedCallReportAllOfFromJSONTyped=O_;Ka.ExtendedCallReportAllOfToJSON=mw;var Va=Y(),pn=G();function vw(e){return O_(e,!1)}function O_(e,t){return e==null?e:{rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:(0,Va.exists)(e,"mxpEventLog")?e.mxpEventLog:void 0,callQuality:(0,Va.exists)(e,"callQuality")?(0,pn.CallQualityFromJSON)(e.callQuality):void 0,audioRouteEventLog:(0,Va.exists)(e,"audioRouteEventLog")?(0,pn.AudioRouteEventLogFromJSON)(e.audioRouteEventLog):void 0,pushProvider:(0,Va.exists)(e,"pushProvider")?(0,pn.PushProviderFromJSON)(e.pushProvider):void 0,clientEvents:(0,Va.exists)(e,"clientEvents")?(0,pn.ClientEventsFromJSON)(e.clientEvents):void 0}}function mw(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 F_=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.FcmPushProfileFromJSON=gw;za.FcmPushProfileFromJSONTyped=R_;za.FcmPushProfileToJSON=_w;function gw(e){return R_(e,!1)}function R_(e,t){return e==null?e:{registrationId:e.registrationId,senderId:e.senderId}}function _w(e){if(e!==void 0)return e===null?null:{registrationId:e.registrationId,senderId:e.senderId}}});var N_=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.IceCandidateFromJSON=xw;Ga.IceCandidateFromJSONTyped=P_;Ga.IceCandidateToJSON=Sw;var ir=Y(),vn=G();function xw(e){return P_(e,!1)}function P_(e,t){return e==null?e:{address:(0,ir.exists)(e,"address")?e.address:void 0,port:(0,ir.exists)(e,"port")?e.port:void 0,ipProtocolVersion:(0,ir.exists)(e,"ipProtocolVersion")?(0,vn.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,type:(0,ir.exists)(e,"type")?(0,vn.IceCandidateTypeFromJSON)(e.type):void 0,transportProtocol:(0,ir.exists)(e,"transportProtocol")?(0,vn.TransportProtocolFromJSON)(e.transportProtocol):void 0,relayProtocol:(0,ir.exists)(e,"relayProtocol")?(0,vn.RelayProtocolFromJSON)(e.relayProtocol):void 0,url:(0,ir.exists)(e,"url")?e.url:void 0}}function Sw(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 q_=p(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.IceCandidateType=void 0;ar.IceCandidateTypeFromJSON=yw;ar.IceCandidateTypeFromJSONTyped=B_;ar.IceCandidateTypeToJSON=Cw;var M_;(function(e){e.Host="host",e.Srflx="srflx",e.Prflx="prflx",e.Relay="relay",e.Local="local",e.Stun="stun"})(M_||(ar.IceCandidateType=M_={}));function yw(e){return B_(e,!1)}function B_(e,t){return e}function Cw(e){return e}});var U_=p(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.IceServerCredentialTypeEnum=void 0;or.IceServerFromJSON=Ew;or.IceServerFromJSONTyped=L_;or.IceServerToJSON=bw;var dl=Y(),J_=G(),k_;(function(e){e.Oauth="oauth",e.Password="password"})(k_||(or.IceServerCredentialTypeEnum=k_={}));function Ew(e){return L_(e,!1)}function L_(e,t){return e==null?e:{urls:e.urls,username:(0,dl.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,dl.exists)(e,"password")?e.password:void 0,oauthCredential:(0,dl.exists)(e,"oauthCredential")?(0,J_.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0,validUntil:new Date(e.validUntil)}}function bw(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,J_.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential),validUntil:e.validUntil.toISOString()}}});var H_=p(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.IceServerAllOfFromJSON=Iw;Za.IceServerAllOfFromJSONTyped=W_;Za.IceServerAllOfToJSON=Tw;function Iw(e){return W_(e,!1)}function W_(e,t){return e==null?e:{validUntil:new Date(e.validUntil)}}function Tw(e){if(e!==void 0)return e===null?null:{validUntil:e.validUntil.toISOString()}}});var z_=p(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.IceServersResponseFromJSON=Aw;Qa.IceServersResponseFromJSONTyped=K_;Qa.IceServersResponseToJSON=ww;var V_=G();function Aw(e){return K_(e,!1)}function K_(e,t){return e==null?e:{iceServers:e.iceServers.map(V_.IceServerFromJSON)}}function ww(e){if(e!==void 0)return e===null?null:{iceServers:e.iceServers.map(V_.IceServerToJSON)}}});var Q_=p(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.InstanceFromJSON=Dw;Ya.InstanceFromJSONTyped=Z_;Ya.InstanceToJSON=Rw;var Ow=Y(),G_=G();function Dw(e){return Z_(e,!1)}function Z_(e,t){return e==null?e:{id:e.id,secret:e.secret,deviceId:(0,Ow.exists)(e,"deviceId")?e.deviceId:void 0,expireAt:new Date(e.expireAt),capabilities:e.capabilities,version:(0,G_.InstanceVersionDataFromJSON)(e.version)}}function Rw(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,G_.InstanceVersionDataToJSON)(e.version)}}});var j_=p($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.InstanceVersionDataFromJSON=Fw;$a.InstanceVersionDataFromJSONTyped=X_;$a.InstanceVersionDataToJSON=Pw;var Y_=Y(),$_=G();function Fw(e){return X_(e,!1)}function X_(e,t){return e==null?e:{platform:(0,$_.PlatformIdentifierFromJSON)(e.platform),os:e.os,osName:(0,Y_.exists)(e,"osName")?e.osName:void 0,osVersion:(0,Y_.exists)(e,"osVersion")?e.osVersion:void 0,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}function Pw(e){if(e!==void 0)return e===null?null:{platform:(0,$_.PlatformIdentifierToJSON)(e.platform),os:e.os,osName:e.osName,osVersion:e.osVersion,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}});var nx=p(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.IpProtocolVersion=void 0;sr.IpProtocolVersionFromJSON=Nw;sr.IpProtocolVersionFromJSONTyped=tx;sr.IpProtocolVersionToJSON=Mw;var ex;(function(e){e.Ipv4="ipv4",e.Ipv6="ipv6",e.Unknown="unknown"})(ex||(sr.IpProtocolVersion=ex={}));function Nw(e){return tx(e,!1)}function tx(e,t){return e}function Mw(e){return e}});var ax=p(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.MediaStreamType=void 0;ur.MediaStreamTypeFromJSON=Bw;ur.MediaStreamTypeFromJSONTyped=ix;ur.MediaStreamTypeToJSON=qw;var rx;(function(e){e.Audio="audio",e.Video="video"})(rx||(ur.MediaStreamType=rx={}));function Bw(e){return ix(e,!1)}function ix(e,t){return e}function qw(e){return e}});var sx=p(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ModelErrorFromJSON=Jw;Xa.ModelErrorFromJSONTyped=ox;Xa.ModelErrorToJSON=Lw;var kw=Y();function Jw(e){return ox(e,!1)}function ox(e,t){return e==null?e:{code:e.code,message:e.message,reference:(0,kw.exists)(e,"reference")?e.reference:void 0}}function Lw(e){if(e!==void 0)return e===null?null:{code:e.code,message:e.message,reference:e.reference}}});var cx=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.MxpPubSubConfigFromJSON=Ww;ja.MxpPubSubConfigFromJSONTyped=ux;ja.MxpPubSubConfigToJSON=Hw;var Uw=Y();function Ww(e){return ux(e,!1)}function ux(e,t){return e==null?e:{hostname:e.hostname,signalSubscribeKey:e.signalSubscribeKey,signalPublishKey:e.signalPublishKey,broadcastSubscribeKey:e.broadcastSubscribeKey,pubnubClientId:(0,Uw.exists)(e,"pubnubClientId")?e.pubnubClientId:void 0}}function Hw(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 lx=p(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.OpaquePushProfileFromJSON=Vw;eo.OpaquePushProfileFromJSONTyped=dx;eo.OpaquePushProfileToJSON=Kw;function Vw(e){return dx(e,!1)}function dx(e,t){return e==null?e:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}function Kw(e){if(e!==void 0)return e===null?null:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}});var px=p(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.OriginFromJSON=Gw;to.OriginFromJSONTyped=hx;to.OriginToJSON=Zw;var zw=Y(),fx=G();function Gw(e){return hx(e,!1)}function hx(e,t){return e==null?e:{domain:(0,zw.exists)(e,"domain")?(0,fx.DomainFromJSON)(e.domain):void 0,identity:e.identity}}function Zw(e){if(e!==void 0)return e===null?null:{domain:(0,fx.DomainToJSON)(e.domain),identity:e.identity}}});var gx=p(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.PlatformIdentifier=void 0;cr.PlatformIdentifierFromJSON=Qw;cr.PlatformIdentifierFromJSONTyped=mx;cr.PlatformIdentifierToJSON=Yw;var vx;(function(e){e.Ios="ios",e.Android="android",e.Js="js",e.Test="test"})(vx||(cr.PlatformIdentifier=vx={}));function Qw(e){return mx(e,!1)}function mx(e,t){return e}function Yw(e){return e}});var Sx=p(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.PrimaryMediaTransportType=void 0;dr.PrimaryMediaTransportTypeFromJSON=$w;dr.PrimaryMediaTransportTypeFromJSONTyped=xx;dr.PrimaryMediaTransportTypeToJSON=Xw;var _x;(function(e){e.Proxy="proxy",e.P2p="p2p"})(_x||(dr.PrimaryMediaTransportType=_x={}));function $w(e){return xx(e,!1)}function xx(e,t){return e}function Xw(e){return e}});var Ex=p(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.PushConfigFromJSON=jw;no.PushConfigFromJSONTyped=Cx;no.PushConfigToJSON=eO;var yx=Y();function jw(e){return Cx(e,!1)}function Cx(e,t){return e==null?e:{fcmSenderId:(0,yx.exists)(e,"fcmSenderId")?e.fcmSenderId:void 0,w3cApplicationServerKey:(0,yx.exists)(e,"w3cApplicationServerKey")?e.w3cApplicationServerKey:void 0}}function eO(e){if(e!==void 0)return e===null?null:{fcmSenderId:e.fcmSenderId,w3cApplicationServerKey:e.w3cApplicationServerKey}}});var Tx=p(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.PushNotificationFromJSON=tO;ro.PushNotificationFromJSONTyped=Ix;ro.PushNotificationToJSON=nO;var bx=G();function tO(e){return Ix(e,!1)}function Ix(e,t){return e==null?e:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(bx.PushNotificationDestinationFromJSON)}}function nO(e){if(e!==void 0)return e===null?null:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(bx.PushNotificationDestinationToJSON)}}});var wx=p(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.PushNotificationDestinationFromJSON=rO;io.PushNotificationDestinationFromJSONTyped=Ax;io.PushNotificationDestinationToJSON=iO;function rO(e){return Ax(e,!1)}function Ax(e,t){return e==null?e:{userId:e.userId,instanceId:e.instanceId}}function iO(e){if(e!==void 0)return e===null?null:{userId:e.userId,instanceId:e.instanceId}}});var Dx=p(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.PushProfileFromJSON=aO;ao.PushProfileFromJSONTyped=Ox;ao.PushProfileToJSON=oO;var ei=Y(),Ct=G();function aO(e){return Ox(e,!1)}function Ox(e,t){return e==null?e:{maxPayloadSize:(0,ei.exists)(e,"maxPayloadSize")?e.maxPayloadSize:void 0,apn:(0,ei.exists)(e,"apn")?e.apn.map(Ct.ApnPushProfileFromJSON):void 0,fcm:(0,ei.exists)(e,"fcm")?(0,Ct.FcmPushProfileFromJSON)(e.fcm):void 0,opaque:(0,ei.exists)(e,"opaque")?(0,Ct.OpaquePushProfileFromJSON)(e.opaque):void 0,upa:(0,ei.exists)(e,"upa")?(0,Ct.UpaPushProfileFromJSON)(e.upa):void 0,w3c:(0,ei.exists)(e,"w3c")?(0,Ct.W3CPushProfileFromJSON)(e.w3c):void 0}}function oO(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 Px=p(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.PushProvider=void 0;lr.PushProviderFromJSON=sO;lr.PushProviderFromJSONTyped=Fx;lr.PushProviderToJSON=uO;var Rx;(function(e){e.Apns="apns",e.Fcm="fcm",e.HuaweiHms="huawei-hms",e.W3c="w3c"})(Rx||(lr.PushProvider=Rx={}));function sO(e){return Fx(e,!1)}function Fx(e,t){return e}function uO(e){return e}});var Bx=p(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.RelayProtocol=void 0;fr.RelayProtocolFromJSON=cO;fr.RelayProtocolFromJSONTyped=Mx;fr.RelayProtocolToJSON=dO;var Nx;(function(e){e.Udp="udp",e.Tcp="tcp",e.Tls="tls"})(Nx||(fr.RelayProtocol=Nx={}));function cO(e){return Mx(e,!1)}function Mx(e,t){return e}function dO(e){return e}});var Jx=p(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.RemotePeerInstanceFromJSON=lO;oo.RemotePeerInstanceFromJSONTyped=kx;oo.RemotePeerInstanceToJSON=fO;var ll=Y(),qx=G();function lO(e){return kx(e,!1)}function kx(e,t){return e==null?e:{id:(0,ll.exists)(e,"id")?e.id:void 0,capabilities:(0,ll.exists)(e,"capabilities")?e.capabilities:void 0,pushProfile:(0,ll.exists)(e,"pushProfile")?(0,qx.RemotePeerInstancePushProfileFromJSON)(e.pushProfile):void 0}}function fO(e){if(e!==void 0)return e===null?null:{id:e.id,capabilities:e.capabilities,pushProfile:(0,qx.RemotePeerInstancePushProfileToJSON)(e.pushProfile)}}});var Ux=p(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.RemotePeerInstancePushProfileFromJSON=pO;so.RemotePeerInstancePushProfileFromJSONTyped=Lx;so.RemotePeerInstancePushProfileToJSON=vO;var hO=Y();function pO(e){return Lx(e,!1)}function Lx(e,t){return e==null?e:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:(0,hO.exists)(e,"legacyPushData")?e.legacyPushData:void 0}}function vO(e){if(e!==void 0)return e===null?null:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:e.legacyPushData}}});var Vx=p(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.RtcConfigFromJSON=gO;uo.RtcConfigFromJSONTyped=Hx;uo.RtcConfigToJSON=_O;var mO=Y(),Wx=G();function gO(e){return Hx(e,!1)}function Hx(e,t){return e==null?e:{mxpPubSubConfig:(0,Wx.MxpPubSubConfigFromJSON)(e.mxpPubSubConfig),legacyStunUrls:(0,mO.exists)(e,"legacyStunUrls")?e.legacyStunUrls:void 0}}function _O(e){if(e!==void 0)return e===null?null:{mxpPubSubConfig:(0,Wx.MxpPubSubConfigToJSON)(e.mxpPubSubConfig),legacyStunUrls:e.legacyStunUrls}}});var zx=p(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.RtcProfileFromJSON=xO;co.RtcProfileFromJSONTyped=Kx;co.RtcProfileToJSON=SO;function xO(e){return Kx(e,!1)}function Kx(e,t){return e==null?e:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}function SO(e){if(e!==void 0)return e===null?null:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}});var Qx=p(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.SdpSemantics=void 0;hr.SdpSemanticsFromJSON=yO;hr.SdpSemanticsFromJSONTyped=Zx;hr.SdpSemanticsToJSON=CO;var Gx;(function(e){e.PlanB="planB",e.UnifiedPlan="unifiedPlan"})(Gx||(hr.SdpSemantics=Gx={}));function yO(e){return Zx(e,!1)}function Zx(e,t){return e}function CO(e){return e}});var $x=p(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SemanticVersionFromJSON=EO;lo.SemanticVersionFromJSONTyped=Yx;lo.SemanticVersionToJSON=bO;function EO(e){return Yx(e,!1)}function Yx(e,t){return e==null?e:{major:e.major,minor:e.minor}}function bO(e){if(e!==void 0)return e===null?null:{major:e.major,minor:e.minor}}});var e1=p(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.TransportProtocol=void 0;pr.TransportProtocolFromJSON=IO;pr.TransportProtocolFromJSONTyped=jx;pr.TransportProtocolToJSON=TO;var Xx;(function(e){e.Tcp="tcp",e.Udp="udp"})(Xx||(pr.TransportProtocol=Xx={}));function IO(e){return jx(e,!1)}function jx(e,t){return e}function TO(e){return e}});var n1=p(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.UpaPushProfileFromJSON=AO;fo.UpaPushProfileFromJSONTyped=t1;fo.UpaPushProfileToJSON=wO;function AO(e){return t1(e,!1)}function t1(e,t){return e==null?e:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}function wO(e){if(e!==void 0)return e===null?null:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}});var a1=p(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.UpdateInstanceRequestFromJSON=OO;ho.UpdateInstanceRequestFromJSONTyped=i1;ho.UpdateInstanceRequestToJSON=DO;var r1=G();function OO(e){return i1(e,!1)}function i1(e,t){return e==null?e:{capabilities:e.capabilities,version:(0,r1.InstanceVersionDataFromJSON)(e.version)}}function DO(e){if(e!==void 0)return e===null?null:{capabilities:e.capabilities,version:(0,r1.InstanceVersionDataToJSON)(e.version)}}});var s1=p(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.UpdateInstanceTtlRequestFromJSON=FO;po.UpdateInstanceTtlRequestFromJSONTyped=o1;po.UpdateInstanceTtlRequestToJSON=PO;var RO=Y();function FO(e){return o1(e,!1)}function o1(e,t){return e==null?e:{expireAt:(0,RO.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function PO(e){if(e!==void 0)return e===null?null:{expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var c1=p(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.UpdateInstanceTtlResponseFromJSON=NO;vo.UpdateInstanceTtlResponseFromJSONTyped=u1;vo.UpdateInstanceTtlResponseToJSON=MO;function NO(e){return u1(e,!1)}function u1(e,t){return e==null?e:{instanceId:e.instanceId,expireAt:new Date(e.expireAt)}}function MO(e){if(e!==void 0)return e===null?null:{instanceId:e.instanceId,expireAt:e.expireAt.toISOString()}}});var l1=p(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.UserDebugInfoResponseFromJSON=BO;mo.UserDebugInfoResponseFromJSONTyped=d1;mo.UserDebugInfoResponseToJSON=qO;function BO(e){return d1(e,!1)}function d1(e,t){return e==null?e:{createdAt:new Date(e.createdAt),blocked:e.blocked,instanceCount:e.instanceCount,pushProfileCount:e.pushProfileCount,instanceIds:e.instanceIds}}function qO(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 p1=p(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.W3CPushProfileFromJSON=kO;go.W3CPushProfileFromJSONTyped=h1;go.W3CPushProfileToJSON=JO;var f1=G();function kO(e){return h1(e,!1)}function h1(e,t){return e==null?e:{endpoint:e.endpoint,keys:(0,f1.W3CPushProfileKeysFromJSON)(e.keys),expirationTime:new Date(e.expirationTime),applicationServerKey:e.applicationServerKey}}function JO(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,keys:(0,f1.W3CPushProfileKeysToJSON)(e.keys),expirationTime:e.expirationTime.toISOString(),applicationServerKey:e.applicationServerKey}}});var m1=p(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.W3CPushProfileKeysFromJSON=LO;_o.W3CPushProfileKeysFromJSONTyped=v1;_o.W3CPushProfileKeysToJSON=UO;function LO(e){return v1(e,!1)}function v1(e,t){return e==null?e:{p256dh:e.p256dh,auth:e.auth}}function UO(e){if(e!==void 0)return e===null?null:{p256dh:e.p256dh,auth:e.auth}}});var _1=p(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.WarningEventFromJSON=HO;xo.WarningEventFromJSONTyped=g1;xo.WarningEventToJSON=VO;var WO=Y(),ti=G();function HO(e){return g1(e,!1)}function g1(e,t){return e==null?e:{name:(0,ti.WarningEventNameFromJSON)(e.name),time:new Date(e.time),type:(0,ti.WarningEventTypeFromJSON)(e.type),mediaStreamType:(0,WO.exists)(e,"mediaStreamType")?(0,ti.MediaStreamTypeFromJSON)(e.mediaStreamType):void 0}}function VO(e){if(e!==void 0)return e===null?null:{name:(0,ti.WarningEventNameToJSON)(e.name),time:e.time.toISOString(),type:(0,ti.WarningEventTypeToJSON)(e.type),mediaStreamType:(0,ti.MediaStreamTypeToJSON)(e.mediaStreamType)}}});var y1=p(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.WarningEventName=void 0;vr.WarningEventNameFromJSON=KO;vr.WarningEventNameFromJSONTyped=S1;vr.WarningEventNameToJSON=zO;var x1;(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"})(x1||(vr.WarningEventName=x1={}));function KO(e){return S1(e,!1)}function S1(e,t){return e}function zO(e){return e}});var b1=p(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.WarningEventType=void 0;mr.WarningEventTypeFromJSON=GO;mr.WarningEventTypeFromJSONTyped=E1;mr.WarningEventTypeToJSON=ZO;var C1;(function(e){e.Trigger="trigger",e.Recover="recover"})(C1||(mr.WarningEventType=C1={}));function GO(e){return E1(e,!1)}function E1(e,t){return e}function ZO(e){return e}});var w1=p(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.WebrtcRTCIceServerCredentialTypeEnum=void 0;gr.WebrtcRTCIceServerFromJSON=QO;gr.WebrtcRTCIceServerFromJSONTyped=A1;gr.WebrtcRTCIceServerToJSON=YO;var fl=Y(),T1=G(),I1;(function(e){e.Oauth="oauth",e.Password="password"})(I1||(gr.WebrtcRTCIceServerCredentialTypeEnum=I1={}));function QO(e){return A1(e,!1)}function A1(e,t){return e==null?e:{urls:e.urls,username:(0,fl.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,fl.exists)(e,"password")?e.password:void 0,oauthCredential:(0,fl.exists)(e,"oauthCredential")?(0,T1.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0}}function YO(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,T1.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential)}}});var D1=p(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.WebrtcRTCOAuthCredentialFromJSON=$O;So.WebrtcRTCOAuthCredentialFromJSONTyped=O1;So.WebrtcRTCOAuthCredentialToJSON=XO;function $O(e){return O1(e,!1)}function O1(e,t){return e==null?e:{macKey:e.macKey,accessToken:e.accessToken}}function XO(e){if(e!==void 0)return e===null?null:{macKey:e.macKey,accessToken:e.accessToken}}});var F1=p(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.WebrtcRTCSessionDescriptionFromJSON=jO;yo.WebrtcRTCSessionDescriptionFromJSONTyped=R1;yo.WebrtcRTCSessionDescriptionToJSON=e2;function jO(e){return R1(e,!1)}function R1(e,t){return e==null?e:{type:e.type,sdp:e.sdp}}function e2(e){if(e!==void 0)return e===null?null:{type:e.type,sdp:e.sdp}}});var G=p(q=>{"use strict";var t2=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)&&t2(t,e,n)};Object.defineProperty(q,"__esModule",{value:!0});U(pg(),q);U(mg(),q);U(_g(),q);U(Sg(),q);U(Cg(),q);U(Ig(),q);U(Ag(),q);U(Og(),q);U(Fg(),q);U(Mg(),q);U(kg(),q);U(Ug(),q);U(Hg(),q);U(Kg(),q);U(Qg(),q);U($g(),q);U(t_(),q);U(i_(),q);U(o_(),q);U(d_(),q);U(h_(),q);U(m_(),q);U(__(),q);U(E_(),q);U(T_(),q);U(w_(),q);U(D_(),q);U(F_(),q);U(N_(),q);U(q_(),q);U(U_(),q);U(H_(),q);U(z_(),q);U(Q_(),q);U(j_(),q);U(nx(),q);U(ax(),q);U(sx(),q);U(cx(),q);U(lx(),q);U(px(),q);U(gx(),q);U(Sx(),q);U(Ex(),q);U(Tx(),q);U(wx(),q);U(Dx(),q);U(Px(),q);U(Bx(),q);U(Jx(),q);U(Ux(),q);U(Vx(),q);U(zx(),q);U(Qx(),q);U($x(),q);U(e1(),q);U(n1(),q);U(a1(),q);U(s1(),q);U(c1(),q);U(l1(),q);U(p1(),q);U(m1(),q);U(_1(),q);U(y1(),q);U(b1(),q);U(w1(),q);U(D1(),q);U(F1(),q)});var M1=p(ni=>{"use strict";var P1=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.CallApi=void 0;var hl=Y(),N1=G(),pl=class extends hl.BaseAPI{initiateCallRaw(t){return P1(this,void 0,void 0,function*(){if(t.callInitiationRequest===null||t.callInitiationRequest===void 0)throw new hl.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,N1.CallInitiationRequestToJSON)(t.callInitiationRequest)});return new hl.JSONApiResponse(i,a=>(0,N1.CallInitiationResponseFromJSON)(a))})}initiateCall(t){return P1(this,void 0,void 0,function*(){return yield(yield this.initiateCallRaw(t)).value()})}};ni.CallApi=pl});var q1=p(ri=>{"use strict";var B1=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.CallReportApi=void 0;var vl=Y(),n2=G(),ml=class extends vl.BaseAPI{createCallReportRaw(t){return B1(this,void 0,void 0,function*(){if(t.callReport===null||t.callReport===void 0)throw new vl.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,n2.CallReportToJSON)(t.callReport)});return new vl.VoidApiResponse(i)})}createCallReport(t){return B1(this,void 0,void 0,function*(){yield this.createCallReportRaw(t)})}};ri.CallReportApi=ml});var J1=p(ii=>{"use strict";var k1=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.ConfigApi=void 0;var Ru=Y(),r2=G(),gl=class extends Ru.BaseAPI{getConfigRaw(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 getConfig.");if(t.instanceId===null||t.instanceId===void 0)throw new Ru.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 Ru.JSONApiResponse(i,a=>(0,r2.ConfigFromJSON)(a))})}getConfig(t){return k1(this,void 0,void 0,function*(){return yield(yield this.getConfigRaw(t)).value()})}};ii.ConfigApi=gl});var U1=p(ai=>{"use strict";var L1=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.DebugApi=void 0;var _l=Y(),i2=G(),xl=class extends _l.BaseAPI{getUserDebugInfoRaw(t){return L1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new _l.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 _l.JSONApiResponse(i,a=>(0,i2.UserDebugInfoResponseFromJSON)(a))})}getUserDebugInfo(t){return L1(this,void 0,void 0,function*(){return yield(yield this.getUserDebugInfoRaw(t)).value()})}};ai.DebugApi=xl});var H1=p(oi=>{"use strict";var W1=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.FeatureFlagsApi=void 0;var Fu=Y(),Sl=class extends Fu.BaseAPI{getFeatureFlagsRaw(t){return W1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Fu.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getFeatureFlags.");if(t.instanceId===null||t.instanceId===void 0)throw new Fu.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 Fu.JSONApiResponse(i)})}getFeatureFlags(t){return W1(this,void 0,void 0,function*(){return yield(yield this.getFeatureFlagsRaw(t)).value()})}};oi.FeatureFlagsApi=Sl});var K1=p(si=>{"use strict";var V1=si&&si.__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(si,"__esModule",{value:!0});si.IceApi=void 0;var Pu=Y(),a2=G(),yl=class extends Pu.BaseAPI{getIceServersRaw(t){return V1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Pu.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getIceServers.");if(t.instanceId===null||t.instanceId===void 0)throw new Pu.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 Pu.JSONApiResponse(i,a=>(0,a2.IceServersResponseFromJSON)(a))})}getIceServers(t){return V1(this,void 0,void 0,function*(){return yield(yield this.getIceServersRaw(t)).value()})}};si.IceApi=yl});var z1=p(di=>{"use strict";var ui=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.InstanceApi=void 0;var Xe=Y(),ci=G(),Cl=class extends Xe.BaseAPI{createInstanceRaw(t){return ui(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,ci.CreateInstanceRequestToJSON)(t.createInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.CreateInstanceResponseFromJSON)(a))})}createInstance(t){return ui(this,void 0,void 0,function*(){return yield(yield this.createInstanceRaw(t)).value()})}updateInstanceRaw(t){return ui(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,ci.UpdateInstanceRequestToJSON)(t.updateInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.InstanceFromJSON)(a))})}updateInstance(t){return ui(this,void 0,void 0,function*(){return yield(yield this.updateInstanceRaw(t)).value()})}updateInstanceTtlRaw(t){return ui(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,ci.UpdateInstanceTtlRequestToJSON)(t.updateInstanceTtlRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.UpdateInstanceTtlResponseFromJSON)(a))})}updateInstanceTtl(t){return ui(this,void 0,void 0,function*(){return yield(yield this.updateInstanceTtlRaw(t)).value()})}};di.InstanceApi=Cl});var G1=p(li=>{"use strict";var je=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.PushApi=void 0;var Ee=Y(),Nu=G(),El=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,Nu.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,Nu.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(Nu.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,Nu.PushProfileToJSON)(t.pushProfile)});return new Ee.VoidApiResponse(i)})}updatePushProfile(t){return je(this,void 0,void 0,function*(){yield this.updatePushProfileRaw(t)})}};li.PushApi=El});var bl=p(Be=>{"use strict";var o2=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)&&o2(t,e,n)};Object.defineProperty(Be,"__esModule",{value:!0});mn(M1(),Be);mn(q1(),Be);mn(J1(),Be);mn(U1(),Be);mn(H1(),Be);mn(K1(),Be);mn(z1(),Be);mn(G1(),Be)});var qe=p(Vt=>{"use strict";var s2=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]})),Il=Vt&&Vt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&s2(t,e,n)};Object.defineProperty(Vt,"__esModule",{value:!0});Il(Y(),Vt);Il(bl(),Vt);Il(G(),Vt)});var Z1=p(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Codec=void 0;var De=Zn(),u2=qe(),Mu=ht(),Tl=ft(),Al=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 Tl.Body(Tl.Body.clientType,JSON.stringify(n))}static decodeClient(t){if(t.type!==Tl.Body.clientType)throw new Mu.MXPError(Mu.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:u2.Domain.Mxp}}catch{throw new Mu.MXPError(Mu.MXPError.Codes.BODY_PARSE_FAIL)}}};Bu.Codec=Al});var ht=p(Ve=>{"use strict";var c2=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]})),_r=Ve&&Ve.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&c2(t,e,n)};Object.defineProperty(Ve,"__esModule",{value:!0});_r(Ds(),Ve);_r(Z0(),Ve);_r(ug(),Ve);_r(X0(),Ve);_r(cg(),Ve);_r(dg(),Ve);_r(Z1(),Ve)});var Q1=p(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.JsepMessage=void 0;var d2=ht(),wl=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==d2.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"}};qu.JsepMessage=wl});var Co=p(gn=>{"use strict";var l2=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]})),Y1=gn&&gn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&l2(t,e,n)};Object.defineProperty(gn,"__esModule",{value:!0});Y1(Vv(),gn);Y1(Q1(),gn)});var Ol=p(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.markPipelineOwned=f2;ku.isPipelineOwned=h2;var $1=new WeakSet;function f2(e){$1.add(e)}function h2(e){return $1.has(e)}});var X1=p(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.WebRTCFactory=void 0;var Dl=class{static createPeerConnection(t){return new RTCPeerConnection(t)}};Ju.WebRTCFactory=Dl});var Ae=p(K=>{"use strict";var p2=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=Rl;K.constant=Eo;K.flip=y2;K.flow=j1;K.tuple=C2;K.increment=E2;K.decrement=b2;K.absurd=eS;K.tupled=I2;K.untupled=T2;K.pipe=A2;K.not=O2;var v2=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=v2;var m2=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}};K.getSemigroup=m2;var g2=function(e){var t=(0,K.getSemigroup)(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};K.getMonoid=g2;var _2=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=_2;var x2=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=x2;var S2=function(e){return function(t){return t(e)}};K.apply=S2;function Rl(e){return e}K.unsafeCoerce=Rl;function Eo(e){return function(){return e}}K.constTrue=Eo(!0);K.constFalse=Eo(!1);K.constNull=Eo(null);K.constUndefined=Eo(void 0);K.constVoid=K.constUndefined;function y2(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 j1(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 C2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function E2(e){return e+1}function b2(e){return e-1}function eS(e){throw new Error("Called `absurd` function which should be uncallable")}function I2(e){return function(t){return e.apply(void 0,t)}}function T2(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function A2(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=eS;var w2=function(e,t){return t};K.SK=w2;function O2(e){return function(t){return!e(t)}}var D2=function(){return{concat:function(e,t){return j1(e,t)},empty:Rl}};K.getEndomorphismMonoid=D2;var R2=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,p2([i],r,!1))}}};K.dual=R2});var xr=p(W=>{"use strict";var F2=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 fi=Ae(),P2=function(e){return e._tag==="None"};W.isNone=P2;var N2=function(e){return e._tag==="Some"};W.isSome=N2;W.none={_tag:"None"};var M2=function(e){return{_tag:"Some",value:e}};W.some=M2;var B2=function(e){return e._tag==="Left"};W.isLeft=B2;var q2=function(e){return e._tag==="Right"};W.isRight=q2;var k2=function(e){return{_tag:"Left",left:e}};W.left=k2;var J2=function(e){return{_tag:"Right",right:e}};W.right=J2;var L2=function(e){return[e]};W.singleton=L2;var U2=function(e){return e.length>0};W.isNonEmpty=U2;var W2=function(e){return e[0]};W.head=W2;var H2=function(e){return e.slice(1)};W.tail=H2;W.emptyReadonlyArray=[];W.emptyRecord={};W.has=Object.prototype.hasOwnProperty;var V2=function(e){return F2([e[0]],e.slice(1),!0)};W.fromReadonlyNonEmptyArray=V2;var K2=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=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((0,W.isNone)(a)?(0,W.left)(n.apply(void 0,r)):(0,W.right)(a.value))}}};W.liftOption=z2;var G2=function(e,t){return(0,fi.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftNullable)(e)(r,i))})};W.flatMapNullable=G2;var Z2=function(e,t){return(0,fi.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftOption)(e)(r,i))})};W.flatMapOption=Z2;var Q2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};W.flatMapEither=Q2;var Y2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromIO(r(i))})})};W.flatMapIO=Y2;var $2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromTask(r(i))})})};W.flatMapTask=$2;var X2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromReader(r(i))})})};W.flatMapReader=X2});var Lu=p(Re=>{"use strict";var j2=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]})),eD=Re&&Re.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),tD=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)&&j2(t,e,n);return eD(t,e),t};Object.defineProperty(Re,"__esModule",{value:!0});Re.ap=iD;Re.apFirst=aD;Re.apSecond=oD;Re.apS=sD;Re.getApplySemigroup=uD;Re.sequenceT=dD;Re.sequenceS=fD;var nD=Ae(),rD=tD(xr());function iD(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 aD(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function oD(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function sD(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 uD(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 Pl(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):Pl(e,t-1,i)}}var Fl={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 cD(e){return rD.has.call(Fl,e)||(Fl[e]=Pl(nD.tuple,e-1,[])),Fl[e]}function dD(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=cD(r),a=e.map(t[0],i),s=1;s<r;s++)a=e.ap(a,t[s]);return a}}function lD(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 Pl(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 fD(e){return function(t){for(var n=Object.keys(t),r=n.length,i=lD(n),a=e.map(t[n[0]],i),s=1;s<r;s++)a=e.ap(a,t[n[s]]);return a}}});var bo=p(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.map=tS;Kt.flap=pD;Kt.bindTo=vD;Kt.let=mD;Kt.getFunctorComposition=gD;Kt.as=nS;Kt.asUnit=_D;var hD=Ae();function tS(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function pD(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function vD(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function mD(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 gD(e,t){var n=tS(e,t);return{map:function(r,i){return(0,hD.pipe)(r,n(i))}}}function nS(e){return function(t,n){return e.map(t,function(){return n})}}function _D(e){var t=nS(e);return function(n){return t(n,void 0)}}});var Nl=p(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.getApplicativeMonoid=yD;Uu.getApplicativeComposition=CD;var rS=Lu(),xD=Ae(),SD=bo();function yD(e){var t=(0,rS.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function CD(e,t){var n=(0,SD.getFunctorComposition)(e,t).map,r=(0,rS.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,a){return(0,xD.pipe)(i,r(a))}}}});var Wu=p(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.chainFirst=ED;Io.tap=iS;Io.bind=bD;function ED(e){var t=iS(e);return function(n){return function(r){return t(r,n)}}}function iS(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}function bD(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 aS=p(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.tailRec=void 0;var ID=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};Hu.tailRec=ID});var Bl=p(be=>{"use strict";var TD=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]})),AD=be&&be.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wD=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)&&TD(t,e,n);return AD(t,e),t};Object.defineProperty(be,"__esModule",{value:!0});be.fromOption=sS;be.fromPredicate=DD;be.fromOptionK=uS;be.chainOptionK=RD;be.fromEitherK=Ml;be.chainEitherK=FD;be.chainFirstEitherK=PD;be.filterOrElse=ND;be.tapEither=cS;var OD=Wu(),oS=Ae(),Sr=wD(xr());function sS(e){return function(t){return function(n){return e.fromEither(Sr.isNone(n)?Sr.left(t()):Sr.right(n.value))}}}function DD(e){return function(t,n){return function(r){return e.fromEither(t(r)?Sr.right(r):Sr.left(n(r)))}}}function uS(e){var t=sS(e);return function(n){var r=t(n);return function(i){return(0,oS.flow)(i,r)}}}function RD(e,t){var n=uS(e);return function(r){var i=n(r);return function(a){return function(s){return t.chain(s,i(a))}}}}function Ml(e){return function(t){return(0,oS.flow)(t,e.fromEither)}}function FD(e,t){var n=Ml(e);return function(r){return function(i){return t.chain(i,n(r))}}}function PD(e,t){var n=cS(e,t);return function(r){return function(i){return n(i,r)}}}function ND(e,t){return function(n,r){return function(i){return t.chain(i,function(a){return e.fromEither(n(a)?Sr.right(a):Sr.left(r(a)))})}}}function cS(e,t){var n=Ml(e),r=(0,OD.tap)(t);return function(i,a){return r(i,n(a))}}});var kl=p($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.right=$.left=$.flap=$.Functor=$.Bifunctor=$.URI=$.bimap=$.mapLeft=$.map=$.separated=void 0;var ql=Ae(),MD=bo(),BD=function(e,t){return{left:e,right:t}};$.separated=BD;var qD=function(e,t){return(0,ql.pipe)(e,(0,$.map)(t))},kD=function(e,t){return(0,ql.pipe)(e,(0,$.mapLeft)(t))},JD=function(e,t,n){return(0,ql.pipe)(e,(0,$.bimap)(t,n))},LD=function(e){return function(t){return(0,$.separated)((0,$.left)(t),e((0,$.right)(t)))}};$.map=LD;var UD=function(e){return function(t){return(0,$.separated)(e((0,$.left)(t)),(0,$.right)(t))}};$.mapLeft=UD;var WD=function(e,t){return function(n){return(0,$.separated)(e((0,$.left)(n)),t((0,$.right)(n)))}};$.bimap=WD;$.URI="Separated";$.Bifunctor={URI:$.URI,mapLeft:kD,bimap:JD};$.Functor={URI:$.URI,map:qD};$.flap=(0,MD.flap)($.Functor);var HD=function(e){return e.left};$.left=HD;var VD=function(e){return e.right};$.right=VD});var Jl=p(vt=>{"use strict";var KD=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]})),zD=vt&&vt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),GD=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)&&KD(t,e,n);return zD(t,e),t};Object.defineProperty(vt,"__esModule",{value:!0});vt.wiltDefault=ZD;vt.witherDefault=QD;vt.filterE=YD;var dS=GD(xr());function ZD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.separate)}}}function QD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.compact)}}}function YD(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?dS.some(a):dS.none})})}}}}});var _S=p(l=>{"use strict";var $D=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]})),XD=l&&l.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fS=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)&&$D(t,e,n);return XD(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=w8;l.elem=gS;l.parseJSON=N8;l.getValidation=k8;var hS=Nl(),To=Lu(),pS=fS(Wu()),jD=aS(),Ao=Bl(),ge=Ae(),wo=bo(),et=fS(xr()),zt=kl(),lS=Jl();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))},yr=function(e,t){return(0,ge.pipe)(e,(0,l.ap)(t))},Oo=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduce)(t,n))},Do=function(e){return function(t,n){var r=(0,l.foldMap)(e);return(0,ge.pipe)(t,r(n))}},Ro=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduceRight)(t,n))},Vu=function(e){var t=(0,l.traverse)(e);return function(n,r){return(0,ge.pipe)(n,t(r))}},Ll=function(e,t,n){return(0,ge.pipe)(e,(0,l.bimap)(t,n))},Ul=function(e,t){return(0,ge.pipe)(e,(0,l.mapLeft)(t))},vS=function(e,t){return(0,ge.pipe)(e,(0,l.alt)(t))},Wl=function(e,t){return(0,ge.pipe)(e,(0,l.extend)(t))},Hl=function(e,t){return(0,jD.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 e8=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=e8;var t8=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=t8;var n8=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=n8;var r8=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=r8;var i8=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=i8;var a8=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:Vu,sequence:l.sequence,reduce:Oo,foldMap:Do,reduceRight:Ro,wither:(0,lS.witherDefault)(l.Traversable,n),wilt:(0,lS.wiltDefault)(l.Traversable,n)}};l.getWitherable=a8;var o8=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=o8;var s8=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=s8;var u8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t.right))}};l.map=u8;l.Functor={URI:l.URI,map:we};l.as=(0,ge.dual)(2,(0,wo.as)(l.Functor));l.asUnit=(0,wo.asUnit)(l.Functor);l.of=l.right;l.Pointed={URI:l.URI,of:l.of};var c8=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=c8;l.ap=l.apW;l.Apply={URI:l.URI,map:we,ap:yr};l.Applicative={URI:l.URI,map:we,ap:yr,of:l.of};l.Chain={URI:l.URI,map:we,ap:yr,chain:l.flatMap};l.Monad={URI:l.URI,map:we,ap:yr,of:l.of,chain:l.flatMap};var d8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(e,n.right)}};l.reduce=d8;var l8=function(e){return function(t){return function(n){return(0,l.isLeft)(n)?e.empty:t(n.right)}}};l.foldMap=l8;var f8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(n.right,e)}};l.reduceRight=f8;l.Foldable={URI:l.URI,reduce:Oo,foldMap:Do,reduceRight:Ro};var h8=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=h8;var p8=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=p8;l.Traversable={URI:l.URI,map:we,reduce:Oo,foldMap:Do,reduceRight:Ro,traverse:Vu,sequence:l.sequence};var v8=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=v8;var m8=function(e){return function(t){return(0,l.isLeft)(t)?(0,l.left)(e(t.left)):t}};l.mapLeft=m8;l.Bifunctor={URI:l.URI,bimap:Ll,mapLeft:Ul};var g8=function(e){return function(t){return(0,l.isLeft)(t)?e():t}};l.altW=g8;l.alt=l.altW;l.Alt={URI:l.URI,map:we,alt:vS};var _8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t))}};l.extend=_8;l.Extend={URI:l.URI,map:we,extend:Wl};l.ChainRec={URI:l.URI,map:we,ap:yr,chain:l.flatMap,chainRec:Hl};l.throwError=l.left;l.MonadThrow={URI:l.URI,map:we,ap:yr,of:l.of,chain:l.flatMap,throwError:l.throwError};l.FromEither={URI:l.URI,fromEither:ge.identity};l.fromPredicate=(0,Ao.fromPredicate)(l.FromEither);l.fromOption=(0,Ao.fromOption)(l.FromEither);l.isLeft=et.isLeft;l.isRight=et.isRight;var x8=function(e,t){return function(n){return(0,l.isLeft)(n)?e(n.left):t(n.right)}};l.matchW=x8;l.foldW=l.matchW;l.match=l.matchW;l.fold=l.match;var S8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t.right}};l.getOrElseW=S8;l.getOrElse=l.getOrElseW;l.flap=(0,wo.flap)(l.Functor);l.apFirst=(0,To.apFirst)(l.Apply);l.apFirstW=l.apFirst;l.apSecond=(0,To.apSecond)(l.Apply);l.apSecondW=l.apSecond;l.tap=(0,ge.dual)(2,pS.tap(l.Chain));l.flattenW=(0,l.flatMap)(ge.identity);l.flatten=l.flattenW;l.duplicate=(0,l.extend)(ge.identity);l.fromOptionK=(0,Ao.fromOptionK)(l.FromEither);l.chainOptionK=(0,Ao.chainOptionK)(l.FromEither,l.Chain);l.chainOptionKW=l.chainOptionK;var Ku={fromEither:l.FromEither.fromEither};l.liftNullable=et.liftNullable(Ku);l.liftOption=et.liftOption(Ku);var mS={flatMap:l.flatMap};l.flatMapNullable=et.flatMapNullable(Ku,mS);l.flatMapOption=et.flatMapOption(Ku,mS);l.filterOrElse=(0,Ao.filterOrElse)(l.FromEither,l.Chain);l.filterOrElseW=l.filterOrElse;var y8=function(e){return(0,l.isLeft)(e)?(0,l.right)(e.left):(0,l.left)(e.right)};l.swap=y8;var C8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t}};l.orElseW=C8;l.orElse=l.orElseW;var E8=function(e){return function(t){return t==null?(0,l.left)(e):(0,l.right)(t)}};l.fromNullable=E8;var b8=function(e,t){try{return(0,l.right)(e())}catch(n){return(0,l.left)(t(n))}};l.tryCatch=b8;var I8=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=I8;var T8=function(e){var t=(0,l.fromNullable)(e);return function(n){return(0,ge.flow)(n,t)}};l.fromNullableK=T8;var A8=function(e){var t=(0,l.fromNullableK)(e);return function(n){return(0,l.flatMap)(t(n))}};l.chainNullableK=A8;l.toUnion=(0,l.foldW)(ge.identity,ge.identity);function w8(e){try{return e instanceof Error?e:new Error(String(e))}catch{return new Error}}function gS(e){return function(t,n){if(n===void 0){var r=gS(e);return function(i){return r(t,i)}}return(0,l.isLeft)(n)?!1:e.equals(t,n.right)}}var O8=function(e){return function(t){return(0,l.isLeft)(t)?!1:e(t.right)}};l.exists=O8;l.Do=(0,l.of)(et.emptyRecord);l.bindTo=(0,wo.bindTo)(l.Functor);var D8=(0,wo.let)(l.Functor);l.let=D8;l.bind=pS.bind(l.Chain);l.bindW=l.bind;l.apS=(0,To.apS)(l.Apply);l.apSW=l.apS;l.ApT=(0,l.of)(et.emptyReadonlyArray);var R8=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=R8;var F8=function(e){var t=(0,l.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return et.isNonEmpty(n)?t(n):l.ApT}};l.traverseReadonlyArrayWithIndex=F8;l.traverseArrayWithIndex=l.traverseReadonlyArrayWithIndex;var P8=function(e){return(0,l.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};l.traverseArray=P8;l.sequenceArray=(0,l.traverseArray)(ge.identity);l.chainW=l.flatMap;l.chain=l.flatMap;l.chainFirst=l.tap;l.chainFirstW=l.tap;function N8(e,t){return(0,l.tryCatch)(function(){return JSON.parse(e)},t)}var M8=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=M8;l.either={URI:l.URI,map:we,of:l.of,ap:yr,chain:l.flatMap,reduce:Oo,foldMap:Do,reduceRight:Ro,traverse:Vu,sequence:l.sequence,bimap:Ll,mapLeft:Ul,alt:vS,extend:Wl,chainRec:Hl,throwError:l.throwError};l.getApplySemigroup=(0,To.getApplySemigroup)(l.Apply);l.getApplyMonoid=(0,hS.getApplicativeMonoid)(l.Applicative);var B8=function(e,t){return(0,To.getApplySemigroup)((0,l.getApplicativeValidation)(e))(t)};l.getValidationSemigroup=B8;var q8=function(e,t){return(0,hS.getApplicativeMonoid)((0,l.getApplicativeValidation)(e))(t)};l.getValidationMonoid=q8;function k8(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:Ll,mapLeft:Ul,reduce:Oo,foldMap:Do,reduceRight:Ro,extend:Wl,traverse:Vu,sequence:l.sequence,chainRec:Hl,throwError:l.throwError,ap:t,alt:n}}});var _n=p(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ClientEvent=hi.ClientEventName=void 0;var J8=qe(),xS;(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"})(xS||(hi.ClientEventName=xS={}));var Vl=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(J8.EventType.ClientEventType,t,new Date,n).data}};hi.ClientEvent=Vl});var Fo=p(Fe=>{"use strict";var pi=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 L8=Ol(),U8=X1(),Kl=_S(),W8=Ae(),xn=_n(),SS;(function(e){e.Relay="relay",e.All="all"})(SS||(Fe.IceTransportPolicy=SS={}));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 zl;(function(e){e.Closed="closed"})(zl||(Fe.SignalingState=zl={}));Fe.MAX_WAIT_DISCONNECTED_PC=1e3*60*5;var Gl=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,Kl.right)(u):(0,Kl.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=()=>pi(this,void 0,void 0,function*(){yield this.createOffer()}),this.pc.oniceconnectionstatechange=(0,W8.flow)(this.logIceState,this.getIceConnectionState,this.notifyCurrentIceStateObserver,this.handleInactivateTimerState,(0,Kl.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,L8.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 U8.WebRTCFactory.createPeerConnection(this.rtcConfiguration)}setPendingRemoteDesription(){return pi(this,void 0,void 0,function*(){if(this.pendingRemoteDescription)return this.setRemoteDescription(this.pendingRemoteDescription)})}setLocalDescription(t){return pi(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 pi(this,void 0,void 0,function*(){this.remoteDescription=void 0;let t=yield this.pc.createOffer();yield this.setLocalDescription(this.originalOffer||t)})}createAnswer(){return pi(this,void 0,void 0,function*(){let t=yield this.pc.createAnswer();return yield this.setLocalDescription(t),t})}setRemoteDescription(t){return pi(this,void 0,void 0,function*(){if(t.type=="answer"){if(this.remoteDescription)return;if(!this.localDescription){this.pendingRemoteDescription=t;return}}this.pc.signalingState!==zl.Closed&&(this.remoteDescription=t,yield this.pc.setRemoteDescription(t),this.applyPendingRemoteCandidates(),t.type=="offer"&&(yield this.createAnswer()))})}};Fe.PeerConnection=Gl});var ES=p(vi=>{"use strict";var Sn=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.PeerConnectionClient=void 0;var H8=un(),yS=Co(),V8=Fo(),CS=Fo(),Zl=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 H8.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 yS.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 yS.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?CS.IceTransportPolicy.Relay:CS.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 V8.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}})}};vi.PeerConnectionClient=Zl});var bS=p(mi=>{"use strict";var K8=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.LocalAudioProcessor=void 0;var Ql=class{constructor(){this.owned=new Set}setListener(t){return K8(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()})}};mi.LocalAudioProcessor=Ql});var IS=p(gi=>{"use strict";var z8=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.LocalVideoProcessor=void 0;var G8=Ol(),Z8=1e4,Yl=class{constructor(){this.owned=new Set}setListener(t){return z8(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}Q8();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'))},Z8);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,G8.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)}};gi.LocalVideoProcessor=Yl;function Q8(){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 Xl=p(_i=>{"use strict";var Y8=_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.MediaController=void 0;var $l=class e{static create(t){return Y8(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())}};_i.MediaController=$l});var TS=p(xi=>{"use strict";var $8=xi&&xi.__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(xi,"__esModule",{value:!0});xi.LocalMediaPipeline=void 0;var X8=bS(),j8=IS(),eR=Xl(),jl=class{constructor(){this.audioProcessor=new X8.LocalAudioProcessor,this.videoProcessor=new j8.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 $8(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 eR.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)))}};xi.LocalMediaPipeline=jl});var AS=p(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Base64Helper=void 0;var Cr=Zn(),ef=ue(),tR=Ce(),tf=class{static encode(t){let n;if(typeof t!="string")if(ef.TypeHelper.isPlainObject(t)||ef.TypeHelper.isArray(t))n=JSON.stringify(t);else throw new tR.ArgumentError("String to encode must be a string, a plain object or an array",(0,ef.nameof)(t));else n=t;let r=Cr.enc.Utf8.parse(n),i=Cr.enc.Base64.stringify(r);return this.makeURLSafe(i)}static encodeUnsafe(t){let n=Cr.enc.Utf8.parse(t);return Cr.enc.Base64.stringify(n)}static decode(t){return Cr.enc.Base64.parse(t)}static decodeToString(t){return Cr.enc.Base64.parse(t).toString(Cr.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}};zu.Base64Helper=tf});var OS=p(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.CryptoHelper=void 0;var Gu=Zn(),wS=ue(),nf=class e{static convertUTF8ToByteArray(t){return Gu.enc.Utf8.parse(t)}static SHA256FromByteArray(t){return Gu.SHA256(t)}static HMAC_SHA256(t,n){let r=n;return wS.TypeHelper.isString(n)&&(r=wS.Base64Helper.decode(n)),Gu.HmacSHA256(e.convertUTF8ToByteArray(t),r)}static convertByteArrayToHex(t){return t.toString(Gu.enc.Hex)}};Zu.CryptoHelper=nf});var DS=p(()=>{});var FS=p((Qu,RS)=>{(function(e,t){typeof Qu=="object"&&typeof RS<"u"?t(Qu):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(Qu,(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=DS();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 PS=p(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.StringHelper=void 0;var nR=Zn(),rR=FS(),rf=class{static random(t=16){return nR.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,rR.ulid)(t)}};Yu.StringHelper=rf});var NS=p($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.EnvHelper=void 0;var af=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}};$u.EnvHelper=af});var MS=p(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.TypeHelper=void 0;var of=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"}};Xu.TypeHelper=of});var BS=p(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.DateHelper=void 0;var sf=class{static formatISO8601BasicDateTime(t){return t.toISOString().replace(/(\.)(\d+)(Z)/,"$1$3").replace(/[-.:]/g,"")}};ju.DateHelper=sf});var qS=p(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.PromiseHelper=void 0;var uf=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))}};ec.PromiseHelper=uf});var kS=p(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.pipeAsync=Et.pipe=Et.isEmpty=Et.nameof=void 0;var iR=e=>e.constructor.name;Et.nameof=iR;var aR=e=>e&&Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype;Et.isEmpty=aR;var oR=(...e)=>t=>e.reduce((n,r)=>r(n),t);Et.pipe=oR;var sR=(...e)=>t=>e.reduce((n,r)=>n.then(r),Promise.resolve(t));Et.pipeAsync=sR});var ue=p(ke=>{"use strict";var uR=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)&&uR(t,e,n)};Object.defineProperty(ke,"__esModule",{value:!0});yn(AS(),ke);yn(OS(),ke);yn(PS(),ke);yn(NS(),ke);yn(MS(),ke);yn(BS(),ke);yn(qS(),ke);yn(kS(),ke)});var Si=p(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.EventFanout=void 0;var cR=ue(),cf=class{constructor(){this.idKey=cR.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]}};tc.EventFanout=cf});var LS=p(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0})});var WS=p(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.CallDirection=void 0;var US;(function(e){e[e.INBOUND=1]="INBOUND",e[e.OUTBOUND=2]="OUTBOUND"})(US||(nc.CallDirection=US={}))});var df=p(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.CallState=void 0;var HS;(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"})(HS||(rc.CallState=HS={}))});var ic=p(Zt=>{"use strict";var dR=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]})),lf=Zt&&Zt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&dR(t,e,n)};Object.defineProperty(Zt,"__esModule",{value:!0});lf(LS(),Zt);lf(WS(),Zt);lf(df(),Zt)});var VS=p(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var ac=ct(),ff=Fo(),lR=Si(),Po=Lt(),fR=ic(),hf=class extends lR.EventFanout{constructor(t){super(),this.call=t,this.iceConnectionState=ff.IceConnectionState.New,this.issuedProgressing=!1,this.issuedEstablished=!1,this.issuedAccepted=!1,this.issuedAnswered=!1,this.listen=(n,r)=>{switch(n.state){case ac.SessionState.Terminated:r.onCallEnded&&r.onCallEnded(this.call);break;case ac.SessionState.Established:r.onCallAnswered&&r.onCallAnswered(this.call);break}}}setCurrentIceConnectionState(t){this.iceConnectionState=t,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination()}setPushNotificationRequestSent(){if(this.call.direction===Po.Direction.Inbound){console.warn("Calling setPushNotificationRequestSent on Inbound call");return}this.issueCallProgressingIfNeeded()}setCallAccepted(){if(this.call.direction===Po.Direction.Outbound){console.warn("Calling setCallAccepted on Outbound call");return}this.issueCallAcceptedIfNeeded()}onEventProcessed(t){switch(super.onEventProcessed(t),t.state){case ac.SessionState.Established:this.issuedAnswered=!0,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination();break;case ac.SessionState.Progress:this.issueCallProgressingIfNeeded(),this.issueCallRingingIfNeeded();break}}issueCallProgressingIfNeeded(){this.issuedProgressing||(this.issuedProgressing=!0,this.listeners.forEach(t=>{t.onCallProgressing&&this.call.direction===Po.Direction.Outbound&&t.onCallProgressing(this.call)}))}issueCallRingingIfNeeded(){this.listeners.forEach(t=>{t.onCallRinging&&this.call.direction===Po.Direction.Outbound&&t.onCallRinging(this.call)})}issueCallEstablishedIfNeeded(){this.issuedEstablished||!this.issuedAnswered||this.iceConnectionState!=ff.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===Po.Direction.Inbound&&t.onCallAccepted(this.call)}))}checkIceFailureTermination(){let t=this.call.state===fR.CallState.Ended;this.issuedAnswered&&!this.issuedEstablished&&!t&&this.iceConnectionState===ff.IceConnectionState.Failed&&this.call.terminateDueToIceFailure()}};pf.default=hf});var KS=p(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.TrackEventFanout=void 0;var hR=Si(),vf=class extends hR.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onRemoteTrack&&r.onRemoteTrack(this.call,n)}}};oc.TrackEventFanout=vf});var Ci=p(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.FeatureFlagDefaults=yi.FeatureFlag=void 0;var sc;(function(e){e.IncludeMxpEventLog="CallReport.IncludeMxpEventLog",e.UseTurn="WebRtc.UseTurn"})(sc||(yi.FeatureFlag=sc={}));yi.FeatureFlagDefaults={[sc.IncludeMxpEventLog]:!1,[sc.UseTurn]:!1}});var GS=p(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0})});var mf=p(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.Capability=void 0;var ZS;(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"})(ZS||(uc.Capability=ZS={}))});var cc=p(Cn=>{"use strict";var pR=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]})),QS=Cn&&Cn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&pR(t,e,n)};Object.defineProperty(Cn,"__esModule",{value:!0});QS(GS(),Cn);QS(mf(),Cn)});var gf=p(tt=>{"use strict";var vR=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 mR=Ci(),gR=cc(),dc;(function(e){e.ValidUntil="validUntil",e.Password="password"})(dc||(dc={}));var _R=(e,t,n)=>()=>vR(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=_R;var xR=e=>t=>{e.toggleCapability(gR.Capability.Turn,t.get(mR.FeatureFlag.UseTurn))};tt.onTurnFeatureFlagChanged=xR;var SR=e=>t=>{e.setIceServers(t)};tt.createIceServerSetter=SR;var yR=e=>e?e.map(t=>{let n={};for(let[r,i]of Object.entries(t))switch(r){case dc.Password:n.credential=i;break;case dc.ValidUntil:n.validUntil=typeof i=="string"?new Date(i):i;break;default:n[r]=i}return n}):[];tt.toRTCIceServer=yR});var lc=p(En=>{"use strict";var CR=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]})),YS=En&&En.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&CR(t,e,n)};Object.defineProperty(En,"__esModule",{value:!0});YS(Fo(),En);YS(gf(),En)});var hc=p(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.CallEndCause=void 0;var $S;(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"})($S||(fc.CallEndCause=$S={}))});var XS=p(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.DefaultCallDetails=void 0;var _f=Lt(),bt=dt(),pc=dn(),bn=hc(),xf=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===_f.Direction.Inbound?this.startedTime:this.rungTime,a=this.direction===_f.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===_f.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 pc.SinchError(pc.ErrorMessage.ICE_FAILED_TO_CONNECT,pc.ErrorCode.CallFailedToConnectIce,pc.ErrorType.Network):this.session.error}calculateDurationMs(t,n){return!t||!n?0:n.getTime()-t.getTime()}};vc.DefaultCallDetails=xf});var jS=p(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.CallQualityWarningEventFanout=void 0;var ER=Si(),Sf=class extends ER.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onCallQualityWarningEvent&&r.onCallQualityWarningEvent(this.call,n)}}};mc.CallQualityWarningEventFanout=Sf});var Er=p(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CallQualityWarningMediaStreamType=void 0;var ey;(function(e){e.Audio="Audio",e.Video="Video"})(ey||(gc.CallQualityWarningMediaStreamType=ey={}))});var Qt=p(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.MediaType=Ei.RtcStatsTypes=void 0;var ty;(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"})(ty||(Ei.RtcStatsTypes=ty={}));var ny;(function(e){e.Audio="audio",e.Video="video"})(ny||(Ei.MediaType=ny={}))});var It=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.getStatsWithType=bR;_c.calculateBufferSize=IR;var ry=Ce();function bR(e,t,n){let r=null;return e.forEach(i=>{i.type===t&&i.kind===n&&(r=i)}),r}function IR(e,t){if(e<=0)throw new ry.ArgumentError("timeSpanCoveredMs must be greater than 0","timeSpanCoveredMs");if(t<=0)throw new ry.ArgumentError("statsRequestIntervalMs must be greater than 0","statsRequestIntervalMs");return Math.ceil(e/t+.5)}});var Yt=p(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.CallQualityWarningEventType=void 0;var iy;(function(e){e.Trigger="Trigger",e.Recover="Recover"})(iy||(xc.CallQualityWarningEventType=iy={}))});var ay=p(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.HighRemoteInboundRttWarningEvent=void 0;var yf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highRemoteInboundRtt"}};Sc.HighRemoteInboundRttWarningEvent=yf});var Ef=p(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.BaseDetector=void 0;var TR=Yt(),Cf=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===TR.CallQualityWarningEventType.Trigger,this.fanout.onEvent(t)}};yc.BaseDetector=Cf});var br=p(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.WebRtcStatsDetector=void 0;var AR=Ef(),Cc=class extends AR.BaseDetector{};Ec.WebRtcStatsDetector=Cc;Cc.TIMESTAMP_KEY="timestamp"});var uy=p(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.HighRemoteInboundRttDetector=void 0;var bf=Qt(),wR=It(),oy=Yt(),OR=Er(),sy=ay(),DR=br(),No=class e extends DR.WebRtcStatsDetector{constructor(t,n){super(n),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===OR.CallQualityWarningMediaStreamType.Audio?bf.MediaType.Audio:bf.MediaType.Video,r=(0,wR.getStatsWithType)(t,bf.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 sy.HighRemoteInboundRttWarningEvent(oy.CallQualityWarningEventType.Trigger,this.mediaStream)):a<=e.RTT_THRESHOLD_MS&&this.isInTriggeredState&&this.emitWarning(new sy.HighRemoteInboundRttWarningEvent(oy.CallQualityWarningEventType.Recover,this.mediaStream))}};bc.HighRemoteInboundRttDetector=No;No.RTT_THRESHOLD_MS=300;No.RTT_KEY="roundTripTime"});var Tc=p(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.StatsBuffer=void 0;var RR=Ce(),If=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 RR.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)}}};Ic.StatsBuffer=If});var Tf=p(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.BufferedWarningDetector=void 0;var cy=Yt(),FR=Tc(),PR=br(),Mo=class extends PR.WebRtcStatsDetector{constructor(t,n,r,i){super(t),this.lastSampleTimestampMs=-1,this.buffer=new FR.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(cy.CallQualityWarningEventType.Trigger)):!this.buffer.isAboveThreshold&&this.isInTriggeredState&&this.emitWarning(this.warningEventWithType(cy.CallQualityWarningEventType.Recover)))}};Ac.BufferedWarningDetector=Mo;Mo.DEFAULT_BUFFER_SIZE=4;Mo.DEFAULT_SAMPLES_COUNT_FOR_WARNING=3});var dy=p(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.HighInboundJitterWarningEvent=void 0;var Af=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundJitter"}};wc.HighInboundJitterWarningEvent=Af});var ly=p(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.HighInboundJitterDetector=void 0;var NR=Er(),wf=Tf(),MR=dy(),Of=Qt(),BR=It(),qR=br(),Bo=class e extends wf.BufferedWarningDetector{constructor(t,n){super(n,wf.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,wf.BufferedWarningDetector.DEFAULT_SAMPLES_COUNT_FOR_WARNING,e.JITTER_THRESHOLD_MS),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===NR.CallQualityWarningMediaStreamType.Audio?Of.MediaType.Audio:Of.MediaType.Video,r=(0,BR.getStatsWithType)(t,Of.RtcStatsTypes.InboundRtp,n),i=r?.[e.JITTER_KEY],a=i!==void 0?i*1e3:void 0;this.onNewMonitoredValue(a,r?.[qR.WebRtcStatsDetector.TIMESTAMP_KEY])}warningEventWithType(t){return new MR.HighInboundJitterWarningEvent(t,this.mediaStream)}};Oc.HighInboundJitterDetector=Bo;Bo.JITTER_KEY="jitter";Bo.JITTER_THRESHOLD_MS=30});var fy=p(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.MissingMediaStreamWarningEvent=void 0;var Df=class{constructor(t){this.type=t,this.name="missingMediaStream"}};Dc.MissingMediaStreamWarningEvent=Df});var vy=p(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.MissingMediaStreamWarningDetector=void 0;var Rc=lc(),hy=Yt(),py=fy(),kR=Ef(),Fc=class e extends kR.BaseDetector{constructor(t){super(t),this.iceState=Rc.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==Rc.IceConnectionState.Connected?0:e.WARNING_EMISSION_DELAY_MS;t===0?this.performStateCheck():this.timeoutId=setTimeout(this.performStateCheck.bind(this),t)}performStateCheck(){this.iceState!==Rc.IceConnectionState.Connected&&!this.isInTriggeredState?this.emitWarning(new py.MissingMediaStreamWarningEvent(hy.CallQualityWarningEventType.Trigger)):this.iceState===Rc.IceConnectionState.Connected&&this.isInTriggeredState&&this.emitWarning(new py.MissingMediaStreamWarningEvent(hy.CallQualityWarningEventType.Recover))}};Pc.MissingMediaStreamWarningDetector=Fc;Fc.WARNING_EMISSION_DELAY_MS=2e3});var my=p(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.HighInboundPacketLossWarningEvent=void 0;var Rf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundPacketLoss"}};Nc.HighInboundPacketLossWarningEvent=Rf});var gy=p(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.HighInboundPacketLossDetector=void 0;var JR=Er(),Ff=Tf(),Pf=Qt(),LR=br(),UR=It(),WR=my(),bi=class e extends Ff.BufferedWarningDetector{constructor(t,n){super(n,Ff.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,Ff.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===JR.CallQualityWarningMediaStreamType.Audio?Pf.MediaType.Audio:Pf.MediaType.Video,r=(0,UR.getStatsWithType)(t,Pf.RtcStatsTypes.InboundRtp,n),i=r?.[LR.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 WR.HighInboundPacketLossWarningEvent(t,this.mediaStream)}};Mc.HighInboundPacketLossDetector=bi;bi.PACKET_LOSS_KEY="packetsLost";bi.PACKET_RECEIVED_KEY="packetsReceived";bi.FRACTION_LOST_THRESHOLD=.01});var Sy=p(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.ConstantAudioLevelDetector=void 0;var HR=It(),_y=Yt(),VR=Tc(),xy=br(),Ii=class e extends xy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new VR.StatsBuffer((0,HR.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?.[xy.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(_y.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(_y.CallQualityWarningEventType.Recover)))}};Bc.ConstantAudioLevelDetector=Ii;Ii.AUDIO_LEVEL_KEY="audioLevel";Ii.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e4;Ii.AUDIO_LEVEL_MIN_SD_THRESHOLD=.005});var Nf=p(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.CallQualityWarningController=void 0;var qc=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)}};kc.CallQualityWarningController=qc;qc.WEBRTC_FETCH_STATS_INTERVAL_MS=500});var yy=p(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ConstantInboundAudioLevelWarningEvent=void 0;var Mf=class{constructor(t){this.type=t,this.name="constantInboundAudioLevel"}};Jc.ConstantInboundAudioLevelWarningEvent=Mf});var Ey=p(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.ConstantInboundAudioLevelDetectorHandler=void 0;var Cy=Qt(),KR=It(),zR=yy(),Bf=class{getAudioLevelStats(t){return(0,KR.getStatsWithType)(t,Cy.RtcStatsTypes.InboundRtp,Cy.MediaType.Audio)}createWarningEvent(t){return new zR.ConstantInboundAudioLevelWarningEvent(t)}};Lc.ConstantInboundAudioLevelDetectorHandler=Bf});var by=p(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.ConstantOutboundAudioLevelWarningEvent=void 0;var qf=class{constructor(t){this.type=t,this.name="constantOutboundAudioLevel"}};Uc.ConstantOutboundAudioLevelWarningEvent=qf});var Ty=p(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ConstantOutboundAudioLevelDetectorHandler=void 0;var Iy=Qt(),GR=It(),ZR=by(),kf=class{getAudioLevelStats(t){return(0,GR.getStatsWithType)(t,Iy.RtcStatsTypes.MediaSource,Iy.MediaType.Audio)}createWarningEvent(t){return new ZR.ConstantOutboundAudioLevelWarningEvent(t)}};Wc.ConstantOutboundAudioLevelDetectorHandler=kf});var Oy=p(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ZeroAudioLevelDetector=void 0;var QR=It(),Ay=Yt(),YR=Tc(),wy=br(),qo=class e extends wy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new YR.StatsBuffer((0,QR.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?.[wy.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(Ay.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(Ay.CallQualityWarningEventType.Recover)))}};Hc.ZeroAudioLevelDetector=qo;qo.AUDIO_LEVEL_KEY="audioLevel";qo.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e3});var Dy=p(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ZeroInboundAudioLevelWarningEvent=void 0;var Jf=class{constructor(t){this.type=t,this.name="zeroInboundAudioLevel"}};Vc.ZeroInboundAudioLevelWarningEvent=Jf});var Fy=p(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ZeroInboundAudioLevelDetectorHandler=void 0;var Ry=Qt(),$R=It(),XR=Dy(),Lf=class{getAudioLevelStats(t){return(0,$R.getStatsWithType)(t,Ry.RtcStatsTypes.InboundRtp,Ry.MediaType.Audio)}createWarningEvent(t){return new XR.ZeroInboundAudioLevelWarningEvent(t)}};Kc.ZeroInboundAudioLevelDetectorHandler=Lf});var Py=p(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.ZeroOutboundAudioLevelWarningEvent=void 0;var Uf=class{constructor(t){this.type=t,this.name="zeroOutboundAudioLevel"}};zc.ZeroOutboundAudioLevelWarningEvent=Uf});var My=p(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.ZeroOutboundAudioLevelDetectorHandler=void 0;var Ny=Qt(),jR=It(),eF=Py(),Wf=class{getAudioLevelStats(t){return(0,jR.getStatsWithType)(t,Ny.RtcStatsTypes.MediaSource,Ny.MediaType.Audio)}createWarningEvent(t){return new eF.ZeroOutboundAudioLevelWarningEvent(t)}};Gc.ZeroOutboundAudioLevelDetectorHandler=Wf});var Uy=p(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.CallQualityDetectorsFactory=void 0;var Ti=Er(),By=uy(),qy=ly(),tF=vy(),ky=gy(),Jy=Sy(),Zc=Nf(),nF=Ey(),rF=Ty(),Ly=Oy(),iF=Fy(),aF=My(),Hf=class{constructor(t){this.fanout=t}createMissingMediaStreamDetector(){return new tF.MissingMediaStreamWarningDetector(this.fanout)}createWebRtcStatsDetectors(){return[new By.HighRemoteInboundRttDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new By.HighRemoteInboundRttDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new qy.HighInboundJitterDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new qy.HighInboundJitterDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new ky.HighInboundPacketLossDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new ky.HighInboundPacketLossDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new Jy.ConstantAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new nF.ConstantInboundAudioLevelDetectorHandler,this.fanout),new Jy.ConstantAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new rF.ConstantOutboundAudioLevelDetectorHandler,this.fanout),new Ly.ZeroAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new iF.ZeroInboundAudioLevelDetectorHandler,this.fanout),new Ly.ZeroAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new aF.ZeroOutboundAudioLevelDetectorHandler,this.fanout)]}};Qc.CallQualityDetectorsFactory=Hf});var ko=p(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MxpClientEventsVersionKey=In.MxpClientEventsVersion=In.MxpClientEvent=void 0;var Wy;(function(e){e.EnteredEstablished="EnteredEstablished",e.IceConnected="IceConnected",e.IceCompleted="IceCompleted"})(Wy||(In.MxpClientEvent=Wy={}));In.MxpClientEventsVersion="2";In.MxpClientEventsVersionKey="cev"});var Hy=p(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.PublicCallListenerCallbackMapper=void 0;var oF=Lt(),Vf=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===oF.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)}};Yc.PublicCallListenerCallbackMapper=Vf});var $c=p(wi=>{"use strict";var Kf=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.DefaultCall=void 0;var sF=Lt(),Ir=ct(),uF=ES(),cF=TS(),dF=VS(),lF=KS(),fF=un(),Vy=Ce(),Ai=ic(),hF=ue(),zf=lc(),Tn=_n(),pF=XS(),Ky=dt(),vF=jS(),mF=Uy(),zy=ko(),gF=Hy(),Gf=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 cF.LocalMediaPipeline,this.start=()=>Kf(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 gF.PublicCallListenerCallbackMapper,this.trackEvent=new lF.TrackEventFanout(this),this.callEventFanout=new dF.default(this),this.callQualityWarningEventFanout=new vF.CallQualityWarningEventFanout(this),this.callQualityWarningController=d.create(new mF.CallQualityDetectorsFactory(this.callQualityWarningEventFanout),this),this.callDetail=new pF.DefaultCallDetails(this,n),this.mediaController=this.localMedia.setRawMedia(i),this.peerConnectionClient=uF.PeerConnectionClient.create(this.mediaController,new fF.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,zf.createIceServerSetter)(this.peerConnectionClient)}answer(){return Kf(this,void 0,void 0,function*(){throw new Vy.InvalidOperationError("Answer can only be called on incoming call.")})}sendDtmf(t){if(!new RegExp("^[0-9#*abcdABCD]+$").test(t))throw new Vy.ArgumentError("Invalid DTMF keys",(0,hF.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 zf.IceConnectionState.Connected:this.emitClientEvent(zy.MxpClientEvent.IceConnected,t);break;case zf.IceConnectionState.Completed:this.emitClientEvent(zy.MxpClientEvent.IceCompleted,t);break}}tryEnableEarlyMedia(t){this.earlyMedia||this.direction===sF.Direction.Outbound&&t.isEarlyMedia()&&(this.session.state!==Ir.SessionState.Initiating&&this.session.state!==Ir.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(Ky.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 Ir.SessionState.Created:case Ir.SessionState.Initiating:return this.details.progressTime?Ai.CallState.Progressing:Ai.CallState.Init;case Ir.SessionState.Progress:return Ai.CallState.Ringing;case Ir.SessionState.Established:return this.details.establishedTime?Ai.CallState.Established:Ai.CallState.Answered;case Ir.SessionState.Terminated:return Ai.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(Ky.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 Kf(this,void 0,void 0,function*(){return yield this.peerConnectionClient.getPeerConnectionStats()})}};wi.DefaultCall=Gf});var Gy=p(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.RealTimeScheduler=void 0;var Zf=class{scheduleDelayed(t,n,r){let i=setTimeout(t,n);r?.subscribe(a=>{clearTimeout(i)})}};Xc.RealTimeScheduler=Zf});var Zy=p(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.CancellationTokenSource=Oi.CancellationError=void 0;var jc=class extends Error{constructor(){super(...arguments),this.name="CancellationError",this.message="The operation was cancelled"}};Oi.CancellationError=jc;var Qf=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 jc){this.cancellation=t,this.subscribers.splice(0).forEach(n=>n(t))}};Oi.CancellationTokenSource=Qf});var Di=p(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.TransitionSource=void 0;var Qy;(function(e){e[e.LocalAction=0]="LocalAction",e[e.RemotePeerMessage=1]="RemotePeerMessage"})(Qy||(ed.TransitionSource=Qy={}))});var Jo=p(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.TimerEventType=void 0;var Yy;(function(e){e[e.Termination=0]="Termination",e[e.ACKWindowEnd=1]="ACKWindowEnd"})(Yy||(td.TimerEventType=Yy={}))});var jy=p(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.FsmState=void 0;var $y=Co(),Xy=dt(),nd=ct(),_F=ft(),xF=Ce(),Yf=Di(),SF=Jo(),$f=class{constructor(t,n){this.fsmSessionState=t,this.transitions=n,this.callTerminationCause=Xy.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: ${_F.Method[t.method]} when in ${this.stateName} state. Ignoring...`)}onSessionDescription(t,n){$y.Source.Local==t&&this.onLocalSessionDescription(n)}onCandidate(t,n){$y.Source.Local==t&&this.onLocalCandidate(n)}onStateTimeout(t){t.type==SF.TimerEventType.Termination&&(this.onTimeout(t),this.transition(nd.SessionState.Terminated,Yf.TransitionSource.LocalAction))}onTimeout(t){}onException(t){console.log(`FsmState exception: ${t}`),this.transition(nd.SessionState.Terminated,Yf.TransitionSource.LocalAction)}terminate(t,n){t&&(this.callTerminationCause=Xy.TerminationCause.Error),this.transition(nd.SessionState.Terminated,n??Yf.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==nd.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 xF.InvalidOperationError(`Accept() is not a valid action for current state (${this.stateName})`)}onLocalSessionDescription(t){}onLocalCandidate(t){}};rd.FsmState=$f});var tC=p(eC=>{"use strict";Object.defineProperty(eC,"__esModule",{value:!0})});var nC=p(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.FsmTransitions=void 0;var yF=mt(),Xf=class{constructor(){this.entries=new Array,this.nullState=new yF.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)}};id.FsmTransitions=Xf});var iC=p(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.NullState=void 0;var rC=ct(),CF=dt(),EF=mt(),jf=class extends EF.FsmState{constructor(){super(rC.SessionState.Terminated)}throw(){throw new Error("Invalid state (null)")}get sessionState(){return this.throw(),rC.SessionState.Terminated}get terminationCause(){return this.throw(),CF.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()}};ad.NullState=jf});var aC=p(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.TimerEvent=void 0;var eh=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})`}};od.TimerEvent=eh});var mt=p(Ke=>{"use strict";var bF=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]})),Tr=Ke&&Ke.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&bF(t,e,n)};Object.defineProperty(Ke,"__esModule",{value:!0});Tr(Zy(),Ke);Tr(Ce(),Ke);Tr(jy(),Ke);Tr(tC(),Ke);Tr(nC(),Ke);Tr(iC(),Ke);Tr(aC(),Ke)});var Lo=p(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.SessionStateBase=void 0;var Ar=ft(),IF=mt(),TF=dt(),AF=ht(),th=class extends IF.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=TF.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(Ar.Method.Joined).body(AF.Codec.encodeClient(t.from)).build())}sendError(t){let n=this.Session.newMessage().method(Ar.Method.Error);t&&n.body(Ar.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(Ar.Method.PeerEvent).body(Ar.Body.sdp(t.asJson())).build())}onLocalCandidate(t){t.forEach(n=>{let r=this.Session.newMessage().method(Ar.Method.PeerEvent).body(Ar.Body.sdp(n.data));n.instanceId&&r.values({to:n.instanceId}),this.sendOutboundMessage(r.build())})}};sd.SessionStateBase=th});var oC=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 Ri=Ae(),wF=function(e,t){return(0,Ri.pipe)(e,(0,ae.contramap)(t))},OF=function(e){return function(t){return(0,Ri.flow)(e,t)}};ae.contramap=OF;ae.URI="Predicate";var DF=function(){return{concat:function(e,t){return(0,Ri.pipe)(e,(0,ae.or)(t))}}};ae.getSemigroupAny=DF;var RF=function(){return{concat:(0,ae.getSemigroupAny)().concat,empty:Ri.constFalse}};ae.getMonoidAny=RF;var FF=function(){return{concat:function(e,t){return(0,Ri.pipe)(e,(0,ae.and)(t))}}};ae.getSemigroupAll=FF;var PF=function(){return{concat:(0,ae.getSemigroupAll)().concat,empty:Ri.constTrue}};ae.getMonoidAll=PF;ae.Contravariant={URI:ae.URI,contramap:wF};var NF=function(e){return function(t){return!e(t)}};ae.not=NF;var MF=function(e){return function(t){return function(n){return t(n)||e(n)}}};ae.or=MF;var BF=function(e){return function(t){return function(n){return t(n)&&e(n)}}};ae.and=BF});var sC=p(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.concatAll=nt.endo=nt.filterSecond=nt.filterFirst=nt.reverse=void 0;var qF=function(e){return{concat:function(t,n){return e.concat(n,t)}}};nt.reverse=qF;var kF=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}};nt.filterFirst=kF;var JF=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}};nt.filterSecond=JF;var LF=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}};nt.endo=LF;var UF=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};nt.concatAll=UF});var uC=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 WF=Ae(),HF=function(e){return{equals:function(t,n){return t===n||e(t,n)}}};z.fromEquals=HF;var VF=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=VF;var KF=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=KF;var zF=function(e,t){return(0,WF.pipe)(e,(0,z.contramap)(t))},GF=function(e){return function(t){return(0,z.fromEquals)(function(n,r){return t.equals(e(n),e(r))})}};z.contramap=GF;z.URI="Eq";z.eqStrict={equals:function(e,t){return e===t}};var ZF={equals:function(){return!0}},QF=function(){return{concat:function(e,t){return(0,z.fromEquals)(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}};z.getSemigroup=QF;var YF=function(){return{concat:(0,z.getSemigroup)().concat,empty:ZF}};z.getMonoid=YF;z.Contravariant={URI:z.URI,contramap:zF};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 cC=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 $F=uC(),ud=Ae(),XF=function(e){return function(t,n){return t===n||e(t,n)===0}};k.equalsDefault=XF;var jF=function(e){return{equals:(0,k.equalsDefault)(e),compare:function(t,n){return t===n?0:e(t,n)}}};k.fromCompare=jF;var e4=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=e4;var t4=function(e){return(0,k.fromCompare)(function(t,n){return e.compare(n,t)})};k.reverse=t4;var n4=function(e,t){return(0,ud.pipe)(e,(0,k.contramap)(t))},r4=function(e){return function(t){return(0,k.fromCompare)(function(n,r){return t.compare(e(n),e(r))})}};k.contramap=r4;k.URI="Ord";var i4=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=i4;var a4=function(){return{concat:(0,k.getSemigroup)().concat,empty:(0,k.fromCompare)(function(){return 0})}};k.getMonoid=a4;k.Contravariant={URI:k.URI,contramap:n4};k.trivial={equals:ud.constTrue,compare:(0,ud.constant)(0)};var o4=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}};k.equals=o4;var s4=function(e){return function(t,n){return e.compare(t,n)===-1}};k.lt=s4;var u4=function(e){return function(t,n){return e.compare(t,n)===1}};k.gt=u4;var c4=function(e){return function(t,n){return e.compare(t,n)!==1}};k.leq=c4;var d4=function(e){return function(t,n){return e.compare(t,n)!==-1}};k.geq=d4;var l4=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}};k.min=l4;var f4=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};k.max=f4;var h4=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=h4;var p4=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=p4;k.getTupleOrd=k.tuple;k.getDualOrd=k.reverse;k.ord=k.Contravariant;function v4(e,t){return e<t?-1:e>t?1:0}var nh={equals:$F.eqStrict.equals,compare:v4};k.ordBoolean=nh;k.ordString=nh;k.ordNumber=nh;k.ordDate=(0,ud.pipe)(k.ordNumber,(0,k.contramap)(function(e){return e.valueOf()}))});var hC=p(L=>{"use strict";var m4=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]})),g4=L&&L.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),rh=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)&&m4(t,e,n);return g4(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=w4;var dC=Ae(),_4=rh(xr()),lC=rh(sC()),fC=rh(cC()),x4=function(e){return{concat:fC.min(e)}};L.min=x4;var S4=function(e){return{concat:fC.max(e)}};L.max=S4;var y4=function(e){return{concat:function(){return e}}};L.constant=y4;L.reverse=lC.reverse;var C4=function(e){return{concat:function(t,n){var r={};for(var i in e)_4.has.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}};L.struct=C4;var E4=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=E4;var b4=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}};L.intercalate=b4;var I4=function(){return{concat:dC.identity}};L.first=I4;var T4=function(){return{concat:function(e,t){return t}}};L.last=T4;L.concatAll=lC.concatAll;L.semigroupVoid=(0,L.constant)(void 0);var A4=function(){return{concat:function(e,t){return Object.assign({},e,t)}}};L.getObjectSemigroup=A4;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 w4(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=dC.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 pC=p(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.guard=O4;function O4(e,t){return function(n){return n?t.of(void 0):e.zero()}}});var yC=p(h=>{"use strict";var D4=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]})),R4=h&&h.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vC=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)&&D4(t,e,n);return R4(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=M4;h.elem=SC;h.getRefinement=xP;var F4=Nl(),cd=Lu(),mC=vC(Wu()),ah=Bl(),ce=Ae(),Wo=bo(),wr=vC(xr()),P4=oC(),gC=hC(),oh=kl(),_C=Jl(),N4=pC();h.none=wr.none;h.some=wr.some;function M4(e){return function(t){return e(t)?(0,h.some)(t):h.none}}var B4=function(e){return e._tag==="Right"?h.none:(0,h.some)(e.left)};h.getLeft=B4;var q4=function(e){return e._tag==="Left"?h.none:(0,h.some)(e.right)};h.getRight=q4;var ze=function(e,t){return(0,ce.pipe)(e,(0,h.map)(t))},Or=function(e,t){return(0,ce.pipe)(e,(0,h.ap)(t))},dd=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduce)(t,n))},ld=function(e){var t=(0,h.foldMap)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},fd=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduceRight)(t,n))},sh=function(e){var t=(0,h.traverse)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},uh=function(e,t){return(0,ce.pipe)(e,(0,h.alt)(t))},Uo=function(e,t){return(0,ce.pipe)(e,(0,h.filter)(t))},ch=function(e,t){return(0,ce.pipe)(e,(0,h.filterMap)(t))},xC=function(e,t){return(0,ce.pipe)(e,(0,h.extend)(t))},dh=function(e,t){return(0,ce.pipe)(e,(0,h.partition)(t))},lh=function(e,t){return(0,ce.pipe)(e,(0,h.partitionMap)(t))};h.URI="Option";var k4=function(e){return{show:function(t){return(0,h.isNone)(t)?"none":"some(".concat(e.show(t.value),")")}}};h.getShow=k4;var J4=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=J4;var L4=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=L4;var U4=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=U4;var W4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t.value))}};h.map=W4;h.Functor={URI:h.URI,map:ze};h.as=(0,ce.dual)(2,(0,Wo.as)(h.Functor));h.asUnit=(0,Wo.asUnit)(h.Functor);h.of=h.some;h.Pointed={URI:h.URI,of:h.of};var H4=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=H4;h.Apply={URI:h.URI,map:ze,ap:Or};h.Applicative={URI:h.URI,map:ze,ap:Or,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:Or,chain:h.flatMap};h.Monad={URI:h.URI,map:ze,ap:Or,of:h.of,chain:h.flatMap};var V4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(e,n.value)}};h.reduce=V4;var K4=function(e){return function(t){return function(n){return(0,h.isNone)(n)?e.empty:t(n.value)}}};h.foldMap=K4;var z4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(n.value,e)}};h.reduceRight=z4;h.Foldable={URI:h.URI,reduce:dd,foldMap:ld,reduceRight:fd};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:uh};var G4=function(){return h.none};h.zero=G4;h.Zero={URI:h.URI,zero:h.zero};h.guard=(0,N4.guard)(h.Zero,h.Pointed);h.Alternative={URI:h.URI,map:ze,ap:Or,of:h.of,alt:uh,zero:h.zero};var Z4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t))}};h.extend=Z4;h.Extend={URI:h.URI,map:ze,extend:xC};h.compact=(0,h.flatMap)(ce.identity);var Q4=(0,oh.separated)(h.none,h.none),Y4=function(e){return(0,h.isNone)(e)?Q4:(0,oh.separated)((0,h.getLeft)(e.value),(0,h.getRight)(e.value))};h.separate=Y4;h.Compactable={URI:h.URI,compact:h.compact,separate:h.separate};var $4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)?t:h.none}};h.filter=$4;var X4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)}};h.filterMap=X4;var j4=function(e){return function(t){return(0,oh.separated)(Uo(t,(0,P4.not)(e)),Uo(t,e))}};h.partition=j4;var eP=function(e){return(0,ce.flow)((0,h.map)(e),h.separate)};h.partitionMap=eP;h.Filterable={URI:h.URI,map:ze,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh};var tP=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=tP;var nP=function(e){return function(t){return(0,h.isNone)(t)?e.of(h.none):e.map(t.value,h.some)}};h.sequence=nP;h.Traversable={URI:h.URI,map:ze,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence};var fh=(0,_C.witherDefault)(h.Traversable,h.Compactable),hh=(0,_C.wiltDefault)(h.Traversable,h.Compactable),rP=function(e){var t=fh(e);return function(n){return function(r){return t(r,n)}}};h.wither=rP;var iP=function(e){var t=hh(e);return function(n){return function(r){return t(r,n)}}};h.wilt=iP;h.Witherable={URI:h.URI,map:ze,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh,wither:fh,wilt:hh};var aP=function(){return h.none};h.throwError=aP;h.MonadThrow={URI:h.URI,map:ze,ap:Or,of:h.of,chain:h.flatMap,throwError:h.throwError};h.fromEither=h.getRight;h.FromEither={URI:h.URI,fromEither:h.fromEither};h.isSome=wr.isSome;var oP=function(e){return e._tag==="None"};h.isNone=oP;var sP=function(e,t){return function(n){return(0,h.isNone)(n)?e():t(n.value)}};h.matchW=sP;h.foldW=h.matchW;h.match=h.matchW;h.fold=h.match;var uP=function(e){return function(t){return(0,h.isNone)(t)?e():t.value}};h.getOrElseW=uP;h.getOrElse=h.getOrElseW;h.flap=(0,Wo.flap)(h.Functor);h.apFirst=(0,cd.apFirst)(h.Apply);h.apSecond=(0,cd.apSecond)(h.Apply);h.flatten=h.compact;h.tap=(0,ce.dual)(2,mC.tap(h.Chain));h.tapEither=(0,ce.dual)(2,(0,ah.tapEither)(h.FromEither,h.Chain));h.duplicate=(0,h.extend)(ce.identity);h.fromEitherK=(0,ah.fromEitherK)(h.FromEither);h.chainEitherK=(0,ah.chainEitherK)(h.FromEither,h.Chain);h.chainFirstEitherK=h.tapEither;var cP=function(e){return e==null?h.none:(0,h.some)(e)};h.fromNullable=cP;var dP=function(e){try{return(0,h.some)(e())}catch{return h.none}};h.tryCatch=dP;var lP=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=lP;var fP=function(e){return(0,ce.flow)(e,h.fromNullable)};h.fromNullableK=fP;var hP=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.fromNullable)(e(t.value))}};h.chainNullableK=hP;h.toNullable=(0,h.match)(ce.constNull,ce.identity);h.toUndefined=(0,h.match)(ce.constUndefined,ce.identity);function SC(e){return function(t,n){if(n===void 0){var r=SC(e);return function(i){return r(t,i)}}return(0,h.isNone)(n)?!1:e.equals(t,n.value)}}var pP=function(e){return function(t){return(0,h.isNone)(t)?!1:e(t.value)}};h.exists=pP;h.Do=(0,h.of)(wr.emptyRecord);h.bindTo=(0,Wo.bindTo)(h.Functor);var vP=(0,Wo.let)(h.Functor);h.let=vP;h.bind=mC.bind(h.Chain);h.apS=(0,cd.apS)(h.Apply);h.ApT=(0,h.of)(wr.emptyReadonlyArray);var mP=function(e){return function(t){var n=e(0,wr.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=mP;var gP=function(e){var t=(0,h.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return wr.isNonEmpty(n)?t(n):h.ApT}};h.traverseReadonlyArrayWithIndex=gP;h.traverseArrayWithIndex=h.traverseReadonlyArrayWithIndex;var _P=function(e){return(0,h.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};h.traverseArray=_P;h.sequenceArray=(0,h.traverseArray)(ce.identity);h.chain=h.flatMap;h.chainFirst=h.tap;function xP(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:Or,chain:h.flatMap,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence,zero:h.zero,alt:uh,extend:xC,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh,wither:fh,wilt:hh,throwError:h.throwError};h.getApplySemigroup=(0,cd.getApplySemigroup)(h.Apply);h.getApplyMonoid=(0,F4.getApplicativeMonoid)(h.Applicative);var SP=function(){return(0,h.getMonoid)((0,gC.first)())};h.getFirstMonoid=SP;var yP=function(){return(0,h.getMonoid)((0,gC.last)())};h.getLastMonoid=yP});var gh=p(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.EstablishedState=void 0;var ph=yC(),CP=Ae(),vh=ht(),Fi=ft(),EP=ct(),$t=dt(),bP=Lo(),IP=Di(),CC=new Map([[$t.TerminationCause.None,{terminationCause:$t.TerminationCause.HungUp,headers:{extterm:vh.HeaderBooleanValue.Yes}}],[$t.TerminationCause.Inactive,{terminationCause:$t.TerminationCause.Inactive,headers:{inactive:vh.HeaderBooleanValue.Yes}}],[$t.TerminationCause.IceFailedToConnect,{terminationCause:$t.TerminationCause.IceFailedToConnect,headers:{iceFailed:vh.HeaderBooleanValue.Yes}}]]),mh=class extends bP.SessionStateBase{constructor(t){super(EP.SessionState.Established,t),this.toMessageContent=n=>CC.has(n)?(0,ph.some)(CC.get(n)):ph.none}setTerminationCauseAndLeave(t){this.terminationCause=t.terminationCause;let n=this.Session.newMessage().method(Fi.Method.Leave),r=t.headers?n.values(t.headers).build():n.build();this.sendOutboundMessage(r)}onWillTerminate(t){if(t!==IP.TransitionSource.RemotePeerMessage)if(this.terminationCause===$t.TerminationCause.Error){this.sendError(this.Session.error);return}else{this.sendMxpMessageForLocalTermination();return}}sendMxpMessageForLocalTermination(){(0,CP.pipe)(this.terminationCause,this.toMessageContent,(0,ph.match)(()=>{},t=>this.setTerminationCauseAndLeave(t)))}handleInboundMessage(t){switch(t.method){case Fi.Method.Leave:return this.terminateBasedOnMessage(t,$t.TerminationCause.HungUp),!0;case Fi.Method.Ack:return!0;case Fi.Method.Join:return this.sendJoined(t),!0;case Fi.Method.PeerEvent:return this.Session.emitJsepEvent(t),!0;case Fi.Method.Error:return this.terminateBasedOnMessage(t,$t.TerminationCause.Error),!0}return!1}};hd.EstablishedState=mh});var xh=p(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.TerminatedState=void 0;var TP=ct(),AP=Lo(),_h=class extends AP.SessionStateBase{constructor(t){super(TP.SessionState.Terminated,t)}handleInboundMessage(t){return!0}};pd.TerminatedState=_h});var EC=p(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.InvalidStateTransition=void 0;var wP=Ce(),Sh=class extends wP.ErrorBase{constructor(t,n){super(`Invalid transition ${t} -> ${n}`)}};vd.InvalidStateTransition=Sh});var bC=p(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.MessageBuilder=void 0;var OP=mt(),DP=ue(),RP=Ds(),Ho=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 OP.ArgumentError("Missing arguments",(0,DP.nameof)(this));return new RP.Message(this.mxpMethod,this.mxpSessionId,this.mxpFrom,this.mxpBody,this.mxpValues)}};md.MessageBuilder=Ho;Ho.create=()=>new Ho});var Ch=p(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.Session=void 0;var FP=require("pubnub"),IC=ft(),gd=mt(),_d=Ce(),PP=EC(),Pi=Co(),NP=dt(),MP=ct(),xd=un(),BP=bC(),qP=ue(),kP=Di(),TC=Jo(),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 gd.NullState,this.transitions=new gd.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 xd.Event,this.symmetricSessionKey=null,this.onSessionKey=new xd.Event,this.stateChanged=new xd.Event,this.outboundMessageEvent=new xd.Event,this.addJsepMessage=a=>{a.forEach(s=>this.pendingJsepMessages.push(s))},n.length<=0)throw new _d.ArgumentError("Invalid session id",(0,qP.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(MP.SessionState.Initiating,kP.TransitionSource.LocalAction))}set onStateChanged(t){this.stateChanged.add(t)}set onOutboundMessage(t){this.outboundMessageEvent.add(t)}newMessage(){return BP.MessageBuilder.create().sessionId(this.sessionId).from(this.localPeer)}setInitialState(t){this.fsmState=t}setStartedAt(){if(this.startedAt)throw new _d.InvalidOperationError("Started timestamp already set");this.startedAt=new Date}timeoutRelativeToStart(t){if(!this.startedAt)throw new _d.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 _d.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(IC.Method.PeerEvent).body(IC.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 PP.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==NP.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){Pi.JsepMessage.tryParse(t,n=>{this.emitJsepEvents(n)})}addPendingInboundMessage(t){this.pendingInboundMessages.push(t)}setLocalCandidate(t){this.tryWithCurrentState(n=>n.onCandidate(Pi.Source.Local,t))}setLocalSessionDescription(t){this.localDescription=new Pi.SessionDescription(t.isAnswer?Pi.DescriptionType.Answer:Pi.DescriptionType.Offer,t.data),this.tryWithCurrentState(n=>{this.localDescription&&n.onSessionDescription(Pi.Source.Local,this.localDescription)})}scheduleTimeout(t,n,r){let i=new gd.TimerEvent((0,FP.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 gd.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 TC.TimerEventType.Termination:t==this.fsmState&&t.onStateTimeout(n);break;case TC.TimerEventType.ACKWindowEnd:this.onACKWindowTimeout(t,n);break}}};Sd.Session=yh});var OC=p(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.OutboundSession=void 0;var ve=ft(),JP=Lo(),Eh=ht(),wC=ue(),LP=gh(),UP=xh(),Tt=dt(),_e=ct(),WP=Ch(),AC=mt(),HP=Lt(),Vo=Di(),yd=Jo(),Ko=class extends JP.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 Ko{constructor(t){super(_e.SessionState.Created,t)}},Ih=class extends Ko{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),yd.TimerEventType.ACKWindowEnd),this.Session.scheduleTimeout(this,this.CallProgressTimeoutMs,yd.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:wC.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,Vo.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,Vo.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!==Vo.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 Ko{constructor(t){super(_e.SessionState.Progress,t)}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallSetupTimeoutMs),yd.TimerEventType.Termination),this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallACKWindowTimeoutMs),yd.TimerEventType.ACKWindowEnd)}handleInboundMessage(t){switch(t.method){case ve.Method.Join:this.sendJoined(t),this.Session.emitJsepEvent(t),this.transition(_e.SessionState.Established,Vo.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!==Vo.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 WP.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,HP.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 LP.EstablishedState(this),d=new UP.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 AC.ArgumentError("Invalid key (empty)",(0,wC.nameof)(t));if(this.sessionKey!=null)throw new AC.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)})}};Cd.OutboundSession=Ah});var Ed=p((l9,RC)=>{var DC=RC.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(DC).forEach(function(e){var t=DC[e];t.forEach(function(n){n.reg||(n.reg=/(.*)/),n.format||(n.format="%s")})})});var NC=p(Xt=>{var Ni=function(e){return String(Number(e))===e?Number(e):e},VP=function(e,t,n,r){if(r&&!n)t[r]=Ni(e[1]);else for(var i=0;i<n.length;i+=1)e[i+1]!=null&&(t[n[i]]=Ni(e[i+1]))},KP=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;VP(n.match(e.reg),i,e.names,e.name),e.push&&t[e.push].push(i)},FC=Ed(),zP=RegExp.prototype.test.bind(/^([a-z])=(.*)/);Xt.parse=function(e){var t={},n=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(zP).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<(FC[a]||[]).length;u+=1){var d=FC[a][u];if(d.reg.test(s))return KP(d,r,s)}}),t.media=n,t};var PC=function(e,t){var n=t.split(/=(.+)/,2);return n.length===2?e[n[0]]=Ni(n[1]):n.length===1&&t.length>1&&(e[n[0]]=void 0),e};Xt.parseParams=function(e){return e.split(/;\s?/).reduce(PC,{})};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(Ni),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(PC,{})})};Xt.parseSimulcastStreamList=function(e){return e.split(";").map(function(t){return t.split(",").map(function(n){var r,i=!1;return n[0]!=="~"?r=Ni(n):(r=Ni(n.substring(1,n.length)),i=!0),{scid:r,paused:i}})})}});var BC=p((h9,MC)=>{var wh=Ed(),GP=/%[sdv%]/g,ZP=function(e){var t=1,n=arguments,r=n.length;return e.replace(GP,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""}})},zo=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 ZP.apply(null,i)},QP=["v","o","s","i","u","e","p","c","b","t","r","z","a"],YP=["i","c","b","a"];MC.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||QP,r=t.innerOrder||YP,i=[];return n.forEach(function(a){wh[a].forEach(function(s){s.name in e&&e[s.name]!=null?i.push(zo(a,s,e)):s.push in e&&e[s.push]!=null&&e[s.push].forEach(function(u){i.push(zo(a,s,u))})})}),e.media.forEach(function(a){i.push(zo("m",wh.m[0],a)),r.forEach(function(s){wh[s].forEach(function(u){u.name in a&&a[u.name]!=null?i.push(zo(s,u,a)):u.push in a&&a[u.push]!=null&&a[u.push].forEach(function(d){i.push(zo(s,u,d))})})})}),i.join(`\r
|
|
1
|
+
"use strict";var YT=Object.create;var Cs=Object.defineProperty;var $T=Object.getOwnPropertyDescriptor;var XT=Object.getOwnPropertyNames;var jT=Object.getPrototypeOf,eA=Object.prototype.hasOwnProperty;var p=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},tA=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})},Lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of XT(t))!eA.call(e,i)&&i!==n&&Cs(e,i,{get:()=>t[i],enumerable:!(r=$T(t,i))||r.enumerable});return e};var nA=(e,t,n)=>(n=e!=null?YT(jT(e)):{},Lv(t||!e||!e.__esModule?Cs(n,"default",{value:e,enumerable:!0}):n,e)),rA=e=>Lv(Cs({},"__esModule",{value:!0}),e);var Lt=p(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.Direction=void 0;var Uv;(function(e){e[e.Inbound=0]="Inbound",e[e.Outbound=1]="Outbound"})(Uv||(Es.Direction=Uv={}))});var ct=p(bs=>{"use strict";Object.defineProperty(bs,"__esModule",{value:!0});bs.SessionState=void 0;var Wv;(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"})(Wv||(bs.SessionState=Wv={}))});var un=p(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.Event=void 0;var W0=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=[]}};Is.Event=W0});var Vv=p(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.SessionDescription=cn.Source=cn.DescriptionType=void 0;var Ts;(function(e){e[e.Offer=1]="Offer",e[e.Answer=2]="Answer"})(Ts||(cn.DescriptionType=Ts={}));var Hv;(function(e){e[e.Local=1]="Local",e[e.Remote=2]="Remote"})(Hv||(cn.Source=Hv={}));var ba=class e{constructor(t,n){this.type=t,this.sdp=n}asJson(){switch(this.type){case Ts.Offer:return e.toJson(e.offer,this.sdp);case Ts.Answer:return e.toJson(e.answer,this.sdp)}}static toJson(t,n){return JSON.stringify({type:t,sdp:n.toString()})}};cn.SessionDescription=ba;ba.answer="answer";ba.offer="offer"});var dt=p(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.TerminationCause=void 0;var Kv;(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"})(Kv||(As.TerminationCause=Kv={}))});var Ce=p(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.ArgumentError=xt.InvalidOperationError=xt.UnhandledEventError=xt.ErrorBase=void 0;var Gr=class extends Error{constructor(t){super(t),this.name=this.constructor.name}};xt.ErrorBase=Gr;var H0=class extends Gr{constructor(t,n){super(n?`${t} (state: ${n})`:t)}};xt.UnhandledEventError=H0;var V0=class extends Gr{};xt.InvalidOperationError=V0;var K0=class extends Gr{constructor(t,n){super(`${t}, type: ${n}`)}};xt.ArgumentError=K0});var dn=p(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.SinchError=St.ErrorCode=St.ErrorMessage=St.ErrorType=void 0;var iA=Ce(),z0;(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"})(z0||(St.ErrorType=z0={}));var ws=class{};St.ErrorMessage=ws;ws.ICE_FAILED_TO_CONNECT="ICE failed to connect";var zv;(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"})(zv||(St.ErrorCode=zv={}));var G0=class extends iA.ErrorBase{constructor(t,n=500,r=z0.Generic,i){super(t),this.message=t,this.code=n,this.domain=r,this.isFatal=i}};St.SinchError=G0});var Zv=p(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0})});var Qv=p(Os=>{"use strict";Object.defineProperty(Os,"__esModule",{value:!0});Os.Body=void 0;var aA=Ds(),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,aA.Message.errorToJsonString(t))}};Os.Body=ln;ln.clientType="client";ln.sdpType="sdp";ln.mediaType="media";ln.clientEventType="clientEvent";ln.errorJsonType="error/json"});var $v=p(Yv=>{"use strict";Object.defineProperty(Yv,"__esModule",{value:!0})});var Z0=p(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.Method=void 0;var Xv;(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"})(Xv||(Rs.Method=Xv={}))});var jv=p(()=>{});var X=p((Fs,em)=>{(function(e,t){typeof Fs=="object"?em.exports=Fs=t():e.CryptoJS=t()})(Fs,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 require=="function")try{r=jv()}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 Ia=p((Ps,tm)=>{(function(e,t){typeof Ps=="object"?tm.exports=Ps=t(X()):t(e.CryptoJS)})(Ps,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 rm=p((Ns,nm)=>{(function(e,t){typeof Ns=="object"?nm.exports=Ns=t(X()):t(e.CryptoJS)})(Ns,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 am=p((Ms,im)=>{(function(e,t){typeof Ms=="object"?im.exports=Ms=t(X()):t(e.CryptoJS)})(Ms,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((Bs,om)=>{(function(e,t){typeof Bs=="object"?om.exports=Bs=t(X()):t(e.CryptoJS)})(Bs,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 um=p((qs,sm)=>{(function(e,t){typeof qs=="object"?sm.exports=qs=t(X()):t(e.CryptoJS)})(qs,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((ks,cm)=>{(function(e,t){typeof ks=="object"?cm.exports=ks=t(X()):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=[];(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 Q0=p((Js,dm)=>{(function(e,t){typeof Js=="object"?dm.exports=Js=t(X()):t(e.CryptoJS)})(Js,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 Us=p((Ls,lm)=>{(function(e,t){typeof Ls=="object"?lm.exports=Ls=t(X()):t(e.CryptoJS)})(Ls,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 hm=p((Ws,fm)=>{(function(e,t,n){typeof Ws=="object"?fm.exports=Ws=t(X(),Us()):t(e.CryptoJS)})(Ws,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 Y0=p((Hs,pm)=>{(function(e,t,n){typeof Hs=="object"?pm.exports=Hs=t(X(),Ia()):t(e.CryptoJS)})(Hs,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,ga=T,Vr=N,L0=J,_a=F,st=V,We=H,xs=Z,xa=j,Ss=R,Sa=M,U0=B,ya=P,ut=0;ut<80;ut++){var $e,on,ys=o[ut];if(ut<16)on=ys.high=m[_+ut*2]|0,$e=ys.low=m[_+ut*2+1]|0;else{var wv=o[ut-15],Kr=wv.high,Ca=wv.low,qT=(Kr>>>1|Ca<<31)^(Kr>>>8|Ca<<24)^Kr>>>7,Ov=(Ca>>>1|Kr<<31)^(Ca>>>8|Kr<<24)^(Ca>>>7|Kr<<25),Dv=o[ut-2],zr=Dv.high,Ea=Dv.low,kT=(zr>>>19|Ea<<13)^(zr<<3|Ea>>>29)^zr>>>6,Rv=(Ea>>>19|zr<<13)^(Ea<<3|zr>>>29)^(Ea>>>6|zr<<26),Fv=o[ut-7],JT=Fv.high,LT=Fv.low,Pv=o[ut-16],UT=Pv.high,Nv=Pv.low;$e=Ov+LT,on=qT+JT+($e>>>0<Ov>>>0?1:0),$e=$e+Rv,on=on+kT+($e>>>0<Rv>>>0?1:0),$e=$e+Nv,on=on+UT+($e>>>0<Nv>>>0?1:0),ys.high=on,ys.low=$e}var WT=st&xs^~st&Ss,Mv=We&xa^~We&Sa,HT=de&Me^de&ga^Me&ga,VT=se&Q^se&Vr^Q&Vr,KT=(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),GT=(We>>>14|st<<18)^(We>>>18|st<<14)^(We<<23|st>>>9),qv=c[ut],ZT=qv.high,kv=qv.low,He=ya+GT,sn=U0+zT+(He>>>0<ya>>>0?1:0),He=He+Mv,sn=sn+WT+(He>>>0<Mv>>>0?1:0),He=He+kv,sn=sn+ZT+(He>>>0<kv>>>0?1:0),He=He+$e,sn=sn+on+(He>>>0<$e>>>0?1:0),Jv=Bv+VT,QT=KT+HT+(Jv>>>0<Bv>>>0?1:0);U0=Ss,ya=Sa,Ss=xs,Sa=xa,xs=st,xa=We,We=_a+He|0,st=L0+sn+(We>>>0<_a>>>0?1:0)|0,L0=ga,_a=Vr,ga=Me,Vr=Q,Me=de,Q=se,se=He+Jv|0,de=sn+QT+(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+Vr,v.high=T+ga+(N>>>0<Vr>>>0?1:0),F=g.low=F+_a,g.high=J+L0+(F>>>0<_a>>>0?1:0),H=y.low=H+We,y.high=V+st+(H>>>0<We>>>0?1:0),j=S.low=j+xa,S.high=Z+xs+(j>>>0<xa>>>0?1:0),M=b.low=M+Sa,b.high=R+Ss+(M>>>0<Sa>>>0?1:0),P=I.low=P+ya,I.high=B+U0+(P>>>0<ya>>>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 mm=p((Vs,vm)=>{(function(e,t,n){typeof Vs=="object"?vm.exports=Vs=t(X(),Ia(),Y0()):t(e.CryptoJS)})(Vs,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 _m=p((Ks,gm)=>{(function(e,t,n){typeof Ks=="object"?gm.exports=Ks=t(X(),Ia()):t(e.CryptoJS)})(Ks,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 Sm=p((zs,xm)=>{(function(e,t){typeof zs=="object"?xm.exports=zs=t(X()):t(e.CryptoJS)})(zs,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((Gs,ym)=>{(function(e,t){typeof Gs=="object"?ym.exports=Gs=t(X()):t(e.CryptoJS)})(Gs,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 Em=p((Qs,Cm)=>{(function(e,t,n){typeof Qs=="object"?Cm.exports=Qs=t(X(),Us(),Zs()):t(e.CryptoJS)})(Qs,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((Ys,bm)=>{(function(e,t,n){typeof Ys=="object"?bm.exports=Ys=t(X(),Q0(),Zs()):t(e.CryptoJS)})(Ys,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(($s,Im)=>{(function(e,t,n){typeof $s=="object"?Im.exports=$s=t(X(),Ut()):t(e.CryptoJS)})($s,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 Am=p((Xs,Tm)=>{(function(e,t,n){typeof Xs=="object"?Tm.exports=Xs=t(X(),ye()):t(e.CryptoJS)})(Xs,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 Om=p((js,wm)=>{(function(e,t,n){typeof js=="object"?wm.exports=js=t(X(),ye()):t(e.CryptoJS)})(js,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 Rm=p((eu,Dm)=>{(function(e,t,n){typeof eu=="object"?Dm.exports=eu=t(X(),ye()):t(e.CryptoJS)})(eu,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 Pm=p((tu,Fm)=>{(function(e,t,n){typeof tu=="object"?Fm.exports=tu=t(X(),ye()):t(e.CryptoJS)})(tu,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 Mm=p((nu,Nm)=>{(function(e,t,n){typeof nu=="object"?Nm.exports=nu=t(X(),ye()):t(e.CryptoJS)})(nu,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 qm=p((ru,Bm)=>{(function(e,t,n){typeof ru=="object"?Bm.exports=ru=t(X(),ye()):t(e.CryptoJS)})(ru,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 Jm=p((iu,km)=>{(function(e,t,n){typeof iu=="object"?km.exports=iu=t(X(),ye()):t(e.CryptoJS)})(iu,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 Um=p((au,Lm)=>{(function(e,t,n){typeof au=="object"?Lm.exports=au=t(X(),ye()):t(e.CryptoJS)})(au,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 Hm=p((ou,Wm)=>{(function(e,t,n){typeof ou=="object"?Wm.exports=ou=t(X(),ye()):t(e.CryptoJS)})(ou,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 Km=p((su,Vm)=>{(function(e,t,n){typeof su=="object"?Vm.exports=su=t(X(),ye()):t(e.CryptoJS)})(su,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding})});var Gm=p((uu,zm)=>{(function(e,t,n){typeof uu=="object"?zm.exports=uu=t(X(),ye()):t(e.CryptoJS)})(uu,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 Qm=p((cu,Zm)=>{(function(e,t,n){typeof cu=="object"?Zm.exports=cu=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(cu,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 $m=p((du,Ym)=>{(function(e,t,n){typeof du=="object"?Ym.exports=du=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(du,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 jm=p((lu,Xm)=>{(function(e,t,n){typeof lu=="object"?Xm.exports=lu=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(lu,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 tg=p((fu,eg)=>{(function(e,t,n){typeof fu=="object"?eg.exports=fu=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(fu,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 rg=p((hu,ng)=>{(function(e,t,n){typeof hu=="object"?ng.exports=hu=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(hu,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 ag=p((pu,ig)=>{(function(e,t,n){typeof pu=="object"?ig.exports=pu=t(X(),fn(),hn(),Ut(),ye()):t(e.CryptoJS)})(pu,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 Zn=p((vu,og)=>{(function(e,t,n){typeof vu=="object"?og.exports=vu=t(X(),Ia(),rm(),am(),fn(),um(),hn(),Q0(),Us(),hm(),Y0(),mm(),_m(),Sm(),Zs(),Em(),Ut(),ye(),Am(),Om(),Rm(),Pm(),Mm(),qm(),Jm(),Um(),Hm(),Km(),Gm(),Qm(),$m(),jm(),tg(),rg(),ag()):e.CryptoJS=t(e.CryptoJS)})(vu,function(e){return e})});var X0=p(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.SymmetricKey=void 0;var oA=Zn(),$0=class{constructor(t){this.key=oA.enc.Base64.parse(t)}};mu.SymmetricKey=$0});var ft=p(lt=>{"use strict";var sA=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]})),Ta=lt&<.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&sA(t,e,n)};Object.defineProperty(lt,"__esModule",{value:!0});Ta(Zv(),lt);Ta(Qv(),lt);Ta($v(),lt);Ta(Z0(),lt);Ta(X0(),lt)});var Ds=p(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.Message=Qr.HeaderBooleanValue=void 0;var sg=dt(),Wt=dn(),j0=ft(),Zr;(function(e){e.Yes="yes",e.No="no"})(Zr||(Qr.HeaderBooleanValue=Zr={}));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 j0.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 sg.TerminationCause.IceFailedToConnect;if(this.isFailureTermination())return sg.TerminationCause.Error}isIceFailureFlagSet(){return!this.values||!(e.KEY_ICE_FAILURE in this.values)?!1:this.values[e.KEY_ICE_FAILURE]===Zr.Yes}isFailureTermination(){return!this.values||!(e.KEY_FAILURE_TERMINATION in this.values)?!1:this.values[e.KEY_FAILURE_TERMINATION]===Zr.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!=j0.Method.Deny?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_DENY_ALL])===Zr.No}isEarlyMedia(){var t;return this.method!=j0.Method.Ack?!1:((t=this.values)===null||t===void 0?void 0:t[e.KEY_EARLY_MEDIA])===Zr.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}}};Qr.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 ug=p($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.ProtocolV10Factory=$r.ProtocolV10=void 0;var uA=Zn(),Yr=ht(),cA=ft(),gu=class e{constructor(){this.Version="10",this.sessionBuffer=new Yr.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=Yr.Codec.encrypt(i,n),s=Math.floor(1+a.length/3e4),u=s===1?"-":uA.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=Yr.Codec.decrypt(t,r),a=JSON.parse(i),s=this.encodeClient(a),u=new cA.Body(a.bt,a.bd);return new Yr.Message(parseInt(a.md),n,s,u,a.nvps)}catch(i){throw i.name!=="MXPError"?new Yr.MXPError(Yr.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}};$r.ProtocolV10=gu;var el=class{static create(){return new gu}};$r.ProtocolV10Factory=el});var cg=p(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.MXPError=void 0;var _u=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}};xu.MXPError=_u;_u.Codes={INVALID_DECRYPTION_KEY:1,DECRYPTION_FAIL:2,INVALID_MESSAGE:3,INVALID_BODY_TYPE:4,BODY_PARSE_FAIL:5}});var dg=p(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.SessionMessageBuffer=void 0;var tl=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}};Su.SessionMessageBuffer=tl});var Y=p(oe=>{"use strict";var Xr=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=lA;oe.querystring=ul;oe.mapValues=fA;oe.canConsumeForm=hA;oe.BASE_PATH="http://ocra.api.sinch.com/ocra".replace(/\/+$/,"");var dA=e=>typeof Blob<"u"&&e instanceof Blob,nl=class{constructor(t=new yu){this.configuration=t,this.fetchApi=(n,r)=>Xr(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 Xr(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||dA(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=nl;var rl=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}};oe.RequiredError=rl;oe.COLLECTION_FORMATS={csv:",",ssv:" ",tsv:" ",pipes:"|"};var yu=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||ul}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=yu;function lA(e,t){let n=e[t];return n!=null}function ul(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?ul(i,r):`${encodeURIComponent(r)}=${encodeURIComponent(String(i))}`}).filter(n=>n.length>0).join("&")}function fA(e,t){return Object.keys(e).reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])}),{})}function hA(e){for(let t of e)if(t.contentType==="multipart/form-data")return!0;return!1}var il=class{constructor(t,n=r=>r){this.raw=t,this.transformer=n}value(){return Xr(this,void 0,void 0,function*(){return this.transformer(yield this.raw.json())})}};oe.JSONApiResponse=il;var al=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){})}};oe.VoidApiResponse=al;var ol=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){return yield this.raw.blob()})}};oe.BlobApiResponse=ol;var sl=class{constructor(t){this.raw=t}value(){return Xr(this,void 0,void 0,function*(){return yield this.raw.text()})}};oe.TextApiResponse=sl});var pg=p(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ApnPushProfileEnvironmentEnum=Ht.ApnPushProfileTokenTypeEnum=void 0;Ht.ApnPushProfileFromJSON=pA;Ht.ApnPushProfileFromJSONTyped=hg;Ht.ApnPushProfileToJSON=vA;var lg;(function(e){e.Voip="voip",e.Default="default"})(lg||(Ht.ApnPushProfileTokenTypeEnum=lg={}));var fg;(function(e){e.Development="development",e.Production="production"})(fg||(Ht.ApnPushProfileEnvironmentEnum=fg={}));function pA(e){return hg(e,!1)}function hg(e,t){return e==null?e:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}function vA(e){if(e!==void 0)return e===null?null:{tokenType:e.tokenType,deviceToken:e.deviceToken,environment:e.environment,bundleId:e.bundleId}}});var mg=p(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.AudioRouteEventFromJSON=mA;Aa.AudioRouteEventFromJSONTyped=vg;Aa.AudioRouteEventToJSON=gA;function mA(e){return vg(e,!1)}function vg(e,t){return e==null?e:{description:e.description,time:new Date(e.time)}}function gA(e){if(e!==void 0)return e===null?null:{description:e.description,time:e.time.toISOString()}}});var _g=p(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.AudioRouteEventLogFromJSON=_A;wa.AudioRouteEventLogFromJSONTyped=gg;wa.AudioRouteEventLogToJSON=xA;var Cu=G();function _A(e){return gg(e,!1)}function gg(e,t){return e==null?e:{events:e.events.map(Cu.AudioRouteEventFromJSON),eventsSemanticVersion:(0,Cu.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function xA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Cu.AudioRouteEventToJSON),eventsSemanticVersion:(0,Cu.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var Sg=p(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.BasicCallReportFromJSON=SA;Oa.BasicCallReportFromJSONTyped=xg;Oa.BasicCallReportToJSON=yA;var pt=Y(),le=G();function SA(e){return xg(e,!1)}function xg(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 yA(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 Cg=p(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.CallInitiationRequestFromJSON=CA;Ra.CallInitiationRequestFromJSONTyped=yg;Ra.CallInitiationRequestToJSON=EA;var Da=Y(),Eu=G();function CA(e){return yg(e,!1)}function yg(e,t){return e==null?e:{callId:e.callId,destination:(0,Eu.DestinationFromJSON)(e.destination),rtcOffer:(0,Eu.WebrtcRTCSessionDescriptionFromJSON)(e.rtcOffer),requestedAudio:e.requestedAudio,requestedVideo:e.requestedVideo,publicCallHeaders:(0,Da.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,cli:(0,Da.exists)(e,"cli")?e.cli:void 0,mxpInstanceId:(0,Da.exists)(e,"mxpInstanceId")?e.mxpInstanceId:void 0,legacyMediaProxyEngage:(0,Da.exists)(e,"legacyMediaProxyEngage")?e.legacyMediaProxyEngage:void 0,mxpClientEventsVersion:(0,Da.exists)(e,"mxpClientEventsVersion")?e.mxpClientEventsVersion:void 0}}function EA(e){if(e!==void 0)return e===null?null:{callId:e.callId,destination:(0,Eu.DestinationToJSON)(e.destination),rtcOffer:(0,Eu.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 Ig=p(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.CallInitiationResponseFromJSON=bA;Fa.CallInitiationResponseFromJSONTyped=bg;Fa.CallInitiationResponseToJSON=IA;var bu=Y(),Eg=G();function bA(e){return bg(e,!1)}function bg(e,t){return e==null?e:{callId:e.callId,mxpEncryptionKey:e.mxpEncryptionKey,mxpSignalChannel:e.mxpSignalChannel,instances:(0,bu.exists)(e,"instances")?e.instances.map(Eg.RemotePeerInstanceFromJSON):void 0,startTime:new Date(e.startTime),legacyRelayIceCandidates:(0,bu.exists)(e,"legacyRelayIceCandidates")?e.legacyRelayIceCandidates:void 0,publicCallHeaders:(0,bu.exists)(e,"publicCallHeaders")?e.publicCallHeaders:void 0,apiBaseUrl:(0,bu.exists)(e,"apiBaseUrl")?e.apiBaseUrl:void 0}}function IA(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(Eg.RemotePeerInstanceToJSON),startTime:e.startTime.toISOString(),legacyRelayIceCandidates:e.legacyRelayIceCandidates,publicCallHeaders:e.publicCallHeaders,apiBaseUrl:e.apiBaseUrl}}});var Ag=p(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.CallQualityFromJSON=TA;Pa.CallQualityFromJSONTyped=Tg;Pa.CallQualityToJSON=AA;var Iu=G();function TA(e){return Tg(e,!1)}function Tg(e,t){return e==null?e:{warningEvents:e.warningEvents.map(Iu.WarningEventFromJSON),semanticVersion:(0,Iu.SemanticVersionFromJSON)(e.semanticVersion)}}function AA(e){if(e!==void 0)return e===null?null:{warningEvents:e.warningEvents.map(Iu.WarningEventToJSON),semanticVersion:(0,Iu.SemanticVersionToJSON)(e.semanticVersion)}}});var Og=p(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.CallReportFromJSON=wA;Na.CallReportFromJSONTyped=wg;Na.CallReportToJSON=OA;var me=Y(),re=G();function wA(e){return wg(e,!1)}function wg(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 OA(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 Fg=p(Ma=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.CallReportInstanceFromJSON=RA;Ma.CallReportInstanceFromJSONTyped=Rg;Ma.CallReportInstanceToJSON=FA;var DA=Y(),Dg=G();function RA(e){return Rg(e,!1)}function Rg(e,t){return e==null?e:{id:e.id,deviceId:(0,DA.exists)(e,"deviceId")?e.deviceId:void 0,version:(0,Dg.InstanceVersionDataFromJSON)(e.version)}}function FA(e){if(e!==void 0)return e===null?null:{id:e.id,deviceId:e.deviceId,version:(0,Dg.InstanceVersionDataToJSON)(e.version)}}});var Mg=p(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CallResult=void 0;Qn.CallResultFromJSON=PA;Qn.CallResultFromJSONTyped=Ng;Qn.CallResultToJSON=NA;var Pg;(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"})(Pg||(Qn.CallResult=Pg={}));function PA(e){return Ng(e,!1)}function Ng(e,t){return e}function NA(e){return e}});var kg=p(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.ClientErrorFromJSON=MA;Ba.ClientErrorFromJSONTyped=qg;Ba.ClientErrorToJSON=BA;var cl=Y(),Bg=G();function MA(e){return qg(e,!1)}function qg(e,t){return e==null?e:{code:(0,cl.exists)(e,"code")?e.code:void 0,domain:(0,cl.exists)(e,"domain")?(0,Bg.ClientErrorDomainFromJSON)(e.domain):void 0,message:(0,cl.exists)(e,"message")?e.message:void 0}}function BA(e){if(e!==void 0)return e===null?null:{code:e.code,domain:(0,Bg.ClientErrorDomainToJSON)(e.domain),message:e.message}}});var Ug=p(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ClientErrorDomain=void 0;Yn.ClientErrorDomainFromJSON=qA;Yn.ClientErrorDomainFromJSONTyped=Lg;Yn.ClientErrorDomainToJSON=kA;var Jg;(function(e){e.Network="network",e.Http="http",e.Api="api",e.Mxp="mxp"})(Jg||(Yn.ClientErrorDomain=Jg={}));function qA(e){return Lg(e,!1)}function Lg(e,t){return e}function kA(e){return e}});var Hg=p(qa=>{"use strict";Object.defineProperty(qa,"__esModule",{value:!0});qa.ClientEventFromJSON=LA;qa.ClientEventFromJSONTyped=Wg;qa.ClientEventToJSON=UA;var JA=Y(),Tu=G();function LA(e){return Wg(e,!1)}function Wg(e,t){return e==null?e:{type:(0,Tu.EventTypeFromJSON)(e.type),name:e.name,time:new Date(e.time),result:(0,JA.exists)(e,"result")?(0,Tu.EventResultFromJSON)(e.result):void 0}}function UA(e){if(e!==void 0)return e===null?null:{type:(0,Tu.EventTypeToJSON)(e.type),name:e.name,time:e.time.toISOString(),result:(0,Tu.EventResultToJSON)(e.result)}}});var Kg=p(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.ClientEventsFromJSON=WA;ka.ClientEventsFromJSONTyped=Vg;ka.ClientEventsToJSON=HA;var Au=G();function WA(e){return Vg(e,!1)}function Vg(e,t){return e==null?e:{events:e.events.map(Au.ClientEventFromJSON),eventsSemanticVersion:(0,Au.SemanticVersionFromJSON)(e.eventsSemanticVersion)}}function HA(e){if(e!==void 0)return e===null?null:{events:e.events.map(Au.ClientEventToJSON),eventsSemanticVersion:(0,Au.SemanticVersionToJSON)(e.eventsSemanticVersion)}}});var Qg=p($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.ConfigIceTransportPolicyEnum=void 0;$n.ConfigFromJSON=VA;$n.ConfigFromJSONTyped=Zg;$n.ConfigToJSON=KA;var zg=Y(),jr=G(),Gg;(function(e){e.Relay="relay",e.Nohost="nohost",e.All="all"})(Gg||($n.ConfigIceTransportPolicyEnum=Gg={}));function VA(e){return Zg(e,!1)}function Zg(e,t){return e==null?e:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:(0,zg.exists)(e,"iceTransportPolicy")?e.iceTransportPolicy:void 0,rtcProfile:(0,jr.RtcProfileFromJSON)(e.rtcProfile),rtcConfig:(0,jr.RtcConfigFromJSON)(e.rtcConfig),pushConfig:(0,zg.exists)(e,"pushConfig")?(0,jr.PushConfigFromJSON)(e.pushConfig):void 0}}function KA(e){if(e!==void 0)return e===null?null:{configRefreshIntervalMs:e.configRefreshIntervalMs,pushProfileCacheValidityPeriodMs:e.pushProfileCacheValidityPeriodMs,updateInstanceTtlWindowDays:e.updateInstanceTtlWindowDays,iceTransportPolicy:e.iceTransportPolicy,rtcProfile:(0,jr.RtcProfileToJSON)(e.rtcProfile),rtcConfig:(0,jr.RtcConfigToJSON)(e.rtcConfig),pushConfig:(0,jr.PushConfigToJSON)(e.pushConfig)}}});var $g=p(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.ConnectionInfoFromJSON=zA;Ja.ConnectionInfoFromJSONTyped=Yg;Ja.ConnectionInfoToJSON=GA;var wu=G();function zA(e){return Yg(e,!1)}function Yg(e,t){return e==null?e:{localIceCandidate:(0,wu.IceCandidateFromJSON)(e.localIceCandidate),remoteIceCandidate:(0,wu.IceCandidateFromJSON)(e.remoteIceCandidate),timestamp:new Date(e.timestamp)}}function GA(e){if(e!==void 0)return e===null?null:{localIceCandidate:(0,wu.IceCandidateToJSON)(e.localIceCandidate),remoteIceCandidate:(0,wu.IceCandidateToJSON)(e.remoteIceCandidate),timestamp:e.timestamp.toISOString()}}});var t_=p(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.ConnectionInfoV2ProtocolEnum=void 0;Xn.ConnectionInfoV2FromJSON=ZA;Xn.ConnectionInfoV2FromJSONTyped=e_;Xn.ConnectionInfoV2ToJSON=QA;var Ou=Y(),jg=G(),Xg;(function(e){e.Udp="udp",e.Tcp="tcp"})(Xg||(Xn.ConnectionInfoV2ProtocolEnum=Xg={}));function ZA(e){return e_(e,!1)}function e_(e,t){return e==null?e:{type:e.type,protocol:(0,Ou.exists)(e,"protocol")?e.protocol:void 0,ipProtocolVersion:(0,Ou.exists)(e,"ipProtocolVersion")?(0,jg.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,host:(0,Ou.exists)(e,"host")?e.host:void 0,port:(0,Ou.exists)(e,"port")?e.port:void 0,timestamp:new Date(e.timestamp)}}function QA(e){if(e!==void 0)return e===null?null:{type:e.type,protocol:e.protocol,ipProtocolVersion:(0,jg.IpProtocolVersionToJSON)(e.ipProtocolVersion),host:e.host,port:e.port,timestamp:e.timestamp.toISOString()}}});var i_=p(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});La.CreateInstanceRequestFromJSON=$A;La.CreateInstanceRequestFromJSONTyped=r_;La.CreateInstanceRequestToJSON=XA;var YA=Y(),n_=G();function $A(e){return r_(e,!1)}function r_(e,t){return e==null?e:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,n_.InstanceVersionDataFromJSON)(e.version),expireAt:(0,YA.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function XA(e){if(e!==void 0)return e===null?null:{userId:e.userId,deviceId:e.deviceId,capabilities:e.capabilities,version:(0,n_.InstanceVersionDataToJSON)(e.version),expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var o_=p(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.CreateInstanceResponseFromJSON=jA;Ua.CreateInstanceResponseFromJSONTyped=a_;Ua.CreateInstanceResponseToJSON=ew;var Du=G();function jA(e){return a_(e,!1)}function a_(e,t){return e==null?e:{instance:(0,Du.InstanceFromJSON)(e.instance),config:(0,Du.ConfigFromJSON)(e.config)}}function ew(e){if(e!==void 0)return e===null?null:{instance:(0,Du.InstanceToJSON)(e.instance),config:(0,Du.ConfigToJSON)(e.config)}}});var d_=p(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.DestinationTypeEnum=void 0;jn.DestinationFromJSON=tw;jn.DestinationFromJSONTyped=c_;jn.DestinationToJSON=nw;var u_=G(),s_;(function(e){e.UserId="userId",e.Phonenumber="phonenumber",e.Conference="conference",e.Sip="sip"})(s_||(jn.DestinationTypeEnum=s_={}));function tw(e){return c_(e,!1)}function c_(e,t){return e==null?e:{domain:(0,u_.DomainFromJSON)(e.domain),type:e.type,identity:e.identity}}function nw(e){if(e!==void 0)return e===null?null:{domain:(0,u_.DomainToJSON)(e.domain),type:e.type,identity:e.identity}}});var h_=p(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.Direction=void 0;er.DirectionFromJSON=rw;er.DirectionFromJSONTyped=f_;er.DirectionToJSON=iw;var l_;(function(e){e.Inbound="inbound",e.Outbound="outbound"})(l_||(er.Direction=l_={}));function rw(e){return f_(e,!1)}function f_(e,t){return e}function iw(e){return e}});var m_=p(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.Domain=void 0;tr.DomainFromJSON=aw;tr.DomainFromJSONTyped=v_;tr.DomainToJSON=ow;var p_;(function(e){e.Mxp="mxp",e.Pstn="pstn",e.Sip="sip",e.Conference="conference"})(p_||(tr.Domain=p_={}));function aw(e){return v_(e,!1)}function v_(e,t){return e}function ow(e){return e}});var __=p(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.ErrorResponseFromJSON=sw;Wa.ErrorResponseFromJSONTyped=g_;Wa.ErrorResponseToJSON=uw;function sw(e){return g_(e,!1)}function g_(e,t){return e==null?e:{error:e.error}}function uw(e){if(e!==void 0)return e===null?null:{error:e.error}}});var E_=p(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.EventResultTypeEnum=void 0;nr.EventResultFromJSON=cw;nr.EventResultFromJSONTyped=C_;nr.EventResultToJSON=dw;var x_=Y(),y_=G(),S_;(function(e){e.Success="success",e.Failure="failure"})(S_||(nr.EventResultTypeEnum=S_={}));function cw(e){return C_(e,!1)}function C_(e,t){return e==null?e:{type:e.type,errorCode:(0,x_.exists)(e,"errorCode")?e.errorCode:void 0,errorDomain:(0,x_.exists)(e,"errorDomain")?(0,y_.ClientErrorDomainFromJSON)(e.errorDomain):void 0}}function dw(e){if(e!==void 0)return e===null?null:{type:e.type,errorCode:e.errorCode,errorDomain:(0,y_.ClientErrorDomainToJSON)(e.errorDomain)}}});var T_=p(rr=>{"use strict";Object.defineProperty(rr,"__esModule",{value:!0});rr.EventType=void 0;rr.EventTypeFromJSON=lw;rr.EventTypeFromJSONTyped=I_;rr.EventTypeToJSON=fw;var b_;(function(e){e.ClientEventType="ClientEventType",e.EventResultType="EventResultType"})(b_||(rr.EventType=b_={}));function lw(e){return I_(e,!1)}function I_(e,t){return e}function fw(e){return e}});var w_=p(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.ExtendedCallReportFromJSON=hw;Ha.ExtendedCallReportFromJSONTyped=A_;Ha.ExtendedCallReportToJSON=pw;var Te=Y(),ee=G();function hw(e){return A_(e,!1)}function A_(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 pw(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 D_=p(Ka=>{"use strict";Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ExtendedCallReportAllOfFromJSON=vw;Ka.ExtendedCallReportAllOfFromJSONTyped=O_;Ka.ExtendedCallReportAllOfToJSON=mw;var Va=Y(),pn=G();function vw(e){return O_(e,!1)}function O_(e,t){return e==null?e:{rtcStatisticsReport:e.rtcStatisticsReport,mxpEventLog:(0,Va.exists)(e,"mxpEventLog")?e.mxpEventLog:void 0,callQuality:(0,Va.exists)(e,"callQuality")?(0,pn.CallQualityFromJSON)(e.callQuality):void 0,audioRouteEventLog:(0,Va.exists)(e,"audioRouteEventLog")?(0,pn.AudioRouteEventLogFromJSON)(e.audioRouteEventLog):void 0,pushProvider:(0,Va.exists)(e,"pushProvider")?(0,pn.PushProviderFromJSON)(e.pushProvider):void 0,clientEvents:(0,Va.exists)(e,"clientEvents")?(0,pn.ClientEventsFromJSON)(e.clientEvents):void 0}}function mw(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 F_=p(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.FcmPushProfileFromJSON=gw;za.FcmPushProfileFromJSONTyped=R_;za.FcmPushProfileToJSON=_w;function gw(e){return R_(e,!1)}function R_(e,t){return e==null?e:{registrationId:e.registrationId,senderId:e.senderId}}function _w(e){if(e!==void 0)return e===null?null:{registrationId:e.registrationId,senderId:e.senderId}}});var N_=p(Ga=>{"use strict";Object.defineProperty(Ga,"__esModule",{value:!0});Ga.IceCandidateFromJSON=xw;Ga.IceCandidateFromJSONTyped=P_;Ga.IceCandidateToJSON=Sw;var ir=Y(),vn=G();function xw(e){return P_(e,!1)}function P_(e,t){return e==null?e:{address:(0,ir.exists)(e,"address")?e.address:void 0,port:(0,ir.exists)(e,"port")?e.port:void 0,ipProtocolVersion:(0,ir.exists)(e,"ipProtocolVersion")?(0,vn.IpProtocolVersionFromJSON)(e.ipProtocolVersion):void 0,type:(0,ir.exists)(e,"type")?(0,vn.IceCandidateTypeFromJSON)(e.type):void 0,transportProtocol:(0,ir.exists)(e,"transportProtocol")?(0,vn.TransportProtocolFromJSON)(e.transportProtocol):void 0,relayProtocol:(0,ir.exists)(e,"relayProtocol")?(0,vn.RelayProtocolFromJSON)(e.relayProtocol):void 0,url:(0,ir.exists)(e,"url")?e.url:void 0}}function Sw(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 q_=p(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.IceCandidateType=void 0;ar.IceCandidateTypeFromJSON=yw;ar.IceCandidateTypeFromJSONTyped=B_;ar.IceCandidateTypeToJSON=Cw;var M_;(function(e){e.Host="host",e.Srflx="srflx",e.Prflx="prflx",e.Relay="relay",e.Local="local",e.Stun="stun"})(M_||(ar.IceCandidateType=M_={}));function yw(e){return B_(e,!1)}function B_(e,t){return e}function Cw(e){return e}});var U_=p(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.IceServerCredentialTypeEnum=void 0;or.IceServerFromJSON=Ew;or.IceServerFromJSONTyped=L_;or.IceServerToJSON=bw;var dl=Y(),J_=G(),k_;(function(e){e.Oauth="oauth",e.Password="password"})(k_||(or.IceServerCredentialTypeEnum=k_={}));function Ew(e){return L_(e,!1)}function L_(e,t){return e==null?e:{urls:e.urls,username:(0,dl.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,dl.exists)(e,"password")?e.password:void 0,oauthCredential:(0,dl.exists)(e,"oauthCredential")?(0,J_.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0,validUntil:new Date(e.validUntil)}}function bw(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,J_.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential),validUntil:e.validUntil.toISOString()}}});var H_=p(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.IceServerAllOfFromJSON=Iw;Za.IceServerAllOfFromJSONTyped=W_;Za.IceServerAllOfToJSON=Tw;function Iw(e){return W_(e,!1)}function W_(e,t){return e==null?e:{validUntil:new Date(e.validUntil)}}function Tw(e){if(e!==void 0)return e===null?null:{validUntil:e.validUntil.toISOString()}}});var z_=p(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.IceServersResponseFromJSON=Aw;Qa.IceServersResponseFromJSONTyped=K_;Qa.IceServersResponseToJSON=ww;var V_=G();function Aw(e){return K_(e,!1)}function K_(e,t){return e==null?e:{iceServers:e.iceServers.map(V_.IceServerFromJSON)}}function ww(e){if(e!==void 0)return e===null?null:{iceServers:e.iceServers.map(V_.IceServerToJSON)}}});var Q_=p(Ya=>{"use strict";Object.defineProperty(Ya,"__esModule",{value:!0});Ya.InstanceFromJSON=Dw;Ya.InstanceFromJSONTyped=Z_;Ya.InstanceToJSON=Rw;var Ow=Y(),G_=G();function Dw(e){return Z_(e,!1)}function Z_(e,t){return e==null?e:{id:e.id,secret:e.secret,deviceId:(0,Ow.exists)(e,"deviceId")?e.deviceId:void 0,expireAt:new Date(e.expireAt),capabilities:e.capabilities,version:(0,G_.InstanceVersionDataFromJSON)(e.version)}}function Rw(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,G_.InstanceVersionDataToJSON)(e.version)}}});var j_=p($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.InstanceVersionDataFromJSON=Fw;$a.InstanceVersionDataFromJSONTyped=X_;$a.InstanceVersionDataToJSON=Pw;var Y_=Y(),$_=G();function Fw(e){return X_(e,!1)}function X_(e,t){return e==null?e:{platform:(0,$_.PlatformIdentifierFromJSON)(e.platform),os:e.os,osName:(0,Y_.exists)(e,"osName")?e.osName:void 0,osVersion:(0,Y_.exists)(e,"osVersion")?e.osVersion:void 0,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}function Pw(e){if(e!==void 0)return e===null?null:{platform:(0,$_.PlatformIdentifierToJSON)(e.platform),os:e.os,osName:e.osName,osVersion:e.osVersion,application:e.application,deviceModelId:e.deviceModelId,deviceModelName:e.deviceModelName}}});var nx=p(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.IpProtocolVersion=void 0;sr.IpProtocolVersionFromJSON=Nw;sr.IpProtocolVersionFromJSONTyped=tx;sr.IpProtocolVersionToJSON=Mw;var ex;(function(e){e.Ipv4="ipv4",e.Ipv6="ipv6",e.Unknown="unknown"})(ex||(sr.IpProtocolVersion=ex={}));function Nw(e){return tx(e,!1)}function tx(e,t){return e}function Mw(e){return e}});var ax=p(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.MediaStreamType=void 0;ur.MediaStreamTypeFromJSON=Bw;ur.MediaStreamTypeFromJSONTyped=ix;ur.MediaStreamTypeToJSON=qw;var rx;(function(e){e.Audio="audio",e.Video="video"})(rx||(ur.MediaStreamType=rx={}));function Bw(e){return ix(e,!1)}function ix(e,t){return e}function qw(e){return e}});var sx=p(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ModelErrorFromJSON=Jw;Xa.ModelErrorFromJSONTyped=ox;Xa.ModelErrorToJSON=Lw;var kw=Y();function Jw(e){return ox(e,!1)}function ox(e,t){return e==null?e:{code:e.code,message:e.message,reference:(0,kw.exists)(e,"reference")?e.reference:void 0}}function Lw(e){if(e!==void 0)return e===null?null:{code:e.code,message:e.message,reference:e.reference}}});var cx=p(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.MxpPubSubConfigFromJSON=Ww;ja.MxpPubSubConfigFromJSONTyped=ux;ja.MxpPubSubConfigToJSON=Hw;var Uw=Y();function Ww(e){return ux(e,!1)}function ux(e,t){return e==null?e:{hostname:e.hostname,signalSubscribeKey:e.signalSubscribeKey,signalPublishKey:e.signalPublishKey,broadcastSubscribeKey:e.broadcastSubscribeKey,pubnubClientId:(0,Uw.exists)(e,"pubnubClientId")?e.pubnubClientId:void 0}}function Hw(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 lx=p(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.OpaquePushProfileFromJSON=Vw;eo.OpaquePushProfileFromJSONTyped=dx;eo.OpaquePushProfileToJSON=Kw;function Vw(e){return dx(e,!1)}function dx(e,t){return e==null?e:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}function Kw(e){if(e!==void 0)return e===null?null:{externalId:e.externalId,managed:e.managed,contentType:e.contentType,data:e.data}}});var px=p(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.OriginFromJSON=Gw;to.OriginFromJSONTyped=hx;to.OriginToJSON=Zw;var zw=Y(),fx=G();function Gw(e){return hx(e,!1)}function hx(e,t){return e==null?e:{domain:(0,zw.exists)(e,"domain")?(0,fx.DomainFromJSON)(e.domain):void 0,identity:e.identity}}function Zw(e){if(e!==void 0)return e===null?null:{domain:(0,fx.DomainToJSON)(e.domain),identity:e.identity}}});var gx=p(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.PlatformIdentifier=void 0;cr.PlatformIdentifierFromJSON=Qw;cr.PlatformIdentifierFromJSONTyped=mx;cr.PlatformIdentifierToJSON=Yw;var vx;(function(e){e.Ios="ios",e.Android="android",e.Js="js",e.Test="test"})(vx||(cr.PlatformIdentifier=vx={}));function Qw(e){return mx(e,!1)}function mx(e,t){return e}function Yw(e){return e}});var Sx=p(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.PrimaryMediaTransportType=void 0;dr.PrimaryMediaTransportTypeFromJSON=$w;dr.PrimaryMediaTransportTypeFromJSONTyped=xx;dr.PrimaryMediaTransportTypeToJSON=Xw;var _x;(function(e){e.Proxy="proxy",e.P2p="p2p"})(_x||(dr.PrimaryMediaTransportType=_x={}));function $w(e){return xx(e,!1)}function xx(e,t){return e}function Xw(e){return e}});var Ex=p(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.PushConfigFromJSON=jw;no.PushConfigFromJSONTyped=Cx;no.PushConfigToJSON=eO;var yx=Y();function jw(e){return Cx(e,!1)}function Cx(e,t){return e==null?e:{fcmSenderId:(0,yx.exists)(e,"fcmSenderId")?e.fcmSenderId:void 0,w3cApplicationServerKey:(0,yx.exists)(e,"w3cApplicationServerKey")?e.w3cApplicationServerKey:void 0}}function eO(e){if(e!==void 0)return e===null?null:{fcmSenderId:e.fcmSenderId,w3cApplicationServerKey:e.w3cApplicationServerKey}}});var Tx=p(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.PushNotificationFromJSON=tO;ro.PushNotificationFromJSONTyped=Ix;ro.PushNotificationToJSON=nO;var bx=G();function tO(e){return Ix(e,!1)}function Ix(e,t){return e==null?e:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(bx.PushNotificationDestinationFromJSON)}}function nO(e){if(e!==void 0)return e===null?null:{collapseId:e.collapseId,templateId:e.templateId,templateParameters:e.templateParameters,to:e.to.map(bx.PushNotificationDestinationToJSON)}}});var wx=p(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.PushNotificationDestinationFromJSON=rO;io.PushNotificationDestinationFromJSONTyped=Ax;io.PushNotificationDestinationToJSON=iO;function rO(e){return Ax(e,!1)}function Ax(e,t){return e==null?e:{userId:e.userId,instanceId:e.instanceId}}function iO(e){if(e!==void 0)return e===null?null:{userId:e.userId,instanceId:e.instanceId}}});var Dx=p(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.PushProfileFromJSON=aO;ao.PushProfileFromJSONTyped=Ox;ao.PushProfileToJSON=oO;var ei=Y(),Ct=G();function aO(e){return Ox(e,!1)}function Ox(e,t){return e==null?e:{maxPayloadSize:(0,ei.exists)(e,"maxPayloadSize")?e.maxPayloadSize:void 0,apn:(0,ei.exists)(e,"apn")?e.apn.map(Ct.ApnPushProfileFromJSON):void 0,fcm:(0,ei.exists)(e,"fcm")?(0,Ct.FcmPushProfileFromJSON)(e.fcm):void 0,opaque:(0,ei.exists)(e,"opaque")?(0,Ct.OpaquePushProfileFromJSON)(e.opaque):void 0,upa:(0,ei.exists)(e,"upa")?(0,Ct.UpaPushProfileFromJSON)(e.upa):void 0,w3c:(0,ei.exists)(e,"w3c")?(0,Ct.W3CPushProfileFromJSON)(e.w3c):void 0}}function oO(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 Px=p(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.PushProvider=void 0;lr.PushProviderFromJSON=sO;lr.PushProviderFromJSONTyped=Fx;lr.PushProviderToJSON=uO;var Rx;(function(e){e.Apns="apns",e.Fcm="fcm",e.HuaweiHms="huawei-hms",e.W3c="w3c"})(Rx||(lr.PushProvider=Rx={}));function sO(e){return Fx(e,!1)}function Fx(e,t){return e}function uO(e){return e}});var Bx=p(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.RelayProtocol=void 0;fr.RelayProtocolFromJSON=cO;fr.RelayProtocolFromJSONTyped=Mx;fr.RelayProtocolToJSON=dO;var Nx;(function(e){e.Udp="udp",e.Tcp="tcp",e.Tls="tls"})(Nx||(fr.RelayProtocol=Nx={}));function cO(e){return Mx(e,!1)}function Mx(e,t){return e}function dO(e){return e}});var Jx=p(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.RemotePeerInstanceFromJSON=lO;oo.RemotePeerInstanceFromJSONTyped=kx;oo.RemotePeerInstanceToJSON=fO;var ll=Y(),qx=G();function lO(e){return kx(e,!1)}function kx(e,t){return e==null?e:{id:(0,ll.exists)(e,"id")?e.id:void 0,capabilities:(0,ll.exists)(e,"capabilities")?e.capabilities:void 0,pushProfile:(0,ll.exists)(e,"pushProfile")?(0,qx.RemotePeerInstancePushProfileFromJSON)(e.pushProfile):void 0}}function fO(e){if(e!==void 0)return e===null?null:{id:e.id,capabilities:e.capabilities,pushProfile:(0,qx.RemotePeerInstancePushProfileToJSON)(e.pushProfile)}}});var Ux=p(so=>{"use strict";Object.defineProperty(so,"__esModule",{value:!0});so.RemotePeerInstancePushProfileFromJSON=pO;so.RemotePeerInstancePushProfileFromJSONTyped=Lx;so.RemotePeerInstancePushProfileToJSON=vO;var hO=Y();function pO(e){return Lx(e,!1)}function Lx(e,t){return e==null?e:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:(0,hO.exists)(e,"legacyPushData")?e.legacyPushData:void 0}}function vO(e){if(e!==void 0)return e===null?null:{maxPayloadSize:e.maxPayloadSize,managed:e.managed,legacyPushData:e.legacyPushData}}});var Vx=p(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.RtcConfigFromJSON=gO;uo.RtcConfigFromJSONTyped=Hx;uo.RtcConfigToJSON=_O;var mO=Y(),Wx=G();function gO(e){return Hx(e,!1)}function Hx(e,t){return e==null?e:{mxpPubSubConfig:(0,Wx.MxpPubSubConfigFromJSON)(e.mxpPubSubConfig),legacyStunUrls:(0,mO.exists)(e,"legacyStunUrls")?e.legacyStunUrls:void 0}}function _O(e){if(e!==void 0)return e===null?null:{mxpPubSubConfig:(0,Wx.MxpPubSubConfigToJSON)(e.mxpPubSubConfig),legacyStunUrls:e.legacyStunUrls}}});var zx=p(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.RtcProfileFromJSON=xO;co.RtcProfileFromJSONTyped=Kx;co.RtcProfileToJSON=SO;function xO(e){return Kx(e,!1)}function Kx(e,t){return e==null?e:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}function SO(e){if(e!==void 0)return e===null?null:{mxpEncryptionKey:e.mxpEncryptionKey,mxpBroadcastChannel:e.mxpBroadcastChannel,mxpSignalChannel:e.mxpSignalChannel}}});var Qx=p(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.SdpSemantics=void 0;hr.SdpSemanticsFromJSON=yO;hr.SdpSemanticsFromJSONTyped=Zx;hr.SdpSemanticsToJSON=CO;var Gx;(function(e){e.PlanB="planB",e.UnifiedPlan="unifiedPlan"})(Gx||(hr.SdpSemantics=Gx={}));function yO(e){return Zx(e,!1)}function Zx(e,t){return e}function CO(e){return e}});var $x=p(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.SemanticVersionFromJSON=EO;lo.SemanticVersionFromJSONTyped=Yx;lo.SemanticVersionToJSON=bO;function EO(e){return Yx(e,!1)}function Yx(e,t){return e==null?e:{major:e.major,minor:e.minor}}function bO(e){if(e!==void 0)return e===null?null:{major:e.major,minor:e.minor}}});var e1=p(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.TransportProtocol=void 0;pr.TransportProtocolFromJSON=IO;pr.TransportProtocolFromJSONTyped=jx;pr.TransportProtocolToJSON=TO;var Xx;(function(e){e.Tcp="tcp",e.Udp="udp"})(Xx||(pr.TransportProtocol=Xx={}));function IO(e){return jx(e,!1)}function jx(e,t){return e}function TO(e){return e}});var n1=p(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.UpaPushProfileFromJSON=AO;fo.UpaPushProfileFromJSONTyped=t1;fo.UpaPushProfileToJSON=wO;function AO(e){return t1(e,!1)}function t1(e,t){return e==null?e:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}function wO(e){if(e!==void 0)return e===null?null:{vendorId:e.vendorId,deviceToken:e.deviceToken,vendorData:e.vendorData}}});var a1=p(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.UpdateInstanceRequestFromJSON=OO;ho.UpdateInstanceRequestFromJSONTyped=i1;ho.UpdateInstanceRequestToJSON=DO;var r1=G();function OO(e){return i1(e,!1)}function i1(e,t){return e==null?e:{capabilities:e.capabilities,version:(0,r1.InstanceVersionDataFromJSON)(e.version)}}function DO(e){if(e!==void 0)return e===null?null:{capabilities:e.capabilities,version:(0,r1.InstanceVersionDataToJSON)(e.version)}}});var s1=p(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.UpdateInstanceTtlRequestFromJSON=FO;po.UpdateInstanceTtlRequestFromJSONTyped=o1;po.UpdateInstanceTtlRequestToJSON=PO;var RO=Y();function FO(e){return o1(e,!1)}function o1(e,t){return e==null?e:{expireAt:(0,RO.exists)(e,"expireAt")?new Date(e.expireAt):void 0}}function PO(e){if(e!==void 0)return e===null?null:{expireAt:e.expireAt===void 0?void 0:e.expireAt.toISOString()}}});var c1=p(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.UpdateInstanceTtlResponseFromJSON=NO;vo.UpdateInstanceTtlResponseFromJSONTyped=u1;vo.UpdateInstanceTtlResponseToJSON=MO;function NO(e){return u1(e,!1)}function u1(e,t){return e==null?e:{instanceId:e.instanceId,expireAt:new Date(e.expireAt)}}function MO(e){if(e!==void 0)return e===null?null:{instanceId:e.instanceId,expireAt:e.expireAt.toISOString()}}});var l1=p(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.UserDebugInfoResponseFromJSON=BO;mo.UserDebugInfoResponseFromJSONTyped=d1;mo.UserDebugInfoResponseToJSON=qO;function BO(e){return d1(e,!1)}function d1(e,t){return e==null?e:{createdAt:new Date(e.createdAt),blocked:e.blocked,instanceCount:e.instanceCount,pushProfileCount:e.pushProfileCount,instanceIds:e.instanceIds}}function qO(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 p1=p(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.W3CPushProfileFromJSON=kO;go.W3CPushProfileFromJSONTyped=h1;go.W3CPushProfileToJSON=JO;var f1=G();function kO(e){return h1(e,!1)}function h1(e,t){return e==null?e:{endpoint:e.endpoint,keys:(0,f1.W3CPushProfileKeysFromJSON)(e.keys),expirationTime:new Date(e.expirationTime),applicationServerKey:e.applicationServerKey}}function JO(e){if(e!==void 0)return e===null?null:{endpoint:e.endpoint,keys:(0,f1.W3CPushProfileKeysToJSON)(e.keys),expirationTime:e.expirationTime.toISOString(),applicationServerKey:e.applicationServerKey}}});var m1=p(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.W3CPushProfileKeysFromJSON=LO;_o.W3CPushProfileKeysFromJSONTyped=v1;_o.W3CPushProfileKeysToJSON=UO;function LO(e){return v1(e,!1)}function v1(e,t){return e==null?e:{p256dh:e.p256dh,auth:e.auth}}function UO(e){if(e!==void 0)return e===null?null:{p256dh:e.p256dh,auth:e.auth}}});var _1=p(xo=>{"use strict";Object.defineProperty(xo,"__esModule",{value:!0});xo.WarningEventFromJSON=HO;xo.WarningEventFromJSONTyped=g1;xo.WarningEventToJSON=VO;var WO=Y(),ti=G();function HO(e){return g1(e,!1)}function g1(e,t){return e==null?e:{name:(0,ti.WarningEventNameFromJSON)(e.name),time:new Date(e.time),type:(0,ti.WarningEventTypeFromJSON)(e.type),mediaStreamType:(0,WO.exists)(e,"mediaStreamType")?(0,ti.MediaStreamTypeFromJSON)(e.mediaStreamType):void 0}}function VO(e){if(e!==void 0)return e===null?null:{name:(0,ti.WarningEventNameToJSON)(e.name),time:e.time.toISOString(),type:(0,ti.WarningEventTypeToJSON)(e.type),mediaStreamType:(0,ti.MediaStreamTypeToJSON)(e.mediaStreamType)}}});var y1=p(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.WarningEventName=void 0;vr.WarningEventNameFromJSON=KO;vr.WarningEventNameFromJSONTyped=S1;vr.WarningEventNameToJSON=zO;var x1;(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"})(x1||(vr.WarningEventName=x1={}));function KO(e){return S1(e,!1)}function S1(e,t){return e}function zO(e){return e}});var b1=p(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.WarningEventType=void 0;mr.WarningEventTypeFromJSON=GO;mr.WarningEventTypeFromJSONTyped=E1;mr.WarningEventTypeToJSON=ZO;var C1;(function(e){e.Trigger="trigger",e.Recover="recover"})(C1||(mr.WarningEventType=C1={}));function GO(e){return E1(e,!1)}function E1(e,t){return e}function ZO(e){return e}});var w1=p(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.WebrtcRTCIceServerCredentialTypeEnum=void 0;gr.WebrtcRTCIceServerFromJSON=QO;gr.WebrtcRTCIceServerFromJSONTyped=A1;gr.WebrtcRTCIceServerToJSON=YO;var fl=Y(),T1=G(),I1;(function(e){e.Oauth="oauth",e.Password="password"})(I1||(gr.WebrtcRTCIceServerCredentialTypeEnum=I1={}));function QO(e){return A1(e,!1)}function A1(e,t){return e==null?e:{urls:e.urls,username:(0,fl.exists)(e,"username")?e.username:void 0,credentialType:e.credentialType,password:(0,fl.exists)(e,"password")?e.password:void 0,oauthCredential:(0,fl.exists)(e,"oauthCredential")?(0,T1.WebrtcRTCOAuthCredentialFromJSON)(e.oauthCredential):void 0}}function YO(e){if(e!==void 0)return e===null?null:{urls:e.urls,username:e.username,credentialType:e.credentialType,password:e.password,oauthCredential:(0,T1.WebrtcRTCOAuthCredentialToJSON)(e.oauthCredential)}}});var D1=p(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.WebrtcRTCOAuthCredentialFromJSON=$O;So.WebrtcRTCOAuthCredentialFromJSONTyped=O1;So.WebrtcRTCOAuthCredentialToJSON=XO;function $O(e){return O1(e,!1)}function O1(e,t){return e==null?e:{macKey:e.macKey,accessToken:e.accessToken}}function XO(e){if(e!==void 0)return e===null?null:{macKey:e.macKey,accessToken:e.accessToken}}});var F1=p(yo=>{"use strict";Object.defineProperty(yo,"__esModule",{value:!0});yo.WebrtcRTCSessionDescriptionFromJSON=jO;yo.WebrtcRTCSessionDescriptionFromJSONTyped=R1;yo.WebrtcRTCSessionDescriptionToJSON=e2;function jO(e){return R1(e,!1)}function R1(e,t){return e==null?e:{type:e.type,sdp:e.sdp}}function e2(e){if(e!==void 0)return e===null?null:{type:e.type,sdp:e.sdp}}});var G=p(q=>{"use strict";var t2=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)&&t2(t,e,n)};Object.defineProperty(q,"__esModule",{value:!0});U(pg(),q);U(mg(),q);U(_g(),q);U(Sg(),q);U(Cg(),q);U(Ig(),q);U(Ag(),q);U(Og(),q);U(Fg(),q);U(Mg(),q);U(kg(),q);U(Ug(),q);U(Hg(),q);U(Kg(),q);U(Qg(),q);U($g(),q);U(t_(),q);U(i_(),q);U(o_(),q);U(d_(),q);U(h_(),q);U(m_(),q);U(__(),q);U(E_(),q);U(T_(),q);U(w_(),q);U(D_(),q);U(F_(),q);U(N_(),q);U(q_(),q);U(U_(),q);U(H_(),q);U(z_(),q);U(Q_(),q);U(j_(),q);U(nx(),q);U(ax(),q);U(sx(),q);U(cx(),q);U(lx(),q);U(px(),q);U(gx(),q);U(Sx(),q);U(Ex(),q);U(Tx(),q);U(wx(),q);U(Dx(),q);U(Px(),q);U(Bx(),q);U(Jx(),q);U(Ux(),q);U(Vx(),q);U(zx(),q);U(Qx(),q);U($x(),q);U(e1(),q);U(n1(),q);U(a1(),q);U(s1(),q);U(c1(),q);U(l1(),q);U(p1(),q);U(m1(),q);U(_1(),q);U(y1(),q);U(b1(),q);U(w1(),q);U(D1(),q);U(F1(),q)});var M1=p(ni=>{"use strict";var P1=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.CallApi=void 0;var hl=Y(),N1=G(),pl=class extends hl.BaseAPI{initiateCallRaw(t){return P1(this,void 0,void 0,function*(){if(t.callInitiationRequest===null||t.callInitiationRequest===void 0)throw new hl.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,N1.CallInitiationRequestToJSON)(t.callInitiationRequest)});return new hl.JSONApiResponse(i,a=>(0,N1.CallInitiationResponseFromJSON)(a))})}initiateCall(t){return P1(this,void 0,void 0,function*(){return yield(yield this.initiateCallRaw(t)).value()})}};ni.CallApi=pl});var q1=p(ri=>{"use strict";var B1=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.CallReportApi=void 0;var vl=Y(),n2=G(),ml=class extends vl.BaseAPI{createCallReportRaw(t){return B1(this,void 0,void 0,function*(){if(t.callReport===null||t.callReport===void 0)throw new vl.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,n2.CallReportToJSON)(t.callReport)});return new vl.VoidApiResponse(i)})}createCallReport(t){return B1(this,void 0,void 0,function*(){yield this.createCallReportRaw(t)})}};ri.CallReportApi=ml});var J1=p(ii=>{"use strict";var k1=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.ConfigApi=void 0;var Ru=Y(),r2=G(),gl=class extends Ru.BaseAPI{getConfigRaw(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 getConfig.");if(t.instanceId===null||t.instanceId===void 0)throw new Ru.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 Ru.JSONApiResponse(i,a=>(0,r2.ConfigFromJSON)(a))})}getConfig(t){return k1(this,void 0,void 0,function*(){return yield(yield this.getConfigRaw(t)).value()})}};ii.ConfigApi=gl});var U1=p(ai=>{"use strict";var L1=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.DebugApi=void 0;var _l=Y(),i2=G(),xl=class extends _l.BaseAPI{getUserDebugInfoRaw(t){return L1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new _l.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 _l.JSONApiResponse(i,a=>(0,i2.UserDebugInfoResponseFromJSON)(a))})}getUserDebugInfo(t){return L1(this,void 0,void 0,function*(){return yield(yield this.getUserDebugInfoRaw(t)).value()})}};ai.DebugApi=xl});var H1=p(oi=>{"use strict";var W1=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.FeatureFlagsApi=void 0;var Fu=Y(),Sl=class extends Fu.BaseAPI{getFeatureFlagsRaw(t){return W1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Fu.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getFeatureFlags.");if(t.instanceId===null||t.instanceId===void 0)throw new Fu.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 Fu.JSONApiResponse(i)})}getFeatureFlags(t){return W1(this,void 0,void 0,function*(){return yield(yield this.getFeatureFlagsRaw(t)).value()})}};oi.FeatureFlagsApi=Sl});var K1=p(si=>{"use strict";var V1=si&&si.__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(si,"__esModule",{value:!0});si.IceApi=void 0;var Pu=Y(),a2=G(),yl=class extends Pu.BaseAPI{getIceServersRaw(t){return V1(this,void 0,void 0,function*(){if(t.userId===null||t.userId===void 0)throw new Pu.RequiredError("userId","Required parameter requestParameters.userId was null or undefined when calling getIceServers.");if(t.instanceId===null||t.instanceId===void 0)throw new Pu.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 Pu.JSONApiResponse(i,a=>(0,a2.IceServersResponseFromJSON)(a))})}getIceServers(t){return V1(this,void 0,void 0,function*(){return yield(yield this.getIceServersRaw(t)).value()})}};si.IceApi=yl});var z1=p(di=>{"use strict";var ui=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.InstanceApi=void 0;var Xe=Y(),ci=G(),Cl=class extends Xe.BaseAPI{createInstanceRaw(t){return ui(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,ci.CreateInstanceRequestToJSON)(t.createInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.CreateInstanceResponseFromJSON)(a))})}createInstance(t){return ui(this,void 0,void 0,function*(){return yield(yield this.createInstanceRaw(t)).value()})}updateInstanceRaw(t){return ui(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,ci.UpdateInstanceRequestToJSON)(t.updateInstanceRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.InstanceFromJSON)(a))})}updateInstance(t){return ui(this,void 0,void 0,function*(){return yield(yield this.updateInstanceRaw(t)).value()})}updateInstanceTtlRaw(t){return ui(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,ci.UpdateInstanceTtlRequestToJSON)(t.updateInstanceTtlRequest)});return new Xe.JSONApiResponse(i,a=>(0,ci.UpdateInstanceTtlResponseFromJSON)(a))})}updateInstanceTtl(t){return ui(this,void 0,void 0,function*(){return yield(yield this.updateInstanceTtlRaw(t)).value()})}};di.InstanceApi=Cl});var G1=p(li=>{"use strict";var je=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.PushApi=void 0;var Ee=Y(),Nu=G(),El=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,Nu.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,Nu.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(Nu.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,Nu.PushProfileToJSON)(t.pushProfile)});return new Ee.VoidApiResponse(i)})}updatePushProfile(t){return je(this,void 0,void 0,function*(){yield this.updatePushProfileRaw(t)})}};li.PushApi=El});var bl=p(Be=>{"use strict";var o2=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)&&o2(t,e,n)};Object.defineProperty(Be,"__esModule",{value:!0});mn(M1(),Be);mn(q1(),Be);mn(J1(),Be);mn(U1(),Be);mn(H1(),Be);mn(K1(),Be);mn(z1(),Be);mn(G1(),Be)});var qe=p(Vt=>{"use strict";var s2=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]})),Il=Vt&&Vt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&s2(t,e,n)};Object.defineProperty(Vt,"__esModule",{value:!0});Il(Y(),Vt);Il(bl(),Vt);Il(G(),Vt)});var Z1=p(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.Codec=void 0;var De=Zn(),u2=qe(),Mu=ht(),Tl=ft(),Al=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 Tl.Body(Tl.Body.clientType,JSON.stringify(n))}static decodeClient(t){if(t.type!==Tl.Body.clientType)throw new Mu.MXPError(Mu.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:u2.Domain.Mxp}}catch{throw new Mu.MXPError(Mu.MXPError.Codes.BODY_PARSE_FAIL)}}};Bu.Codec=Al});var ht=p(Ve=>{"use strict";var c2=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]})),_r=Ve&&Ve.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&c2(t,e,n)};Object.defineProperty(Ve,"__esModule",{value:!0});_r(Ds(),Ve);_r(Z0(),Ve);_r(ug(),Ve);_r(X0(),Ve);_r(cg(),Ve);_r(dg(),Ve);_r(Z1(),Ve)});var Q1=p(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.JsepMessage=void 0;var d2=ht(),wl=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==d2.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"}};qu.JsepMessage=wl});var Co=p(gn=>{"use strict";var l2=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]})),Y1=gn&&gn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&l2(t,e,n)};Object.defineProperty(gn,"__esModule",{value:!0});Y1(Vv(),gn);Y1(Q1(),gn)});var Ol=p(ku=>{"use strict";Object.defineProperty(ku,"__esModule",{value:!0});ku.markPipelineOwned=f2;ku.isPipelineOwned=h2;var $1=new WeakSet;function f2(e){$1.add(e)}function h2(e){return $1.has(e)}});var X1=p(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.WebRTCFactory=void 0;var Dl=class{static createPeerConnection(t){return new RTCPeerConnection(t)}};Ju.WebRTCFactory=Dl});var Ae=p(K=>{"use strict";var p2=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=Rl;K.constant=Eo;K.flip=y2;K.flow=j1;K.tuple=C2;K.increment=E2;K.decrement=b2;K.absurd=eS;K.tupled=I2;K.untupled=T2;K.pipe=A2;K.not=O2;var v2=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=v2;var m2=function(e){return function(){return{concat:function(t,n){return function(r){return e.concat(t(r),n(r))}}}}};K.getSemigroup=m2;var g2=function(e){var t=(0,K.getSemigroup)(e);return function(){return{concat:t().concat,empty:function(){return e.empty}}}};K.getMonoid=g2;var _2=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=_2;var x2=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=x2;var S2=function(e){return function(t){return t(e)}};K.apply=S2;function Rl(e){return e}K.unsafeCoerce=Rl;function Eo(e){return function(){return e}}K.constTrue=Eo(!0);K.constFalse=Eo(!1);K.constNull=Eo(null);K.constUndefined=Eo(void 0);K.constVoid=K.constUndefined;function y2(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 j1(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 C2(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e}function E2(e){return e+1}function b2(e){return e-1}function eS(e){throw new Error("Called `absurd` function which should be uncallable")}function I2(e){return function(t){return e.apply(void 0,t)}}function T2(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(t)}}function A2(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=eS;var w2=function(e,t){return t};K.SK=w2;function O2(e){return function(t){return!e(t)}}var D2=function(){return{concat:function(e,t){return j1(e,t)},empty:Rl}};K.getEndomorphismMonoid=D2;var R2=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,p2([i],r,!1))}}};K.dual=R2});var xr=p(W=>{"use strict";var F2=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 fi=Ae(),P2=function(e){return e._tag==="None"};W.isNone=P2;var N2=function(e){return e._tag==="Some"};W.isSome=N2;W.none={_tag:"None"};var M2=function(e){return{_tag:"Some",value:e}};W.some=M2;var B2=function(e){return e._tag==="Left"};W.isLeft=B2;var q2=function(e){return e._tag==="Right"};W.isRight=q2;var k2=function(e){return{_tag:"Left",left:e}};W.left=k2;var J2=function(e){return{_tag:"Right",right:e}};W.right=J2;var L2=function(e){return[e]};W.singleton=L2;var U2=function(e){return e.length>0};W.isNonEmpty=U2;var W2=function(e){return e[0]};W.head=W2;var H2=function(e){return e.slice(1)};W.tail=H2;W.emptyReadonlyArray=[];W.emptyRecord={};W.has=Object.prototype.hasOwnProperty;var V2=function(e){return F2([e[0]],e.slice(1),!0)};W.fromReadonlyNonEmptyArray=V2;var K2=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=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((0,W.isNone)(a)?(0,W.left)(n.apply(void 0,r)):(0,W.right)(a.value))}}};W.liftOption=z2;var G2=function(e,t){return(0,fi.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftNullable)(e)(r,i))})};W.flatMapNullable=G2;var Z2=function(e,t){return(0,fi.dual)(3,function(n,r,i){return t.flatMap(n,(0,W.liftOption)(e)(r,i))})};W.flatMapOption=Z2;var Q2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromEither(r(i))})})};W.flatMapEither=Q2;var Y2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromIO(r(i))})})};W.flatMapIO=Y2;var $2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromTask(r(i))})})};W.flatMapTask=$2;var X2=function(e,t){return(0,fi.dual)(2,function(n,r){return t.flatMap(n,function(i){return e.fromReader(r(i))})})};W.flatMapReader=X2});var Lu=p(Re=>{"use strict";var j2=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]})),eD=Re&&Re.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),tD=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)&&j2(t,e,n);return eD(t,e),t};Object.defineProperty(Re,"__esModule",{value:!0});Re.ap=iD;Re.apFirst=aD;Re.apSecond=oD;Re.apS=sD;Re.getApplySemigroup=uD;Re.sequenceT=dD;Re.sequenceS=fD;var nD=Ae(),rD=tD(xr());function iD(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 aD(e){return function(t){return function(n){return e.ap(e.map(n,function(r){return function(){return r}}),t)}}}function oD(e){return function(t){return function(n){return e.ap(e.map(n,function(){return function(r){return r}}),t)}}}function sD(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 uD(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 Pl(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):Pl(e,t-1,i)}}var Fl={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 cD(e){return rD.has.call(Fl,e)||(Fl[e]=Pl(nD.tuple,e-1,[])),Fl[e]}function dD(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=t.length,i=cD(r),a=e.map(t[0],i),s=1;s<r;s++)a=e.ap(a,t[s]);return a}}function lD(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 Pl(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 fD(e){return function(t){for(var n=Object.keys(t),r=n.length,i=lD(n),a=e.map(t[n[0]],i),s=1;s<r;s++)a=e.ap(a,t[n[s]]);return a}}});var bo=p(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.map=tS;Kt.flap=pD;Kt.bindTo=vD;Kt.let=mD;Kt.getFunctorComposition=gD;Kt.as=nS;Kt.asUnit=_D;var hD=Ae();function tS(e,t){return function(n){return function(r){return e.map(r,function(i){return t.map(i,n)})}}}function pD(e){return function(t){return function(n){return e.map(n,function(r){return r(t)})}}}function vD(e){return function(t){return function(n){return e.map(n,function(r){var i;return i={},i[t]=r,i})}}}function mD(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 gD(e,t){var n=tS(e,t);return{map:function(r,i){return(0,hD.pipe)(r,n(i))}}}function nS(e){return function(t,n){return e.map(t,function(){return n})}}function _D(e){var t=nS(e);return function(n){return t(n,void 0)}}});var Nl=p(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.getApplicativeMonoid=yD;Uu.getApplicativeComposition=CD;var rS=Lu(),xD=Ae(),SD=bo();function yD(e){var t=(0,rS.getApplySemigroup)(e);return function(n){return{concat:t(n).concat,empty:e.of(n.empty)}}}function CD(e,t){var n=(0,SD.getFunctorComposition)(e,t).map,r=(0,rS.ap)(e,t);return{map:n,of:function(i){return e.of(t.of(i))},ap:function(i,a){return(0,xD.pipe)(i,r(a))}}}});var Wu=p(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.chainFirst=ED;Io.tap=iS;Io.bind=bD;function ED(e){var t=iS(e);return function(n){return function(r){return t(r,n)}}}function iS(e){return function(t,n){return e.chain(t,function(r){return e.map(n(r),function(){return r})})}}function bD(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 aS=p(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.tailRec=void 0;var ID=function(e,t){for(var n=t(e);n._tag==="Left";)n=t(n.left);return n.right};Hu.tailRec=ID});var Bl=p(be=>{"use strict";var TD=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]})),AD=be&&be.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),wD=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)&&TD(t,e,n);return AD(t,e),t};Object.defineProperty(be,"__esModule",{value:!0});be.fromOption=sS;be.fromPredicate=DD;be.fromOptionK=uS;be.chainOptionK=RD;be.fromEitherK=Ml;be.chainEitherK=FD;be.chainFirstEitherK=PD;be.filterOrElse=ND;be.tapEither=cS;var OD=Wu(),oS=Ae(),Sr=wD(xr());function sS(e){return function(t){return function(n){return e.fromEither(Sr.isNone(n)?Sr.left(t()):Sr.right(n.value))}}}function DD(e){return function(t,n){return function(r){return e.fromEither(t(r)?Sr.right(r):Sr.left(n(r)))}}}function uS(e){var t=sS(e);return function(n){var r=t(n);return function(i){return(0,oS.flow)(i,r)}}}function RD(e,t){var n=uS(e);return function(r){var i=n(r);return function(a){return function(s){return t.chain(s,i(a))}}}}function Ml(e){return function(t){return(0,oS.flow)(t,e.fromEither)}}function FD(e,t){var n=Ml(e);return function(r){return function(i){return t.chain(i,n(r))}}}function PD(e,t){var n=cS(e,t);return function(r){return function(i){return n(i,r)}}}function ND(e,t){return function(n,r){return function(i){return t.chain(i,function(a){return e.fromEither(n(a)?Sr.right(a):Sr.left(r(a)))})}}}function cS(e,t){var n=Ml(e),r=(0,OD.tap)(t);return function(i,a){return r(i,n(a))}}});var kl=p($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.right=$.left=$.flap=$.Functor=$.Bifunctor=$.URI=$.bimap=$.mapLeft=$.map=$.separated=void 0;var ql=Ae(),MD=bo(),BD=function(e,t){return{left:e,right:t}};$.separated=BD;var qD=function(e,t){return(0,ql.pipe)(e,(0,$.map)(t))},kD=function(e,t){return(0,ql.pipe)(e,(0,$.mapLeft)(t))},JD=function(e,t,n){return(0,ql.pipe)(e,(0,$.bimap)(t,n))},LD=function(e){return function(t){return(0,$.separated)((0,$.left)(t),e((0,$.right)(t)))}};$.map=LD;var UD=function(e){return function(t){return(0,$.separated)(e((0,$.left)(t)),(0,$.right)(t))}};$.mapLeft=UD;var WD=function(e,t){return function(n){return(0,$.separated)(e((0,$.left)(n)),t((0,$.right)(n)))}};$.bimap=WD;$.URI="Separated";$.Bifunctor={URI:$.URI,mapLeft:kD,bimap:JD};$.Functor={URI:$.URI,map:qD};$.flap=(0,MD.flap)($.Functor);var HD=function(e){return e.left};$.left=HD;var VD=function(e){return e.right};$.right=VD});var Jl=p(vt=>{"use strict";var KD=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]})),zD=vt&&vt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),GD=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)&&KD(t,e,n);return zD(t,e),t};Object.defineProperty(vt,"__esModule",{value:!0});vt.wiltDefault=ZD;vt.witherDefault=QD;vt.filterE=YD;var dS=GD(xr());function ZD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.separate)}}}function QD(e,t){return function(n){var r=e.traverse(n);return function(i,a){return n.map(r(i,a),t.compact)}}}function YD(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?dS.some(a):dS.none})})}}}}});var _S=p(l=>{"use strict";var $D=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]})),XD=l&&l.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fS=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)&&$D(t,e,n);return XD(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=w8;l.elem=gS;l.parseJSON=N8;l.getValidation=k8;var hS=Nl(),To=Lu(),pS=fS(Wu()),jD=aS(),Ao=Bl(),ge=Ae(),wo=bo(),et=fS(xr()),zt=kl(),lS=Jl();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))},yr=function(e,t){return(0,ge.pipe)(e,(0,l.ap)(t))},Oo=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduce)(t,n))},Do=function(e){return function(t,n){var r=(0,l.foldMap)(e);return(0,ge.pipe)(t,r(n))}},Ro=function(e,t,n){return(0,ge.pipe)(e,(0,l.reduceRight)(t,n))},Vu=function(e){var t=(0,l.traverse)(e);return function(n,r){return(0,ge.pipe)(n,t(r))}},Ll=function(e,t,n){return(0,ge.pipe)(e,(0,l.bimap)(t,n))},Ul=function(e,t){return(0,ge.pipe)(e,(0,l.mapLeft)(t))},vS=function(e,t){return(0,ge.pipe)(e,(0,l.alt)(t))},Wl=function(e,t){return(0,ge.pipe)(e,(0,l.extend)(t))},Hl=function(e,t){return(0,jD.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 e8=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=e8;var t8=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=t8;var n8=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=n8;var r8=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=r8;var i8=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=i8;var a8=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:Vu,sequence:l.sequence,reduce:Oo,foldMap:Do,reduceRight:Ro,wither:(0,lS.witherDefault)(l.Traversable,n),wilt:(0,lS.wiltDefault)(l.Traversable,n)}};l.getWitherable=a8;var o8=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=o8;var s8=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=s8;var u8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t.right))}};l.map=u8;l.Functor={URI:l.URI,map:we};l.as=(0,ge.dual)(2,(0,wo.as)(l.Functor));l.asUnit=(0,wo.asUnit)(l.Functor);l.of=l.right;l.Pointed={URI:l.URI,of:l.of};var c8=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=c8;l.ap=l.apW;l.Apply={URI:l.URI,map:we,ap:yr};l.Applicative={URI:l.URI,map:we,ap:yr,of:l.of};l.Chain={URI:l.URI,map:we,ap:yr,chain:l.flatMap};l.Monad={URI:l.URI,map:we,ap:yr,of:l.of,chain:l.flatMap};var d8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(e,n.right)}};l.reduce=d8;var l8=function(e){return function(t){return function(n){return(0,l.isLeft)(n)?e.empty:t(n.right)}}};l.foldMap=l8;var f8=function(e,t){return function(n){return(0,l.isLeft)(n)?e:t(n.right,e)}};l.reduceRight=f8;l.Foldable={URI:l.URI,reduce:Oo,foldMap:Do,reduceRight:Ro};var h8=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=h8;var p8=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=p8;l.Traversable={URI:l.URI,map:we,reduce:Oo,foldMap:Do,reduceRight:Ro,traverse:Vu,sequence:l.sequence};var v8=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=v8;var m8=function(e){return function(t){return(0,l.isLeft)(t)?(0,l.left)(e(t.left)):t}};l.mapLeft=m8;l.Bifunctor={URI:l.URI,bimap:Ll,mapLeft:Ul};var g8=function(e){return function(t){return(0,l.isLeft)(t)?e():t}};l.altW=g8;l.alt=l.altW;l.Alt={URI:l.URI,map:we,alt:vS};var _8=function(e){return function(t){return(0,l.isLeft)(t)?t:(0,l.right)(e(t))}};l.extend=_8;l.Extend={URI:l.URI,map:we,extend:Wl};l.ChainRec={URI:l.URI,map:we,ap:yr,chain:l.flatMap,chainRec:Hl};l.throwError=l.left;l.MonadThrow={URI:l.URI,map:we,ap:yr,of:l.of,chain:l.flatMap,throwError:l.throwError};l.FromEither={URI:l.URI,fromEither:ge.identity};l.fromPredicate=(0,Ao.fromPredicate)(l.FromEither);l.fromOption=(0,Ao.fromOption)(l.FromEither);l.isLeft=et.isLeft;l.isRight=et.isRight;var x8=function(e,t){return function(n){return(0,l.isLeft)(n)?e(n.left):t(n.right)}};l.matchW=x8;l.foldW=l.matchW;l.match=l.matchW;l.fold=l.match;var S8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t.right}};l.getOrElseW=S8;l.getOrElse=l.getOrElseW;l.flap=(0,wo.flap)(l.Functor);l.apFirst=(0,To.apFirst)(l.Apply);l.apFirstW=l.apFirst;l.apSecond=(0,To.apSecond)(l.Apply);l.apSecondW=l.apSecond;l.tap=(0,ge.dual)(2,pS.tap(l.Chain));l.flattenW=(0,l.flatMap)(ge.identity);l.flatten=l.flattenW;l.duplicate=(0,l.extend)(ge.identity);l.fromOptionK=(0,Ao.fromOptionK)(l.FromEither);l.chainOptionK=(0,Ao.chainOptionK)(l.FromEither,l.Chain);l.chainOptionKW=l.chainOptionK;var Ku={fromEither:l.FromEither.fromEither};l.liftNullable=et.liftNullable(Ku);l.liftOption=et.liftOption(Ku);var mS={flatMap:l.flatMap};l.flatMapNullable=et.flatMapNullable(Ku,mS);l.flatMapOption=et.flatMapOption(Ku,mS);l.filterOrElse=(0,Ao.filterOrElse)(l.FromEither,l.Chain);l.filterOrElseW=l.filterOrElse;var y8=function(e){return(0,l.isLeft)(e)?(0,l.right)(e.left):(0,l.left)(e.right)};l.swap=y8;var C8=function(e){return function(t){return(0,l.isLeft)(t)?e(t.left):t}};l.orElseW=C8;l.orElse=l.orElseW;var E8=function(e){return function(t){return t==null?(0,l.left)(e):(0,l.right)(t)}};l.fromNullable=E8;var b8=function(e,t){try{return(0,l.right)(e())}catch(n){return(0,l.left)(t(n))}};l.tryCatch=b8;var I8=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=I8;var T8=function(e){var t=(0,l.fromNullable)(e);return function(n){return(0,ge.flow)(n,t)}};l.fromNullableK=T8;var A8=function(e){var t=(0,l.fromNullableK)(e);return function(n){return(0,l.flatMap)(t(n))}};l.chainNullableK=A8;l.toUnion=(0,l.foldW)(ge.identity,ge.identity);function w8(e){try{return e instanceof Error?e:new Error(String(e))}catch{return new Error}}function gS(e){return function(t,n){if(n===void 0){var r=gS(e);return function(i){return r(t,i)}}return(0,l.isLeft)(n)?!1:e.equals(t,n.right)}}var O8=function(e){return function(t){return(0,l.isLeft)(t)?!1:e(t.right)}};l.exists=O8;l.Do=(0,l.of)(et.emptyRecord);l.bindTo=(0,wo.bindTo)(l.Functor);var D8=(0,wo.let)(l.Functor);l.let=D8;l.bind=pS.bind(l.Chain);l.bindW=l.bind;l.apS=(0,To.apS)(l.Apply);l.apSW=l.apS;l.ApT=(0,l.of)(et.emptyReadonlyArray);var R8=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=R8;var F8=function(e){var t=(0,l.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return et.isNonEmpty(n)?t(n):l.ApT}};l.traverseReadonlyArrayWithIndex=F8;l.traverseArrayWithIndex=l.traverseReadonlyArrayWithIndex;var P8=function(e){return(0,l.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};l.traverseArray=P8;l.sequenceArray=(0,l.traverseArray)(ge.identity);l.chainW=l.flatMap;l.chain=l.flatMap;l.chainFirst=l.tap;l.chainFirstW=l.tap;function N8(e,t){return(0,l.tryCatch)(function(){return JSON.parse(e)},t)}var M8=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=M8;l.either={URI:l.URI,map:we,of:l.of,ap:yr,chain:l.flatMap,reduce:Oo,foldMap:Do,reduceRight:Ro,traverse:Vu,sequence:l.sequence,bimap:Ll,mapLeft:Ul,alt:vS,extend:Wl,chainRec:Hl,throwError:l.throwError};l.getApplySemigroup=(0,To.getApplySemigroup)(l.Apply);l.getApplyMonoid=(0,hS.getApplicativeMonoid)(l.Applicative);var B8=function(e,t){return(0,To.getApplySemigroup)((0,l.getApplicativeValidation)(e))(t)};l.getValidationSemigroup=B8;var q8=function(e,t){return(0,hS.getApplicativeMonoid)((0,l.getApplicativeValidation)(e))(t)};l.getValidationMonoid=q8;function k8(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:Ll,mapLeft:Ul,reduce:Oo,foldMap:Do,reduceRight:Ro,extend:Wl,traverse:Vu,sequence:l.sequence,chainRec:Hl,throwError:l.throwError,ap:t,alt:n}}});var _n=p(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.ClientEvent=hi.ClientEventName=void 0;var J8=qe(),xS;(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"})(xS||(hi.ClientEventName=xS={}));var Vl=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(J8.EventType.ClientEventType,t,new Date,n).data}};hi.ClientEvent=Vl});var Fo=p(Fe=>{"use strict";var pi=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 L8=Ol(),U8=X1(),Kl=_S(),W8=Ae(),xn=_n(),SS;(function(e){e.Relay="relay",e.All="all"})(SS||(Fe.IceTransportPolicy=SS={}));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 zl;(function(e){e.Closed="closed"})(zl||(Fe.SignalingState=zl={}));Fe.MAX_WAIT_DISCONNECTED_PC=1e3*60*5;var Gl=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,Kl.right)(u):(0,Kl.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=()=>pi(this,void 0,void 0,function*(){yield this.createOffer()}),this.pc.oniceconnectionstatechange=(0,W8.flow)(this.logIceState,this.getIceConnectionState,this.notifyCurrentIceStateObserver,this.handleInactivateTimerState,(0,Kl.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,L8.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 U8.WebRTCFactory.createPeerConnection(this.rtcConfiguration)}setPendingRemoteDesription(){return pi(this,void 0,void 0,function*(){if(this.pendingRemoteDescription)return this.setRemoteDescription(this.pendingRemoteDescription)})}setLocalDescription(t){return pi(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 pi(this,void 0,void 0,function*(){this.remoteDescription=void 0;let t=yield this.pc.createOffer();yield this.setLocalDescription(this.originalOffer||t)})}createAnswer(){return pi(this,void 0,void 0,function*(){let t=yield this.pc.createAnswer();return yield this.setLocalDescription(t),t})}setRemoteDescription(t){return pi(this,void 0,void 0,function*(){if(t.type=="answer"){if(this.remoteDescription)return;if(!this.localDescription){this.pendingRemoteDescription=t;return}}this.pc.signalingState!==zl.Closed&&(this.remoteDescription=t,yield this.pc.setRemoteDescription(t),this.applyPendingRemoteCandidates(),t.type=="offer"&&(yield this.createAnswer()))})}};Fe.PeerConnection=Gl});var ES=p(vi=>{"use strict";var Sn=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.PeerConnectionClient=void 0;var H8=un(),yS=Co(),V8=Fo(),CS=Fo(),Zl=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 H8.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 yS.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 yS.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?CS.IceTransportPolicy.Relay:CS.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 V8.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}})}};vi.PeerConnectionClient=Zl});var bS=p(mi=>{"use strict";var K8=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.LocalAudioProcessor=void 0;var Ql=class{constructor(){this.owned=new Set}setListener(t){return K8(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()})}};mi.LocalAudioProcessor=Ql});var IS=p(gi=>{"use strict";var z8=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.LocalVideoProcessor=void 0;var G8=Ol(),Z8=1e4,Yl=class{constructor(){this.owned=new Set}setListener(t){return z8(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}Q8();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'))},Z8);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,G8.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)}};gi.LocalVideoProcessor=Yl;function Q8(){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 Xl=p(_i=>{"use strict";var Y8=_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.MediaController=void 0;var $l=class e{static create(t){return Y8(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())}};_i.MediaController=$l});var TS=p(xi=>{"use strict";var $8=xi&&xi.__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(xi,"__esModule",{value:!0});xi.LocalMediaPipeline=void 0;var X8=bS(),j8=IS(),eR=Xl(),jl=class{constructor(){this.audioProcessor=new X8.LocalAudioProcessor,this.videoProcessor=new j8.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 $8(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 eR.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)))}};xi.LocalMediaPipeline=jl});var AS=p(zu=>{"use strict";Object.defineProperty(zu,"__esModule",{value:!0});zu.Base64Helper=void 0;var Cr=Zn(),ef=ue(),tR=Ce(),tf=class{static encode(t){let n;if(typeof t!="string")if(ef.TypeHelper.isPlainObject(t)||ef.TypeHelper.isArray(t))n=JSON.stringify(t);else throw new tR.ArgumentError("String to encode must be a string, a plain object or an array",(0,ef.nameof)(t));else n=t;let r=Cr.enc.Utf8.parse(n),i=Cr.enc.Base64.stringify(r);return this.makeURLSafe(i)}static encodeUnsafe(t){let n=Cr.enc.Utf8.parse(t);return Cr.enc.Base64.stringify(n)}static decode(t){return Cr.enc.Base64.parse(t)}static decodeToString(t){return Cr.enc.Base64.parse(t).toString(Cr.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}};zu.Base64Helper=tf});var OS=p(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.CryptoHelper=void 0;var Gu=Zn(),wS=ue(),nf=class e{static convertUTF8ToByteArray(t){return Gu.enc.Utf8.parse(t)}static SHA256FromByteArray(t){return Gu.SHA256(t)}static HMAC_SHA256(t,n){let r=n;return wS.TypeHelper.isString(n)&&(r=wS.Base64Helper.decode(n)),Gu.HmacSHA256(e.convertUTF8ToByteArray(t),r)}static convertByteArrayToHex(t){return t.toString(Gu.enc.Hex)}};Zu.CryptoHelper=nf});var DS=p(()=>{});var FS=p((Qu,RS)=>{(function(e,t){typeof Qu=="object"&&typeof RS<"u"?t(Qu):(e=typeof globalThis<"u"?globalThis:e||self,t(e.ULID={}))})(Qu,(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=DS();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 PS=p(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.StringHelper=void 0;var nR=Zn(),rR=FS(),rf=class{static random(t=16){return nR.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,rR.ulid)(t)}};Yu.StringHelper=rf});var NS=p($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.EnvHelper=void 0;var af=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}};$u.EnvHelper=af});var MS=p(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.TypeHelper=void 0;var of=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"}};Xu.TypeHelper=of});var BS=p(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.DateHelper=void 0;var sf=class{static formatISO8601BasicDateTime(t){return t.toISOString().replace(/(\.)(\d+)(Z)/,"$1$3").replace(/[-.:]/g,"")}};ju.DateHelper=sf});var qS=p(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.PromiseHelper=void 0;var uf=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))}};ec.PromiseHelper=uf});var kS=p(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.pipeAsync=Et.pipe=Et.isEmpty=Et.nameof=void 0;var iR=e=>e.constructor.name;Et.nameof=iR;var aR=e=>e&&Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype;Et.isEmpty=aR;var oR=(...e)=>t=>e.reduce((n,r)=>r(n),t);Et.pipe=oR;var sR=(...e)=>t=>e.reduce((n,r)=>n.then(r),Promise.resolve(t));Et.pipeAsync=sR});var ue=p(ke=>{"use strict";var uR=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)&&uR(t,e,n)};Object.defineProperty(ke,"__esModule",{value:!0});yn(AS(),ke);yn(OS(),ke);yn(PS(),ke);yn(NS(),ke);yn(MS(),ke);yn(BS(),ke);yn(qS(),ke);yn(kS(),ke)});var Si=p(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.EventFanout=void 0;var cR=ue(),cf=class{constructor(){this.idKey=cR.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]}};tc.EventFanout=cf});var LS=p(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0})});var WS=p(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.CallDirection=void 0;var US;(function(e){e[e.INBOUND=1]="INBOUND",e[e.OUTBOUND=2]="OUTBOUND"})(US||(nc.CallDirection=US={}))});var df=p(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.CallState=void 0;var HS;(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"})(HS||(rc.CallState=HS={}))});var ic=p(Zt=>{"use strict";var dR=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]})),lf=Zt&&Zt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&dR(t,e,n)};Object.defineProperty(Zt,"__esModule",{value:!0});lf(LS(),Zt);lf(WS(),Zt);lf(df(),Zt)});var VS=p(pf=>{"use strict";Object.defineProperty(pf,"__esModule",{value:!0});var ac=ct(),ff=Fo(),lR=Si(),Po=Lt(),fR=ic(),hf=class extends lR.EventFanout{constructor(t){super(),this.call=t,this.iceConnectionState=ff.IceConnectionState.New,this.issuedProgressing=!1,this.issuedEstablished=!1,this.issuedAccepted=!1,this.issuedAnswered=!1,this.listen=(n,r)=>{switch(n.state){case ac.SessionState.Terminated:r.onCallEnded&&r.onCallEnded(this.call);break;case ac.SessionState.Established:r.onCallAnswered&&r.onCallAnswered(this.call);break}}}setCurrentIceConnectionState(t){this.iceConnectionState=t,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination()}setPushNotificationRequestSent(){if(this.call.direction===Po.Direction.Inbound){console.warn("Calling setPushNotificationRequestSent on Inbound call");return}this.issueCallProgressingIfNeeded()}setCallAccepted(){if(this.call.direction===Po.Direction.Outbound){console.warn("Calling setCallAccepted on Outbound call");return}this.issueCallAcceptedIfNeeded()}onEventProcessed(t){switch(super.onEventProcessed(t),t.state){case ac.SessionState.Established:this.issuedAnswered=!0,this.issueCallEstablishedIfNeeded(),this.checkIceFailureTermination();break;case ac.SessionState.Progress:this.issueCallProgressingIfNeeded(),this.issueCallRingingIfNeeded();break}}issueCallProgressingIfNeeded(){this.issuedProgressing||(this.issuedProgressing=!0,this.listeners.forEach(t=>{t.onCallProgressing&&this.call.direction===Po.Direction.Outbound&&t.onCallProgressing(this.call)}))}issueCallRingingIfNeeded(){this.listeners.forEach(t=>{t.onCallRinging&&this.call.direction===Po.Direction.Outbound&&t.onCallRinging(this.call)})}issueCallEstablishedIfNeeded(){this.issuedEstablished||!this.issuedAnswered||this.iceConnectionState!=ff.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===Po.Direction.Inbound&&t.onCallAccepted(this.call)}))}checkIceFailureTermination(){let t=this.call.state===fR.CallState.Ended;this.issuedAnswered&&!this.issuedEstablished&&!t&&this.iceConnectionState===ff.IceConnectionState.Failed&&this.call.terminateDueToIceFailure()}};pf.default=hf});var KS=p(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.TrackEventFanout=void 0;var hR=Si(),vf=class extends hR.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onRemoteTrack&&r.onRemoteTrack(this.call,n)}}};oc.TrackEventFanout=vf});var Ci=p(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.FeatureFlagDefaults=yi.FeatureFlag=void 0;var sc;(function(e){e.IncludeMxpEventLog="CallReport.IncludeMxpEventLog",e.UseTurn="WebRtc.UseTurn"})(sc||(yi.FeatureFlag=sc={}));yi.FeatureFlagDefaults={[sc.IncludeMxpEventLog]:!1,[sc.UseTurn]:!1}});var GS=p(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0})});var mf=p(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.Capability=void 0;var ZS;(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"})(ZS||(uc.Capability=ZS={}))});var cc=p(Cn=>{"use strict";var pR=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]})),QS=Cn&&Cn.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&pR(t,e,n)};Object.defineProperty(Cn,"__esModule",{value:!0});QS(GS(),Cn);QS(mf(),Cn)});var gf=p(tt=>{"use strict";var vR=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 mR=Ci(),gR=cc(),dc;(function(e){e.ValidUntil="validUntil",e.Password="password"})(dc||(dc={}));var _R=(e,t,n)=>()=>vR(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=_R;var xR=e=>t=>{e.toggleCapability(gR.Capability.Turn,t.get(mR.FeatureFlag.UseTurn))};tt.onTurnFeatureFlagChanged=xR;var SR=e=>t=>{e.setIceServers(t)};tt.createIceServerSetter=SR;var yR=e=>e?e.map(t=>{let n={};for(let[r,i]of Object.entries(t))switch(r){case dc.Password:n.credential=i;break;case dc.ValidUntil:n.validUntil=typeof i=="string"?new Date(i):i;break;default:n[r]=i}return n}):[];tt.toRTCIceServer=yR});var lc=p(En=>{"use strict";var CR=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]})),YS=En&&En.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&CR(t,e,n)};Object.defineProperty(En,"__esModule",{value:!0});YS(Fo(),En);YS(gf(),En)});var hc=p(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});fc.CallEndCause=void 0;var $S;(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"})($S||(fc.CallEndCause=$S={}))});var XS=p(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.DefaultCallDetails=void 0;var _f=Lt(),bt=dt(),pc=dn(),bn=hc(),xf=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===_f.Direction.Inbound?this.startedTime:this.rungTime,a=this.direction===_f.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===_f.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 pc.SinchError(pc.ErrorMessage.ICE_FAILED_TO_CONNECT,pc.ErrorCode.CallFailedToConnectIce,pc.ErrorType.Network):this.session.error}calculateDurationMs(t,n){return!t||!n?0:n.getTime()-t.getTime()}};vc.DefaultCallDetails=xf});var jS=p(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.CallQualityWarningEventFanout=void 0;var ER=Si(),Sf=class extends ER.EventFanout{constructor(t){super(),this.call=t,this.listen=(n,r)=>{r.onCallQualityWarningEvent&&r.onCallQualityWarningEvent(this.call,n)}}};mc.CallQualityWarningEventFanout=Sf});var Er=p(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.CallQualityWarningMediaStreamType=void 0;var ey;(function(e){e.Audio="Audio",e.Video="Video"})(ey||(gc.CallQualityWarningMediaStreamType=ey={}))});var Qt=p(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.MediaType=Ei.RtcStatsTypes=void 0;var ty;(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"})(ty||(Ei.RtcStatsTypes=ty={}));var ny;(function(e){e.Audio="audio",e.Video="video"})(ny||(Ei.MediaType=ny={}))});var It=p(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.getStatsWithType=bR;_c.calculateBufferSize=IR;var ry=Ce();function bR(e,t,n){let r=null;return e.forEach(i=>{i.type===t&&i.kind===n&&(r=i)}),r}function IR(e,t){if(e<=0)throw new ry.ArgumentError("timeSpanCoveredMs must be greater than 0","timeSpanCoveredMs");if(t<=0)throw new ry.ArgumentError("statsRequestIntervalMs must be greater than 0","statsRequestIntervalMs");return Math.ceil(e/t+.5)}});var Yt=p(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.CallQualityWarningEventType=void 0;var iy;(function(e){e.Trigger="Trigger",e.Recover="Recover"})(iy||(xc.CallQualityWarningEventType=iy={}))});var ay=p(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.HighRemoteInboundRttWarningEvent=void 0;var yf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highRemoteInboundRtt"}};Sc.HighRemoteInboundRttWarningEvent=yf});var Ef=p(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.BaseDetector=void 0;var TR=Yt(),Cf=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===TR.CallQualityWarningEventType.Trigger,this.fanout.onEvent(t)}};yc.BaseDetector=Cf});var br=p(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.WebRtcStatsDetector=void 0;var AR=Ef(),Cc=class extends AR.BaseDetector{};Ec.WebRtcStatsDetector=Cc;Cc.TIMESTAMP_KEY="timestamp"});var uy=p(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.HighRemoteInboundRttDetector=void 0;var bf=Qt(),wR=It(),oy=Yt(),OR=Er(),sy=ay(),DR=br(),No=class e extends DR.WebRtcStatsDetector{constructor(t,n){super(n),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===OR.CallQualityWarningMediaStreamType.Audio?bf.MediaType.Audio:bf.MediaType.Video,r=(0,wR.getStatsWithType)(t,bf.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 sy.HighRemoteInboundRttWarningEvent(oy.CallQualityWarningEventType.Trigger,this.mediaStream)):a<=e.RTT_THRESHOLD_MS&&this.isInTriggeredState&&this.emitWarning(new sy.HighRemoteInboundRttWarningEvent(oy.CallQualityWarningEventType.Recover,this.mediaStream))}};bc.HighRemoteInboundRttDetector=No;No.RTT_THRESHOLD_MS=300;No.RTT_KEY="roundTripTime"});var Tc=p(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.StatsBuffer=void 0;var RR=Ce(),If=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 RR.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)}}};Ic.StatsBuffer=If});var Tf=p(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.BufferedWarningDetector=void 0;var cy=Yt(),FR=Tc(),PR=br(),Mo=class extends PR.WebRtcStatsDetector{constructor(t,n,r,i){super(t),this.lastSampleTimestampMs=-1,this.buffer=new FR.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(cy.CallQualityWarningEventType.Trigger)):!this.buffer.isAboveThreshold&&this.isInTriggeredState&&this.emitWarning(this.warningEventWithType(cy.CallQualityWarningEventType.Recover)))}};Ac.BufferedWarningDetector=Mo;Mo.DEFAULT_BUFFER_SIZE=4;Mo.DEFAULT_SAMPLES_COUNT_FOR_WARNING=3});var dy=p(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.HighInboundJitterWarningEvent=void 0;var Af=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundJitter"}};wc.HighInboundJitterWarningEvent=Af});var ly=p(Oc=>{"use strict";Object.defineProperty(Oc,"__esModule",{value:!0});Oc.HighInboundJitterDetector=void 0;var NR=Er(),wf=Tf(),MR=dy(),Of=Qt(),BR=It(),qR=br(),Bo=class e extends wf.BufferedWarningDetector{constructor(t,n){super(n,wf.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,wf.BufferedWarningDetector.DEFAULT_SAMPLES_COUNT_FOR_WARNING,e.JITTER_THRESHOLD_MS),this.mediaStream=t}onNewWebRtcStats(t){let n=this.mediaStream===NR.CallQualityWarningMediaStreamType.Audio?Of.MediaType.Audio:Of.MediaType.Video,r=(0,BR.getStatsWithType)(t,Of.RtcStatsTypes.InboundRtp,n),i=r?.[e.JITTER_KEY],a=i!==void 0?i*1e3:void 0;this.onNewMonitoredValue(a,r?.[qR.WebRtcStatsDetector.TIMESTAMP_KEY])}warningEventWithType(t){return new MR.HighInboundJitterWarningEvent(t,this.mediaStream)}};Oc.HighInboundJitterDetector=Bo;Bo.JITTER_KEY="jitter";Bo.JITTER_THRESHOLD_MS=30});var fy=p(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.MissingMediaStreamWarningEvent=void 0;var Df=class{constructor(t){this.type=t,this.name="missingMediaStream"}};Dc.MissingMediaStreamWarningEvent=Df});var vy=p(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.MissingMediaStreamWarningDetector=void 0;var Rc=lc(),hy=Yt(),py=fy(),kR=Ef(),Fc=class e extends kR.BaseDetector{constructor(t){super(t),this.iceState=Rc.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==Rc.IceConnectionState.Connected?0:e.WARNING_EMISSION_DELAY_MS;t===0?this.performStateCheck():this.timeoutId=setTimeout(this.performStateCheck.bind(this),t)}performStateCheck(){this.iceState!==Rc.IceConnectionState.Connected&&!this.isInTriggeredState?this.emitWarning(new py.MissingMediaStreamWarningEvent(hy.CallQualityWarningEventType.Trigger)):this.iceState===Rc.IceConnectionState.Connected&&this.isInTriggeredState&&this.emitWarning(new py.MissingMediaStreamWarningEvent(hy.CallQualityWarningEventType.Recover))}};Pc.MissingMediaStreamWarningDetector=Fc;Fc.WARNING_EMISSION_DELAY_MS=2e3});var my=p(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.HighInboundPacketLossWarningEvent=void 0;var Rf=class{constructor(t,n){this.type=t,this.mediaStreamType=n,this.name="highInboundPacketLoss"}};Nc.HighInboundPacketLossWarningEvent=Rf});var gy=p(Mc=>{"use strict";Object.defineProperty(Mc,"__esModule",{value:!0});Mc.HighInboundPacketLossDetector=void 0;var JR=Er(),Ff=Tf(),Pf=Qt(),LR=br(),UR=It(),WR=my(),bi=class e extends Ff.BufferedWarningDetector{constructor(t,n){super(n,Ff.BufferedWarningDetector.DEFAULT_BUFFER_SIZE,Ff.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===JR.CallQualityWarningMediaStreamType.Audio?Pf.MediaType.Audio:Pf.MediaType.Video,r=(0,UR.getStatsWithType)(t,Pf.RtcStatsTypes.InboundRtp,n),i=r?.[LR.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 WR.HighInboundPacketLossWarningEvent(t,this.mediaStream)}};Mc.HighInboundPacketLossDetector=bi;bi.PACKET_LOSS_KEY="packetsLost";bi.PACKET_RECEIVED_KEY="packetsReceived";bi.FRACTION_LOST_THRESHOLD=.01});var Sy=p(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.ConstantAudioLevelDetector=void 0;var HR=It(),_y=Yt(),VR=Tc(),xy=br(),Ii=class e extends xy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new VR.StatsBuffer((0,HR.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?.[xy.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(_y.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(_y.CallQualityWarningEventType.Recover)))}};Bc.ConstantAudioLevelDetector=Ii;Ii.AUDIO_LEVEL_KEY="audioLevel";Ii.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e4;Ii.AUDIO_LEVEL_MIN_SD_THRESHOLD=.005});var Nf=p(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.CallQualityWarningController=void 0;var qc=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)}};kc.CallQualityWarningController=qc;qc.WEBRTC_FETCH_STATS_INTERVAL_MS=500});var yy=p(Jc=>{"use strict";Object.defineProperty(Jc,"__esModule",{value:!0});Jc.ConstantInboundAudioLevelWarningEvent=void 0;var Mf=class{constructor(t){this.type=t,this.name="constantInboundAudioLevel"}};Jc.ConstantInboundAudioLevelWarningEvent=Mf});var Ey=p(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.ConstantInboundAudioLevelDetectorHandler=void 0;var Cy=Qt(),KR=It(),zR=yy(),Bf=class{getAudioLevelStats(t){return(0,KR.getStatsWithType)(t,Cy.RtcStatsTypes.InboundRtp,Cy.MediaType.Audio)}createWarningEvent(t){return new zR.ConstantInboundAudioLevelWarningEvent(t)}};Lc.ConstantInboundAudioLevelDetectorHandler=Bf});var by=p(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.ConstantOutboundAudioLevelWarningEvent=void 0;var qf=class{constructor(t){this.type=t,this.name="constantOutboundAudioLevel"}};Uc.ConstantOutboundAudioLevelWarningEvent=qf});var Ty=p(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ConstantOutboundAudioLevelDetectorHandler=void 0;var Iy=Qt(),GR=It(),ZR=by(),kf=class{getAudioLevelStats(t){return(0,GR.getStatsWithType)(t,Iy.RtcStatsTypes.MediaSource,Iy.MediaType.Audio)}createWarningEvent(t){return new ZR.ConstantOutboundAudioLevelWarningEvent(t)}};Wc.ConstantOutboundAudioLevelDetectorHandler=kf});var Oy=p(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.ZeroAudioLevelDetector=void 0;var QR=It(),Ay=Yt(),YR=Tc(),wy=br(),qo=class e extends wy.WebRtcStatsDetector{constructor(t,n,r){super(r),this.handler=n,this.lastStatTimestamp=-1,this.statsBuffer=new YR.StatsBuffer((0,QR.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?.[wy.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(Ay.CallQualityWarningEventType.Trigger)):this.isInTriggeredState&&this.emitWarning(this.handler.createWarningEvent(Ay.CallQualityWarningEventType.Recover)))}};Hc.ZeroAudioLevelDetector=qo;qo.AUDIO_LEVEL_KEY="audioLevel";qo.AUDIO_STATS_COVERED_TIME_SPAN_MS=2e3});var Dy=p(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ZeroInboundAudioLevelWarningEvent=void 0;var Jf=class{constructor(t){this.type=t,this.name="zeroInboundAudioLevel"}};Vc.ZeroInboundAudioLevelWarningEvent=Jf});var Fy=p(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.ZeroInboundAudioLevelDetectorHandler=void 0;var Ry=Qt(),$R=It(),XR=Dy(),Lf=class{getAudioLevelStats(t){return(0,$R.getStatsWithType)(t,Ry.RtcStatsTypes.InboundRtp,Ry.MediaType.Audio)}createWarningEvent(t){return new XR.ZeroInboundAudioLevelWarningEvent(t)}};Kc.ZeroInboundAudioLevelDetectorHandler=Lf});var Py=p(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.ZeroOutboundAudioLevelWarningEvent=void 0;var Uf=class{constructor(t){this.type=t,this.name="zeroOutboundAudioLevel"}};zc.ZeroOutboundAudioLevelWarningEvent=Uf});var My=p(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.ZeroOutboundAudioLevelDetectorHandler=void 0;var Ny=Qt(),jR=It(),eF=Py(),Wf=class{getAudioLevelStats(t){return(0,jR.getStatsWithType)(t,Ny.RtcStatsTypes.MediaSource,Ny.MediaType.Audio)}createWarningEvent(t){return new eF.ZeroOutboundAudioLevelWarningEvent(t)}};Gc.ZeroOutboundAudioLevelDetectorHandler=Wf});var Uy=p(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.CallQualityDetectorsFactory=void 0;var Ti=Er(),By=uy(),qy=ly(),tF=vy(),ky=gy(),Jy=Sy(),Zc=Nf(),nF=Ey(),rF=Ty(),Ly=Oy(),iF=Fy(),aF=My(),Hf=class{constructor(t){this.fanout=t}createMissingMediaStreamDetector(){return new tF.MissingMediaStreamWarningDetector(this.fanout)}createWebRtcStatsDetectors(){return[new By.HighRemoteInboundRttDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new By.HighRemoteInboundRttDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new qy.HighInboundJitterDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new qy.HighInboundJitterDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new ky.HighInboundPacketLossDetector(Ti.CallQualityWarningMediaStreamType.Audio,this.fanout),new ky.HighInboundPacketLossDetector(Ti.CallQualityWarningMediaStreamType.Video,this.fanout),new Jy.ConstantAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new nF.ConstantInboundAudioLevelDetectorHandler,this.fanout),new Jy.ConstantAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new rF.ConstantOutboundAudioLevelDetectorHandler,this.fanout),new Ly.ZeroAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new iF.ZeroInboundAudioLevelDetectorHandler,this.fanout),new Ly.ZeroAudioLevelDetector(Zc.CallQualityWarningController.WEBRTC_FETCH_STATS_INTERVAL_MS,new aF.ZeroOutboundAudioLevelDetectorHandler,this.fanout)]}};Qc.CallQualityDetectorsFactory=Hf});var ko=p(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.MxpClientEventsVersionKey=In.MxpClientEventsVersion=In.MxpClientEvent=void 0;var Wy;(function(e){e.EnteredEstablished="EnteredEstablished",e.IceConnected="IceConnected",e.IceCompleted="IceCompleted"})(Wy||(In.MxpClientEvent=Wy={}));In.MxpClientEventsVersion="2";In.MxpClientEventsVersionKey="cev"});var Hy=p(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.PublicCallListenerCallbackMapper=void 0;var oF=Lt(),Vf=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===oF.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)}};Yc.PublicCallListenerCallbackMapper=Vf});var $c=p(wi=>{"use strict";var Kf=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.DefaultCall=void 0;var sF=Lt(),Ir=ct(),uF=ES(),cF=TS(),dF=VS(),lF=KS(),fF=un(),Vy=Ce(),Ai=ic(),hF=ue(),zf=lc(),Tn=_n(),pF=XS(),Ky=dt(),vF=jS(),mF=Uy(),zy=ko(),gF=Hy(),Gf=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 cF.LocalMediaPipeline,this.start=()=>Kf(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 gF.PublicCallListenerCallbackMapper,this.trackEvent=new lF.TrackEventFanout(this),this.callEventFanout=new dF.default(this),this.callQualityWarningEventFanout=new vF.CallQualityWarningEventFanout(this),this.callQualityWarningController=d.create(new mF.CallQualityDetectorsFactory(this.callQualityWarningEventFanout),this),this.callDetail=new pF.DefaultCallDetails(this,n),this.mediaController=this.localMedia.setRawMedia(i),this.peerConnectionClient=uF.PeerConnectionClient.create(this.mediaController,new fF.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,zf.createIceServerSetter)(this.peerConnectionClient)}answer(){return Kf(this,void 0,void 0,function*(){throw new Vy.InvalidOperationError("Answer can only be called on incoming call.")})}sendDtmf(t){if(!new RegExp("^[0-9#*abcdABCD]+$").test(t))throw new Vy.ArgumentError("Invalid DTMF keys",(0,hF.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 zf.IceConnectionState.Connected:this.emitClientEvent(zy.MxpClientEvent.IceConnected,t);break;case zf.IceConnectionState.Completed:this.emitClientEvent(zy.MxpClientEvent.IceCompleted,t);break}}tryEnableEarlyMedia(t){this.earlyMedia||this.direction===sF.Direction.Outbound&&t.isEarlyMedia()&&(this.session.state!==Ir.SessionState.Initiating&&this.session.state!==Ir.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(Ky.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 Ir.SessionState.Created:case Ir.SessionState.Initiating:return this.details.progressTime?Ai.CallState.Progressing:Ai.CallState.Init;case Ir.SessionState.Progress:return Ai.CallState.Ringing;case Ir.SessionState.Established:return this.details.establishedTime?Ai.CallState.Established:Ai.CallState.Answered;case Ir.SessionState.Terminated:return Ai.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(Ky.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 Kf(this,void 0,void 0,function*(){return yield this.peerConnectionClient.getPeerConnectionStats()})}};wi.DefaultCall=Gf});var Gy=p(Xc=>{"use strict";Object.defineProperty(Xc,"__esModule",{value:!0});Xc.RealTimeScheduler=void 0;var Zf=class{scheduleDelayed(t,n,r){let i=setTimeout(t,n);r?.subscribe(a=>{clearTimeout(i)})}};Xc.RealTimeScheduler=Zf});var Zy=p(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.CancellationTokenSource=Oi.CancellationError=void 0;var jc=class extends Error{constructor(){super(...arguments),this.name="CancellationError",this.message="The operation was cancelled"}};Oi.CancellationError=jc;var Qf=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 jc){this.cancellation=t,this.subscribers.splice(0).forEach(n=>n(t))}};Oi.CancellationTokenSource=Qf});var Di=p(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});ed.TransitionSource=void 0;var Qy;(function(e){e[e.LocalAction=0]="LocalAction",e[e.RemotePeerMessage=1]="RemotePeerMessage"})(Qy||(ed.TransitionSource=Qy={}))});var Jo=p(td=>{"use strict";Object.defineProperty(td,"__esModule",{value:!0});td.TimerEventType=void 0;var Yy;(function(e){e[e.Termination=0]="Termination",e[e.ACKWindowEnd=1]="ACKWindowEnd"})(Yy||(td.TimerEventType=Yy={}))});var jy=p(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.FsmState=void 0;var $y=Co(),Xy=dt(),nd=ct(),_F=ft(),xF=Ce(),Yf=Di(),SF=Jo(),$f=class{constructor(t,n){this.fsmSessionState=t,this.transitions=n,this.callTerminationCause=Xy.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: ${_F.Method[t.method]} when in ${this.stateName} state. Ignoring...`)}onSessionDescription(t,n){$y.Source.Local==t&&this.onLocalSessionDescription(n)}onCandidate(t,n){$y.Source.Local==t&&this.onLocalCandidate(n)}onStateTimeout(t){t.type==SF.TimerEventType.Termination&&(this.onTimeout(t),this.transition(nd.SessionState.Terminated,Yf.TransitionSource.LocalAction))}onTimeout(t){}onException(t){console.log(`FsmState exception: ${t}`),this.transition(nd.SessionState.Terminated,Yf.TransitionSource.LocalAction)}terminate(t,n){t&&(this.callTerminationCause=Xy.TerminationCause.Error),this.transition(nd.SessionState.Terminated,n??Yf.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==nd.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 xF.InvalidOperationError(`Accept() is not a valid action for current state (${this.stateName})`)}onLocalSessionDescription(t){}onLocalCandidate(t){}};rd.FsmState=$f});var tC=p(eC=>{"use strict";Object.defineProperty(eC,"__esModule",{value:!0})});var nC=p(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});id.FsmTransitions=void 0;var yF=mt(),Xf=class{constructor(){this.entries=new Array,this.nullState=new yF.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)}};id.FsmTransitions=Xf});var iC=p(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.NullState=void 0;var rC=ct(),CF=dt(),EF=mt(),jf=class extends EF.FsmState{constructor(){super(rC.SessionState.Terminated)}throw(){throw new Error("Invalid state (null)")}get sessionState(){return this.throw(),rC.SessionState.Terminated}get terminationCause(){return this.throw(),CF.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()}};ad.NullState=jf});var aC=p(od=>{"use strict";Object.defineProperty(od,"__esModule",{value:!0});od.TimerEvent=void 0;var eh=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})`}};od.TimerEvent=eh});var mt=p(Ke=>{"use strict";var bF=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]})),Tr=Ke&&Ke.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&bF(t,e,n)};Object.defineProperty(Ke,"__esModule",{value:!0});Tr(Zy(),Ke);Tr(Ce(),Ke);Tr(jy(),Ke);Tr(tC(),Ke);Tr(nC(),Ke);Tr(iC(),Ke);Tr(aC(),Ke)});var Lo=p(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});sd.SessionStateBase=void 0;var Ar=ft(),IF=mt(),TF=dt(),AF=ht(),th=class extends IF.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=TF.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(Ar.Method.Joined).body(AF.Codec.encodeClient(t.from)).build())}sendError(t){let n=this.Session.newMessage().method(Ar.Method.Error);t&&n.body(Ar.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(Ar.Method.PeerEvent).body(Ar.Body.sdp(t.asJson())).build())}onLocalCandidate(t){t.forEach(n=>{let r=this.Session.newMessage().method(Ar.Method.PeerEvent).body(Ar.Body.sdp(n.data));n.instanceId&&r.values({to:n.instanceId}),this.sendOutboundMessage(r.build())})}};sd.SessionStateBase=th});var oC=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 Ri=Ae(),wF=function(e,t){return(0,Ri.pipe)(e,(0,ae.contramap)(t))},OF=function(e){return function(t){return(0,Ri.flow)(e,t)}};ae.contramap=OF;ae.URI="Predicate";var DF=function(){return{concat:function(e,t){return(0,Ri.pipe)(e,(0,ae.or)(t))}}};ae.getSemigroupAny=DF;var RF=function(){return{concat:(0,ae.getSemigroupAny)().concat,empty:Ri.constFalse}};ae.getMonoidAny=RF;var FF=function(){return{concat:function(e,t){return(0,Ri.pipe)(e,(0,ae.and)(t))}}};ae.getSemigroupAll=FF;var PF=function(){return{concat:(0,ae.getSemigroupAll)().concat,empty:Ri.constTrue}};ae.getMonoidAll=PF;ae.Contravariant={URI:ae.URI,contramap:wF};var NF=function(e){return function(t){return!e(t)}};ae.not=NF;var MF=function(e){return function(t){return function(n){return t(n)||e(n)}}};ae.or=MF;var BF=function(e){return function(t){return function(n){return t(n)&&e(n)}}};ae.and=BF});var sC=p(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.concatAll=nt.endo=nt.filterSecond=nt.filterFirst=nt.reverse=void 0;var qF=function(e){return{concat:function(t,n){return e.concat(n,t)}}};nt.reverse=qF;var kF=function(e){return function(t){return{concat:function(n,r){return e(n)?t.concat(n,r):r}}}};nt.filterFirst=kF;var JF=function(e){return function(t){return{concat:function(n,r){return e(r)?t.concat(n,r):n}}}};nt.filterSecond=JF;var LF=function(e){return function(t){return{concat:function(n,r){return t.concat(e(n),e(r))}}}};nt.endo=LF;var UF=function(e){return function(t){return function(n){return n.reduce(function(r,i){return e.concat(r,i)},t)}}};nt.concatAll=UF});var uC=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 WF=Ae(),HF=function(e){return{equals:function(t,n){return t===n||e(t,n)}}};z.fromEquals=HF;var VF=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=VF;var KF=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=KF;var zF=function(e,t){return(0,WF.pipe)(e,(0,z.contramap)(t))},GF=function(e){return function(t){return(0,z.fromEquals)(function(n,r){return t.equals(e(n),e(r))})}};z.contramap=GF;z.URI="Eq";z.eqStrict={equals:function(e,t){return e===t}};var ZF={equals:function(){return!0}},QF=function(){return{concat:function(e,t){return(0,z.fromEquals)(function(n,r){return e.equals(n,r)&&t.equals(n,r)})}}};z.getSemigroup=QF;var YF=function(){return{concat:(0,z.getSemigroup)().concat,empty:ZF}};z.getMonoid=YF;z.Contravariant={URI:z.URI,contramap:zF};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 cC=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 $F=uC(),ud=Ae(),XF=function(e){return function(t,n){return t===n||e(t,n)===0}};k.equalsDefault=XF;var jF=function(e){return{equals:(0,k.equalsDefault)(e),compare:function(t,n){return t===n?0:e(t,n)}}};k.fromCompare=jF;var e4=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=e4;var t4=function(e){return(0,k.fromCompare)(function(t,n){return e.compare(n,t)})};k.reverse=t4;var n4=function(e,t){return(0,ud.pipe)(e,(0,k.contramap)(t))},r4=function(e){return function(t){return(0,k.fromCompare)(function(n,r){return t.compare(e(n),e(r))})}};k.contramap=r4;k.URI="Ord";var i4=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=i4;var a4=function(){return{concat:(0,k.getSemigroup)().concat,empty:(0,k.fromCompare)(function(){return 0})}};k.getMonoid=a4;k.Contravariant={URI:k.URI,contramap:n4};k.trivial={equals:ud.constTrue,compare:(0,ud.constant)(0)};var o4=function(e){return function(t){return function(n){return n===t||e.compare(n,t)===0}}};k.equals=o4;var s4=function(e){return function(t,n){return e.compare(t,n)===-1}};k.lt=s4;var u4=function(e){return function(t,n){return e.compare(t,n)===1}};k.gt=u4;var c4=function(e){return function(t,n){return e.compare(t,n)!==1}};k.leq=c4;var d4=function(e){return function(t,n){return e.compare(t,n)!==-1}};k.geq=d4;var l4=function(e){return function(t,n){return t===n||e.compare(t,n)<1?t:n}};k.min=l4;var f4=function(e){return function(t,n){return t===n||e.compare(t,n)>-1?t:n}};k.max=f4;var h4=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=h4;var p4=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=p4;k.getTupleOrd=k.tuple;k.getDualOrd=k.reverse;k.ord=k.Contravariant;function v4(e,t){return e<t?-1:e>t?1:0}var nh={equals:$F.eqStrict.equals,compare:v4};k.ordBoolean=nh;k.ordString=nh;k.ordNumber=nh;k.ordDate=(0,ud.pipe)(k.ordNumber,(0,k.contramap)(function(e){return e.valueOf()}))});var hC=p(L=>{"use strict";var m4=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]})),g4=L&&L.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),rh=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)&&m4(t,e,n);return g4(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=w4;var dC=Ae(),_4=rh(xr()),lC=rh(sC()),fC=rh(cC()),x4=function(e){return{concat:fC.min(e)}};L.min=x4;var S4=function(e){return{concat:fC.max(e)}};L.max=S4;var y4=function(e){return{concat:function(){return e}}};L.constant=y4;L.reverse=lC.reverse;var C4=function(e){return{concat:function(t,n){var r={};for(var i in e)_4.has.call(e,i)&&(r[i]=e[i].concat(t[i],n[i]));return r}}};L.struct=C4;var E4=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=E4;var b4=function(e){return function(t){return{concat:function(n,r){return t.concat(n,t.concat(e,r))}}}};L.intercalate=b4;var I4=function(){return{concat:dC.identity}};L.first=I4;var T4=function(){return{concat:function(e,t){return t}}};L.last=T4;L.concatAll=lC.concatAll;L.semigroupVoid=(0,L.constant)(void 0);var A4=function(){return{concat:function(e,t){return Object.assign({},e,t)}}};L.getObjectSemigroup=A4;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 w4(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=dC.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 pC=p(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.guard=O4;function O4(e,t){return function(n){return n?t.of(void 0):e.zero()}}});var yC=p(h=>{"use strict";var D4=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]})),R4=h&&h.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),vC=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)&&D4(t,e,n);return R4(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=M4;h.elem=SC;h.getRefinement=xP;var F4=Nl(),cd=Lu(),mC=vC(Wu()),ah=Bl(),ce=Ae(),Wo=bo(),wr=vC(xr()),P4=oC(),gC=hC(),oh=kl(),_C=Jl(),N4=pC();h.none=wr.none;h.some=wr.some;function M4(e){return function(t){return e(t)?(0,h.some)(t):h.none}}var B4=function(e){return e._tag==="Right"?h.none:(0,h.some)(e.left)};h.getLeft=B4;var q4=function(e){return e._tag==="Left"?h.none:(0,h.some)(e.right)};h.getRight=q4;var ze=function(e,t){return(0,ce.pipe)(e,(0,h.map)(t))},Or=function(e,t){return(0,ce.pipe)(e,(0,h.ap)(t))},dd=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduce)(t,n))},ld=function(e){var t=(0,h.foldMap)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},fd=function(e,t,n){return(0,ce.pipe)(e,(0,h.reduceRight)(t,n))},sh=function(e){var t=(0,h.traverse)(e);return function(n,r){return(0,ce.pipe)(n,t(r))}},uh=function(e,t){return(0,ce.pipe)(e,(0,h.alt)(t))},Uo=function(e,t){return(0,ce.pipe)(e,(0,h.filter)(t))},ch=function(e,t){return(0,ce.pipe)(e,(0,h.filterMap)(t))},xC=function(e,t){return(0,ce.pipe)(e,(0,h.extend)(t))},dh=function(e,t){return(0,ce.pipe)(e,(0,h.partition)(t))},lh=function(e,t){return(0,ce.pipe)(e,(0,h.partitionMap)(t))};h.URI="Option";var k4=function(e){return{show:function(t){return(0,h.isNone)(t)?"none":"some(".concat(e.show(t.value),")")}}};h.getShow=k4;var J4=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=J4;var L4=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=L4;var U4=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=U4;var W4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t.value))}};h.map=W4;h.Functor={URI:h.URI,map:ze};h.as=(0,ce.dual)(2,(0,Wo.as)(h.Functor));h.asUnit=(0,Wo.asUnit)(h.Functor);h.of=h.some;h.Pointed={URI:h.URI,of:h.of};var H4=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=H4;h.Apply={URI:h.URI,map:ze,ap:Or};h.Applicative={URI:h.URI,map:ze,ap:Or,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:Or,chain:h.flatMap};h.Monad={URI:h.URI,map:ze,ap:Or,of:h.of,chain:h.flatMap};var V4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(e,n.value)}};h.reduce=V4;var K4=function(e){return function(t){return function(n){return(0,h.isNone)(n)?e.empty:t(n.value)}}};h.foldMap=K4;var z4=function(e,t){return function(n){return(0,h.isNone)(n)?e:t(n.value,e)}};h.reduceRight=z4;h.Foldable={URI:h.URI,reduce:dd,foldMap:ld,reduceRight:fd};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:uh};var G4=function(){return h.none};h.zero=G4;h.Zero={URI:h.URI,zero:h.zero};h.guard=(0,N4.guard)(h.Zero,h.Pointed);h.Alternative={URI:h.URI,map:ze,ap:Or,of:h.of,alt:uh,zero:h.zero};var Z4=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.some)(e(t))}};h.extend=Z4;h.Extend={URI:h.URI,map:ze,extend:xC};h.compact=(0,h.flatMap)(ce.identity);var Q4=(0,oh.separated)(h.none,h.none),Y4=function(e){return(0,h.isNone)(e)?Q4:(0,oh.separated)((0,h.getLeft)(e.value),(0,h.getRight)(e.value))};h.separate=Y4;h.Compactable={URI:h.URI,compact:h.compact,separate:h.separate};var $4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)?t:h.none}};h.filter=$4;var X4=function(e){return function(t){return(0,h.isNone)(t)?h.none:e(t.value)}};h.filterMap=X4;var j4=function(e){return function(t){return(0,oh.separated)(Uo(t,(0,P4.not)(e)),Uo(t,e))}};h.partition=j4;var eP=function(e){return(0,ce.flow)((0,h.map)(e),h.separate)};h.partitionMap=eP;h.Filterable={URI:h.URI,map:ze,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh};var tP=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=tP;var nP=function(e){return function(t){return(0,h.isNone)(t)?e.of(h.none):e.map(t.value,h.some)}};h.sequence=nP;h.Traversable={URI:h.URI,map:ze,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence};var fh=(0,_C.witherDefault)(h.Traversable,h.Compactable),hh=(0,_C.wiltDefault)(h.Traversable,h.Compactable),rP=function(e){var t=fh(e);return function(n){return function(r){return t(r,n)}}};h.wither=rP;var iP=function(e){var t=hh(e);return function(n){return function(r){return t(r,n)}}};h.wilt=iP;h.Witherable={URI:h.URI,map:ze,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh,wither:fh,wilt:hh};var aP=function(){return h.none};h.throwError=aP;h.MonadThrow={URI:h.URI,map:ze,ap:Or,of:h.of,chain:h.flatMap,throwError:h.throwError};h.fromEither=h.getRight;h.FromEither={URI:h.URI,fromEither:h.fromEither};h.isSome=wr.isSome;var oP=function(e){return e._tag==="None"};h.isNone=oP;var sP=function(e,t){return function(n){return(0,h.isNone)(n)?e():t(n.value)}};h.matchW=sP;h.foldW=h.matchW;h.match=h.matchW;h.fold=h.match;var uP=function(e){return function(t){return(0,h.isNone)(t)?e():t.value}};h.getOrElseW=uP;h.getOrElse=h.getOrElseW;h.flap=(0,Wo.flap)(h.Functor);h.apFirst=(0,cd.apFirst)(h.Apply);h.apSecond=(0,cd.apSecond)(h.Apply);h.flatten=h.compact;h.tap=(0,ce.dual)(2,mC.tap(h.Chain));h.tapEither=(0,ce.dual)(2,(0,ah.tapEither)(h.FromEither,h.Chain));h.duplicate=(0,h.extend)(ce.identity);h.fromEitherK=(0,ah.fromEitherK)(h.FromEither);h.chainEitherK=(0,ah.chainEitherK)(h.FromEither,h.Chain);h.chainFirstEitherK=h.tapEither;var cP=function(e){return e==null?h.none:(0,h.some)(e)};h.fromNullable=cP;var dP=function(e){try{return(0,h.some)(e())}catch{return h.none}};h.tryCatch=dP;var lP=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=lP;var fP=function(e){return(0,ce.flow)(e,h.fromNullable)};h.fromNullableK=fP;var hP=function(e){return function(t){return(0,h.isNone)(t)?h.none:(0,h.fromNullable)(e(t.value))}};h.chainNullableK=hP;h.toNullable=(0,h.match)(ce.constNull,ce.identity);h.toUndefined=(0,h.match)(ce.constUndefined,ce.identity);function SC(e){return function(t,n){if(n===void 0){var r=SC(e);return function(i){return r(t,i)}}return(0,h.isNone)(n)?!1:e.equals(t,n.value)}}var pP=function(e){return function(t){return(0,h.isNone)(t)?!1:e(t.value)}};h.exists=pP;h.Do=(0,h.of)(wr.emptyRecord);h.bindTo=(0,Wo.bindTo)(h.Functor);var vP=(0,Wo.let)(h.Functor);h.let=vP;h.bind=mC.bind(h.Chain);h.apS=(0,cd.apS)(h.Apply);h.ApT=(0,h.of)(wr.emptyReadonlyArray);var mP=function(e){return function(t){var n=e(0,wr.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=mP;var gP=function(e){var t=(0,h.traverseReadonlyNonEmptyArrayWithIndex)(e);return function(n){return wr.isNonEmpty(n)?t(n):h.ApT}};h.traverseReadonlyArrayWithIndex=gP;h.traverseArrayWithIndex=h.traverseReadonlyArrayWithIndex;var _P=function(e){return(0,h.traverseReadonlyArrayWithIndex)(function(t,n){return e(n)})};h.traverseArray=_P;h.sequenceArray=(0,h.traverseArray)(ce.identity);h.chain=h.flatMap;h.chainFirst=h.tap;function xP(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:Or,chain:h.flatMap,reduce:dd,foldMap:ld,reduceRight:fd,traverse:sh,sequence:h.sequence,zero:h.zero,alt:uh,extend:xC,compact:h.compact,separate:h.separate,filter:Uo,filterMap:ch,partition:dh,partitionMap:lh,wither:fh,wilt:hh,throwError:h.throwError};h.getApplySemigroup=(0,cd.getApplySemigroup)(h.Apply);h.getApplyMonoid=(0,F4.getApplicativeMonoid)(h.Applicative);var SP=function(){return(0,h.getMonoid)((0,gC.first)())};h.getFirstMonoid=SP;var yP=function(){return(0,h.getMonoid)((0,gC.last)())};h.getLastMonoid=yP});var gh=p(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.EstablishedState=void 0;var ph=yC(),CP=Ae(),vh=ht(),Fi=ft(),EP=ct(),$t=dt(),bP=Lo(),IP=Di(),CC=new Map([[$t.TerminationCause.None,{terminationCause:$t.TerminationCause.HungUp,headers:{extterm:vh.HeaderBooleanValue.Yes}}],[$t.TerminationCause.Inactive,{terminationCause:$t.TerminationCause.Inactive,headers:{inactive:vh.HeaderBooleanValue.Yes}}],[$t.TerminationCause.IceFailedToConnect,{terminationCause:$t.TerminationCause.IceFailedToConnect,headers:{iceFailed:vh.HeaderBooleanValue.Yes}}]]),mh=class extends bP.SessionStateBase{constructor(t){super(EP.SessionState.Established,t),this.toMessageContent=n=>CC.has(n)?(0,ph.some)(CC.get(n)):ph.none}setTerminationCauseAndLeave(t){this.terminationCause=t.terminationCause;let n=this.Session.newMessage().method(Fi.Method.Leave),r=t.headers?n.values(t.headers).build():n.build();this.sendOutboundMessage(r)}onWillTerminate(t){if(t!==IP.TransitionSource.RemotePeerMessage)if(this.terminationCause===$t.TerminationCause.Error){this.sendError(this.Session.error);return}else{this.sendMxpMessageForLocalTermination();return}}sendMxpMessageForLocalTermination(){(0,CP.pipe)(this.terminationCause,this.toMessageContent,(0,ph.match)(()=>{},t=>this.setTerminationCauseAndLeave(t)))}handleInboundMessage(t){switch(t.method){case Fi.Method.Leave:return this.terminateBasedOnMessage(t,$t.TerminationCause.HungUp),!0;case Fi.Method.Ack:return!0;case Fi.Method.Join:return this.sendJoined(t),!0;case Fi.Method.PeerEvent:return this.Session.emitJsepEvent(t),!0;case Fi.Method.Error:return this.terminateBasedOnMessage(t,$t.TerminationCause.Error),!0}return!1}};hd.EstablishedState=mh});var xh=p(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.TerminatedState=void 0;var TP=ct(),AP=Lo(),_h=class extends AP.SessionStateBase{constructor(t){super(TP.SessionState.Terminated,t)}handleInboundMessage(t){return!0}};pd.TerminatedState=_h});var EC=p(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.InvalidStateTransition=void 0;var wP=Ce(),Sh=class extends wP.ErrorBase{constructor(t,n){super(`Invalid transition ${t} -> ${n}`)}};vd.InvalidStateTransition=Sh});var bC=p(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});md.MessageBuilder=void 0;var OP=mt(),DP=ue(),RP=Ds(),Ho=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 OP.ArgumentError("Missing arguments",(0,DP.nameof)(this));return new RP.Message(this.mxpMethod,this.mxpSessionId,this.mxpFrom,this.mxpBody,this.mxpValues)}};md.MessageBuilder=Ho;Ho.create=()=>new Ho});var Ch=p(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.Session=void 0;var FP=require("pubnub"),IC=ft(),gd=mt(),_d=Ce(),PP=EC(),Pi=Co(),NP=dt(),MP=ct(),xd=un(),BP=bC(),qP=ue(),kP=Di(),TC=Jo(),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 gd.NullState,this.transitions=new gd.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 xd.Event,this.symmetricSessionKey=null,this.onSessionKey=new xd.Event,this.stateChanged=new xd.Event,this.outboundMessageEvent=new xd.Event,this.addJsepMessage=a=>{a.forEach(s=>this.pendingJsepMessages.push(s))},n.length<=0)throw new _d.ArgumentError("Invalid session id",(0,qP.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(MP.SessionState.Initiating,kP.TransitionSource.LocalAction))}set onStateChanged(t){this.stateChanged.add(t)}set onOutboundMessage(t){this.outboundMessageEvent.add(t)}newMessage(){return BP.MessageBuilder.create().sessionId(this.sessionId).from(this.localPeer)}setInitialState(t){this.fsmState=t}setStartedAt(){if(this.startedAt)throw new _d.InvalidOperationError("Started timestamp already set");this.startedAt=new Date}timeoutRelativeToStart(t){if(!this.startedAt)throw new _d.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 _d.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(IC.Method.PeerEvent).body(IC.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 PP.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==NP.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){Pi.JsepMessage.tryParse(t,n=>{this.emitJsepEvents(n)})}addPendingInboundMessage(t){this.pendingInboundMessages.push(t)}setLocalCandidate(t){this.tryWithCurrentState(n=>n.onCandidate(Pi.Source.Local,t))}setLocalSessionDescription(t){this.localDescription=new Pi.SessionDescription(t.isAnswer?Pi.DescriptionType.Answer:Pi.DescriptionType.Offer,t.data),this.tryWithCurrentState(n=>{this.localDescription&&n.onSessionDescription(Pi.Source.Local,this.localDescription)})}scheduleTimeout(t,n,r){let i=new gd.TimerEvent((0,FP.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 gd.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 TC.TimerEventType.Termination:t==this.fsmState&&t.onStateTimeout(n);break;case TC.TimerEventType.ACKWindowEnd:this.onACKWindowTimeout(t,n);break}}};Sd.Session=yh});var OC=p(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.OutboundSession=void 0;var ve=ft(),JP=Lo(),Eh=ht(),wC=ue(),LP=gh(),UP=xh(),Tt=dt(),_e=ct(),WP=Ch(),AC=mt(),HP=Lt(),Vo=Di(),yd=Jo(),Ko=class extends JP.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 Ko{constructor(t){super(_e.SessionState.Created,t)}},Ih=class extends Ko{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),yd.TimerEventType.ACKWindowEnd),this.Session.scheduleTimeout(this,this.CallProgressTimeoutMs,yd.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:wC.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,Vo.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,Vo.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!==Vo.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 Ko{constructor(t){super(_e.SessionState.Progress,t)}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallSetupTimeoutMs),yd.TimerEventType.Termination),this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallACKWindowTimeoutMs),yd.TimerEventType.ACKWindowEnd)}handleInboundMessage(t){switch(t.method){case ve.Method.Join:this.sendJoined(t),this.Session.emitJsepEvent(t),this.transition(_e.SessionState.Established,Vo.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!==Vo.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 WP.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,HP.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 LP.EstablishedState(this),d=new UP.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 AC.ArgumentError("Invalid key (empty)",(0,wC.nameof)(t));if(this.sessionKey!=null)throw new AC.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)})}};Cd.OutboundSession=Ah});var Ed=p((l9,RC)=>{var DC=RC.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(DC).forEach(function(e){var t=DC[e];t.forEach(function(n){n.reg||(n.reg=/(.*)/),n.format||(n.format="%s")})})});var NC=p(Xt=>{var Ni=function(e){return String(Number(e))===e?Number(e):e},VP=function(e,t,n,r){if(r&&!n)t[r]=Ni(e[1]);else for(var i=0;i<n.length;i+=1)e[i+1]!=null&&(t[n[i]]=Ni(e[i+1]))},KP=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;VP(n.match(e.reg),i,e.names,e.name),e.push&&t[e.push].push(i)},FC=Ed(),zP=RegExp.prototype.test.bind(/^([a-z])=(.*)/);Xt.parse=function(e){var t={},n=[],r=t;return e.split(/(\r\n|\r|\n)/).filter(zP).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<(FC[a]||[]).length;u+=1){var d=FC[a][u];if(d.reg.test(s))return KP(d,r,s)}}),t.media=n,t};var PC=function(e,t){var n=t.split(/=(.+)/,2);return n.length===2?e[n[0]]=Ni(n[1]):n.length===1&&t.length>1&&(e[n[0]]=void 0),e};Xt.parseParams=function(e){return e.split(/;\s?/).reduce(PC,{})};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(Ni),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(PC,{})})};Xt.parseSimulcastStreamList=function(e){return e.split(";").map(function(t){return t.split(",").map(function(n){var r,i=!1;return n[0]!=="~"?r=Ni(n):(r=Ni(n.substring(1,n.length)),i=!0),{scid:r,paused:i}})})}});var BC=p((h9,MC)=>{var wh=Ed(),GP=/%[sdv%]/g,ZP=function(e){var t=1,n=arguments,r=n.length;return e.replace(GP,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""}})},zo=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 ZP.apply(null,i)},QP=["v","o","s","i","u","e","p","c","b","t","r","z","a"],YP=["i","c","b","a"];MC.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||QP,r=t.innerOrder||YP,i=[];return n.forEach(function(a){wh[a].forEach(function(s){s.name in e&&e[s.name]!=null?i.push(zo(a,s,e)):s.push in e&&e[s.push]!=null&&e[s.push].forEach(function(u){i.push(zo(a,s,u))})})}),e.media.forEach(function(a){i.push(zo("m",wh.m[0],a)),r.forEach(function(s){wh[s].forEach(function(u){u.name in a&&a[u.name]!=null?i.push(zo(s,u,a)):u.push in a&&a[u.push]!=null&&a[u.push].forEach(function(d){i.push(zo(s,u,d))})})})}),i.join(`\r
|
|
2
2
|
`)+`\r
|
|
3
3
|
`}});var qC=p(At=>{var Dr=NC(),$P=BC(),XP=Ed();At.grammar=XP;At.write=$P;At.parse=Dr.parse;At.parseParams=Dr.parseParams;At.parseFmtpConfig=Dr.parseFmtpConfig;At.parsePayloads=Dr.parsePayloads;At.parseRemoteCandidates=Dr.parseRemoteCandidates;At.parseImageAttributes=Dr.parseImageAttributes;At.parseSimulcastStreamList=Dr.parseSimulcastStreamList});var Dh=p(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});bd.Sdp=void 0;var jP=qC(),Oh=class e{static parse(t){return new e(jP.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}};bd.Sdp=Oh});var Rh=p(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});Id.PushType=void 0;var kC;(function(e){e[e.Call=1]="Call"})(kC||(Id.PushType=kC={}))});var Ad=p(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.OcraPushService=An.PUSH_VERSION=An.REQUEST_VIDEO_FLAG=void 0;var eN=Ce(),tN=ue(),JC=cc(),nN=wd();An.REQUEST_VIDEO_FLAG=1;An.PUSH_VERSION=4;var Td=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)}},Go=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 eN.ArgumentError("Invalid subscription",(0,tN.nameof)(t))}getTemplateParameters(t){let n={sinch:(0,nN.generatePushPayload)(t)};return this.pushNotificationDisplayName&&(n.displayName=this.pushNotificationDisplayName),n}mapPushInstances(t,n){return n.filter(r=>r.capabilities&&Td.getVersion(r.capabilities,JC.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&&Td.getVersion(r.capabilities,JC.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=Go;Go.MaxPayloadSize=3393;Go.MinSupportedPushVersion=4});var wd=p(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.PushPayload=void 0;Mi.getFlags=UC;Mi.generatePushPayload=aN;var rN=Rh(),LC=Ad(),iN=qe();function UC(e){let t=0;return e.requestedVideo&&(t|=LC.REQUEST_VIDEO_FLAG),t}function aN(e){let t;if(!new Od(LC.PUSH_VERSION,rN.PushType.Call,e.id,e.createdAt,e.localPeer.userId,UC(e),iN.Domain.Mxp,e.headers).tryEncode(r=>{t=r})||!t)throw new Error("Unable to create push payload");return t}var Od=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}}};Mi.PushPayload=Od});var ki=p(qi=>{"use strict";var WC=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.OutboundCall=void 0;var oN=ht(),HC=qe(),sN=$c(),uN=Dh(),cN=Ci(),dN=wd(),Bi=_n(),Dd=dn(),lN=ko(),Fh=class extends sN.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,dN.generatePushPayload)(this),this.onLocalDescription=x=>{this.callInitiated?this.withSession(E=>E.setLocalSessionDescription(x)):this.initiateCall(x.data)}}initiateCall(t){return WC(this,void 0,void 0,function*(){var n;try{let r=this.features.getFeatureFlag(cN.FeatureFlag.UseTurn);this.callInitiated=!0,this.clientEventsCollector.addEvent(Bi.ClientEvent.createClientEventType(Bi.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(lN.MxpClientEventsVersion)}});this.clientEventsCollector.addEvent(Bi.ClientEvent.createClientEventType(Bi.ClientEventName.OCRA_CALL_INIT_REQUEST_COMPLETE)),i.publicCallHeaders!=null&&this.setHeaders(i.publicCallHeaders),i.apiBaseUrl!=null&&(this.callApiBaseUrl=i.apiBaseUrl),this.setMxpSignalingConfiguration(new oN.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 Dd.SinchError?(this.clientEventsCollector.addEvent(Bi.ClientEvent.createClientEventType(Bi.ClientEventName.OCRA_CALL_INIT_REQUEST_COMPLETE,{type:HC.EventResultTypeEnum.Failure,errorCode:r.code,errorDomain:HC.ClientErrorDomain.Http})),this.hangup(r)):this.hangup(new Dd.SinchError(r.message,Dd.ErrorCode.Generic,Dd.ErrorType.Http))}})}sendPushNotifications(t){return WC(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=uN.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}};qi.OutboundCall=Fh});var Nh=p(wn=>{"use strict";var fN=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 Rd=require("pubnub"),VC=un(),Fd=class{constructor(t,n,r){this.broadcastChannel=t,this.signalChannel=n,this.config=r,this.subscribers=new Array,this.onBroadcastMessage=new VC.Event,this.onSignalMessage=new VC.Event,this.broadcastFilters=new Array,this.broadcast=new Rd({subscribeKey:r.broadcastSubscribeKey,ssl:!0,origin:r.hostname,uuid:Rd.generateUUID()}),this.signal=new Rd({subscribeKey:r.signalSubscribeKey,publishKey:r.signalPublishKey,ssl:!0,origin:r.hostname,uuid:Rd.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 fN(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=Fd;var Ph=class{static create(t,n,r){return new Fd(t,n,r)}};wn.PubSubClientFactory=Ph});var Bh=p(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});Nd.MxpMessageChannel=void 0;var KC=un(),Pd=Ce(),zC=ue(),Mh=class{constructor(t,n,r){this.sessionId=t,this.instanceId=n,this.protocol=r,this.onInboundMessage=new KC.Event,this.onOutboundMessage=new KC.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 Pd.InvalidOperationError("No channelId configured");if(!this.onOutboundMessage)throw new Pd.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 Pd.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 Pd.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)}};Nd.MxpMessageChannel=Mh});var YC=p(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});Bd.InboundSession=void 0;var ZC=ht(),Je=ft(),GC=ko(),hN=ue(),pN=Lt(),vN=gh(),QC=mt(),mN=Jo(),Md=Di(),gN=Co(),_N=Ch(),xe=ct(),xN=Lo(),SN=xh(),Rr=dt(),Zo=class extends xN.SessionStateBase{constructor(t,n){super(t,n)}},qh=class extends Zo{constructor(t){super(xe.SessionState.Created,t)}},kh=class extends Zo{constructor(t){super(xe.SessionState.Initiating,t)}handleInboundMessage(t){return t.isMethod(Je.Method.Invite)&&this.Session.processInvite(t)?(this.transition(xe.SessionState.Progress,Md.TransitionSource.RemotePeerMessage),!0):!1}},Jh=class extends Zo{constructor(t){super(xe.SessionState.Progress,t)}onEnter(t){this.Session.scheduleTimeout(this,this.timeoutRelativeToStart(this.CallSetupTimeoutInboundMs),mN.TimerEventType.Termination),this.Session.emitPendingJsepEvents()}onWillTerminate(t){if(t!==Md.TransitionSource.RemotePeerMessage)switch(this.terminationCause){case Rr.TerminationCause.Error:this.sendError(this.Session.error);return;case Rr.TerminationCause.Timeout:this.hasSentOutboundMessage(Je.Method.Join)&&this.sendOutboundMessage(this.Session.newMessage().method(Je.Method.Leave).build());return;case Rr.TerminationCause.None:this.terminationCause=Rr.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,Rr.TerminationCause.Canceled),!0;case Je.Method.Error:return this.terminateBasedOnMessage(t,Rr.TerminationCause.Error),!0;case Je.Method.Joined:return t.body&&this.Session.isLocalPeer(ZC.Codec.decodeClient(t.body))?this.transition(xe.SessionState.Established,Md.TransitionSource.RemotePeerMessage):(this.terminationCause=Rr.TerminationCause.OtherPeerAccepted,this.transition(xe.SessionState.Terminated,Md.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({[GC.MxpClientEventsVersionKey]:GC.MxpClientEventsVersion}).build())}onAccept(){let t=this.Session.localDescription;if(t==null)throw new QC.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 _N.Session{constructor(t,n,r){super(t,n,pN.Direction.Inbound,r),this.processInvite=o=>{if(o.method!=Je.Method.Invite)throw new QC.ArgumentError("Invalid method",(0,hN.nameof)(o));return!ZC.Message.tryExtractSessionKey(o,f=>{this.sessionKey=f})||!gN.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 vN.EstablishedState(this),d=new SN.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())}};Bd.InboundSession=Lh});var jC=p(Ji=>{"use strict";var $C=Ji&&Ji.__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(Ji,"__esModule",{value:!0});Ji.InboundCall=void 0;var qd=ct(),yN=$c(),XC=_n(),CN=1500,Uh=class extends yN.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 $C(this,void 0,void 0,function*(){let t=Date.now();t-this.lastAnswerTime<CN||(this.lastAnswerTime=t,yield this.doAnswer())})}doAnswer(){return $C(this,void 0,void 0,function*(){this.mediaController.hasAnyTracks===!1&&(yield this.onAcceptedWithoutTracks(this)),this.withSession(t=>{let n=t.state;n===qd.SessionState.Progress?(this.clientEventsCollector.addEvent(XC.ClientEvent.createClientEventType(XC.ClientEventName.SDK_API_ANSWER)),t.accept()):(n===qd.SessionState.Created||n===qd.SessionState.Initiating)&&(t.onStateChanged=r=>{r.state==qd.SessionState.Progress&&this.doAnswer()})}),this.callEventFanout.setCallAccepted()})}};Ji.InboundCall=Uh});var eE=p(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.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))}};kd.ClientEventsCollector=Wh});var nE=p(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.MxpEventsCollector=Dn.EventSubType=Dn.EventType=void 0;var wt=ht(),Li;(function(e){e.In="IN",e.Out="OUT",e.Error="ERROR"})(Li||(Dn.EventType=Li={}));var tE=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=[Li.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=[Li.Out,t,r,i,tE.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?Li.In:Li.Out,t,r,i,a,tE.get(s),u,d];this.addEvent(c)}}get eventLog(){return this.mxpEventLog}get events(){return this.mxpEventLog.Events}};Dn.MxpEventsCollector=Hh});var rE=p(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});Jd.CallQualityDataCollector=void 0;var Qo=qe(),EN=Yt(),bN=Er(),IN=Ce(),TN=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(Qo.WarningEventName).find(r=>r===t);if(!n)throw new IN.ArgumentError(`Invalid WarningEventName. ${t} cannot be mapped to any Ocra event name`,(0,TN.nameof)(t));return n}toOcraWarningEventType(t){return t===EN.CallQualityWarningEventType.Recover?Qo.WarningEventType.Recover:Qo.WarningEventType.Trigger}toOcraWarningMediaStreamType(t){if(t)return t===bN.CallQualityWarningMediaStreamType.Video?Qo.MediaStreamType.Video:Qo.MediaStreamType.Audio}};Jd.CallQualityDataCollector=Vh});var iE=p(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.DefaultCallQualityWarningControllerFactory=void 0;var AN=Nf(),Kh=class{create(t,n){return new AN.CallQualityWarningController(t,n)}};Ld.DefaultCallQualityWarningControllerFactory=Kh});var Gh=p(Ui=>{"use strict";var rt=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.CallClientInstance=void 0;var wN=Ae(),aE=ue(),Ot=G(),oE=Gy(),ON=OC(),Ud=Ce(),Wd=ht(),sE=ft(),DN=ki(),RN=Nh(),FN=Bh(),PN=YC(),NN=jC(),MN=Dh(),BN=lc(),uE=Ci(),cE=eE(),dE=_n(),qN=nE(),lE=ic(),fE=rE(),hE=iE(),kN=ko(),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 sE.SymmetricKey(this.rtcProfile.mxpEncryptionKey));g!==null&&g.message.method==sE.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=Wd.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(uE.FeatureFlag.IncludeMxpEventLog),this.isTurnEnabled=this.features.getFeatureFlag(uE.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=Wd.ProtocolV10Factory.create(),this.joinIceServersAndStunUrls=(0,wN.flow)(BN.toRTCIceServer,C=>this.stunUrls?C.concat([{urls:this.stunUrls}]):C),this.getRTCIceServers=(0,aE.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 ON.OutboundSession(this.localPeer,r,new oE.RealTimeScheduler),a=yield this.mediaManager.createMediaController(!0,n),s=yield this.getRTCIceServers(),u=new DN.OutboundCall(t,n,i,this.getOrCreateMxpChannel(i),this.pushSender,a,this.callInitiator,this.useRelayIceCandidatesOnly,this.features,new cE.ClientEventsCollector,new fE.CallQualityDataCollector,new hE.DefaultCallQualityWarningControllerFactory,s);return this.addCallListener(u),this.storeCall(u),u})}ensureCallNotExists(t){if(this.calls.has(t))throw new Ud.InvalidOperationError(`Call already exists (${t})`)}hasActiveCall(){for(let t of this.calls.values())if(t.state!=lE.CallState.Ended)return!0;return!1}hasVideo(t){return MN.Sdp.parse(t.getSdp().sdp).hasVideo()}createMxpEventsCollector(){return this.isMxpEventLogsEnabled?new qN.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 PN.InboundSession(this.localPeer,t.sessionId,new oE.RealTimeScheduler),i=yield this.mediaManager.createMediaController(!0,n),a={identity:t.from.userId,domain:t.from.domain},s=new NN.InboundCall(n,a,r,this.getOrCreateMxpChannel(r),i,this.useRelayIceCandidatesOnly,new cE.ClientEventsCollector,new fE.CallQualityDataCollector,new hE.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(kN.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 aE.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 Ud.InvalidOperationError("MXP message channel already exists");let n=new FN.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(dE.ClientEvent.createClientEventType(dE.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),!Wd.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 Ud.InvalidOperationError("Unable to get message channel");if(c){o.terminateDueToOngoingCall();return}this.incomingCallEvent.onEvent(o)})}createPubSubClient(t,n){return RN.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=>Wd.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!=lE.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 Ud.InvalidOperationError("Could not get media tracks. Make sure you have granted required media permissions."));t.updateMediaController(n)})}};Ui.CallClientInstance=zh});var pE=p(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});Hd.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()}};Hd.WebRTCStats=Zh});var mE=p(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.CallDestination=void 0;var en=qe(),vE=ki(),Qh=class e{constructor(t,n){this.call=t,this.localUserId=n,this.destinationDomain=this.call instanceof vE.OutboundCall?this.call.remoteDomain:en.Domain.Mxp,this.destinationUser=this.call instanceof vE.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}}};Vd.CallDestination=Qh});var _E=p(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.CallOrigin=void 0;var JN=qe(),gE=ki(),Yh=class{constructor(t,n){this.call=t,this.localUserId=n,this.originDomain=this.call instanceof gE.OutboundCall?JN.Domain.Mxp:this.call.remoteDomain,this.originUser=this.call instanceof gE.OutboundCall?this.localUserId:this.call.remoteUserId}getOrigin(){if(!(!this.originDomain||!this.originUser))return{domain:this.originDomain,identity:this.originUser}}};Kd.CallOrigin=Yh});var Xh=p(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});zd.CallReportUtils=void 0;var pe=qe(),xE=qe(),LN=Lt(),SE=dn(),Rn=hc(),UN=ki(),WN=mE(),HN=_E(),$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==LN.Direction.Inbound?xE.Direction.Inbound:xE.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 SE.ErrorType.Http:return pe.ClientErrorDomain.Http;case SE.ErrorType.Network:return pe.ClientErrorDomain.Network;default:return}}static getRemoteDomain(t){return t instanceof UN.OutboundCall?t.destination.domain:t.remoteDomain}static getCallDestination(t,n){return new WN.CallDestination(t,n).getDestination()}static getCallOrigin(t,n){return new HN.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}};zd.CallReportUtils=$h});var EE=p(Se=>{"use strict";var VN=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(),yE=pE(),CE=Xh(),KN=2e3,zN=10,GN=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 ZN={[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 yE.WebRTCStats}startStatsCollection(t){let n=0;this.intervalId=setInterval(()=>{n++,n>zN?(clearInterval(this.intervalId),this.collectStats(t),this.intervalId=setInterval(()=>this.collectStats(t),GN)):this.collectStats(t)},KN)}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 yE.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=ZN[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:CE.CallReportUtils.getIceCandidate(r),remoteIceCandidate:CE.CallReportUtils.getIceCandidate(i),timestamp:new Date};this.webRtcStats.connectionInfos.push(a)}collectStats(t){return VN(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 Gd),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 Gd=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=Gd});var IE=p(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.CallClientEventFanout=void 0;var QN=Si(),bE=_n(),ep=class extends QN.EventFanout{constructor(t){super(),this.callClient=t,this.listen=(n,r)=>{n.clientEventsCollector.addEvent(bE.ClientEvent.createClientEventType(bE.ClientEventName.SDK_DID_NOTIFY_INCOMING_CALL)),r.onIncomingCall(this.callClient,n)}}};Zd.CallClientEventFanout=ep});var TE=p(Fn=>{"use strict";var Yo=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 YN=Gh(),$N=EE(),XN=IE(),Qd=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 YN.CallClientInstance(this.userId,this.applicationKey,r,i,t,n,new XN.CallClientEventFanout(this),s,a,new $N.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 Yo(this,void 0,void 0,function*(){return this.callclient.callUser(t,!1,n)})}callUserVideo(t,n){return Yo(this,void 0,void 0,function*(){return this.callclient.callUser(t,!0,n)})}callPhoneNumber(t,n){return Yo(this,void 0,void 0,function*(){return this.callclient.callPhoneNumber(t,n)})}callSip(t,n){return Yo(this,void 0,void 0,function*(){return this.callclient.callSip(t,!1,n)})}callConference(t,n){return Yo(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=Qd;var tp=class{static create(t,n,r){return new Qd(t,n,r)}};Fn.CallClientFactory=tp});var np=p(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0})});var OE=p(wE=>{"use strict";Object.defineProperty(wE,"__esModule",{value:!0})});var DE=p(Le=>{"use strict";var jN=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)&&jN(t,e,n)};Object.defineProperty(Le,"__esModule",{value:!0});Pn($c(),Le);Pn(TE(),Le);Pn(np(),Le);Pn(OE(),Le);Pn(Bh(),Le);Pn(ki(),Le);Pn(Nh(),Le);Pn(Gh(),Le)});var RE=p(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});Yd.DeviceVersion=void 0;var eM=qe(),rp=ue(),ip=class{constructor(t){this.application=t,this.platform=eM.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}};Yd.DeviceVersion=ip});var PE=p(FE=>{"use strict";Object.defineProperty(FE,"__esModule",{value:!0})});var ME=p(NE=>{"use strict";Object.defineProperty(NE,"__esModule",{value:!0})});var BE=p($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.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}};$d.Context=ap});var qE=p(Wi=>{"use strict";var tM=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.InstanceRequestSignatureV1Authentication=void 0;var nM=ue(),rM=Xd(),iM=BE(),op=class{constructor(t,n,r){this.instanceCredentials=t,this.userInstance=n,this.prolong=r,this.pre=i=>tM(this,void 0,void 0,function*(){rM.SignatureV1RequestSigner.sign(new iM.Context(i),this.instanceCredentials.applicationKey,this.instanceCredentials.username,this.instanceCredentials.instance.id,this.secret)}),this.secret=nM.Base64Helper.decode(t.instance.secret)}get credentials(){return this.instanceCredentials}get instance(){return this.userInstance}get id(){return this.userInstance.instance.id}};Wi.InstanceRequestSignatureV1Authentication=op});var kE=p(Hi=>{"use strict";var aM=Hi&&Hi.__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(Hi,"__esModule",{value:!0});Hi.JwtAuthentication=void 0;var sp=class{constructor(t){this.jwt=t,this.pre=n=>aM(this,void 0,void 0,function*(){n.init.headers.Authorization=`Bearer ${this.jwt}`})}};Hi.JwtAuthentication=sp});var LE=p(JE=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0})});var UE=p(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});jd.SignatureV1=void 0;var tn=ue(),$o=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(`
|
|
4
4
|
`),n.push(e.buildCanonicalURI(t.url.pathname)),n.push(`
|