genesys-cloud-streaming-client 18.0.1-develop.124 → 18.0.1-develop.125

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.
@@ -28,5 +28,5 @@ var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
28
28
  */
29
29
  n(9);var i=n(259),r=n(260),s=n(261);function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return l(this,e,t,n)}function l(e,t,n,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,n):new Uint8Array(t,n,i);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=h(e,t);return e}(e,t,n,i):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=0|f(t,n),r=(e=a(e,i)).write(t,n);r!==i&&(e=e.slice(0,r));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|p(t.length);return 0===(e=a(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(i=t.length)!=i?a(e,0):h(e,t);if("Buffer"===t.type&&s(t.data))return h(e,t.data)}var i;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(u(t),e=a(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|p(t.length);e=a(e,n);for(var i=0;i<n;i+=1)e[i]=255&t[i];return e}function p(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(e).length;default:if(i)return q(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function y(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,i)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){var s,o=1,a=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var u=-1;for(s=n;s<a;s++)if(l(e,s)===l(t,-1===u?0:s-u)){if(-1===u&&(u=s),s-u+1===c)return u*o}else-1!==u&&(s-=s-u),u=-1}else for(n+c>a&&(n=a-c),s=n;s>=0;s--){for(var d=!0,h=0;h<c;h++)if(l(e,s+h)!==l(t,h)){d=!1;break}if(d)return s}return-1}function b(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");i>s/2&&(i=s/2);for(var o=0;o<i;++o){var a=parseInt(t.substr(2*o,2),16);if(isNaN(a))return o;e[n+o]=a}return o}function _(e,t,n,i){return z(q(t,e.length-n),e,n,i)}function S(e,t,n,i){return z(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function w(e,t,n,i){return S(e,t,n,i)}function T(e,t,n,i){return z(U(t),e,n,i)}function I(e,t,n,i){return z(function(e,t){for(var n,i,r,s=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),i=n>>8,r=n%256,s.push(r),s.push(i);return s}(t,e.length-n),e,n,i)}function A(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var s,o,a,c,l=e[r],u=null,d=l>239?4:l>223?3:l>191?2:1;if(r+d<=n)switch(d){case 1:l<128&&(u=l);break;case 2:128==(192&(s=e[r+1]))&&(c=(31&l)<<6|63&s)>127&&(u=c);break;case 3:s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&(c=(15&l)<<12|(63&s)<<6|63&o)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(c=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,d=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|1023&u),i.push(u),r+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=4096));return n}(i)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return l(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,i){return u(t),t<=0?a(e,t):void 0!==n?"string"==typeof i?a(e,t).fill(n,i):a(e,t).fill(n):a(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return d(null,e)},c.allocUnsafeSlow=function(e){return d(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,r=0,s=Math.min(n,i);r<s;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!s(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=c.allocUnsafe(t),r=0;for(n=0;n<e.length;++n){var o=e[n];if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,r),r+=o.length}return i},c.byteLength=f,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?E(this,0,e):m.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,n,i,r){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(t>>>=0),a=Math.min(s,o),l=this.slice(i,r),u=e.slice(t,n),d=0;d<a;++d)if(l[d]!==u[d]){s=l[d],o=u[d];break}return s<o?-1:o<s?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},c.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":return S(this,e,t,n);case"latin1":case"binary":return w(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function x(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function C(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",s=t;s<n;++s)r+=B(e[s]);return r}function R(e,t,n){for(var i=e.slice(t,n),r="",s=0;s<i.length;s+=2)r+=String.fromCharCode(i[s]+256*i[s+1]);return r}function O(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,n,i,r,s){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<s)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function P(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,s=Math.min(e.length-n,2);r<s;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>8*(i?r:1-r)}function j(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,s=Math.min(e.length-n,4);r<s;++r)e[n+r]=t>>>8*(i?r:3-r)&255}function M(e,t,n,i,r,s){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,i,s){return s||M(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function D(e,t,n,i,s){return s||M(e,0,n,8),r.write(e,t,n,i,52,8),n+8}c.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var r=t-e;n=new c(r,void 0);for(var s=0;s<r;++s)n[s]=this[s+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var i=this[e],r=1,s=0;++s<t&&(r*=256);)i+=this[e+s]*r;return i},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},c.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var i=this[e],r=1,s=0;++s<t&&(r*=256);)i+=this[e+s]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var i=t,r=1,s=this[e+--i];i>0&&(r*=256);)s+=this[e+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},c.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||k(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[t]=255&e;++s<n&&(r*=256);)this[t+s]=e/r&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||k(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}var s=0,o=1,a=0;for(this[t]=255&e;++s<n&&(o*=256);)e<0&&0===a&&0!==this[t+s-1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);k(this,e,t,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var r,s=i-n;if(this===e&&n<t&&t<i)for(r=s-1;r>=0;--r)e[r+t]=this[r+n];else if(s<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r<s;++r)e[r+t]=this[r+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),t);return s},c.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var r=e.charCodeAt(0);r<256&&(e=r)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var s;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var o=c.isBuffer(e)?e:q(new c(e,i).toString()),a=o.length;for(s=0;s<n-t;++s)this[s+t]=o[s%a]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){var n;t=t||1/0;for(var i=e.length,r=null,s=[],o=0;o<i;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function U(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}).call(this,n(15))},function(e,t,n){"use strict";n(9),t.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,i=l(e),o=i[0],a=i[1],c=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),u=0,d=a>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=0,a=n-r;o<a;o+=16383)s.push(u(e,o,o+16383>a?a:o+16383));1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t){
30
30
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
31
- t.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=l}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,n,i,r,s){var o,a,c,l=8*s-r-1,u=(1<<l)-1,d=u>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;e[n+p]=255&o,p+=f,o/=256,l-=8);e[n+p-f]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){e||Object.defineProperty(window,"crypto",{value:window.crypto||window.msCrypto,writable:!1,configurable:!1})}).call(this,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Notifications=void 0;const i=n(264),r=n(16);function s(e,t){return[...e,...t].filter((e,t,n)=>n.indexOf(e)===t)}t.Notifications=class{constructor(e){this.subscriptions={},this.bulkSubscriptions={},this.topicPriorities={},this.client=e,e.on("pubsub:event",this.pubsubEvent.bind(this)),e.on("connected",this.subscriptionsKeepAlive.bind(this)),this.debouncedResubscribe=i(this.resubscribe.bind(this),100)}get pubsubHost(){try{return"notifications."+this.client.config.apiHost.replace(/http(s?):\/\//,"")}catch(e){return"notifications.mypurecloud.com"}}handleStanzaInstanceChange(e){const t=this.stanzaInstance&&this.stanzaInstance.id!==e.id&&this.stanzaInstance.channelId!==e.channelId;this.stanzaInstance=e,t&&(this.client.logger.info("resubscribing due to hard reconnect"),this.debouncedResubscribe())}topicHandlers(e){return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e]}pubsubEvent(e){let{pubsub:t}=e,n=t.items.node;n.includes("no_longer_subscribed")?n="no_longer_subscribed":n.includes("duplicate_id")&&(n="duplicate_id");const i=t.items.published[0].content.json,r=this.topicHandlers(n);this.client.emit("notify",{topic:n,data:i}),this.client.emit("notify:"+n,i),r.forEach(e=>{e(i)})}async xmppSubscribe(e){if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();const t=()=>this.stanzaInstance.subscribeToNode(this.pubsubHost,e);return this.client.connected?t():new Promise((e,n)=>{this.client.once("connected",()=>t().then(e,n))})}xmppUnsubscribe(e){if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();const t=()=>this.stanzaInstance.unsubscribeFromNode(this.pubsubHost,e);return this.client.connected?t():new Promise((e,n)=>{this.client.once("connected",()=>t().then(e,n))})}mapCombineTopics(e){const t={},n=[],i=[];e.forEach(e=>{e.includes("?")?n.push({id:e}):i.push(e)}),i.map(e=>{const t=e.split("."),n=t.splice(t.length-1);return{prefix:t.join("."),postfix:n}}).forEach(e=>{t[e.prefix]?t[e.prefix].push(e.postfix):t[e.prefix]=[e.postfix]});let r=[];const s=(e,t)=>{const n=`${e}${1===t.length?".":"?"}${t.join("&")}`;n.length<200?r.push({id:n}):1===t.length?this.client.logger.error("Refusing to attempt topic with length > 200",n):(s(e,t.slice(0,t.length/2)),s(e,t.slice(t.length/2)))};Object.keys(t).forEach(e=>{const n=t[e];s(e,n)});const o=r.concat(n);return this.truncateTopicList(this.prioritizeTopicList(o))}prioritizeTopicList(e){return e.sort((e,t)=>this.getTopicPriority(t.id)-this.getTopicPriority(e.id)),e}getTopicPriority(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{prefix:n,postfixes:i}=this.getTopicParts(e),r=this.topicPriorities[n],s=r&&Object.keys(r).filter(e=>i.includes(e)).map(e=>r[e]),o=s&&s.length&&s.reduce((e,t)=>t>e?t:e);return t?o||0:o}truncateTopicList(e){const t=e.slice(0,1e3);if(e.length>1e3){let t=e.slice(1e3);if(t.length>20){const e=t.length-20;t=t.slice(20),t.push(`...and ${e} more`)}this.client.logger.warn("Too many topics to subscribe to; truncating extra topics",{droppedTopics:t})}return t}makeBulkSubscribeRequest(e,t){const n={method:t.replace?"put":"post",host:this.client.config.apiHost,authToken:this.client.config.authToken,data:JSON.stringify(this.mapCombineTopics(e)),logger:this.client.logger},i=this.stanzaInstance.channelId;return this.client.http.requestApi(`notifications/channels/${i}/subscriptions`,n)}createSubscription(e,t){r.splitIntoIndividualTopics(e).forEach(e=>{let n=this.topicHandlers(e);n.includes(t)||n.push(t)})}removeSubscription(e,t){r.splitIntoIndividualTopics(e).forEach(e=>{let n=this.topicHandlers(e),i=n.indexOf(t);i>-1&&n.splice(i,1),n.length||delete this.subscriptions[e]})}removeTopicPriority(e){if(this.getTopicPriority(e,!1)){const{prefix:t,postfixes:n}=this.getTopicParts(e);n.forEach(e=>{delete this.topicPriorities[t][e]}),Object.keys(this.topicPriorities[t]).length||delete this.topicPriorities[t]}}getActiveIndividualTopics(){const e=[];return Object.keys(this.subscriptions).forEach(t=>{if("streaming-subscriptions-expiring"===t)return;this.topicHandlers(t).length>0&&e.push(t)}),e}resubscribe(){const e=Object.keys(this.bulkSubscriptions);return e.length+this.getActiveIndividualTopics().length===0?Promise.resolve():this.bulkSubscribe(e,{replace:!0})}subscriptionsKeepAlive(){const e="streaming-subscriptions-expiring";0===this.topicHandlers(e).length&&this.createSubscription(e,()=>{this.client.logger.info(e+" - Triggering resubscribe.",{channelId:this.client.config.channelId}),this.debouncedResubscribe().catch(e=>{const t="Error resubscribing to topics";this.client.logger.error(t,e),this.client.emit("pubsub:error",{msg:t,err:e})})})}getTopicParts(e){const t=e.includes("?"),n=t?"?":".",i=e.split(n),r=t?i[1]:i.splice(i.length-1),s=t?i[0]:i.join(".");let o=[];return o=t?r.split("&"):r,{prefix:s,postfixes:o}}setTopicPriorities(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(t=>{const n=this.getTopicParts(t),i=this.topicPriorities[n.prefix],r=e[t];if(i)n.postfixes.forEach(e=>{const t=i[e];(t&&t<r||!t)&&(i[e]=r)});else{const e=n.postfixes.reduce((e,t)=>(e[t]=r,e),{});this.topicPriorities[n.prefix]=e}})}subscribe(e,t,n,i){let r;return i&&this.setTopicPriorities({[e]:i}),r=n?this.xmppSubscribe(e):this.debouncedResubscribe(),t?this.createSubscription(e,t):this.bulkSubscriptions[e]=!0,r}unsubscribe(e,t,n){return t?this.removeSubscription(e,t):(delete this.bulkSubscriptions[e],delete this.subscriptions[e]),this.removeTopicPriority(e),n?this.xmppUnsubscribe(e):this.debouncedResubscribe()}async bulkSubscribe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{replace:!1,force:!1},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setTopicPriorities(n);let i=s(e,[]);t.replace&&!t.force?i=s(i,this.getActiveIndividualTopics()):t.force&&(this.subscriptions={}),await this.makeBulkSubscribeRequest(i,t),t.replace&&(this.bulkSubscriptions={}),e.forEach(e=>{this.bulkSubscriptions[e]=!0})}get expose(){return{subscribe:this.subscribe.bind(this),unsubscribe:this.unsubscribe.bind(this),bulkSubscribe:this.bulkSubscribe.bind(this)}}}},function(e,t,n){"use strict";function i(e){return"function"==typeof e?e():e}function r(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=void 0,o=void 0,a=void 0,c=[];return function(){var u=i(t),d=(new Date).getTime(),h=!s||d-s>u;s=d;for(var p=arguments.length,f=Array(p),m=0;m<p;m++)f[m]=arguments[m];if(h&&n.leading)return n.accumulate?Promise.resolve(e.call(this,[f])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(f)));if(o?clearTimeout(a):o=r(),c.push(f),a=setTimeout(l.bind(this),u),n.accumulate){var g=c.length-1;return o.promise.then((function(e){return e[g]}))}return o.promise};function l(){var t=o;clearTimeout(a),Promise.resolve(n.accumulate?e.call(this,c):e.apply(this,c[c.length-1])).then(t.resolve,t.reject),c=[],o=null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebrtcExtension=void 0;const i=n(26),r=n(10),s=n(13),o=n(268),a=n(8),c=n(28),l=i.__importDefault(n(273)),u=n(274),d=n(275),h=n(16),p=n(68),f=n(289),m=n(24),g=n(58),y=n(64),v=n(38),b="requestIncomingRtcSession",_="cancelIncomingRtcSession",S="handledIncomingRtcSession",w="incomingRtcSession",T="outgoingRtcSession",I="rtcSessionError";class A extends r.EventEmitter{constructor(e,t){super(),this.ignoredSessions=new o.LRUCache({max:10,ttl:216e3}),this.earlyIceCandidates=new o.LRUCache({max:10,ttl:6e4,ttlAutopurge:!0}),this.pendingSessions={},this.statsArr=[],this.throttleSendStatsInterval=25e3,this.currentMaxStatSize=15e3,this.statsSizeDecreaseAmount=3e3,this.statBuffer=0,this.discoRetries=0,this.iceServers=[],this.webrtcSessions=[],this.client=e,this.config={allowIPv6:!0===t.allowIPv6,optOutOfWebrtcStatsTelemetry:t.optOutOfWebrtcStatsTelemetry},this.logger=e.logger,this.addEventListeners(),this.throttledSendStats=l.default(this.sendStats.bind(this),this.throttleSendStatsInterval,{leading:!1,trailing:!0}),this.client.on("jingle:outgoing",e=>(this.logger.info("Emitting jingle:outgoing media-session (session-init)",e.sid),this.emit(T,e))),this.client.on("jingle:incoming",e=>(this.logger.info("Emitting jingle:incoming media-session (session-init)",e.sid),this.emit(w,e))),this.client.on("jingle:created",e=>{e instanceof g.StanzaMediaSession||e.end("cancel",!0)}),window.addEventListener("offline",()=>this.onOnlineStatusChange(!1)),window.addEventListener("online",()=>this.onOnlineStatusChange(!0))}get jid(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jid}onOnlineStatusChange(e){this.addStatToQueue({actionName:"WebrtcStats",details:{_eventType:"onlineStatus",_eventTimestamp:(new Date).getTime(),online:e}})}async handleStanzaInstanceChange(e){this.stanzaInstance=e,this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),e.on("iq:set:genesysWebrtc",this.handleGenesysWebrtcStanza.bind(this)),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.client.emit("sessionManagerChange",e)}async configureNewStanzaInstance(e){Object.assign(e.jingle.config.peerConnectionConfig,{sdpSemantics:"unified-plan"}),await this.configureStanzaIceServers(e),e.stanzas.define(d.definitions),e.jingle.prepareSession=this.prepareSession.bind(this),e.jingle.on("log",(e,t,n)=>{this.logger[e](t,n)});const t=["iceConnectionType","peerTrackAdded","peerTrackRemoved","mute","unmute","sessionState","connectionState","terminated","stats","endOfCandidates"];for(const n of t)e.jingle.on(n,(function(e){if(e instanceof g.StanzaMediaSession){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.emit(n,...i)}}))}configureStanzaIceServers(e){return e.jingle.config.iceServers=[],this.setIceServers([],e),this._refreshIceServers(e)}async handleGenesysOffer(e){const t=e.genesysWebrtc.params,n="relay"===this.getIceTransportPolicy()&&u.isFirefox,i={id:t.sessionId,logger:this.logger,peerID:e.from,fromJid:e.from,sessionType:this.getSessionTypeByJid(e.from),conversationId:t.conversationId,ignoreHostCandidatesFromRemote:n,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,allowIPv6:this.config.allowIPv6,iceServers:this.iceServers,reinvite:!!t.reinvite,iceTransportPolicy:this.getIceTransportPolicy()};let r;const s=this.pendingSessions[t.sessionId];r=s?{...i,meetingId:s.meetingId,fromUserId:s.fromUserId,originalRoomJid:s.originalRoomJid,privAnswerMode:s.privAnswerMode}:i;const o=this.webrtcSessions.find(e=>e.id===r.id);if(this.logger.info("offer received",{existingSession:!!o,mediaSessionParams:r}),o&&(o.conversationId=t.conversationId,!h.iceIsDifferent(o.peerConnection.remoteDescription.sdp,t.sdp)))return this.handleGenesysRenegotiate(o,t.sdp);const a=new y.GenesysCloudMediaSession(this,r);return await a.setRemoteDescription(t.sdp),this.proxyStatsForSession(a),a.on("sendIq",e=>{var t;return null===(t=this.stanzaInstance)||void 0===t?void 0:t.sendIQ(e)}),a.on("terminated",()=>{this.webrtcSessions=this.webrtcSessions.filter(e=>e.id!==a.id)}),this.webrtcSessions.push(a),this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(a),this.emit(w,a)}applyEarlyIceCandidates(e){const t=this.earlyIceCandidates.get(e.id);if(t){this.earlyIceCandidates.delete(e.id);for(const n of t)e.addRemoteIceCandidate(n)}}async handleGenesysRenegotiate(e,t){await e.peerConnection.setRemoteDescription({sdp:t,type:"offer"}),await e.accept()}async handleGenesysIceCandidate(e){const t=e.genesysWebrtc.params,n=this.getSessionById(t.sessionId,!0);if(n)await n.addRemoteIceCandidate(t.sdp);else{const e=this.earlyIceCandidates.get(t.sessionId);e?this.earlyIceCandidates.set(t.sessionId,[...e,t.sdp]):this.earlyIceCandidates.set(t.sessionId,[t.sdp])}}async handleGenesysTerminate(e){const t=e.genesysWebrtc.params;this.getSessionById(t.sessionId).onSessionTerminate(t.reason)}getSessionById(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getAllSessions().find(t=>t.id===e);if(!n&&!t){const t=new Error("Failed to find session by id");throw this.logger.error(t,{sessionId:e}),t}return n}async sendIq(e){if(!this.stanzaInstance)throw new Error("Failed to send iq because there was no stanza instance");return this.stanzaInstance.sendIQ(e)}async handleMessage(e){e.propose?await this.handlePropose(e):e.retract?this.handleRetract(e.retract.sessionId):e.accept?this.handledIncomingRtcSession(e.accept.sessionId,e):e.reject&&this.handledIncomingRtcSession(e.reject.sessionId,e)}async handleGenesysWebrtcStanza(e){const t=e.genesysWebrtc;return"offer"===t.method?this.handleGenesysOffer(e):"iceCandidate"===t.method?this.handleGenesysIceCandidate(e):"terminate"===t.method?this.handleGenesysTerminate(e):void 0}prepareSession(e){const t=this.pendingSessions[e.sid];if(t&&delete this.pendingSessions[t.sessionId],null==t?void 0:t.sdpOverXmpp)return void this.logger.debug("skipping creation of jingle webrtc session due to sdpOverXmpp on the pendingSession");const n="relay"===this.getIceTransportPolicy()&&u.isFirefox,i={options:e,logger:this.logger,id:e.sid,fromJid:e.peerID,peerID:e.peerID,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,conversationId:null==t?void 0:t.conversationId,fromUserId:null==t?void 0:t.fromJid,originalRoomJid:null==t?void 0:t.originalRoomJid,sessionType:null==t?void 0:t.sessionType,allowIPv6:this.config.allowIPv6,ignoreHostCandidatesFromRemote:n,meetingId:null==t?void 0:t.meetingId},r=new g.StanzaMediaSession(i);return this.proxyStatsForSession(r),r}proxyStatsForSession(e){e.on("stats",t=>{const n=JSON.parse(JSON.stringify(t)),i={conversationId:e.conversationId,sessionId:e.id,sessionType:e.sessionType},r=f.formatStatsEvent(n,i);this.addStatToQueue(r)})}addStatToQueue(e){if(this.config.optOutOfWebrtcStatsTelemetry)return;e.details._appId||(e.details._appId=this.logger.clientId,e.details._appName="streamingclient",e.details._appVersion=p.Client.version),e.details._originAppId=this.client.config.appId;const t=f.deepFlatten(e.details);Object.keys(t).forEach(e=>{const n=t[e];"boolean"==typeof n&&(t[e]=""+n)});const n={...e,details:t},i=h.calculatePayloadSize(n),r=this.statBuffer+i>this.currentMaxStatSize;this.statsArr.push(n),this.statBuffer+=i,r?this.sendStatsImmediately():this.throttledSendStats()}getLogDetailsForPendingSessionId(e){const t={sessionId:e},n=this.pendingSessions[e];return n&&(t.sessionType=n.sessionType,t.conversationId=n.conversationId),t}sendStatsImmediately(){this.throttledSendStats(),this.throttledSendStats.flush()}async sendStats(){var e,t;if(!navigator.onLine)return;const n=[];let i=0;for(const e of this.statsArr){const t=h.calculatePayloadSize(e);if(!(i+t<this.currentMaxStatSize))break;n.push(e),i+=t}if(this.statsArr.splice(0,n.length),this.statBuffer=this.statsArr.reduce((e,t)=>e+h.calculatePayloadSize(t),0),!n.length||this.client.isGuest)return;const r={appName:"streamingclient",appVersion:p.Client.version,originAppName:this.client.config.appName,originAppVersion:this.client.config.appVersion,actions:n};try{let e=this.client.config.authToken,t="diagnostics/newrelic/insights";this.client.backgroundAssistantMode&&(e=this.client.config.jwt,t+="/backgroundassistant"),await this.client.http.requestApi(t,{method:"post",responseType:"text",host:this.client.config.apiHost,authToken:e,logger:this.client.logger,data:r}),this.currentMaxStatSize=15e3}catch(i){if(!v.HttpClient.retryStatusCodes.has(null===(e=i.response)||void 0===e?void 0:e.status)&&navigator.onLine||(this.statsArr=[...n,...this.statsArr],this.statBuffer=this.statsArr.reduce((e,t)=>e+h.calculatePayloadSize(t),0)),413===(null===(t=i.response)||void 0===t?void 0:t.status)){const e=this.currentMaxStatSize;this.currentMaxStatSize-=this.statsSizeDecreaseAmount,this.logger.info("Failed to send stats due to 413, retrying with smaller set",{attemptedPayloadSize:e,newPayloadSize:this.currentMaxStatSize}),await this.sendStats()}else this.logger.error("Failed to send stats",{err:i,numberOfFailedStats:n.length},{skipServer:!navigator.onLine})}}addEventListeners(){this.client.on("connected",()=>(this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.refreshIceServers().catch(e=>this.logger.error("Error fetching ice servers after streaming-client connected",{error:e,channelId:this.client.config.channelId})))),this.client.on("disconnected",()=>{clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null})}async handlePropose(e){if(e.from===this.jid)return;const t=e.propose.sessionId;let n=this.pendingSessions[t];const i=!!n,r=this.getSessionTypeByJid(e.from),s={sessionId:t,conversationId:e.propose.conversationId,sessionType:r,isDuplicatePropose:i};if(this.logger.info("propose received",s),!i){const{appId:i}=this.client.config,o={actionName:"WebrtcStats",details:{_eventTimestamp:(new Date).getTime(),_eventType:"firstPropose",conversationId:s.conversationId,sdpViaXmppRequested:!!e.propose.sdpOverXmpp,sessionId:t,sessionType:r}};this.addStatToQueue(o);const a=e.from,c=a;e.propose.originalRoomJid=e.propose.originalRoomJid||c,n={...e.propose,toJid:e.to,fromJid:a,sessionType:r,roomJid:c,id:t,sdpOverXmpp:e.propose.sdpOverXmpp,privAnswerMode:e.propose.privAnswerMode},this.pendingSessions[t]=n}if(n.accepted)return this.logger.info("proceed already sent for this session, but sending another",s),void await this.acceptRtcSession(t);this.emit(b,Object.assign(n))}handleRetract(e){return this.logger.info("retract received",this.getLogDetailsForPendingSessionId(e)),delete this.pendingSessions[e],this.emit(_,e)}handledIncomingRtcSession(e,t){let n=t.accept?"accept":"reject";return this.logger.info(n+" received",this.getLogDetailsForPendingSessionId(e)),this.emit(S,e)}async initiateRtcSession(e){const t={to:e.jid,propose:{id:c.v4(),descriptions:[]}};if(e.stream)for(let n of Array.from(e.stream.getTracks()))t.propose.descriptions.push({media:n.kind});if(e.provideVideo){t.propose.descriptions.filter(e=>"video"===e.media).length>0||t.propose.descriptions.push({media:"video"})}if(e.provideAudio){t.propose.descriptions.filter(e=>"audio"===e.media).length>0||t.propose.descriptions.push({media:"audio"})}if(e.mediaPurpose&&t.propose.descriptions.push({media:e.mediaPurpose}),e.jid&&e.jid.match(/@conference/)){let n=t.propose.descriptions;0===n.length&&(n=[{media:"listener"}]);const i={type:"upgradeMedia",to:e.jid,id:c.v4(),from:this.jid,media:{conversationId:e.conversationId,sourceCommunicationId:e.sourceCommunicationId}};for(const e of n)i.media[e.media]=!0;await this.stanzaInstance.send("presence",i)}else await this.stanzaInstance.send("message",t),this.pendingSessions[t.propose.id]=t;return t.propose.id}async acceptRtcSession(e){const t=this.pendingSessions[e];if(!t)return void this.emit(I,"Cannot accept session because it is not pending or does not exist");const n={to:t.fromJid,proceed:{sessionId:e}};t.accepted=!0;const i=this.getLogDetailsForPendingSessionId(e);this.logger.info("sending jingle proceed",i),await this.stanzaInstance.send("message",n),this.logger.info("sent jingle proceed",i)}async rejectRtcSession(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getLogDetailsForPendingSessionId(e),i=this.pendingSessions[e];if(i)if(delete this.pendingSessions[e],t)this.ignoredSessions.set(e,!0);else{const t={to:s.toBare(this.jid),reject:{sessionId:e}},r=this.stanzaInstance.send("message",t),o={to:i.fromJid,reject:{sessionId:e}},a=this.stanzaInstance.send("message",o);this.logger.info("sending jingle reject",n),await Promise.all([r,a]),this.logger.info("sent jingle reject",n)}else this.emit(I,"Cannot reject session because it is not pending or does not exist")}async rtcSessionAccepted(e){this.pendingSessions[e];const t=this.getLogDetailsForPendingSessionId(e),n={to:s.toBare(this.jid),accept:{sessionId:e}};this.logger.info("sending session-info:accept",t),await this.stanzaInstance.send("message",n),this.logger.info("sent session-info:accept",t)}async notifyScreenShareStart(e){return this.stanzaInstance.send("iq",{to:""+e.peerID,from:this.jid,type:"set",jingle:{action:a.JingleAction.SessionInfo,sid:e.id,screenstart:{}}})}async notifyScreenShareStop(e){return this.stanzaInstance.send("iq",{to:""+e.peerID,from:this.jid,type:"set",jingle:{action:a.JingleAction.SessionInfo,sid:e.id,screenstop:{}}})}async cancelRtcSession(e){const t=this.pendingSessions[e],n=this.getLogDetailsForPendingSessionId(e);if(!t)return void this.emit(I,"Cannot cancel session because it is not pending or does not exist");const i={to:t.toJid,retract:{sessionId:e}};delete this.pendingSessions[e],this.logger.info("sending jingle retract",n),await this.stanzaInstance.send("message",i),this.logger.info("sent jingle retract",n)}async refreshIceServers(){return this.refreshIceServersRetryPromise||(this.refreshIceServersRetryPromise=h.retryPromise(this._refreshIceServers.bind(this,this.stanzaInstance),e=>++this.discoRetries>2?(this.logger.warn("fetching ice servers failed. max retries reached.",{retryAttempt:this.discoRetries,MAX_DISCO_RETRIES:2,error:e,channelId:this.client.config.channelId}),!1):(this.logger.warn("fetching ice servers failed. retrying",{retryAttempt:this.discoRetries,error:e,channelId:this.client.config.channelId}),!0),0,this.client.logger)),this.refreshIceServersRetryPromise.promise.finally(()=>{this.discoRetries=0,this.refreshIceServersRetryPromise=void 0})}async _refreshIceServers(e){if(!e)throw new Error("No stanza instance to refresh ice servers");const t=e.config.server,n=e.getServices(t,"turn","1"),i=e.getServices(t,"stun","1"),r=new Promise((e,t)=>{setTimeout(()=>{t(new Error("Timeout waiting for refresh ice servers to finish"))},15e3),Promise.all([n,i]).then(t=>{let[n,i]=t;e([n,i])}).catch(t)}),[s,o]=await r,a=[...s.services,...o.services].map(e=>{const t=e.port?":"+e.port:"",n={type:e.type,urls:`${e.type}:${e.host}${t}`};return["turn","turns"].includes(e.type)&&(e.transport&&"udp"!==e.transport&&(n.urls+="?transport="+e.transport),e.username&&(n.username=e.username),e.password&&(n.credential=e.password)),n});return this.setIceServers(a,e),o.services.length?this.setIceTransportPolicy("all",e):(this.logger.info('No stun servers received, setting iceTransportPolicy to "relay"'),this.setIceTransportPolicy("relay",e)),a}setIceServers(e,t){t.jingle.iceServers=e,this.iceServers=e}getIceTransportPolicy(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.config.peerConnectionConfig.iceTransportPolicy}setIceTransportPolicy(e,t){t.jingle.config.peerConnectionConfig.iceTransportPolicy=e}getSessionTypeByJid(e){return h.isAcdJid(e)?m.SessionTypes.acdScreenShare:h.isScreenRecordingJid(e)?m.SessionTypes.screenRecording:h.isSoftphoneJid(e)?m.SessionTypes.softphone:h.isVideoJid(e)?m.SessionTypes.collaborateVideo:m.SessionTypes.unknown}getSessionManager(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle}getAllSessions(){var e;const t=null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.sessions;return[...t&&Object.values(t)||[],...this.webrtcSessions]}proxyNRStat(e){this.addStatToQueue(e)}get expose(){return{on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeAllListeners:this.removeAllListeners.bind(this),removeListener:this.removeListener.bind(this),refreshIceServers:this.refreshIceServers.bind(this),acceptRtcSession:this.acceptRtcSession.bind(this),rejectRtcSession:this.rejectRtcSession.bind(this),cancelRtcSession:this.cancelRtcSession.bind(this),notifyScreenShareStart:this.notifyScreenShareStart.bind(this),notifyScreenShareStop:this.notifyScreenShareStop.bind(this),rtcSessionAccepted:this.rtcSessionAccepted.bind(this),initiateRtcSession:this.initiateRtcSession.bind(this),getSessionTypeByJid:this.getSessionTypeByJid.bind(this),getSessionManager:this.getSessionManager.bind(this),getAllSessions:this.getAllSessions.bind(this),proxyNRStat:this.proxyNRStat.bind(this)}}}t.WebrtcExtension=A},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_DATA=void 0,t.TABLE_DATA={"A.1":{r:"hk:if|le:lf|nf:nv|qg:qv|rg:rj|rm:rp|rr:rt|rv:s3|vn:vv|17m:17n|17q:17v|18g:19g|1an:1ao|1cb:1cg|1e5:1ef|1fb:1ff|1fl:1gb|1gd:1gq|1gs:1gu|1hr:1hv|1im:1iv|1ne:1nf|1pd:1pf|1qb:1rv|1ti:280|29q:29r|2ae:2af|2al:2an|2bh:2c0|2cd:2ce|2ch:2ci|2dj:2dl|2dq:2dr|2e5:2e6|2e9:2ea|2ee:2em|2eo:2er|2f4:2f5|2fr:2g1|2g3:2g4|2gb:2ge|2gh:2gi|2hq:2hr|2i3:2i6|2i9:2ia|2ie:2io|2iv:2j5|2jl:2k0|2lq:2lr|2me:2mf|2mh:2mv|2n1:2n5|2ng:2o0|2od:2oe|2oh:2oi|2pk:2pl|2pq:2pr|2q4:2q6|2q9:2qa|2qe:2ql|2qo:2qr|2r2:2r5|2rh:2s1|2sb:2sd|2sm:2so|2t0:2t2|2t5:2t7|2tb:2td|2tq:2tt|2u3:2u5|2ue:2um|2uo:2v6|2vj:300|31q:31t|32e:32k|32n:32v|332:335|33g:341|35q:35t|36e:36k|36n:36t|372:375|37g:381|39q:39t|3a4:3a5|3ae:3am|3ao:3av|3b2:3b5|3bg:3c1|3cn:3cp|3du:3dv|3e7:3e9|3eb:3ee|3f0:3fh|3fl:3g0|3hr:3hu|3is:3k0|3k5:3k6|3kb:3kc|3ke:3kj|3l8:3l9|3lu:3lv|3me:3mf|3mq:3mr|3mu:3nv|3rb:3rg|3sc:3sf|3ud:3ue|3ug:3vv|41j:41l|41q:41v|42q:44v|466:46f|47p:47q|47s:47v|4aq:4au|4d3:4d7|4fq:4fv|4ie:4if|4iu:4iv|4ke:4kf|4lm:4ln|4m6:4m7|4om:4on|4qr:4r0|4rt:4sv|4vl:500|5jn:5jv|5kt:5kv|5nh:5nv|5ol:5ov|5pn:5pv|5qk:5qv|5rk:5rv|5ut:5uv|5va:5vv|60q:60v|63o:63v|65a:7fv|7ks:7kv|7nq:7nv|7om:7on|7ou:7ov|7q6:7q7|7qe:7qf|7ru:7rv|7uk:7ul|7vg:7vh|82j:82m|82o:82u|834:839|83i:83j|84f:84v|85i:86f|87b:87v|89r:89s|8ac:8ai|8c4:8cf|8uf:8vv|917:91v|92b:92v|9gk:9gl|9ju:9jv|9ka:9o0|9oa:9ob|9qj:9ql|9qv:9r0|9sl:9sn|9tv:9uf|9vc:9vf|ao0:bjv|bnk:bnv|bum:bvf|bvs:bvv|c4n:c4o|c80:c84|c9d:c9g|cdo:cff|cgt:cgv|ci4:cig|cjs:cju|cmc:cmf|crn:crq|cuu:cuv|jdm:jfv|17t6:17vv|194d:194f|1967:1avv|1lt4:1lvv|1uhe:1uhf|1ujb:1unv|1uo7:1uoi|1uoo:1uos|1uti:1uui|1va0:1vaf|1vcg:1vch|1ve8:1vef|1vft:1vfv|1vgg:1vgv|1vh4:1vhf|1vi7:1vi8|1vjc:1vjf|1vnt:1vnu|1vtv:1vu1|1vu8:1vu9|1vug:1vuh|1vuo:1vup|1vut:1vuv|1vvf:1vvo|2000:20nv|20p4:20pf|20qb:20vv|2116:2117|212e:3jvv|3k7m:3k7v|3k97:3k99|3keu:3kvv|3l50:3l51|3l53:3l54|3l57:3l58|3l8b:3l8c|3la7:3la9|3ll4:3ll7|3lua:3lud|3m00:3vvt|59mn:5tvv|5ugu:5vvt|6000:7vvt|8000:9vvt|a000:bvvt|c000:dvvt|e000:fvvt|g000:hvvt|i000:jvvt|k000:lvvt|m000:nvvt|o000:pvvt|q000:rvvt|s002:s00v|s040:tvvt",s:"9p8|9qc|9qe|9qn|9tg|147|bkq|3l2l|3l4t|3l5d|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13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl|ds|ed|ef|eh|ej|el|en|ep|er|eu|f0|f2|f4|f6|f8|fa|fc|fe|fk|fq|fs|fu|g0|g2|g4|g6|g8|ga|gc|ge|gg|gi|gk|gm|go|gq|gs|gu|h0|h2|h4|h6|h8|ha|hc|he|hg|hi|21|22|7g0|7g2|7g4|7g6|7g8|7ga|7gc|7ge|7gg|7gi|2d|7gk|7gm|7go|7gq|7gs|7gu|7h0|7h2|7h4|7h6|7h8|7ha|7hc|7he|7hg|7hi|7hk|7hm|7ho|7hq|7hs|7hu|7i0|7i2|7i4|7i6|7i8|7ia|7ic|7ie|7ig|7ii|7ik|7im|7io|7iq|7is|7iu|7j0|7j2|7j4|7j6|7j8|7ja|7jc|7je|7jg|7ji|7jk|7jm|2e|7jo|7jq|7js|7ju|7k0|7k2|7k4|7k6|7k8|7ka|7kc|7ke|7kg|7ki|7kk|7l0|7l2|7l4|7l6|7l8|7la|7lc|7le|7lg|7li|7lk|7lm|7lo|7lq|7ls|7lu|7m0|7m2|7m4|7m6|7m8|7ma|7mc|7me|7mg|7mi|7mk|7mm|7mo|7mq|2f|7ms|7mu|7n0|7n2|7n4|7n6|7n8|7na|7nc|7ne|7ng|7ni|7nk|7nm|7no|2g|7qp|7qr|7qt|7qv|2h|896|2l|s6|sc|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7:u5;o8;q2|7vi:7rs;tp|7vj:u9;tp|7vk:ue;tp|7vm:u9;q2|7vn:u9;q2;tp|7vs:u9;tp|1uo0:36;36|1uo1:36;39|1uo2:36;3c|1uo3:36;36;39|1uo4:36;36;3c|1uo5:3j;3k|1uo6:3j;3k|1uoj:1bk;1bm|1uok:1bk;1b5|1uol:1bk;1bb|1uom:1bu;1bm|1uon:1bk;1bd",r:"23:2c|2i:2k|2m:2q|60:6m|6o:6u|bo:bp|c1:c2|c6:c7|c9:cb|ce:ch|cj:ck|cm:co|cs:ct|cv:d0|d6:d7|de:df|dh:dj|dn:do|e4:e5|e7:e8|ea:eb|fh:fi|fm:fo|s8:sa|se:sf|sh:t1|t3:tb|100:11f|19h:1am|7o8:7of|7oo:7ot|7p8:7pf|7po:7pv|7q8:7qd|7r8:7rf|7to:7tr|7u8:7ub|7uo:7ur|7v8:7vc|7vo:7vr|89a:89b|8b0:8bf|95m:96f|1vp1:1vpq|2100:2115",s:"v8|va|vc|ve|vk|130|132|134|136|138|13a|13c|13e|13g|13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl|ds|ed|ef|eh|ej|el|en|ep|er|eu|f0|f2|f4|f6|f8|fa|fc|fe|fk|fq|fs|fu|g0|g2|g4|g6|g8|ga|gc|ge|gg|gi|gk|gm|go|gq|gs|gu|h0|h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.9":{r:"s010:s03v",s:"s001"},"D.1":{r:"1eg:1fa|1fg:1fk|1h1:1hq|1i0:1ia|1jd:1jf|1jh:1ml|1n5:1n6|1nq:1nu|1o0:1od|1oi:1pc|1s0:1t5|1uov:1up8|1upa:1upm|1upo:1ups|1uq0:1uq1|1uq3:1uq4|1uq6:1uth|1uuj:1v9t|1vag:1vcf|1vci:1ve7|1vfg:1vfs|1vjg:1vjk|1vjm:1vns",s:"1du|1e0|1e3|1gr|1gv|1mt|1og|1th|1uot|1upu|80f"},"D.2":{r:"21:2q|31:3q|60:6m|6o:7m|7o:h0|h2:hj|ig:ld|lg:lo|lr:m1|mg:mh|n0:n4|s8:sa|se:t1|t3:ue|ug:vl|100:142|14a:16e|16g:17l|17o:17p|180:18f|19h:1am|1ap:1av|1b1:1c7|285:29p|29t:2a0|2a9:2ac|2ao:2b1|2b4:2bg|2c2:2c3|2c5:2cc|2cf:2cg|2cj:2d8|2da:2dg|2dm:2dp|2du:2e0|2e7:2e8|2eb:2ec|2es:2et|2ev:2f1|2f6:2fh|2fk:2fq|2g5:2ga|2gf:2gg|2gj:2h8|2ha:2hg|2hi:2hj|2hl:2hm|2ho:2hp|2hu:2i0|2ip:2is|2j6:2jf|2ji:2jk|2k5:2kb|2kf:2kh|2kj:2l8|2la:2lg|2li:2lj|2ll:2lp|2lt:2m0|2mb:2mc|2n6:2nf|2o2:2o3|2o5:2oc|2of:2og|2oj:2p8|2pa:2pg|2pi:2pj|2pm:2pp|2pt:2pu|2q7:2q8|2qb:2qc|2qs:2qt|2qv:2r1|2r6:2rg|2s5:2sa|2se:2sg|2si:2sl|2sp:2sq|2su:2sv|2t3:2t4|2t8:2ta|2te:2tl|2tn:2tp|2tu:2tv|2u1:2u2|2u6:2u8|2ua:2uc|2v7:2vi|301:303|305:30c|30e:30g|30i:318|31a:31j|31l:31p|321:324|330:331|336:33f|342:343|345:34c|34e:34g|34i:358|35a:35j|35l:35p|360:364|367:368|36a:36b|36l:36m|370:371|376:37f|382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uhd|1uhg:1uja|1uo0:1uo6|1uoj:1uon|1vp1:1vpq|1vq1:1vqq|1vr6:1vtu|1vu2:1vu7|1vua:1vuf|1vui:1vun|1vuq:1vus|20o0:20ou|20p0:20p3|20pg:20qa|2100:2115|2118:212d|3k00:3k7l|3k80:3k96|3k9a:3kb6|3kba:3kbi|3kc3:3kc4|3kcc:3kd9|3kde:3ket|3l00:3l2k|3l2m:3l4s|3l4u:3l4v|3l55:3l56|3l59:3l5c|3l5e:3l5p|3l5t:3l60|3l62:3l63|3l65:3l85|3l87:3l8a|3l8d:3l8k|3l8m:3l8s|3l8u:3l9p|3l9r:3l9u|3la0:3la4|3laa:3lag|3lai:3ll3|3ll8:3lu9|4000:59mm|5u00:5ugt|u000:vvvt|10000:11vvt",s:"3l52|3l5r|3la6|1c9|5a|5l|5q|283|2ag|2di|2en|2iu|2k3|2kd|2m9|2mg|2n0|2q0|2qn|2s3|2ss|2un|35u|36u|3an|3dt|3k4|3ka|3kd|3l5|3l7|3lt|3m6|3pm|3po|3rv|3s5|3uf|41c|41h|41o|47r|4i8|4io|4k8|4lg|4m0|4og|5us|ne|7qp|7qr|7qt|7tu|80e|83h|83v|882|887|88l|894|896|898|rq|s6|sc|8sl"}}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"LRUCache",(function(){return ge}));n(9);var i=n(4),r=n.n(i),s=n(0),o=n.n(s),a=n(7),c=n.n(a);function l(e,t){d(e,t),t.add(e)}function u(e,t,n){d(e,t),t.set(e,n)}function d(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function p(e,t,n,i){return m(e,t),f(n,"set"),function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,n,i),i}function f(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function m(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}const g="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,y=new Set,v="object"==typeof e&&e?e:{},b=(e,t,n,i)=>{"function"==typeof v.emitWarning?v.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let _=globalThis.AbortController,S=globalThis.AbortSignal;if(void 0===_){var w;S=class{constructor(){c()(this,"onabort",void 0),c()(this,"_onabort",[]),c()(this,"reason",void 0),c()(this,"aborted",!1)}addEventListener(e,t){this._onabort.push(t)}},_=class{constructor(){c()(this,"signal",new S),t()}abort(e){var t,n;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);null===(t=(n=this.signal).onabort)||void 0===t||t.call(n,e)}}};let e="1"!==(null===(w=v.env)||void 0===w?void 0:w.LRU_CACHE_IGNORE_AC_WARNING);const t=()=>{e&&(e=!1,b("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const T=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),I=e=>T(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?A:null:null;class A extends Array{constructor(e){super(e),this.fill(0)}}class E{static create(e){const t=I(e);if(!t)return[];p(E,E,N,!0);const n=new E(e,t);return p(E,E,N,!1),n}constructor(e,t){if(c()(this,"heap",void 0),c()(this,"length",void 0),i=N,m(n=E,E),f(i,"get"),!function(e,t){return t.get?t.get.call(e):t.value}(n,i))throw new TypeError("instantiate Stack using Stack.create(n)");var n,i;this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}var N={writable:!0,value:!1},x=new WeakMap,C=new WeakMap,R=new WeakMap,O=new WeakMap,k=new WeakMap,P=new WeakMap,j=new WeakMap,M=new WeakMap,L=new WeakMap,D=new WeakMap,F=new WeakMap,B=new WeakMap,q=new WeakMap,U=new WeakMap,z=new WeakMap,J=new WeakMap,G=new WeakMap,H=new WeakMap,V=new WeakMap,W=new WeakMap,$=new WeakMap,Q=new WeakMap,K=new WeakMap,Y=new WeakSet,X=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakSet,ie=new WeakMap,re=new WeakMap,se=new WeakMap,oe=new WeakSet,ae=new WeakSet,ce=new WeakSet,le=new WeakSet,ue=new WeakSet,de=new WeakSet,he=new WeakSet,pe=new WeakSet,fe=new WeakSet,me=new WeakSet;class ge{static unsafeExposeInternals(e){return{starts:o()(e,V),ttls:o()(e,W),sizes:o()(e,H),keyMap:o()(e,L),keyList:o()(e,D),valList:o()(e,F),next:o()(e,B),prev:o()(e,q),get head(){return o()(e,U)},get tail(){return o()(e,z)},free:o()(e,J),isBackgroundFetch:t=>h(e,de,Ie).call(e,t),backgroundFetch:(t,n,i,r)=>h(e,ue,Te).call(e,t,n,i,r),moveToTail:t=>h(e,pe,Ee).call(e,t),indexes:t=>h(e,oe,be).call(e,t),rindexes:t=>h(e,ae,_e).call(e,t),isStale:t=>o()(e,te).call(e,t)}}get max(){return o()(this,x)}get maxSize(){return o()(this,C)}get calculatedSize(){return o()(this,M)}get size(){return o()(this,j)}get fetchMethod(){return o()(this,k)}get memoMethod(){return o()(this,P)}get dispose(){return o()(this,R)}get disposeAfter(){return o()(this,O)}constructor(e){l(this,me),l(this,fe),l(this,pe),l(this,he),l(this,de),l(this,ue),l(this,le),l(this,ce),l(this,ae),l(this,oe),l(this,ne),l(this,Y),u(this,x,{writable:!0,value:void 0}),u(this,C,{writable:!0,value:void 0}),u(this,R,{writable:!0,value:void 0}),u(this,O,{writable:!0,value:void 0}),u(this,k,{writable:!0,value:void 0}),u(this,P,{writable:!0,value:void 0}),c()(this,"ttl",void 0),c()(this,"ttlResolution",void 0),c()(this,"ttlAutopurge",void 0),c()(this,"updateAgeOnGet",void 0),c()(this,"updateAgeOnHas",void 0),c()(this,"allowStale",void 0),c()(this,"noDisposeOnSet",void 0),c()(this,"noUpdateTTL",void 0),c()(this,"maxEntrySize",void 0),c()(this,"sizeCalculation",void 0),c()(this,"noDeleteOnFetchRejection",void 0),c()(this,"noDeleteOnStaleGet",void 0),c()(this,"allowStaleOnFetchAbort",void 0),c()(this,"allowStaleOnFetchRejection",void 0),c()(this,"ignoreFetchAbort",void 0),u(this,j,{writable:!0,value:void 0}),u(this,M,{writable:!0,value:void 0}),u(this,L,{writable:!0,value:void 0}),u(this,D,{writable:!0,value:void 0}),u(this,F,{writable:!0,value:void 0}),u(this,B,{writable:!0,value:void 0}),u(this,q,{writable:!0,value:void 0}),u(this,U,{writable:!0,value:void 0}),u(this,z,{writable:!0,value:void 0}),u(this,J,{writable:!0,value:void 0}),u(this,G,{writable:!0,value:void 0}),u(this,H,{writable:!0,value:void 0}),u(this,V,{writable:!0,value:void 0}),u(this,W,{writable:!0,value:void 0}),u(this,$,{writable:!0,value:void 0}),u(this,Q,{writable:!0,value:void 0}),u(this,K,{writable:!0,value:void 0}),u(this,X,{writable:!0,value:()=>{}}),u(this,Z,{writable:!0,value:()=>{}}),u(this,ee,{writable:!0,value:()=>{}}),u(this,te,{writable:!0,value:()=>!1}),u(this,ie,{writable:!0,value:e=>{}}),u(this,re,{writable:!0,value:(e,t,n)=>{}}),u(this,se,{writable:!0,value:(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}}),c()(this,Symbol.toStringTag,"LRUCache");const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:v,maxSize:_=0,maxEntrySize:S=0,sizeCalculation:w,fetchMethod:A,memoMethod:N,noDeleteOnFetchRejection:be,noDeleteOnStaleGet:_e,allowStaleOnFetchRejection:Se,allowStaleOnFetchAbort:we,ignoreFetchAbort:Te}=e;if(0!==t&&!T(t))throw new TypeError("max option must be a nonnegative integer");const Ie=t?I(t):Array;if(!Ie)throw new Error("invalid max value: "+t);if(r()(this,x,t),r()(this,C,_),this.maxEntrySize=S||o()(this,C),this.sizeCalculation=w,this.sizeCalculation){if(!o()(this,C)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==N&&"function"!=typeof N)throw new TypeError("memoMethod must be a function if defined");if(r()(this,P,N),void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(r()(this,k,A),r()(this,Q,!!A),r()(this,L,new Map),r()(this,D,new Array(t).fill(void 0)),r()(this,F,new Array(t).fill(void 0)),r()(this,B,new Ie(t)),r()(this,q,new Ie(t)),r()(this,U,0),r()(this,z,0),r()(this,J,E.create(t)),r()(this,j,0),r()(this,M,0),"function"==typeof f&&r()(this,R,f),"function"==typeof m?(r()(this,O,m),r()(this,G,[])):(r()(this,O,void 0),r()(this,G,void 0)),r()(this,$,!!o()(this,R)),r()(this,K,!!o()(this,O)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!be,this.allowStaleOnFetchRejection=!!Se,this.allowStaleOnFetchAbort=!!we,this.ignoreFetchAbort=!!Te,0!==this.maxEntrySize){if(0!==o()(this,C)&&!T(o()(this,C)))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,ne,ve).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!_e,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=T(i)||0===i?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,Y,ye).call(this)}if(0===o()(this,x)&&0===this.ttl&&0===o()(this,C))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!o()(this,x)&&!o()(this,C)){const e="LRU_CACHE_UNBOUNDED";if((e=>!y.has(e))(e)){y.add(e);b("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,ge)}}}getRemainingTTL(e){return o()(this,L).has(e)?1/0:0}*entries(){for(const e of h(this,oe,be).call(this))void 0===o()(this,F)[e]||void 0===o()(this,D)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield[o()(this,D)[e],o()(this,F)[e]])}*rentries(){for(const e of h(this,ae,_e).call(this))void 0===o()(this,F)[e]||void 0===o()(this,D)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield[o()(this,D)[e],o()(this,F)[e]])}*keys(){for(const e of h(this,oe,be).call(this)){const t=o()(this,D)[e];void 0===t||h(this,de,Ie).call(this,o()(this,F)[e])||(yield t)}}*rkeys(){for(const e of h(this,ae,_e).call(this)){const t=o()(this,D)[e];void 0===t||h(this,de,Ie).call(this,o()(this,F)[e])||(yield t)}}*values(){for(const e of h(this,oe,be).call(this)){void 0===o()(this,F)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield o()(this,F)[e])}}*rvalues(){for(const e of h(this,ae,_e).call(this)){void 0===o()(this,F)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield o()(this,F)[e])}}[Symbol.iterator](){return this.entries()}find(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const n of h(this,oe,be).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;if(void 0!==r&&e(r,o()(this,D)[n],this))return this.get(o()(this,D)[n],t)}}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;for(const n of h(this,oe,be).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,o()(this,D)[n],this)}}rforEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;for(const n of h(this,ae,_e).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,o()(this,D)[n],this)}}purgeStale(){let e=!1;for(const t of h(this,ae,_e).call(this,{allowStale:!0}))o()(this,te).call(this,t)&&(h(this,fe,Ne).call(this,o()(this,D)[t],"expire"),e=!0);return e}info(e){const t=o()(this,L).get(e);if(void 0===t)return;const n=o()(this,F)[t],i=h(this,de,Ie).call(this,n)?n.__staleWhileFetching:n;if(void 0===i)return;const r={value:i};if(o()(this,W)&&o()(this,V)){const e=o()(this,W)[t],n=o()(this,V)[t];if(e&&n){const t=e-(g.now()-n);r.ttl=t,r.start=Date.now()}}return o()(this,H)&&(r.size=o()(this,H)[t]),r}dump(){const e=[];for(const t of h(this,oe,be).call(this,{allowStale:!0})){const n=o()(this,D)[t],i=o()(this,F)[t],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;if(void 0===r||void 0===n)continue;const s={value:r};if(o()(this,W)&&o()(this,V)){s.ttl=o()(this,W)[t];const e=g.now()-o()(this,V)[t];s.start=Math.floor(Date.now()-e)}o()(this,H)&&(s.size=o()(this,H)[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=g.now()-e}this.set(t,n.value,n)}}set(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t)return this.delete(e),this;const{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n;let{noUpdateTTL:u=this.noUpdateTTL}=n;const d=o()(this,se).call(this,e,t,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),h(this,fe,Ne).call(this,e,"set"),this;let p=0===o()(this,j)?void 0:o()(this,L).get(e);if(void 0===p){var f;p=0===o()(this,j)?o()(this,z):0!==o()(this,J).length?o()(this,J).pop():o()(this,j)===o()(this,x)?h(this,le,we).call(this,!1):o()(this,j),o()(this,D)[p]=e,o()(this,F)[p]=t,o()(this,L).set(e,p),o()(this,B)[o()(this,z)]=p,o()(this,q)[p]=o()(this,z),r()(this,z,p),r()(this,j,(f=o()(this,j),f++,f)),o()(this,re).call(this,p,d,l),l&&(l.set="add"),u=!1}else{h(this,pe,Ee).call(this,p);const n=o()(this,F)[p];if(t!==n){if(o()(this,Q)&&h(this,de,Ie).call(this,n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;if(void 0!==t&&!a){var m,g;if(o()(this,$))null===(m=o()(this,R))||void 0===m||m.call(this,t,e,"set");if(o()(this,K))null===(g=o()(this,G))||void 0===g||g.push([t,e,"set"])}}else if(!a){var y,v;if(o()(this,$))null===(y=o()(this,R))||void 0===y||y.call(this,n,e,"set");if(o()(this,K))null===(v=o()(this,G))||void 0===v||v.push([n,e,"set"])}if(o()(this,ie).call(this,p),o()(this,re).call(this,p,d,l),o()(this,F)[p]=t,l){l.set="replace";const e=n&&h(this,de,Ie).call(this,n)?n.__staleWhileFetching:n;void 0!==e&&(l.oldValue=e)}}else l&&(l.set="update")}if(0===i||o()(this,W)||h(this,Y,ye).call(this),o()(this,W)&&(u||o()(this,ee).call(this,p,i,s),l&&o()(this,Z).call(this,l,p)),!a&&o()(this,K)&&o()(this,G)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var b;null===(b=o()(this,O))||void 0===b||b.call(this,...t)}}return this}pop(){try{for(;o()(this,j);){const e=o()(this,F)[o()(this,U)];if(h(this,le,we).call(this,!0),h(this,de,Ie).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(o()(this,K)&&o()(this,G)){const t=o()(this,G);let n;for(;n=null==t?void 0:t.shift();){var e;null===(e=o()(this,O))||void 0===e||e.call(this,...n)}}}}has(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,r=o()(this,L).get(e);if(void 0!==r){const e=o()(this,F)[r];if(h(this,de,Ie).call(this,e)&&void 0===e.__staleWhileFetching)return!1;if(!o()(this,te).call(this,r))return n&&o()(this,X).call(this,r),i&&(i.has="hit",o()(this,Z).call(this,i,r)),!0;i&&(i.has="stale",o()(this,Z).call(this,i,r))}else i&&(i.has="miss");return!1}peek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale}=t,i=o()(this,L).get(e);if(void 0===i||!n&&o()(this,te).call(this,i))return;const r=o()(this,F)[i];return h(this,de,Ie).call(this,r)?r.__staleWhileFetching:r}async fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:g,forceRefresh:y=!1,status:v,signal:b}=t;if(!o()(this,Q))return v&&(v.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:v});const _={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:s,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:v,signal:b};let S=o()(this,L).get(e);if(void 0===S){v&&(v.fetch="miss");const t=h(this,ue,Te).call(this,e,S,_,g);return t.__returned=t}{const t=o()(this,F)[S];if(h(this,de,Ie).call(this,t)){const e=n&&void 0!==t.__staleWhileFetching;return v&&(v.fetch="inflight",e&&(v.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=o()(this,te).call(this,S);if(!y&&!r)return v&&(v.fetch="hit"),h(this,pe,Ee).call(this,S),i&&o()(this,X).call(this,S),v&&o()(this,Z).call(this,v,S),t;const s=h(this,ue,Te).call(this,e,S,_,g),a=void 0!==s.__staleWhileFetching&&n;return v&&(v.fetch=r?"stale":"refresh",a&&r&&(v.returnedStale=!0)),a?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await this.fetch(e,t);if(void 0===n)throw new Error("fetch() returned undefined");return n}memo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=o()(this,P);if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...s}=t,a=this.get(e,s);if(!r&&void 0!==a)return a;const c=n(e,a,{options:s,context:i});return this.set(e,c,s),c}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:s}=t,a=o()(this,L).get(e);if(void 0!==a){const t=o()(this,F)[a],c=h(this,de,Ie).call(this,t);return s&&o()(this,Z).call(this,s,a),o()(this,te).call(this,a)?(s&&(s.get="stale"),c?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(r||h(this,fe,Ne).call(this,e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),c?t.__staleWhileFetching:(h(this,pe,Ee).call(this,a),i&&o()(this,X).call(this,a),t))}s&&(s.get="miss")}delete(e){return h(this,fe,Ne).call(this,e,"delete")}clear(){return h(this,me,xe).call(this,"delete")}}function ye(){var e=this;const t=new A(o()(this,x)),n=new A(o()(this,x));r()(this,W,t),r()(this,V,n),r()(this,ee,(function(i,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.now();if(n[i]=0!==r?s:0,t[i]=r,0!==r&&e.ttlAutopurge){const t=setTimeout(()=>{o()(e,te).call(e,i)&&h(e,fe,Ne).call(e,o()(e,D)[i],"expire")},r+1);t.unref&&t.unref()}})),r()(this,X,e=>{n[e]=0!==t[e]?g.now():0}),r()(this,Z,(e,r)=>{if(t[r]){const o=t[r],a=n[r];if(!o||!a)return;e.ttl=o,e.start=a,e.now=i||s();const c=e.now-a;e.remainingTTL=o-c}});let i=0;const s=()=>{const e=g.now();if(this.ttlResolution>0){i=e;const t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{const r=o()(this,L).get(e);if(void 0===r)return 0;const a=t[r],c=n[r];if(!a||!c)return 1/0;return a-((i||s())-c)},r()(this,te,e=>{const r=n[e],o=t[e];return!!o&&!!r&&(i||s())-r>o})}function ve(){const e=new A(o()(this,x));r()(this,M,0),r()(this,H,e),r()(this,ie,t=>{r()(this,M,o()(this,M)-e[t]),e[t]=0}),r()(this,se,(e,t,n,i)=>{if(h(this,de,Ie).call(this,t))return 0;if(!T(n)){if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(n=i(t,e),!T(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n}),r()(this,re,(t,n,i)=>{if(e[t]=n,o()(this,C)){const n=o()(this,C)-e[t];for(;o()(this,M)>n;)h(this,le,we).call(this,!0)}r()(this,M,o()(this,M)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=o()(this,M))})}function*be(){let{allowStale:e=this.allowStale}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o()(this,j))for(let t=o()(this,z);h(this,ce,Se).call(this,t)&&(!e&&o()(this,te).call(this,t)||(yield t),t!==o()(this,U));)t=o()(this,q)[t]}function*_e(){let{allowStale:e=this.allowStale}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o()(this,j))for(let t=o()(this,U);h(this,ce,Se).call(this,t)&&(!e&&o()(this,te).call(this,t)||(yield t),t!==o()(this,z));)t=o()(this,B)[t]}function Se(e){return void 0!==e&&o()(this,L).get(o()(this,D)[e])===e}function we(e){var t;const n=o()(this,U),i=o()(this,D)[n],s=o()(this,F)[n];if(o()(this,Q)&&h(this,de,Ie).call(this,s))s.__abortController.abort(new Error("evicted"));else if(o()(this,$)||o()(this,K)){var a,c;if(o()(this,$))null===(a=o()(this,R))||void 0===a||a.call(this,s,i,"evict");if(o()(this,K))null===(c=o()(this,G))||void 0===c||c.push([s,i,"evict"])}return o()(this,ie).call(this,n),e&&(o()(this,D)[n]=void 0,o()(this,F)[n]=void 0,o()(this,J).push(n)),1===o()(this,j)?(r()(this,U,r()(this,z,0)),o()(this,J).length=0):r()(this,U,o()(this,B)[n]),o()(this,L).delete(i),r()(this,j,(t=o()(this,j),t--,t)),n}function Te(e,t,n,i){var r=this;const s=void 0===t?void 0:o()(this,F)[t];if(h(this,de,Ie).call(this,s))return s;const a=new _,{signal:c}=n;null==c||c.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});const l={signal:a.signal,options:n,context:i},u=function(i){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{aborted:c}=a.signal,u=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(c&&!s?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,u&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),c&&!u&&!s)return d(a.signal.reason);const f=p;return o()(r,F)[t]===p&&(void 0===i?f.__staleWhileFetching?o()(r,F)[t]=f.__staleWhileFetching:h(r,fe,Ne).call(r,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),r.set(e,i,l.options))),i},d=i=>{const{aborted:r}=a.signal,s=r&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(o()(this,F)[t]===p){!l||void 0===u.__staleWhileFetching?h(this,fe,Ne).call(this,e,"fetch"):s||(o()(this,F)[t]=u.__staleWhileFetching)}if(c)return n.status&&void 0!==u.__staleWhileFetching&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw i};n.status&&(n.status.fetchDispatched=!0);const p=new Promise((t,i)=>{var r;const c=null===(r=o()(this,k))||void 0===r?void 0:r.call(this,e,s,l);c&&c instanceof Promise&&c.then(e=>t(void 0===e?void 0:e),i),a.signal.addEventListener("abort",()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))})}).then(u,e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e))),f=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=o()(this,L).get(e)):o()(this,F)[t]=f,f}function Ie(e){if(!o()(this,Q))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof _}function Ae(e,t){o()(this,q)[t]=e,o()(this,B)[e]=t}function Ee(e){e!==o()(this,z)&&(e===o()(this,U)?r()(this,U,o()(this,B)[e]):h(this,he,Ae).call(this,o()(this,q)[e],o()(this,B)[e]),h(this,he,Ae).call(this,o()(this,z),e),r()(this,z,e))}function Ne(e,t){var n;let i=!1;if(0!==o()(this,j)){const n=o()(this,L).get(e);if(void 0!==n)if(i=!0,1===o()(this,j))h(this,me,xe).call(this,t);else{var s;o()(this,ie).call(this,n);const i=o()(this,F)[n];if(h(this,de,Ie).call(this,i))i.__abortController.abort(new Error("deleted"));else if(o()(this,$)||o()(this,K)){var a,c;if(o()(this,$))null===(a=o()(this,R))||void 0===a||a.call(this,i,e,t);if(o()(this,K))null===(c=o()(this,G))||void 0===c||c.push([i,e,t])}if(o()(this,L).delete(e),o()(this,D)[n]=void 0,o()(this,F)[n]=void 0,n===o()(this,z))r()(this,z,o()(this,q)[n]);else if(n===o()(this,U))r()(this,U,o()(this,B)[n]);else{const e=o()(this,q)[n];o()(this,B)[e]=o()(this,B)[n];const t=o()(this,B)[n];o()(this,q)[t]=o()(this,q)[n]}r()(this,j,(s=o()(this,j),s--,s)),o()(this,J).push(n)}}if(o()(this,K)&&(null===(n=o()(this,G))||void 0===n?void 0:n.length)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var l;null===(l=o()(this,O))||void 0===l||l.call(this,...t)}}return i}function xe(e){for(const i of h(this,ae,_e).call(this,{allowStale:!0})){const r=o()(this,F)[i];if(h(this,de,Ie).call(this,r))r.__abortController.abort(new Error("deleted"));else{const s=o()(this,D)[i];var t,n;if(o()(this,$))null===(t=o()(this,R))||void 0===t||t.call(this,r,s,e);if(o()(this,K))null===(n=o()(this,G))||void 0===n||n.push([r,s,e])}}if(o()(this,L).clear(),o()(this,F).fill(void 0),o()(this,D).fill(void 0),o()(this,W)&&o()(this,V)&&(o()(this,W).fill(0),o()(this,V).fill(0)),o()(this,H)&&o()(this,H).fill(0),r()(this,U,0),r()(this,z,0),o()(this,J).length=0,r()(this,M,0),r()(this,j,0),o()(this,K)&&o()(this,G)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var i;null===(i=o()(this,O))||void 0===i||i.call(this,...t)}}}}.call(this,n(23))},function(e,t){e.exports=function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){return t.get?t.get.call(e):t.value},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var i=n(91).default,r=n(272);e.exports=function(e){var t=r(e,"string");return"symbol"===i(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var i=n(91).default;e.exports=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),u=Object.prototype.toString,d=Math.max,h=Math.min,p=function(){return l.Date.now()};function f(e,t,n){var i,r,s,o,a,c,l=0,u=!1,f=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function b(e){return l=e,a=setTimeout(S,t),u?v(e):o}function _(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-l>=s}function S(){var e=p();if(_(e))return w(e);a=setTimeout(S,function(e){var n=t-(e-c);return f?h(n,s-(e-l)):n}(e))}function w(e){return a=void 0,y&&i?v(e):(i=r=void 0,o)}function T(){var e=p(),n=_(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return b(c);if(f)return a=setTimeout(S,t),v(c)}return void 0===a&&(a=setTimeout(S,t)),o}return t=g(t)||0,m(n)&&(u=!!n.leading,s=(f="maxWait"in n)?d(g(n.maxWait)||0,t):s,y="trailing"in n?!!n.trailing:y),T.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},T.flush=function(){return void 0===a?o:w(p())},T}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=r.test(e);return a||s.test(e)?o(e.slice(2),a?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return m(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),f(e,t,{leading:i,maxWait:t,trailing:r})}}).call(this,n(15))},function(e,t,n){e.exports=function(){"use strict";var e="undefined"==typeof window,t=!1,n=!1,i=!1,r=!1,s=!1,o=!1,a=!1,c=!1,l=!1,u=!1;return e||(t="undefined"!=typeof InstallTrigger,n=!!window.chrome,i=!(!window.chrome||!window.navigator||!window.navigator.plugins||!window.navigator.plugins.namedItem("Chrome PDF Plugin")&&!window.chrome.runtime),r=n&&!window.chrome.webstore&&!window.chrome.runtime,s=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||window.safari&&window.safari.pushNotification,o=!!window.opr&&!!window.opr.addons||!!window.opera,a=!!window.StyleMedia,c=n&&!!navigator.userAgent.match(/edg/i),l=(i||o)&&!!window.CSS,u=!(n||s||t||o||!document.documentMode)),{get isChrome(){return i},get isChromeOrChromium(){return n},get isChromium(){return r},get isFirefox(){return t},get isSafari(){return s},get isOpera(){return o},get isEdge(){return a},get isEdgeChromium(){return c},get isIE(){return u},get isBlink(){return l}}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitions=void 0;const i=n(3),r=n(2),s={aliases:["message.propose"],element:"propose",fields:{conversationId:i.attribute("inin-cid"),persistentConversationId:i.attribute("inin-persistent-cid"),sdpOverXmpp:i.booleanAttribute("inin-sdp-over-xmpp"),privAnswerMode:i.attribute("inin-priv-answer-mode"),originalRoomJid:i.attribute("inin-ofrom"),autoAnswer:i.booleanAttribute("inin-autoanswer"),fromUserId:i.attribute("inin-user-id"),sessionId:i.attribute("id"),meetingId:i.attribute("inin-meeting-id")},namespace:"urn:xmpp:jingle-message:0"},o={aliases:["message.proceed"],element:"proceed",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},a={aliases:["message.accept"],element:"accept",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},c={aliases:["message.reject"],element:"reject",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},l={aliases:["message.retract"],element:"retract",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},u={aliases:["iq.jingle.screenstart"],element:"screen-start",namespace:r.NS_JINGLE_RTP_INFO_1},d={aliases:["iq.jingle.screenstop"],element:"screen-stop",namespace:r.NS_JINGLE_RTP_INFO_1},h={path:"iq",namespace:r.NS_CLIENT,element:"iq",fields:{genesysWebrtc:i.childJSON("genesys","genesys-webrtc")}},p={path:"message",namespace:r.NS_CLIENT,element:"message",fields:{mediaMessage:i.childJSON("genesys","media-message")}},f={aliases:["presence.media"],element:"x",fields:{conversationId:i.attribute("conversationId"),sourceCommunicationId:i.attribute("sourceCommunicationId"),screenShare:i.childAttribute(null,"mediastream","screenShare"),video:i.childAttribute(null,"mediastream","video"),audio:i.childAttribute(null,"mediastream","audio"),listener:i.childAttribute(null,"mediastream","listener"),screenRecording:i.childAttribute(null,"mediastream","screenRecording")},namespace:"orgspan:mediastream"};t.definitions=[s,o,a,c,l,u,d,f,h,p]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(35),s=(0,i.__importDefault)(n(277)),o=(0,i.__importDefault)(n(92));t.default=class{constructor(){this.translators=new Map,this.root=new o.default,this.setLanguageResolver(r.basicLanguageResolver)}setLanguageResolver(e){this.languageResolver=e}import(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{registry:this};if(!this.hasTranslator(e.getNamespace(),e.getName()))return;t.acceptLanguages||(t.acceptLanguages=[]),t.acceptLanguages=t.acceptLanguages.map(e=>e.toLowerCase()),t.lang&&(t.lang=t.lang.toLowerCase()),t.resolveLanguage||(t.resolveLanguage=this.languageResolver),t.path=this.getImportKey(e),t.sanitizers||(t.sanitizers={xhtmlim:s.default});return this.getOrCreateTranslator(e.getNamespace(),e.getName()).import(e,{...t,registry:this})}export(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{registry:this};n.acceptLanguages||(n.acceptLanguages=[]),n.acceptLanguages=n.acceptLanguages.map(e=>e.toLowerCase()),n.lang&&(n.lang=n.lang.toLowerCase()),n.sanitizers||(n.sanitizers={xhtmlim:s.default}),n.path=e;const i=e.split(".").filter(e=>""!==e);let r=this.root;for(const e of i){const t=r.getChild(e);if(!t)return;r=t}return r.export(t,{...n,registry:this})}getImportKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?this.walkToTranslator(t.split(".")):this.root;if(n)return n.getImportKey(e)}define(e){if(Array.isArray(e)){for(const t of e)"object"==typeof t?this.define(t):t(this);return}if("object"!=typeof e)return void e(this);const t=e;t.aliases=t.aliases||[],t.path&&!t.aliases.includes(t.path)&&t.aliases.push(t.path);const n=t.aliases.map(e=>"string"==typeof e?{path:e}:e).sort((e,t)=>{const n=e.path.split(".").length;return t.path.split(".").length-n});let i;if(this.hasTranslator(t.namespace,t.element)&&(i=this.getOrCreateTranslator(t.namespace,t.element)),!i){let e;for(const t of n){const n=this.walkToTranslator(t.path.split("."));if(n&&!n.placeholder){i=n;break}n&&(e=n)}e&&!i&&(i=e,i.placeholder=!1)}i||(i=this.getOrCreateTranslator(t.namespace,t.element)),this.indexTranslator(t.namespace,t.element,i);const r=t.fields||{},s=new Map,o=new Map,a=new Map,c=new Map;t.typeField&&(i.typeField=t.typeField),t.defaultType&&(i.defaultType=t.defaultType),t.versionField&&(i.versionField=t.versionField),t.defaultVersion&&(i.defaultVersion=t.defaultVersion),t.languageField&&(i.languageField=t.languageField);for(const[e,t]of Object.entries(r))s.set(e,t.importer),a.set(e,t.importOrder||t.order||0),o.set(e,t.exporter),c.set(e,t.exportOrder||t.order||0);if(t.childrenExportOrder)for(const[e,n]of Object.entries(t.childrenExportOrder))c.set(e,n||0);const l=new Map;for(const[e,n]of Object.entries(t.optionalNamespaces||{}))l.set(e,n);i.updateDefinition({contexts:new Map,element:t.element,exporterOrdering:c,exporters:o,importerOrdering:a,importers:s,namespace:t.namespace,optionalNamespaces:l,type:t.type,version:t.version,typeOrder:t.typeOrder});for(const e of n)this.alias(t.namespace,t.element,e.path,e.multiple,e.selector,e.contextField,t.type,e.impliedType);for(const e of n){const t=this.walkToTranslator(e.path.split("."));t&&t!==i&&t.replaceWith(i)}}alias(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const c=this.getOrCreateTranslator(e,t);c.placeholder=!1;const l=n.split(".").filter(e=>""!==e),u=l.pop(),d=this.walkToTranslator(l,!0),h=`{${e}}${t}`;o&&(s||a)&&c.addContext(n,r,s,h,o,a),d.addChild(u,c,i,r,h)}walkToTranslator(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.root;for(const i of e){let e=n.getChild(i);if(!e){if(!t)return;e=new o.default,e.placeholder=!0,n.addChild(i,e)}n=e}return n}hasTranslator(e,t){return this.translators.has(`{${e}}${t}`)}getOrCreateTranslator(e,t){let n=this.translators.get(`{${e}}${t}`);return n||(n=new o.default,this.indexTranslator(e,t,n)),n}indexTranslator(e,t,n){this.translators.set(`{${e}}${t}`,n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=new Set(["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul"]),r=new Set(["style"]),s=new Map([["a",new Set(["href","style"])],["body",new Set(["style","xml:lang"])],["blockquote",r],["br",r],["cite",r],["em",r],["img",new Set(["alt","height","src","style","width"])],["li",r],["ol",r],["p",r],["span",r],["strong",r],["ul",r]]),o=new Map([["font-style",/normal|italic|oblique|inherit/i],["font-weight",/normal|bold|bolder|lighter|inherit|\d\d\d/i],["text-decoration",/none|underline|overline|line-through|blink|inherit/i]]),a=e=>!!e.match(/^(https?|xmpp|cid|mailto|ftps?|im|ircs?|sips?|tel|geo|bitcoin|magnet):/i)&&e,c=e=>!!e.match(/^[0-9]*$/)&&e,l={alt:e=>e,height:c,href:a,src:a,style:e=>{const t=(";"+e).replace(/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,"").replace(/\/\*.*/,"").replace(/\\([a-fA-F0-9]{1,6})\s?/,(e,t)=>String.fromCharCode(parseInt(t,16))).match(/;\s*([a-z-]+)\s*:\s*([^;]*[^\s;])\s*/g),n=[];if(!t)return!1;for(const e of t){const t=e.match(/^;\s*([a-z-]+)\s*:\s*([^;]*[^\s])\s*$/);if(!t)continue;const i=o.get(t[1]);if(i){const e=t[2].match(i);e&&n.push(`${t[1]}:${e[0]}`)}}return!!n.length&&n.join("")},width:c};function u(e){if("string"==typeof e)return e;if(!i.has(e.name)){if("script"===e.name)return;return function(e){let t=[];for(const n of e.children)if("string"==typeof n)t.push(n);else{const e=u(n);e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t}(e)}const t=e.children.map(u).filter(e=>void 0!==e),n={};for(const[t,i]of Object.entries(e.attributes)){const r=s.get(e.name);if(!r||!r.has(t))continue;if(!i)continue;const o=l[t](i);o&&(n[t]=o)}return{attributes:n,children:t,name:e.name}}t.default=function(e){if("string"==typeof e)return;let t=[];for(const n of e.children){if(!n)continue;if("string"==typeof n){t.push(n);continue}const e=u(n);Array.isArray(e)?t=t.concat(e):e&&t.push(e)}const n={};return"body"===e.name?(void 0!==e.attributes.xmlns&&(n.xmlns=e.attributes.xmlns),e.attributes.style&&(n.style=e.attributes.style),void 0!==e.attributes["xml:lang"]&&(n["xml:lang"]=e.attributes["xml:lang"]),{attributes:n,children:t,name:"body"}):void 0}},function(e,t,n){"use strict";n(9),t.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,i=l(e),o=i[0],a=i[1],c=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),u=0,d=a>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=0,a=n-r;o<a;o+=16383)s.push(u(e,o,o+16383>a?a:o+16383));1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t,n){"use strict";
31
+ t.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=l}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,n,i,r,s){var o,a,c,l=8*s-r-1,u=(1<<l)-1,d=u>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;e[n+p]=255&o,p+=f,o/=256,l-=8);e[n+p-f]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){e||Object.defineProperty(window,"crypto",{value:window.crypto||window.msCrypto,writable:!1,configurable:!1})}).call(this,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Notifications=void 0;const i=n(264),r=n(16);function s(e,t){return[...e,...t].filter((e,t,n)=>n.indexOf(e)===t)}t.Notifications=class{constructor(e){this.subscriptions={},this.bulkSubscriptions={},this.topicPriorities={},this.client=e,e.on("pubsub:event",this.pubsubEvent.bind(this)),e.on("connected",this.subscriptionsKeepAlive.bind(this)),this.debouncedResubscribe=i(this.resubscribe.bind(this),100)}get pubsubHost(){try{return"notifications."+this.client.config.apiHost.replace(/http(s?):\/\//,"")}catch(e){return"notifications.mypurecloud.com"}}handleStanzaInstanceChange(e){const t=this.stanzaInstance&&this.stanzaInstance.id!==e.id&&this.stanzaInstance.channelId!==e.channelId;this.stanzaInstance=e,t&&(this.client.logger.info("resubscribing due to hard reconnect"),this.debouncedResubscribe())}topicHandlers(e){return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e]}pubsubEvent(e){let{pubsub:t}=e,n=t.items.node;n.includes("no_longer_subscribed")?n="no_longer_subscribed":n.includes("duplicate_id")&&(n="duplicate_id");const i=t.items.published[0].content.json,r=this.topicHandlers(n);this.client.emit("notify",{topic:n,data:i}),this.client.emit("notify:"+n,i),r.forEach(e=>{e(i)})}async xmppSubscribe(e){if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();const t=()=>this.stanzaInstance.subscribeToNode(this.pubsubHost,e);return this.client.connected?t():new Promise((e,n)=>{this.client.once("connected",()=>t().then(e,n))})}xmppUnsubscribe(e){if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();const t=()=>this.stanzaInstance.unsubscribeFromNode(this.pubsubHost,e);return this.client.connected?t():new Promise((e,n)=>{this.client.once("connected",()=>t().then(e,n))})}mapCombineTopics(e){const t={},n=[],i=[];e.forEach(e=>{e.includes("?")?n.push({id:e}):i.push(e)}),i.map(e=>{const t=e.split("."),n=t.splice(t.length-1);return{prefix:t.join("."),postfix:n}}).forEach(e=>{t[e.prefix]?t[e.prefix].push(e.postfix):t[e.prefix]=[e.postfix]});let r=[];const s=(e,t)=>{const n=`${e}${1===t.length?".":"?"}${t.join("&")}`;n.length<200?r.push({id:n}):1===t.length?this.client.logger.error("Refusing to attempt topic with length > 200",n):(s(e,t.slice(0,t.length/2)),s(e,t.slice(t.length/2)))};Object.keys(t).forEach(e=>{const n=t[e];s(e,n)});const o=r.concat(n);return this.truncateTopicList(this.prioritizeTopicList(o))}prioritizeTopicList(e){return e.sort((e,t)=>this.getTopicPriority(t.id)-this.getTopicPriority(e.id)),e}getTopicPriority(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const{prefix:n,postfixes:i}=this.getTopicParts(e),r=this.topicPriorities[n],s=r&&Object.keys(r).filter(e=>i.includes(e)).map(e=>r[e]),o=s&&s.length&&s.reduce((e,t)=>t>e?t:e);return t?o||0:o}truncateTopicList(e){const t=e.slice(0,1e3);if(e.length>1e3){let t=e.slice(1e3);if(t.length>20){const e=t.length-20;t=t.slice(20),t.push(`...and ${e} more`)}this.client.logger.warn("Too many topics to subscribe to; truncating extra topics",{droppedTopics:t})}return t}makeBulkSubscribeRequest(e,t){const n={method:t.replace?"put":"post",host:this.client.config.apiHost,authToken:this.client.config.authToken,data:JSON.stringify(this.mapCombineTopics(e)),logger:this.client.logger},i=this.stanzaInstance.channelId;return this.client.http.requestApi(`notifications/channels/${i}/subscriptions`,n)}createSubscription(e,t){r.splitIntoIndividualTopics(e).forEach(e=>{let n=this.topicHandlers(e);n.includes(t)||n.push(t)})}removeSubscription(e,t){r.splitIntoIndividualTopics(e).forEach(e=>{let n=this.topicHandlers(e),i=n.indexOf(t);i>-1&&n.splice(i,1),n.length||delete this.subscriptions[e]})}removeTopicPriority(e){if(this.getTopicPriority(e,!1)){const{prefix:t,postfixes:n}=this.getTopicParts(e);n.forEach(e=>{delete this.topicPriorities[t][e]}),Object.keys(this.topicPriorities[t]).length||delete this.topicPriorities[t]}}getActiveIndividualTopics(){const e=[];return Object.keys(this.subscriptions).forEach(t=>{if("streaming-subscriptions-expiring"===t)return;this.topicHandlers(t).length>0&&e.push(t)}),e}resubscribe(){const e=Object.keys(this.bulkSubscriptions);return e.length+this.getActiveIndividualTopics().length===0?Promise.resolve():this.bulkSubscribe(e,{replace:!0})}subscriptionsKeepAlive(){const e="streaming-subscriptions-expiring";0===this.topicHandlers(e).length&&this.createSubscription(e,()=>{this.client.logger.info(e+" - Triggering resubscribe.",{channelId:this.client.config.channelId}),this.debouncedResubscribe().catch(e=>{const t="Error resubscribing to topics";this.client.logger.error(t,e),this.client.emit("pubsub:error",{msg:t,err:e})})})}getTopicParts(e){const t=e.includes("?"),n=t?"?":".",i=e.split(n),r=t?i[1]:i.splice(i.length-1),s=t?i[0]:i.join(".");let o=[];return o=t?r.split("&"):r,{prefix:s,postfixes:o}}setTopicPriorities(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(e).forEach(t=>{const n=this.getTopicParts(t),i=this.topicPriorities[n.prefix],r=e[t];if(i)n.postfixes.forEach(e=>{const t=i[e];(t&&t<r||!t)&&(i[e]=r)});else{const e=n.postfixes.reduce((e,t)=>(e[t]=r,e),{});this.topicPriorities[n.prefix]=e}})}subscribe(e,t,n,i){let r;return i&&this.setTopicPriorities({[e]:i}),r=n?this.xmppSubscribe(e):this.debouncedResubscribe(),t?this.createSubscription(e,t):this.bulkSubscriptions[e]=!0,r}unsubscribe(e,t,n){return t?this.removeSubscription(e,t):(delete this.bulkSubscriptions[e],delete this.subscriptions[e]),this.removeTopicPriority(e),n?this.xmppUnsubscribe(e):this.debouncedResubscribe()}async bulkSubscribe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{replace:!1,force:!1},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.setTopicPriorities(n);let i=s(e,[]);t.replace&&!t.force?i=s(i,this.getActiveIndividualTopics()):t.force&&(this.subscriptions={}),await this.makeBulkSubscribeRequest(i,t),t.replace&&(this.bulkSubscriptions={}),e.forEach(e=>{this.bulkSubscriptions[e]=!0})}get expose(){return{subscribe:this.subscribe.bind(this),unsubscribe:this.unsubscribe.bind(this),bulkSubscribe:this.bulkSubscribe.bind(this)}}}},function(e,t,n){"use strict";function i(e){return"function"==typeof e?e():e}function r(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}e.exports=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=void 0,o=void 0,a=void 0,c=[];return function(){var u=i(t),d=(new Date).getTime(),h=!s||d-s>u;s=d;for(var p=arguments.length,f=Array(p),m=0;m<p;m++)f[m]=arguments[m];if(h&&n.leading)return n.accumulate?Promise.resolve(e.call(this,[f])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(f)));if(o?clearTimeout(a):o=r(),c.push(f),a=setTimeout(l.bind(this),u),n.accumulate){var g=c.length-1;return o.promise.then((function(e){return e[g]}))}return o.promise};function l(){var t=o;clearTimeout(a),Promise.resolve(n.accumulate?e.call(this,c):e.apply(this,c[c.length-1])).then(t.resolve,t.reject),c=[],o=null}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebrtcExtension=void 0;const i=n(26),r=n(10),s=n(13),o=n(268),a=n(8),c=n(28),l=i.__importDefault(n(273)),u=n(274),d=n(275),h=n(16),p=n(68),f=n(289),m=n(24),g=n(58),y=n(64),v=n(38),b="requestIncomingRtcSession",_="cancelIncomingRtcSession",S="handledIncomingRtcSession",w="incomingRtcSession",T="outgoingRtcSession",I="rtcSessionError";class A extends r.EventEmitter{constructor(e,t){super(),this.ignoredSessions=new o.LRUCache({max:10,ttl:216e3}),this.earlyIceCandidates=new o.LRUCache({max:10,ttl:6e4,ttlAutopurge:!0}),this.pendingSessions={},this.statsArr=[],this.throttleSendStatsInterval=25e3,this.currentMaxStatSize=15e3,this.statsSizeDecreaseAmount=3e3,this.statBuffer=0,this.discoRetries=0,this.iceServers=[],this.webrtcSessions=[],this.reinviteCache=new o.LRUCache({max:5,ttl:18e4}),this.client=e,this.config={allowIPv6:!0===t.allowIPv6,optOutOfWebrtcStatsTelemetry:t.optOutOfWebrtcStatsTelemetry},this.logger=e.logger,this.addEventListeners(),this.throttledSendStats=l.default(this.sendStats.bind(this),this.throttleSendStatsInterval,{leading:!1,trailing:!0}),this.client.on("jingle:outgoing",e=>(this.logger.info("Emitting jingle:outgoing media-session (session-init)",e.sid),this.emit(T,e))),this.client.on("jingle:incoming",e=>(this.logger.info("Emitting jingle:incoming media-session (session-init)",e.sid),this.emit(w,e))),this.client.on("jingle:created",e=>{e instanceof g.StanzaMediaSession||e.end("cancel",!0)}),window.addEventListener("offline",()=>this.onOnlineStatusChange(!1)),window.addEventListener("online",()=>this.onOnlineStatusChange(!0))}get jid(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jid}onOnlineStatusChange(e){this.addStatToQueue({actionName:"WebrtcStats",details:{_eventType:"onlineStatus",_eventTimestamp:(new Date).getTime(),online:e}})}async handleStanzaInstanceChange(e){this.stanzaInstance=e,this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),e.on("iq:set:genesysWebrtc",this.handleGenesysWebrtcStanza.bind(this)),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.client.emit("sessionManagerChange",e)}async configureNewStanzaInstance(e){Object.assign(e.jingle.config.peerConnectionConfig,{sdpSemantics:"unified-plan"}),await this.configureStanzaIceServers(e),e.stanzas.define(d.definitions),e.jingle.prepareSession=this.prepareSession.bind(this),e.jingle.on("log",(e,t,n)=>{this.logger[e](t,n)});const t=["iceConnectionType","peerTrackAdded","peerTrackRemoved","mute","unmute","sessionState","connectionState","terminated","stats","endOfCandidates"];for(const n of t)e.jingle.on(n,(function(e){if(e instanceof g.StanzaMediaSession){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];e.emit(n,...i)}}))}configureStanzaIceServers(e){return e.jingle.config.iceServers=[],this.setIceServers([],e),this._refreshIceServers(e)}async handleGenesysOffer(e){const t=e.genesysWebrtc,n=t.params;if(n.reinvite&&this.reinviteCache.get(t.id))return void this.logger.info("Ignoring duplicate reinvite offer",t.id);n.reinvite&&this.reinviteCache.set(t.id,!0);const i="relay"===this.getIceTransportPolicy()&&u.isFirefox,r={id:n.sessionId,logger:this.logger,peerID:e.from,fromJid:e.from,sessionType:this.getSessionTypeByJid(e.from),conversationId:n.conversationId,ignoreHostCandidatesFromRemote:i,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,allowIPv6:this.config.allowIPv6,iceServers:this.iceServers,reinvite:!!n.reinvite,iceTransportPolicy:this.getIceTransportPolicy()};let s;const o=this.pendingSessions[n.sessionId];s=o?{...r,meetingId:o.meetingId,fromUserId:o.fromUserId,originalRoomJid:o.originalRoomJid,privAnswerMode:o.privAnswerMode}:r;const a=this.webrtcSessions.find(e=>e.id===s.id);if(this.logger.info("offer received",{existingSession:!!a,mediaSessionParams:s}),a&&(a.conversationId=n.conversationId,!h.iceIsDifferent(a.peerConnection.remoteDescription.sdp,n.sdp)))return this.handleGenesysRenegotiate(a,n.sdp);const c=new y.GenesysCloudMediaSession(this,s);return await c.setRemoteDescription(n.sdp),this.proxyStatsForSession(c),c.on("sendIq",e=>{var t;return null===(t=this.stanzaInstance)||void 0===t?void 0:t.sendIQ(e)}),c.on("terminated",()=>{this.webrtcSessions=this.webrtcSessions.filter(e=>e.id!==c.id)}),this.webrtcSessions.push(c),this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(c),this.emit(w,c)}applyEarlyIceCandidates(e){const t=this.earlyIceCandidates.get(e.id);if(t){this.earlyIceCandidates.delete(e.id);for(const n of t)e.addRemoteIceCandidate(n)}}async handleGenesysRenegotiate(e,t){await e.peerConnection.setRemoteDescription({sdp:t,type:"offer"}),await e.accept()}async handleGenesysIceCandidate(e){const t=e.genesysWebrtc.params,n=this.getSessionById(t.sessionId,!0);if(n)await n.addRemoteIceCandidate(t.sdp);else{const e=this.earlyIceCandidates.get(t.sessionId);e?this.earlyIceCandidates.set(t.sessionId,[...e,t.sdp]):this.earlyIceCandidates.set(t.sessionId,[t.sdp])}}async handleGenesysTerminate(e){const t=e.genesysWebrtc.params;this.getSessionById(t.sessionId).onSessionTerminate(t.reason)}getSessionById(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getAllSessions().find(t=>t.id===e);if(!n&&!t){const t=new Error("Failed to find session by id");throw this.logger.error(t,{sessionId:e}),t}return n}async sendIq(e){if(!this.stanzaInstance)throw new Error("Failed to send iq because there was no stanza instance");return this.stanzaInstance.sendIQ(e)}async handleMessage(e){e.propose?await this.handlePropose(e):e.retract?this.handleRetract(e.retract.sessionId):e.accept?this.handledIncomingRtcSession(e.accept.sessionId,e):e.reject&&this.handledIncomingRtcSession(e.reject.sessionId,e)}async handleGenesysWebrtcStanza(e){const t=e.genesysWebrtc;return"offer"===t.method?this.handleGenesysOffer(e):"iceCandidate"===t.method?this.handleGenesysIceCandidate(e):"terminate"===t.method?this.handleGenesysTerminate(e):void 0}prepareSession(e){const t=this.pendingSessions[e.sid];if(t&&delete this.pendingSessions[t.sessionId],null==t?void 0:t.sdpOverXmpp)return void this.logger.debug("skipping creation of jingle webrtc session due to sdpOverXmpp on the pendingSession");const n="relay"===this.getIceTransportPolicy()&&u.isFirefox,i={options:e,logger:this.logger,id:e.sid,fromJid:e.peerID,peerID:e.peerID,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,conversationId:null==t?void 0:t.conversationId,fromUserId:null==t?void 0:t.fromJid,originalRoomJid:null==t?void 0:t.originalRoomJid,sessionType:null==t?void 0:t.sessionType,allowIPv6:this.config.allowIPv6,ignoreHostCandidatesFromRemote:n,meetingId:null==t?void 0:t.meetingId},r=new g.StanzaMediaSession(i);return this.proxyStatsForSession(r),r}proxyStatsForSession(e){e.on("stats",t=>{const n=JSON.parse(JSON.stringify(t)),i={conversationId:e.conversationId,sessionId:e.id,sessionType:e.sessionType},r=f.formatStatsEvent(n,i);this.addStatToQueue(r)})}addStatToQueue(e){if(this.config.optOutOfWebrtcStatsTelemetry)return;e.details._appId||(e.details._appId=this.logger.clientId,e.details._appName="streamingclient",e.details._appVersion=p.Client.version),e.details._originAppId=this.client.config.appId;const t=f.deepFlatten(e.details);Object.keys(t).forEach(e=>{const n=t[e];"boolean"==typeof n&&(t[e]=""+n)});const n={...e,details:t},i=h.calculatePayloadSize(n),r=this.statBuffer+i>this.currentMaxStatSize;this.statsArr.push(n),this.statBuffer+=i,r?this.sendStatsImmediately():this.throttledSendStats()}getLogDetailsForPendingSessionId(e){const t={sessionId:e},n=this.pendingSessions[e];return n&&(t.sessionType=n.sessionType,t.conversationId=n.conversationId),t}sendStatsImmediately(){this.throttledSendStats(),this.throttledSendStats.flush()}async sendStats(){var e,t;if(!navigator.onLine)return;const n=[];let i=0;for(const e of this.statsArr){const t=h.calculatePayloadSize(e);if(!(i+t<this.currentMaxStatSize))break;n.push(e),i+=t}if(this.statsArr.splice(0,n.length),this.statBuffer=this.statsArr.reduce((e,t)=>e+h.calculatePayloadSize(t),0),!n.length||this.client.isGuest)return;const r={appName:"streamingclient",appVersion:p.Client.version,originAppName:this.client.config.appName,originAppVersion:this.client.config.appVersion,actions:n};try{let e=this.client.config.authToken,t="diagnostics/newrelic/insights";this.client.backgroundAssistantMode&&(e=this.client.config.jwt,t+="/backgroundassistant"),await this.client.http.requestApi(t,{method:"post",responseType:"text",host:this.client.config.apiHost,authToken:e,logger:this.client.logger,data:r}),this.currentMaxStatSize=15e3}catch(i){if(!v.HttpClient.retryStatusCodes.has(null===(e=i.response)||void 0===e?void 0:e.status)&&navigator.onLine||(this.statsArr=[...n,...this.statsArr],this.statBuffer=this.statsArr.reduce((e,t)=>e+h.calculatePayloadSize(t),0)),413===(null===(t=i.response)||void 0===t?void 0:t.status)){const e=this.currentMaxStatSize;this.currentMaxStatSize-=this.statsSizeDecreaseAmount,this.logger.info("Failed to send stats due to 413, retrying with smaller set",{attemptedPayloadSize:e,newPayloadSize:this.currentMaxStatSize}),await this.sendStats()}else this.logger.error("Failed to send stats",{err:i,numberOfFailedStats:n.length},{skipServer:!navigator.onLine})}}addEventListeners(){this.client.on("connected",()=>(this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.refreshIceServers().catch(e=>this.logger.error("Error fetching ice servers after streaming-client connected",{error:e,channelId:this.client.config.channelId})))),this.client.on("disconnected",()=>{clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null})}async handlePropose(e){if(e.from===this.jid)return;const t=e.propose.sessionId;let n=this.pendingSessions[t];const i=!!n,r=this.getSessionTypeByJid(e.from),s={sessionId:t,conversationId:e.propose.conversationId,sessionType:r,isDuplicatePropose:i};if(this.logger.info("propose received",s),!i){const{appId:i}=this.client.config,o={actionName:"WebrtcStats",details:{_eventTimestamp:(new Date).getTime(),_eventType:"firstPropose",conversationId:s.conversationId,sdpViaXmppRequested:!!e.propose.sdpOverXmpp,sessionId:t,sessionType:r}};this.addStatToQueue(o);const a=e.from,c=a;e.propose.originalRoomJid=e.propose.originalRoomJid||c,n={...e.propose,toJid:e.to,fromJid:a,sessionType:r,roomJid:c,id:t,sdpOverXmpp:e.propose.sdpOverXmpp,privAnswerMode:e.propose.privAnswerMode},this.pendingSessions[t]=n}if(n.accepted)return this.logger.info("proceed already sent for this session, but sending another",s),void await this.acceptRtcSession(t);this.emit(b,Object.assign(n))}handleRetract(e){return this.logger.info("retract received",this.getLogDetailsForPendingSessionId(e)),delete this.pendingSessions[e],this.emit(_,e)}handledIncomingRtcSession(e,t){let n=t.accept?"accept":"reject";return this.logger.info(n+" received",this.getLogDetailsForPendingSessionId(e)),this.emit(S,e)}async initiateRtcSession(e){const t={to:e.jid,propose:{id:c.v4(),descriptions:[]}};if(e.stream)for(let n of Array.from(e.stream.getTracks()))t.propose.descriptions.push({media:n.kind});if(e.provideVideo){t.propose.descriptions.filter(e=>"video"===e.media).length>0||t.propose.descriptions.push({media:"video"})}if(e.provideAudio){t.propose.descriptions.filter(e=>"audio"===e.media).length>0||t.propose.descriptions.push({media:"audio"})}if(e.mediaPurpose&&t.propose.descriptions.push({media:e.mediaPurpose}),e.jid&&e.jid.match(/@conference/)){let n=t.propose.descriptions;0===n.length&&(n=[{media:"listener"}]);const i={type:"upgradeMedia",to:e.jid,id:c.v4(),from:this.jid,media:{conversationId:e.conversationId,sourceCommunicationId:e.sourceCommunicationId}};for(const e of n)i.media[e.media]=!0;await this.stanzaInstance.send("presence",i)}else await this.stanzaInstance.send("message",t),this.pendingSessions[t.propose.id]=t;return t.propose.id}async acceptRtcSession(e){const t=this.pendingSessions[e];if(!t)return void this.emit(I,"Cannot accept session because it is not pending or does not exist");const n={to:t.fromJid,proceed:{sessionId:e}};t.accepted=!0;const i=this.getLogDetailsForPendingSessionId(e);this.logger.info("sending jingle proceed",i),await this.stanzaInstance.send("message",n),this.logger.info("sent jingle proceed",i)}async rejectRtcSession(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this.getLogDetailsForPendingSessionId(e),i=this.pendingSessions[e];if(i)if(delete this.pendingSessions[e],t)this.ignoredSessions.set(e,!0);else{const t={to:s.toBare(this.jid),reject:{sessionId:e}},r=this.stanzaInstance.send("message",t),o={to:i.fromJid,reject:{sessionId:e}},a=this.stanzaInstance.send("message",o);this.logger.info("sending jingle reject",n),await Promise.all([r,a]),this.logger.info("sent jingle reject",n)}else this.emit(I,"Cannot reject session because it is not pending or does not exist")}async rtcSessionAccepted(e){this.pendingSessions[e];const t=this.getLogDetailsForPendingSessionId(e),n={to:s.toBare(this.jid),accept:{sessionId:e}};this.logger.info("sending session-info:accept",t),await this.stanzaInstance.send("message",n),this.logger.info("sent session-info:accept",t)}async notifyScreenShareStart(e){return this.stanzaInstance.send("iq",{to:""+e.peerID,from:this.jid,type:"set",jingle:{action:a.JingleAction.SessionInfo,sid:e.id,screenstart:{}}})}async notifyScreenShareStop(e){return this.stanzaInstance.send("iq",{to:""+e.peerID,from:this.jid,type:"set",jingle:{action:a.JingleAction.SessionInfo,sid:e.id,screenstop:{}}})}async cancelRtcSession(e){const t=this.pendingSessions[e],n=this.getLogDetailsForPendingSessionId(e);if(!t)return void this.emit(I,"Cannot cancel session because it is not pending or does not exist");const i={to:t.toJid,retract:{sessionId:e}};delete this.pendingSessions[e],this.logger.info("sending jingle retract",n),await this.stanzaInstance.send("message",i),this.logger.info("sent jingle retract",n)}async refreshIceServers(){return this.refreshIceServersRetryPromise||(this.refreshIceServersRetryPromise=h.retryPromise(this._refreshIceServers.bind(this,this.stanzaInstance),e=>++this.discoRetries>2?(this.logger.warn("fetching ice servers failed. max retries reached.",{retryAttempt:this.discoRetries,MAX_DISCO_RETRIES:2,error:e,channelId:this.client.config.channelId}),!1):(this.logger.warn("fetching ice servers failed. retrying",{retryAttempt:this.discoRetries,error:e,channelId:this.client.config.channelId}),!0),0,this.client.logger)),this.refreshIceServersRetryPromise.promise.finally(()=>{this.discoRetries=0,this.refreshIceServersRetryPromise=void 0})}async _refreshIceServers(e){if(!e)throw new Error("No stanza instance to refresh ice servers");const t=e.config.server,n=e.getServices(t,"turn","1"),i=e.getServices(t,"stun","1"),r=new Promise((e,t)=>{setTimeout(()=>{t(new Error("Timeout waiting for refresh ice servers to finish"))},15e3),Promise.all([n,i]).then(t=>{let[n,i]=t;e([n,i])}).catch(t)}),[s,o]=await r,a=[...s.services,...o.services].map(e=>{const t=e.port?":"+e.port:"",n={type:e.type,urls:`${e.type}:${e.host}${t}`};return["turn","turns"].includes(e.type)&&(e.transport&&"udp"!==e.transport&&(n.urls+="?transport="+e.transport),e.username&&(n.username=e.username),e.password&&(n.credential=e.password)),n});return this.setIceServers(a,e),o.services.length?this.setIceTransportPolicy("all",e):(this.logger.info('No stun servers received, setting iceTransportPolicy to "relay"'),this.setIceTransportPolicy("relay",e)),a}setIceServers(e,t){t.jingle.iceServers=e,this.iceServers=e}getIceTransportPolicy(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.config.peerConnectionConfig.iceTransportPolicy}setIceTransportPolicy(e,t){t.jingle.config.peerConnectionConfig.iceTransportPolicy=e}getSessionTypeByJid(e){return h.isAcdJid(e)?m.SessionTypes.acdScreenShare:h.isScreenRecordingJid(e)?m.SessionTypes.screenRecording:h.isSoftphoneJid(e)?m.SessionTypes.softphone:h.isVideoJid(e)?m.SessionTypes.collaborateVideo:m.SessionTypes.unknown}getSessionManager(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle}getAllSessions(){var e;const t=null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.sessions;return[...t&&Object.values(t)||[],...this.webrtcSessions]}proxyNRStat(e){this.addStatToQueue(e)}get expose(){return{on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeAllListeners:this.removeAllListeners.bind(this),removeListener:this.removeListener.bind(this),refreshIceServers:this.refreshIceServers.bind(this),acceptRtcSession:this.acceptRtcSession.bind(this),rejectRtcSession:this.rejectRtcSession.bind(this),cancelRtcSession:this.cancelRtcSession.bind(this),notifyScreenShareStart:this.notifyScreenShareStart.bind(this),notifyScreenShareStop:this.notifyScreenShareStop.bind(this),rtcSessionAccepted:this.rtcSessionAccepted.bind(this),initiateRtcSession:this.initiateRtcSession.bind(this),getSessionTypeByJid:this.getSessionTypeByJid.bind(this),getSessionManager:this.getSessionManager.bind(this),getAllSessions:this.getAllSessions.bind(this),proxyNRStat:this.proxyNRStat.bind(this)}}}t.WebrtcExtension=A},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_DATA=void 0,t.TABLE_DATA={"A.1":{r:"hk:if|le:lf|nf:nv|qg:qv|rg:rj|rm:rp|rr:rt|rv:s3|vn:vv|17m:17n|17q:17v|18g:19g|1an:1ao|1cb:1cg|1e5:1ef|1fb:1ff|1fl:1gb|1gd:1gq|1gs:1gu|1hr:1hv|1im:1iv|1ne:1nf|1pd:1pf|1qb:1rv|1ti:280|29q:29r|2ae:2af|2al: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l:9sn|9tv:9uf|9vc:9vf|ao0:bjv|bnk:bnv|bum:bvf|bvs:bvv|c4n:c4o|c80:c84|c9d:c9g|cdo:cff|cgt:cgv|ci4:cig|cjs:cju|cmc:cmf|crn:crq|cuu:cuv|jdm:jfv|17t6:17vv|194d:194f|1967:1avv|1lt4:1lvv|1uhe:1uhf|1ujb:1unv|1uo7:1uoi|1uoo:1uos|1uti:1uui|1va0:1vaf|1vcg:1vch|1ve8:1vef|1vft:1vfv|1vgg:1vgv|1vh4:1vhf|1vi7:1vi8|1vjc:1vjf|1vnt:1vnu|1vtv:1vu1|1vu8:1vu9|1vug:1vuh|1vuo:1vup|1vut:1vuv|1vvf:1vvo|2000:20nv|20p4:20pf|20qb:20vv|2116:2117|212e:3jvv|3k7m:3k7v|3k97:3k99|3keu:3kvv|3l50:3l51|3l53:3l54|3l57:3l58|3l8b:3l8c|3la7:3la9|3ll4:3ll7|3lua:3lud|3m00:3vvt|59mn:5tvv|5ugu:5vvt|6000:7vvt|8000:9vvt|a000:bvvt|c000:dvvt|e000:fvvt|g000:hvvt|i000:jvvt|k000:lvvt|m000:nvvt|o000:pvvt|q000:rvvt|s002:s00v|s040:tvvt",s:"9p8|9qc|9qe|9qn|9tg|147|bkq|3l2l|3l4t|3l5d|3l5q|3l5s|3l61|3l64|3l86|3l8l|3l8t|3l9q|3l9v|3la5|3lah|16f|c20|ccf|cnv|cvv|1b0|1c8|1d2|1dq|1h0|1nv|1oe|284|2c4|2d9|2dh|2dt|2eu|2h9|2hh|2hk|2hn|2ht|2it|2k4|2kc|2ke|2ki|2l9|2lh|2lk|2m6|2ma|2o4|2p9|2ph|2qu|2s4|2sh|2sr|2st|2tm|2u9|304|30d|30h|319|31k|325|329|344|34d|34h|359|35k|365|369|36v|384|38d|38h|399|3a9|3c4|3di|3ds|3el|3en|3k3|3k9|3ko|3l0|3l4|3l6|3lc|3lq|3m5|3m7|3q8|3so|3tt|412|418|41b|4g7|4i7|4i9|4in|4ip|4k7|4k9|4l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7rg;tp|7tj:th;tp|7tk:tc;tp|7tm:th;q2|7tn:th;q2;tp|7ts:th;tp|7tu:tp|7u2:7rk;tp|7u3:tn;tp|7u4:te;tp|7u6:tn;q2|7u7:tn;q2;tp|7uc:tn;tp|7ui:tp;o8;o0|7uj:tp;o8;o1|7um:tp;q2|7un:tp;o8;q2|7v2:u5;o8;o0|7v3:u5;o8;o1|7v4:u1;oj|7v6:u5;q2|7v7:u5;o8;q2|7vi:7rs;tp|7vj:u9;tp|7vk:ue;tp|7vm:u9;q2|7vn:u9;q2;tp|7vs:u9;tp|858:3i;3j|882:33|883:5g;33|887:ir|889:5g;36|88b:38|88c:38|88d:38|88g:39|88h:39|88i:3c|88l:3e|88m:3e;3f|88p:3g|88q:3h|88r:3i|88s:3i|88t:3i|890:3j;3d|891:3k;35;3c|892:3k;3d|894:3q|898:3q|89c:32|89d:33|89g:35|89h:36|89j:3d|89u:tj|89v:u0|8a5:34|crh:38;3g;31|crj:31;3l|crl:3f;3m|cs0:3g;31|cs1:3e;31|cs2:ts;31|cs3:3d;31|cs4:3b;31|cs5:3b;32|cs6:3d;32|cs7:37;32|csa:3g;36|csb:3e;36|csc:ts;36|csg:38;3q|csh:3b;38;3q|csi:3d;38;3q|csj:37;38;3q|csk:3k;38;3q|ct9:3g;31|cta:3b;3g;31|ctb:3d;3g;31|ctc:37;3g;31|ctk:3g;3m|ctl:3e;3m|ctm:ts;3m|ctn:3d;3m|cto:3b;3m|ctp:3d;3m|ctq:3g;3n|ctr:3e;3n|cts:ts;3n|ctt:3d;3n|ctu:3b;3n|ctv:3d;3n|cu0:3b;u9|cu1:3d;u9|cu3:32;3h|cu6:33;8gl;3b;37|cu7:33;3f;1e|cu8:34;32|cu9:37;3p|cub:38;3g|cud:3b;3b|cue:3b;3d|cun:3g;38|cup:3g;3g;3d|cuq:3g;3i|cus:3j;3m|cut:3n;32|1uo0:36;36|1uo1:36;39|1uo2:36;3c|1uo3:36;36;39|1uo4:36;36;3c|1uo5:3j;3k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0:tr|3lr1:ts|3lr2:tt|3lr3:tu|3lr4:tv|3lr5:u0|3lr6:u1|3lr7:to|3lr8:u3|3lr9:u4|3lra:u5|3lrb:u6|3lrc:u7|3lrd:u8|3lre:u9|3ls1:u3|3lsg:th|3lsh:ti|3lsi:tj|3lsj:tk|3lsk:tl|3lsl:tm|3lsm:tn|3lsn:to|3lso:tp|3lsp:tq|3lsq:tr|3lsr:ts|3lss:tt|3lst:tu|3lsu:tv|3lsv:u0|3lt0:u1|3lt1:to|3lt2:u3|3lt3:u4|3lt4:u5|3lt5:u6|3lt6:u7|3lt7:u8|3lt8:u9|3ltr:u3",r:"23:2c|2i:2k|2m:2q|60:6m|6o:6u|bo:bp|c1:c2|c6:c7|c9:cb|ce:ch|cj:ck|cm:co|cs:ct|cv:d0|d6:d7|de:df|dh:dj|dn:do|e4:e5|e7:e8|ea:eb|fh:fi|fm:fo|s8:sa|se:sf|sh:t1|t3:tb|100:11f|19h:1am|7o8:7of|7oo:7ot|7p8:7pf|7po:7pv|7q8:7qd|7r8:7rf|7to:7tr|7u8:7ub|7uo:7ur|7v8:7vc|7vo:7vr|89a:89b|8b0:8bf|95m:96f|1vp1:1vpq|2100:2115",s:"v8|va|vc|ve|vk|130|132|134|136|138|13a|13c|13e|13g|13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl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|19h:1am|7o8:7of|7oo:7ot|7p8:7pf|7po:7pv|7q8:7qd|7r8:7rf|7to:7tr|7u8:7ub|7uo:7ur|7v8:7vc|7vo:7vr|89a:89b|8b0:8bf|95m:96f|1vp1:1vpq|2100:2115",s:"v8|va|vc|ve|vk|130|132|134|136|138|13a|13c|13e|13g|13i|13k|13m|13o|13q|13s|13u|140|14a|14c|14e|14g|14i|14k|14m|14o|14q|14s|14u|150|152|154|156|158|15a|15c|15e|15g|15i|15k|15m|15o|15q|15s|15u|161|163|165|167|169|16b|16d|16g|16i|16k|16m|16o|16q|16s|16u|170|172|174|176|178|17a|17c|17e|17g|17i|17k|17o|180|182|184|186|188|18a|18c|18e|80|82|84|86|88|8a|8c|8e|8g|8i|8k|8m|8o|8q|8s|8u|90|92|94|96|98|9a|9c|9e|9i|9k|9m|9p|9r|9t|9v|a1|a3|a5|a7|aa|ac|ae|ag|ai|ak|am|ao|aq|as|au|b0|b2|b4|b6|b8|ba|bc|be|bg|bi|bk|bm|br|bt|c4|d2|d4|d9|dc|dl|ds|ed|ef|eh|ej|el|en|ep|er|eu|f0|f2|f4|f6|f8|fa|fc|fe|fk|fq|fs|fu|g0|g2|g4|g6|g8|ga|gc|ge|gg|gi|gk|gm|go|gq|gs|gu|h0|h2|h4|h6|h8|ha|hc|he|hg|hi|21|22|7g0|7g2|7g4|7g6|7g8|7ga|7gc|7ge|7gg|7gi|2d|7gk|7gm|7go|7gq|7gs|7gu|7h0|7h2|7h4|7h6|7h8|7ha|7hc|7he|7hg|7hi|7hk|7hm|7ho|7hq|7hs|7hu|7i0|7i2|7i4|7i6|7i8|7ia|7ic|7ie|7ig|7ii|7ik|7im|7io|7iq|7is|7iu|7j0|7j2|7j4|7j6|7j8|7ja|7jc|7je|7jg|7ji|7jk|7jm|2e|7jo|7jq|7js|7ju|7k0|7k2|7k4|7k6|7k8|7ka|7kc|7ke|7kg|7ki|7kk|7l0|7l2|7l4|7l6|7l8|7la|7lc|7le|7lg|7li|7lk|7lm|7lo|7lq|7ls|7lu|7m0|7m2|7m4|7m6|7m8|7ma|7mc|7me|7mg|7mi|7mk|7mm|7mo|7mq|2f|7ms|7mu|7n0|7n2|7n4|7n6|7n8|7na|7nc|7ne|7ng|7ni|7nk|7nm|7no|2g|7qp|7qr|7qt|7qv|2h|896|2l|s6|sc|uo|uq|us|uu|v0|v2|v4|v6"},"C.1.1":{s:"10"},"C.1.2":{r:"800:80b",s:"c00|50|5k0|81f|82v"},"C.2.1":{r:"0:v",s:"3v"},"C.2.2":{r:"40:4v|80c:80d|818:819|830:833|83a:83f|1vvp:1vvs|3kbj:3kbq",s:"1mt|1of|60e|1vnv"},"C.3":{r:"1o00:1u7v|u000:vvvt|10000:11vvt"},"C.4":{r:"1veg:1vff|1vvu:1vvv|3vvu:3vvv|5vvu:5vvv|7vvu:7vvv|9vvu:9vvv|bvvu:bvvv|dvvu:dvvv|fvvu:fvvv|hvvu:hvvv|jvvu:jvvv|lvvu:lvvv|nvvu:nvvv|pvvu:pvvv|rvvu:rvvv|tvvu:tvvv|vvvu:vvvv|11vvu:11vvv"},"C.5":{r:"1m00:1nvv"},"C.6":{r:"1vvp:1vvt"},"C.7":{r:"bvg:bvr"},"C.8":{r:"q0:q1|80e:80f|81a:81e|83a:83f"},"C.9":{r:"s010:s03v",s:"s001"},"D.1":{r:"1eg:1fa|1fg:1fk|1h1:1hq|1i0:1ia|1jd:1jf|1jh:1ml|1n5:1n6|1nq:1nu|1o0:1od|1oi:1pc|1s0:1t5|1uov:1up8|1upa:1upm|1upo:1ups|1uq0:1uq1|1uq3:1uq4|1uq6:1uth|1uuj:1v9t|1vag:1vcf|1vci:1ve7|1vfg:1vfs|1vjg:1vjk|1vjm:1vns",s:"1du|1e0|1e3|1gr|1gv|1mt|1og|1th|1uot|1upu|80f"},"D.2":{r:"21:2q|31:3q|60:6m|6o:7m|7o:h0|h2:hj|ig:ld|lg:lo|lr:m1|mg:mh|n0:n4|s8:sa|se:t1|t3:ue|ug:vl|100:142|14a:16e|16g:17l|17o:17p|180:18f|19h:1am|1ap:1av|1b1:1c7|285:29p|29t:2a0|2a9:2ac|2ao:2b1|2b4:2bg|2c2:2c3|2c5:2cc|2cf:2cg|2cj:2d8|2da:2dg|2dm:2dp|2du:2e0|2e7:2e8|2eb:2ec|2es:2et|2ev:2f1|2f6:2fh|2fk:2fq|2g5:2ga|2gf:2gg|2gj:2h8|2ha:2hg|2hi:2hj|2hl:2hm|2ho:2hp|2hu:2i0|2ip:2is|2j6:2jf|2ji:2jk|2k5:2kb|2kf:2kh|2kj:2l8|2la:2lg|2li:2lj|2ll:2lp|2lt:2m0|2mb:2mc|2n6:2nf|2o2:2o3|2o5:2oc|2of:2og|2oj:2p8|2pa:2pg|2pi:2pj|2pm:2pp|2pt:2pu|2q7:2q8|2qb:2qc|2qs:2qt|2qv:2r1|2r6:2rg|2s5:2sa|2se:2sg|2si:2sl|2sp:2sq|2su:2sv|2t3:2t4|2t8:2ta|2te:2tl|2tn:2tp|2tu:2tv|2u1:2u2|2u6:2u8|2ua:2uc|2v7:2vi|301:303|305:30c|30e:30g|30i:318|31a:31j|31l:31p|321:324|330:331|336:33f|342:343|345:34c|34e:34g|34i:358|35a:35j|35l:35p|360:364|367:368|36a:36b|36l:36m|370:371|376:37f|382:383|385:38c|38e:38g|38i:398|39a:39p|39u:3a0|3a6:3a8|3aa:3ac|3b0:3b1|3b6:3bf|3c2:3c3|3c5:3cm|3cq:3dh|3dj:3dr|3e0:3e6|3ef:3eh|3eo:3ev|3fi:3fk|3g1:3hg|3hi:3hj|3i0:3i6|3if:3ir|3k1:3k2|3k7:3k8|3kk:3kn|3kp:3kv|3l1:3l3|3la:3lb|3ld:3lg|3li:3lj|3m0:3m4|3mg:3mp|3ms:3mt|3o0:3on|3oq:3pk|3pu:3q7|3q9:3ra|3s8:3sb|3tu:3u5|3u7:3uc|400:411|413:417|419:41a|420:42n|450:465|46g:47o|480:4ap|4av:4d2|4d8:4fp|4g0:4g6|4g8:4i6|4ia:4id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u00:5ugt|u000:vvvt|10000:11vvt",s:"3l52|3l5r|3la6|1c9|5a|5l|5q|283|2ag|2di|2en|2iu|2k3|2kd|2m9|2mg|2n0|2q0|2qn|2s3|2ss|2un|35u|36u|3an|3dt|3k4|3ka|3kd|3l5|3l7|3lt|3m6|3pm|3po|3rv|3s5|3uf|41c|41h|41o|47r|4i8|4io|4k8|4lg|4m0|4og|5us|ne|7qp|7qr|7qt|7tu|80e|83h|83v|882|887|88l|894|896|898|rq|s6|sc|8sl"}}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"LRUCache",(function(){return ge}));n(9);var i=n(4),r=n.n(i),s=n(0),o=n.n(s),a=n(7),c=n.n(a);function l(e,t){d(e,t),t.add(e)}function u(e,t,n){d(e,t),t.set(e,n)}function d(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function h(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function p(e,t,n,i){return m(e,t),f(n,"set"),function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,n,i),i}function f(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function m(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}const g="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,y=new Set,v="object"==typeof e&&e?e:{},b=(e,t,n,i)=>{"function"==typeof v.emitWarning?v.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let _=globalThis.AbortController,S=globalThis.AbortSignal;if(void 0===_){var w;S=class{constructor(){c()(this,"onabort",void 0),c()(this,"_onabort",[]),c()(this,"reason",void 0),c()(this,"aborted",!1)}addEventListener(e,t){this._onabort.push(t)}},_=class{constructor(){c()(this,"signal",new S),t()}abort(e){var t,n;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);null===(t=(n=this.signal).onabort)||void 0===t||t.call(n,e)}}};let e="1"!==(null===(w=v.env)||void 0===w?void 0:w.LRU_CACHE_IGNORE_AC_WARNING);const t=()=>{e&&(e=!1,b("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const T=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),I=e=>T(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?A:null:null;class A extends Array{constructor(e){super(e),this.fill(0)}}class E{static create(e){const t=I(e);if(!t)return[];p(E,E,N,!0);const n=new E(e,t);return p(E,E,N,!1),n}constructor(e,t){if(c()(this,"heap",void 0),c()(this,"length",void 0),i=N,m(n=E,E),f(i,"get"),!function(e,t){return t.get?t.get.call(e):t.value}(n,i))throw new TypeError("instantiate Stack using Stack.create(n)");var n,i;this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}var N={writable:!0,value:!1},x=new WeakMap,C=new WeakMap,R=new WeakMap,O=new WeakMap,k=new WeakMap,P=new WeakMap,j=new WeakMap,M=new WeakMap,L=new WeakMap,D=new WeakMap,F=new WeakMap,B=new WeakMap,q=new WeakMap,U=new WeakMap,z=new WeakMap,J=new WeakMap,G=new WeakMap,H=new WeakMap,V=new WeakMap,W=new WeakMap,$=new WeakMap,Q=new WeakMap,K=new WeakMap,Y=new WeakSet,X=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakSet,ie=new WeakMap,re=new WeakMap,se=new WeakMap,oe=new WeakSet,ae=new WeakSet,ce=new WeakSet,le=new WeakSet,ue=new WeakSet,de=new WeakSet,he=new WeakSet,pe=new WeakSet,fe=new WeakSet,me=new WeakSet;class ge{static unsafeExposeInternals(e){return{starts:o()(e,V),ttls:o()(e,W),sizes:o()(e,H),keyMap:o()(e,L),keyList:o()(e,D),valList:o()(e,F),next:o()(e,B),prev:o()(e,q),get head(){return o()(e,U)},get tail(){return o()(e,z)},free:o()(e,J),isBackgroundFetch:t=>h(e,de,Ie).call(e,t),backgroundFetch:(t,n,i,r)=>h(e,ue,Te).call(e,t,n,i,r),moveToTail:t=>h(e,pe,Ee).call(e,t),indexes:t=>h(e,oe,be).call(e,t),rindexes:t=>h(e,ae,_e).call(e,t),isStale:t=>o()(e,te).call(e,t)}}get max(){return o()(this,x)}get maxSize(){return o()(this,C)}get calculatedSize(){return o()(this,M)}get size(){return o()(this,j)}get fetchMethod(){return o()(this,k)}get memoMethod(){return o()(this,P)}get dispose(){return o()(this,R)}get disposeAfter(){return o()(this,O)}constructor(e){l(this,me),l(this,fe),l(this,pe),l(this,he),l(this,de),l(this,ue),l(this,le),l(this,ce),l(this,ae),l(this,oe),l(this,ne),l(this,Y),u(this,x,{writable:!0,value:void 0}),u(this,C,{writable:!0,value:void 0}),u(this,R,{writable:!0,value:void 0}),u(this,O,{writable:!0,value:void 0}),u(this,k,{writable:!0,value:void 0}),u(this,P,{writable:!0,value:void 0}),c()(this,"ttl",void 0),c()(this,"ttlResolution",void 0),c()(this,"ttlAutopurge",void 0),c()(this,"updateAgeOnGet",void 0),c()(this,"updateAgeOnHas",void 0),c()(this,"allowStale",void 0),c()(this,"noDisposeOnSet",void 0),c()(this,"noUpdateTTL",void 0),c()(this,"maxEntrySize",void 0),c()(this,"sizeCalculation",void 0),c()(this,"noDeleteOnFetchRejection",void 0),c()(this,"noDeleteOnStaleGet",void 0),c()(this,"allowStaleOnFetchAbort",void 0),c()(this,"allowStaleOnFetchRejection",void 0),c()(this,"ignoreFetchAbort",void 0),u(this,j,{writable:!0,value:void 0}),u(this,M,{writable:!0,value:void 0}),u(this,L,{writable:!0,value:void 0}),u(this,D,{writable:!0,value:void 0}),u(this,F,{writable:!0,value:void 0}),u(this,B,{writable:!0,value:void 0}),u(this,q,{writable:!0,value:void 0}),u(this,U,{writable:!0,value:void 0}),u(this,z,{writable:!0,value:void 0}),u(this,J,{writable:!0,value:void 0}),u(this,G,{writable:!0,value:void 0}),u(this,H,{writable:!0,value:void 0}),u(this,V,{writable:!0,value:void 0}),u(this,W,{writable:!0,value:void 0}),u(this,$,{writable:!0,value:void 0}),u(this,Q,{writable:!0,value:void 0}),u(this,K,{writable:!0,value:void 0}),u(this,X,{writable:!0,value:()=>{}}),u(this,Z,{writable:!0,value:()=>{}}),u(this,ee,{writable:!0,value:()=>{}}),u(this,te,{writable:!0,value:()=>!1}),u(this,ie,{writable:!0,value:e=>{}}),u(this,re,{writable:!0,value:(e,t,n)=>{}}),u(this,se,{writable:!0,value:(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}}),c()(this,Symbol.toStringTag,"LRUCache");const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:d,allowStale:p,dispose:f,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:v,maxSize:_=0,maxEntrySize:S=0,sizeCalculation:w,fetchMethod:A,memoMethod:N,noDeleteOnFetchRejection:be,noDeleteOnStaleGet:_e,allowStaleOnFetchRejection:Se,allowStaleOnFetchAbort:we,ignoreFetchAbort:Te}=e;if(0!==t&&!T(t))throw new TypeError("max option must be a nonnegative integer");const Ie=t?I(t):Array;if(!Ie)throw new Error("invalid max value: "+t);if(r()(this,x,t),r()(this,C,_),this.maxEntrySize=S||o()(this,C),this.sizeCalculation=w,this.sizeCalculation){if(!o()(this,C)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==N&&"function"!=typeof N)throw new TypeError("memoMethod must be a function if defined");if(r()(this,P,N),void 0!==A&&"function"!=typeof A)throw new TypeError("fetchMethod must be a function if specified");if(r()(this,k,A),r()(this,Q,!!A),r()(this,L,new Map),r()(this,D,new Array(t).fill(void 0)),r()(this,F,new Array(t).fill(void 0)),r()(this,B,new Ie(t)),r()(this,q,new Ie(t)),r()(this,U,0),r()(this,z,0),r()(this,J,E.create(t)),r()(this,j,0),r()(this,M,0),"function"==typeof f&&r()(this,R,f),"function"==typeof m?(r()(this,O,m),r()(this,G,[])):(r()(this,O,void 0),r()(this,G,void 0)),r()(this,$,!!o()(this,R)),r()(this,K,!!o()(this,O)),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!be,this.allowStaleOnFetchRejection=!!Se,this.allowStaleOnFetchAbort=!!we,this.ignoreFetchAbort=!!Te,0!==this.maxEntrySize){if(0!==o()(this,C)&&!T(o()(this,C)))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");h(this,ne,ve).call(this)}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!_e,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!d,this.ttlResolution=T(i)||0===i?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");h(this,Y,ye).call(this)}if(0===o()(this,x)&&0===this.ttl&&0===o()(this,C))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!o()(this,x)&&!o()(this,C)){const e="LRU_CACHE_UNBOUNDED";if((e=>!y.has(e))(e)){y.add(e);b("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,ge)}}}getRemainingTTL(e){return o()(this,L).has(e)?1/0:0}*entries(){for(const e of h(this,oe,be).call(this))void 0===o()(this,F)[e]||void 0===o()(this,D)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield[o()(this,D)[e],o()(this,F)[e]])}*rentries(){for(const e of h(this,ae,_e).call(this))void 0===o()(this,F)[e]||void 0===o()(this,D)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield[o()(this,D)[e],o()(this,F)[e]])}*keys(){for(const e of h(this,oe,be).call(this)){const t=o()(this,D)[e];void 0===t||h(this,de,Ie).call(this,o()(this,F)[e])||(yield t)}}*rkeys(){for(const e of h(this,ae,_e).call(this)){const t=o()(this,D)[e];void 0===t||h(this,de,Ie).call(this,o()(this,F)[e])||(yield t)}}*values(){for(const e of h(this,oe,be).call(this)){void 0===o()(this,F)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield o()(this,F)[e])}}*rvalues(){for(const e of h(this,ae,_e).call(this)){void 0===o()(this,F)[e]||h(this,de,Ie).call(this,o()(this,F)[e])||(yield o()(this,F)[e])}}[Symbol.iterator](){return this.entries()}find(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const n of h(this,oe,be).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;if(void 0!==r&&e(r,o()(this,D)[n],this))return this.get(o()(this,D)[n],t)}}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;for(const n of h(this,oe,be).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,o()(this,D)[n],this)}}rforEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;for(const n of h(this,ae,_e).call(this)){const i=o()(this,F)[n],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;void 0!==r&&e.call(t,r,o()(this,D)[n],this)}}purgeStale(){let e=!1;for(const t of h(this,ae,_e).call(this,{allowStale:!0}))o()(this,te).call(this,t)&&(h(this,fe,Ne).call(this,o()(this,D)[t],"expire"),e=!0);return e}info(e){const t=o()(this,L).get(e);if(void 0===t)return;const n=o()(this,F)[t],i=h(this,de,Ie).call(this,n)?n.__staleWhileFetching:n;if(void 0===i)return;const r={value:i};if(o()(this,W)&&o()(this,V)){const e=o()(this,W)[t],n=o()(this,V)[t];if(e&&n){const t=e-(g.now()-n);r.ttl=t,r.start=Date.now()}}return o()(this,H)&&(r.size=o()(this,H)[t]),r}dump(){const e=[];for(const t of h(this,oe,be).call(this,{allowStale:!0})){const n=o()(this,D)[t],i=o()(this,F)[t],r=h(this,de,Ie).call(this,i)?i.__staleWhileFetching:i;if(void 0===r||void 0===n)continue;const s={value:r};if(o()(this,W)&&o()(this,V)){s.ttl=o()(this,W)[t];const e=g.now()-o()(this,V)[t];s.start=Math.floor(Date.now()-e)}o()(this,H)&&(s.size=o()(this,H)[t]),e.unshift([n,s])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=g.now()-e}this.set(t,n.value,n)}}set(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t)return this.delete(e),this;const{ttl:i=this.ttl,start:s,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n;let{noUpdateTTL:u=this.noUpdateTTL}=n;const d=o()(this,se).call(this,e,t,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),h(this,fe,Ne).call(this,e,"set"),this;let p=0===o()(this,j)?void 0:o()(this,L).get(e);if(void 0===p){var f;p=0===o()(this,j)?o()(this,z):0!==o()(this,J).length?o()(this,J).pop():o()(this,j)===o()(this,x)?h(this,le,we).call(this,!1):o()(this,j),o()(this,D)[p]=e,o()(this,F)[p]=t,o()(this,L).set(e,p),o()(this,B)[o()(this,z)]=p,o()(this,q)[p]=o()(this,z),r()(this,z,p),r()(this,j,(f=o()(this,j),f++,f)),o()(this,re).call(this,p,d,l),l&&(l.set="add"),u=!1}else{h(this,pe,Ee).call(this,p);const n=o()(this,F)[p];if(t!==n){if(o()(this,Q)&&h(this,de,Ie).call(this,n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;if(void 0!==t&&!a){var m,g;if(o()(this,$))null===(m=o()(this,R))||void 0===m||m.call(this,t,e,"set");if(o()(this,K))null===(g=o()(this,G))||void 0===g||g.push([t,e,"set"])}}else if(!a){var y,v;if(o()(this,$))null===(y=o()(this,R))||void 0===y||y.call(this,n,e,"set");if(o()(this,K))null===(v=o()(this,G))||void 0===v||v.push([n,e,"set"])}if(o()(this,ie).call(this,p),o()(this,re).call(this,p,d,l),o()(this,F)[p]=t,l){l.set="replace";const e=n&&h(this,de,Ie).call(this,n)?n.__staleWhileFetching:n;void 0!==e&&(l.oldValue=e)}}else l&&(l.set="update")}if(0===i||o()(this,W)||h(this,Y,ye).call(this),o()(this,W)&&(u||o()(this,ee).call(this,p,i,s),l&&o()(this,Z).call(this,l,p)),!a&&o()(this,K)&&o()(this,G)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var b;null===(b=o()(this,O))||void 0===b||b.call(this,...t)}}return this}pop(){try{for(;o()(this,j);){const e=o()(this,F)[o()(this,U)];if(h(this,le,we).call(this,!0),h(this,de,Ie).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(o()(this,K)&&o()(this,G)){const t=o()(this,G);let n;for(;n=null==t?void 0:t.shift();){var e;null===(e=o()(this,O))||void 0===e||e.call(this,...n)}}}}has(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,r=o()(this,L).get(e);if(void 0!==r){const e=o()(this,F)[r];if(h(this,de,Ie).call(this,e)&&void 0===e.__staleWhileFetching)return!1;if(!o()(this,te).call(this,r))return n&&o()(this,X).call(this,r),i&&(i.has="hit",o()(this,Z).call(this,i,r)),!0;i&&(i.has="stale",o()(this,Z).call(this,i,r))}else i&&(i.has="miss");return!1}peek(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale}=t,i=o()(this,L).get(e);if(void 0===i||!n&&o()(this,te).call(this,i))return;const r=o()(this,F)[i];return h(this,de,Ie).call(this,r)?r.__staleWhileFetching:r}async fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:g,forceRefresh:y=!1,status:v,signal:b}=t;if(!o()(this,Q))return v&&(v.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:v});const _={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:s,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:m,ignoreFetchAbort:f,status:v,signal:b};let S=o()(this,L).get(e);if(void 0===S){v&&(v.fetch="miss");const t=h(this,ue,Te).call(this,e,S,_,g);return t.__returned=t}{const t=o()(this,F)[S];if(h(this,de,Ie).call(this,t)){const e=n&&void 0!==t.__staleWhileFetching;return v&&(v.fetch="inflight",e&&(v.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const r=o()(this,te).call(this,S);if(!y&&!r)return v&&(v.fetch="hit"),h(this,pe,Ee).call(this,S),i&&o()(this,X).call(this,S),v&&o()(this,Z).call(this,v,S),t;const s=h(this,ue,Te).call(this,e,S,_,g),a=void 0!==s.__staleWhileFetching&&n;return v&&(v.fetch=r?"stale":"refresh",a&&r&&(v.returnedStale=!0)),a?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await this.fetch(e,t);if(void 0===n)throw new Error("fetch() returned undefined");return n}memo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=o()(this,P);if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...s}=t,a=this.get(e,s);if(!r&&void 0!==a)return a;const c=n(e,a,{options:s,context:i});return this.set(e,c,s),c}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:s}=t,a=o()(this,L).get(e);if(void 0!==a){const t=o()(this,F)[a],c=h(this,de,Ie).call(this,t);return s&&o()(this,Z).call(this,s,a),o()(this,te).call(this,a)?(s&&(s.get="stale"),c?(s&&n&&void 0!==t.__staleWhileFetching&&(s.returnedStale=!0),n?t.__staleWhileFetching:void 0):(r||h(this,fe,Ne).call(this,e,"expire"),s&&n&&(s.returnedStale=!0),n?t:void 0)):(s&&(s.get="hit"),c?t.__staleWhileFetching:(h(this,pe,Ee).call(this,a),i&&o()(this,X).call(this,a),t))}s&&(s.get="miss")}delete(e){return h(this,fe,Ne).call(this,e,"delete")}clear(){return h(this,me,xe).call(this,"delete")}}function ye(){var e=this;const t=new A(o()(this,x)),n=new A(o()(this,x));r()(this,W,t),r()(this,V,n),r()(this,ee,(function(i,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.now();if(n[i]=0!==r?s:0,t[i]=r,0!==r&&e.ttlAutopurge){const t=setTimeout(()=>{o()(e,te).call(e,i)&&h(e,fe,Ne).call(e,o()(e,D)[i],"expire")},r+1);t.unref&&t.unref()}})),r()(this,X,e=>{n[e]=0!==t[e]?g.now():0}),r()(this,Z,(e,r)=>{if(t[r]){const o=t[r],a=n[r];if(!o||!a)return;e.ttl=o,e.start=a,e.now=i||s();const c=e.now-a;e.remainingTTL=o-c}});let i=0;const s=()=>{const e=g.now();if(this.ttlResolution>0){i=e;const t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{const r=o()(this,L).get(e);if(void 0===r)return 0;const a=t[r],c=n[r];if(!a||!c)return 1/0;return a-((i||s())-c)},r()(this,te,e=>{const r=n[e],o=t[e];return!!o&&!!r&&(i||s())-r>o})}function ve(){const e=new A(o()(this,x));r()(this,M,0),r()(this,H,e),r()(this,ie,t=>{r()(this,M,o()(this,M)-e[t]),e[t]=0}),r()(this,se,(e,t,n,i)=>{if(h(this,de,Ie).call(this,t))return 0;if(!T(n)){if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(n=i(t,e),!T(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n}),r()(this,re,(t,n,i)=>{if(e[t]=n,o()(this,C)){const n=o()(this,C)-e[t];for(;o()(this,M)>n;)h(this,le,we).call(this,!0)}r()(this,M,o()(this,M)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=o()(this,M))})}function*be(){let{allowStale:e=this.allowStale}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o()(this,j))for(let t=o()(this,z);h(this,ce,Se).call(this,t)&&(!e&&o()(this,te).call(this,t)||(yield t),t!==o()(this,U));)t=o()(this,q)[t]}function*_e(){let{allowStale:e=this.allowStale}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(o()(this,j))for(let t=o()(this,U);h(this,ce,Se).call(this,t)&&(!e&&o()(this,te).call(this,t)||(yield t),t!==o()(this,z));)t=o()(this,B)[t]}function Se(e){return void 0!==e&&o()(this,L).get(o()(this,D)[e])===e}function we(e){var t;const n=o()(this,U),i=o()(this,D)[n],s=o()(this,F)[n];if(o()(this,Q)&&h(this,de,Ie).call(this,s))s.__abortController.abort(new Error("evicted"));else if(o()(this,$)||o()(this,K)){var a,c;if(o()(this,$))null===(a=o()(this,R))||void 0===a||a.call(this,s,i,"evict");if(o()(this,K))null===(c=o()(this,G))||void 0===c||c.push([s,i,"evict"])}return o()(this,ie).call(this,n),e&&(o()(this,D)[n]=void 0,o()(this,F)[n]=void 0,o()(this,J).push(n)),1===o()(this,j)?(r()(this,U,r()(this,z,0)),o()(this,J).length=0):r()(this,U,o()(this,B)[n]),o()(this,L).delete(i),r()(this,j,(t=o()(this,j),t--,t)),n}function Te(e,t,n,i){var r=this;const s=void 0===t?void 0:o()(this,F)[t];if(h(this,de,Ie).call(this,s))return s;const a=new _,{signal:c}=n;null==c||c.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});const l={signal:a.signal,options:n,context:i},u=function(i){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{aborted:c}=a.signal,u=n.ignoreFetchAbort&&void 0!==i;if(n.status&&(c&&!s?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,u&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),c&&!u&&!s)return d(a.signal.reason);const f=p;return o()(r,F)[t]===p&&(void 0===i?f.__staleWhileFetching?o()(r,F)[t]=f.__staleWhileFetching:h(r,fe,Ne).call(r,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),r.set(e,i,l.options))),i},d=i=>{const{aborted:r}=a.signal,s=r&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(o()(this,F)[t]===p){!l||void 0===u.__staleWhileFetching?h(this,fe,Ne).call(this,e,"fetch"):s||(o()(this,F)[t]=u.__staleWhileFetching)}if(c)return n.status&&void 0!==u.__staleWhileFetching&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw i};n.status&&(n.status.fetchDispatched=!0);const p=new Promise((t,i)=>{var r;const c=null===(r=o()(this,k))||void 0===r?void 0:r.call(this,e,s,l);c&&c instanceof Promise&&c.then(e=>t(void 0===e?void 0:e),i),a.signal.addEventListener("abort",()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))})}).then(u,e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e))),f=Object.assign(p,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=o()(this,L).get(e)):o()(this,F)[t]=f,f}function Ie(e){if(!o()(this,Q))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof _}function Ae(e,t){o()(this,q)[t]=e,o()(this,B)[e]=t}function Ee(e){e!==o()(this,z)&&(e===o()(this,U)?r()(this,U,o()(this,B)[e]):h(this,he,Ae).call(this,o()(this,q)[e],o()(this,B)[e]),h(this,he,Ae).call(this,o()(this,z),e),r()(this,z,e))}function Ne(e,t){var n;let i=!1;if(0!==o()(this,j)){const n=o()(this,L).get(e);if(void 0!==n)if(i=!0,1===o()(this,j))h(this,me,xe).call(this,t);else{var s;o()(this,ie).call(this,n);const i=o()(this,F)[n];if(h(this,de,Ie).call(this,i))i.__abortController.abort(new Error("deleted"));else if(o()(this,$)||o()(this,K)){var a,c;if(o()(this,$))null===(a=o()(this,R))||void 0===a||a.call(this,i,e,t);if(o()(this,K))null===(c=o()(this,G))||void 0===c||c.push([i,e,t])}if(o()(this,L).delete(e),o()(this,D)[n]=void 0,o()(this,F)[n]=void 0,n===o()(this,z))r()(this,z,o()(this,q)[n]);else if(n===o()(this,U))r()(this,U,o()(this,B)[n]);else{const e=o()(this,q)[n];o()(this,B)[e]=o()(this,B)[n];const t=o()(this,B)[n];o()(this,q)[t]=o()(this,q)[n]}r()(this,j,(s=o()(this,j),s--,s)),o()(this,J).push(n)}}if(o()(this,K)&&(null===(n=o()(this,G))||void 0===n?void 0:n.length)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var l;null===(l=o()(this,O))||void 0===l||l.call(this,...t)}}return i}function xe(e){for(const i of h(this,ae,_e).call(this,{allowStale:!0})){const r=o()(this,F)[i];if(h(this,de,Ie).call(this,r))r.__abortController.abort(new Error("deleted"));else{const s=o()(this,D)[i];var t,n;if(o()(this,$))null===(t=o()(this,R))||void 0===t||t.call(this,r,s,e);if(o()(this,K))null===(n=o()(this,G))||void 0===n||n.push([r,s,e])}}if(o()(this,L).clear(),o()(this,F).fill(void 0),o()(this,D).fill(void 0),o()(this,W)&&o()(this,V)&&(o()(this,W).fill(0),o()(this,V).fill(0)),o()(this,H)&&o()(this,H).fill(0),r()(this,U,0),r()(this,z,0),o()(this,J).length=0,r()(this,M,0),r()(this,j,0),o()(this,K)&&o()(this,G)){const e=o()(this,G);let t;for(;t=null==e?void 0:e.shift();){var i;null===(i=o()(this,O))||void 0===i||i.call(this,...t)}}}}.call(this,n(23))},function(e,t){e.exports=function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){return t.get?t.get.call(e):t.value},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var i=n(91).default,r=n(272);e.exports=function(e){var t=r(e,"string");return"symbol"===i(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var i=n(91).default;e.exports=function(e,t){if("object"!==i(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,a="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,l=a||c||Function("return this")(),u=Object.prototype.toString,d=Math.max,h=Math.min,p=function(){return l.Date.now()};function f(e,t,n){var i,r,s,o,a,c,l=0,u=!1,f=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=i,s=r;return i=r=void 0,l=t,o=e.apply(s,n)}function b(e){return l=e,a=setTimeout(S,t),u?v(e):o}function _(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-l>=s}function S(){var e=p();if(_(e))return w(e);a=setTimeout(S,function(e){var n=t-(e-c);return f?h(n,s-(e-l)):n}(e))}function w(e){return a=void 0,y&&i?v(e):(i=r=void 0,o)}function T(){var e=p(),n=_(e);if(i=arguments,r=this,c=e,n){if(void 0===a)return b(c);if(f)return a=setTimeout(S,t),v(c)}return void 0===a&&(a=setTimeout(S,t)),o}return t=g(t)||0,m(n)&&(u=!!n.leading,s=(f="maxWait"in n)?d(g(n.maxWait)||0,t):s,y="trailing"in n?!!n.trailing:y),T.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=r=a=void 0},T.flush=function(){return void 0===a?o:w(p())},T}function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var a=r.test(e);return a||s.test(e)?o(e.slice(2),a?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return m(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),f(e,t,{leading:i,maxWait:t,trailing:r})}}).call(this,n(15))},function(e,t,n){e.exports=function(){"use strict";var e="undefined"==typeof window,t=!1,n=!1,i=!1,r=!1,s=!1,o=!1,a=!1,c=!1,l=!1,u=!1;return e||(t="undefined"!=typeof InstallTrigger,n=!!window.chrome,i=!(!window.chrome||!window.navigator||!window.navigator.plugins||!window.navigator.plugins.namedItem("Chrome PDF Plugin")&&!window.chrome.runtime),r=n&&!window.chrome.webstore&&!window.chrome.runtime,s=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||window.safari&&window.safari.pushNotification,o=!!window.opr&&!!window.opr.addons||!!window.opera,a=!!window.StyleMedia,c=n&&!!navigator.userAgent.match(/edg/i),l=(i||o)&&!!window.CSS,u=!(n||s||t||o||!document.documentMode)),{get isChrome(){return i},get isChromeOrChromium(){return n},get isChromium(){return r},get isFirefox(){return t},get isSafari(){return s},get isOpera(){return o},get isEdge(){return a},get isEdgeChromium(){return c},get isIE(){return u},get isBlink(){return l}}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitions=void 0;const i=n(3),r=n(2),s={aliases:["message.propose"],element:"propose",fields:{conversationId:i.attribute("inin-cid"),persistentConversationId:i.attribute("inin-persistent-cid"),sdpOverXmpp:i.booleanAttribute("inin-sdp-over-xmpp"),privAnswerMode:i.attribute("inin-priv-answer-mode"),originalRoomJid:i.attribute("inin-ofrom"),autoAnswer:i.booleanAttribute("inin-autoanswer"),fromUserId:i.attribute("inin-user-id"),sessionId:i.attribute("id"),meetingId:i.attribute("inin-meeting-id")},namespace:"urn:xmpp:jingle-message:0"},o={aliases:["message.proceed"],element:"proceed",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},a={aliases:["message.accept"],element:"accept",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},c={aliases:["message.reject"],element:"reject",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},l={aliases:["message.retract"],element:"retract",fields:{sessionId:i.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},u={aliases:["iq.jingle.screenstart"],element:"screen-start",namespace:r.NS_JINGLE_RTP_INFO_1},d={aliases:["iq.jingle.screenstop"],element:"screen-stop",namespace:r.NS_JINGLE_RTP_INFO_1},h={path:"iq",namespace:r.NS_CLIENT,element:"iq",fields:{genesysWebrtc:i.childJSON("genesys","genesys-webrtc")}},p={path:"message",namespace:r.NS_CLIENT,element:"message",fields:{mediaMessage:i.childJSON("genesys","media-message")}},f={aliases:["presence.media"],element:"x",fields:{conversationId:i.attribute("conversationId"),sourceCommunicationId:i.attribute("sourceCommunicationId"),screenShare:i.childAttribute(null,"mediastream","screenShare"),video:i.childAttribute(null,"mediastream","video"),audio:i.childAttribute(null,"mediastream","audio"),listener:i.childAttribute(null,"mediastream","listener"),screenRecording:i.childAttribute(null,"mediastream","screenRecording")},namespace:"orgspan:mediastream"};t.definitions=[s,o,a,c,l,u,d,f,h,p]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(35),s=(0,i.__importDefault)(n(277)),o=(0,i.__importDefault)(n(92));t.default=class{constructor(){this.translators=new Map,this.root=new o.default,this.setLanguageResolver(r.basicLanguageResolver)}setLanguageResolver(e){this.languageResolver=e}import(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{registry:this};if(!this.hasTranslator(e.getNamespace(),e.getName()))return;t.acceptLanguages||(t.acceptLanguages=[]),t.acceptLanguages=t.acceptLanguages.map(e=>e.toLowerCase()),t.lang&&(t.lang=t.lang.toLowerCase()),t.resolveLanguage||(t.resolveLanguage=this.languageResolver),t.path=this.getImportKey(e),t.sanitizers||(t.sanitizers={xhtmlim:s.default});return this.getOrCreateTranslator(e.getNamespace(),e.getName()).import(e,{...t,registry:this})}export(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{registry:this};n.acceptLanguages||(n.acceptLanguages=[]),n.acceptLanguages=n.acceptLanguages.map(e=>e.toLowerCase()),n.lang&&(n.lang=n.lang.toLowerCase()),n.sanitizers||(n.sanitizers={xhtmlim:s.default}),n.path=e;const i=e.split(".").filter(e=>""!==e);let r=this.root;for(const e of i){const t=r.getChild(e);if(!t)return;r=t}return r.export(t,{...n,registry:this})}getImportKey(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t?this.walkToTranslator(t.split(".")):this.root;if(n)return n.getImportKey(e)}define(e){if(Array.isArray(e)){for(const t of e)"object"==typeof t?this.define(t):t(this);return}if("object"!=typeof e)return void e(this);const t=e;t.aliases=t.aliases||[],t.path&&!t.aliases.includes(t.path)&&t.aliases.push(t.path);const n=t.aliases.map(e=>"string"==typeof e?{path:e}:e).sort((e,t)=>{const n=e.path.split(".").length;return t.path.split(".").length-n});let i;if(this.hasTranslator(t.namespace,t.element)&&(i=this.getOrCreateTranslator(t.namespace,t.element)),!i){let e;for(const t of n){const n=this.walkToTranslator(t.path.split("."));if(n&&!n.placeholder){i=n;break}n&&(e=n)}e&&!i&&(i=e,i.placeholder=!1)}i||(i=this.getOrCreateTranslator(t.namespace,t.element)),this.indexTranslator(t.namespace,t.element,i);const r=t.fields||{},s=new Map,o=new Map,a=new Map,c=new Map;t.typeField&&(i.typeField=t.typeField),t.defaultType&&(i.defaultType=t.defaultType),t.versionField&&(i.versionField=t.versionField),t.defaultVersion&&(i.defaultVersion=t.defaultVersion),t.languageField&&(i.languageField=t.languageField);for(const[e,t]of Object.entries(r))s.set(e,t.importer),a.set(e,t.importOrder||t.order||0),o.set(e,t.exporter),c.set(e,t.exportOrder||t.order||0);if(t.childrenExportOrder)for(const[e,n]of Object.entries(t.childrenExportOrder))c.set(e,n||0);const l=new Map;for(const[e,n]of Object.entries(t.optionalNamespaces||{}))l.set(e,n);i.updateDefinition({contexts:new Map,element:t.element,exporterOrdering:c,exporters:o,importerOrdering:a,importers:s,namespace:t.namespace,optionalNamespaces:l,type:t.type,version:t.version,typeOrder:t.typeOrder});for(const e of n)this.alias(t.namespace,t.element,e.path,e.multiple,e.selector,e.contextField,t.type,e.impliedType);for(const e of n){const t=this.walkToTranslator(e.path.split("."));t&&t!==i&&t.replaceWith(i)}}alias(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const c=this.getOrCreateTranslator(e,t);c.placeholder=!1;const l=n.split(".").filter(e=>""!==e),u=l.pop(),d=this.walkToTranslator(l,!0),h=`{${e}}${t}`;o&&(s||a)&&c.addContext(n,r,s,h,o,a),d.addChild(u,c,i,r,h)}walkToTranslator(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.root;for(const i of e){let e=n.getChild(i);if(!e){if(!t)return;e=new o.default,e.placeholder=!0,n.addChild(i,e)}n=e}return n}hasTranslator(e,t){return this.translators.has(`{${e}}${t}`)}getOrCreateTranslator(e,t){let n=this.translators.get(`{${e}}${t}`);return n||(n=new o.default,this.indexTranslator(e,t,n)),n}indexTranslator(e,t,n){this.translators.set(`{${e}}${t}`,n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=new Set(["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul"]),r=new Set(["style"]),s=new Map([["a",new Set(["href","style"])],["body",new Set(["style","xml:lang"])],["blockquote",r],["br",r],["cite",r],["em",r],["img",new Set(["alt","height","src","style","width"])],["li",r],["ol",r],["p",r],["span",r],["strong",r],["ul",r]]),o=new Map([["font-style",/normal|italic|oblique|inherit/i],["font-weight",/normal|bold|bolder|lighter|inherit|\d\d\d/i],["text-decoration",/none|underline|overline|line-through|blink|inherit/i]]),a=e=>!!e.match(/^(https?|xmpp|cid|mailto|ftps?|im|ircs?|sips?|tel|geo|bitcoin|magnet):/i)&&e,c=e=>!!e.match(/^[0-9]*$/)&&e,l={alt:e=>e,height:c,href:a,src:a,style:e=>{const t=(";"+e).replace(/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,"").replace(/\/\*.*/,"").replace(/\\([a-fA-F0-9]{1,6})\s?/,(e,t)=>String.fromCharCode(parseInt(t,16))).match(/;\s*([a-z-]+)\s*:\s*([^;]*[^\s;])\s*/g),n=[];if(!t)return!1;for(const e of t){const t=e.match(/^;\s*([a-z-]+)\s*:\s*([^;]*[^\s])\s*$/);if(!t)continue;const i=o.get(t[1]);if(i){const e=t[2].match(i);e&&n.push(`${t[1]}:${e[0]}`)}}return!!n.length&&n.join("")},width:c};function u(e){if("string"==typeof e)return e;if(!i.has(e.name)){if("script"===e.name)return;return function(e){let t=[];for(const n of e.children)if("string"==typeof n)t.push(n);else{const e=u(n);e&&(Array.isArray(e)?t=t.concat(e):t.push(e))}return t}(e)}const t=e.children.map(u).filter(e=>void 0!==e),n={};for(const[t,i]of Object.entries(e.attributes)){const r=s.get(e.name);if(!r||!r.has(t))continue;if(!i)continue;const o=l[t](i);o&&(n[t]=o)}return{attributes:n,children:t,name:e.name}}t.default=function(e){if("string"==typeof e)return;let t=[];for(const n of e.children){if(!n)continue;if("string"==typeof n){t.push(n);continue}const e=u(n);Array.isArray(e)?t=t.concat(e):e&&t.push(e)}const n={};return"body"===e.name?(void 0!==e.attributes.xmlns&&(n.xmlns=e.attributes.xmlns),e.attributes.style&&(n.style=e.attributes.style),void 0!==e.attributes["xml:lang"]&&(n["xml:lang"]=e.attributes["xml:lang"]),{attributes:n,children:t,name:"body"}):void 0}},function(e,t,n){"use strict";n(9),t.byteLength=function(e){var t=l(e),n=t[0],i=t[1];return 3*(n+i)/4-i},t.toByteArray=function(e){var t,n,i=l(e),o=i[0],a=i[1],c=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),u=0,d=a>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=0,a=n-r;o<a;o+=16383)s.push(u(e,o,o+16383>a?a:o+16383));1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a<c;++a)i[a]=o[a],r[o.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var r,s,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=r)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t,n){"use strict";
32
32
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */t.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,c=(1<<a)-1,l=c>>1,u=-7,d=n?r-1:0,h=n?-1:1,p=e[t+d];for(d+=h,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=i;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===s)s=1-l;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=l}return(p?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,n,i,r,s){var o,a,c,l=8*s-r-1,u=(1<<l)-1,d=u>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?h/c:h*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=f,a/=256,r-=8);for(o=o<<r|a,l+=r;l>0;e[n+p]=255&o,p+=f,o/=256,l-=8);e[n+p-f]|=128*m}},function(e,t,n){"use strict";var i=n(14).Buffer;t.BufferList=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}concat(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t,n,r,s=i.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=s,r=a,t.copy(n,r),a+=o.data.length,o=o.next;return s}}},function(e,t,n){"use strict";e.exports=r;var i=n(98);function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}Object.create(n(32)).inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(14),s=(0,i.__importDefault)(n(31));function o(e,t){return e<<t|e>>>32-t}function a(e,t,n,i,r,s,a){return o(e+(t&n|~t&i)+r+s|0,a)+t|0}function c(e,t,n,i,r,s,a){return o(e+(t&i|n&~i)+r+s|0,a)+t|0}function l(e,t,n,i,r,s,a){return o(e+(t^n^i)+r+s|0,a)+t|0}function u(e,t,n,i,r,s,a){return o(e+(n^(t|~i))+r+s|0,a)+t|0}class d extends s.default{constructor(){super(64,56,"le"),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._m=new Array(16)}_update(e){const t=this._m;for(let n=0;n<16;++n)t[n]=e.readInt32LE(4*n);let n=this._a,i=this._b,r=this._c,s=this._d;n=a(n,i,r,s,t[0],3614090360,7),s=a(s,n,i,r,t[1],3905402710,12),r=a(r,s,n,i,t[2],606105819,17),i=a(i,r,s,n,t[3],3250441966,22),n=a(n,i,r,s,t[4],4118548399,7),s=a(s,n,i,r,t[5],1200080426,12),r=a(r,s,n,i,t[6],2821735955,17),i=a(i,r,s,n,t[7],4249261313,22),n=a(n,i,r,s,t[8],1770035416,7),s=a(s,n,i,r,t[9],2336552879,12),r=a(r,s,n,i,t[10],4294925233,17),i=a(i,r,s,n,t[11],2304563134,22),n=a(n,i,r,s,t[12],1804603682,7),s=a(s,n,i,r,t[13],4254626195,12),r=a(r,s,n,i,t[14],2792965006,17),i=a(i,r,s,n,t[15],1236535329,22),n=c(n,i,r,s,t[1],4129170786,5),s=c(s,n,i,r,t[6],3225465664,9),r=c(r,s,n,i,t[11],643717713,14),i=c(i,r,s,n,t[0],3921069994,20),n=c(n,i,r,s,t[5],3593408605,5),s=c(s,n,i,r,t[10],38016083,9),r=c(r,s,n,i,t[15],3634488961,14),i=c(i,r,s,n,t[4],3889429448,20),n=c(n,i,r,s,t[9],568446438,5),s=c(s,n,i,r,t[14],3275163606,9),r=c(r,s,n,i,t[3],4107603335,14),i=c(i,r,s,n,t[8],1163531501,20),n=c(n,i,r,s,t[13],2850285829,5),s=c(s,n,i,r,t[2],4243563512,9),r=c(r,s,n,i,t[7],1735328473,14),i=c(i,r,s,n,t[12],2368359562,20),n=l(n,i,r,s,t[5],4294588738,4),s=l(s,n,i,r,t[8],2272392833,11),r=l(r,s,n,i,t[11],1839030562,16),i=l(i,r,s,n,t[14],4259657740,23),n=l(n,i,r,s,t[1],2763975236,4),s=l(s,n,i,r,t[4],1272893353,11),r=l(r,s,n,i,t[7],4139469664,16),i=l(i,r,s,n,t[10],3200236656,23),n=l(n,i,r,s,t[13],681279174,4),s=l(s,n,i,r,t[0],3936430074,11),r=l(r,s,n,i,t[3],3572445317,16),i=l(i,r,s,n,t[6],76029189,23),n=l(n,i,r,s,t[9],3654602809,4),s=l(s,n,i,r,t[12],3873151461,11),r=l(r,s,n,i,t[15],530742520,16),i=l(i,r,s,n,t[2],3299628645,23),n=u(n,i,r,s,t[0],4096336452,6),s=u(s,n,i,r,t[7],1126891415,10),r=u(r,s,n,i,t[14],2878612391,15),i=u(i,r,s,n,t[5],4237533241,21),n=u(n,i,r,s,t[12],1700485571,6),s=u(s,n,i,r,t[3],2399980690,10),r=u(r,s,n,i,t[10],4293915773,15),i=u(i,r,s,n,t[1],2240044497,21),n=u(n,i,r,s,t[8],1873313359,6),s=u(s,n,i,r,t[15],4264355552,10),r=u(r,s,n,i,t[6],2734768916,15),i=u(i,r,s,n,t[13],1309151649,21),n=u(n,i,r,s,t[4],4149444226,6),s=u(s,n,i,r,t[11],3174756917,10),r=u(r,s,n,i,t[2],718787259,15),i=u(i,r,s,n,t[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+i|0,this._c=this._c+r|0,this._d=this._d+s|0}_hash(){const e=r.Buffer.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e}}t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(14),s=(0,i.__importDefault)(n(31)),o=[1518500249,1859775393,-1894007588,-899497514];function a(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}class u extends s.default{constructor(){super(64,56),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this._w=new Array(80)}_update(e){const t=this._w;let n,i=0|this._a,r=0|this._b,s=0|this._c,u=0|this._d,d=0|this._e;for(n=0;n<16;++n)t[n]=e.readInt32BE(4*n);for(;n<80;++n)t[n]=(h=t[n-3]^t[n-8]^t[n-14]^t[n-16])<<1|h>>>31;var h;for(let e=0;e<80;++e){const n=~~(e/20),h=a(i)+l(n,r,s,u)+d+t[e]+o[n]|0;d=u,u=s,s=c(r),r=i,i=h}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=u+this._d|0,this._e=d+this._e|0}_hash(){const e=r.Buffer.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e}}t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(14),s=(0,i.__importDefault)(n(31)),o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function a(e,t,n){return n^e&(t^n)}function c(e,t,n){return e&t|n&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function u(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}class h extends s.default{constructor(){super(64,56),this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this._w=new Array(64)}_update(e){const t=this._w;let n,i=0|this._a,r=0|this._b,s=0|this._c,h=0|this._d,p=0|this._e,f=0|this._f,m=0|this._g,g=0|this._h;for(n=0;n<16;++n)t[n]=e.readInt32BE(4*n);for(;n<64;++n)t[n]=0|(((y=t[n-2])>>>17|y<<15)^(y>>>19|y<<13)^y>>>10)+t[n-7]+d(t[n-15])+t[n-16];var y;for(let e=0;e<64;++e){const n=g+u(p)+a(p,f,m)+o[e]+t[e]|0,d=l(i)+c(i,r,s)|0;g=m,m=f,f=p,p=h+n|0,h=s,s=r,r=i,i=n+d|0}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=h+this._d|0,this._e=p+this._e|0,this._f=f+this._f|0,this._g=m+this._g|0,this._h=g+this._h|0}_hash(){const e=r.Buffer.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e}}t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(14),s=(0,i.__importDefault)(n(31)),o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function a(e,t,n){return n^e&(t^n)}function c(e,t,n){return e&t|n&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function u(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function p(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function f(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}class g extends s.default{constructor(){super(128,112),this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this._w=new Array(160)}_update(e){const t=this._w;let n,i,r=0|this._ah,s=0|this._bh,g=0|this._ch,y=0|this._dh,v=0|this._eh,b=0|this._fh,_=0|this._gh,S=0|this._hh,w=0|this._al,T=0|this._bl,I=0|this._cl,A=0|this._dl,E=0|this._el,N=0|this._fl,x=0|this._gl,C=0|this._hl,R=0;for(R=0;R<32;R+=2)t[R]=e.readInt32BE(4*R),t[R+1]=e.readInt32BE(4*R+4);for(;R<160;R+=2){let e=t[R-30],r=t[R-30+1];const s=d(e,r),o=h(r,e);e=t[R-4],r=t[R-4+1];const a=p(e,r),c=f(r,e),l=t[R-14],u=t[R-14+1],g=t[R-32],y=t[R-32+1];i=o+u|0,n=s+l+m(i,o)|0,i=i+c|0,n=n+a+m(i,c)|0,i=i+y|0,n=n+g+m(i,y)|0,t[R]=n,t[R+1]=i}for(let e=0;e<160;e+=2){n=t[e],i=t[e+1];const d=c(r,s,g),h=c(w,T,I),p=l(r,w),f=l(w,r),R=u(v,E),O=u(E,v),k=o[e],P=o[e+1],j=a(v,b,_),M=a(E,N,x);let L=C+O|0,D=S+R+m(L,C)|0;L=L+M|0,D=D+j+m(L,M)|0,L=L+P|0,D=D+k+m(L,P)|0,L=L+i|0,D=D+n+m(L,i)|0;const F=f+h|0,B=p+d+m(F,f)|0;S=_,C=x,_=b,x=N,b=v,N=E,E=A+L|0,v=y+D+m(E,A)|0,y=g,A=I,g=s,I=T,s=r,T=w,w=L+F|0,r=D+B+m(w,L)|0}this._al=this._al+w|0,this._bl=this._bl+T|0,this._cl=this._cl+I|0,this._dl=this._dl+A|0,this._el=this._el+E|0,this._fl=this._fl+N|0,this._gl=this._gl+x|0,this._hl=this._hl+C|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+s+m(this._bl,T)|0,this._ch=this._ch+g+m(this._cl,I)|0,this._dh=this._dh+y+m(this._dl,A)|0,this._eh=this._eh+v+m(this._el,E)|0,this._fh=this._fh+b+m(this._fl,N)|0,this._gh=this._gh+_+m(this._gl,x)|0,this._hh=this._hh+S+m(this._hl,C)|0}_hash(){const e=r.Buffer.allocUnsafe(64);function t(t,n,i){e.writeInt32BE(t,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e}}t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(14),s=n(56),o=(0,i.__importDefault)(n(93)),a=r.Buffer.alloc(128);class c extends s.Transform{constructor(e,t){super(),"string"==typeof t&&(t=r.Buffer.from(t));const n="sha512"===e?128:64;this._alg=e,t.length>n?t=(0,o.default)(e).update(t).digest():t.length<n&&(t=r.Buffer.concat([t,a],n)),this._ipad=r.Buffer.alloc(n),this._opad=r.Buffer.alloc(n);for(let e=0;e<n;e++)this._ipad[e]=54^t[e],this._opad[e]=92^t[e];this._hash=(0,o.default)(e).update(this._ipad)}_transform(e,t,n){let i;try{this.update(e,t)}catch(e){i=e}finally{n(i)}}_flush(e){let t;try{this.push(this._final())}catch(e){t=e}e(t)}_final(){const e=this._hash.digest();return(0,o.default)(this._alg).update(this._opad).update(e).digest()}update(e,t){return this._hash.update(e,t),this}digest(e){const t=this._final()||r.Buffer.alloc(0);return e?t.toString(e):t}}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pubsubItemContentAliases=t.extendStanzaError=t.extendStreamFeatures=t.extendIQ=t.extendPresence=t.extendMessage=t.addAlias=t.childJID=t.childJIDAttribute=t.JIDAttribute=void 0;const i=n(2),r=n(55);t.JIDAttribute=r.attribute,t.childJIDAttribute=r.childAttribute,t.childJID=r.childText,t.addAlias=function(e,t,n){return{aliases:Array.isArray(n)?n:[n],element:t,fields:{},namespace:e}},t.extendMessage=function(e){return{element:"message",fields:e,namespace:i.NS_CLIENT}},t.extendPresence=function(e){return{element:"presence",fields:e,namespace:i.NS_CLIENT}},t.extendIQ=function(e){return{element:"iq",fields:e,namespace:i.NS_CLIENT}},t.extendStreamFeatures=function(e){return{element:"features",fields:e,namespace:i.NS_STREAM}},t.extendStanzaError=function(e){return{element:"error",fields:e,namespace:i.NS_STANZAS,path:"stanzaError"}},t.pubsubItemContentAliases=function(){return[{path:"pubsubcontent",contextField:"itemType"},{path:"pubsubitem.content",contextField:"itemType"},{path:"pubsubeventitem.content",contextField:"itemType"},{path:"iq.pubsub.publish.items",contextField:"itemType"}]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(12),s=(0,i.__importDefault)(n(34)),o=(0,i.__importDefault)(n(54)),a=(0,i.__importDefault)(n(57));class c extends r.Transform{constructor(e){super({objectMode:!0}),this.closedStream=!1,this.wrappedStream=!1,this.registry=e.registry,this.acceptLanguages=e.acceptLanguages||[],e.wrappedStream&&(this.wrappedStream=!0,this.rootImportKey=e.rootKey),this.parser=new a.default({allowComments:e.allowComments}),this.parser.on("error",e=>{this.destroy(e)}),this.parser.on("startElement",(e,t)=>{if(this.destroyed)return;if(this.closedStream)return this.destroy(o.default.alreadyClosed());const n=new s.default(e,t),i=this.registry.getImportKey(n);if(this.wrappedStream&&!this.rootElement){if(this.rootImportKey&&i!==this.rootImportKey)return this.destroy(o.default.unknownRoot());const e=this.registry.import(n,{acceptLanguages:this.acceptLanguages,lang:this.lang});return e?(this.rootElement=n,void this.push({event:"stream-start",kind:i,stanza:e,xml:n})):this.destroy(o.default.notWellFormed())}this.currentElement?this.currentElement=this.currentElement.appendChild(n):this.currentElement=n}),this.parser.on("endElement",e=>{if(!this.destroyed){if(this.wrappedStream&&!this.currentElement)return this.rootElement&&e===this.rootElement.name?(this.closedStream=!0,this.push({event:"stream-end",kind:this.rootImportKey,stanza:{},xml:this.rootElement}),this.end()):(this.closedStream=!0,this.destroy(o.default.notWellFormed()));if(!this.currentElement||e!==this.currentElement.name)return this.closedStream=!0,this.destroy(o.default.notWellFormed());if(this.currentElement.parent)this.currentElement=this.currentElement.parent;else{this.wrappedStream&&(this.currentElement.parent=this.rootElement);const e=this.registry.getImportKey(this.currentElement),t=this.registry.import(this.currentElement,{acceptLanguages:this.acceptLanguages,lang:this.lang});t&&this.push({kind:e,stanza:t,xml:this.currentElement}),this.currentElement=void 0}}}),this.parser.on("text",e=>{this.currentElement&&this.currentElement.children.push(e)})}_transform(e,t,n){this.parser.write(e.toString()),n()}}t.default=c},function(e,t,n){"use strict";function i(e){return"getStats"===e.name}function r(e){let t={};return Object.assign(t,s(e.tracks,"localTrack")),delete e.tracks,Object.assign(t,s(e.remoteTracks,"remoteTrack")),delete e.remoteTracks,t}function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={};if(Array.isArray(e))for(let i=0;i<e.length;i++)Object.assign(n,s(e[i],`${t}_[${i}]`));else"object"!=typeof e?n[t]=e:Object.keys(e).filter(e=>"ip"!==e.toLowerCase()).forEach(i=>{const r=e[i],o=t?`${t}_${i}`:i;"object"==typeof r||Array.isArray(r)?Object.assign(n,s(r,o)):n[o]=r});return n}Object.defineProperty(t,"__esModule",{value:!0}),t.deepFlatten=t.formatStatsEvent=void 0,t.formatStatsEvent=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={_eventType:e.name,_eventTimestamp:(new Date).getTime(),...t};i(e)&&Object.assign(n,r(e)),Object.assign(n,s(e)),delete n.name;const o={actionName:"WebrtcStats",details:n};return o},t.deepFlatten=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(10),s=n(8),o=n(2),a=n(12),c=n(17),l=(0,i.__importDefault)(n(99)),u=(0,i.__importDefault)(n(101)),d=(0,i.__importDefault)(n(62));class h extends r.EventEmitter{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),e=e||{},this.selfID=e.selfID,this.sessions={},this.peers={},this.iceServers=e.iceServers||[],this.prepareSession=e.prepareSession||(e=>{if(this.config.hasRTCPeerConnection)return e.applicationTypes.indexOf(o.NS_JINGLE_RTP_1)>=0?new u.default(e):e.applicationTypes.indexOf(o.NS_JINGLE_FILE_TRANSFER_5)>=0?new l.default(e):void 0}),this.performTieBreak=e.performTieBreak||((e,t)=>{const n=(t.jingle.contents||[]).map(e=>{if(e.application)return e.application.applicationType});return(e.pendingApplicationTypes||[]).filter(e=>n.includes(e)).length>0}),this.createPeerConnection=e.createPeerConnection||((e,t)=>{if(a.RTCPeerConnection)return new a.RTCPeerConnection(t)}),this.config={debug:!1,hasRTCPeerConnection:!!a.RTCPeerConnection,peerConnectionConfig:{bundlePolicy:e.bundlePolicy||"balanced",iceTransportPolicy:e.iceTransportPolicy||"all",rtcpMuxPolicy:e.rtcpMuxPolicy||"require",sdpSemantics:e.sdpSemantics},peerConnectionConstraints:{optional:[{DtlsSrtpKeyAgreement:!0},{RtpDataChannels:!1}]},...e}}addICEServer(e){if("string"==typeof e)return void this.iceServers.push({urls:e});if(!(t=e).type&&(t.urls||t.url))return void this.iceServers.push(e);var t;let n=e.host||"";n.indexOf(":")>=0&&(n=`[${n}]`);let i=`${e.type}:${n}`;e.port&&(i+=":"+e.port),e.transport&&(i+="?transport="+e.transport),"turn"===e.type||"turns"===e.type?this.iceServers.push({credential:e.password,urls:[i],username:e.username}):"stun"!==e.type&&"stuns"!==e.type||this.iceServers.push({urls:[i]})}resetICEServers(){this.iceServers=[]}addSession(e){e.parent=this;const t=e.sid,n=e.peerID;return this.sessions[t]=e,this.peers[n]||(this.peers[n]=[]),this.peers[n].push(e),this.emit("createdSession",e),e}forgetSession(e){const t=this.peers[e.peerID]||[];t.length&&t.splice(t.indexOf(e),1),delete this.sessions[e.sid]}createMediaSession(e,t,n){const i=new u.default({config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!0,maxRelayBandwidth:786432,parent:this,peerID:e,sid:t,stream:n});return this.addSession(i),i}createFileTransferSession(e,t){const n=new l.default({config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!0,maxRelayBandwidth:786432,parent:this,peerID:e,sid:t});return this.addSession(n),n}endPeerSessions(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=this.peers[e]||[];delete this.peers[e];for(const e of i)e.end(t||"gone",n)}endAllSessions(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(const n of Object.keys(this.peers))this.endPeerSessions(n,e,t)}process(e){const t=e.jingle?e.jingle.sid:void 0;let n=t?this.sessions[t]:void 0;const i=e.id,r=e.from;if(!r)return;if("error"===e.type){if(this._log("error","Received error response",e),n&&e.error&&"unknown-session"===e.error.jingleError)return n.end("gone",!0);const t=e.error&&"tie-break"===e.error.jingleError;return n&&"pending"===n.state&&t?n.end("alternative-session",!0):void(n&&(n.pendingAction=void 0))}if("result"===e.type)return void(n&&(n.pendingAction=void 0));const o=e.jingle.action,a=e.jingle.contents||[],l=a.map(e=>e.application?e.application.applicationType:void 0),u=a.map(e=>e.transport?e.transport.transportType:void 0);if(o!==s.JingleAction.SessionInitiate){if(!n)return"session-terminate"===o?void this.emit("send",{id:i,to:r,type:"result"}):(this._log("error","Unknown session",t),this._sendError(r,i,{condition:"item-not-found",jingleError:"unknown-session"}));if(n.peerID!==r||"ended"===n.state)return this._log("error","Session has ended, or action has wrong sender"),this._sendError(r,i,{condition:"item-not-found",jingleError:"unknown-session"});if("session-accept"===o&&"pending"!==n.state)return this._log("error","Tried to accept session twice",t),this._sendError(r,i,{condition:"unexpected-request",jingleError:"out-of-order"});if("session-terminate"!==o&&o===n.pendingAction&&(this._log("error","Tie break during pending request"),n.isInitiator))return this._sendError(r,i,{condition:"conflict",jingleError:"tie-break"})}else if(n){if(n.peerID!==r)return this._log("error","Duplicate sid from new sender"),this._sendError(r,i,{condition:"service-unavailable"});if("pending"!==n.state)return this._log("error","Someone is doing this wrong"),this._sendError(r,i,{condition:"unexpected-request",jingleError:"out-of-order"});if(this.selfID&&this.selfID>n.peerID&&this.performTieBreak(n,e))return this._log("error","Tie break new session because of duplicate sids"),this._sendError(r,i,{condition:"conflict",jingleError:"tie-break"})}else if(this.peers[r]&&this.peers[r].length)for(let n=0,s=this.peers[r].length;n<s;n++){const s=this.peers[r][n];if(s&&"pending"===s.state&&t&&(0,c.octetCompare)(s.sid,t)>0&&this.performTieBreak(s,e))return this._log("info","Tie break session-initiate"),this._sendError(r,i,{condition:"conflict",jingleError:"tie-break"})}if("session-initiate"===o){if(!a.length)return this._sendError(r,i,{condition:"bad-request"});n=this._createIncomingSession({applicationTypes:l,config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!1,parent:this,peerID:r,sid:t,transportTypes:u},e)}n.process(o,e.jingle,t=>{t?(this._log("error","Could not process request",e,t),this._sendError(r,i,t)):(this.emit("send",{id:i,to:r,type:"result"}),"session-initiate"===o&&this.emit("incoming",n))})}signal(e,t){const n=t.jingle&&t.jingle.action;e.isInitiator&&n===s.JingleAction.SessionInitiate&&this.emit("outgoing",e),this.emit("send",t)}_createIncomingSession(e,t){let n;return this.prepareSession&&(n=this.prepareSession(e,t)),n||(n=new d.default(e)),this.addSession(n),n}_sendError(e,t,n){n.type||(n.type="cancel"),this.emit("send",{error:n,id:t,to:e,type:"error"})}_log(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];this.emit("log",e,t,...i),this.emit("log:"+e,t,...i)}}t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Ping=void 0;t.Ping=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.client=e,this.stanzaInstance=t,this.options=n,this.pingInterval=n.pingInterval||14e3,this.failedPingsBeforeDisconnect=n.failedPingsBeforeDisconnect||1,this.numberOfFailedPings=0,this.nextPingTimeoutId=void 0,this.start()}start(){this.nextPingTimeoutId||(this.nextPingTimeoutId=-1,this.queueNextPing())}stop(){clearTimeout(this.nextPingTimeoutId),this.nextPingTimeoutId=void 0,this.numberOfFailedPings=0}async performPing(){var e;try{await this.stanzaInstance.ping(this.options.jid),this.numberOfFailedPings=0,this.queueNextPing()}catch(t){const n={channelId:this.client.config.channelId,jid:this.stanzaInstance.jid,stanzaInstanceId:this.stanzaInstance.id};this.client.logger.warn("Missed a ping.",Object.assign({error:t},n)),++this.numberOfFailedPings>this.failedPingsBeforeDisconnect?(this.client.logger.error("Missed too many pings, disconnecting",Object.assign({numberOfFailedPings:this.numberOfFailedPings},n)),this.stanzaInstance.sendStreamError({text:"too many missed pongs",condition:"connection-timeout"}),this.stop(),null===(e=this.stanzaInstance.transport)||void 0===e||e.disconnect(!1)):this.queueNextPing()}}queueNextPing(){this.nextPingTimeoutId&&(this.nextPingTimeoutId=setTimeout(this.performPing.bind(this),this.pingInterval))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerMonitor=void 0;t.ServerMonitor=class{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.client=e,this.stanzaInstance=t,this.stanzaTimeout=n.stanzaTimeout||7e4,this.timeoutId=void 0,this.start()}start(){this.boundSetupStanzaTimeout=this.setupStanzaTimeout.bind(this),this.client.on("connected",this.boundSetupStanzaTimeout),this.stanzaInstance.on("raw:incoming",this.boundSetupStanzaTimeout)}stop(){clearTimeout(this.timeoutId),this.timeoutId=void 0,this.boundSetupStanzaTimeout&&(this.client.off("connected",this.boundSetupStanzaTimeout),this.stanzaInstance.off("raw:incoming",this.boundSetupStanzaTimeout),this.boundSetupStanzaTimeout=void 0)}setupStanzaTimeout(){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{var e;const t={channelId:this.client.config.channelId,jid:this.stanzaInstance.jid,stanzaInstanceId:this.stanzaInstance.id,timeout:this.stanzaTimeout};this.client.logger.error("Time between XMPP stanzas exceeded timeout, disconnecting",t),this.stanzaInstance.sendStreamError({text:"time between stanzas exceeded timeout",condition:"connection-timeout"}),this.stop(),null===(e=this.stanzaInstance.transport)||void 0===e||e.disconnect(!1)},this.stanzaTimeout)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionManager=void 0;const i=n(26),r=n(295),s=n(28),o=i.__importDefault(n(206)),a=n(16);t.ConnectionManager=class{constructor(e,t){this.logger=e,this.config=t}setConfig(e){this.config=e}async getNewStanzaConnection(){const e=this.getStanzaOptions(),t=r.createClient({});t.sasl.mechanisms.find(e=>"ANONYMOUS"===e.name).priority=0,t.sasl.mechanisms=t.sasl.mechanisms.sort((e,t)=>t.priority-e.priority),t.id=s.v4();const n=t.channelId=this.config.channelId;let i,o,c,l;const u=a.timeoutPromise((n,r)=>{i=this.checkForErrorStanza.bind(this,t),t.on("raw:incoming",i),o=this.handleSessionStarted.bind(this,t,n),t.on("session:started",o),c=this.handleSessionSasl.bind(this,t,r),t.on("sasl",c),l=this.handleSessionDisconnected.bind(this,t,r),t.on("disconnected",l),t.updateConfig(e),t.connect()},15e3,"connecting to streaming service",{channelId:n,stanzaInstanceId:t.id});return u.catch(()=>t.disconnect()),u.finally(()=>{t.off("raw:incoming",i),t.off("session:started",o),t.off("sasl",c),t.off("disconnected",l)})}handleSessionStarted(e,t){this.logger.info("new stanza instance connected",{stanzaInstanceId:e.id,channelId:e.channelId}),t(e)}handleSessionSasl(e,t,n){"failure"===n.type&&t(new o.default(n.condition,e.channelId,e.id))}handleSessionDisconnected(e,t){this.logger.error("stanza disconnected",{stanzaInstanceId:e.id,channelId:e.channelId}),t()}checkForErrorStanza(e,t){t.includes("error")&&this.logger.error("Received a stanza during setup that tripped the error filter",{rawStanza:t,stanzaInstanceId:e.id,channelId:e.channelId})}getStanzaOptions(){return this.config.jwt?this.getJwtOptions():this.getStandardOptions()}getJwtOptions(){const e=this.config,t=a.parseJwt(e.jwt);let n;try{n=t.data.jid.split("@")[1].replace("conference.","")}catch(e){throw new Error("failed to parse jid")}let i=e.host.replace(/\/$/,"");return{resource:e.jidResource,transports:{websocket:`${i}/stream/jwt/${e.jwt}`},server:n}}getStandardOptions(){const e=this.config;let t=e.host.replace(/\/$/,"");return{jid:e.jid,resource:e.jidResource,credentials:{username:e.jid,password:"authKey:"+e.authToken},transports:{websocket:`${t}/stream/channels/${e.channelId}`}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createClient=t.VERSION=t.Platform=t.SASL=t.RTT=t.RSM=t.Utils=t.Jingle=t.Stanzas=t.Namespaces=t.JID=t.JXT=t.DataForms=t.Constants=t.Client=void 0;const i=n(6),r=(0,i.__importDefault)(n(296));t.Client=r.default;const s=(0,i.__importStar)(n(8));t.Constants=s;const o=(0,i.__importStar)(n(302));t.RTT=o;const a=(0,i.__importStar)(n(13));t.JID=a;const c=(0,i.__importStar)(n(59));t.Jingle=c;const l=(0,i.__importStar)(n(3));t.JXT=l;const u=(0,i.__importStar)(n(105));t.SASL=u;const d=(0,i.__importStar)(n(2));t.Namespaces=d;const h=(0,i.__importStar)(n(125));t.Stanzas=h;const p=(0,i.__importStar)(n(17));t.Utils=p;const f=(0,i.__importStar)(n(12));t.Platform=f,(0,i.__exportStar)(n(104),t);const m=(0,i.__importStar)(n(303));t.RSM=m;const g=(0,i.__importStar)(n(117));t.DataForms=g,t.VERSION=s.VERSION;const y=(0,i.__importDefault)(n(65));(0,i.__exportStar)(n(65),t),t.createClient=function(e){const t=new r.default(e);return t.use(y.default),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(63),s=n(10),o=(0,i.__importDefault)(n(104)),a=(0,i.__importStar)(n(13)),c=(0,i.__importStar)(n(3)),l=(0,i.__importStar)(n(105)),u=n(65),d=(0,i.__importDefault)(n(125)),h=(0,i.__importDefault)(n(299)),p=(0,i.__importDefault)(n(300)),f=n(17),m=(0,i.__importDefault)(n(301));class g extends s.EventEmitter{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.reconnectAttempts=0,this.setMaxListeners(100),this.off=this.removeListener,this.updateConfig(e),this.jid="",this.sasl=new l.Factory,this.sasl.register("EXTERNAL",l.EXTERNAL,1e3),this.sasl.register("SCRAM-SHA-256-PLUS",l.SCRAM,350),this.sasl.register("SCRAM-SHA-256",l.SCRAM,300),this.sasl.register("SCRAM-SHA-1-PLUS",l.SCRAM,250),this.sasl.register("SCRAM-SHA-1",l.SCRAM,200),this.sasl.register("DIGEST-MD5",l.DIGEST,100),this.sasl.register("OAUTHBEARER",l.OAUTH,100),this.sasl.register("X-OAUTH2",l.PLAIN,50),this.sasl.register("PLAIN",l.PLAIN,1),this.sasl.register("ANONYMOUS",l.ANONYMOUS,0),this.stanzas=new c.Registry,this.stanzas.define(d.default),this.resolver=new m.default,this.use(u.core),this.sm=new o.default,void 0!==this.config.allowResumption&&(this.sm.allowResume=this.config.allowResumption),this.sm.on("prebound",e=>{this.jid=e,this.emit("session:bound",e)}),this.on("session:bound",e=>this.sm.bind(e)),this.sm.on("send",e=>this.send("sm",e)),this.sm.on("acked",e=>this.emit("stanza:acked",e)),this.sm.on("failed",e=>this.emit("stanza:failed",e)),this.sm.on("hibernated",e=>this.emit("stanza:hibernated",e)),this.sm.on("begin-resend",()=>this.outgoingDataQueue.pause()),this.sm.on("resend",e=>{let{kind:t,stanza:n}=e;return this.send(t,n,!0)}),this.sm.on("end-resend",()=>this.outgoingDataQueue.resume());for(const e of["acked","hibernated","failed"])this.on("stanza:"+e,t=>{"message"===t.kind&&this.emit("message:"+e,t.stanza)});this.transports={bosh:h.default,websocket:p.default},this.incomingDataQueue=(0,r.priorityQueue)(async(e,t)=>{const{kind:n,stanza:i}=e;this.emit(n,i),i.id&&this.emit(n+":id:"+i.id,i),"message"===n||"presence"===n||"iq"===n?(this.emit("stanza",i),await this.sm.handle()):"sm"===n&&("ack"===i.type&&(await this.sm.process(i),this.emit("stream:management:ack",i)),"request"===i.type&&this.sm.ack()),t&&t()},1);const t=(e,t)=>{["message","presence","iq"].includes(e)&&(this.sm.started&&this.sm.resumable?this.sm.resumable&&!this.transport&&this.emit("stanza:hibernated",{kind:e,stanza:t}):this.emit("stanza:failed",{kind:e,stanza:t}))};this.outgoingDataQueue=(0,r.priorityQueue)(async(e,n)=>{var i;const{kind:r,stanza:s,replay:o}=e,a=o||await this.sm.track(r,s);if("message"===r&&(o?this.emit("message:retry",s):this.emit("message:sent",s,!1)),this.transport)try{await this.transport.send(r,s),a&&(null===(i=this.transport)||void 0===i||i.send("sm",{type:"request"}))}catch(e){console.error(e),t(r,s)}else t(r,s);n&&n()},1),this.on("stream:data",(e,t)=>{this.incomingDataQueue.push({kind:t,stanza:e},0)}),this.on("--transport-disconnected",async()=>{const e=[];this.incomingDataQueue.idle()||e.push(this.incomingDataQueue.drain()),this.outgoingDataQueue.idle()||e.push(this.outgoingDataQueue.drain()),await Promise.all(e),await this.sm.hibernate(),this.transport&&delete this.transport,this.emit("--reset-stream-features"),!this.sessionTerminating&&this.config.autoReconnect&&(this.reconnectAttempts+=1,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>{this.connect()},1e3*Math.min(Math.pow(2,this.reconnectAttempts)+Math.random(),this.config.maxReconnectBackoff||32))),this.emit("disconnected")}),this.on("iq",e=>{const t=e.type,n=e.payloadType,i="iq:"+t+":"+n;if("get"===t||"set"===t){if("invalid-payload-count"===n)return this.sendIQError(e,{error:{condition:"bad-request",type:"modify"}});if("unknown-payload"===n||0===this.listenerCount(i))return this.sendIQError(e,{error:{condition:"service-unavailable",type:"cancel"}});this.emit(i,e)}}),this.on("message",e=>{const t=e.alternateLanguageBodies&&e.alternateLanguageBodies.length||e.links&&e.links.length,n=e.marker&&"markable"!==e.marker.type;t&&!n&&("chat"===e.type||"normal"===e.type?this.emit("chat",e):"groupchat"===e.type&&this.emit("groupchat",e)),"error"===e.type&&this.emit("message:error",e)}),this.on("presence",e=>{let t=e.type||"available";"error"===t&&(t="presence:error"),this.emit(t,e)}),this.on("session:started",()=>{this.sessionStarting=!1,this.reconnectAttempts=0,this.reconnectTimer&&clearTimeout(this.reconnectTimer)})}updateConfig(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;const n=this.config||{};this.config={allowResumption:!0,jid:"",transports:{bosh:!0,websocket:!0},useStreamManagement:!0,transportPreferenceOrder:["websocket","bosh"],...n,...e},this.config.server||(this.config.server=a.getDomain(this.config.jid)),this.config.password&&(this.config.credentials=this.config.credentials||{},this.config.credentials.password=this.config.password,delete this.config.password),this.config.transportPreferenceOrder||(this.config.transportPreferenceOrder=Object.keys(null!==(t=this.config.transports)&&void 0!==t?t:{}))}get stream(){return this.transport?this.transport.stream:void 0}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];const r=super.emit(e,...n);return"raw"===e?(super.emit("raw:"+n[0],n[1]),super.emit("raw:*","raw:"+n[0],n[1]),super.emit("*","raw:"+n[0],n[1])):super.emit("*",e,...n),r}use(e){"function"==typeof e&&e(this,this.stanzas,this.config)}nextId(){return(0,f.uuid)()}async getCredentials(){return this._getConfiguredCredentials()}async connect(){var e,t,n;this.sessionTerminating=!1,this.sessionStarting=!0,this.emit("--reset-stream-features"),this.transport&&this.transport.disconnect(!1);const i=null!==(e=this.config.transportPreferenceOrder)&&void 0!==e?e:[];let r;for(const e of i){const i=this.config.transports[e];if(!i||!this.transports[e])continue;let s={acceptLanguages:this.config.acceptLanguages||[null!==(t=this.config.lang)&&void 0!==t?t:"en"],jid:this.config.jid,lang:null!==(n=this.config.lang)&&void 0!==n?n:"en",server:this.config.server};const o=new this.transports[e](this,this.sm,this.stanzas);if("string"==typeof i)s.url=i;else if(1==i)if(o.discoverBindings){const e=await o.discoverBindings(this.config.server);if(!e)continue;s={...s,...e}}else{if(!r)try{r=await this.discoverBindings(this.config.server)}catch(e){console.error(e);continue}if(r[e]=(r[e]||[]).filter(e=>e.startsWith("wss:")||e.startsWith("https:")),!r[e]||!r[e].length)continue;s.url=r[e][0]}return this.transport=o,void this.transport.connect(s)}console.error("No endpoints found for the requested transports."),this.emit("--transport-disconnected")}async disconnect(){this.sessionTerminating=!0,clearTimeout(this.reconnectTimer),this.outgoingDataQueue.pause(),this.sessionStarted&&!this.sm.started&&this.emit("session:end"),this.emit("--reset-stream-features"),this.sessionStarted=!1,this.transport?this.transport.disconnect():this.emit("--transport-disconnected"),this.outgoingDataQueue.resume(),this.outgoingDataQueue.idle()||await this.outgoingDataQueue.drain(),await this.sm.shutdown()}async send(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((i,r)=>{this.outgoingDataQueue.push({kind:e,stanza:t,replay:n},n?0:1,e=>e?r(e):i())})}sendMessage(e){const t=e.id||this.nextId(),n={id:t,originId:t,...e};return this.send("message",n),n.id}sendPresence(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t={id:this.nextId(),...e};return this.send("presence",t),t.id}sendIQ(e){const t={id:this.nextId(),...e},n=a.allowedResponders(this.jid,e.to),i="iq:id:"+t.id,r=new Promise((e,t)=>{const r=s=>{n.has(s.from)&&("result"!==s.type&&"error"!==s.type||(this.off(i,r),"result"===s.type?e(s):t(s)))};this.on(i,r)});this.send("iq",t);const s=this.config.timeout||15;return(0,f.timeoutPromise)(r,1e3*s,()=>({...t,to:void 0,from:void 0,error:{condition:"timeout",text:`Request timed out after ${s} seconds.`},id:t.id,type:"error"}))}sendIQResult(e,t){this.send("iq",{...t,id:e.id,to:e.from,type:"result"})}sendIQError(e,t){this.send("iq",{...t,id:e.id,to:e.from,type:"error"})}sendStreamError(e){this.emit("stream:error",e),this.send("error",e),this.disconnect()}_getConfiguredCredentials(){const e=this.config.credentials||{},t=a.parse(this.config.jid||""),n=e.username||t.local,i=e.host||t.domain;return{host:i,password:this.config.password,realm:i,serviceName:i,serviceType:"xmpp",username:n,...e}}}t.default=g},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=(0,n(6).__importStar)(n(298));t.default=class{constructor(){this.capsAlgorithms=["sha-1"],this.features=new Map,this.identities=new Map,this.extensions=new Map,this.items=new Map,this.caps=new Map,this.features.set("",new Set),this.identities.set("",[]),this.extensions.set("",[])}getNodeInfo(e){return{extensions:[...this.extensions.get(e)||[]],features:[...this.features.get(e)||[]],identities:[...this.identities.get(e)||[]]}}addFeature(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.features.has(t)||this.features.set(t,new Set),this.features.get(t).add(e)}addIdentity(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.identities.has(t)||this.identities.set(t,[]),this.identities.get(t).push(e)}addItem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.items.has(t)||this.items.set(t,[]),this.items.get(t).push(e)}addExtension(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.extensions.has(t)||this.extensions.set(t,[]),this.extensions.get(t).push(e)}updateCaps(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.capsAlgorithms;const n={extensions:[...this.extensions.get("")],features:[...this.features.get("")],identities:[...this.identities.get("")],type:"info"};for(const r of t){const t=i.generate(n,r);if(!t){this.caps.delete(r);continue}this.caps.set(r,{algorithm:r,node:e,value:t});const s=`${e}#${t}`;for(const e of n.features)this.addFeature(e,s);for(const e of n.identities)this.addIdentity(e,s);for(const e of n.extensions)this.addExtension(e,s);this.identities.set(s,n.identities),this.features.set(s,new Set(n.features)),this.extensions.set(s,n.extensions)}return[...this.caps.values()]}getCaps(){return[...this.caps.values()]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verify=t.generate=void 0;const i=n(12),r=n(17);function s(e){return i.Buffer.from(e.replace(/</g,"&lt;"),"utf-8")}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[];for(const n of e)"FORM_TYPE"!==n.name&&(n.rawValues?t.push({name:s(n.name),values:n.rawValues.map(e=>s(e)).sort(r.octetCompare)}):Array.isArray(n.value)?t.push({name:s(n.name),values:n.value.map(e=>s(e)).sort(r.octetCompare)}):!0===n.value||!1===n.value?t.push({name:s(n.name),values:[s(n.value?"1":"0")]}):t.push({name:s(n.name),values:[s(n.value||"")]}));t.sort((e,t)=>(0,r.octetCompare)(e.name,t.name));const n=[];for(const e of t){n.push(e.name);for(const t of e.values)n.push(t)}return n}function a(e,t){const n=[],a=i.Buffer.from("<","utf8"),c=e=>{n.push(e),n.push(a)},l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[],n=new Set;for(const{category:i,type:r,lang:o,name:a}of e){const e=`${i}/${r}/${o||""}/${a||""}`;if(n.has(e))return null;n.add(e),t.push(s(e))}return t.sort(r.octetCompare),t}(e.identities),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[],n=new Set;for(const i of e){if(n.has(i))return null;n.add(i),t.push(s(i))}return t.sort(r.octetCompare),t}(e.features),d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[],n=new Set;for(const i of e){let e;for(const t of i.fields||[])if("FORM_TYPE"===t.name&&"hidden"===t.type){if(t.rawValues&&1===t.rawValues.length){e=s(t.rawValues[0]);break}if(t.value&&"string"==typeof t.value){e=s(t.value);break}}if(e){if(n.has(e.toString()))return null;n.add(e.toString()),t.push({type:e,form:i})}}t.sort((e,t)=>(0,r.octetCompare)(e.type,t.type));const i=[];for(const e of t){i.push(e.type);const t=o(e.form.fields);for(const e of t)i.push(e)}return i}(e.extensions);if(!l||!u||!d)return null;for(const e of l)c(e);for(const e of u)c(e);for(const e of d)c(e);return(0,i.createHash)(t).update(i.Buffer.concat(n)).digest("base64")}t.generate=a,t.verify=function(e,t,n){const i=a(e,t);return!!i&&i===n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),r=n(12),s=n(3),o=n(17);class a{constructor(e){this.active=!1,this.maxRetries=5,this.stream=e,this.maxTimeout=1100*this.stream.maxWaitTime}async send(e,t){this.rid=e,this.active=!0;let n=0;for(;n<=this.maxRetries;){n+=1;try{const e=await(0,o.timeoutPromise)((0,r.fetch)(this.stream.url,{body:t,headers:{"Content-Type":this.stream.contentType},method:"POST"}),this.maxTimeout,()=>new Error("Request timed out"));if(!e.ok)throw new Error("HTTP Status Error: "+e.status);const n=await e.text();return this.active=!1,n}catch(e){if(1===n)continue;if(n<this.maxRetries){const e=Math.min(this.maxTimeout,1e3*Math.pow(n,2));await(0,o.sleep)(e+1e3*Math.random());continue}throw this.active=!1,e}}throw new Error("Request failed")}}class c extends r.Duplex{constructor(e,t,n){super({objectMode:!0}),this.rid=Math.floor(4294967295*Math.random()),this.sid="",this.maxHoldOpen=2,this.maxWaitTime=30,this.contentType="text/xml; charset=utf-8",this.channels=[new a(this),new a(this)],this.activeChannelID=0,this.queue=[],this.isEnded=!1,this.client=e,this.sm=t,this.stanzas=n,this.on("data",e=>{this.client.emit("stream:data",e.stanza,e.kind)}),this.on("end",()=>{this.isEnded=!0,clearTimeout(this.idleTimeout),this.client.transport===this&&this.client.emit("--transport-disconnected")})}_write(e,t,n){this.queue.push([e,n]),this.scheduleRequests()}_writev(e,t){this.queue.push([e.map(e=>e.chunk).join(""),t]),this.scheduleRequests()}_read(){}process(e){const t=new s.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,rootKey:"bosh",wrappedStream:!0});t.on("error",e=>{const t={condition:i.StreamErrorCondition.InvalidXML};return this.client.emit("stream:error",t,e),this.send("error",t),this.disconnect()}),t.on("data",e=>{if("stream-start"===e.event)return this.stream=e.stanza,void("terminate"===e.stanza.type?(this.hasStream=!1,this.rid=void 0,this.sid=void 0,this.isEnded||(this.isEnded=!0,this.client.emit("bosh:terminate",e.stanza),this.client.emit("stream:end"),this.push(null))):this.hasStream||(this.hasStream=!0,this.stream=e.stanza,this.sid=e.stanza.sid||this.sid,this.maxWaitTime=e.stanza.maxWaitTime||this.maxWaitTime,this.client.emit("stream:start",e.stanza)));e.event||this.push({kind:e.kind,stanza:e.stanza})}),this.client.emit("raw","incoming",e),t.write(e),this.scheduleRequests()}connect(e){if(this.config=e,this.url=e.url,e.rid&&(this.rid=e.rid),e.sid&&(this.sid=e.sid),e.wait&&(this.maxWaitTime=e.wait),e.maxHoldOpen&&(this.maxHoldOpen=e.maxHoldOpen),this.sid)return this.hasStream=!0,this.stream={},this.client.emit("connected"),this.client.emit("session:prebind",this.config.jid),void this.client.emit("session:started");this._send({lang:e.lang,maxHoldOpen:this.maxHoldOpen,maxWaitTime:this.maxWaitTime,to:e.server,version:"1.6",xmppVersion:"1.0"})}restart(){this.hasStream=!1,this._send({to:this.config.server,xmppRestart:!0})}disconnect(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.hasStream&&e?this._send({type:"terminate"}):(this.stream=void 0,this.sid=void 0,this.rid=void 0,this.client.emit("--transport-disconnected"))}async send(e,t){var n;let i;if(t&&(i=null===(n=this.stanzas.export(e,t))||void 0===n?void 0:n.toString()),i)return new Promise((e,t)=>{this.write(i,"utf8",n=>n?t(n):e())})}get sendingChannel(){return this.channels[this.activeChannelID]}get pollingChannel(){return this.channels[0===this.activeChannelID?1:0]}toggleChannel(){this.activeChannelID=0===this.activeChannelID?1:0}async _send(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.isEnded)return;const n=this.rid++,i=this.stanzas.export("bosh",{...e,rid:n,sid:this.sid});let r;r=t?[i.openTag(),t,i.closeTag()].join(""):i.toString(),this.client.emit("raw","outgoing",r),this.sendingChannel.send(n,r).then(e=>{this.process(e)}).catch(e=>{this.end(e)}),this.toggleChannel()}async _poll(){if(this.isEnded)return;const e=this.rid++,t=this.stanzas.export("bosh",{rid:e,sid:this.sid}).toString();this.client.emit("raw","outgoing",t),this.pollingChannel.send(e,t).then(e=>{this.process(e)}).catch(e=>{this.end(e)})}scheduleRequests(){clearTimeout(this.idleTimeout),this.idleTimeout=setTimeout(()=>{this.fireRequests()},10)}fireRequests(){if(!this.isEnded)if(this.queue.length)if(this.sendingChannel.active)this.scheduleRequests();else{const[e,t]=this.queue.shift();this._send({},e),t()}else!this.authenticated||this.channels[0].active||this.channels[1].active||this._poll()}}t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(8),r=n(3),s=n(12);class o extends s.Duplex{constructor(e,t,n){super({objectMode:!0}),this.sm=t,this.stanzas=n,this.closing=!1,this.client=e,this.on("data",e=>{this.client.emit("stream:data",e.stanza,e.kind)}),this.on("error",()=>{this.end()}),this.on("end",()=>{this.client.transport===this&&this.client.emit("--transport-disconnected")})}_read(){}_write(e,t,n){if(!this.socket||1!==this.socket.readyState)return n(new Error("Socket closed"));const i=s.Buffer.from(e,"utf8").toString();this.client.emit("raw","outgoing",i),this.socket.send(i),n()}connect(e){this.config=e,this.hasStream=!1,this.closing=!1,this.parser=new r.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,wrappedStream:!1}),this.parser.on("data",e=>{const t=e.kind,n=e.stanza;if("stream"===t){if("open"===n.action)return this.hasStream=!0,this.stream=n,this.client.emit("stream:start",n);if("close"===n.action)return this.client.emit("stream:end"),this.disconnect()}this.push({kind:e.kind,stanza:e.stanza})}),this.parser.on("error",e=>{const t={condition:i.StreamErrorCondition.InvalidXML};return this.client.emit("stream:error",t,e),this.write(this.stanzas.export("error",t).toString()),this.disconnect()}),this.socket=new s.WebSocket(e.url,"xmpp"),this.socket.onopen=()=>{this.emit("connect"),this.sm.started=!1,this.client.emit("connected"),this.write(this.startHeader())},this.socket.onmessage=e=>{const t=s.Buffer.from(e.data,"utf8").toString();this.client.emit("raw","incoming",t),this.parser&&this.parser.write(t)},this.socket.onclose=()=>{this.push(null)},this.socket.onerror=e=>{console.error(e),this.push(null)}}disconnect(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.socket&&!this.closing&&this.hasStream&&e?(this.closing=!0,this.write(this.closeHeader())):(this.hasStream=!1,this.stream=void 0,this.socket&&(this.end(),this.socket.close(),this.client.transport===this&&this.client.emit("--transport-disconnected")),this.socket=void 0)}async send(e,t){var n;let i;if(t&&(i=null===(n=this.stanzas.export(e,t))||void 0===n?void 0:n.toString()),i)return new Promise((e,t)=>{this.write(i,"utf8",n=>n?t(n):e())})}restart(){this.hasStream=!1,this.write(this.startHeader())}startHeader(){return this.stanzas.export("stream",{action:"open",lang:this.config.lang,to:this.config.server,version:"1.0"}).toString()}closeHeader(){return this.stanzas.export("stream",{action:"close"}).toString()}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(6),r=n(12),s=n(17),o=n(3),a=(0,i.__importDefault)(n(66));t.default=class{constructor(){this.hostMetaCache=new Map,this.hostMetaTTL=3e4,this.resolver=(0,r.createResolver)(),this.registry=new o.Registry,this.registry.define(a.default)}async getHostMeta(e){const t=this.hostMetaCache.get(e);if(t){if(t.created+this.hostMetaTTL<Date.now())return t.hostmeta;this.hostMetaCache.delete(e)}const n=(0,s.promiseAny)([(0,r.fetch)(`https://${e}/.well-known/host-meta.json`).then(async e=>{if(!e.ok)throw new Error("could-not-fetch-json");return e.json()}),(0,r.fetch)(`https://${e}/.well-known/host-meta`).then(async e=>{if(!e.ok)throw new Error("could-not-fetch-xml");const t=await e.text(),n=(0,o.parse)(t);if(n)return this.registry.import(n);throw new Error("could-not-import-xml")})]);return this.hostMetaCache.set(e,{created:Date.now(),hostmeta:n}),n.catch(()=>{this.hostMetaCache.delete(e)}),n}async resolveTXT(e){var t,n;return null!==(n=null===(t=this.resolver)||void 0===t?void 0:t.resolveTxt(e))&&void 0!==n?n:[]}async resolve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!this.resolver)return[];let i=[],r=!0;if(n.srvType){const t=await this.resolveWeightedSRV(e,n.srvType,n.srvTypeSecure);r=t.allowFallback,i=t.records.map(e=>({host:e.name,port:e.port,secure:e.secure}))}return r&&i.push({host:e,port:t}),i}async resolveWeightedSRV(e,t,n){const[i,r]=await Promise.all([this.resolveSRV(e,t),n?this.resolveSRV(e,n,!0):Promise.resolve({records:[],allowFallback:!1})]),o=[...i.records,...r.records],a=new Map;let c=0;for(const e of o){e.id=c++,e.runningSum=0,a.has(e.priority)||a.set(e.priority,[]);a.get(e.priority).push(e)}const l=e=>{const t=[];for(;t.length<e.length;){const n=(0,s.shuffle)(e.filter(e=>0===e.weight&&!e.used)),i=(0,s.shuffle)(e.filter(e=>0!==e.weight&&!e.used));let r=0;for(const e of i)r+=e.weight,e.runningSum=r,n.push(e);const o=Math.floor(Math.random()*(r+1));for(const e of n)if(e.runningSum>=o){e.used=!0,t.push(e);break}}return t};let u=[];for(const e of Array.from(a.keys()).sort((e,t)=>e<t?-1:e>t?1:0)){const t=a.get(e);u=u.concat(l(t))}return{records:u,allowFallback:i.allowFallback}}async resolveSRV(e,t,n){var i,r;try{const s=null!==(r=await(null===(i=this.resolver)||void 0===i?void 0:i.resolveSrv(`${t}.${e}`)))&&void 0!==r?r:[];return 1!==s.length||"."!==s[0].name&&""!==s[0].name?{records:s.map(e=>({secure:n,...e})).filter(e=>""!==e.name&&"."!==e.name),allowFallback:!1}:{records:[],allowFallback:!1}}catch(e){return{records:[],allowFallback:!0}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InputBuffer=t.DisplayBuffer=t.diff=void 0;const i=n(6),r=n(63),s=(0,i.__importDefault)(n(53));function o(e,t){const n=e.length,i=t.length,r=Math.min(n,i);let o=0;for(o=0;o<r&&e[o]===t[o];o++);let a=0;for(a=0;a<r-o&&e[n-a-1]===t[i-a-1];a++);const c=o+a,l=[];if(c<n&&l.push({length:n-c,position:n-a,type:"erase"}),c<i){const e=t.slice(o,o+i-c);l.push({position:o,text:s.default.ucs2.encode(e),type:"insert"})}return l}t.diff=o;t.DisplayBuffer=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.synced=!1,this.cursorPosition=0,this.ignoreWaits=!1,this.timeDeficit=0,this.sequenceNumber=0,this.onStateChange=e||function(){},this.ignoreWaits=t,this.buffer=[],this.resetActionQueue()}get text(){return s.default.ucs2.encode(this.buffer.slice())}commit(){this.resetActionQueue()}process(e){if("cancel"!==e.event&&"init"!==e.event){if("reset"===e.event||"new"===e.event?(this.resetActionQueue(),void 0!==e.seq&&(this.sequenceNumber=e.seq)):e.seq!==this.sequenceNumber&&(this.synced=!1),e.actions){const t=Date.now();let n=0;for(const i of e.actions)i.baseTime=t+n,"wait"===i.type&&(n+=i.duration),this.actionQueue.push(i,0)}this.sequenceNumber=this.sequenceNumber+1}else this.resetActionQueue()}insert(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.buffer.length;e=e.normalize("NFC");const n=s.default.ucs2.decode(e);this.buffer.splice(t,0,...n),this.cursorPosition=t+n.length,this.emitState()}erase(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.buffer.length;t=Math.max(Math.min(t,this.buffer.length),0),e=Math.max(Math.min(e,this.text.length),0),this.buffer.splice(Math.max(t-e,0),e),this.cursorPosition=Math.max(t-e,0),this.emitState()}emitState(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.onStateChange({cursorPosition:this.cursorPosition,synced:this.synced,text:this.text,...e})}resetActionQueue(){this.actionQueue&&this.actionQueue.kill(),this.sequenceNumber=0,this.synced=!0,this.buffer=[],this.timeDeficit=0,this.actionQueue=(0,r.priorityQueue)((e,t)=>{const n=Date.now();if("insert"===e.type)return this.insert(e.text,e.position),t();if("erase"===e.type)return this.erase(e.length,e.position),t();if("wait"!==e.type)return t();{if(this.ignoreWaits)return t();e.duration>700&&(e.duration=700);const i=e.duration-(n-e.baseTime)+this.timeDeficit;if(i<=0)return this.timeDeficit=i,t();this.timeDeficit=0,setTimeout(()=>t(),i)}},1),this.emitState()}};t.InputBuffer=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.resetInterval=1e4,this.ignoreWaits=!1,this.isStarting=!1,this.isReset=!1,this.changedBetweenResets=!1,this.onStateChange=e||function(){},this.ignoreWaits=t,this.buffer=[],this.actionQueue=[],this.sequenceNumber=0}get text(){return s.default.ucs2.encode(this.buffer.slice())}update(e){let t=[];if(void 0!==e){e=e.normalize("NFC");const n=s.default.ucs2.decode(e);t=o(this.buffer,n.slice()),this.buffer=n,this.emitState()}const n=Date.now();if(this.changedBetweenResets&&n-this.lastResetTime>this.resetInterval)this.actionQueue=[],this.actionQueue.push({position:0,text:this.text,type:"insert"}),this.isReset=!0,this.lastActionTime=n,this.lastResetTime=n,this.changedBetweenResets=!1;else if(t.length){const e=n-(this.lastActionTime||n);e>0&&!this.ignoreWaits&&this.actionQueue.push({duration:e,type:"wait"});for(const e of t)this.actionQueue.push(e);this.lastActionTime=n,this.changedBetweenResets=!0}else this.lastActionTime=n}start(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.resetInterval;return this.commit(),this.isStarting=!0,this.resetInterval=e,this.sequenceNumber=Math.floor(1e4*Math.random()+1),{event:"init"}}stop(){return this.commit(),{event:"cancel"}}diff(){if(this.update(),!this.actionQueue.length)return null;const e={actions:this.actionQueue,seq:this.sequenceNumber++};return this.isStarting?(e.event="new",this.isStarting=!1,this.lastResetTime=Date.now()):this.isReset&&(e.event="reset",this.isReset=!1),this.actionQueue=[],e}commit(){this.sequenceNumber=0,this.lastActionTime=0,this.actionQueue=[],this.buffer=[]}emitState(){this.onStateChange({text:this.text})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createPager=t.ResultSetPager=void 0;class i{constructor(e){var t,n,i;this.resultComplete=!1,this.fetchedCount=0,this.yieldedCount=0,this.cursor={first:e.before,last:e.after},this.query=e.query,this.direction=null!==(t=e.direction)&&void 0!==t?t:"forward",this.reverse=null!==(n=e.reverse)&&void 0!==n?n:"backward"===this.direction,this.pageSize=null!==(i=e.pageSize)&&void 0!==i?i:20}async*[Symbol.asyncIterator](){let e=[];do{e=await this.fetchPage();for(const t of e)this.yieldedCount+=1,yield t}while(e.length>0)}async size(){if(void 0!==this.resultCount)return this.resultCount;const{paging:e}=await this.query({max:0});return this.resultCount=e.count,e.count}queryCompleted(){return this.resultComplete}finished(){return this.resultComplete&&this.yieldedCount===this.fetchedCount}async fetchPage(){var e;const{results:t,paging:n}=await this.query({before:"backward"===this.direction?null!==(e=this.cursor.first)&&void 0!==e?e:"":void 0,after:"forward"===this.direction?this.cursor.last:void 0,max:this.pageSize});return this.cursor=n,this.resultCount=n.count,this.fetchedCount+=t.length,(this.pageSize&&t.length<this.pageSize||this.resultCount&&this.fetchedCount===this.resultCount)&&(this.resultComplete=!0),this.reverse&&t.reverse(),t}}t.ResultSetPager=i,t.createPager=function(e){return new i(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i extends Error{}t.default=i},function(e,t,n){"use strict";n.r(t),n.d(t,"Emitter",(function(){return s})),n.d(t,"MemoryLeakError",(function(){return i}));var i=class extends Error{constructor(e,t,n){super(`Possible EventEmitter memory leak detected. ${n} ${t.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=t,this.count=n,this.name="MaxListenersExceededWarning"}},r=class{static listenerCount(e,t){return e.listenerCount(t)}constructor(){this.events=new Map,this.maxListeners=r.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}_emitInternalEvent(e,t,n){this.emit(e,t,n)}_getListeners(e){return this.events.get(e)||[]}_removeListener(e,t){const n=e.indexOf(t);return n>-1&&e.splice(n,1),[]}_wrapOnceListener(e,t){var n=this;const i=function(){n.removeListener(e,i);for(var r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];t.apply(n,s)};return i}setMaxListeners(e){return this.maxListeners=e,this}getMaxListeners(){return this.maxListeners}eventNames(){return Array.from(this.events.keys())}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];const r=this._getListeners(e);return r.forEach(e=>{e.apply(this,n)}),r.length>0}addListener(e,t){this._emitInternalEvent("newListener",e,t);const n=this._getListeners(e).concat(t);if(this.events.set(e,n),this.maxListeners>0&&this.listenerCount(e)>this.maxListeners&&!this.hasWarnedAboutPotentialMemoryLeak){this.hasWarnedAboutPotentialMemoryLeak=!0;const t=new i(this,e,this.listenerCount(e));console.warn(t)}return this}on(e,t){return this.addListener(e,t)}once(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}prependListener(e,t){const n=this._getListeners(e);if(n.length>0){const i=[t].concat(n);this.events.set(e,i)}else this.events.set(e,n.concat(t));return this}prependOnceListener(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}removeListener(e,t){const n=this._getListeners(e);return n.length>0&&(this._removeListener(n,t),this.events.set(e,n),this._emitInternalEvent("removeListener",e,t)),this}off(e,t){return this.removeListener(e,t)}removeAllListeners(e){return e?this.events.delete(e):this.events.clear(),this}listeners(e){return Array.from(this._getListeners(e))}listenerCount(e){return this._getListeners(e).length}rawListeners(e){return this.listeners(e)}},s=r;s.defaultMaxListeners=10},function(e,t,n){"use strict";n.r(t);var i=n(10),r=n(208),s=n(39),o=n.n(s);const a=function(e){const t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},c=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(0===n)return null;if(t){if(Array.isArray(t)){const i=[];for(let r=0;r<t.length;r++)i[r]=e(t[r],n-1);return i}if("object"==typeof t){const i=Object.assign({},t);for(const r in t)try{i[r]=e(t[r],n-1)}catch(e){console.debug("WARN: Failed cloning key on object, ignoring",{key:r,object:t})}return i}}return t};var l=n(70),u=n(69),d=n(40);function h(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function p(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function f(e){p(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Object(d.a)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function m(e,t){p(2,arguments);var n=f(e),i=h(t);return isNaN(i)?new Date(NaN):i?(n.setDate(n.getDate()+i),n):n}function g(e,t){p(2,arguments);var n=f(e),i=h(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var r=n.getDate(),s=new Date(n.getTime());s.setMonth(n.getMonth()+i+1,0);var o=s.getDate();return r>=o?s:(n.setFullYear(s.getFullYear(),s.getMonth(),r),n)}function y(e,t){p(2,arguments);var n=f(e),i=f(t);return n.getTime()>i.getTime()}var v=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))};const b=[408,429,500,503,504],_=[401],S=new Map;class w{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;this.url=e,this.debugMode=t,this.customHeaders=n,this.sendQueue=[]}postLogsToEndpoint(e){const t=(()=>{let e,t;return{promise:new Promise((n,i)=>{e=n,t=i}),resolve:e,reject:t}})();return this.sendQueue.push({requestParams:e,deferred:t}),this.sendNextQueuedLogToServer(),this.debug("adding requestParams to sendQueue",{requestParams:e,updatedSendQueue:this.sendQueue.map(e=>e.requestParams),hasPendingRequest:!!this.pendingRequest}),t.promise}postLogsToEndpointInstantly(e,t){return v(this,void 0,void 0,(function*(){if(this.debug("sending request instantly",{requestParams:e,sendQueue:this.sendQueue.map(e=>e.requestParams)}),!navigator.onLine)return this.saveRequestForLater(e);try{yield this.sendPostRequest(e)}catch(n){throw(null==t?void 0:t.saveOnFailure)&&this.saveRequestForLater(e),n}}))}saveRequestForLater(e){const t=this.getSavedRequests()||[],n=Object.assign({},e);delete n.accessToken,t.push(n),window.localStorage.setItem("gc_logger_requests",JSON.stringify(t))}getSavedRequests(){const e=window.localStorage.getItem("gc_logger_requests");if(e)try{return JSON.parse(e)}catch(t){console.error("Failed to parse saved messages, ignoring",{savedMessagesStr:e})}}sendEntireQueue(){this.debug("sending all queued requests instantly to clear out sendQueue",{sendQueue:this.sendQueue.map(e=>e.requestParams)});const e=[];let t;for(;t=this.sendQueue.shift();)e.push(this.postLogsToEndpointInstantly(t.requestParams,{saveOnFailure:!0}));return e}resetSendQueue(){this.debug("reseting send queue without sending currently queued data",{queueLength:this.sendQueue.length}),this.sendQueue=[]}sendNextQueuedLogToServer(){return v(this,void 0,void 0,(function*(){if(this.pendingRequest||0===this.sendQueue.length)return void this.debug("sendNextQueuedLogToServer() but not sending request",{hasPendingRequest:!!this.pendingRequest,sendQueueLength:this.sendQueue.length});const e=this.sendQueue.shift();return e.deferred.promise.finally(()=>{this.debug("queue item completed. removing from queue and resetting send queue",{queueItemRequestParams:e.requestParams,updatedSendQueue:this.sendQueue.map(e=>e.requestParams)}),this.pendingRequest=void 0,this.sendNextQueuedLogToServer()}),this.pendingRequest=e,this.debug("sending logs to server",{queueItem:e.requestParams,sendQueue:this.sendQueue.map(e=>e.requestParams)}),Object(u.backOff)(()=>this.backoffFn(e.requestParams),{retry:e=>{var t,n,i,r,s;const o=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status,a=null==e?void 0:e.code,c=(null===(i=null===(n=e.response)||void 0===n?void 0:n.headers)||void 0===i?void 0:i["retry-after"])||(null===(s=null===(r=e.response)||void 0===r?void 0:r.getResponseHeader)||void 0===s?void 0:s.call(r,"retry-after"));if(c){const e=function(e,t){if(p(2,arguments),!t||"object"!==Object(d.a)(t))return new Date(NaN);var n=t.years?h(t.years):0,i=t.months?h(t.months):0,r=t.weeks?h(t.weeks):0,s=t.days?h(t.days):0,o=t.hours?h(t.hours):0,a=t.minutes?h(t.minutes):0,c=t.seconds?h(t.seconds):0,l=f(e),u=i||n?g(l,i+12*n):l,y=s||r?m(u,s+7*r):u,v=a+60*o,b=c+60*v,_=1e3*b,S=new Date(y.getTime()+_);return S}(new Date,{seconds:parseInt(c,10)});this.retryAfter&&!y(e,this.retryAfter)||(this.retryAfter=e)}return navigator.onLine&&(o&&b.includes(o)||"ERR_NETWORK"===a)},numOfAttempts:10,startingDelay:0,delayFirstAttempt:!1,maxDelay:15e3}).then(t=>{this.debug("successfully sent logs to server",{requestParams:e.requestParams,response:t}),e.deferred.resolve(t)}).catch(this.handleBackoffError.bind(this,e))}))}handleBackoffError(e,t){var n;const i=null===(n=t.response)||void 0===n?void 0:n.status;i&&b.includes(i)||_.includes(i)||"ERR_NETWORK"===t.code?(this.debug("Failed to sends logs to the server, moving request to the end of the queue",{requestParams:e.requestParams,error:t}),this.saveRequestForLater(e.requestParams)):this.debug("ERROR sending logs to server",{requestParams:e.requestParams,error:t}),e.deferred.reject(Object.assign(Object.assign({},t),{id:"rejectionSpot1"}))}retryAfterTimerCheck(){return v(this,void 0,void 0,(function*(){if(this.retryAfter){if(!y(Date.now(),this.retryAfter)){const e=function(e,t){return p(2,arguments),f(e).getTime()-f(t).getTime()}(this.retryAfter,Date.now());return this.debug('Respecting "retry-after" response header, waiting to send request',{millisecondsToWait:e}),yield new Promise(t=>{setTimeout(()=>{t(null)},e)}),this.retryAfterTimerCheck()}this.retryAfter=void 0}}))}backoffFn(e){return v(this,void 0,void 0,(function*(){yield this.retryAfterTimerCheck();const t=e.accessToken,n=yield this.sendPostRequest(e),i=this.getSavedRequests();return i&&(window.localStorage.removeItem("gc_logger_requests"),i.map(e=>{const n=Object.assign({accessToken:t},e);this.postLogsToEndpoint(n)})),n}))}sendPostRequest(e){this.debug("issuing POST request",{requestParams:e});const t=Object.assign({},e);delete t.accessToken;const n=Object.assign({authorization:"Bearer "+e.accessToken,"content-type":"application/json; charset=UTF-8"},this.customHeaders||{});return Object(l.a)({method:"post",url:this.url,responseType:"text",data:t,headers:n})}debug(e,t){this.debugMode&&console.log("%c [DEBUG:log-uploader] "+e,"color: #32a0a8",c(t))}}var T=function(e,t,n,i){return new(n||(n=Promise))((function(r,s){function o(e){try{c(i.next(e))}catch(e){s(e)}}function a(e){try{c(i.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((i=i.apply(e,t||[])).next())}))};class I{constructor(e){if(this.isInitialized=!1,this.logBuffer=[],this.debounceTimer=null,this.logger=e,!e.config.url||!e.config.appVersion){const t="Missing `url` and/or `appVersion` config options to set up server logging. Not sending logs to server for this logger instance";throw this.logger.error(t,{providedConfig:e.config},{skipServer:!0}),new Error(t)}this.isInitialized=!0,this.debounceLogUploadTime=e.config.uploadDebounceTime||4e3,this.logUploader=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;if(n)return new w(e,t,i);let r=S.get(e);return r||(r=new w(e,t,i),S.set(e,r)),r}(e.config.url,e.config.debugMode,e.config.useUniqueLogUploader,e.config.customHeaders),window.addEventListener("unload",this.sendAllLogsInstantly.bind(this)),this.logger.on("onStop",e=>{this.debug("`onStop` received. Clearing logBuffer and sendQueue",{logBuffer:this.logBuffer,sendQueue:this.logUploader.sendQueue}),this.logBuffer=[],this.logUploader.resetSendQueue()})}addLogToSend(e,t,n){if(!this.isInitialized)return;const i=this.convertToLogMessage(t,n);let r=this.convertToTrace(e,i),s=a(r);if(s>14500){const t=this.truncateLog(e,i);if(null===t)return void this.logger.error("truncated message is too large to send to server. not sending message",{originalTrace:r,originalTraceSize:a(r),truncatedTrace:t,truncatedTraceSize:a(t)},{skipServer:!0});s=a(t),r=t}const o=!this.logBuffer.length;let c;c=o?{size:0,traces:[]}:this.logBuffer[this.logBuffer.length-1];if(c.size+s>14500)return this.debug("`exceedsMaxLogSize` was `true`",{logBuffer:this.logBuffer,bufferItem:c,incomingTrace:r,incomingTraceSize:s,maxAllowedTraceSize:14500}),this.logBuffer.push({size:s,traces:[r]}),this.debug("calling sendLogsToServer(true)",{logBuffer:this.logBuffer}),void this.sendLogsToServer(!0);c.size+=s,c.traces.push(r),o&&(this.debug("`this.logBuffer` was empty. pushing new buffer item",{logBuffer:this.logBuffer,bufferItem:c}),this.logBuffer.push(c)),this.debug("calling sendLogsToServer()",{logBuffer:this.logBuffer}),this.sendLogsToServer()}sendAllLogsInstantly(){return this.logUploader.sendEntireQueue().concat(this.logBuffer.map(e=>this.logUploader.postLogsToEndpointInstantly(this.convertToRequestParams(e.traces.reverse()),{saveOnFailure:!0})))}sendLogsToServer(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var t;return T(this,void 0,void 0,(function*(){if(!this.logBuffer.length)return clearTimeout(this.debounceTimer),this.debounceTimer=null,void this.debug("buffer empty, not sending http request");if(!e)return void(this.debounceTimer?this.debug("sendLogsToServer() 'immediate' is false. 'debounceTimer' is already running"):(this.debug(`sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to ${this.debounceLogUploadTime}ms`),this.debounceTimer=setTimeout(()=>this.sendLogsToServer(!0),this.debounceLogUploadTime)));clearTimeout(this.debounceTimer),this.debounceTimer=null;const[n]=this.logBuffer.splice(0,1);try{this.debug("calling logUploader.postLogsToEndpoint() with",{bufferItem:n,newLogBuffer:this.logBuffer}),yield this.logUploader.postLogsToEndpoint(this.convertToRequestParams(n.traces.reverse()))}catch(e){this.logger.emit("onError",e),this.logger.error("Error sending logs to server",e,{skipServer:!0});const n=(null==e?void 0:e.status)?parseInt(e.status,10):parseInt(null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status,10);[401,403,404].includes(n)&&(this.logger.warn(`received a ${n} from logUploader. stopping logging to server`),this.logger.stopServerLogging())}finally{this.sendLogsToServer()}}))}truncateLog(e,t){let n,i;const r=a(this.convertToTrace(e,t)),s=c(t);return s?(s.details="[[TRUNCATED]]",n=this.convertToTrace(e,s),i=a(n),i<=14500?(this.logger.warn("message too large to send to server. truncated log details",{originalLog:t,truncatedLog:s,originalTraceSize:r,truncatedTraceSize:i,maxAllowedTraceSize:14500},{skipServer:!0}),n):(s.message=s.message.substr(0,150)+"... [[TRUNCATED]]",n=this.convertToTrace(e,s),i=a(n),i<=14500?(this.logger.warn("message too large to send to server. truncated log details & log message",{originalLog:t,truncatedLog:s,originalTraceSize:r,truncatedTraceSize:i,maxAllowedTraceSize:14500},{skipServer:!0}),n):null)):null}convertToLogMessage(e,t){const n={clientTime:(new Date).toISOString(),clientId:this.logger.clientId,message:e,details:t},{originAppName:i,originAppVersion:r,originAppId:s}=this.logger.config;return i&&(n.originAppName=i,n.originAppVersion=r,n.originAppId=s),n}convertToTrace(e,t){return{topic:this.logger.config.appName,level:e.toUpperCase(),message:o()(t)}}convertToRequestParams(e){return{accessToken:this.logger.config.accessToken,app:{appId:this.logger.config.appName,appVersion:this.logger.config.appVersion},traces:e}}debug(e,t){this.logger.config.debugMode&&console.log(`%c [DEBUG:${this.logger.config.appName}] ${e}`,"color: #32a852",c(t))}}class A extends i.EventEmitter{constructor(e){super(),this.defaultFormatter=(e,t,n,i,r)=>{if(i.skipDefaultFormatter)return r();t instanceof Error&&(n=n||t,t=t.message);r(e,t=`${this.config.appName?`[${this.config.appName}] `:""}${t}`,n,i)},this.logMessage=(e,t,n,i)=>{if(!i.skipSecondaryLogger)try{const i=[t];void 0!==n&&i.push(this.config.stringify?o()(n):n),this.secondaryLogger[e].apply(this.secondaryLogger,i)}catch(e){console.error("Error logging using custom logger passed into `genesys-cloud-client-logger`",{error:e,secondaryLogger:this.secondaryLogger,message:t,details:n,messageOptions:i})}!i.skipServer&&!this.stopReason&&this.serverLogger&&this.logRank(e)>=this.logRank(this.config.logLevel)&&this.serverLogger.addLogToSend(e,t,n)},Object.defineProperty(this,"clientId",{value:Object(r.a)(),writable:!1}),this.config=Object.assign({},e),this.secondaryLogger=this.config.logger||console,delete this.config.logger,-1===this.logRank(this.config.logLevel)&&(e.logLevel&&this.warn(`Invalid log level: "${e.logLevel}". Default "info" will be used instead.`,null,{skipServer:!0}),this.config.logLevel="info"),!e.appName&&e.logTopic&&(this.warn("`logTopic` has been renamed to `appName`. Please use `appName`",null,{skipServer:!0}),this.config.appName=e.logTopic),!1!==this.config.initializeServerLogging&&(this.serverLogger=new I(this)),this.config.startServerLoggingPaused&&this.stopServerLogging()}get VERSION(){return A.VERSION}setAccessToken(e){this.config.accessToken=e,401==this.stopReason&&this.startServerLogging()}log(e,t,n){this.formatMessage("log",e,t,n)}debug(e,t,n){this.formatMessage("debug",e,t,n)}info(e,t,n){this.formatMessage("info",e,t,n)}warn(e,t,n){this.formatMessage("warn",e,t,n)}error(e,t,n){this.formatMessage("error",e,t,n)}startServerLogging(){if(this.stopReason=void 0,!this.serverLogger)return this.warn("`startServerLogging` called but the logger instance is not configured to send logs to the server. Ignoring call to start sending logs to server.",void 0,{skipServer:!0});this.emit("onStart")}stopServerLogging(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"force";"force"===this.stopReason&&"force"!==e||(this.stopReason=e,this.emit("onStop",e))}sendAllLogsInstantly(){var e;return(null===(e=this.serverLogger)||void 0===e?void 0:e.sendAllLogsInstantly())||[]}formatMessage(e,t,n,i){let r=[this.defaultFormatter.bind(this)];this.config.formatters&&(r=[...this.config.formatters,this.defaultFormatter.bind(this)]),this.callNextFormatter(r,e,t,n,i)}callNextFormatter(e,t,n,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const[s,...o]=e;if(!s)return this.logMessage(t,n,i,r);s(t,n,i,r,(e,s,a,c)=>{void 0!==e?this.callNextFormatter(o,e,s,a,c):this.callNextFormatter(o,t,n,i,r)})}logRank(e){switch(e){case"log":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;default:return-1}}}A.VERSION="4.2.13",n.d(t,"Logger",(function(){return A}));t.default=A}]).default;