genesys-cloud-streaming-client 19.2.3-develop.2 → 19.2.3-develop.3

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.
@@ -13,5 +13,5 @@ window.GenesysCloudStreamingClient=function(e){var t={};function n(r){if(t[r])re
13
13
  */
14
14
  var r=n(223),i=n(224),a=n(225);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(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 f(this,e)}return c(this,e,t,n)}function c(e,t,n,r){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,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|h(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(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||(r=t.length)!=r?s(e,0):p(e,t);if("Buffer"===t.type&&a(t.data))return p(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(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 f(e,t){if(l(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function h(e,t){if(u.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 r=!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(r)return q(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!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 E(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return I(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(a=n;a<s;a++)if(c(e,a)===c(t,-1===l?0:a-l)){if(-1===l&&(l=a),a-l+1===u)return l*o}else-1!==l&&(a-=a-l),l=-1}else for(n+u>s&&(n=s-u),a=n;a>=0;a--){for(var f=!0,p=0;p<u;p++)if(c(e,a+p)!==c(t,p)){f=!1;break}if(f)return a}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function _(e,t,n,r){return z(q(t,e.length-n),e,n,r)}function S(e,t,n,r){return z(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function w(e,t,n,r){return S(e,t,n,r)}function x(e,t,n,r){return z(U(t),e,n,r)}function k(e,t,n,r){return z(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function O(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function T(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,u,c=e[i],l=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&c)<<6|63&a)>127&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&c)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.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(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.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}},u.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=h,u.prototype._isBuffer=!0,u.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)m(this,t,t+1);return this},u.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)m(this,t,t+3),m(this,t+1,t+2);return this},u.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?T(this,0,e):v.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.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+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.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===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(c[f]!==l[f]){a=c[f],o=l[f];break}return a<o?-1:o<a?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=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===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){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 x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function I(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function E(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=F(e[a]);return i}function N(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function R(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 j(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function C(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function P(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function M(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,a){return a||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,a){return a||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||j(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):P(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);j(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):C(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):C(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):P(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):P(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===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(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}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 a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=u.isBuffer(e)?e:q(new u(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function F(e){return e<16?"0"+e.toString(16):e.toString(16)}function q(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.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;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function U(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(25))},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],s=r[1],u=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,f=s>0?o-4:o;for(n=0;n<f;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(l(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(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 l(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){
15
15
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
16
- t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,p=n?-1:1,d=e[t+f];for(f+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=p,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=c}return(d?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&s,d+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+d]=255&o,d+=h,o/=256,c-=8);e[n+d-h]|=128*v}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(54);function i(e){var t,n;function i(t,n){try{var o=e[t](n),s=o.value,u=s instanceof r;Promise.resolve(u?s.v:s).then((function(n){if(u){var r="return"===t?"return":"next";if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?"return":"normal",n)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},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(25))},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9),o=n(6),s=n(7),u=n(12);Object.defineProperty(t,"__esModule",{value:!0}),t.Notifications=void 0;var c=n(229),l=n(26);function f(e,t){return[].concat(u(e),u(t)).filter((function(e,t,n){return n.indexOf(e)===t}))}var p=function(){function e(t){o(this,e),this.subscriptions={},this.bulkSubscriptions={},this.topicPriorities={},this.client=t,t.on("pubsub:event",this.pubsubEvent.bind(this)),t.on("connected",this.subscriptionsKeepAlive.bind(this)),this.debouncedResubscribe=c(this.resubscribe.bind(this),100)}var t,n;return s(e,[{key:"handleStanzaInstanceChange",value:function(e){var 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())}},{key:"topicHandlers",value:function(e){return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e]}},{key:"pubsubEvent",value:function(e){var t=e.pubsub,n=t.items.node;n.includes("no_longer_subscribed")?n="no_longer_subscribed":n.includes("duplicate_id")&&(n="duplicate_id");var r=t.items.published[0].content.json,i=this.topicHandlers(n);this.client.emit("notify",{topic:n,data:r}),this.client.emit("notify:".concat(n),r),i.forEach((function(e){e(r)}))}},{key:"xmppSubscribe",value:(n=a(i.mark((function e(t){var n,r=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.topicHandlers(t).length&&!this.bulkSubscriptions[t]){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if(n=function(){return r.stanzaInstance.subscribeToNode(r.pubsubHost,t)},!this.client.connected){e.next=7;break}return e.abrupt("return",n());case 7:return e.abrupt("return",new Promise((function(e,t){r.client.once("connected",(function(){return n().then(e,t)}))})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"xmppUnsubscribe",value:function(e){var t=this;if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();var n=function(){return t.stanzaInstance.unsubscribeFromNode(t.pubsubHost,e)};return this.client.connected?n():new Promise((function(e,r){t.client.once("connected",(function(){return n().then(e,r)}))}))}},{key:"mapCombineTopics",value:function(e){var t=this,n={},r=[],i=[];e.forEach((function(e){e.includes("?")?r.push({id:e}):i.push(e)})),i.map((function(e){var t=e.split("."),n=t.splice(t.length-1);return{prefix:t.join("."),postfix:n}})).forEach((function(e){n[e.prefix]?n[e.prefix].push(e.postfix):n[e.prefix]=[e.postfix]}));var a=[];Object.keys(n).forEach((function(e){!function e(n,r){var i=1===r.length?".":"?",o="".concat(n).concat(i).concat(r.join("&"));o.length<200?a.push({id:o}):1===r.length?t.client.logger.error("Refusing to attempt topic with length > 200",o):(e(n,r.slice(0,r.length/2)),e(n,r.slice(r.length/2)))}(e,n[e])}));var o=a.concat(r);return this.truncateTopicList(this.prioritizeTopicList(o))}},{key:"prioritizeTopicList",value:function(e){var t=this;return e.sort((function(e,n){return t.getTopicPriority(n.id)-t.getTopicPriority(e.id)})),e}},{key:"getTopicPriority",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getTopicParts(e),r=n.prefix,i=n.postfixes,a=this.topicPriorities[r],o=a&&Object.keys(a).filter((function(e){return i.includes(e)})).map((function(e){return a[e]})),s=o&&o.length&&o.reduce((function(e,t){return t>e?t:e}));return t?s||0:s}},{key:"truncateTopicList",value:function(e){var t=e.slice(0,1e3);if(e.length>1e3){var n=e.slice(1e3);if(n.length>20){var r=n.length-20;(n=n.slice(20)).push("...and ".concat(r," more"))}this.client.logger.warn("Too many topics to subscribe to; truncating extra topics",{droppedTopics:n})}return t}},{key:"makeBulkSubscribeRequest",value:function(e,t){var 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},r=this.stanzaInstance.channelId;return this.client.http.requestApi("notifications/channels/".concat(r,"/subscriptions"),n)}},{key:"createSubscription",value:function(e,t){var n=this;l.splitIntoIndividualTopics(e).forEach((function(e){var r=n.topicHandlers(e);r.includes(t)||r.push(t)}))}},{key:"removeSubscription",value:function(e,t){var n=this;l.splitIntoIndividualTopics(e).forEach((function(e){var r=n.topicHandlers(e),i=r.indexOf(t);i>-1&&r.splice(i,1),r.length||delete n.subscriptions[e]}))}},{key:"removeTopicPriority",value:function(e){var t=this;if(this.getTopicPriority(e,!1)){var n=this.getTopicParts(e),r=n.prefix;n.postfixes.forEach((function(e){delete t.topicPriorities[r][e]})),Object.keys(this.topicPriorities[r]).length||delete this.topicPriorities[r]}}},{key:"getActiveIndividualTopics",value:function(){var e=this,t=[];return Object.keys(this.subscriptions).forEach((function(n){"streaming-subscriptions-expiring"!==n&&(e.topicHandlers(n).length>0&&t.push(n))})),t}},{key:"resubscribe",value:function(){var e=Object.keys(this.bulkSubscriptions);return e.length+this.getActiveIndividualTopics().length===0?Promise.resolve():this.bulkSubscribe(e,{replace:!0})}},{key:"subscriptionsKeepAlive",value:function(){var e=this,t="streaming-subscriptions-expiring";0===this.topicHandlers(t).length&&this.createSubscription(t,(function(){e.client.logger.info("".concat(t," - Triggering resubscribe."),{channelId:e.client.config.channelId}),e.debouncedResubscribe().catch((function(t){var n="Error resubscribing to topics";e.client.logger.error(n,t),e.client.emit("pubsub:error",{msg:n,err:t})}))}))}},{key:"getTopicParts",value:function(e){var t=e.includes("?"),n=t?"?":".",r=e.split(n),i=t?r[1]:r.splice(r.length-1);return{prefix:t?r[0]:r.join("."),postfixes:t?i.split("&"):i}}},{key:"setTopicPriorities",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach((function(n){var r=e.getTopicParts(n),i=e.topicPriorities[r.prefix],a=t[n];if(i)r.postfixes.forEach((function(e){var t=i[e];(t&&t<a||!t)&&(i[e]=a)}));else{var o=r.postfixes.reduce((function(e,t){return e[t]=a,e}),{});e.topicPriorities[r.prefix]=o}}))}},{key:"subscribe",value:function(e,t,n,i){var a;return i&&this.setTopicPriorities(r({},e,i)),a=n?this.xmppSubscribe(e):this.debouncedResubscribe(),t?this.createSubscription(e,t):this.bulkSubscriptions[e]=!0,a}},{key:"unsubscribe",value:function(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()}},{key:"bulkSubscribe",value:(t=a(i.mark((function e(t){var n,r,a,o=this,s=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{replace:!1,force:!1},r=s.length>2&&void 0!==s[2]?s[2]:{},this.setTopicPriorities(r),a=f(t,[]),n.replace&&!n.force?a=f(a,this.getActiveIndividualTopics()):n.force&&(this.subscriptions={}),e.next=7,this.makeBulkSubscribeRequest(a,n);case 7:n.replace&&(this.bulkSubscriptions={}),t.forEach((function(e){o.bulkSubscriptions[e]=!0}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"pubsubHost",get:function(){try{var e=this.client.config.apiHost.replace(/http(s?):\/\//,"");return"notifications.".concat(e)}catch(e){return"notifications.mypurecloud.com"}}},{key:"expose",get:function(){return{subscribe:this.subscribe.bind(this),unsubscribe:this.unsubscribe.bind(this),bulkSubscribe:this.bulkSubscribe.bind(this)}}}]),e}();t.Notifications=p},function(e,t,n){"use strict";function r(e){return"function"==typeof e?e():e}function i(){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]:{},a=void 0,o=void 0,s=void 0,u=[];return function(){var l=r(t),f=(new Date).getTime(),p=!a||f-a>l;a=f;for(var d=arguments.length,h=Array(d),v=0;v<d;v++)h[v]=arguments[v];if(p&&n.leading)return n.accumulate?Promise.resolve(e.call(this,[h])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(h)));if(o?clearTimeout(s):o=i(),u.push(h),s=setTimeout(c.bind(this),l),n.accumulate){var m=u.length-1;return o.promise.then((function(e){return e[m]}))}return o.promise};function c(){var t=o;clearTimeout(s),Promise.resolve(n.accumulate?e.call(this,u):e.apply(this,u[u.length-1])).then(t.resolve,t.reject),u=[],o=null}}},function(e,t){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(53),i=n(232);function a(t,n,o){return i()?(e.exports=a=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(null,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(13),i=n(12),a=n(4),o=n(3),s=n(9),u=n(6),c=n(7),l=n(24),f=n(16),p=n(17),d=n(14);function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.WebrtcExtension=void 0;var b=n(36),_=n(20),S=n(22),w=n(235),x=n(18),k=n(34),O=b.__importDefault(n(239)),T=n(240),A=n(241),I=n(26),E=n(70),N=n(255),R=n(33),j=n(60),C=n(66),P=n(45),M="requestIncomingRtcSession",D="cancelIncomingRtcSession",L="handledIncomingRtcSession",B="incomingRtcSession",F="outgoingRtcSession",q="rtcSessionError",U=function(e){f(Z,e);var t,n,a,p,d,v,m,b,_,U,z,J,G,H,V,W,Q,K,Y,X,$=y(Z);function Z(e,t){var n;return u(this,Z),(n=$.call(this)).ignoredSessions=new w.LRUCache({max:10,ttl:216e3}),n.earlyIceCandidates=new w.LRUCache({max:10,ttl:6e4,ttlAutopurge:!0}),n.pendingSessions={},n.statsArr=[],n.throttleSendStatsInterval=25e3,n.currentMaxStatSize=15e3,n.statsSizeDecreaseAmount=3e3,n.statBuffer=0,n.discoRetries=0,n.iceServers=[],n.webrtcSessions=[],n.reinviteCache=new w.LRUCache({max:5,ttl:18e4}),n.sessionsMap={},n.client=e,n.config={allowIPv6:!0===t.allowIPv6,optOutOfWebrtcStatsTelemetry:t.optOutOfWebrtcStatsTelemetry},n.logger=e.logger,n.addEventListeners(),n.throttledSendStats=O.default(n.sendStats.bind(l(n)),n.throttleSendStatsInterval,{leading:!1,trailing:!0}),n.client.on("jingle:outgoing",(function(e){return n.logger.info("Emitting jingle:outgoing media-session (session-init)",e.sid),n.emit(F,e)})),n.client.on("jingle:incoming",(function(e){return n.logger.info("Emitting jingle:incoming media-session (session-init)",e.sid),n.emit(B,e)})),n.client.on("jingle:created",(function(e){e instanceof j.StanzaMediaSession||e.end("cancel",!0)})),window.addEventListener("offline",(function(){return n.onOnlineStatusChange(!1)})),window.addEventListener("online",(function(){return n.onOnlineStatusChange(!0)})),n}return c(Z,[{key:"onOnlineStatusChange",value:function(e){this.addStatToQueue({actionName:"WebrtcStats",details:{_eventType:"onlineStatus",_eventTimestamp:(new Date).getTime(),online:e}})}},{key:"handleStanzaInstanceChange",value:(X=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.stanzaInstance=t,this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),t.on("iq:set:genesysWebrtc",this.handleGenesysWebrtcStanza.bind(this)),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.client.emit("sessionManagerChange",t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"configureNewStanzaInstance",value:(Y=s(o.mark((function e(t){var n,r,i,a=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Object.assign(t.jingle.config.peerConnectionConfig,{sdpSemantics:"unified-plan"}),e.next=3,this.configureStanzaIceServers(t);case 3:for(t.stanzas.define(A.definitions),t.jingle.prepareSession=this.prepareSession.bind(this),t.jingle.on("log",(function(e,t,n){a.logger[e](t,n)})),n=function(){var e=i[r];t.jingle.on(e,(function(t){if(t instanceof j.StanzaMediaSession){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit.apply(t,[e].concat(r))}}))},r=0,i=["iceConnectionType","peerTrackAdded","peerTrackRemoved","mute","unmute","sessionState","connectionState","terminated","stats","endOfCandidates"];r<i.length;r++)n();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return Y.apply(this,arguments)})},{key:"configureStanzaIceServers",value:function(e){return e.jingle.config.iceServers=[],this.setIceServers([],e),this._refreshIceServers(e)}},{key:"handleGenesysOffer",value:(K=s(o.mark((function e(t){var n,r,i,a,s,u,c,l,f=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,!(r=n.params).reinvite||!this.reinviteCache.get(n.id)){e.next=5;break}return this.logger.info("Ignoring duplicate reinvite offer",n.id),e.abrupt("return");case 5:if(r.reinvite&&this.reinviteCache.set(n.id,!0),i="relay"===this.getIceTransportPolicy()&&T.isFirefox,a={id:r.sessionId,logger:this.logger,peerID:t.from,fromJid:t.from,sessionType:this.getSessionTypeByJid(t.from),conversationId:r.conversationId,ignoreHostCandidatesFromRemote:i,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,allowIPv6:this.config.allowIPv6,iceServers:this.iceServers,reinvite:!!r.reinvite,iceTransportPolicy:this.getIceTransportPolicy()},(u=this.pendingSessions[r.sessionId])?(s=g(g({},a),{},{meetingId:u.meetingId,fromUserId:u.fromUserId,originalRoomJid:u.originalRoomJid,privAnswerMode:u.privAnswerMode}),delete this.pendingSessions[u.sessionId]):s=a,c=this.webrtcSessions.find((function(e){return e.id===s.id})),this.logger.info("offer received",{existingSession:!!c,mediaSessionParams:s}),!c){e.next=16;break}if(c.conversationId=r.conversationId,I.iceIsDifferent(c.peerConnection.remoteDescription.sdp,r.sdp)){e.next=16;break}return e.abrupt("return",this.handleGenesysRenegotiate(c,r.sdp));case 16:return l=new C.GenesysCloudMediaSession(this,s),e.next=19,l.setRemoteDescription(r.sdp);case 19:return this.proxyStatsForSession(l),l.on("sendIq",(function(e){var t;return null===(t=f.stanzaInstance)||void 0===t?void 0:t.sendIQ(e)})),l.on("terminated",(function(){delete f.sessionsMap[l.id],f.webrtcSessions=f.webrtcSessions.filter((function(e){return e.id!==l.id}))})),this.webrtcSessions.push(l),this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(l),e.abrupt("return",this.emit(B,l));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"applyEarlyIceCandidates",value:function(e){var t=this.earlyIceCandidates.get(e.id);if(t){this.earlyIceCandidates.delete(e.id);var n,r=h(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.addRemoteIceCandidate(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"handleGenesysRenegotiate",value:(Q=s(o.mark((function e(t,n){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.peerConnection.setRemoteDescription({sdp:n,type:"offer"});case 2:return e.next=4,t.accept();case 4:case"end":return e.stop()}}),e)}))),function(e,t){return Q.apply(this,arguments)})},{key:"handleGenesysIceCandidate",value:(W=s(o.mark((function e(t){var n,r,a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,r=n.params,!(a=this.getSessionById(r.sessionId,!0))){e.next=8;break}return e.next=6,a.addRemoteIceCandidate(r.sdp);case 6:e.next=10;break;case 8:(s=this.earlyIceCandidates.get(r.sessionId))?this.earlyIceCandidates.set(r.sessionId,[].concat(i(s),[r.sdp])):this.earlyIceCandidates.set(r.sessionId,[r.sdp]);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"handleGenesysTerminate",value:(V=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.genesysWebrtc,r=n.params,this.getSessionById(r.sessionId).onSessionTerminate(r.reason);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getSessionById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getAllSessions().find((function(t){return t.id===e}));if(!n&&!t){var r=new Error("Failed to find session by id");throw this.logger.error(r,{sessionId:e}),r}return n}},{key:"sendIq",value:(H=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stanzaInstance){e.next=2;break}throw new Error("Failed to send iq because there was no stanza instance");case 2:return e.abrupt("return",this.stanzaInstance.sendIQ(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"handleMessage",value:(G=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.propose){e.next=5;break}return e.next=3,this.handlePropose(t);case 3:e.next=6;break;case 5:t.retract?this.handleRetract(t.retract.sessionId):t.accept?this.handledIncomingRtcSession(t.accept.sessionId,t):t.reject&&this.handledIncomingRtcSession(t.reject.sessionId,t);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"handleGenesysWebrtcStanza",value:(J=s(o.mark((function e(t){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("offer"!==(n=t.genesysWebrtc).method){e.next=5;break}return e.abrupt("return",this.handleGenesysOffer(t));case 5:if("iceCandidate"!==n.method){e.next=9;break}return e.abrupt("return",this.handleGenesysIceCandidate(t));case 9:if("terminate"!==n.method){e.next=11;break}return e.abrupt("return",this.handleGenesysTerminate(t));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{key:"prepareSession",value:function(e){if(!e.sid||!this.sessionsMap[e.sid]){var t=this.pendingSessions[e.sid];t&&(delete this.pendingSessions[t.sessionId],delete this.sessionsMap[t.sessionId]);var n="relay"===this.getIceTransportPolicy()&&T.isFirefox,r={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},i=new j.StanzaMediaSession(r);return this.proxyStatsForSession(i),i}this.logger.debug("skipping creation of jingle webrtc session due to sdpOverXmpp")}},{key:"proxyStatsForSession",value:function(e){var t=this;e.on("stats",(function(n){var r=JSON.parse(JSON.stringify(n)),i={conversationId:e.conversationId,sessionId:e.id,sessionType:e.sessionType},a=N.formatStatsEvent(r,i);t.addStatToQueue(a)}))}},{key:"addStatToQueue",value:function(e){if(!this.config.optOutOfWebrtcStatsTelemetry){e.details._appId||(e.details._appId=this.logger.clientId,e.details._appName="streamingclient",e.details._appVersion=E.Client.version),e.details._originAppId=this.client.config.appId;var t=N.deepFlatten(e.details);Object.keys(t).forEach((function(e){var n=t[e];"boolean"==typeof n&&(t[e]="".concat(n))}));var n=g(g({},e),{},{details:t}),r=I.calculatePayloadSize(n),i=this.statBuffer+r>this.currentMaxStatSize;this.statsArr.push(n),this.statBuffer+=r,i?this.sendStatsImmediately():this.throttledSendStats()}}},{key:"getLogDetailsForPendingSessionId",value:function(e){var t={sessionId:e},n=this.pendingSessions[e];return n&&(t.sessionType=n.sessionType,t.conversationId=n.conversationId),t}},{key:"sendStatsImmediately",value:function(){this.throttledSendStats(),this.throttledSendStats.flush()}},{key:"sendStats",value:(z=s(o.mark((function e(){var t,n,r,a,s,u,c,l,f,p,d,v;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=2;break}return e.abrupt("return");case 2:r=[],a=0,s=h(this.statsArr),e.prev=5,s.s();case 7:if((u=s.n()).done){e.next=18;break}if(c=u.value,l=I.calculatePayloadSize(c),!(a+l<this.currentMaxStatSize)){e.next=15;break}r.push(c),a+=l,e.next=16;break;case 15:return e.abrupt("break",18);case 16:e.next=7;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(5),s.e(e.t0);case 23:return e.prev=23,s.f(),e.finish(23);case 26:if(this.statsArr.splice(0,r.length),this.statBuffer=this.statsArr.reduce((function(e,t){return e+I.calculatePayloadSize(t)}),0),r.length&&!this.client.isGuest){e.next=30;break}return e.abrupt("return");case 30:return f={appName:"streamingclient",appVersion:E.Client.version,originAppName:this.client.config.appName,originAppVersion:this.client.config.appVersion,actions:r},e.prev=31,p=this.client.config.authToken,d="diagnostics/newrelic/insights",this.client.backgroundAssistantMode&&(p=this.client.config.jwt,d+="/backgroundassistant"),e.next=37,this.client.http.requestApi(d,{method:"post",responseType:"text",host:this.client.config.apiHost,authToken:p,logger:this.client.logger,data:f});case 37:this.currentMaxStatSize=15e3,e.next=52;break;case 40:if(e.prev=40,e.t1=e.catch(31),!P.HttpClient.retryStatusCodes.has(null===(t=e.t1.response)||void 0===t?void 0:t.status)&&navigator.onLine||(this.statsArr=[].concat(r,i(this.statsArr)),this.statBuffer=this.statsArr.reduce((function(e,t){return e+I.calculatePayloadSize(t)}),0)),413!==(null===(n=e.t1.response)||void 0===n?void 0:n.status)){e.next=51;break}return v=this.currentMaxStatSize,this.currentMaxStatSize-=this.statsSizeDecreaseAmount,this.logger.info("Failed to send stats due to 413, retrying with smaller set",{attemptedPayloadSize:v,newPayloadSize:this.currentMaxStatSize}),e.next=49,this.sendStats();case 49:e.next=52;break;case 51:this.logger.error("Failed to send stats",{err:e.t1,numberOfFailedStats:r.length},{skipServer:!navigator.onLine});case 52:case"end":return e.stop()}}),e,this,[[5,20,23,26],[31,40]])}))),function(){return z.apply(this,arguments)})},{key:"addEventListeners",value:function(){var e=this;this.client.on("connected",(function(){return e.refreshIceServersTimer&&(clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null),e.refreshIceServersTimer=setInterval(e.refreshIceServers.bind(e),216e5),e.refreshIceServers().catch((function(t){return e.logger.error("Error fetching ice servers after streaming-client connected",{error:t,channelId:e.client.config.channelId})}))})),this.client.on("disconnected",(function(){clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null}))}},{key:"handlePropose",value:(U=s(o.mark((function e(t){var n,r,i,a,s,u,c,l;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.from!==this.jid){e.next=2;break}return e.abrupt("return");case 2:if(n=t.propose.sessionId,r=this.pendingSessions[n],i=!!r,a=this.getSessionTypeByJid(t.from),s={sessionId:n,conversationId:t.propose.conversationId,sessionType:a,isDuplicatePropose:i},this.logger.info("propose received",s),i||(this.client.config.appId,u={actionName:"WebrtcStats",details:{_eventTimestamp:(new Date).getTime(),_eventType:"firstPropose",conversationId:s.conversationId,sdpViaXmppRequested:!!t.propose.sdpOverXmpp,sessionId:n,sessionType:a}},this.addStatToQueue(u),c=t.from,l=c,t.propose.originalRoomJid=t.propose.originalRoomJid||l,r=g(g({},t.propose),{},{toJid:t.to,fromJid:c,sessionType:a,roomJid:l,id:n,sdpOverXmpp:t.propose.sdpOverXmpp,privAnswerMode:t.propose.privAnswerMode}),i||(this.sessionsMap[r.id]=!!r.sdpOverXmpp,this.pendingSessions[n]=r)),!r.accepted){e.next=14;break}return this.logger.info("proceed already sent for this session, but sending another",s),e.next=13,this.acceptRtcSession(n);case 13:return e.abrupt("return");case 14:this.emit(M,Object.assign(r));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"handleRetract",value:function(e){return this.logger.info("retract received",this.getLogDetailsForPendingSessionId(e)),delete this.sessionsMap[e],delete this.pendingSessions[e],this.emit(D,e)}},{key:"handledIncomingRtcSession",value:function(e,t){var n=t.accept?"accept":"reject";return this.logger.info("".concat(n," received"),this.getLogDetailsForPendingSessionId(e)),this.emit(L,e)}},{key:"initiateRtcSession",value:(_=s(o.mark((function e(t){var n,r,i,a,s,u,c,l,f;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={to:t.jid,propose:{id:k.v4(),descriptions:[]}},t.stream)for(r=0,i=Array.from(t.stream.getTracks());r<i.length;r++)a=i[r],n.propose.descriptions.push({media:a.kind});if(t.provideVideo&&(n.propose.descriptions.filter((function(e){return"video"===e.media})).length>0||n.propose.descriptions.push({media:"video"})),t.provideAudio&&(n.propose.descriptions.filter((function(e){return"audio"===e.media})).length>0||n.propose.descriptions.push({media:"audio"})),t.mediaPurpose&&n.propose.descriptions.push({media:t.mediaPurpose}),!t.jid||!t.jid.match(/@conference/)){e.next=15;break}0===(s=n.propose.descriptions).length&&(s=[{media:"listener"}]),u={type:"upgradeMedia",to:t.jid,id:k.v4(),from:this.jid,media:{conversationId:t.conversationId,sourceCommunicationId:t.sourceCommunicationId}},c=h(s);try{for(c.s();!(l=c.n()).done;)f=l.value,u.media[f.media]=!0}catch(e){c.e(e)}finally{c.f()}return e.next=13,this.stanzaInstance.send("presence",u);case 13:e.next=18;break;case 15:return e.next=17,this.stanzaInstance.send("message",n);case 17:this.pendingSessions[n.propose.id]=n;case 18:return e.abrupt("return",n.propose.id);case 19:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"acceptRtcSession",value:(b=s(o.mark((function e(t){var n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t]){e.next=4;break}return this.emit(q,"Cannot accept session because it is not pending or does not exist"),e.abrupt("return");case 4:return r={to:n.fromJid,proceed:{sessionId:t}},n.accepted=!0,i=this.getLogDetailsForPendingSessionId(t),this.logger.info("sending jingle proceed",i),e.next=10,this.stanzaInstance.send("message",r);case 10:this.logger.info("sent jingle proceed",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"rejectRtcSession",value:(m=s(o.mark((function e(t){var n,r,i,a,s,u,c,l=arguments;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.length>1&&void 0!==l[1]&&l[1],r=this.getLogDetailsForPendingSessionId(t),i=this.pendingSessions[t]){e.next=6;break}return this.emit(q,"Cannot reject session because it is not pending or does not exist"),e.abrupt("return");case 6:if(delete this.sessionsMap[t],delete this.pendingSessions[t],!n){e.next=12;break}this.ignoredSessions.set(t,!0),e.next=20;break;case 12:return a={to:S.toBare(this.jid),reject:{sessionId:t}},s=this.stanzaInstance.send("message",a),u={to:i.fromJid,reject:{sessionId:t}},c=this.stanzaInstance.send("message",u),this.logger.info("sending jingle reject",r),e.next=19,Promise.all([s,c]);case 19:this.logger.info("sent jingle reject",r);case 20:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"rtcSessionAccepted",value:(v=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingSessions[t],n=this.getLogDetailsForPendingSessionId(t),r={to:S.toBare(this.jid),accept:{sessionId:t}},this.logger.info("sending session-info:accept",n),e.next=6,this.stanzaInstance.send("message",r);case 6:this.logger.info("sent session-info:accept",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"notifyScreenShareStart",value:(d=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:x.JingleAction.SessionInfo,sid:t.id,screenstart:{}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"notifyScreenShareStop",value:(p=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:x.JingleAction.SessionInfo,sid:t.id,screenstop:{}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"cancelRtcSession",value:(a=s(o.mark((function e(t){var n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t],r=this.getLogDetailsForPendingSessionId(t),n){e.next=5;break}return this.emit(q,"Cannot cancel session because it is not pending or does not exist"),e.abrupt("return");case 5:return i={to:n.toJid,retract:{sessionId:t}},delete this.pendingSessions[t],delete this.sessionsMap[t],this.logger.info("sending jingle retract",r),e.next=11,this.stanzaInstance.send("message",i);case 11:this.logger.info("sent jingle retract",r);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"refreshIceServers",value:(n=s(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.refreshIceServersRetryPromise||(this.refreshIceServersRetryPromise=I.retryPromise(this._refreshIceServers.bind(this,this.stanzaInstance),(function(e){return++t.discoRetries>2?(t.logger.warn("fetching ice servers failed. max retries reached.",{retryAttempt:t.discoRetries,MAX_DISCO_RETRIES:2,error:e,channelId:t.client.config.channelId}),!1):(t.logger.warn("fetching ice servers failed. retrying",{retryAttempt:t.discoRetries,error:e,channelId:t.client.config.channelId}),!0)}),0,this.client.logger)),e.abrupt("return",this.refreshIceServersRetryPromise.promise.finally((function(){t.discoRetries=0,t.refreshIceServersRetryPromise=void 0})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_refreshIceServers",value:(t=s(o.mark((function e(t){var n,a,s,u,c,l,f,p,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No stanza instance to refresh ice servers");case 2:return n=t.config.server,a=t.getServices(n,"turn","1"),s=t.getServices(n,"stun","1"),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Timeout waiting for refresh ice servers to finish"))}),15e3),Promise.all([a,s]).then((function(t){var n=r(t,2),i=n[0],a=n[1];e([i,a])})).catch(t)})),e.next=8,u;case 8:return c=e.sent,l=r(c,2),f=l[0],p=l[1],d=[].concat(i(f.services),i(p.services)).map((function(e){var t=e.port?":".concat(e.port):"",n={type:e.type,urls:"".concat(e.type,":").concat(e.host).concat(t)};return["turn","turns"].includes(e.type)&&(e.transport&&"udp"!==e.transport&&(n.urls+="?transport=".concat(e.transport)),e.username&&(n.username=e.username),e.password&&(n.credential=e.password)),n})),this.setIceServers(d,t),p.services.length?this.setIceTransportPolicy("all",t):(this.logger.info('No stun servers received, setting iceTransportPolicy to "relay"'),this.setIceTransportPolicy("relay",t)),e.abrupt("return",d);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setIceServers",value:function(e,t){t.jingle.iceServers=e,this.iceServers=e}},{key:"getIceTransportPolicy",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.config.peerConnectionConfig.iceTransportPolicy}},{key:"setIceTransportPolicy",value:function(e,t){t.jingle.config.peerConnectionConfig.iceTransportPolicy=e}},{key:"getSessionTypeByJid",value:function(e){return I.isAcdJid(e)?R.SessionTypes.acdScreenShare:I.isScreenRecordingJid(e)?R.SessionTypes.screenRecording:I.isSoftphoneJid(e)?R.SessionTypes.softphone:I.isVideoJid(e)?R.SessionTypes.collaborateVideo:R.SessionTypes.unknown}},{key:"getSessionManager",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle}},{key:"getAllSessions",value:function(){var e,t=null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.sessions,n=t&&Object.values(t)||[];return[].concat(i(n),i(this.webrtcSessions))}},{key:"proxyNRStat",value:function(e){this.addStatToQueue(e)}},{key:"jid",get:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jid}},{key:"expose",get:function(){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)}}}]),Z}(_.EventEmitter);t.WebrtcExtension=U},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|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|4lf|4lh|4lv|4m1|4mf|4mn|4nf|4of|4oh|4ov|4q7|h1|5od|5rd|5rh|60f|1upn|1upt|1upv|1uq2|1uq5|1vij|1vj7|1vjl|1vo0|1vv7|20ov|7qo|7qq|7qs|7qu|7tl|7u5|7us|7vl|7vv|sb|sd|s000|t2|97v|uf|9go|9o5"},"B.1":{r:"60b:60d|80b:80d|1vg0:1vgf",s:"5d|606|1vnv|830|qf"},"B.2":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|rq:10;tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ui:u5|uj:ud|uk:ub|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti: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|1uo6:3j;3k|1uoj:1bk;1bm|1uok:1bk;1b5|1uol:1bk;1bb|1uom:1bu;1bm|1uon:1bk;1bd|3l00:31|3l01:32|3l02:33|3l03:34|3l04:35|3l05:36|3l06:37|3l07:38|3l08:39|3l09:3a|3l0a:3b|3l0b:3c|3l0c:3d|3l0d:3e|3l0e:3f|3l0f:3g|3l0g:3h|3l0h:3i|3l0i:3j|3l0j:3k|3l0k:3l|3l0l:3m|3l0m:3n|3l0n:3o|3l0o:3p|3l0p:3q|3l1k:31|3l1l:32|3l1m:33|3l1n:34|3l1o:35|3l1p:36|3l1q:37|3l1r:38|3l1s:39|3l1t:3a|3l1u:3b|3l1v:3c|3l20:3d|3l21:3e|3l22:3f|3l23:3g|3l24:3h|3l25:3i|3l26:3j|3l27:3k|3l28:3l|3l29:3m|3l2a:3n|3l2b:3o|3l2c:3p|3l2d:3q|3l38:31|3l39:32|3l3a:33|3l3b:34|3l3c:35|3l3d:36|3l3e:37|3l3f:38|3l3g:39|3l3h:3a|3l3i:3b|3l3j:3c|3l3k:3d|3l3l:3e|3l3m:3f|3l3n:3g|3l3o:3h|3l3p:3i|3l3q:3j|3l3r:3k|3l3s:3l|3l3t:3m|3l3u:3n|3l3v:3o|3l40:3p|3l41:3q|3l4s:31|3l4u:33|3l4v:34|3l52:37|3l55:3a|3l56:3b|3l59:3e|3l5a:3f|3l5b:3g|3l5c:3h|3l5e:3j|3l5f:3k|3l5g:3l|3l5h:3m|3l5i:3n|3l5j:3o|3l5k:3p|3l5l:3q|3l6g:31|3l6h:32|3l6i:33|3l6j:34|3l6k:35|3l6l:36|3l6m:37|3l6n:38|3l6o:39|3l6p:3a|3l6q:3b|3l6r:3c|3l6s:3d|3l6t:3e|3l6u:3f|3l6v:3g|3l70:3h|3l71:3i|3l72:3j|3l73:3k|3l74:3l|3l75:3m|3l76:3n|3l77:3o|3l78:3p|3l79:3q|3l84:31|3l85:32|3l87:34|3l88:35|3l89:36|3l8a:37|3l8d:3a|3l8e:3b|3l8f:3c|3l8g:3d|3l8h:3e|3l8i:3f|3l8j:3g|3l8k:3h|3l8m:3j|3l8n:3k|3l8o:3l|3l8p:3m|3l8q:3n|3l8r:3o|3l8s:3p|3l9o:31|3l9p:32|3l9r:34|3l9s:35|3l9t:36|3l9u:37|3la0:39|3la1:3a|3la2:3b|3la3:3c|3la4:3d|3la6:3f|3laa:3j|3lab:3k|3lac:3l|3lad:3m|3lae:3n|3laf:3o|3lag:3p|3lbc:31|3lbd:32|3lbe:33|3lbf:34|3lbg:35|3lbh:36|3lbi:37|3lbj:38|3lbk:39|3lbl:3a|3lbm:3b|3lbn:3c|3lbo:3d|3lbp:3e|3lbq:3f|3lbr:3g|3lbs:3h|3lbt:3i|3lbu:3j|3lbv:3k|3lc0:3l|3lc1:3m|3lc2:3n|3lc3:3o|3lc4:3p|3lc5:3q|3ld0:31|3ld1:32|3ld2:33|3ld3:34|3ld4:35|3ld5:36|3ld6:37|3ld7:38|3ld8:39|3ld9:3a|3lda:3b|3ldb:3c|3ldc:3d|3ldd:3e|3lde:3f|3ldf:3g|3ldg:3h|3ldh:3i|3ldi:3j|3ldj:3k|3ldk:3l|3ldl:3m|3ldm:3n|3ldn:3o|3ldo:3p|3ldp:3q|3lek:31|3lel:32|3lem:33|3len:34|3leo:35|3lep:36|3leq:37|3ler:38|3les:39|3let:3a|3leu:3b|3lev:3c|3lf0:3d|3lf1:3e|3lf2:3f|3lf3:3g|3lf4:3h|3lf5:3i|3lf6:3j|3lf7:3k|3lf8:3l|3lf9:3m|3lfa:3n|3lfb:3o|3lfc:3p|3lfd:3q|3lg8:31|3lg9:32|3lga:33|3lgb:34|3lgc:35|3lgd:36|3lge:37|3lgf:38|3lgg:39|3lgh:3a|3lgi:3b|3lgj:3c|3lgk:3d|3lgl:3e|3lgm:3f|3lgn:3g|3lgo:3h|3lgp:3i|3lgq:3j|3lgr:3k|3lgs:3l|3lgt:3m|3lgu:3n|3lgv:3o|3lh0:3p|3lh1:3q|3lhs:31|3lht:32|3lhu:33|3lhv:34|3li0:35|3li1:36|3li2:37|3li3:38|3li4:39|3li5:3a|3li6:3b|3li7:3c|3li8:3d|3li9:3e|3lia:3f|3lib:3g|3lic:3h|3lid:3i|3lie:3j|3lif:3k|3lig:3l|3lih:3m|3lii:3n|3lij:3o|3lik:3p|3lil:3q|3ljg:31|3ljh:32|3lji:33|3ljj:34|3ljk:35|3ljl:36|3ljm:37|3ljn:38|3ljo:39|3ljp:3a|3ljq:3b|3ljr:3c|3ljs:3d|3ljt:3e|3lju:3f|3ljv:3g|3lk0:3h|3lk1:3i|3lk2:3j|3lk3:3k|3lk4:3l|3lk5:3m|3lk6:3n|3lk7:3o|3lk8:3p|3lk9:3q|3ll8:th|3ll9:ti|3lla:tj|3llb:tk|3llc:tl|3lld:tm|3lle:tn|3llf:to|3llg:tp|3llh:tq|3lli:tr|3llj:ts|3llk:tt|3lll:tu|3llm:tv|3lln:u0|3llo:u1|3llp:to|3llq:u3|3llr:u4|3lls:u5|3llt:u6|3llu:u7|3llv:u8|3lm0:u9|3lmj:u3|3ln2:th|3ln3:ti|3ln4:tj|3ln5:tk|3ln6:tl|3ln7:tm|3ln8:tn|3ln9:to|3lna:tp|3lnb:tq|3lnc:tr|3lnd:ts|3lne:tt|3lnf:tu|3lng:tv|3lnh:u0|3lni:u1|3lnj:to|3lnk:u3|3lnl:u4|3lnm:u5|3lnn:u6|3lno:u7|3lnp:u8|3lnq:u9|3lod:u3|3los:th|3lot:ti|3lou:tj|3lov:tk|3lp0:tl|3lp1:tm|3lp2:tn|3lp3:to|3lp4:tp|3lp5:tq|3lp6:tr|3lp7:ts|3lp8:tt|3lp9:tu|3lpa:tv|3lpb:u0|3lpc:u1|3lpd:to|3lpe:u3|3lpf:u4|3lpg:u5|3lph:u6|3lpi:u7|3lpj:u8|3lpk:u9|3lq7:u3|3lqm:th|3lqn:ti|3lqo:tj|3lqp:tk|3lqq:tl|3lqr:tm|3lqs:tn|3lqt:to|3lqu:tp|3lqv:tq|3lr0: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|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"},"B.3":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti: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|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|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|4ig:4im|4iq:4it|4j0:4k6|4ka:4kd|4kg:4le|4li:4ll|4lo:4lu|4m2:4m5|4m8:4me|4mg:4mm|4mo:4ne|4ng:4oe|4oi:4ol|4oo:4ou|4p0:4q6|4q8:4qq|4r1:4rs|4t0:4vk|501:5jm|5k1:5kq|5l0:5ng|5o0:5oc|5oe:5oh|5p0:5ph|5pl:5pm|5q0:5qh|5r0:5rc|5re:5rg|5s0:5tm|5tu:5u5|5u7:5u8|5uk:5uq|5v0:5v9|60g:60p|610:63n|640:658|7g0:7kr|7l0:7np|7o0:7ol|7oo:7ot|7p0:7q5|7q8:7qd|7qg:7qn|7qv:7rt|7s0:7tk|7tm:7ts|7u2:7u4|7u6:7uc|7ug:7uj|7um:7ur|7v0:7vc|7vi:7vk|7vm:7vs|88a:88j|88p:88t|89a:89d|89f:89h|89j:89p|89t:89v|8a5:8a9|8b0:8c3|8pm:8rq|94s:979|c05:c07|c11:c19|c1h:c1l|c1o:c1s|c21:c4m|c4t:c4v|c51:c7q|c7s:c7v|c85:c9c|c9h:cce|ccg:cdn|cfg:cgs|ch0:ci3|cj0:cjr|cjv:clg|cm0:cmb|cmg:cnu|co0:crm|crr:cut|cv0:cvu|d00:jdl|jg0:17t5|1800:194c|1b00:1lt3|1m00:1uhd|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 Ke}));var r=n(203),i=n.n(r),a=n(9),o=n.n(a),s=n(12),u=n.n(s),c=n(13),l=n.n(c),f=n(3),p=n.n(f),d=n(8),h=n.n(d),v=n(0),m=n.n(v),g=n(16),y=n.n(g),b=n(17),_=n.n(b),S=n(14),w=n.n(S),x=n(28),k=n.n(x),O=n(6),T=n.n(O),A=n(7),I=n.n(A),E=n(4),N=n.n(E),R=n(11),j=n.n(R);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=p.a.mark($e),D=p.a.mark(Ze);function L(e,t){F(e,t),t.add(e)}function B(e,t,n){F(e,t),t.set(e,n)}function F(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function U(e,t,n,r){return J(e,t),z(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,r),r}function z(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function J(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w()(e);if(t){var i=w()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _()(this,n)}}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var W="object"===("undefined"==typeof performance?"undefined":j()(performance))&&performance&&"function"==typeof performance.now?performance:Date,Q=new Set,K="object"===(void 0===e?"undefined":j()(e))&&e?e:{},Y=function(e,t,n,r){"function"==typeof K.emitWarning?K.emitWarning(e,t,n,r):console.error("[".concat(n,"] ").concat(t,": ").concat(e))},X=globalThis.AbortController,$=globalThis.AbortSignal;if(void 0===X){var Z;$=function(){function e(){T()(this,e),N()(this,"onabort",void 0),N()(this,"_onabort",[]),N()(this,"reason",void 0),N()(this,"aborted",!1)}return I()(e,[{key:"addEventListener",value:function(e,t){this._onabort.push(t)}}]),e}(),X=function(){function e(){T()(this,e),N()(this,"signal",new $),te()}return I()(e,[{key:"abort",value:function(e){var t,n;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;var r,i=H(this.signal._onabort);try{for(i.s();!(r=i.n()).done;){(0,r.value)(e)}}catch(e){i.e(e)}finally{i.f()}null===(t=(n=this.signal).onabort)||void 0===t||t.call(n,e)}}}]),e}();var ee="1"!==(null===(Z=K.env)||void 0===Z?void 0:Z.LRU_CACHE_IGNORE_AC_WARNING),te=function e(){ee&&(ee=!1,Y("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");var ne=function(e){return e&&e===Math.floor(e)&&e>0&&isFinite(e)},re=function(e){return ne(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ie:null:null},ie=function(e){y()(n,e);var t=G(n);function n(e){var r;return T()(this,n),(r=t.call(this,e)).fill(0),r}return n}(k()(Array)),ae=function(){function e(t,n){if(T()(this,e),N()(this,"heap",void 0),N()(this,"length",void 0),i=oe,J(r=e,e),z(i,"get"),!function(e,t){return t.get?t.get.call(e):t.value}(r,i))throw new TypeError("instantiate Stack using Stack.create(n)");var r,i;this.heap=new n(t),this.length=0}return I()(e,null,[{key:"create",value:function(t){var n=re(t);if(!n)return[];U(e,e,oe,!0);var r=new e(t,n);return U(e,e,oe,!1),r}}]),I()(e,[{key:"push",value:function(e){this.heap[this.length++]=e}},{key:"pop",value:function(){return this.heap[--this.length]}}]),e}(),oe={writable:!0,value:!1},se=new WeakMap,ue=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,pe=new WeakMap,de=new WeakMap,he=new WeakMap,ve=new WeakMap,me=new WeakMap,ge=new WeakMap,ye=new WeakMap,be=new WeakMap,_e=new WeakMap,Se=new WeakMap,we=new WeakMap,xe=new WeakMap,ke=new WeakMap,Oe=new WeakMap,Te=new WeakMap,Ae=new WeakMap,Ie=new WeakMap,Ee=new WeakMap,Ne=new WeakSet,Re=new WeakMap,je=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Me=new WeakSet,De=new WeakMap,Le=new WeakMap,Be=new WeakMap,Fe=new WeakSet,qe=new WeakSet,Ue=new WeakSet,ze=new WeakSet,Je=new WeakSet,Ge=new WeakSet,He=new WeakSet,Ve=new WeakSet,We=new WeakSet,Qe=new WeakSet,Ke=function(){function e(t){T()(this,e),L(this,Qe),L(this,We),L(this,Ve),L(this,He),L(this,Ge),L(this,Je),L(this,ze),L(this,Ue),L(this,qe),L(this,Fe),L(this,Me),L(this,Ne),B(this,se,{writable:!0,value:void 0}),B(this,ue,{writable:!0,value:void 0}),B(this,ce,{writable:!0,value:void 0}),B(this,le,{writable:!0,value:void 0}),B(this,fe,{writable:!0,value:void 0}),B(this,pe,{writable:!0,value:void 0}),N()(this,"ttl",void 0),N()(this,"ttlResolution",void 0),N()(this,"ttlAutopurge",void 0),N()(this,"updateAgeOnGet",void 0),N()(this,"updateAgeOnHas",void 0),N()(this,"allowStale",void 0),N()(this,"noDisposeOnSet",void 0),N()(this,"noUpdateTTL",void 0),N()(this,"maxEntrySize",void 0),N()(this,"sizeCalculation",void 0),N()(this,"noDeleteOnFetchRejection",void 0),N()(this,"noDeleteOnStaleGet",void 0),N()(this,"allowStaleOnFetchAbort",void 0),N()(this,"allowStaleOnFetchRejection",void 0),N()(this,"ignoreFetchAbort",void 0),B(this,de,{writable:!0,value:void 0}),B(this,he,{writable:!0,value:void 0}),B(this,ve,{writable:!0,value:void 0}),B(this,me,{writable:!0,value:void 0}),B(this,ge,{writable:!0,value:void 0}),B(this,ye,{writable:!0,value:void 0}),B(this,be,{writable:!0,value:void 0}),B(this,_e,{writable:!0,value:void 0}),B(this,Se,{writable:!0,value:void 0}),B(this,we,{writable:!0,value:void 0}),B(this,xe,{writable:!0,value:void 0}),B(this,ke,{writable:!0,value:void 0}),B(this,Oe,{writable:!0,value:void 0}),B(this,Te,{writable:!0,value:void 0}),B(this,Ae,{writable:!0,value:void 0}),B(this,Ie,{writable:!0,value:void 0}),B(this,Ee,{writable:!0,value:void 0}),B(this,Re,{writable:!0,value:function(){}}),B(this,je,{writable:!0,value:function(){}}),B(this,Ce,{writable:!0,value:function(){}}),B(this,Pe,{writable:!0,value:function(){return!1}}),B(this,De,{writable:!0,value:function(e){}}),B(this,Le,{writable:!0,value:function(e,t,n){}}),B(this,Be,{writable:!0,value:function(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}}),N()(this,Symbol.toStringTag,"LRUCache");var n=t.max,r=void 0===n?0:n,i=t.ttl,a=t.ttlResolution,o=void 0===a?1:a,s=t.ttlAutopurge,u=t.updateAgeOnGet,c=t.updateAgeOnHas,l=t.allowStale,f=t.dispose,p=t.disposeAfter,d=t.noDisposeOnSet,v=t.noUpdateTTL,g=t.maxSize,y=void 0===g?0:g,b=t.maxEntrySize,_=void 0===b?0:b,S=t.sizeCalculation,w=t.fetchMethod,x=t.memoMethod,k=t.noDeleteOnFetchRejection,O=t.noDeleteOnStaleGet,A=t.allowStaleOnFetchRejection,I=t.allowStaleOnFetchAbort,E=t.ignoreFetchAbort;if(0!==r&&!ne(r))throw new TypeError("max option must be a nonnegative integer");var R=r?re(r):Array;if(!R)throw new Error("invalid max value: "+r);if(h()(this,se,r),h()(this,ue,y),this.maxEntrySize=_||m()(this,ue),this.sizeCalculation=S,this.sizeCalculation){if(!m()(this,ue)&&!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!==x&&"function"!=typeof x)throw new TypeError("memoMethod must be a function if defined");if(h()(this,pe,x),void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(h()(this,fe,w),h()(this,Ie,!!w),h()(this,ve,new Map),h()(this,me,new Array(r).fill(void 0)),h()(this,ge,new Array(r).fill(void 0)),h()(this,ye,new R(r)),h()(this,be,new R(r)),h()(this,_e,0),h()(this,Se,0),h()(this,we,ae.create(r)),h()(this,de,0),h()(this,he,0),"function"==typeof f&&h()(this,ce,f),"function"==typeof p?(h()(this,le,p),h()(this,xe,[])):(h()(this,le,void 0),h()(this,xe,void 0)),h()(this,Ae,!!m()(this,ce)),h()(this,Ee,!!m()(this,le)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!E,0!==this.maxEntrySize){if(0!==m()(this,ue)&&!ne(m()(this,ue)))throw new TypeError("maxSize must be a positive integer if specified");if(!ne(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");q(this,Me,Xe).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!c,this.ttlResolution=ne(o)||0===o?o:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!ne(this.ttl))throw new TypeError("ttl must be a positive integer if specified");q(this,Ne,Ye).call(this)}if(0===m()(this,se)&&0===this.ttl&&0===m()(this,ue))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!m()(this,se)&&!m()(this,ue)){var j="LRU_CACHE_UNBOUNDED";if(function(e){return!Q.has(e)}(j)){Q.add(j);Y("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,e)}}}var t,n;return I()(e,[{key:"max",get:function(){return m()(this,se)}},{key:"maxSize",get:function(){return m()(this,ue)}},{key:"calculatedSize",get:function(){return m()(this,he)}},{key:"size",get:function(){return m()(this,de)}},{key:"fetchMethod",get:function(){return m()(this,fe)}},{key:"memoMethod",get:function(){return m()(this,pe)}},{key:"dispose",get:function(){return m()(this,ce)}},{key:"disposeAfter",get:function(){return m()(this,le)}}],[{key:"unsafeExposeInternals",value:function(e){return{starts:m()(e,Oe),ttls:m()(e,Te),sizes:m()(e,ke),keyMap:m()(e,ve),keyList:m()(e,me),valList:m()(e,ge),next:m()(e,ye),prev:m()(e,be),get head(){return m()(e,_e)},get tail(){return m()(e,Se)},free:m()(e,we),isBackgroundFetch:function(t){return q(e,Ge,rt).call(e,t)},backgroundFetch:function(t,n,r,i){return q(e,Je,nt).call(e,t,n,r,i)},moveToTail:function(t){return q(e,Ve,at).call(e,t)},indexes:function(t){return q(e,Fe,$e).call(e,t)},rindexes:function(t){return q(e,qe,Ze).call(e,t)},isStale:function(t){return m()(e,Pe).call(e,t)}}}}]),I()(e,[{key:"getRemainingTTL",value:function(e){return m()(this,ve).has(e)?1/0:0}},{key:"entries",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(r=n.value,void 0===m()(this,ge)[r]||void 0===m()(this,me)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=8;break}return e.next=8,[m()(this,me)[r],m()(this,ge)[r]];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"rentries",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(r=n.value,void 0===m()(this,ge)[r]||void 0===m()(this,me)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=8;break}return e.next=8,[m()(this,me)[r],m()(this,ge)[r]];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"keys",value:p.a.mark((function e(){var t,n,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===(i=m()(this,me)[r])||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"rkeys",value:p.a.mark((function e(){var t,n,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===(i=m()(this,me)[r])||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"values",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===m()(this,ge)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,m()(this,ge)[r];case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"rvalues",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===m()(this,ge)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,m()(this,ge)[r];case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"find",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=H(q(this,Fe,$e).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&e(o,m()(this,me)[i],this))return this.get(m()(this,me)[i],n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"forEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=H(q(this,Fe,$e).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,m()(this,me)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"rforEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=H(q(this,qe,Ze).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,m()(this,me)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"purgeStale",value:function(){var e,t=!1,n=H(q(this,qe,Ze).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value;m()(this,Pe).call(this,r)&&(q(this,We,ot).call(this,m()(this,me)[r],"expire"),t=!0)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"info",value:function(e){var t=m()(this,ve).get(e);if(void 0!==t){var n=m()(this,ge)[t],r=q(this,Ge,rt).call(this,n)?n.__staleWhileFetching:n;if(void 0!==r){var i={value:r};if(m()(this,Te)&&m()(this,Oe)){var a=m()(this,Te)[t],o=m()(this,Oe)[t];if(a&&o){var s=a-(W.now()-o);i.ttl=s,i.start=Date.now()}}return m()(this,ke)&&(i.size=m()(this,ke)[t]),i}}}},{key:"dump",value:function(){var e,t=[],n=H(q(this,Fe,$e).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=m()(this,me)[r],a=m()(this,ge)[r],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&void 0!==i){var s={value:o};if(m()(this,Te)&&m()(this,Oe)){s.ttl=m()(this,Te)[r];var u=W.now()-m()(this,Oe)[r];s.start=Math.floor(Date.now()-u)}m()(this,ke)&&(s.size=m()(this,ke)[r]),t.unshift([i,s])}}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"load",value:function(e){this.clear();var t,n=H(e);try{for(n.s();!(t=n.n()).done;){var r=l()(t.value,2),i=r[0],a=r[1];if(a.start){var o=Date.now()-a.start;a.start=W.now()-o}this.set(i,a.value,a)}}catch(e){n.e(e)}finally{n.f()}}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t)return this.delete(e),this;var r=n.ttl,i=void 0===r?this.ttl:r,a=n.start,o=n.noDisposeOnSet,s=void 0===o?this.noDisposeOnSet:o,c=n.sizeCalculation,l=void 0===c?this.sizeCalculation:c,f=n.status,p=n.noUpdateTTL,d=void 0===p?this.noUpdateTTL:p,v=m()(this,Be).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&v>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),q(this,We,ot).call(this,e,"set"),this;var g=0===m()(this,de)?void 0:m()(this,ve).get(e);if(void 0===g){var y;g=0===m()(this,de)?m()(this,Se):0!==m()(this,we).length?m()(this,we).pop():m()(this,de)===m()(this,se)?q(this,ze,tt).call(this,!1):m()(this,de),m()(this,me)[g]=e,m()(this,ge)[g]=t,m()(this,ve).set(e,g),m()(this,ye)[m()(this,Se)]=g,m()(this,be)[g]=m()(this,Se),h()(this,Se,g),h()(this,de,(y=m()(this,de),y++,y)),m()(this,Le).call(this,g,v,f),f&&(f.set="add"),d=!1}else{q(this,Ve,at).call(this,g);var b=m()(this,ge)[g];if(t!==b){if(m()(this,Ie)&&q(this,Ge,rt).call(this,b)){b.__abortController.abort(new Error("replaced"));var _=b.__staleWhileFetching;if(void 0!==_&&!s){var S,w;if(m()(this,Ae))null===(S=m()(this,ce))||void 0===S||S.call(this,_,e,"set");if(m()(this,Ee))null===(w=m()(this,xe))||void 0===w||w.push([_,e,"set"])}}else if(!s){var x,k;if(m()(this,Ae))null===(x=m()(this,ce))||void 0===x||x.call(this,b,e,"set");if(m()(this,Ee))null===(k=m()(this,xe))||void 0===k||k.push([b,e,"set"])}if(m()(this,De).call(this,g),m()(this,Le).call(this,g,v,f),m()(this,ge)[g]=t,f){f.set="replace";var O=b&&q(this,Ge,rt).call(this,b)?b.__staleWhileFetching:b;void 0!==O&&(f.oldValue=O)}}else f&&(f.set="update")}if(0===i||m()(this,Te)||q(this,Ne,Ye).call(this),m()(this,Te)&&(d||m()(this,Ce).call(this,g,i,a),f&&m()(this,je).call(this,f,g)),!s&&m()(this,Ee)&&m()(this,xe))for(var T,A=m()(this,xe);T=null==A?void 0:A.shift();){var I,E;null===(I=m()(this,le))||void 0===I||(E=I).call.apply(E,[this].concat(u()(T)))}return this}},{key:"pop",value:function(){try{for(;m()(this,de);){var e=m()(this,ge)[m()(this,_e)];if(q(this,ze,tt).call(this,!0),q(this,Ge,rt).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(m()(this,Ee)&&m()(this,xe))for(var t,n=m()(this,xe);t=null==n?void 0:n.shift();){var r,i;null===(r=m()(this,le))||void 0===r||(i=r).call.apply(i,[this].concat(u()(t)))}}}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.updateAgeOnHas,r=void 0===n?this.updateAgeOnHas:n,i=t.status,a=m()(this,ve).get(e);if(void 0!==a){var o=m()(this,ge)[a];if(q(this,Ge,rt).call(this,o)&&void 0===o.__staleWhileFetching)return!1;if(!m()(this,Pe).call(this,a))return r&&m()(this,Re).call(this,a),i&&(i.has="hit",m()(this,je).call(this,i,a)),!0;i&&(i.has="stale",m()(this,je).call(this,i,a))}else i&&(i.has="miss");return!1}},{key:"peek",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowStale,r=void 0===n?this.allowStale:n,i=m()(this,ve).get(e);if(void 0!==i&&(r||!m()(this,Pe).call(this,i))){var a=m()(this,ge)[i];return q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a}}},{key:"fetch",value:(n=o()(p.a.mark((function e(t){var n,r,i,a,o,s,u,c,l,f,d,h,v,g,y,b,_,S,w,x,k,O,T,A,I,E,N,R,j,C,P,M,D,L,B,F,U,z,J,G=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=G.length>1&&void 0!==G[1]?G[1]:{},r=n.allowStale,i=void 0===r?this.allowStale:r,a=n.updateAgeOnGet,o=void 0===a?this.updateAgeOnGet:a,s=n.noDeleteOnStaleGet,u=void 0===s?this.noDeleteOnStaleGet:s,c=n.ttl,l=void 0===c?this.ttl:c,f=n.noDisposeOnSet,d=void 0===f?this.noDisposeOnSet:f,h=n.size,v=void 0===h?0:h,g=n.sizeCalculation,y=void 0===g?this.sizeCalculation:g,b=n.noUpdateTTL,_=void 0===b?this.noUpdateTTL:b,S=n.noDeleteOnFetchRejection,w=void 0===S?this.noDeleteOnFetchRejection:S,x=n.allowStaleOnFetchRejection,k=void 0===x?this.allowStaleOnFetchRejection:x,O=n.ignoreFetchAbort,T=void 0===O?this.ignoreFetchAbort:O,A=n.allowStaleOnFetchAbort,I=void 0===A?this.allowStaleOnFetchAbort:A,E=n.context,N=n.forceRefresh,R=void 0!==N&&N,j=n.status,C=n.signal,m()(this,Ie)){e.next=5;break}return j&&(j.fetch="get"),e.abrupt("return",this.get(t,{allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,status:j}));case 5:if(P={allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,ttl:l,noDisposeOnSet:d,size:v,sizeCalculation:y,noUpdateTTL:_,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:T,status:j,signal:C},void 0!==(M=m()(this,ve).get(t))){e.next=13;break}return j&&(j.fetch="miss"),D=q(this,Je,nt).call(this,t,M,P,E),e.abrupt("return",D.__returned=D);case 13:if(L=m()(this,ge)[M],!q(this,Ge,rt).call(this,L)){e.next=18;break}return B=i&&void 0!==L.__staleWhileFetching,j&&(j.fetch="inflight",B&&(j.returnedStale=!0)),e.abrupt("return",B?L.__staleWhileFetching:L.__returned=L);case 18:if(F=m()(this,Pe).call(this,M),R||F){e.next=25;break}return j&&(j.fetch="hit"),q(this,Ve,at).call(this,M),o&&m()(this,Re).call(this,M),j&&m()(this,je).call(this,j,M),e.abrupt("return",L);case 25:return U=q(this,Je,nt).call(this,t,M,P,E),z=void 0!==U.__staleWhileFetching,J=z&&i,j&&(j.fetch=F?"stale":"refresh",J&&F&&(j.returnedStale=!0)),e.abrupt("return",J?U.__staleWhileFetching:U.__returned=U);case 30:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"forceFetch",value:(t=o()(p.a.mark((function e(t){var n,r,i=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,this.fetch(t,n);case 3:if(void 0!==(r=e.sent)){e.next=6;break}throw new Error("fetch() returned undefined");case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"memo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=m()(this,pe);if(!n)throw new Error("no memoMethod provided to constructor");var r=t.context,a=t.forceRefresh,o=i()(t,["context","forceRefresh"]),s=this.get(e,o);if(!a&&void 0!==s)return s;var u=n(e,s,{options:o,context:r});return this.set(e,u,o),u}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowStale,r=void 0===n?this.allowStale:n,i=t.updateAgeOnGet,a=void 0===i?this.updateAgeOnGet:i,o=t.noDeleteOnStaleGet,s=void 0===o?this.noDeleteOnStaleGet:o,u=t.status,c=m()(this,ve).get(e);if(void 0!==c){var l=m()(this,ge)[c],f=q(this,Ge,rt).call(this,l);return u&&m()(this,je).call(this,u,c),m()(this,Pe).call(this,c)?(u&&(u.get="stale"),f?(u&&r&&void 0!==l.__staleWhileFetching&&(u.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||q(this,We,ot).call(this,e,"expire"),u&&r&&(u.returnedStale=!0),r?l:void 0)):(u&&(u.get="hit"),f?l.__staleWhileFetching:(q(this,Ve,at).call(this,c),a&&m()(this,Re).call(this,c),l))}u&&(u.get="miss")}},{key:"delete",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return q(this,We,ot).call(this,e,"delete")}))},{key:"clear",value:function(){return q(this,Qe,st).call(this,"delete")}}]),e}();function Ye(){var e=this,t=new ie(m()(this,se)),n=new ie(m()(this,se));h()(this,Te,t),h()(this,Oe,n),h()(this,Ce,(function(r,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:W.now();if(n[r]=0!==i?a:0,t[r]=i,0!==i&&e.ttlAutopurge){var o=setTimeout((function(){m()(e,Pe).call(e,r)&&q(e,We,ot).call(e,m()(e,me)[r],"expire")}),i+1);o.unref&&o.unref()}})),h()(this,Re,(function(e){n[e]=0!==t[e]?W.now():0})),h()(this,je,(function(e,a){if(t[a]){var o=t[a],s=n[a];if(!o||!s)return;e.ttl=o,e.start=s,e.now=r||i();var u=e.now-s;e.remainingTTL=o-u}}));var r=0,i=function(){var t=W.now();if(e.ttlResolution>0){r=t;var n=setTimeout((function(){return r=0}),e.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=function(a){var o=m()(e,ve).get(a);if(void 0===o)return 0;var s=t[o],u=n[o];return s&&u?s-((r||i())-u):1/0},h()(this,Pe,(function(e){var a=n[e],o=t[e];return!!o&&!!a&&(r||i())-a>o}))}function Xe(){var e=this,t=new ie(m()(this,se));h()(this,he,0),h()(this,ke,t),h()(this,De,(function(n){h()(e,he,m()(e,he)-t[n]),t[n]=0})),h()(this,Be,(function(t,n,r,i){if(q(e,Ge,rt).call(e,n))return 0;if(!ne(r)){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(r=i(n,t),!ne(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r})),h()(this,Le,(function(n,r,i){if(t[n]=r,m()(e,ue))for(var a=m()(e,ue)-t[n];m()(e,he)>a;)q(e,ze,tt).call(e,!0);h()(e,he,m()(e,he)+t[n]),i&&(i.entrySize=r,i.totalCalculatedSize=m()(e,he))}))}function $e(){var e,t,n,r,i=arguments;return p.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},t=e.allowStale,n=void 0===t?this.allowStale:t,!m()(this,de)){a.next=16;break}r=m()(this,Se);case 3:if(q(this,Ue,et).call(this,r)){a.next=6;break}return a.abrupt("break",16);case 6:if(!n&&m()(this,Pe).call(this,r)){a.next=9;break}return a.next=9,r;case 9:if(r!==m()(this,_e)){a.next=13;break}return a.abrupt("break",16);case 13:r=m()(this,be)[r];case 14:a.next=3;break;case 16:case"end":return a.stop()}}),M,this)}function Ze(){var e,t,n,r,i=arguments;return p.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},t=e.allowStale,n=void 0===t?this.allowStale:t,!m()(this,de)){a.next=16;break}r=m()(this,_e);case 3:if(q(this,Ue,et).call(this,r)){a.next=6;break}return a.abrupt("break",16);case 6:if(!n&&m()(this,Pe).call(this,r)){a.next=9;break}return a.next=9,r;case 9:if(r!==m()(this,Se)){a.next=13;break}return a.abrupt("break",16);case 13:r=m()(this,ye)[r];case 14:a.next=3;break;case 16:case"end":return a.stop()}}),D,this)}function et(e){return void 0!==e&&m()(this,ve).get(m()(this,me)[e])===e}function tt(e){var t,n=m()(this,_e),r=m()(this,me)[n],i=m()(this,ge)[n];if(m()(this,Ie)&&q(this,Ge,rt).call(this,i))i.__abortController.abort(new Error("evicted"));else if(m()(this,Ae)||m()(this,Ee)){var a,o;if(m()(this,Ae))null===(a=m()(this,ce))||void 0===a||a.call(this,i,r,"evict");if(m()(this,Ee))null===(o=m()(this,xe))||void 0===o||o.push([i,r,"evict"])}return m()(this,De).call(this,n),e&&(m()(this,me)[n]=void 0,m()(this,ge)[n]=void 0,m()(this,we).push(n)),1===m()(this,de)?(h()(this,_e,h()(this,Se,0)),m()(this,we).length=0):h()(this,_e,m()(this,ye)[n]),m()(this,ve).delete(r),h()(this,de,(t=m()(this,de),t--,t)),n}function nt(e,t,n,r){var i=this,a=void 0===t?void 0:m()(this,ge)[t];if(q(this,Ge,rt).call(this,a))return a;var o=new X,s=n.signal;null==s||s.addEventListener("abort",(function(){return o.abort(s.reason)}),{signal:o.signal});var u={signal:o.signal,options:n,context:r},c=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o.signal.aborted,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(s&&!a?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!a)return l(o.signal.reason);var p=f;return m()(i,ge)[t]===f&&(void 0===r?p.__staleWhileFetching?m()(i,ge)[t]=p.__staleWhileFetching:q(i,We,ot).call(i,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),i.set(e,r,u.options))),r},l=function(r){var a=o.signal.aborted&&n.allowStaleOnFetchAbort,s=a||n.allowStaleOnFetchRejection,u=s||n.noDeleteOnFetchRejection,c=f;m()(i,ge)[t]===f&&(!u||void 0===c.__staleWhileFetching?q(i,We,ot).call(i,e,"fetch"):a||(m()(i,ge)[t]=c.__staleWhileFetching));if(s)return n.status&&void 0!==c.__staleWhileFetching&&(n.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw r};n.status&&(n.status.fetchDispatched=!0);var f=new Promise((function(t,r){var s,l=null===(s=m()(i,fe))||void 0===s?void 0:s.call(i,e,a,u);l&&l instanceof Promise&&l.then((function(e){return t(void 0===e?void 0:e)}),r),o.signal.addEventListener("abort",(function(){n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=function(e){return c(e,!0)}))}))})).then(c,(function(e){return n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)})),p=Object.assign(f,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return void 0===t?(this.set(e,p,P(P({},u.options),{},{status:void 0})),t=m()(this,ve).get(e)):m()(this,ge)[t]=p,p}function rt(e){if(!m()(this,Ie))return!1;var t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof X}function it(e,t){m()(this,be)[t]=e,m()(this,ye)[e]=t}function at(e){e!==m()(this,Se)&&(e===m()(this,_e)?h()(this,_e,m()(this,ye)[e]):q(this,He,it).call(this,m()(this,be)[e],m()(this,ye)[e]),q(this,He,it).call(this,m()(this,Se),e),h()(this,Se,e))}function ot(e,t){var n,r=!1;if(0!==m()(this,de)){var i=m()(this,ve).get(e);if(void 0!==i)if(r=!0,1===m()(this,de))q(this,Qe,st).call(this,t);else{var a;m()(this,De).call(this,i);var o=m()(this,ge)[i];if(q(this,Ge,rt).call(this,o))o.__abortController.abort(new Error("deleted"));else if(m()(this,Ae)||m()(this,Ee)){var s,c;if(m()(this,Ae))null===(s=m()(this,ce))||void 0===s||s.call(this,o,e,t);if(m()(this,Ee))null===(c=m()(this,xe))||void 0===c||c.push([o,e,t])}if(m()(this,ve).delete(e),m()(this,me)[i]=void 0,m()(this,ge)[i]=void 0,i===m()(this,Se))h()(this,Se,m()(this,be)[i]);else if(i===m()(this,_e))h()(this,_e,m()(this,ye)[i]);else{var l=m()(this,be)[i];m()(this,ye)[l]=m()(this,ye)[i];var f=m()(this,ye)[i];m()(this,be)[f]=m()(this,be)[i]}h()(this,de,(a=m()(this,de),a--,a)),m()(this,we).push(i)}}if(m()(this,Ee)&&(null===(n=m()(this,xe))||void 0===n?void 0:n.length))for(var p,d=m()(this,xe);p=null==d?void 0:d.shift();){var v,g;null===(v=m()(this,le))||void 0===v||(g=v).call.apply(g,[this].concat(u()(p)))}return r}function st(e){var t,n=H(q(this,qe,Ze).call(this,{allowStale:!0}));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=m()(this,ge)[r];if(q(this,Ge,rt).call(this,i))i.__abortController.abort(new Error("deleted"));else{var a,o,s=m()(this,me)[r];if(m()(this,Ae))null===(a=m()(this,ce))||void 0===a||a.call(this,i,s,e);if(m()(this,Ee))null===(o=m()(this,xe))||void 0===o||o.push([i,s,e])}}}catch(e){n.e(e)}finally{n.f()}if(m()(this,ve).clear(),m()(this,ge).fill(void 0),m()(this,me).fill(void 0),m()(this,Te)&&m()(this,Oe)&&(m()(this,Te).fill(0),m()(this,Oe).fill(0)),m()(this,ke)&&m()(this,ke).fill(0),h()(this,_e,0),h()(this,Se,0),m()(this,we).length=0,h()(this,he,0),h()(this,de,0),m()(this,Ee)&&m()(this,xe))for(var c,l=m()(this,xe);c=null==l?void 0:l.shift();){var f,p;null===(f=m()(this,le))||void 0===f||(p=f).call.apply(p,[this].concat(u()(c)))}}}.call(this,n(32))},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},e.exports.__esModule=!0,e.exports.default=e.exports},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){(function(t){var r=n(11),i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt,c="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,l="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=c||l||Function("return this")(),p=Object.prototype.toString,d=Math.max,h=Math.min,v=function(){return f.Date.now()};function m(e,t,n){var r,i,a,o,s,u,c=0,l=!1,f=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,a=i;return r=i=void 0,c=t,o=e.apply(a,n)}function y(e){return c=e,s=setTimeout(S,t),l?m(e):o}function _(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-c>=a}function S(){var e=v();if(_(e))return w(e);s=setTimeout(S,function(e){var n=t-(e-u);return f?h(n,a-(e-c)):n}(e))}function w(e){return s=void 0,p&&r?m(e):(r=i=void 0,o)}function x(){var e=v(),n=_(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return y(u);if(f)return s=setTimeout(S,t),m(u)}return void 0===s&&(s=setTimeout(S,t)),o}return t=b(t)||0,g(n)&&(l=!!n.leading,a=(f="maxWait"in n)?d(b(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0},x.flush=function(){return void 0===s?o:w(v())},x}function g(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function y(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function b(e){if("number"==typeof e)return e;if(y(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=o.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return g(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),m(e,t,{leading:r,maxWait:t,trailing:i})}}).call(this,n(25))},function(e,t,n){var r,i,a=n(11);!function(o,s){"object"==a(t)&&void 0!==e?e.exports=s():void 0===(i="function"==typeof(r=s)?r.call(t,n,t,e):r)||(e.exports=i)}(0,(function(){"use strict";var e="undefined"==typeof window,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,u=!1,c=!1,l=!1;return e||(t="undefined"!=typeof InstallTrigger,n=!!window.chrome,r=!(!window.chrome||!window.navigator||!window.navigator.plugins||!window.navigator.plugins.namedItem("Chrome PDF Plugin")&&!window.chrome.runtime),i=n&&!window.chrome.webstore&&!window.chrome.runtime,a=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||window.safari&&window.safari.pushNotification,o=!!window.opr&&!!window.opr.addons||!!window.opera,s=!!window.StyleMedia,u=n&&!!navigator.userAgent.match(/edg/i),c=(r||o)&&!!window.CSS,l=!(n||a||t||o||!document.documentMode)),{get isChrome(){return r},get isChromeOrChromium(){return n},get isChromium(){return i},get isFirefox(){return t},get isSafari(){return a},get isOpera(){return o},get isEdge(){return s},get isEdgeChromium(){return u},get isIE(){return l},get isBlink(){return c}}}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitions=void 0;var r=n(5),i=n(2),a={aliases:["message.propose"],element:"propose",fields:{conversationId:r.attribute("inin-cid"),persistentConversationId:r.attribute("inin-persistent-cid"),sdpOverXmpp:r.booleanAttribute("inin-sdp-over-xmpp"),privAnswerMode:r.attribute("inin-priv-answer-mode"),originalRoomJid:r.attribute("inin-ofrom"),autoAnswer:r.booleanAttribute("inin-autoanswer"),fromUserId:r.attribute("inin-user-id"),sessionId:r.attribute("id"),meetingId:r.attribute("inin-meeting-id")},namespace:"urn:xmpp:jingle-message:0"},o={aliases:["message.proceed"],element:"proceed",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},s={aliases:["message.accept"],element:"accept",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},u={aliases:["message.reject"],element:"reject",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},c={aliases:["message.retract"],element:"retract",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},l={aliases:["iq.jingle.screenstart"],element:"screen-start",namespace:i.NS_JINGLE_RTP_INFO_1},f={aliases:["iq.jingle.screenstop"],element:"screen-stop",namespace:i.NS_JINGLE_RTP_INFO_1},p={path:"iq",namespace:i.NS_CLIENT,element:"iq",fields:{genesysWebrtc:r.childJSON("genesys","genesys-webrtc")}},d={path:"message",namespace:i.NS_CLIENT,element:"message",fields:{mediaMessage:r.childJSON("genesys","media-message")}},h={aliases:["presence.media"],element:"x",fields:{conversationId:r.attribute("conversationId"),sourceCommunicationId:r.attribute("sourceCommunicationId"),screenShare:r.childAttribute(null,"mediastream","screenShare"),video:r.childAttribute(null,"mediastream","video"),audio:r.childAttribute(null,"mediastream","audio"),listener:r.childAttribute(null,"mediastream","listener"),screenRecording:r.childAttribute(null,"mediastream","screenRecording")},namespace:"orgspan:mediastream"};t.definitions=[a,o,s,u,c,l,f,h,p,d]},function(e,t,n){"use strict";var r=n(13),i=n(11),a=n(4),o=n(6),s=n(7);function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var p=n(15),d=n(41),h=(0,p.__importDefault)(n(243)),v=(0,p.__importDefault)(n(85)),m=function(){function e(){o(this,e),this.translators=new Map,this.root=new v.default,this.setLanguageResolver(d.basicLanguageResolver)}return s(e,[{key:"setLanguageResolver",value:function(e){this.languageResolver=e}},{key:"import",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{registry:this};if(this.hasTranslator(e.getNamespace(),e.getName())){t.acceptLanguages||(t.acceptLanguages=[]),t.acceptLanguages=t.acceptLanguages.map((function(e){return 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:h.default});var n=this.getOrCreateTranslator(e.getNamespace(),e.getName());return n.import(e,f(f({},t),{},{registry:this}))}}},{key:"export",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{registry:this};n.acceptLanguages||(n.acceptLanguages=[]),n.acceptLanguages=n.acceptLanguages.map((function(e){return e.toLowerCase()})),n.lang&&(n.lang=n.lang.toLowerCase()),n.sanitizers||(n.sanitizers={xhtmlim:h.default}),n.path=e;var r,i=e.split(".").filter((function(e){return""!==e})),a=this.root,o=u(i);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=a.getChild(s);if(!c)return;a=c}}catch(e){o.e(e)}finally{o.f()}return a.export(t,f(f({},n),{},{registry:this}))}},{key:"getImportKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t?this.walkToTranslator(t.split(".")):this.root;if(n)return n.getImportKey(e)}},{key:"define",value:function(e){if(Array.isArray(e)){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;"object"===i(a)?this.define(a):a(this)}}catch(e){n.e(e)}finally{n.f()}}else if("object"===i(e)){var o=e;o.aliases=o.aliases||[],o.path&&!o.aliases.includes(o.path)&&o.aliases.push(o.path);var s,c=o.aliases.map((function(e){return"string"==typeof e?{path:e}:e})).sort((function(e,t){var n=e.path.split(".").length;return t.path.split(".").length-n}));if(this.hasTranslator(o.namespace,o.element)&&(s=this.getOrCreateTranslator(o.namespace,o.element)),!s){var l,f,p=u(c);try{for(p.s();!(f=p.n()).done;){var d=f.value,h=this.walkToTranslator(d.path.split("."));if(h&&!h.placeholder){s=h;break}h&&(l=h)}}catch(e){p.e(e)}finally{p.f()}l&&!s&&((s=l).placeholder=!1)}s||(s=this.getOrCreateTranslator(o.namespace,o.element)),this.indexTranslator(o.namespace,o.element,s);var v=o.fields||{},m=new Map,g=new Map,y=new Map,b=new Map;o.typeField&&(s.typeField=o.typeField),o.defaultType&&(s.defaultType=o.defaultType),o.versionField&&(s.versionField=o.versionField),o.defaultVersion&&(s.defaultVersion=o.defaultVersion),o.languageField&&(s.languageField=o.languageField);for(var _=0,S=Object.entries(v);_<S.length;_++){var w=r(S[_],2),x=w[0],k=w[1];m.set(x,k.importer),y.set(x,k.importOrder||k.order||0),g.set(x,k.exporter),b.set(x,k.exportOrder||k.order||0)}if(o.childrenExportOrder)for(var O=0,T=Object.entries(o.childrenExportOrder);O<T.length;O++){var A=r(T[O],2),I=A[0],E=A[1];b.set(I,E||0)}for(var N=new Map,R=0,j=Object.entries(o.optionalNamespaces||{});R<j.length;R++){var C=r(j[R],2),P=C[0],M=C[1];N.set(P,M)}s.updateDefinition({contexts:new Map,element:o.element,exporterOrdering:b,exporters:g,importerOrdering:y,importers:m,namespace:o.namespace,optionalNamespaces:N,type:o.type,version:o.version,typeOrder:o.typeOrder});var D,L=u(c);try{for(L.s();!(D=L.n()).done;){var B=D.value;this.alias(o.namespace,o.element,B.path,B.multiple,B.selector,B.contextField,o.type,B.impliedType)}}catch(e){L.e(e)}finally{L.f()}var F,q=u(c);try{for(q.s();!(F=q.n()).done;){var U=F.value,z=this.walkToTranslator(U.path.split("."));z&&z!==s&&z.replaceWith(s)}}catch(e){q.e(e)}finally{q.f()}}else e(this)}},{key:"alias",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=this.getOrCreateTranslator(e,t);u.placeholder=!1;var c=n.split(".").filter((function(e){return""!==e})),l=c.pop(),f=this.walkToTranslator(c,!0),p="{".concat(e,"}").concat(t);o&&(a||s)&&u.addContext(n,i,a,p,o,s),f.addChild(l,u,r,i,p)}},{key:"walkToTranslator",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.root,i=u(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getChild(a);if(!o){if(!n)return;(o=new v.default).placeholder=!0,r.addChild(a,o)}r=o}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"hasTranslator",value:function(e,t){return this.translators.has("{".concat(e,"}").concat(t))}},{key:"getOrCreateTranslator",value:function(e,t){var n=this.translators.get("{".concat(e,"}").concat(t));return n||(n=new v.default,this.indexTranslator(e,t,n)),n}},{key:"indexTranslator",value:function(e,t,n){this.translators.set("{".concat(e,"}").concat(t),n)}}]),e}();t.default=m},function(e,t,n){"use strict";var r=n(13);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var o=new Set(["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul"]),s=new Set(["style"]),u=new Map([["a",new Set(["href","style"])],["body",new Set(["style","xml:lang"])],["blockquote",s],["br",s],["cite",s],["em",s],["img",new Set(["alt","height","src","style","width"])],["li",s],["ol",s],["p",s],["span",s],["strong",s],["ul",s]]),c=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]]),l=function(e){return!!e.match(/^(https?|xmpp|cid|mailto|ftps?|im|ircs?|sips?|tel|geo|bitcoin|magnet):/i)&&e},f=function(e){return!!e.match(/^[0-9]*$/)&&e},p={alt:function(e){return e},height:f,href:l,src:l,style:function(e){var t=";".concat(e).replace(/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,"").replace(/\/\*.*/,"").replace(/\\([a-fA-F0-9]{1,6})\s?/,(function(e,t){return String.fromCharCode(parseInt(t,16))})).match(/;\s*([a-z-]+)\s*:\s*([^;]*[^\s;])\s*/g),n=[];if(!t)return!1;var r,a=i(t);try{for(a.s();!(r=a.n()).done;){var o=r.value.match(/^;\s*([a-z-]+)\s*:\s*([^;]*[^\s])\s*$/);if(o){var s=c.get(o[1]);if(s){var u=o[2].match(s);u&&n.push("".concat(o[1],":").concat(u[0]))}}}}catch(e){a.e(e)}finally{a.f()}return!!n.length&&n.join("")},width:f};function d(e){if("string"==typeof e)return e;if(!o.has(e.name)){if("script"===e.name)return;return function(e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if("string"==typeof a)n.push(a);else{var o=d(a);o&&(Array.isArray(o)?n=n.concat(o):n.push(o))}}}catch(e){r.e(e)}finally{r.f()}return n}(e)}for(var t=e.children.map(d).filter((function(e){return void 0!==e})),n={},a=0,s=Object.entries(e.attributes);a<s.length;a++){var c=r(s[a],2),l=c[0],f=c[1],h=u.get(e.name);if(h&&h.has(l)&&f){var v=p[l](f);v&&(n[l]=v)}}return{attributes:n,children:t,name:e.name}}t.default=function(e){if("string"!=typeof e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a)if("string"!=typeof a){var o=d(a);Array.isArray(o)?n=n.concat(o):o&&n.push(o)}else n.push(a)}}catch(e){r.e(e)}finally{r.f()}var s={};if("body"===e.name)return void 0!==e.attributes.xmlns&&(s.xmlns=e.attributes.xmlns),e.attributes.style&&(s.style=e.attributes.style),void 0!==e.attributes["xml:lang"]&&(s["xml:lang"]=e.attributes["xml:lang"]),{attributes:s,children:n,name:"body"}}}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],s=r[1],u=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,f=s>0?o-4:o;for(n=0;n<f;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(l(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(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 l(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,n){"use strict";
16
+ t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,p=n?-1:1,d=e[t+f];for(f+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=p,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=c}return(d?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&s,d+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+d]=255&o,d+=h,o/=256,c-=8);e[n+d-h]|=128*v}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){var r=n(54);function i(e){var t,n;function i(t,n){try{var o=e[t](n),s=o.value,u=s instanceof r;Promise.resolve(u?s.v:s).then((function(n){if(u){var r="return"===t?"return":"next";if(!s.k||n.done)return i(r,n);n=e[r](n).value}a(o.done?"return":"normal",n)}),(function(e){i("throw",e)}))}catch(e){a("throw",e)}}function a(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?i(t.key,t.arg):n=null}this._invoke=function(e,r){return new Promise((function(a,o){var s={key:e,arg:r,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,i(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},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(25))},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9),o=n(6),s=n(7),u=n(12);Object.defineProperty(t,"__esModule",{value:!0}),t.Notifications=void 0;var c=n(229),l=n(26);function f(e,t){return[].concat(u(e),u(t)).filter((function(e,t,n){return n.indexOf(e)===t}))}var p=function(){function e(t){o(this,e),this.subscriptions={},this.bulkSubscriptions={},this.topicPriorities={},this.client=t,t.on("pubsub:event",this.pubsubEvent.bind(this)),t.on("connected",this.subscriptionsKeepAlive.bind(this)),this.debouncedResubscribe=c(this.resubscribe.bind(this),100)}var t,n;return s(e,[{key:"handleStanzaInstanceChange",value:function(e){var 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())}},{key:"topicHandlers",value:function(e){return this.subscriptions[e]||(this.subscriptions[e]=[]),this.subscriptions[e]}},{key:"pubsubEvent",value:function(e){var t=e.pubsub,n=t.items.node;n.includes("no_longer_subscribed")?n="no_longer_subscribed":n.includes("duplicate_id")&&(n="duplicate_id");var r=t.items.published[0].content.json,i=this.topicHandlers(n);this.client.emit("notify",{topic:n,data:r}),this.client.emit("notify:".concat(n),r),i.forEach((function(e){e(r)}))}},{key:"xmppSubscribe",value:(n=a(i.mark((function e(t){var n,r=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0===this.topicHandlers(t).length&&!this.bulkSubscriptions[t]){e.next=2;break}return e.abrupt("return",Promise.resolve());case 2:if(n=function(){return r.stanzaInstance.subscribeToNode(r.pubsubHost,t)},!this.client.connected){e.next=7;break}return e.abrupt("return",n());case 7:return e.abrupt("return",new Promise((function(e,t){r.client.once("connected",(function(){return n().then(e,t)}))})));case 8:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"xmppUnsubscribe",value:function(e){var t=this;if(0!==this.topicHandlers(e).length||this.bulkSubscriptions[e])return Promise.resolve();var n=function(){return t.stanzaInstance.unsubscribeFromNode(t.pubsubHost,e)};return this.client.connected?n():new Promise((function(e,r){t.client.once("connected",(function(){return n().then(e,r)}))}))}},{key:"mapCombineTopics",value:function(e){var t=this,n={},r=[],i=[];e.forEach((function(e){e.includes("?")?r.push({id:e}):i.push(e)})),i.map((function(e){var t=e.split("."),n=t.splice(t.length-1);return{prefix:t.join("."),postfix:n}})).forEach((function(e){n[e.prefix]?n[e.prefix].push(e.postfix):n[e.prefix]=[e.postfix]}));var a=[];Object.keys(n).forEach((function(e){!function e(n,r){var i=1===r.length?".":"?",o="".concat(n).concat(i).concat(r.join("&"));o.length<200?a.push({id:o}):1===r.length?t.client.logger.error("Refusing to attempt topic with length > 200",o):(e(n,r.slice(0,r.length/2)),e(n,r.slice(r.length/2)))}(e,n[e])}));var o=a.concat(r);return this.truncateTopicList(this.prioritizeTopicList(o))}},{key:"prioritizeTopicList",value:function(e){var t=this;return e.sort((function(e,n){return t.getTopicPriority(n.id)-t.getTopicPriority(e.id)})),e}},{key:"getTopicPriority",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getTopicParts(e),r=n.prefix,i=n.postfixes,a=this.topicPriorities[r],o=a&&Object.keys(a).filter((function(e){return i.includes(e)})).map((function(e){return a[e]})),s=o&&o.length&&o.reduce((function(e,t){return t>e?t:e}));return t?s||0:s}},{key:"truncateTopicList",value:function(e){var t=e.slice(0,1e3);if(e.length>1e3){var n=e.slice(1e3);if(n.length>20){var r=n.length-20;(n=n.slice(20)).push("...and ".concat(r," more"))}this.client.logger.warn("Too many topics to subscribe to; truncating extra topics",{droppedTopics:n})}return t}},{key:"makeBulkSubscribeRequest",value:function(e,t){var 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},r=this.stanzaInstance.channelId;return this.client.http.requestApi("notifications/channels/".concat(r,"/subscriptions"),n)}},{key:"createSubscription",value:function(e,t){var n=this;l.splitIntoIndividualTopics(e).forEach((function(e){var r=n.topicHandlers(e);r.includes(t)||r.push(t)}))}},{key:"removeSubscription",value:function(e,t){var n=this;l.splitIntoIndividualTopics(e).forEach((function(e){var r=n.topicHandlers(e),i=r.indexOf(t);i>-1&&r.splice(i,1),r.length||delete n.subscriptions[e]}))}},{key:"removeTopicPriority",value:function(e){var t=this;if(this.getTopicPriority(e,!1)){var n=this.getTopicParts(e),r=n.prefix;n.postfixes.forEach((function(e){delete t.topicPriorities[r][e]})),Object.keys(this.topicPriorities[r]).length||delete this.topicPriorities[r]}}},{key:"getActiveIndividualTopics",value:function(){var e=this,t=[];return Object.keys(this.subscriptions).forEach((function(n){"streaming-subscriptions-expiring"!==n&&(e.topicHandlers(n).length>0&&t.push(n))})),t}},{key:"resubscribe",value:function(){var e=Object.keys(this.bulkSubscriptions);return e.length+this.getActiveIndividualTopics().length===0?Promise.resolve():this.bulkSubscribe(e,{replace:!0})}},{key:"subscriptionsKeepAlive",value:function(){var e=this,t="streaming-subscriptions-expiring";0===this.topicHandlers(t).length&&this.createSubscription(t,(function(){e.client.logger.info("".concat(t," - Triggering resubscribe."),{channelId:e.client.config.channelId}),e.debouncedResubscribe().catch((function(t){var n="Error resubscribing to topics";e.client.logger.error(n,t),e.client.emit("pubsub:error",{msg:n,err:t})}))}))}},{key:"getTopicParts",value:function(e){var t=e.includes("?"),n=t?"?":".",r=e.split(n),i=t?r[1]:r.splice(r.length-1);return{prefix:t?r[0]:r.join("."),postfixes:t?i.split("&"):i}}},{key:"setTopicPriorities",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.keys(t).forEach((function(n){var r=e.getTopicParts(n),i=e.topicPriorities[r.prefix],a=t[n];if(i)r.postfixes.forEach((function(e){var t=i[e];(t&&t<a||!t)&&(i[e]=a)}));else{var o=r.postfixes.reduce((function(e,t){return e[t]=a,e}),{});e.topicPriorities[r.prefix]=o}}))}},{key:"subscribe",value:function(e,t,n,i){var a;return i&&this.setTopicPriorities(r({},e,i)),a=n?this.xmppSubscribe(e):this.debouncedResubscribe(),t?this.createSubscription(e,t):this.bulkSubscriptions[e]=!0,a}},{key:"unsubscribe",value:function(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()}},{key:"bulkSubscribe",value:(t=a(i.mark((function e(t){var n,r,a,o=this,s=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{replace:!1,force:!1},r=s.length>2&&void 0!==s[2]?s[2]:{},this.setTopicPriorities(r),a=f(t,[]),n.replace&&!n.force?a=f(a,this.getActiveIndividualTopics()):n.force&&(this.subscriptions={}),e.next=7,this.makeBulkSubscribeRequest(a,n);case 7:n.replace&&(this.bulkSubscriptions={}),t.forEach((function(e){o.bulkSubscriptions[e]=!0}));case 9:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"pubsubHost",get:function(){try{var e=this.client.config.apiHost.replace(/http(s?):\/\//,"");return"notifications.".concat(e)}catch(e){return"notifications.mypurecloud.com"}}},{key:"expose",get:function(){return{subscribe:this.subscribe.bind(this),unsubscribe:this.unsubscribe.bind(this),bulkSubscribe:this.bulkSubscribe.bind(this)}}}]),e}();t.Notifications=p},function(e,t,n){"use strict";function r(e){return"function"==typeof e?e():e}function i(){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]:{},a=void 0,o=void 0,s=void 0,u=[];return function(){var l=r(t),f=(new Date).getTime(),p=!a||f-a>l;a=f;for(var d=arguments.length,h=Array(d),v=0;v<d;v++)h[v]=arguments[v];if(p&&n.leading)return n.accumulate?Promise.resolve(e.call(this,[h])).then((function(e){return e[0]})):Promise.resolve(e.call.apply(e,[this].concat(h)));if(o?clearTimeout(s):o=i(),u.push(h),s=setTimeout(c.bind(this),l),n.accumulate){var m=u.length-1;return o.promise.then((function(e){return e[m]}))}return o.promise};function c(){var t=o;clearTimeout(s),Promise.resolve(n.accumulate?e.call(this,u):e.apply(this,u[u.length-1])).then(t.resolve,t.reject),u=[],o=null}}},function(e,t){e.exports=function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(53),i=n(232);function a(t,n,o){return i()?(e.exports=a=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=a=function(e,t,n){var i=[null];i.push.apply(i,t);var a=new(Function.bind.apply(e,i));return n&&r(a,n.prototype),a},e.exports.__esModule=!0,e.exports.default=e.exports),a.apply(null,arguments)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(13),i=n(12),a=n(4),o=n(3),s=n(9),u=n(6),c=n(7),l=n(24),f=n(16),p=n(17),d=n(14);function h(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p(this,n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.WebrtcExtension=void 0;var b=n(36),_=n(20),S=n(22),w=n(235),x=n(18),k=n(34),O=b.__importDefault(n(239)),T=n(240),A=n(241),I=n(26),E=n(70),N=n(255),R=n(33),j=n(60),C=n(66),P=n(45),M="requestIncomingRtcSession",D="cancelIncomingRtcSession",L="handledIncomingRtcSession",B="incomingRtcSession",F="outgoingRtcSession",q="rtcSessionError",U=function(e){f(Z,e);var t,n,a,p,d,v,m,b,_,U,z,J,G,H,V,W,Q,K,Y,X,$=y(Z);function Z(e,t){var n;return u(this,Z),(n=$.call(this)).ignoredSessions=new w.LRUCache({max:10,ttl:216e3}),n.earlyIceCandidates=new w.LRUCache({max:10,ttl:6e4,ttlAutopurge:!0}),n.pendingSessions={},n.statsArr=[],n.throttleSendStatsInterval=25e3,n.currentMaxStatSize=15e3,n.statsSizeDecreaseAmount=3e3,n.statBuffer=0,n.discoRetries=0,n.iceServers=[],n.webrtcSessions=[],n.reinviteCache=new w.LRUCache({max:5,ttl:18e4}),n.sessionsMap={},n.client=e,n.config={allowIPv6:!0===t.allowIPv6,optOutOfWebrtcStatsTelemetry:t.optOutOfWebrtcStatsTelemetry},n.logger=e.logger,n.addEventListeners(),n.throttledSendStats=O.default(n.sendStats.bind(l(n)),n.throttleSendStatsInterval,{leading:!1,trailing:!0}),n.client.on("jingle:outgoing",(function(e){return n.logger.info("Emitting jingle:outgoing media-session (session-init)",e.sid),n.emit(F,e)})),n.client.on("jingle:incoming",(function(e){return n.logger.info("Emitting jingle:incoming media-session (session-init)",e.sid),n.emit(B,e)})),n.client.on("jingle:created",(function(e){e instanceof j.StanzaMediaSession||e.end("cancel",!0)})),window.addEventListener("offline",(function(){return n.onOnlineStatusChange(!1)})),window.addEventListener("online",(function(){return n.onOnlineStatusChange(!0)})),n}return c(Z,[{key:"onOnlineStatusChange",value:function(e){this.addStatToQueue({actionName:"WebrtcStats",details:{_eventType:"onlineStatus",_eventTimestamp:(new Date).getTime(),online:e}})}},{key:"handleStanzaInstanceChange",value:(X=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.stanzaInstance=t,this.refreshIceServersTimer&&(clearInterval(this.refreshIceServersTimer),this.refreshIceServersTimer=null),t.on("iq:set:genesysWebrtc",this.handleGenesysWebrtcStanza.bind(this)),this.refreshIceServersTimer=setInterval(this.refreshIceServers.bind(this),216e5),this.client.emit("sessionManagerChange",t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return X.apply(this,arguments)})},{key:"configureNewStanzaInstance",value:(Y=s(o.mark((function e(t){var n,r,i,a=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Object.assign(t.jingle.config.peerConnectionConfig,{sdpSemantics:"unified-plan"}),e.next=3,this.configureStanzaIceServers(t);case 3:for(t.stanzas.define(A.definitions),t.jingle.prepareSession=this.prepareSession.bind(this),t.jingle.on("log",(function(e,t,n){a.logger[e](t,n)})),n=function(){var e=i[r];t.jingle.on(e,(function(t){if(t instanceof j.StanzaMediaSession){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.emit.apply(t,[e].concat(r))}}))},r=0,i=["iceConnectionType","peerTrackAdded","peerTrackRemoved","mute","unmute","sessionState","connectionState","terminated","stats","endOfCandidates"];r<i.length;r++)n();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return Y.apply(this,arguments)})},{key:"configureStanzaIceServers",value:function(e){return e.jingle.config.iceServers=[],this.setIceServers([],e),this._refreshIceServers(e)}},{key:"handleGenesysOffer",value:(K=s(o.mark((function e(t){var n,r,i,a,s,u,c,l,f=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,!(r=n.params).reinvite||!this.reinviteCache.get(n.id)){e.next=5;break}return this.logger.info("Ignoring duplicate reinvite offer",n.id),e.abrupt("return");case 5:if(r.reinvite&&this.reinviteCache.set(n.id,!0),i="relay"===this.getIceTransportPolicy()&&T.isFirefox,a={id:r.sessionId,logger:this.logger,peerID:t.from,fromJid:t.from,sessionType:this.getSessionTypeByJid(t.from),conversationId:r.conversationId,ignoreHostCandidatesFromRemote:i,optOutOfWebrtcStatsTelemetry:!!this.config.optOutOfWebrtcStatsTelemetry,allowIPv6:this.config.allowIPv6,iceServers:this.iceServers,reinvite:!!r.reinvite,iceTransportPolicy:this.getIceTransportPolicy()},(u=this.pendingSessions[r.sessionId])?(s=g(g({},a),{},{meetingId:u.meetingId,fromUserId:u.fromUserId,originalRoomJid:u.originalRoomJid,privAnswerMode:u.privAnswerMode}),delete this.pendingSessions[u.sessionId]):s=a,c=this.webrtcSessions.find((function(e){return e.id===s.id})),this.logger.info("offer received",{existingSession:!!c,mediaSessionParams:s}),!c){e.next=16;break}if(c.conversationId=r.conversationId,I.iceIsDifferent(c.peerConnection.remoteDescription.sdp,r.sdp)){e.next=16;break}return e.abrupt("return",this.handleGenesysRenegotiate(c,r.sdp));case 16:return l=new C.GenesysCloudMediaSession(this,s),e.next=19,l.setRemoteDescription(r.sdp);case 19:return this.proxyStatsForSession(l),l.on("sendIq",(function(e){var t;return null===(t=f.stanzaInstance)||void 0===t?void 0:t.sendIQ(e)})),l.on("terminated",(function(){delete f.sessionsMap[l.id],f.webrtcSessions=f.webrtcSessions.filter((function(e){return e.id!==l.id}))})),this.webrtcSessions.push(l),this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(l),e.abrupt("return",this.emit(B,l));case 26:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"applyEarlyIceCandidates",value:function(e){var t=this.earlyIceCandidates.get(e.id);if(t){this.earlyIceCandidates.delete(e.id);var n,r=h(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.addRemoteIceCandidate(i)}}catch(e){r.e(e)}finally{r.f()}}}},{key:"handleGenesysRenegotiate",value:(Q=s(o.mark((function e(t,n){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.peerConnection.setRemoteDescription({sdp:n,type:"offer"});case 2:return e.next=4,t.accept();case 4:case"end":return e.stop()}}),e)}))),function(e,t){return Q.apply(this,arguments)})},{key:"handleGenesysIceCandidate",value:(W=s(o.mark((function e(t){var n,r,a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.genesysWebrtc,r=n.params,!(a=this.getSessionById(r.sessionId,!0))){e.next=8;break}return e.next=6,a.addRemoteIceCandidate(r.sdp);case 6:e.next=10;break;case 8:(s=this.earlyIceCandidates.get(r.sessionId))?this.earlyIceCandidates.set(r.sessionId,[].concat(i(s),[r.sdp])):this.earlyIceCandidates.set(r.sessionId,[r.sdp]);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return W.apply(this,arguments)})},{key:"handleGenesysTerminate",value:(V=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=t.genesysWebrtc,r=n.params,this.getSessionById(r.sessionId).onSessionTerminate(r.reason);case 4:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getSessionById",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getAllSessions().find((function(t){return t.id===e}));if(!n&&!t){var r=new Error("Failed to find session by id");throw this.logger.error(r,{sessionId:e}),r}return n}},{key:"sendIq",value:(H=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stanzaInstance){e.next=2;break}throw new Error("Failed to send iq because there was no stanza instance");case 2:return e.abrupt("return",this.stanzaInstance.sendIQ(t));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"handleMessage",value:(G=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.propose){e.next=5;break}return e.next=3,this.handlePropose(t);case 3:e.next=6;break;case 5:t.retract?this.handleRetract(t.retract.sessionId):t.accept?this.handledIncomingRtcSession(t.accept.sessionId,t):t.reject&&this.handledIncomingRtcSession(t.reject.sessionId,t);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"handleGenesysWebrtcStanza",value:(J=s(o.mark((function e(t){var n;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("offer"!==(n=t.genesysWebrtc).method){e.next=5;break}return e.abrupt("return",this.handleGenesysOffer(t));case 5:if("iceCandidate"!==n.method){e.next=9;break}return e.abrupt("return",this.handleGenesysIceCandidate(t));case 9:if("terminate"!==n.method){e.next=11;break}return e.abrupt("return",this.handleGenesysTerminate(t));case 11:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{key:"prepareSession",value:function(e){if(!e.sid||!this.sessionsMap[e.sid]){var t=this.pendingSessions[e.sid];t&&(delete this.pendingSessions[t.sessionId],delete this.sessionsMap[t.sessionId]);var n="relay"===this.getIceTransportPolicy()&&T.isFirefox,r={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},i=new j.StanzaMediaSession(r);return this.proxyStatsForSession(i),i}this.logger.debug("skipping creation of jingle webrtc session due to sdpOverXmpp")}},{key:"proxyStatsForSession",value:function(e){var t=this;e.on("stats",(function(n){var r=JSON.parse(JSON.stringify(n)),i={conversationId:e.conversationId,sessionId:e.id,sessionType:e.sessionType},a=N.formatStatsEvent(r,i);t.addStatToQueue(a)}))}},{key:"addStatToQueue",value:function(e){if(!this.config.optOutOfWebrtcStatsTelemetry){e.details._appId||(e.details._appId=this.logger.clientId,e.details._appName="streamingclient",e.details._appVersion=E.Client.version),e.details._originAppId=this.client.config.appId;var t=N.deepFlatten(e.details);Object.keys(t).forEach((function(e){var n=t[e];"boolean"==typeof n&&(t[e]="".concat(n))}));var n=g(g({},e),{},{details:t}),r=I.calculatePayloadSize(n),i=this.statBuffer+r>this.currentMaxStatSize;this.statsArr.push(n),this.statBuffer+=r,i?this.sendStatsImmediately():this.throttledSendStats()}}},{key:"getLogDetailsForPendingSessionId",value:function(e){var t={sessionId:e},n=this.pendingSessions[e];return n&&(t.sessionType=n.sessionType,t.conversationId=n.conversationId),t}},{key:"sendStatsImmediately",value:function(){this.throttledSendStats(),this.throttledSendStats.flush()}},{key:"sendStats",value:(z=s(o.mark((function e(){var t,n,r,a,s,u,c,l,f,p,d,v;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=2;break}return e.abrupt("return");case 2:r=[],a=0,s=h(this.statsArr),e.prev=5,s.s();case 7:if((u=s.n()).done){e.next=18;break}if(c=u.value,l=I.calculatePayloadSize(c),!(a+l<this.currentMaxStatSize)){e.next=15;break}r.push(c),a+=l,e.next=16;break;case 15:return e.abrupt("break",18);case 16:e.next=7;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(5),s.e(e.t0);case 23:return e.prev=23,s.f(),e.finish(23);case 26:if(this.statsArr.splice(0,r.length),this.statBuffer=this.statsArr.reduce((function(e,t){return e+I.calculatePayloadSize(t)}),0),r.length&&!this.client.isGuest){e.next=30;break}return e.abrupt("return");case 30:return f={appName:"streamingclient",appVersion:E.Client.version,originAppName:this.client.config.appName,originAppVersion:this.client.config.appVersion,actions:r},e.prev=31,p=this.client.config.authToken,d="diagnostics/newrelic/insights",this.client.backgroundAssistantMode&&(p=this.client.config.jwt,d+="/backgroundassistant"),e.next=37,this.client.http.requestApi(d,{method:"post",responseType:"text",host:this.client.config.apiHost,authToken:p,logger:this.client.logger,data:f});case 37:this.currentMaxStatSize=15e3,e.next=52;break;case 40:if(e.prev=40,e.t1=e.catch(31),!P.HttpClient.retryStatusCodes.has(null===(t=e.t1.response)||void 0===t?void 0:t.status)&&navigator.onLine||(this.statsArr=[].concat(r,i(this.statsArr)),this.statBuffer=this.statsArr.reduce((function(e,t){return e+I.calculatePayloadSize(t)}),0)),413!==(null===(n=e.t1.response)||void 0===n?void 0:n.status)){e.next=51;break}return v=this.currentMaxStatSize,this.currentMaxStatSize-=this.statsSizeDecreaseAmount,this.logger.info("Failed to send stats due to 413, retrying with smaller set",{attemptedPayloadSize:v,newPayloadSize:this.currentMaxStatSize}),e.next=49,this.sendStats();case 49:e.next=52;break;case 51:this.logger.error("Failed to send stats",{err:e.t1,numberOfFailedStats:r.length},{skipServer:!navigator.onLine});case 52:case"end":return e.stop()}}),e,this,[[5,20,23,26],[31,40]])}))),function(){return z.apply(this,arguments)})},{key:"addEventListeners",value:function(){var e=this;this.client.on("connected",(function(){return e.refreshIceServersTimer&&(clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null),e.refreshIceServersTimer=setInterval(e.refreshIceServers.bind(e),216e5),e.refreshIceServers().catch((function(t){return e.logger.error("Error fetching ice servers after streaming-client connected",{error:t,channelId:e.client.config.channelId})}))})),this.client.on("disconnected",(function(){clearInterval(e.refreshIceServersTimer),e.refreshIceServersTimer=null}))}},{key:"handlePropose",value:(U=s(o.mark((function e(t){var n,r,i,a,s,u,c,l;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.from!==this.jid){e.next=2;break}return e.abrupt("return");case 2:if(n=t.propose.sessionId,r=this.pendingSessions[n],i=!!r,a=this.getSessionTypeByJid(t.from),s={sessionId:n,conversationId:t.propose.conversationId,sessionType:a,isDuplicatePropose:i},this.logger.info("propose received",s),i||(this.client.config.appId,u={actionName:"WebrtcStats",details:{_eventTimestamp:(new Date).getTime(),_eventType:"firstPropose",conversationId:s.conversationId,sdpViaXmppRequested:!!t.propose.sdpOverXmpp,sessionId:n,sessionType:a}},this.addStatToQueue(u),c=t.from,l=c,t.propose.originalRoomJid=t.propose.originalRoomJid||l,r=g(g({},t.propose),{},{toJid:t.to,fromJid:c,sessionType:a,roomJid:l,id:n,sdpOverXmpp:t.propose.sdpOverXmpp,privAnswerMode:t.propose.privAnswerMode}),i||(this.sessionsMap[r.id]=!!r.sdpOverXmpp,this.pendingSessions[n]=r)),!r.accepted){e.next=14;break}return this.logger.info("proceed already sent for this session, but sending another",s),e.next=13,this.acceptRtcSession(n);case 13:return e.abrupt("return");case 14:this.emit(M,Object.assign(r));case 15:case"end":return e.stop()}}),e,this)}))),function(e){return U.apply(this,arguments)})},{key:"handleRetract",value:function(e){return this.logger.info("retract received",this.getLogDetailsForPendingSessionId(e)),delete this.sessionsMap[e],delete this.pendingSessions[e],this.emit(D,e)}},{key:"handledIncomingRtcSession",value:function(e,t){var n=t.accept?"accept":"reject";return this.logger.info("".concat(n," received"),this.getLogDetailsForPendingSessionId(e)),this.emit(L,e)}},{key:"initiateRtcSession",value:(_=s(o.mark((function e(t){var n,r,i,a,s,u,c,l,f;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n={to:t.jid,propose:{id:k.v4(),descriptions:[]}},t.stream)for(r=0,i=Array.from(t.stream.getTracks());r<i.length;r++)a=i[r],n.propose.descriptions.push({media:a.kind});if(t.provideVideo&&(n.propose.descriptions.filter((function(e){return"video"===e.media})).length>0||n.propose.descriptions.push({media:"video"})),t.provideAudio&&(n.propose.descriptions.filter((function(e){return"audio"===e.media})).length>0||n.propose.descriptions.push({media:"audio"})),t.mediaPurpose&&n.propose.descriptions.push({media:t.mediaPurpose}),!t.jid||!t.jid.match(/@conference/)){e.next=16;break}0===(s=n.propose.descriptions).length&&(s=[{media:"listener"}]),u={type:"upgradeMedia",to:t.jid,id:k.v4(),from:this.jid,media:{conversationId:t.conversationId,sourceCommunicationId:t.sourceCommunicationId}},t.mediaPurpose===R.SessionTypes.collaborateVideo&&Object.assign(u.media,{video:!0,audio:!0,videoGuest:!0}),c=h(s);try{for(c.s();!(l=c.n()).done;)f=l.value,u.media[f.media]=!0}catch(e){c.e(e)}finally{c.f()}return e.next=14,this.stanzaInstance.send("presence",u);case 14:e.next=19;break;case 16:return e.next=18,this.stanzaInstance.send("message",n);case 18:this.pendingSessions[n.propose.id]=n;case 19:return e.abrupt("return",n.propose.id);case 20:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"acceptRtcSession",value:(b=s(o.mark((function e(t){var n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t]){e.next=4;break}return this.emit(q,"Cannot accept session because it is not pending or does not exist"),e.abrupt("return");case 4:return r={to:n.fromJid,proceed:{sessionId:t}},n.accepted=!0,i=this.getLogDetailsForPendingSessionId(t),this.logger.info("sending jingle proceed",i),e.next=10,this.stanzaInstance.send("message",r);case 10:this.logger.info("sent jingle proceed",i);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"rejectRtcSession",value:(m=s(o.mark((function e(t){var n,r,i,a,s,u,c,l=arguments;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=l.length>1&&void 0!==l[1]&&l[1],r=this.getLogDetailsForPendingSessionId(t),i=this.pendingSessions[t]){e.next=6;break}return this.emit(q,"Cannot reject session because it is not pending or does not exist"),e.abrupt("return");case 6:if(delete this.sessionsMap[t],delete this.pendingSessions[t],!n){e.next=12;break}this.ignoredSessions.set(t,!0),e.next=20;break;case 12:return a={to:S.toBare(this.jid),reject:{sessionId:t}},s=this.stanzaInstance.send("message",a),u={to:i.fromJid,reject:{sessionId:t}},c=this.stanzaInstance.send("message",u),this.logger.info("sending jingle reject",r),e.next=19,Promise.all([s,c]);case 19:this.logger.info("sent jingle reject",r);case 20:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{key:"rtcSessionAccepted",value:(v=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.pendingSessions[t],n=this.getLogDetailsForPendingSessionId(t),r={to:S.toBare(this.jid),accept:{sessionId:t}},this.logger.info("sending session-info:accept",n),e.next=6,this.stanzaInstance.send("message",r);case 6:this.logger.info("sent session-info:accept",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"notifyScreenShareStart",value:(d=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:x.JingleAction.SessionInfo,sid:t.id,screenstart:{}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"notifyScreenShareStop",value:(p=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.stanzaInstance.send("iq",{to:"".concat(t.peerID),from:this.jid,type:"set",jingle:{action:x.JingleAction.SessionInfo,sid:t.id,screenstop:{}}}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return p.apply(this,arguments)})},{key:"cancelRtcSession",value:(a=s(o.mark((function e(t){var n,r,i;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.pendingSessions[t],r=this.getLogDetailsForPendingSessionId(t),n){e.next=5;break}return this.emit(q,"Cannot cancel session because it is not pending or does not exist"),e.abrupt("return");case 5:return i={to:n.toJid,retract:{sessionId:t}},delete this.pendingSessions[t],delete this.sessionsMap[t],this.logger.info("sending jingle retract",r),e.next=11,this.stanzaInstance.send("message",i);case 11:this.logger.info("sent jingle retract",r);case 12:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"refreshIceServers",value:(n=s(o.mark((function e(){var t=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.refreshIceServersRetryPromise||(this.refreshIceServersRetryPromise=I.retryPromise(this._refreshIceServers.bind(this,this.stanzaInstance),(function(e){return++t.discoRetries>2?(t.logger.warn("fetching ice servers failed. max retries reached.",{retryAttempt:t.discoRetries,MAX_DISCO_RETRIES:2,error:e,channelId:t.client.config.channelId}),!1):(t.logger.warn("fetching ice servers failed. retrying",{retryAttempt:t.discoRetries,error:e,channelId:t.client.config.channelId}),!0)}),0,this.client.logger)),e.abrupt("return",this.refreshIceServersRetryPromise.promise.finally((function(){t.discoRetries=0,t.refreshIceServersRetryPromise=void 0})));case 2:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_refreshIceServers",value:(t=s(o.mark((function e(t){var n,a,s,u,c,l,f,p,d;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw new Error("No stanza instance to refresh ice servers");case 2:return n=t.config.server,a=t.getServices(n,"turn","1"),s=t.getServices(n,"stun","1"),u=new Promise((function(e,t){setTimeout((function(){t(new Error("Timeout waiting for refresh ice servers to finish"))}),15e3),Promise.all([a,s]).then((function(t){var n=r(t,2),i=n[0],a=n[1];e([i,a])})).catch(t)})),e.next=8,u;case 8:return c=e.sent,l=r(c,2),f=l[0],p=l[1],d=[].concat(i(f.services),i(p.services)).map((function(e){var t=e.port?":".concat(e.port):"",n={type:e.type,urls:"".concat(e.type,":").concat(e.host).concat(t)};return["turn","turns"].includes(e.type)&&(e.transport&&"udp"!==e.transport&&(n.urls+="?transport=".concat(e.transport)),e.username&&(n.username=e.username),e.password&&(n.credential=e.password)),n})),this.setIceServers(d,t),p.services.length?this.setIceTransportPolicy("all",t):(this.logger.info('No stun servers received, setting iceTransportPolicy to "relay"'),this.setIceTransportPolicy("relay",t)),e.abrupt("return",d);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"setIceServers",value:function(e,t){t.jingle.iceServers=e,this.iceServers=e}},{key:"getIceTransportPolicy",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.config.peerConnectionConfig.iceTransportPolicy}},{key:"setIceTransportPolicy",value:function(e,t){t.jingle.config.peerConnectionConfig.iceTransportPolicy=e}},{key:"getSessionTypeByJid",value:function(e){return I.isAcdJid(e)?R.SessionTypes.acdScreenShare:I.isScreenRecordingJid(e)?R.SessionTypes.screenRecording:I.isSoftphoneJid(e)?R.SessionTypes.softphone:I.isVideoJid(e)?R.SessionTypes.collaborateVideo:R.SessionTypes.unknown}},{key:"getSessionManager",value:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle}},{key:"getAllSessions",value:function(){var e,t=null===(e=this.stanzaInstance)||void 0===e?void 0:e.jingle.sessions,n=t&&Object.values(t)||[];return[].concat(i(n),i(this.webrtcSessions))}},{key:"proxyNRStat",value:function(e){this.addStatToQueue(e)}},{key:"jid",get:function(){var e;return null===(e=this.stanzaInstance)||void 0===e?void 0:e.jid}},{key:"expose",get:function(){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)}}}]),Z}(_.EventEmitter);t.WebrtcExtension=U},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|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|4lf|4lh|4lv|4m1|4mf|4mn|4nf|4of|4oh|4ov|4q7|h1|5od|5rd|5rh|60f|1upn|1upt|1upv|1uq2|1uq5|1vij|1vj7|1vjl|1vo0|1vv7|20ov|7qo|7qq|7qs|7qu|7tl|7u5|7us|7vl|7vv|sb|sd|s000|t2|97v|uf|9go|9o5"},"B.1":{r:"60b:60d|80b:80d|1vg0:1vgf",s:"5d|606|1vnv|830|qf"},"B.2":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|rq:10;tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ui:u5|uj:ud|uk:ub|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti: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|1uo6:3j;3k|1uoj:1bk;1bm|1uok:1bk;1b5|1uol:1bk;1bb|1uom:1bu;1bm|1uon:1bk;1bd|3l00:31|3l01:32|3l02:33|3l03:34|3l04:35|3l05:36|3l06:37|3l07:38|3l08:39|3l09:3a|3l0a:3b|3l0b:3c|3l0c:3d|3l0d:3e|3l0e:3f|3l0f:3g|3l0g:3h|3l0h:3i|3l0i:3j|3l0j:3k|3l0k:3l|3l0l:3m|3l0m:3n|3l0n:3o|3l0o:3p|3l0p:3q|3l1k:31|3l1l:32|3l1m:33|3l1n:34|3l1o:35|3l1p:36|3l1q:37|3l1r:38|3l1s:39|3l1t:3a|3l1u:3b|3l1v:3c|3l20:3d|3l21:3e|3l22:3f|3l23:3g|3l24:3h|3l25:3i|3l26:3j|3l27:3k|3l28:3l|3l29:3m|3l2a:3n|3l2b:3o|3l2c:3p|3l2d:3q|3l38:31|3l39:32|3l3a:33|3l3b:34|3l3c:35|3l3d:36|3l3e:37|3l3f:38|3l3g:39|3l3h:3a|3l3i:3b|3l3j:3c|3l3k:3d|3l3l:3e|3l3m:3f|3l3n:3g|3l3o:3h|3l3p:3i|3l3q:3j|3l3r:3k|3l3s:3l|3l3t:3m|3l3u:3n|3l3v:3o|3l40:3p|3l41:3q|3l4s:31|3l4u:33|3l4v:34|3l52:37|3l55:3a|3l56:3b|3l59:3e|3l5a:3f|3l5b:3g|3l5c:3h|3l5e:3j|3l5f:3k|3l5g:3l|3l5h:3m|3l5i:3n|3l5j:3o|3l5k:3p|3l5l:3q|3l6g:31|3l6h:32|3l6i:33|3l6j:34|3l6k:35|3l6l:36|3l6m:37|3l6n:38|3l6o:39|3l6p:3a|3l6q:3b|3l6r:3c|3l6s:3d|3l6t:3e|3l6u:3f|3l6v:3g|3l70:3h|3l71:3i|3l72:3j|3l73:3k|3l74:3l|3l75:3m|3l76:3n|3l77:3o|3l78:3p|3l79:3q|3l84:31|3l85:32|3l87:34|3l88:35|3l89:36|3l8a:37|3l8d:3a|3l8e:3b|3l8f:3c|3l8g:3d|3l8h:3e|3l8i:3f|3l8j:3g|3l8k:3h|3l8m:3j|3l8n:3k|3l8o:3l|3l8p:3m|3l8q:3n|3l8r:3o|3l8s:3p|3l9o:31|3l9p:32|3l9r:34|3l9s:35|3l9t:36|3l9u:37|3la0:39|3la1:3a|3la2:3b|3la3:3c|3la4:3d|3la6:3f|3laa:3j|3lab:3k|3lac:3l|3lad:3m|3lae:3n|3laf:3o|3lag:3p|3lbc:31|3lbd:32|3lbe:33|3lbf:34|3lbg:35|3lbh:36|3lbi:37|3lbj:38|3lbk:39|3lbl:3a|3lbm:3b|3lbn:3c|3lbo:3d|3lbp:3e|3lbq:3f|3lbr:3g|3lbs:3h|3lbt:3i|3lbu:3j|3lbv:3k|3lc0:3l|3lc1:3m|3lc2:3n|3lc3:3o|3lc4:3p|3lc5:3q|3ld0:31|3ld1:32|3ld2:33|3ld3:34|3ld4:35|3ld5:36|3ld6:37|3ld7:38|3ld8:39|3ld9:3a|3lda:3b|3ldb:3c|3ldc:3d|3ldd:3e|3lde:3f|3ldf:3g|3ldg:3h|3ldh:3i|3ldi:3j|3ldj:3k|3ldk:3l|3ldl:3m|3ldm:3n|3ldn:3o|3ldo:3p|3ldp:3q|3lek:31|3lel:32|3lem:33|3len:34|3leo:35|3lep:36|3leq:37|3ler:38|3les:39|3let:3a|3leu:3b|3lev:3c|3lf0:3d|3lf1:3e|3lf2:3f|3lf3:3g|3lf4:3h|3lf5:3i|3lf6:3j|3lf7:3k|3lf8:3l|3lf9:3m|3lfa:3n|3lfb:3o|3lfc:3p|3lfd:3q|3lg8:31|3lg9:32|3lga:33|3lgb:34|3lgc:35|3lgd:36|3lge:37|3lgf:38|3lgg:39|3lgh:3a|3lgi:3b|3lgj:3c|3lgk:3d|3lgl:3e|3lgm:3f|3lgn:3g|3lgo:3h|3lgp:3i|3lgq:3j|3lgr:3k|3lgs:3l|3lgt:3m|3lgu:3n|3lgv:3o|3lh0:3p|3lh1:3q|3lhs:31|3lht:32|3lhu:33|3lhv:34|3li0:35|3li1:36|3li2:37|3li3:38|3li4:39|3li5:3a|3li6:3b|3li7:3c|3li8:3d|3li9:3e|3lia:3f|3lib:3g|3lic:3h|3lid:3i|3lie:3j|3lif:3k|3lig:3l|3lih:3m|3lii:3n|3lij:3o|3lik:3p|3lil:3q|3ljg:31|3ljh:32|3lji:33|3ljj:34|3ljk:35|3ljl:36|3ljm:37|3ljn:38|3ljo:39|3ljp:3a|3ljq:3b|3ljr:3c|3ljs:3d|3ljt:3e|3lju:3f|3ljv:3g|3lk0:3h|3lk1:3i|3lk2:3j|3lk3:3k|3lk4:3l|3lk5:3m|3lk6:3n|3lk7:3o|3lk8:3p|3lk9:3q|3ll8:th|3ll9:ti|3lla:tj|3llb:tk|3llc:tl|3lld:tm|3lle:tn|3llf:to|3llg:tp|3llh:tq|3lli:tr|3llj:ts|3llk:tt|3lll:tu|3llm:tv|3lln:u0|3llo:u1|3llp:to|3llq:u3|3llr:u4|3lls:u5|3llt:u6|3llu:u7|3llv:u8|3lm0:u9|3lmj:u3|3ln2:th|3ln3:ti|3ln4:tj|3ln5:tk|3ln6:tl|3ln7:tm|3ln8:tn|3ln9:to|3lna:tp|3lnb:tq|3lnc:tr|3lnd:ts|3lne:tt|3lnf:tu|3lng:tv|3lnh:u0|3lni:u1|3lnj:to|3lnk:u3|3lnl:u4|3lnm:u5|3lnn:u6|3lno:u7|3lnp:u8|3lnq:u9|3lod:u3|3los:th|3lot:ti|3lou:tj|3lov:tk|3lp0:tl|3lp1:tm|3lp2:tn|3lp3:to|3lp4:tp|3lp5:tq|3lp6:tr|3lp7:ts|3lp8:tt|3lp9:tu|3lpa:tv|3lpb:u0|3lpc:u1|3lpd:to|3lpe:u3|3lpf:u4|3lpg:u5|3lph:u6|3lpi:u7|3lpj:u8|3lpk:u9|3lq7:u3|3lqm:th|3lqn:ti|3lqo:tj|3lqp:tk|3lqq:tl|3lqr:tm|3lqs:tn|3lqt:to|3lqu:tp|3lqv:tq|3lr0: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|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"},"B.3":{m:"5l:ts|6v:3j;3j|9g:39;o7|a9:ls;3e|bv:3j|fg:3a;oc|q5:tp|sg:tp;o8;o1|tg:u5;o8;o1|u2:u3|ug:ti|uh:to|ul:u6|um:u0|vg:tq|vh:u1|vi:u3|vl:tl|1c7:1b5;1c2|7km:38;ph|7kn:3k;o8|7ko:3n;oa|7kp:3p;oa|7kq:31;lu|7kr:7j1|7qg:u5;oj|7qi:u5;oj;o0|7qk:u5;oj;o1|7qm:u5;oj;q2|7s0:7o0;tp|7s1:7o1;tp|7s2:7o2;tp|7s3:7o3;tp|7s4:7o4;tp|7s5:7o5;tp|7s6:7o6;tp|7s7:7o7;tp|7s8:7o0;tp|7s9:7o1;tp|7sa:7o2;tp|7sb:7o3;tp|7sc:7o4;tp|7sd:7o5;tp|7se:7o6;tp|7sf:7o7;tp|7sg:7p0;tp|7sh:7p1;tp|7si:7p2;tp|7sj:7p3;tp|7sk:7p4;tp|7sl:7p5;tp|7sm:7p6;tp|7sn:7p7;tp|7so:7p0;tp|7sp:7p1;tp|7sq:7p2;tp|7sr:7p3;tp|7ss:7p4;tp|7st:7p5;tp|7su:7p6;tp|7sv:7p7;tp|7t0:7r0;tp|7t1:7r1;tp|7t2:7r2;tp|7t3:7r3;tp|7t4:7r4;tp|7t5:7r5;tp|7t6:7r6;tp|7t7:7r7;tp|7t8:7r0;tp|7t9:7r1;tp|7ta:7r2;tp|7tb:7r3;tp|7tc:7r4;tp|7td:7r5;tp|7te:7r6;tp|7tf:7r7;tp|7ti: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|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|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|4ig:4im|4iq:4it|4j0:4k6|4ka:4kd|4kg:4le|4li:4ll|4lo:4lu|4m2:4m5|4m8:4me|4mg:4mm|4mo:4ne|4ng:4oe|4oi:4ol|4oo:4ou|4p0:4q6|4q8:4qq|4r1:4rs|4t0:4vk|501:5jm|5k1:5kq|5l0:5ng|5o0:5oc|5oe:5oh|5p0:5ph|5pl:5pm|5q0:5qh|5r0:5rc|5re:5rg|5s0:5tm|5tu:5u5|5u7:5u8|5uk:5uq|5v0:5v9|60g:60p|610:63n|640:658|7g0:7kr|7l0:7np|7o0:7ol|7oo:7ot|7p0:7q5|7q8:7qd|7qg:7qn|7qv:7rt|7s0:7tk|7tm:7ts|7u2:7u4|7u6:7uc|7ug:7uj|7um:7ur|7v0:7vc|7vi:7vk|7vm:7vs|88a:88j|88p:88t|89a:89d|89f:89h|89j:89p|89t:89v|8a5:8a9|8b0:8c3|8pm:8rq|94s:979|c05:c07|c11:c19|c1h:c1l|c1o:c1s|c21:c4m|c4t:c4v|c51:c7q|c7s:c7v|c85:c9c|c9h:cce|ccg:cdn|cfg:cgs|ch0:ci3|cj0:cjr|cjv:clg|cm0:cmb|cmg:cnu|co0:crm|crr:cut|cv0:cvu|d00:jdl|jg0:17t5|1800:194c|1b00:1lt3|1m00:1uhd|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 Ke}));var r=n(203),i=n.n(r),a=n(9),o=n.n(a),s=n(12),u=n.n(s),c=n(13),l=n.n(c),f=n(3),p=n.n(f),d=n(8),h=n.n(d),v=n(0),m=n.n(v),g=n(16),y=n.n(g),b=n(17),_=n.n(b),S=n(14),w=n.n(S),x=n(28),k=n.n(x),O=n(6),T=n.n(O),A=n(7),I=n.n(A),E=n(4),N=n.n(E),R=n(11),j=n.n(R);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){N()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=p.a.mark($e),D=p.a.mark(Ze);function L(e,t){F(e,t),t.add(e)}function B(e,t,n){F(e,t),t.set(e,n)}function F(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function q(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function U(e,t,n,r){return J(e,t),z(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,r),r}function z(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function J(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w()(e);if(t){var i=w()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _()(this,n)}}function H(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var W="object"===("undefined"==typeof performance?"undefined":j()(performance))&&performance&&"function"==typeof performance.now?performance:Date,Q=new Set,K="object"===(void 0===e?"undefined":j()(e))&&e?e:{},Y=function(e,t,n,r){"function"==typeof K.emitWarning?K.emitWarning(e,t,n,r):console.error("[".concat(n,"] ").concat(t,": ").concat(e))},X=globalThis.AbortController,$=globalThis.AbortSignal;if(void 0===X){var Z;$=function(){function e(){T()(this,e),N()(this,"onabort",void 0),N()(this,"_onabort",[]),N()(this,"reason",void 0),N()(this,"aborted",!1)}return I()(e,[{key:"addEventListener",value:function(e,t){this._onabort.push(t)}}]),e}(),X=function(){function e(){T()(this,e),N()(this,"signal",new $),te()}return I()(e,[{key:"abort",value:function(e){var t,n;if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;var r,i=H(this.signal._onabort);try{for(i.s();!(r=i.n()).done;){(0,r.value)(e)}}catch(e){i.e(e)}finally{i.f()}null===(t=(n=this.signal).onabort)||void 0===t||t.call(n,e)}}}]),e}();var ee="1"!==(null===(Z=K.env)||void 0===Z?void 0:Z.LRU_CACHE_IGNORE_AC_WARNING),te=function e(){ee&&(ee=!1,Y("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");var ne=function(e){return e&&e===Math.floor(e)&&e>0&&isFinite(e)},re=function(e){return ne(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ie:null:null},ie=function(e){y()(n,e);var t=G(n);function n(e){var r;return T()(this,n),(r=t.call(this,e)).fill(0),r}return n}(k()(Array)),ae=function(){function e(t,n){if(T()(this,e),N()(this,"heap",void 0),N()(this,"length",void 0),i=oe,J(r=e,e),z(i,"get"),!function(e,t){return t.get?t.get.call(e):t.value}(r,i))throw new TypeError("instantiate Stack using Stack.create(n)");var r,i;this.heap=new n(t),this.length=0}return I()(e,null,[{key:"create",value:function(t){var n=re(t);if(!n)return[];U(e,e,oe,!0);var r=new e(t,n);return U(e,e,oe,!1),r}}]),I()(e,[{key:"push",value:function(e){this.heap[this.length++]=e}},{key:"pop",value:function(){return this.heap[--this.length]}}]),e}(),oe={writable:!0,value:!1},se=new WeakMap,ue=new WeakMap,ce=new WeakMap,le=new WeakMap,fe=new WeakMap,pe=new WeakMap,de=new WeakMap,he=new WeakMap,ve=new WeakMap,me=new WeakMap,ge=new WeakMap,ye=new WeakMap,be=new WeakMap,_e=new WeakMap,Se=new WeakMap,we=new WeakMap,xe=new WeakMap,ke=new WeakMap,Oe=new WeakMap,Te=new WeakMap,Ae=new WeakMap,Ie=new WeakMap,Ee=new WeakMap,Ne=new WeakSet,Re=new WeakMap,je=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,Me=new WeakSet,De=new WeakMap,Le=new WeakMap,Be=new WeakMap,Fe=new WeakSet,qe=new WeakSet,Ue=new WeakSet,ze=new WeakSet,Je=new WeakSet,Ge=new WeakSet,He=new WeakSet,Ve=new WeakSet,We=new WeakSet,Qe=new WeakSet,Ke=function(){function e(t){T()(this,e),L(this,Qe),L(this,We),L(this,Ve),L(this,He),L(this,Ge),L(this,Je),L(this,ze),L(this,Ue),L(this,qe),L(this,Fe),L(this,Me),L(this,Ne),B(this,se,{writable:!0,value:void 0}),B(this,ue,{writable:!0,value:void 0}),B(this,ce,{writable:!0,value:void 0}),B(this,le,{writable:!0,value:void 0}),B(this,fe,{writable:!0,value:void 0}),B(this,pe,{writable:!0,value:void 0}),N()(this,"ttl",void 0),N()(this,"ttlResolution",void 0),N()(this,"ttlAutopurge",void 0),N()(this,"updateAgeOnGet",void 0),N()(this,"updateAgeOnHas",void 0),N()(this,"allowStale",void 0),N()(this,"noDisposeOnSet",void 0),N()(this,"noUpdateTTL",void 0),N()(this,"maxEntrySize",void 0),N()(this,"sizeCalculation",void 0),N()(this,"noDeleteOnFetchRejection",void 0),N()(this,"noDeleteOnStaleGet",void 0),N()(this,"allowStaleOnFetchAbort",void 0),N()(this,"allowStaleOnFetchRejection",void 0),N()(this,"ignoreFetchAbort",void 0),B(this,de,{writable:!0,value:void 0}),B(this,he,{writable:!0,value:void 0}),B(this,ve,{writable:!0,value:void 0}),B(this,me,{writable:!0,value:void 0}),B(this,ge,{writable:!0,value:void 0}),B(this,ye,{writable:!0,value:void 0}),B(this,be,{writable:!0,value:void 0}),B(this,_e,{writable:!0,value:void 0}),B(this,Se,{writable:!0,value:void 0}),B(this,we,{writable:!0,value:void 0}),B(this,xe,{writable:!0,value:void 0}),B(this,ke,{writable:!0,value:void 0}),B(this,Oe,{writable:!0,value:void 0}),B(this,Te,{writable:!0,value:void 0}),B(this,Ae,{writable:!0,value:void 0}),B(this,Ie,{writable:!0,value:void 0}),B(this,Ee,{writable:!0,value:void 0}),B(this,Re,{writable:!0,value:function(){}}),B(this,je,{writable:!0,value:function(){}}),B(this,Ce,{writable:!0,value:function(){}}),B(this,Pe,{writable:!0,value:function(){return!1}}),B(this,De,{writable:!0,value:function(e){}}),B(this,Le,{writable:!0,value:function(e,t,n){}}),B(this,Be,{writable:!0,value:function(e,t,n,r){if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}}),N()(this,Symbol.toStringTag,"LRUCache");var n=t.max,r=void 0===n?0:n,i=t.ttl,a=t.ttlResolution,o=void 0===a?1:a,s=t.ttlAutopurge,u=t.updateAgeOnGet,c=t.updateAgeOnHas,l=t.allowStale,f=t.dispose,p=t.disposeAfter,d=t.noDisposeOnSet,v=t.noUpdateTTL,g=t.maxSize,y=void 0===g?0:g,b=t.maxEntrySize,_=void 0===b?0:b,S=t.sizeCalculation,w=t.fetchMethod,x=t.memoMethod,k=t.noDeleteOnFetchRejection,O=t.noDeleteOnStaleGet,A=t.allowStaleOnFetchRejection,I=t.allowStaleOnFetchAbort,E=t.ignoreFetchAbort;if(0!==r&&!ne(r))throw new TypeError("max option must be a nonnegative integer");var R=r?re(r):Array;if(!R)throw new Error("invalid max value: "+r);if(h()(this,se,r),h()(this,ue,y),this.maxEntrySize=_||m()(this,ue),this.sizeCalculation=S,this.sizeCalculation){if(!m()(this,ue)&&!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!==x&&"function"!=typeof x)throw new TypeError("memoMethod must be a function if defined");if(h()(this,pe,x),void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(h()(this,fe,w),h()(this,Ie,!!w),h()(this,ve,new Map),h()(this,me,new Array(r).fill(void 0)),h()(this,ge,new Array(r).fill(void 0)),h()(this,ye,new R(r)),h()(this,be,new R(r)),h()(this,_e,0),h()(this,Se,0),h()(this,we,ae.create(r)),h()(this,de,0),h()(this,he,0),"function"==typeof f&&h()(this,ce,f),"function"==typeof p?(h()(this,le,p),h()(this,xe,[])):(h()(this,le,void 0),h()(this,xe,void 0)),h()(this,Ae,!!m()(this,ce)),h()(this,Ee,!!m()(this,le)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!E,0!==this.maxEntrySize){if(0!==m()(this,ue)&&!ne(m()(this,ue)))throw new TypeError("maxSize must be a positive integer if specified");if(!ne(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");q(this,Me,Xe).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!c,this.ttlResolution=ne(o)||0===o?o:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!ne(this.ttl))throw new TypeError("ttl must be a positive integer if specified");q(this,Ne,Ye).call(this)}if(0===m()(this,se)&&0===this.ttl&&0===m()(this,ue))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!m()(this,se)&&!m()(this,ue)){var j="LRU_CACHE_UNBOUNDED";if(function(e){return!Q.has(e)}(j)){Q.add(j);Y("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,e)}}}var t,n;return I()(e,[{key:"max",get:function(){return m()(this,se)}},{key:"maxSize",get:function(){return m()(this,ue)}},{key:"calculatedSize",get:function(){return m()(this,he)}},{key:"size",get:function(){return m()(this,de)}},{key:"fetchMethod",get:function(){return m()(this,fe)}},{key:"memoMethod",get:function(){return m()(this,pe)}},{key:"dispose",get:function(){return m()(this,ce)}},{key:"disposeAfter",get:function(){return m()(this,le)}}],[{key:"unsafeExposeInternals",value:function(e){return{starts:m()(e,Oe),ttls:m()(e,Te),sizes:m()(e,ke),keyMap:m()(e,ve),keyList:m()(e,me),valList:m()(e,ge),next:m()(e,ye),prev:m()(e,be),get head(){return m()(e,_e)},get tail(){return m()(e,Se)},free:m()(e,we),isBackgroundFetch:function(t){return q(e,Ge,rt).call(e,t)},backgroundFetch:function(t,n,r,i){return q(e,Je,nt).call(e,t,n,r,i)},moveToTail:function(t){return q(e,Ve,at).call(e,t)},indexes:function(t){return q(e,Fe,$e).call(e,t)},rindexes:function(t){return q(e,qe,Ze).call(e,t)},isStale:function(t){return m()(e,Pe).call(e,t)}}}}]),I()(e,[{key:"getRemainingTTL",value:function(e){return m()(this,ve).has(e)?1/0:0}},{key:"entries",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(r=n.value,void 0===m()(this,ge)[r]||void 0===m()(this,me)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=8;break}return e.next=8,[m()(this,me)[r],m()(this,ge)[r]];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"rentries",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=10;break}if(r=n.value,void 0===m()(this,ge)[r]||void 0===m()(this,me)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=8;break}return e.next=8,[m()(this,me)[r],m()(this,ge)[r]];case 8:e.next=3;break;case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(1),t.e(e.t0);case 15:return e.prev=15,t.f(),e.finish(15);case 18:case"end":return e.stop()}}),e,this,[[1,12,15,18]])}))},{key:"keys",value:p.a.mark((function e(){var t,n,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===(i=m()(this,me)[r])||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"rkeys",value:p.a.mark((function e(){var t,n,r,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===(i=m()(this,me)[r])||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,i;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"values",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,Fe,$e).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===m()(this,ge)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,m()(this,ge)[r];case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:"rvalues",value:p.a.mark((function e(){var t,n,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=H(q(this,qe,Ze).call(this)),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=11;break}if(r=n.value,void 0===m()(this,ge)[r]||q(this,Ge,rt).call(this,m()(this,ge)[r])){e.next=9;break}return e.next=9,m()(this,ge)[r];case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),t.e(e.t0);case 16:return e.prev=16,t.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,this,[[1,13,16,19]])}))},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"find",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=H(q(this,Fe,$e).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&e(o,m()(this,me)[i],this))return this.get(m()(this,me)[i],n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"forEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=H(q(this,Fe,$e).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,m()(this,me)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"rforEach",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=H(q(this,qe,Ze).call(this));try{for(r.s();!(t=r.n()).done;){var i=t.value,a=m()(this,ge)[i],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;void 0!==o&&e.call(n,o,m()(this,me)[i],this)}}catch(e){r.e(e)}finally{r.f()}}},{key:"purgeStale",value:function(){var e,t=!1,n=H(q(this,qe,Ze).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value;m()(this,Pe).call(this,r)&&(q(this,We,ot).call(this,m()(this,me)[r],"expire"),t=!0)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"info",value:function(e){var t=m()(this,ve).get(e);if(void 0!==t){var n=m()(this,ge)[t],r=q(this,Ge,rt).call(this,n)?n.__staleWhileFetching:n;if(void 0!==r){var i={value:r};if(m()(this,Te)&&m()(this,Oe)){var a=m()(this,Te)[t],o=m()(this,Oe)[t];if(a&&o){var s=a-(W.now()-o);i.ttl=s,i.start=Date.now()}}return m()(this,ke)&&(i.size=m()(this,ke)[t]),i}}}},{key:"dump",value:function(){var e,t=[],n=H(q(this,Fe,$e).call(this,{allowStale:!0}));try{for(n.s();!(e=n.n()).done;){var r=e.value,i=m()(this,me)[r],a=m()(this,ge)[r],o=q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a;if(void 0!==o&&void 0!==i){var s={value:o};if(m()(this,Te)&&m()(this,Oe)){s.ttl=m()(this,Te)[r];var u=W.now()-m()(this,Oe)[r];s.start=Math.floor(Date.now()-u)}m()(this,ke)&&(s.size=m()(this,ke)[r]),t.unshift([i,s])}}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"load",value:function(e){this.clear();var t,n=H(e);try{for(n.s();!(t=n.n()).done;){var r=l()(t.value,2),i=r[0],a=r[1];if(a.start){var o=Date.now()-a.start;a.start=W.now()-o}this.set(i,a.value,a)}}catch(e){n.e(e)}finally{n.f()}}},{key:"set",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t)return this.delete(e),this;var r=n.ttl,i=void 0===r?this.ttl:r,a=n.start,o=n.noDisposeOnSet,s=void 0===o?this.noDisposeOnSet:o,c=n.sizeCalculation,l=void 0===c?this.sizeCalculation:c,f=n.status,p=n.noUpdateTTL,d=void 0===p?this.noUpdateTTL:p,v=m()(this,Be).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&v>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),q(this,We,ot).call(this,e,"set"),this;var g=0===m()(this,de)?void 0:m()(this,ve).get(e);if(void 0===g){var y;g=0===m()(this,de)?m()(this,Se):0!==m()(this,we).length?m()(this,we).pop():m()(this,de)===m()(this,se)?q(this,ze,tt).call(this,!1):m()(this,de),m()(this,me)[g]=e,m()(this,ge)[g]=t,m()(this,ve).set(e,g),m()(this,ye)[m()(this,Se)]=g,m()(this,be)[g]=m()(this,Se),h()(this,Se,g),h()(this,de,(y=m()(this,de),y++,y)),m()(this,Le).call(this,g,v,f),f&&(f.set="add"),d=!1}else{q(this,Ve,at).call(this,g);var b=m()(this,ge)[g];if(t!==b){if(m()(this,Ie)&&q(this,Ge,rt).call(this,b)){b.__abortController.abort(new Error("replaced"));var _=b.__staleWhileFetching;if(void 0!==_&&!s){var S,w;if(m()(this,Ae))null===(S=m()(this,ce))||void 0===S||S.call(this,_,e,"set");if(m()(this,Ee))null===(w=m()(this,xe))||void 0===w||w.push([_,e,"set"])}}else if(!s){var x,k;if(m()(this,Ae))null===(x=m()(this,ce))||void 0===x||x.call(this,b,e,"set");if(m()(this,Ee))null===(k=m()(this,xe))||void 0===k||k.push([b,e,"set"])}if(m()(this,De).call(this,g),m()(this,Le).call(this,g,v,f),m()(this,ge)[g]=t,f){f.set="replace";var O=b&&q(this,Ge,rt).call(this,b)?b.__staleWhileFetching:b;void 0!==O&&(f.oldValue=O)}}else f&&(f.set="update")}if(0===i||m()(this,Te)||q(this,Ne,Ye).call(this),m()(this,Te)&&(d||m()(this,Ce).call(this,g,i,a),f&&m()(this,je).call(this,f,g)),!s&&m()(this,Ee)&&m()(this,xe))for(var T,A=m()(this,xe);T=null==A?void 0:A.shift();){var I,E;null===(I=m()(this,le))||void 0===I||(E=I).call.apply(E,[this].concat(u()(T)))}return this}},{key:"pop",value:function(){try{for(;m()(this,de);){var e=m()(this,ge)[m()(this,_e)];if(q(this,ze,tt).call(this,!0),q(this,Ge,rt).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(m()(this,Ee)&&m()(this,xe))for(var t,n=m()(this,xe);t=null==n?void 0:n.shift();){var r,i;null===(r=m()(this,le))||void 0===r||(i=r).call.apply(i,[this].concat(u()(t)))}}}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.updateAgeOnHas,r=void 0===n?this.updateAgeOnHas:n,i=t.status,a=m()(this,ve).get(e);if(void 0!==a){var o=m()(this,ge)[a];if(q(this,Ge,rt).call(this,o)&&void 0===o.__staleWhileFetching)return!1;if(!m()(this,Pe).call(this,a))return r&&m()(this,Re).call(this,a),i&&(i.has="hit",m()(this,je).call(this,i,a)),!0;i&&(i.has="stale",m()(this,je).call(this,i,a))}else i&&(i.has="miss");return!1}},{key:"peek",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowStale,r=void 0===n?this.allowStale:n,i=m()(this,ve).get(e);if(void 0!==i&&(r||!m()(this,Pe).call(this,i))){var a=m()(this,ge)[i];return q(this,Ge,rt).call(this,a)?a.__staleWhileFetching:a}}},{key:"fetch",value:(n=o()(p.a.mark((function e(t){var n,r,i,a,o,s,u,c,l,f,d,h,v,g,y,b,_,S,w,x,k,O,T,A,I,E,N,R,j,C,P,M,D,L,B,F,U,z,J,G=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=G.length>1&&void 0!==G[1]?G[1]:{},r=n.allowStale,i=void 0===r?this.allowStale:r,a=n.updateAgeOnGet,o=void 0===a?this.updateAgeOnGet:a,s=n.noDeleteOnStaleGet,u=void 0===s?this.noDeleteOnStaleGet:s,c=n.ttl,l=void 0===c?this.ttl:c,f=n.noDisposeOnSet,d=void 0===f?this.noDisposeOnSet:f,h=n.size,v=void 0===h?0:h,g=n.sizeCalculation,y=void 0===g?this.sizeCalculation:g,b=n.noUpdateTTL,_=void 0===b?this.noUpdateTTL:b,S=n.noDeleteOnFetchRejection,w=void 0===S?this.noDeleteOnFetchRejection:S,x=n.allowStaleOnFetchRejection,k=void 0===x?this.allowStaleOnFetchRejection:x,O=n.ignoreFetchAbort,T=void 0===O?this.ignoreFetchAbort:O,A=n.allowStaleOnFetchAbort,I=void 0===A?this.allowStaleOnFetchAbort:A,E=n.context,N=n.forceRefresh,R=void 0!==N&&N,j=n.status,C=n.signal,m()(this,Ie)){e.next=5;break}return j&&(j.fetch="get"),e.abrupt("return",this.get(t,{allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,status:j}));case 5:if(P={allowStale:i,updateAgeOnGet:o,noDeleteOnStaleGet:u,ttl:l,noDisposeOnSet:d,size:v,sizeCalculation:y,noUpdateTTL:_,noDeleteOnFetchRejection:w,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:T,status:j,signal:C},void 0!==(M=m()(this,ve).get(t))){e.next=13;break}return j&&(j.fetch="miss"),D=q(this,Je,nt).call(this,t,M,P,E),e.abrupt("return",D.__returned=D);case 13:if(L=m()(this,ge)[M],!q(this,Ge,rt).call(this,L)){e.next=18;break}return B=i&&void 0!==L.__staleWhileFetching,j&&(j.fetch="inflight",B&&(j.returnedStale=!0)),e.abrupt("return",B?L.__staleWhileFetching:L.__returned=L);case 18:if(F=m()(this,Pe).call(this,M),R||F){e.next=25;break}return j&&(j.fetch="hit"),q(this,Ve,at).call(this,M),o&&m()(this,Re).call(this,M),j&&m()(this,je).call(this,j,M),e.abrupt("return",L);case 25:return U=q(this,Je,nt).call(this,t,M,P,E),z=void 0!==U.__staleWhileFetching,J=z&&i,j&&(j.fetch=F?"stale":"refresh",J&&F&&(j.returnedStale=!0)),e.abrupt("return",J?U.__staleWhileFetching:U.__returned=U);case 30:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"forceFetch",value:(t=o()(p.a.mark((function e(t){var n,r,i=arguments;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>1&&void 0!==i[1]?i[1]:{},e.next=3,this.fetch(t,n);case 3:if(void 0!==(r=e.sent)){e.next=6;break}throw new Error("fetch() returned undefined");case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"memo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=m()(this,pe);if(!n)throw new Error("no memoMethod provided to constructor");var r=t.context,a=t.forceRefresh,o=i()(t,["context","forceRefresh"]),s=this.get(e,o);if(!a&&void 0!==s)return s;var u=n(e,s,{options:o,context:r});return this.set(e,u,o),u}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.allowStale,r=void 0===n?this.allowStale:n,i=t.updateAgeOnGet,a=void 0===i?this.updateAgeOnGet:i,o=t.noDeleteOnStaleGet,s=void 0===o?this.noDeleteOnStaleGet:o,u=t.status,c=m()(this,ve).get(e);if(void 0!==c){var l=m()(this,ge)[c],f=q(this,Ge,rt).call(this,l);return u&&m()(this,je).call(this,u,c),m()(this,Pe).call(this,c)?(u&&(u.get="stale"),f?(u&&r&&void 0!==l.__staleWhileFetching&&(u.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||q(this,We,ot).call(this,e,"expire"),u&&r&&(u.returnedStale=!0),r?l:void 0)):(u&&(u.get="hit"),f?l.__staleWhileFetching:(q(this,Ve,at).call(this,c),a&&m()(this,Re).call(this,c),l))}u&&(u.get="miss")}},{key:"delete",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return q(this,We,ot).call(this,e,"delete")}))},{key:"clear",value:function(){return q(this,Qe,st).call(this,"delete")}}]),e}();function Ye(){var e=this,t=new ie(m()(this,se)),n=new ie(m()(this,se));h()(this,Te,t),h()(this,Oe,n),h()(this,Ce,(function(r,i){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:W.now();if(n[r]=0!==i?a:0,t[r]=i,0!==i&&e.ttlAutopurge){var o=setTimeout((function(){m()(e,Pe).call(e,r)&&q(e,We,ot).call(e,m()(e,me)[r],"expire")}),i+1);o.unref&&o.unref()}})),h()(this,Re,(function(e){n[e]=0!==t[e]?W.now():0})),h()(this,je,(function(e,a){if(t[a]){var o=t[a],s=n[a];if(!o||!s)return;e.ttl=o,e.start=s,e.now=r||i();var u=e.now-s;e.remainingTTL=o-u}}));var r=0,i=function(){var t=W.now();if(e.ttlResolution>0){r=t;var n=setTimeout((function(){return r=0}),e.ttlResolution);n.unref&&n.unref()}return t};this.getRemainingTTL=function(a){var o=m()(e,ve).get(a);if(void 0===o)return 0;var s=t[o],u=n[o];return s&&u?s-((r||i())-u):1/0},h()(this,Pe,(function(e){var a=n[e],o=t[e];return!!o&&!!a&&(r||i())-a>o}))}function Xe(){var e=this,t=new ie(m()(this,se));h()(this,he,0),h()(this,ke,t),h()(this,De,(function(n){h()(e,he,m()(e,he)-t[n]),t[n]=0})),h()(this,Be,(function(t,n,r,i){if(q(e,Ge,rt).call(e,n))return 0;if(!ne(r)){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(r=i(n,t),!ne(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r})),h()(this,Le,(function(n,r,i){if(t[n]=r,m()(e,ue))for(var a=m()(e,ue)-t[n];m()(e,he)>a;)q(e,ze,tt).call(e,!0);h()(e,he,m()(e,he)+t[n]),i&&(i.entrySize=r,i.totalCalculatedSize=m()(e,he))}))}function $e(){var e,t,n,r,i=arguments;return p.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},t=e.allowStale,n=void 0===t?this.allowStale:t,!m()(this,de)){a.next=16;break}r=m()(this,Se);case 3:if(q(this,Ue,et).call(this,r)){a.next=6;break}return a.abrupt("break",16);case 6:if(!n&&m()(this,Pe).call(this,r)){a.next=9;break}return a.next=9,r;case 9:if(r!==m()(this,_e)){a.next=13;break}return a.abrupt("break",16);case 13:r=m()(this,be)[r];case 14:a.next=3;break;case 16:case"end":return a.stop()}}),M,this)}function Ze(){var e,t,n,r,i=arguments;return p.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(e=i.length>0&&void 0!==i[0]?i[0]:{},t=e.allowStale,n=void 0===t?this.allowStale:t,!m()(this,de)){a.next=16;break}r=m()(this,_e);case 3:if(q(this,Ue,et).call(this,r)){a.next=6;break}return a.abrupt("break",16);case 6:if(!n&&m()(this,Pe).call(this,r)){a.next=9;break}return a.next=9,r;case 9:if(r!==m()(this,Se)){a.next=13;break}return a.abrupt("break",16);case 13:r=m()(this,ye)[r];case 14:a.next=3;break;case 16:case"end":return a.stop()}}),D,this)}function et(e){return void 0!==e&&m()(this,ve).get(m()(this,me)[e])===e}function tt(e){var t,n=m()(this,_e),r=m()(this,me)[n],i=m()(this,ge)[n];if(m()(this,Ie)&&q(this,Ge,rt).call(this,i))i.__abortController.abort(new Error("evicted"));else if(m()(this,Ae)||m()(this,Ee)){var a,o;if(m()(this,Ae))null===(a=m()(this,ce))||void 0===a||a.call(this,i,r,"evict");if(m()(this,Ee))null===(o=m()(this,xe))||void 0===o||o.push([i,r,"evict"])}return m()(this,De).call(this,n),e&&(m()(this,me)[n]=void 0,m()(this,ge)[n]=void 0,m()(this,we).push(n)),1===m()(this,de)?(h()(this,_e,h()(this,Se,0)),m()(this,we).length=0):h()(this,_e,m()(this,ye)[n]),m()(this,ve).delete(r),h()(this,de,(t=m()(this,de),t--,t)),n}function nt(e,t,n,r){var i=this,a=void 0===t?void 0:m()(this,ge)[t];if(q(this,Ge,rt).call(this,a))return a;var o=new X,s=n.signal;null==s||s.addEventListener("abort",(function(){return o.abort(s.reason)}),{signal:o.signal});var u={signal:o.signal,options:n,context:r},c=function(r){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=o.signal.aborted,c=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(s&&!a?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),s&&!c&&!a)return l(o.signal.reason);var p=f;return m()(i,ge)[t]===f&&(void 0===r?p.__staleWhileFetching?m()(i,ge)[t]=p.__staleWhileFetching:q(i,We,ot).call(i,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),i.set(e,r,u.options))),r},l=function(r){var a=o.signal.aborted&&n.allowStaleOnFetchAbort,s=a||n.allowStaleOnFetchRejection,u=s||n.noDeleteOnFetchRejection,c=f;m()(i,ge)[t]===f&&(!u||void 0===c.__staleWhileFetching?q(i,We,ot).call(i,e,"fetch"):a||(m()(i,ge)[t]=c.__staleWhileFetching));if(s)return n.status&&void 0!==c.__staleWhileFetching&&(n.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw r};n.status&&(n.status.fetchDispatched=!0);var f=new Promise((function(t,r){var s,l=null===(s=m()(i,fe))||void 0===s?void 0:s.call(i,e,a,u);l&&l instanceof Promise&&l.then((function(e){return t(void 0===e?void 0:e)}),r),o.signal.addEventListener("abort",(function(){n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=function(e){return c(e,!0)}))}))})).then(c,(function(e){return n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),l(e)})),p=Object.assign(f,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return void 0===t?(this.set(e,p,P(P({},u.options),{},{status:void 0})),t=m()(this,ve).get(e)):m()(this,ge)[t]=p,p}function rt(e){if(!m()(this,Ie))return!1;var t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof X}function it(e,t){m()(this,be)[t]=e,m()(this,ye)[e]=t}function at(e){e!==m()(this,Se)&&(e===m()(this,_e)?h()(this,_e,m()(this,ye)[e]):q(this,He,it).call(this,m()(this,be)[e],m()(this,ye)[e]),q(this,He,it).call(this,m()(this,Se),e),h()(this,Se,e))}function ot(e,t){var n,r=!1;if(0!==m()(this,de)){var i=m()(this,ve).get(e);if(void 0!==i)if(r=!0,1===m()(this,de))q(this,Qe,st).call(this,t);else{var a;m()(this,De).call(this,i);var o=m()(this,ge)[i];if(q(this,Ge,rt).call(this,o))o.__abortController.abort(new Error("deleted"));else if(m()(this,Ae)||m()(this,Ee)){var s,c;if(m()(this,Ae))null===(s=m()(this,ce))||void 0===s||s.call(this,o,e,t);if(m()(this,Ee))null===(c=m()(this,xe))||void 0===c||c.push([o,e,t])}if(m()(this,ve).delete(e),m()(this,me)[i]=void 0,m()(this,ge)[i]=void 0,i===m()(this,Se))h()(this,Se,m()(this,be)[i]);else if(i===m()(this,_e))h()(this,_e,m()(this,ye)[i]);else{var l=m()(this,be)[i];m()(this,ye)[l]=m()(this,ye)[i];var f=m()(this,ye)[i];m()(this,be)[f]=m()(this,be)[i]}h()(this,de,(a=m()(this,de),a--,a)),m()(this,we).push(i)}}if(m()(this,Ee)&&(null===(n=m()(this,xe))||void 0===n?void 0:n.length))for(var p,d=m()(this,xe);p=null==d?void 0:d.shift();){var v,g;null===(v=m()(this,le))||void 0===v||(g=v).call.apply(g,[this].concat(u()(p)))}return r}function st(e){var t,n=H(q(this,qe,Ze).call(this,{allowStale:!0}));try{for(n.s();!(t=n.n()).done;){var r=t.value,i=m()(this,ge)[r];if(q(this,Ge,rt).call(this,i))i.__abortController.abort(new Error("deleted"));else{var a,o,s=m()(this,me)[r];if(m()(this,Ae))null===(a=m()(this,ce))||void 0===a||a.call(this,i,s,e);if(m()(this,Ee))null===(o=m()(this,xe))||void 0===o||o.push([i,s,e])}}}catch(e){n.e(e)}finally{n.f()}if(m()(this,ve).clear(),m()(this,ge).fill(void 0),m()(this,me).fill(void 0),m()(this,Te)&&m()(this,Oe)&&(m()(this,Te).fill(0),m()(this,Oe).fill(0)),m()(this,ke)&&m()(this,ke).fill(0),h()(this,_e,0),h()(this,Se,0),m()(this,we).length=0,h()(this,he,0),h()(this,de,0),m()(this,Ee)&&m()(this,xe))for(var c,l=m()(this,xe);c=null==l?void 0:l.shift();){var f,p;null===(f=m()(this,le))||void 0===f||(p=f).call.apply(p,[this].concat(u()(c)))}}}.call(this,n(32))},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},e.exports.__esModule=!0,e.exports.default=e.exports},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){(function(t){var r=n(11),i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt,c="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,l="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,f=c||l||Function("return this")(),p=Object.prototype.toString,d=Math.max,h=Math.min,v=function(){return f.Date.now()};function m(e,t,n){var r,i,a,o,s,u,c=0,l=!1,f=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,a=i;return r=i=void 0,c=t,o=e.apply(a,n)}function y(e){return c=e,s=setTimeout(S,t),l?m(e):o}function _(e){var n=e-u;return void 0===u||n>=t||n<0||f&&e-c>=a}function S(){var e=v();if(_(e))return w(e);s=setTimeout(S,function(e){var n=t-(e-u);return f?h(n,a-(e-c)):n}(e))}function w(e){return s=void 0,p&&r?m(e):(r=i=void 0,o)}function x(){var e=v(),n=_(e);if(r=arguments,i=this,u=e,n){if(void 0===s)return y(u);if(f)return s=setTimeout(S,t),m(u)}return void 0===s&&(s=setTimeout(S,t)),o}return t=b(t)||0,g(n)&&(l=!!n.leading,a=(f="maxWait"in n)?d(b(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=u=i=s=void 0},x.flush=function(){return void 0===s?o:w(v())},x}function g(e){var t=r(e);return!!e&&("object"==t||"function"==t)}function y(e){return"symbol"==r(e)||function(e){return!!e&&"object"==r(e)}(e)&&"[object Symbol]"==p.call(e)}function b(e){if("number"==typeof e)return e;if(y(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=o.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return g(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),m(e,t,{leading:r,maxWait:t,trailing:i})}}).call(this,n(25))},function(e,t,n){var r,i,a=n(11);!function(o,s){"object"==a(t)&&void 0!==e?e.exports=s():void 0===(i="function"==typeof(r=s)?r.call(t,n,t,e):r)||(e.exports=i)}(0,(function(){"use strict";var e="undefined"==typeof window,t=!1,n=!1,r=!1,i=!1,a=!1,o=!1,s=!1,u=!1,c=!1,l=!1;return e||(t="undefined"!=typeof InstallTrigger,n=!!window.chrome,r=!(!window.chrome||!window.navigator||!window.navigator.plugins||!window.navigator.plugins.namedItem("Chrome PDF Plugin")&&!window.chrome.runtime),i=n&&!window.chrome.webstore&&!window.chrome.runtime,a=0<Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")||window.safari&&window.safari.pushNotification,o=!!window.opr&&!!window.opr.addons||!!window.opera,s=!!window.StyleMedia,u=n&&!!navigator.userAgent.match(/edg/i),c=(r||o)&&!!window.CSS,l=!(n||a||t||o||!document.documentMode)),{get isChrome(){return r},get isChromeOrChromium(){return n},get isChromium(){return i},get isFirefox(){return t},get isSafari(){return a},get isOpera(){return o},get isEdge(){return s},get isEdgeChromium(){return u},get isIE(){return l},get isBlink(){return c}}}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.definitions=void 0;var r=n(5),i=n(2),a={aliases:["message.propose"],element:"propose",fields:{conversationId:r.attribute("inin-cid"),persistentConversationId:r.attribute("inin-persistent-cid"),sdpOverXmpp:r.booleanAttribute("inin-sdp-over-xmpp"),privAnswerMode:r.attribute("inin-priv-answer-mode"),originalRoomJid:r.attribute("inin-ofrom"),autoAnswer:r.booleanAttribute("inin-autoanswer"),fromUserId:r.attribute("inin-user-id"),sessionId:r.attribute("id"),meetingId:r.attribute("inin-meeting-id")},namespace:"urn:xmpp:jingle-message:0"},o={aliases:["message.proceed"],element:"proceed",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},s={aliases:["message.accept"],element:"accept",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},u={aliases:["message.reject"],element:"reject",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},c={aliases:["message.retract"],element:"retract",fields:{sessionId:r.attribute("id")},namespace:"urn:xmpp:jingle-message:0"},l={aliases:["iq.jingle.screenstart"],element:"screen-start",namespace:i.NS_JINGLE_RTP_INFO_1},f={aliases:["iq.jingle.screenstop"],element:"screen-stop",namespace:i.NS_JINGLE_RTP_INFO_1},p={path:"iq",namespace:i.NS_CLIENT,element:"iq",fields:{genesysWebrtc:r.childJSON("genesys","genesys-webrtc")}},d={path:"message",namespace:i.NS_CLIENT,element:"message",fields:{mediaMessage:r.childJSON("genesys","media-message")}},h={aliases:["presence.media"],element:"x",fields:{conversationId:r.attribute("conversationId"),sourceCommunicationId:r.attribute("sourceCommunicationId"),screenShare:r.childAttribute(null,"mediastream","screenShare"),video:r.childAttribute(null,"mediastream","video"),audio:r.childAttribute(null,"mediastream","audio"),listener:r.childAttribute(null,"mediastream","listener"),screenRecording:r.childAttribute(null,"mediastream","screenRecording"),videoGuest:r.childAttribute(null,"mediastream","videoGuest")},namespace:"orgspan:mediastream"};t.definitions=[a,o,s,u,c,l,f,h,p,d]},function(e,t,n){"use strict";var r=n(13),i=n(11),a=n(4),o=n(6),s=n(7);function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var p=n(15),d=n(41),h=(0,p.__importDefault)(n(243)),v=(0,p.__importDefault)(n(85)),m=function(){function e(){o(this,e),this.translators=new Map,this.root=new v.default,this.setLanguageResolver(d.basicLanguageResolver)}return s(e,[{key:"setLanguageResolver",value:function(e){this.languageResolver=e}},{key:"import",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{registry:this};if(this.hasTranslator(e.getNamespace(),e.getName())){t.acceptLanguages||(t.acceptLanguages=[]),t.acceptLanguages=t.acceptLanguages.map((function(e){return 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:h.default});var n=this.getOrCreateTranslator(e.getNamespace(),e.getName());return n.import(e,f(f({},t),{},{registry:this}))}}},{key:"export",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{registry:this};n.acceptLanguages||(n.acceptLanguages=[]),n.acceptLanguages=n.acceptLanguages.map((function(e){return e.toLowerCase()})),n.lang&&(n.lang=n.lang.toLowerCase()),n.sanitizers||(n.sanitizers={xhtmlim:h.default}),n.path=e;var r,i=e.split(".").filter((function(e){return""!==e})),a=this.root,o=u(i);try{for(o.s();!(r=o.n()).done;){var s=r.value,c=a.getChild(s);if(!c)return;a=c}}catch(e){o.e(e)}finally{o.f()}return a.export(t,f(f({},n),{},{registry:this}))}},{key:"getImportKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t?this.walkToTranslator(t.split(".")):this.root;if(n)return n.getImportKey(e)}},{key:"define",value:function(e){if(Array.isArray(e)){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;"object"===i(a)?this.define(a):a(this)}}catch(e){n.e(e)}finally{n.f()}}else if("object"===i(e)){var o=e;o.aliases=o.aliases||[],o.path&&!o.aliases.includes(o.path)&&o.aliases.push(o.path);var s,c=o.aliases.map((function(e){return"string"==typeof e?{path:e}:e})).sort((function(e,t){var n=e.path.split(".").length;return t.path.split(".").length-n}));if(this.hasTranslator(o.namespace,o.element)&&(s=this.getOrCreateTranslator(o.namespace,o.element)),!s){var l,f,p=u(c);try{for(p.s();!(f=p.n()).done;){var d=f.value,h=this.walkToTranslator(d.path.split("."));if(h&&!h.placeholder){s=h;break}h&&(l=h)}}catch(e){p.e(e)}finally{p.f()}l&&!s&&((s=l).placeholder=!1)}s||(s=this.getOrCreateTranslator(o.namespace,o.element)),this.indexTranslator(o.namespace,o.element,s);var v=o.fields||{},m=new Map,g=new Map,y=new Map,b=new Map;o.typeField&&(s.typeField=o.typeField),o.defaultType&&(s.defaultType=o.defaultType),o.versionField&&(s.versionField=o.versionField),o.defaultVersion&&(s.defaultVersion=o.defaultVersion),o.languageField&&(s.languageField=o.languageField);for(var _=0,S=Object.entries(v);_<S.length;_++){var w=r(S[_],2),x=w[0],k=w[1];m.set(x,k.importer),y.set(x,k.importOrder||k.order||0),g.set(x,k.exporter),b.set(x,k.exportOrder||k.order||0)}if(o.childrenExportOrder)for(var O=0,T=Object.entries(o.childrenExportOrder);O<T.length;O++){var A=r(T[O],2),I=A[0],E=A[1];b.set(I,E||0)}for(var N=new Map,R=0,j=Object.entries(o.optionalNamespaces||{});R<j.length;R++){var C=r(j[R],2),P=C[0],M=C[1];N.set(P,M)}s.updateDefinition({contexts:new Map,element:o.element,exporterOrdering:b,exporters:g,importerOrdering:y,importers:m,namespace:o.namespace,optionalNamespaces:N,type:o.type,version:o.version,typeOrder:o.typeOrder});var D,L=u(c);try{for(L.s();!(D=L.n()).done;){var B=D.value;this.alias(o.namespace,o.element,B.path,B.multiple,B.selector,B.contextField,o.type,B.impliedType)}}catch(e){L.e(e)}finally{L.f()}var F,q=u(c);try{for(q.s();!(F=q.n()).done;){var U=F.value,z=this.walkToTranslator(U.path.split("."));z&&z!==s&&z.replaceWith(s)}}catch(e){q.e(e)}finally{q.f()}}else e(this)}},{key:"alias",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7&&void 0!==arguments[7]&&arguments[7],u=this.getOrCreateTranslator(e,t);u.placeholder=!1;var c=n.split(".").filter((function(e){return""!==e})),l=c.pop(),f=this.walkToTranslator(c,!0),p="{".concat(e,"}").concat(t);o&&(a||s)&&u.addContext(n,i,a,p,o,s),f.addChild(l,u,r,i,p)}},{key:"walkToTranslator",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.root,i=u(e);try{for(i.s();!(t=i.n()).done;){var a=t.value,o=r.getChild(a);if(!o){if(!n)return;(o=new v.default).placeholder=!0,r.addChild(a,o)}r=o}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"hasTranslator",value:function(e,t){return this.translators.has("{".concat(e,"}").concat(t))}},{key:"getOrCreateTranslator",value:function(e,t){var n=this.translators.get("{".concat(e,"}").concat(t));return n||(n=new v.default,this.indexTranslator(e,t,n)),n}},{key:"indexTranslator",value:function(e,t,n){this.translators.set("{".concat(e,"}").concat(t),n)}}]),e}();t.default=m},function(e,t,n){"use strict";var r=n(13);function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var o=new Set(["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul"]),s=new Set(["style"]),u=new Map([["a",new Set(["href","style"])],["body",new Set(["style","xml:lang"])],["blockquote",s],["br",s],["cite",s],["em",s],["img",new Set(["alt","height","src","style","width"])],["li",s],["ol",s],["p",s],["span",s],["strong",s],["ul",s]]),c=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]]),l=function(e){return!!e.match(/^(https?|xmpp|cid|mailto|ftps?|im|ircs?|sips?|tel|geo|bitcoin|magnet):/i)&&e},f=function(e){return!!e.match(/^[0-9]*$/)&&e},p={alt:function(e){return e},height:f,href:l,src:l,style:function(e){var t=";".concat(e).replace(/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,"").replace(/\/\*.*/,"").replace(/\\([a-fA-F0-9]{1,6})\s?/,(function(e,t){return String.fromCharCode(parseInt(t,16))})).match(/;\s*([a-z-]+)\s*:\s*([^;]*[^\s;])\s*/g),n=[];if(!t)return!1;var r,a=i(t);try{for(a.s();!(r=a.n()).done;){var o=r.value.match(/^;\s*([a-z-]+)\s*:\s*([^;]*[^\s])\s*$/);if(o){var s=c.get(o[1]);if(s){var u=o[2].match(s);u&&n.push("".concat(o[1],":").concat(u[0]))}}}}catch(e){a.e(e)}finally{a.f()}return!!n.length&&n.join("")},width:f};function d(e){if("string"==typeof e)return e;if(!o.has(e.name)){if("script"===e.name)return;return function(e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if("string"==typeof a)n.push(a);else{var o=d(a);o&&(Array.isArray(o)?n=n.concat(o):n.push(o))}}}catch(e){r.e(e)}finally{r.f()}return n}(e)}for(var t=e.children.map(d).filter((function(e){return void 0!==e})),n={},a=0,s=Object.entries(e.attributes);a<s.length;a++){var c=r(s[a],2),l=c[0],f=c[1],h=u.get(e.name);if(h&&h.has(l)&&f){var v=p[l](f);v&&(n[l]=v)}}return{attributes:n,children:t,name:e.name}}t.default=function(e){if("string"!=typeof e){var t,n=[],r=i(e.children);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a)if("string"!=typeof a){var o=d(a);Array.isArray(o)?n=n.concat(o):o&&n.push(o)}else n.push(a)}}catch(e){r.e(e)}finally{r.f()}var s={};if("body"===e.name)return void 0!==e.attributes.xmlns&&(s.xmlns=e.attributes.xmlns),e.attributes.style&&(s.style=e.attributes.style),void 0!==e.attributes["xml:lang"]&&(s["xml:lang"]=e.attributes["xml:lang"]),{attributes:s,children:n,name:"body"}}}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),o=r[0],s=r[1],u=new a(function(e,t,n){return 3*(t+n)/4-n}(0,o,s)),l=0,f=s>0?o-4:o;for(n=0;n<f;n+=4)t=i[e.charCodeAt(n)]<<18|i[e.charCodeAt(n+1)]<<12|i[e.charCodeAt(n+2)]<<6|i[e.charCodeAt(n+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(l(e,o,o+16383>s?s:o+16383));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s<u;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(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 l(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t,n){"use strict";
17
17
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */t.read=function(e,t,n,r,i){var a,o,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,p=n?-1:1,d=e[t+f];for(f+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=r;l>0;o=256*o+e[t+f],f+=p,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=c}return(d?-1:1)*o*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,h=r?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?p/u:p*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&s,d+=h,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[n+d]=255&o,d+=h,o/=256,c-=8);e[n+d-h]|=128*v}},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(23).Buffer;t.BufferList=function(){function e(){r(this,e),this.head=null,this.tail=null,this.length=0}return i(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,n,r,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,n=i,r=s,t.copy(n,r),s+=o.data.length,o=o.next;return i}}]),e}()},function(e,t,n){"use strict";e.exports=i;var r=n(91);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}Object.create(n(39)).inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(23);function f(e,t){return e<<t|e>>>32-t}function p(e,t,n,r,i,a,o){return f(e+(t&n|~t&r)+i+a|0,o)+t|0}function d(e,t,n,r,i,a,o){return f(e+(t&r|n&~r)+i+a|0,o)+t|0}function h(e,t,n,r,i,a,o){return f(e+(t^n^r)+i+a|0,o)+t|0}function v(e,t,n,r,i,a,o){return f(e+(n^(t|~r))+i+a|0,o)+t|0}var m=function(e){a(n,e);var t=u(n);function n(){var e;return r(this,n),(e=t.call(this,64,56,"le"))._a=1732584193,e._b=4023233417,e._c=2562383102,e._d=271733878,e._m=new Array(16),e}return i(n,[{key:"_update",value:function(e){for(var t=this._m,n=0;n<16;++n)t[n]=e.readInt32LE(4*n);var r=this._a,i=this._b,a=this._c,o=this._d;r=p(r,i,a,o,t[0],3614090360,7),o=p(o,r,i,a,t[1],3905402710,12),a=p(a,o,r,i,t[2],606105819,17),i=p(i,a,o,r,t[3],3250441966,22),r=p(r,i,a,o,t[4],4118548399,7),o=p(o,r,i,a,t[5],1200080426,12),a=p(a,o,r,i,t[6],2821735955,17),i=p(i,a,o,r,t[7],4249261313,22),r=p(r,i,a,o,t[8],1770035416,7),o=p(o,r,i,a,t[9],2336552879,12),a=p(a,o,r,i,t[10],4294925233,17),i=p(i,a,o,r,t[11],2304563134,22),r=p(r,i,a,o,t[12],1804603682,7),o=p(o,r,i,a,t[13],4254626195,12),a=p(a,o,r,i,t[14],2792965006,17),r=d(r,i=p(i,a,o,r,t[15],1236535329,22),a,o,t[1],4129170786,5),o=d(o,r,i,a,t[6],3225465664,9),a=d(a,o,r,i,t[11],643717713,14),i=d(i,a,o,r,t[0],3921069994,20),r=d(r,i,a,o,t[5],3593408605,5),o=d(o,r,i,a,t[10],38016083,9),a=d(a,o,r,i,t[15],3634488961,14),i=d(i,a,o,r,t[4],3889429448,20),r=d(r,i,a,o,t[9],568446438,5),o=d(o,r,i,a,t[14],3275163606,9),a=d(a,o,r,i,t[3],4107603335,14),i=d(i,a,o,r,t[8],1163531501,20),r=d(r,i,a,o,t[13],2850285829,5),o=d(o,r,i,a,t[2],4243563512,9),a=d(a,o,r,i,t[7],1735328473,14),r=h(r,i=d(i,a,o,r,t[12],2368359562,20),a,o,t[5],4294588738,4),o=h(o,r,i,a,t[8],2272392833,11),a=h(a,o,r,i,t[11],1839030562,16),i=h(i,a,o,r,t[14],4259657740,23),r=h(r,i,a,o,t[1],2763975236,4),o=h(o,r,i,a,t[4],1272893353,11),a=h(a,o,r,i,t[7],4139469664,16),i=h(i,a,o,r,t[10],3200236656,23),r=h(r,i,a,o,t[13],681279174,4),o=h(o,r,i,a,t[0],3936430074,11),a=h(a,o,r,i,t[3],3572445317,16),i=h(i,a,o,r,t[6],76029189,23),r=h(r,i,a,o,t[9],3654602809,4),o=h(o,r,i,a,t[12],3873151461,11),a=h(a,o,r,i,t[15],530742520,16),r=v(r,i=h(i,a,o,r,t[2],3299628645,23),a,o,t[0],4096336452,6),o=v(o,r,i,a,t[7],1126891415,10),a=v(a,o,r,i,t[14],2878612391,15),i=v(i,a,o,r,t[5],4237533241,21),r=v(r,i,a,o,t[12],1700485571,6),o=v(o,r,i,a,t[3],2399980690,10),a=v(a,o,r,i,t[10],4293915773,15),i=v(i,a,o,r,t[1],2240044497,21),r=v(r,i,a,o,t[8],1873313359,6),o=v(o,r,i,a,t[15],4264355552,10),a=v(a,o,r,i,t[6],2734768916,15),i=v(i,a,o,r,t[13],1309151649,21),r=v(r,i,a,o,t[4],4149444226,6),o=v(o,r,i,a,t[11],3174756917,10),a=v(a,o,r,i,t[2],718787259,15),i=v(i,a,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+a|0,this._d=this._d+o|0}},{key:"_hash",value:function(){var e=l.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}}]),n}((0,c.__importDefault)(n(38)).default);t.default=m},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(23),f=(0,c.__importDefault)(n(38)),p=[1518500249,1859775393,-1894007588,-899497514];function d(e){return e<<5|e>>>27}function h(e){return e<<30|e>>>2}function v(e,t,n,r){return 0===e?t&n|~t&r:2===e?t&n|t&r|n&r:t^n^r}var m=function(e){a(n,e);var t=u(n);function n(){var e;return r(this,n),(e=t.call(this,64,56))._a=1732584193,e._b=4023233417,e._c=2562383102,e._d=271733878,e._e=3285377520,e._w=new Array(80),e}return i(n,[{key:"_update",value:function(e){var t,n,r=this._w,i=0|this._a,a=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e;for(t=0;t<16;++t)r[t]=e.readInt32BE(4*t);for(;t<80;++t)r[t]=(n=r[t-3]^r[t-8]^r[t-14]^r[t-16])<<1|n>>>31;for(var c=0;c<80;++c){var l=~~(c/20),f=d(i)+v(l,a,o,s)+u+r[c]+p[l]|0;u=s,s=o,o=h(a),a=i,i=f}this._a=i+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0}},{key:"_hash",value:function(){var e=l.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}}]),n}(f.default);t.default=m},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(23),f=(0,c.__importDefault)(n(38)),p=[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 d(e,t,n){return n^e&(t^n)}function h(e,t,n){return e&t|n&(e|t)}function v(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function m(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function g(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}var y=function(e){a(n,e);var t=u(n);function n(){var e;return r(this,n),(e=t.call(this,64,56))._a=1779033703,e._b=3144134277,e._c=1013904242,e._d=2773480762,e._e=1359893119,e._f=2600822924,e._g=528734635,e._h=1541459225,e._w=new Array(64),e}return i(n,[{key:"_update",value:function(e){var t,n,r=this._w,i=0|this._a,a=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,c=0|this._f,l=0|this._g,f=0|this._h;for(t=0;t<16;++t)r[t]=e.readInt32BE(4*t);for(;t<64;++t)r[t]=0|(((n=r[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10)+r[t-7]+g(r[t-15])+r[t-16];for(var y=0;y<64;++y){var b=f+m(u)+d(u,c,l)+p[y]+r[y]|0,_=v(i)+h(i,a,o)|0;f=l,l=c,c=u,u=s+b|0,s=o,o=a,a=i,i=b+_|0}this._a=i+this._a|0,this._b=a+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=c+this._f|0,this._g=l+this._g|0,this._h=f+this._h|0}},{key:"_hash",value:function(){var e=l.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}}]),n}(f.default);t.default=y},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(23),f=(0,c.__importDefault)(n(38)),p=[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 d(e,t,n){return n^e&(t^n)}function h(e,t,n){return e&t|n&(e|t)}function v(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function m(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function g(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function y(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function _(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function S(e,t){return e>>>0<t>>>0?1:0}var w=function(e){a(n,e);var t=u(n);function n(){var e;return r(this,n),(e=t.call(this,128,112))._ah=1779033703,e._bh=3144134277,e._ch=1013904242,e._dh=2773480762,e._eh=1359893119,e._fh=2600822924,e._gh=528734635,e._hh=1541459225,e._al=4089235720,e._bl=2227873595,e._cl=4271175723,e._dl=1595750129,e._el=2917565137,e._fl=725511199,e._gl=4215389547,e._hl=327033209,e._w=new Array(160),e}return i(n,[{key:"_update",value:function(e){var t,n,r=this._w,i=0|this._ah,a=0|this._bh,o=0|this._ch,s=0|this._dh,u=0|this._eh,c=0|this._fh,l=0|this._gh,f=0|this._hh,w=0|this._al,x=0|this._bl,k=0|this._cl,O=0|this._dl,T=0|this._el,A=0|this._fl,I=0|this._gl,E=0|this._hl,N=0;for(N=0;N<32;N+=2)r[N]=e.readInt32BE(4*N),r[N+1]=e.readInt32BE(4*N+4);for(;N<160;N+=2){var R=r[N-30],j=r[N-30+1],C=g(R,j),P=y(j,R),M=b(R=r[N-4],j=r[N-4+1]),D=_(j,R),L=r[N-14],B=r[N-14+1],F=r[N-32],q=r[N-32+1];t=(t=(t=C+L+S(n=P+B|0,P)|0)+M+S(n=n+D|0,D)|0)+F+S(n=n+q|0,q)|0,r[N]=t,r[N+1]=n}for(var U=0;U<160;U+=2){t=r[U],n=r[U+1];var z=h(i,a,o),J=h(w,x,k),G=v(i,w),H=v(w,i),V=m(u,T),W=m(T,u),Q=p[U],K=p[U+1],Y=d(u,c,l),X=d(T,A,I),$=E+W|0,Z=f+V+S($,E)|0;Z=(Z=(Z=Z+Y+S($=$+X|0,X)|0)+Q+S($=$+K|0,K)|0)+t+S($=$+n|0,n)|0;var ee=H+J|0,te=G+z+S(ee,H)|0;f=l,E=I,l=c,I=A,c=u,A=T,u=s+Z+S(T=O+$|0,O)|0,s=o,O=k,o=a,k=x,a=i,x=w,i=Z+te+S(w=$+ee|0,$)|0}this._al=this._al+w|0,this._bl=this._bl+x|0,this._cl=this._cl+k|0,this._dl=this._dl+O|0,this._el=this._el+T|0,this._fl=this._fl+A|0,this._gl=this._gl+I|0,this._hl=this._hl+E|0,this._ah=this._ah+i+S(this._al,w)|0,this._bh=this._bh+a+S(this._bl,x)|0,this._ch=this._ch+o+S(this._cl,k)|0,this._dh=this._dh+s+S(this._dl,O)|0,this._eh=this._eh+u+S(this._el,T)|0,this._fh=this._fh+c+S(this._fl,A)|0,this._gh=this._gh+l+S(this._gl,I)|0,this._hh=this._hh+f+S(this._hl,E)|0}},{key:"_hash",value:function(){var e=l.Buffer.allocUnsafe(64);function t(t,n,r){e.writeInt32BE(t,r),e.writeInt32BE(n,r+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}}]),n}(f.default);t.default=w},function(e,t,n){"use strict";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(23),f=n(58),p=(0,c.__importDefault)(n(86)),d=l.Buffer.alloc(128),h=function(e){a(n,e);var t=u(n);function n(e,i){var a;r(this,n),a=t.call(this),"string"==typeof i&&(i=l.Buffer.from(i));var o="sha512"===e?128:64;a._alg=e,i.length>o?i=(0,p.default)(e).update(i).digest():i.length<o&&(i=l.Buffer.concat([i,d],o)),a._ipad=l.Buffer.alloc(o),a._opad=l.Buffer.alloc(o);for(var s=0;s<o;s++)a._ipad[s]=54^i[s],a._opad[s]=92^i[s];return a._hash=(0,p.default)(e).update(a._ipad),a}return i(n,[{key:"_transform",value:function(e,t,n){var r;try{this.update(e,t)}catch(e){r=e}finally{n(r)}}},{key:"_flush",value:function(e){var t;try{this.push(this._final())}catch(e){t=e}e(t)}},{key:"_final",value:function(){var e=this._hash.digest();return(0,p.default)(this._alg).update(this._opad).update(e).digest()}},{key:"update",value:function(e,t){return this._hash.update(e,t),this}},{key:"digest",value:function(e){var t=this._final()||l.Buffer.alloc(0);return e?t.toString(e):t}}]),n}(f.Transform);t.default=h},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;var r=n(2),i=n(57);t.JIDAttribute=i.attribute,t.childJIDAttribute=i.childAttribute,t.childJID=i.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:r.NS_CLIENT}},t.extendPresence=function(e){return{element:"presence",fields:e,namespace:r.NS_CLIENT}},t.extendIQ=function(e){return{element:"iq",fields:e,namespace:r.NS_CLIENT}},t.extendStreamFeatures=function(e){return{element:"features",fields:e,namespace:r.NS_STREAM}},t.extendStanzaError=function(e){return{element:"error",fields:e,namespace:r.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";var r=n(6),i=n(7),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=n(15),l=n(21),f=(0,c.__importDefault)(n(40)),p=(0,c.__importDefault)(n(56)),d=(0,c.__importDefault)(n(59)),h=function(e){a(n,e);var t=u(n);function n(e){var i;return r(this,n),(i=t.call(this,{objectMode:!0})).closedStream=!1,i.wrappedStream=!1,i.registry=e.registry,i.acceptLanguages=e.acceptLanguages||[],e.wrappedStream&&(i.wrappedStream=!0,i.rootImportKey=e.rootKey),i.parser=new d.default({allowComments:e.allowComments}),i.parser.on("error",(function(e){i.destroy(e)})),i.parser.on("startElement",(function(e,t){if(!i.destroyed){if(i.closedStream)return i.destroy(p.default.alreadyClosed());var n=new f.default(e,t),r=i.registry.getImportKey(n);if(i.wrappedStream&&!i.rootElement){if(i.rootImportKey&&r!==i.rootImportKey)return i.destroy(p.default.unknownRoot());var a=i.registry.import(n,{acceptLanguages:i.acceptLanguages,lang:i.lang});return a?(i.rootElement=n,void i.push({event:"stream-start",kind:r,stanza:a,xml:n})):i.destroy(p.default.notWellFormed())}i.currentElement?i.currentElement=i.currentElement.appendChild(n):i.currentElement=n}})),i.parser.on("endElement",(function(e){if(!i.destroyed){if(i.wrappedStream&&!i.currentElement)return i.rootElement&&e===i.rootElement.name?(i.closedStream=!0,i.push({event:"stream-end",kind:i.rootImportKey,stanza:{},xml:i.rootElement}),i.end()):(i.closedStream=!0,i.destroy(p.default.notWellFormed()));if(!i.currentElement||e!==i.currentElement.name)return i.closedStream=!0,i.destroy(p.default.notWellFormed());if(i.currentElement.parent)i.currentElement=i.currentElement.parent;else{i.wrappedStream&&(i.currentElement.parent=i.rootElement);var t=i.registry.getImportKey(i.currentElement),n=i.registry.import(i.currentElement,{acceptLanguages:i.acceptLanguages,lang:i.lang});n&&i.push({kind:t,stanza:n,xml:i.currentElement}),i.currentElement=void 0}}})),i.parser.on("text",(function(e){i.currentElement&&i.currentElement.children.push(e)})),i}return i(n,[{key:"_transform",value:function(e,t,n){this.parser.write(e.toString()),n()}}]),n}(l.Transform);t.default=h},function(e,t,n){"use strict";var r=n(11),i=n(4);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){return"getStats"===e.name}function u(e){var t={};return Object.assign(t,c(e.tracks,"localTrack")),delete e.tracks,Object.assign(t,c(e.remoteTracks,"remoteTrack")),delete e.remoteTracks,t}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n={};if(Array.isArray(e))for(var i=0;i<e.length;i++)Object.assign(n,c(e[i],"".concat(t,"_[").concat(i,"]")));else"object"!==r(e)?n[t]=e:Object.keys(e).filter((function(e){return"ip"!==e.toLowerCase()})).forEach((function(i){var a=e[i],o=t?"".concat(t,"_").concat(i):i;"object"===r(a)||Array.isArray(a)?Object.assign(n,c(a,o)):n[o]=a}));return n}Object.defineProperty(t,"__esModule",{value:!0}),t.deepFlatten=t.formatStatsEvent=void 0,t.formatStatsEvent=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=o({_eventType:e.name,_eventTimestamp:(new Date).getTime()},t);s(e)&&Object.assign(n,u(e)),Object.assign(n,c(e)),delete n.name;var r={actionName:"WebrtcStats",details:n};return r},t.deepFlatten=c},function(e,t,n){var r=n(14);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(4),i=n(6),a=n(7),o=n(16),s=n(17),u=n(14);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var h=n(15),v=n(20),m=n(18),g=n(2),y=n(21),b=n(27),_=(0,h.__importDefault)(n(92)),S=(0,h.__importDefault)(n(94)),w=(0,h.__importDefault)(n(64));var x=function(e){o(n,e);var t=d(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i(this,n),r=r||{},(e=t.call(this)).selfID=r.selfID,e.sessions={},e.peers={},e.iceServers=r.iceServers||[],e.prepareSession=r.prepareSession||function(t){if(e.config.hasRTCPeerConnection)return t.applicationTypes.indexOf(g.NS_JINGLE_RTP_1)>=0?new S.default(t):t.applicationTypes.indexOf(g.NS_JINGLE_FILE_TRANSFER_5)>=0?new _.default(t):void 0},e.performTieBreak=r.performTieBreak||function(e,t){var n=(t.jingle.contents||[]).map((function(e){if(e.application)return e.application.applicationType}));return(e.pendingApplicationTypes||[]).filter((function(e){return n.includes(e)})).length>0},e.createPeerConnection=r.createPeerConnection||function(e,t){if(y.RTCPeerConnection)return new y.RTCPeerConnection(t)},e.config=p({debug:!1,hasRTCPeerConnection:!!y.RTCPeerConnection,peerConnectionConfig:{bundlePolicy:r.bundlePolicy||"balanced",iceTransportPolicy:r.iceTransportPolicy||"all",rtcpMuxPolicy:r.rtcpMuxPolicy||"require",sdpSemantics:r.sdpSemantics},peerConnectionConstraints:{optional:[{DtlsSrtpKeyAgreement:!0},{RtpDataChannels:!1}]}},r),e}return a(n,[{key:"addICEServer",value:function(e){if("string"!=typeof e)if((t=e).type||!t.urls&&!t.url){var t,n=e.host||"";n.indexOf(":")>=0&&(n="[".concat(n,"]"));var r="".concat(e.type,":").concat(n);e.port&&(r+=":".concat(e.port)),e.transport&&(r+="?transport=".concat(e.transport)),"turn"===e.type||"turns"===e.type?this.iceServers.push({credential:e.password,urls:[r],username:e.username}):"stun"!==e.type&&"stuns"!==e.type||this.iceServers.push({urls:[r]})}else this.iceServers.push(e);else this.iceServers.push({urls:e})}},{key:"resetICEServers",value:function(){this.iceServers=[]}},{key:"addSession",value:function(e){e.parent=this;var 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}},{key:"forgetSession",value:function(e){var t=this.peers[e.peerID]||[];t.length&&t.splice(t.indexOf(e),1),delete this.sessions[e.sid]}},{key:"createMediaSession",value:function(e,t,n){var r=new S.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(r),r}},{key:"createFileTransferSession",value:function(e,t){var n=new _.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}},{key:"endPeerSessions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.peers[e]||[];delete this.peers[e];var i,a=c(r);try{for(a.s();!(i=a.n()).done;){var o=i.value;o.end(t||"gone",n)}}catch(e){a.e(e)}finally{a.f()}}},{key:"endAllSessions",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,r=Object.keys(this.peers);n<r.length;n++){var i=r[n];this.endPeerSessions(i,e,t)}}},{key:"process",value:function(e){var t=this,n=e.jingle?e.jingle.sid:void 0,r=n?this.sessions[n]:void 0,i=e.id,a=e.from;if(a){if("error"===e.type){if(this._log("error","Received error response",e),r&&e.error&&"unknown-session"===e.error.jingleError)return r.end("gone",!0);var o=e.error&&"tie-break"===e.error.jingleError;return r&&"pending"===r.state&&o?r.end("alternative-session",!0):void(r&&(r.pendingAction=void 0))}if("result"!==e.type){var s=e.jingle.action,u=e.jingle.contents||[],c=u.map((function(e){return e.application?e.application.applicationType:void 0})),l=u.map((function(e){return e.transport?e.transport.transportType:void 0}));if(s!==m.JingleAction.SessionInitiate){if(!r)return"session-terminate"===s?void this.emit("send",{id:i,to:a,type:"result"}):(this._log("error","Unknown session",n),this._sendError(a,i,{condition:"item-not-found",jingleError:"unknown-session"}));if(r.peerID!==a||"ended"===r.state)return this._log("error","Session has ended, or action has wrong sender"),this._sendError(a,i,{condition:"item-not-found",jingleError:"unknown-session"});if("session-accept"===s&&"pending"!==r.state)return this._log("error","Tried to accept session twice",n),this._sendError(a,i,{condition:"unexpected-request",jingleError:"out-of-order"});if("session-terminate"!==s&&s===r.pendingAction&&(this._log("error","Tie break during pending request"),r.isInitiator))return this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}else if(r){if(r.peerID!==a)return this._log("error","Duplicate sid from new sender"),this._sendError(a,i,{condition:"service-unavailable"});if("pending"!==r.state)return this._log("error","Someone is doing this wrong"),this._sendError(a,i,{condition:"unexpected-request",jingleError:"out-of-order"});if(this.selfID&&this.selfID>r.peerID&&this.performTieBreak(r,e))return this._log("error","Tie break new session because of duplicate sids"),this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}else if(this.peers[a]&&this.peers[a].length)for(var f=0,p=this.peers[a].length;f<p;f++){var d=this.peers[a][f];if(d&&"pending"===d.state&&n&&(0,b.octetCompare)(d.sid,n)>0&&this.performTieBreak(d,e))return this._log("info","Tie break session-initiate"),this._sendError(a,i,{condition:"conflict",jingleError:"tie-break"})}if("session-initiate"===s){if(!u.length)return this._sendError(a,i,{condition:"bad-request"});r=this._createIncomingSession({applicationTypes:c,config:this.config.peerConnectionConfig,constraints:this.config.peerConnectionConstraints,iceServers:this.iceServers,initiator:!1,parent:this,peerID:a,sid:n,transportTypes:l},e)}r.process(s,e.jingle,(function(n){n?(t._log("error","Could not process request",e,n),t._sendError(a,i,n)):(t.emit("send",{id:i,to:a,type:"result"}),"session-initiate"===s&&t.emit("incoming",r))}))}else r&&(r.pendingAction=void 0)}}},{key:"signal",value:function(e,t){var n=t.jingle&&t.jingle.action;e.isInitiator&&n===m.JingleAction.SessionInitiate&&this.emit("outgoing",e),this.emit("send",t)}},{key:"_createIncomingSession",value:function(e,t){var n;return this.prepareSession&&(n=this.prepareSession(e,t)),n||(n=new w.default(e)),this.addSession(n),n}},{key:"_sendError",value:function(e,t,n){n.type||(n.type="cancel"),this.emit("send",{error:n,id:t,to:e,type:"error"})}},{key:"_log",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];this.emit.apply(this,["log",e,t].concat(r)),this.emit.apply(this,["log:"+e,t].concat(r))}}]),n}(v.EventEmitter);t.default=x},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(7);Object.defineProperty(t,"__esModule",{value:!0}),t.Ping=void 0;var s=function(){function e(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a(this,e),this.client=t,this.stanzaInstance=n,this.options=r,this.pingInterval=r.pingInterval||14e3,this.failedPingsBeforeDisconnect=r.failedPingsBeforeDisconnect||1,this.numberOfFailedPings=0,this.nextPingTimeoutId=void 0,this.start()}var t;return o(e,[{key:"start",value:function(){this.nextPingTimeoutId||(this.nextPingTimeoutId=-1,this.queueNextPing())}},{key:"stop",value:function(){clearTimeout(this.nextPingTimeoutId),this.nextPingTimeoutId=void 0,this.numberOfFailedPings=0}},{key:"performPing",value:(t=i(r.mark((function e(){var t,n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.stanzaInstance.ping(this.options.jid);case 3:this.numberOfFailedPings=0,this.queueNextPing(),e.next=12;break;case 7:e.prev=7,e.t0=e.catch(0),n={channelId:this.client.config.channelId,jid:this.stanzaInstance.jid,stanzaInstanceId:this.stanzaInstance.id},this.client.logger.warn("Missed a ping.",Object.assign({error:e.t0},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===(t=this.stanzaInstance.transport)||void 0===t||t.disconnect(!1)):this.queueNextPing();case 12:case"end":return e.stop()}}),e,this,[[0,7]])}))),function(){return t.apply(this,arguments)})},{key:"queueNextPing",value:function(){this.nextPingTimeoutId&&(this.nextPingTimeoutId=setTimeout(this.performPing.bind(this),this.pingInterval))}}]),e}();t.Ping=s},function(e,t,n){"use strict";var r=n(6),i=n(7);Object.defineProperty(t,"__esModule",{value:!0}),t.ServerMonitor=void 0;var a=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r(this,e),this.client=t,this.stanzaInstance=n,this.stanzaTimeout=i.stanzaTimeout||35e3,this.timeoutId=void 0,this.start()}return i(e,[{key:"start",value:function(){this.boundSetupStanzaTimeout=this.setupStanzaTimeout.bind(this),this.client.on("connected",this.boundSetupStanzaTimeout),this.stanzaInstance.on("raw:incoming",this.boundSetupStanzaTimeout)}},{key:"stop",value:function(){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)}},{key:"setupStanzaTimeout",value:function(){var e=this;clearTimeout(this.timeoutId),this.timeoutId=setTimeout((function(){var t,n={channelId:e.client.config.channelId,jid:e.stanzaInstance.jid,stanzaInstanceId:e.stanzaInstance.id,timeout:e.stanzaTimeout};e.client.logger.error("Time between XMPP stanzas exceeded timeout, disconnecting",n),e.stanzaInstance.sendStreamError({text:"time between stanzas exceeded timeout",condition:"connection-timeout"}),e.stop(),null===(t=e.stanzaInstance.transport)||void 0===t||t.disconnect(!1)}),this.stanzaTimeout)}}]),e}();t.ServerMonitor=a},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(7);Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectionManager=void 0;var s=n(36),u=n(262),c=n(34),l=s.__importDefault(n(199)),f=n(26),p=function(){function e(t,n){a(this,e),this.logger=t,this.config=n}var t;return o(e,[{key:"setConfig",value:function(e){this.config=e}},{key:"getNewStanzaConnection",value:(t=i(r.mark((function e(){var t,n,i,a,o,s,l,p,d=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getStanzaOptions(),(n=u.createClient({})).sasl.mechanisms.find((function(e){return"ANONYMOUS"===e.name})).priority=0,n.sasl.mechanisms=n.sasl.mechanisms.sort((function(e,t){return t.priority-e.priority})),n.id=c.v4(),i=n.channelId=this.config.channelId,(p=f.timeoutPromise((function(e,r){a=d.checkForErrorStanza.bind(d,n),n.on("raw:incoming",a),o=d.handleSessionStarted.bind(d,n,e),n.on("session:started",o),s=d.handleSessionSasl.bind(d,n,r),n.on("sasl",s),l=d.handleSessionDisconnected.bind(d,n,r),n.on("disconnected",l),n.updateConfig(t),n.connect()}),15e3,"connecting to streaming service",{channelId:i,stanzaInstanceId:n.id})).catch((function(){return n.disconnect()})),e.abrupt("return",p.finally((function(){n.off("raw:incoming",a),n.off("session:started",o),n.off("sasl",s),n.off("disconnected",l)})));case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"handleSessionStarted",value:function(e,t){this.logger.info("new stanza instance connected",{stanzaInstanceId:e.id,channelId:e.channelId}),t(e)}},{key:"handleSessionSasl",value:function(e,t,n){"failure"===n.type&&t(new l.default(n.condition,e.channelId,e.id))}},{key:"handleSessionDisconnected",value:function(e,t){this.logger.error("stanza disconnected",{stanzaInstanceId:e.id,channelId:e.channelId}),t()}},{key:"checkForErrorStanza",value:function(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})}},{key:"getStanzaOptions",value:function(){return this.config.jwt?this.getJwtOptions():this.getStandardOptions()}},{key:"getJwtOptions",value:function(){var e,t=this.config,n=f.parseJwt(t.jwt).data.jid;try{e=n.split("@")[1].replace("conference.","")}catch(e){throw new Error("failed to parse jid")}var r=t.host.replace(/\/$/,"");return{resource:t.jidResource,transports:{websocket:"".concat(r,"/stream/jwt/").concat(t.jwt)},server:e}}},{key:"getStandardOptions",value:function(){var e=this.config,t=e.host.replace(/\/$/,"");return{jid:e.jid,resource:e.jidResource,credentials:{username:e.jid,password:"authKey:".concat(e.authToken)},transports:{websocket:"".concat(t,"/stream/channels/").concat(e.channelId)}}}}]),e}();t.ConnectionManager=p},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;var r=n(15),i=(0,r.__importDefault)(n(263));t.Client=i.default;var a=(0,r.__importStar)(n(18));t.Constants=a;var o=(0,r.__importStar)(n(269));t.RTT=o;var s=(0,r.__importStar)(n(22));t.JID=s;var u=(0,r.__importStar)(n(61));t.Jingle=u;var c=(0,r.__importStar)(n(5));t.JXT=c;var l=(0,r.__importStar)(n(98));t.SASL=l;var f=(0,r.__importStar)(n(2));t.Namespaces=f;var p=(0,r.__importStar)(n(118));t.Stanzas=p;var d=(0,r.__importStar)(n(27));t.Utils=d;var h=(0,r.__importStar)(n(21));t.Platform=h,(0,r.__exportStar)(n(97),t);var v=(0,r.__importStar)(n(270));t.RSM=v;var m=(0,r.__importStar)(n(110));t.DataForms=m,t.VERSION=a.VERSION;var g=(0,r.__importDefault)(n(67));(0,r.__exportStar)(n(67),t),t.createClient=function(e){var t=new i.default(e);return t.use(g.default),t}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9),o=n(6),s=n(7),u=n(43),c=n(16),l=n(17),f=n(14);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var g=n(15),y=n(65),b=n(20),_=(0,g.__importDefault)(n(97)),S=(0,g.__importStar)(n(22)),w=(0,g.__importStar)(n(5)),x=(0,g.__importStar)(n(98)),k=n(67),O=(0,g.__importDefault)(n(118)),T=(0,g.__importDefault)(n(266)),A=(0,g.__importDefault)(n(267)),I=n(27),E=(0,g.__importDefault)(n(268)),N=function(e){c(h,e);var t,n,r,l,d=m(h);function h(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o(this,h),(e=d.call(this)).reconnectAttempts=0,e.setMaxListeners(100),e.off=e.removeListener,e.updateConfig(t),e.jid="",e.sasl=new x.Factory,e.sasl.register("EXTERNAL",x.EXTERNAL,1e3),e.sasl.register("SCRAM-SHA-256-PLUS",x.SCRAM,350),e.sasl.register("SCRAM-SHA-256",x.SCRAM,300),e.sasl.register("SCRAM-SHA-1-PLUS",x.SCRAM,250),e.sasl.register("SCRAM-SHA-1",x.SCRAM,200),e.sasl.register("DIGEST-MD5",x.DIGEST,100),e.sasl.register("OAUTHBEARER",x.OAUTH,100),e.sasl.register("X-OAUTH2",x.PLAIN,50),e.sasl.register("PLAIN",x.PLAIN,1),e.sasl.register("ANONYMOUS",x.ANONYMOUS,0),e.stanzas=new w.Registry,e.stanzas.define(O.default),e.resolver=new E.default,e.use(k.core),e.sm=new _.default,void 0!==e.config.allowResumption&&(e.sm.allowResume=e.config.allowResumption),e.sm.on("prebound",(function(t){e.jid=t,e.emit("session:bound",t)})),e.on("session:bound",(function(t){return e.sm.bind(t)})),e.sm.on("send",(function(t){return e.send("sm",t)})),e.sm.on("acked",(function(t){return e.emit("stanza:acked",t)})),e.sm.on("failed",(function(t){return e.emit("stanza:failed",t)})),e.sm.on("hibernated",(function(t){return e.emit("stanza:hibernated",t)})),e.sm.on("begin-resend",(function(){return e.outgoingDataQueue.pause()})),e.sm.on("resend",(function(t){var n=t.kind,r=t.stanza;return e.send(n,r,!0)})),e.sm.on("end-resend",(function(){return e.outgoingDataQueue.resume()}));for(var n=function(){var t=s[r];e.on("stanza:".concat(t),(function(n){"message"===n.kind&&e.emit("message:".concat(t),n.stanza)}))},r=0,s=["acked","hibernated","failed"];r<s.length;r++)n();e.transports={bosh:T.default,websocket:A.default},e.incomingDataQueue=(0,y.priorityQueue)(function(){var t=a(i.mark((function t(n,r){var a,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=n.kind,o=n.stanza,e.emit(a,o),o.id&&e.emit(a+":id:"+o.id,o),"message"!==a&&"presence"!==a&&"iq"!==a){t.next=9;break}return e.emit("stanza",o),t.next=7,e.sm.handle();case 7:t.next=15;break;case 9:if("sm"!==a){t.next=15;break}if("ack"!==o.type){t.next=14;break}return t.next=13,e.sm.process(o);case 13:e.emit("stream:management:ack",o);case 14:"request"===o.type&&e.sm.ack();case 15:r&&r();case 16:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),1);var u=function(t,n){["message","presence","iq"].includes(t)&&(e.sm.started&&e.sm.resumable?e.sm.resumable&&!e.transport&&e.emit("stanza:hibernated",{kind:t,stanza:n}):e.emit("stanza:failed",{kind:t,stanza:n}))};return e.outgoingDataQueue=(0,y.priorityQueue)(function(){var t=a(i.mark((function t(n,r){var a,o,s,c,l;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n.kind,s=n.stanza,c=n.replay,t.t0=c,t.t0){t.next=6;break}return t.next=5,e.sm.track(o,s);case 5:t.t0=t.sent;case 6:if(l=t.t0,"message"===o&&(c?e.emit("message:retry",s):e.emit("message:sent",s,!1)),!e.transport){t.next=21;break}return t.prev=9,t.next=12,e.transport.send(o,s);case 12:l&&(null===(a=e.transport)||void 0===a||a.send("sm",{type:"request"})),t.next=19;break;case 15:t.prev=15,t.t1=t.catch(9),console.error(t.t1),u(o,s);case 19:t.next=22;break;case 21:u(o,s);case 22:r&&r();case 23:case"end":return t.stop()}}),t,null,[[9,15]])})));return function(e,n){return t.apply(this,arguments)}}(),1),e.on("stream:data",(function(t,n){e.incomingDataQueue.push({kind:n,stanza:t},0)})),e.on("--transport-disconnected",a(i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],e.incomingDataQueue.idle()||n.push(e.incomingDataQueue.drain()),e.outgoingDataQueue.idle()||n.push(e.outgoingDataQueue.drain()),t.next=5,Promise.all(n);case 5:return t.next=7,e.sm.hibernate();case 7:e.transport&&delete e.transport,e.emit("--reset-stream-features"),!e.sessionTerminating&&e.config.autoReconnect&&(e.reconnectAttempts+=1,clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout((function(){e.connect()}),1e3*Math.min(Math.pow(2,e.reconnectAttempts)+Math.random(),e.config.maxReconnectBackoff||32))),e.emit("disconnected");case 11:case"end":return t.stop()}}),t)})))),e.on("iq",(function(t){var n=t.type,r=t.payloadType,i="iq:"+n+":"+r;if("get"===n||"set"===n){if("invalid-payload-count"===r)return e.sendIQError(t,{error:{condition:"bad-request",type:"modify"}});if("unknown-payload"===r||0===e.listenerCount(i))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});e.emit(i,t)}})),e.on("message",(function(t){var n=t.alternateLanguageBodies&&t.alternateLanguageBodies.length||t.links&&t.links.length,r=t.marker&&"markable"!==t.marker.type;n&&!r&&("chat"===t.type||"normal"===t.type?e.emit("chat",t):"groupchat"===t.type&&e.emit("groupchat",t)),"error"===t.type&&e.emit("message:error",t)})),e.on("presence",(function(t){var n=t.type||"available";"error"===n&&(n="presence:error"),e.emit(n,t)})),e.on("session:started",(function(){e.sessionStarting=!1,e.reconnectAttempts=0,e.reconnectTimer&&clearTimeout(e.reconnectTimer)})),e}return s(h,[{key:"updateConfig",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.config||{};this.config=v(v({allowResumption:!0,jid:"",transports:{bosh:!0,websocket:!0},useStreamManagement:!0,transportPreferenceOrder:["websocket","bosh"]},n),t),this.config.server||(this.config.server=S.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!==(e=this.config.transports)&&void 0!==e?e:{}))}},{key:"emit",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a,o=(t=u(f(h.prototype),"emit",this)).call.apply(t,[this,e].concat(r));"raw"===e?(u(f(h.prototype),"emit",this).call(this,"raw:".concat(r[0]),r[1]),u(f(h.prototype),"emit",this).call(this,"raw:*","raw:".concat(r[0]),r[1]),u(f(h.prototype),"emit",this).call(this,"*","raw:".concat(r[0]),r[1])):(a=u(f(h.prototype),"emit",this)).call.apply(a,[this,"*",e].concat(r));return o}},{key:"use",value:function(e){"function"==typeof e&&e(this,this.stanzas,this.config)}},{key:"nextId",value:function(){return(0,I.uuid)()}},{key:"getCredentials",value:(l=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getConfiguredCredentials());case 1:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"connect",value:(r=a(i.mark((function e(){var t,n,r,a,o,s,u,c,l,f,d,h;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.sessionTerminating=!1,this.sessionStarting=!0,this.emit("--reset-stream-features"),this.transport&&this.transport.disconnect(!1),a=null!==(t=this.config.transportPreferenceOrder)&&void 0!==t?t:[],s=p(a),e.prev=6,s.s();case 8:if((u=s.n()).done){e.next=49;break}if(c=u.value,(l=this.config.transports[c])&&this.transports[c]){e.next=13;break}return e.abrupt("continue",47);case 13:if(f={acceptLanguages:this.config.acceptLanguages||[null!==(n=this.config.lang)&&void 0!==n?n:"en"],jid:this.config.jid,lang:null!==(r=this.config.lang)&&void 0!==r?r:"en",server:this.config.server},d=new this.transports[c](this,this.sm,this.stanzas),"string"!=typeof l){e.next=19;break}f.url=l,e.next=44;break;case 19:if(1!=l){e.next=44;break}if(!d.discoverBindings){e.next=29;break}return e.next=23,d.discoverBindings(this.config.server);case 23:if(h=e.sent){e.next=26;break}return e.abrupt("continue",47);case 26:f=v(v({},f),h),e.next=44;break;case 29:if(o){e.next=40;break}return e.prev=30,e.next=33,this.discoverBindings(this.config.server);case 33:o=e.sent,e.next=40;break;case 36:return e.prev=36,e.t0=e.catch(30),console.error(e.t0),e.abrupt("continue",47);case 40:if(o[c]=(o[c]||[]).filter((function(e){return e.startsWith("wss:")||e.startsWith("https:")})),o[c]&&o[c].length){e.next=43;break}return e.abrupt("continue",47);case 43:f.url=o[c][0];case 44:return this.transport=d,this.transport.connect(f),e.abrupt("return");case 47:e.next=8;break;case 49:e.next=54;break;case 51:e.prev=51,e.t1=e.catch(6),s.e(e.t1);case 54:return e.prev=54,s.f(),e.finish(54);case 57:console.error("No endpoints found for the requested transports."),this.emit("--transport-disconnected");case 59:case"end":return e.stop()}}),e,this,[[6,51,54,57],[30,36]])}))),function(){return r.apply(this,arguments)})},{key:"disconnect",value:(n=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(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()){e.next=11;break}return e.next=11,this.outgoingDataQueue.drain();case 11:return e.next=13,this.sm.shutdown();case 13:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"send",value:(t=a(i.mark((function e(t,n){var r,a=this,o=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=o.length>2&&void 0!==o[2]&&o[2],e.abrupt("return",new Promise((function(e,i){a.outgoingDataQueue.push({kind:t,stanza:n,replay:r},r?0:1,(function(t){return t?i(t):e()}))})));case 2:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)})},{key:"sendMessage",value:function(e){var t=e.id||this.nextId(),n=v({id:t,originId:t},e);return this.send("message",n),n.id}},{key:"sendPresence",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=v({id:this.nextId()},e);return this.send("presence",t),t.id}},{key:"sendIQ",value:function(e){var t=this,n=v({id:this.nextId()},e),r=S.allowedResponders(this.jid,e.to),i="iq:id:"+n.id,a=new Promise((function(e,n){t.on(i,(function a(o){r.has(o.from)&&("result"!==o.type&&"error"!==o.type||(t.off(i,a),"result"===o.type?e(o):n(o)))}))}));this.send("iq",n);var o=this.config.timeout||15;return(0,I.timeoutPromise)(a,1e3*o,(function(){return v(v({},n),{},{to:void 0,from:void 0,error:{condition:"timeout",text:"Request timed out after ".concat(o," seconds.")},id:n.id,type:"error"})}))}},{key:"sendIQResult",value:function(e,t){this.send("iq",v(v({},t),{},{id:e.id,to:e.from,type:"result"}))}},{key:"sendIQError",value:function(e,t){this.send("iq",v(v({},t),{},{id:e.id,to:e.from,type:"error"}))}},{key:"sendStreamError",value:function(e){this.emit("stream:error",e),this.send("error",e),this.disconnect()}},{key:"_getConfiguredCredentials",value:function(){var e=this.config.credentials||{},t=S.parse(this.config.jid||""),n=e.username||t.local,r=e.host||t.domain;return v({host:r,password:this.config.password,realm:r,serviceName:r,serviceType:"xmpp",username:n},e)}},{key:"stream",get:function(){return this.transport?this.transport.stream:void 0}}]),h}(b.EventEmitter);t.default=N},function(e,t,n){"use strict";var r=n(12),i=n(6),a=n(7);function o(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(265)),c=function(){function e(){i(this,e),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("",[])}return a(e,[{key:"getNodeInfo",value:function(e){return{extensions:r(this.extensions.get(e)||[]),features:r(this.features.get(e)||[]),identities:r(this.identities.get(e)||[])}}},{key:"addFeature",value:function(e){var 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)}},{key:"addIdentity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.identities.has(t)||this.identities.set(t,[]),this.identities.get(t).push(e)}},{key:"addItem",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.items.has(t)||this.items.set(t,[]),this.items.get(t).push(e)}},{key:"addExtension",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.extensions.has(t)||this.extensions.set(t,[]),this.extensions.get(t).push(e)}},{key:"updateCaps",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.capsAlgorithms,i={extensions:r(this.extensions.get("")),features:r(this.features.get("")),identities:r(this.identities.get("")),type:"info"},a=o(n);try{for(a.s();!(t=a.n()).done;){var s=t.value,c=u.generate(i,s);if(c){this.caps.set(s,{algorithm:s,node:e,value:c});var l,f="".concat(e,"#").concat(c),p=o(i.features);try{for(p.s();!(l=p.n()).done;){var d=l.value;this.addFeature(d,f)}}catch(e){p.e(e)}finally{p.f()}var h,v=o(i.identities);try{for(v.s();!(h=v.n()).done;){var m=h.value;this.addIdentity(m,f)}}catch(e){v.e(e)}finally{v.f()}var g,y=o(i.extensions);try{for(y.s();!(g=y.n()).done;){var b=g.value;this.addExtension(b,f)}}catch(e){y.e(e)}finally{y.f()}this.identities.set(f,i.identities),this.features.set(f,new Set(i.features)),this.extensions.set(f,i.extensions)}else this.caps.delete(s)}}catch(e){a.e(e)}finally{a.f()}return r(this.caps.values())}},{key:"getCaps",value:function(){return r(this.caps.values())}}]),e}();t.default=c},function(e,t,n){"use strict";function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.verify=t.generate=void 0;var a=n(21),o=n(27);function s(e){return a.Buffer.from(e.replace(/</g,"&lt;"),"utf-8")}function u(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=r(t);try{for(i.s();!(e=i.n()).done;){var a=e.value;"FORM_TYPE"!==a.name&&(a.rawValues?n.push({name:s(a.name),values:a.rawValues.map((function(e){return s(e)})).sort(o.octetCompare)}):Array.isArray(a.value)?n.push({name:s(a.name),values:a.value.map((function(e){return s(e)})).sort(o.octetCompare)}):!0===a.value||!1===a.value?n.push({name:s(a.name),values:[s(a.value?"1":"0")]}):n.push({name:s(a.name),values:[s(a.value||"")]}))}}catch(e){i.e(e)}finally{i.f()}n.sort((function(e,t){return(0,o.octetCompare)(e.name,t.name)}));for(var u=[],c=0,l=n;c<l.length;c++){var f=l[c];u.push(f.name);var p,d=r(f.values);try{for(d.s();!(p=d.n()).done;){var h=p.value;u.push(h)}}catch(e){d.e(e)}finally{d.f()}}return u}function c(e,t){var n=[],i=a.Buffer.from("<","utf8"),c=function(e){n.push(e),n.push(i)},l=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var u=e.value,c=u.category,l=u.type,f=u.lang,p=u.name,d="".concat(c,"/").concat(l,"/").concat(f||"","/").concat(p||"");if(i.has(d))return null;i.add(d),n.push(s(d))}}catch(e){a.e(e)}finally{a.f()}return n.sort(o.octetCompare),n}(e.identities),f=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var u=e.value;if(i.has(u))return null;i.add(u),n.push(s(u))}}catch(e){a.e(e)}finally{a.f()}return n.sort(o.octetCompare),n}(e.features),p=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[],i=new Set,a=r(t);try{for(a.s();!(e=a.n()).done;){var c,l=e.value,f=void 0,p=r(l.fields||[]);try{for(p.s();!(c=p.n()).done;){var d=c.value;if("FORM_TYPE"===d.name&&"hidden"===d.type){if(d.rawValues&&1===d.rawValues.length){f=s(d.rawValues[0]);break}if(d.value&&"string"==typeof d.value){f=s(d.value);break}}}}catch(e){p.e(e)}finally{p.f()}if(f){if(i.has(f.toString()))return null;i.add(f.toString()),n.push({type:f,form:l})}}}catch(e){a.e(e)}finally{a.f()}n.sort((function(e,t){return(0,o.octetCompare)(e.type,t.type)}));for(var h=[],v=0,m=n;v<m.length;v++){var g=m[v];h.push(g.type);var y,b=u(g.form.fields),_=r(b);try{for(_.s();!(y=_.n()).done;){var S=y.value;h.push(S)}}catch(e){_.e(e)}finally{_.f()}}return h}(e.extensions);if(!l||!f||!p)return null;var d,h=r(l);try{for(h.s();!(d=h.n()).done;){c(d.value)}}catch(e){h.e(e)}finally{h.f()}var v,m=r(f);try{for(m.s();!(v=m.n()).done;){c(v.value)}}catch(e){m.e(e)}finally{m.f()}var g,y=r(p);try{for(y.s();!(g=y.n()).done;){c(g.value)}}catch(e){y.e(e)}finally{y.f()}return(0,a.createHash)(t).update(a.Buffer.concat(n)).digest("base64")}t.generate=c,t.verify=function(e,t,n){var r=c(e,t);return!!r&&r===n}},function(e,t,n){"use strict";var r=n(13),i=n(4),a=n(24),o=n(16),s=n(17),u=n(14),c=n(3),l=n(9),f=n(6),p=n(7);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return s(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var m=n(18),g=n(21),y=n(5),b=n(27),_=function(){function e(t){f(this,e),this.active=!1,this.maxRetries=5,this.stream=t,this.maxTimeout=1100*this.stream.maxWaitTime}var t;return p(e,[{key:"send",value:(t=l(c.mark((function e(t,n){var r,i,a,o;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.rid=t,this.active=!0,r=0;case 3:if(!(r<=this.maxRetries)){e.next=35;break}return r+=1,e.prev=5,e.next=8,(0,b.timeoutPromise)((0,g.fetch)(this.stream.url,{body:n,headers:{"Content-Type":this.stream.contentType},method:"POST"}),this.maxTimeout,(function(){return new Error("Request timed out")}));case 8:if((i=e.sent).ok){e.next=11;break}throw new Error("HTTP Status Error: "+i.status);case 11:return e.next=13,i.text();case 13:return a=e.sent,this.active=!1,e.abrupt("return",a);case 18:if(e.prev=18,e.t0=e.catch(5),1!==r){e.next=24;break}return e.abrupt("continue",3);case 24:if(!(r<this.maxRetries)){e.next=31;break}return o=Math.min(this.maxTimeout,1e3*Math.pow(r,2)),e.next=28,(0,b.sleep)(o+1e3*Math.random());case 28:return e.abrupt("continue",3);case 31:throw this.active=!1,e.t0;case 33:e.next=3;break;case 35:throw new Error("Request failed");case 36:case"end":return e.stop()}}),e,this,[[5,18]])}))),function(e,n){return t.apply(this,arguments)})}]),e}(),S=function(e){o(u,e);var t,n,i,s=v(u);function u(e,t,n){var r;return f(this,u),(r=s.call(this,{objectMode:!0})).rid=Math.floor(4294967295*Math.random()),r.sid="",r.maxHoldOpen=2,r.maxWaitTime=30,r.contentType="text/xml; charset=utf-8",r.channels=[new _(a(r)),new _(a(r))],r.activeChannelID=0,r.queue=[],r.isEnded=!1,r.client=e,r.sm=t,r.stanzas=n,r.on("data",(function(e){r.client.emit("stream:data",e.stanza,e.kind)})),r.on("end",(function(){r.isEnded=!0,clearTimeout(r.idleTimeout),r.client.transport===a(r)&&r.client.emit("--transport-disconnected")})),r}return p(u,[{key:"_write",value:function(e,t,n){this.queue.push([e,n]),this.scheduleRequests()}},{key:"_writev",value:function(e,t){this.queue.push([e.map((function(e){return e.chunk})).join(""),t]),this.scheduleRequests()}},{key:"_read",value:function(){}},{key:"process",value:function(e){var t=this,n=new y.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,rootKey:"bosh",wrappedStream:!0});n.on("error",(function(e){var n={condition:m.StreamErrorCondition.InvalidXML};return t.client.emit("stream:error",n,e),t.send("error",n),t.disconnect()})),n.on("data",(function(e){if("stream-start"===e.event)return t.stream=e.stanza,void("terminate"===e.stanza.type?(t.hasStream=!1,t.rid=void 0,t.sid=void 0,t.isEnded||(t.isEnded=!0,t.client.emit("bosh:terminate",e.stanza),t.client.emit("stream:end"),t.push(null))):t.hasStream||(t.hasStream=!0,t.stream=e.stanza,t.sid=e.stanza.sid||t.sid,t.maxWaitTime=e.stanza.maxWaitTime||t.maxWaitTime,t.client.emit("stream:start",e.stanza)));e.event||t.push({kind:e.kind,stanza:e.stanza})})),this.client.emit("raw","incoming",e),n.write(e),this.scheduleRequests()}},{key:"connect",value:function(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"})}},{key:"restart",value:function(){this.hasStream=!1,this._send({to:this.config.server,xmppRestart:!0})}},{key:"disconnect",value:function(){var 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"))}},{key:"send",value:(i=l(c.mark((function e(t,n){var r,i,a=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&(i=null===(r=this.stanzas.export(t,n))||void 0===r?void 0:r.toString()),i){e.next=3;break}return e.abrupt("return");case 3:return e.abrupt("return",new Promise((function(e,t){a.write(i,"utf8",(function(n){return n?t(n):e()}))})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"toggleChannel",value:function(){this.activeChannelID=0===this.activeChannelID?1:0}},{key:"_send",value:(n=l(c.mark((function e(t){var n,r,i,a,o=this,s=arguments;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"",!this.isEnded){e.next=3;break}return e.abrupt("return");case 3:r=this.rid++,i=this.stanzas.export("bosh",h(h({},t),{},{rid:r,sid:this.sid})),a=n?[i.openTag(),n,i.closeTag()].join(""):i.toString(),this.client.emit("raw","outgoing",a),this.sendingChannel.send(r,a).then((function(e){o.process(e)})).catch((function(e){o.end(e)})),this.toggleChannel();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"_poll",value:(t=l(c.mark((function e(){var t,n,r=this;return c.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isEnded){e.next=2;break}return e.abrupt("return");case 2:t=this.rid++,n=this.stanzas.export("bosh",{rid:t,sid:this.sid}).toString(),this.client.emit("raw","outgoing",n),this.pollingChannel.send(t,n).then((function(e){r.process(e)})).catch((function(e){r.end(e)}));case 6:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"scheduleRequests",value:function(){var e=this;clearTimeout(this.idleTimeout),this.idleTimeout=setTimeout((function(){e.fireRequests()}),10)}},{key:"fireRequests",value:function(){if(!this.isEnded)if(this.queue.length)if(this.sendingChannel.active)this.scheduleRequests();else{var e=this.queue.shift(),t=r(e,2),n=t[0],i=t[1];this._send({},n),i()}else!this.authenticated||this.channels[0].active||this.channels[1].active||this._poll()}},{key:"sendingChannel",get:function(){return this.channels[this.activeChannelID]}},{key:"pollingChannel",get:function(){return this.channels[0===this.activeChannelID?1:0]}}]),u}(g.Duplex);t.default=S},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(7),s=n(24),u=n(16),c=n(17),l=n(14);function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var p=n(18),d=n(5),h=n(21),v=function(e){u(c,e);var t,n=f(c);function c(e,t,r){var i;return a(this,c),(i=n.call(this,{objectMode:!0})).sm=t,i.stanzas=r,i.closing=!1,i.client=e,i.on("data",(function(e){i.client.emit("stream:data",e.stanza,e.kind)})),i.on("error",(function(){i.end()})),i.on("end",(function(){i.client.transport===s(i)&&i.client.emit("--transport-disconnected")})),i}return o(c,[{key:"_read",value:function(){}},{key:"_write",value:function(e,t,n){if(!this.socket||1!==this.socket.readyState)return n(new Error("Socket closed"));var r=h.Buffer.from(e,"utf8").toString();this.client.emit("raw","outgoing",r),this.socket.send(r),n()}},{key:"connect",value:function(e){var t=this;this.config=e,this.hasStream=!1,this.closing=!1,this.parser=new d.StreamParser({acceptLanguages:this.config.acceptLanguages,allowComments:!1,lang:this.config.lang,registry:this.stanzas,wrappedStream:!1}),this.parser.on("data",(function(e){var n=e.kind,r=e.stanza;if("stream"===n){if("open"===r.action)return t.hasStream=!0,t.stream=r,t.client.emit("stream:start",r);if("close"===r.action)return t.client.emit("stream:end"),t.disconnect()}t.push({kind:e.kind,stanza:e.stanza})})),this.parser.on("error",(function(e){var n={condition:p.StreamErrorCondition.InvalidXML};return t.client.emit("stream:error",n,e),t.write(t.stanzas.export("error",n).toString()),t.disconnect()})),this.socket=new h.WebSocket(e.url,"xmpp"),this.socket.onopen=function(){t.emit("connect"),t.sm.started=!1,t.client.emit("connected"),t.write(t.startHeader())},this.socket.onmessage=function(e){var n=h.Buffer.from(e.data,"utf8").toString();t.client.emit("raw","incoming",n),t.parser&&t.parser.write(n)},this.socket.onclose=function(){t.push(null)},this.socket.onerror=function(e){console.error(e),t.push(null)}}},{key:"disconnect",value:function(){var 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)}},{key:"send",value:(t=i(r.mark((function e(t,n){var i,a,o=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&(a=null===(i=this.stanzas.export(t,n))||void 0===i?void 0:i.toString()),a){e.next=3;break}return e.abrupt("return");case 3:return e.abrupt("return",new Promise((function(e,t){o.write(a,"utf8",(function(n){return n?t(n):e()}))})));case 4:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"restart",value:function(){this.hasStream=!1,this.write(this.startHeader())}},{key:"startHeader",value:function(){return this.stanzas.export("stream",{action:"open",lang:this.config.lang,to:this.config.server,version:"1.0"}).toString()}},{key:"closeHeader",value:function(){return this.stanzas.export("stream",{action:"close"}).toString()}}]),c}(h.Duplex);t.default=v},function(e,t,n){"use strict";var r=n(4),i=n(12),a=n(13),o=n(3),s=n(9),u=n(6),c=n(7);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0});var h=n(15),v=n(21),m=n(27),g=n(5),y=(0,h.__importDefault)(n(68)),b=function(){function e(){u(this,e),this.hostMetaCache=new Map,this.hostMetaTTL=3e4,this.resolver=(0,v.createResolver)(),this.registry=new g.Registry,this.registry.define(y.default)}var t,n,r,l,d;return c(e,[{key:"getHostMeta",value:(d=s(o.mark((function e(t){var n,r,i=this;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this.hostMetaCache.get(t))){e.next=7;break}if(!(n.created+this.hostMetaTTL<Date.now())){e.next=6;break}return e.abrupt("return",n.hostmeta);case 6:this.hostMetaCache.delete(t);case 7:return r=(0,m.promiseAny)([(0,v.fetch)("https://".concat(t,"/.well-known/host-meta.json")).then(function(){var e=s(o.mark((function e(t){return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=2;break}throw new Error("could-not-fetch-json");case 2:return e.abrupt("return",t.json());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),(0,v.fetch)("https://".concat(t,"/.well-known/host-meta")).then(function(){var e=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.ok){e.next=2;break}throw new Error("could-not-fetch-xml");case 2:return e.next=4,t.text();case 4:if(n=e.sent,!(r=(0,g.parse)(n))){e.next=10;break}return e.abrupt("return",i.registry.import(r));case 10:throw new Error("could-not-import-xml");case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())]),this.hostMetaCache.set(t,{created:Date.now(),hostmeta:r}),r.catch((function(){i.hostMetaCache.delete(t)})),e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"resolveTXT",value:(l=s(o.mark((function e(t){var n,r;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null!==(r=null===(n=this.resolver)||void 0===n?void 0:n.resolveTxt(t))&&void 0!==r?r:[]);case 1:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"resolve",value:(r=s(o.mark((function e(t,n){var r,i,a,s,u=arguments;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>2&&void 0!==u[2]?u[2]:{},this.resolver){e.next=3;break}return e.abrupt("return",[]);case 3:if(i=[],a=!0,!r.srvType){e.next=11;break}return e.next=8,this.resolveWeightedSRV(t,r.srvType,r.srvTypeSecure);case 8:s=e.sent,a=s.allowFallback,i=s.records.map((function(e){return{host:e.name,port:e.port,secure:e.secure}}));case 11:return a&&i.push({host:t,port:n}),e.abrupt("return",i);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"resolveWeightedSRV",value:(n=s(o.mark((function e(t,n,r){var s,u,c,l,f,d,h,v,g,y,b,_,S,w,x,k;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this.resolveSRV(t,n),r?this.resolveSRV(t,r,!0):Promise.resolve({records:[],allowFallback:!1})]);case 2:s=e.sent,u=a(s,2),c=u[0],l=u[1],f=[].concat(i(c.records),i(l.records)),d=new Map,h=0,v=p(f);try{for(v.s();!(g=v.n()).done;)(y=g.value).id=h++,y.runningSum=0,d.has(y.priority)||d.set(y.priority,[]),d.get(y.priority).push(y)}catch(e){v.e(e)}finally{v.f()}b=function(e){for(var t=[];t.length<e.length;){var n,r=(0,m.shuffle)(e.filter((function(e){return 0===e.weight&&!e.used}))),i=0,a=p((0,m.shuffle)(e.filter((function(e){return 0!==e.weight&&!e.used}))));try{for(a.s();!(n=a.n()).done;){var o=n.value;i+=o.weight,o.runningSum=i,r.push(o)}}catch(e){a.e(e)}finally{a.f()}var s,u=Math.floor(Math.random()*(i+1)),c=p(r);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(l.runningSum>=u){l.used=!0,t.push(l);break}}}catch(e){c.e(e)}finally{c.f()}}return t},_=[],S=p(Array.from(d.keys()).sort((function(e,t){return e<t?-1:e>t?1:0})));try{for(S.s();!(w=S.n()).done;)x=w.value,k=d.get(x),_=_.concat(b(k))}catch(e){S.e(e)}finally{S.f()}return e.abrupt("return",{records:_,allowFallback:c.allowFallback});case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"resolveSRV",value:(t=s(o.mark((function e(t,n,r){var i,a,s;return o.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(i=this.resolver)||void 0===i?void 0:i.resolveSrv("".concat(n,".").concat(t));case 3:if(e.t1=a=e.sent,e.t0=null!==e.t1,!e.t0){e.next=7;break}e.t0=void 0!==a;case 7:if(!e.t0){e.next=11;break}e.t2=a,e.next=12;break;case 11:e.t2=[];case 12:if(1!==(s=e.t2).length||"."!==s[0].name&&""!==s[0].name){e.next=15;break}return e.abrupt("return",{records:[],allowFallback:!1});case 15:return e.abrupt("return",{records:s.map((function(e){return f({secure:r},e)})).filter((function(e){return""!==e.name&&"."!==e.name})),allowFallback:!1});case 18:return e.prev=18,e.t3=e.catch(0),e.abrupt("return",{records:[],allowFallback:!0});case 21:case"end":return e.stop()}}),e,this,[[0,18]])}))),function(e,n,r){return t.apply(this,arguments)})}]),e}();t.default=b},function(e,t,n){"use strict";var r=n(4),i=n(12),a=n(6),o=n(7);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.InputBuffer=t.DisplayBuffer=t.diff=void 0;var f=n(15),p=n(65),d=(0,f.__importDefault)(n(55));function h(e,t){var n=e.length,r=t.length,i=Math.min(n,r),a=0;for(a=0;a<i&&e[a]===t[a];a++);var o=0;for(o=0;o<i-a&&e[n-o-1]===t[r-o-1];o++);var s=a+o,u=[];if(s<n&&u.push({length:n-s,position:n-o,type:"erase"}),s<r){var c=t.slice(a,a+r-s);u.push({position:a,text:d.default.ucs2.encode(c),type:"insert"})}return u}t.diff=h;var v=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a(this,e),this.synced=!1,this.cursorPosition=0,this.ignoreWaits=!1,this.timeDeficit=0,this.sequenceNumber=0,this.onStateChange=t||function(){},this.ignoreWaits=n,this.buffer=[],this.resetActionQueue()}return o(e,[{key:"commit",value:function(){this.resetActionQueue()}},{key:"process",value:function(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){var t,n=Date.now(),r=0,i=c(e.actions);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.baseTime=n+r,"wait"===a.type&&(r+=a.duration),this.actionQueue.push(a,0)}}catch(e){i.e(e)}finally{i.f()}}this.sequenceNumber=this.sequenceNumber+1}else this.resetActionQueue()}},{key:"insert",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.buffer.length;t=t.normalize("NFC");var r=d.default.ucs2.decode(t);(e=this.buffer).splice.apply(e,[n,0].concat(i(r))),this.cursorPosition=n+r.length,this.emitState()}},{key:"erase",value:function(){var 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()}},{key:"emitState",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.onStateChange(u({cursorPosition:this.cursorPosition,synced:this.synced,text:this.text},e))}},{key:"resetActionQueue",value:function(){var e=this;this.actionQueue&&this.actionQueue.kill(),this.sequenceNumber=0,this.synced=!0,this.buffer=[],this.timeDeficit=0,this.actionQueue=(0,p.priorityQueue)((function(t,n){var r=Date.now();if("insert"===t.type)return e.insert(t.text,t.position),n();if("erase"===t.type)return e.erase(t.length,t.position),n();if("wait"!==t.type)return n();if(e.ignoreWaits)return n();t.duration>700&&(t.duration=700);var i=t.duration-(r-t.baseTime)+e.timeDeficit;if(i<=0)return e.timeDeficit=i,n();e.timeDeficit=0,setTimeout((function(){return n()}),i)}),1),this.emitState()}},{key:"text",get:function(){return d.default.ucs2.encode(this.buffer.slice())}}]),e}();t.DisplayBuffer=v;var m=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a(this,e),this.resetInterval=1e4,this.ignoreWaits=!1,this.isStarting=!1,this.isReset=!1,this.changedBetweenResets=!1,this.onStateChange=t||function(){},this.ignoreWaits=n,this.buffer=[],this.actionQueue=[],this.sequenceNumber=0}return o(e,[{key:"update",value:function(e){var t=[];if(void 0!==e){e=e.normalize("NFC");var n=d.default.ucs2.decode(e);t=h(this.buffer,n.slice()),this.buffer=n,this.emitState()}var r=Date.now();if(this.changedBetweenResets&&r-this.lastResetTime>this.resetInterval)this.actionQueue=[],this.actionQueue.push({position:0,text:this.text,type:"insert"}),this.isReset=!0,this.lastActionTime=r,this.lastResetTime=r,this.changedBetweenResets=!1;else if(t.length){var i=r-(this.lastActionTime||r);i>0&&!this.ignoreWaits&&this.actionQueue.push({duration:i,type:"wait"});var a,o=c(t);try{for(o.s();!(a=o.n()).done;){var s=a.value;this.actionQueue.push(s)}}catch(e){o.e(e)}finally{o.f()}this.lastActionTime=r,this.changedBetweenResets=!0}else this.lastActionTime=r}},{key:"start",value:function(){var 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"}}},{key:"stop",value:function(){return this.commit(),{event:"cancel"}}},{key:"diff",value:function(){if(this.update(),!this.actionQueue.length)return null;var 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}},{key:"commit",value:function(){this.sequenceNumber=0,this.lastActionTime=0,this.actionQueue=[],this.buffer=[]}},{key:"emitState",value:function(){this.onStateChange({text:this.text})}},{key:"text",get:function(){return d.default.ucs2.encode(this.buffer.slice())}}]),e}();t.InputBuffer=m},function(e,t,n){"use strict";var r=n(9),i=n(3),a=n(6),o=n(7),s=n(35),u=n(72);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(t,"__esModule",{value:!0}),t.createPager=t.ResultSetPager=void 0;var f=function(){function e(t){var n,r,i;a(this,e),this.resultComplete=!1,this.fetchedCount=0,this.yieldedCount=0,this.cursor={first:t.before,last:t.after},this.query=t.query,this.direction=null!==(n=t.direction)&&void 0!==n?n:"forward",this.reverse=null!==(r=t.reverse)&&void 0!==r?r:"backward"===this.direction,this.pageSize=null!==(i=t.pageSize)&&void 0!==i?i:20}var t,n;return o(e,[{key:Symbol.asyncIterator,value:function(){var e=this;return u(i.mark((function t(){var n,r,a,o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[];case 1:return t.next=3,s(e.fetchPage());case 3:n=t.sent,r=c(n),t.prev=5,r.s();case 7:if((a=r.n()).done){t.next=14;break}return o=a.value,e.yieldedCount+=1,t.next=12,o;case 12:t.next=7;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(5),r.e(t.t0);case 19:return t.prev=19,r.f(),t.finish(19);case 22:if(n.length>0){t.next=1;break}case 23:case"end":return t.stop()}}),t,null,[[5,16,19,22]])})))()}},{key:"size",value:(n=r(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===this.resultCount){e.next=2;break}return e.abrupt("return",this.resultCount);case 2:return e.next=4,this.query({max:0});case 4:return t=e.sent,n=t.paging,this.resultCount=n.count,e.abrupt("return",n.count);case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"queryCompleted",value:function(){return this.resultComplete}},{key:"finished",value:function(){return this.resultComplete&&this.yieldedCount===this.fetchedCount}},{key:"fetchPage",value:(t=r(i.mark((function e(){var t,n,r,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.query({before:"backward"===this.direction?null!==(t=this.cursor.first)&&void 0!==t?t:"":void 0,after:"forward"===this.direction?this.cursor.last:void 0,max:this.pageSize});case 2:return n=e.sent,r=n.results,a=n.paging,this.cursor=a,this.resultCount=a.count,this.fetchedCount+=r.length,(this.pageSize&&r.length<this.pageSize||this.resultCount&&this.fetchedCount===this.resultCount)&&(this.resultComplete=!0),this.reverse&&r.reverse(),e.abrupt("return",r);case 11:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})}]),e}();t.ResultSetPager=f,t.createPager=function(e){return new f(e)}},function(e,t,n){"use strict";var r=n(6),i=n(16),a=n(17),o=n(14),s=n(28);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=o(e);if(t){var i=o(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return a(this,n)}}Object.defineProperty(t,"__esModule",{value:!0});var c=function(e){i(n,e);var t=u(n);function n(){return r(this,n),t.apply(this,arguments)}return n}(s(Error));t.default=c},function(e,t,n){"use strict";n.r(t),n.d(t,"Emitter",(function(){return l})),n.d(t,"MemoryLeakError",(function(){return c}));var r=n(7),i=n(6),a=n(16),o=n(17),s=n(14);function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}var c=function(e){a(n,e);var t=u(n);function n(e,r,a){var o;return i(this,n),(o=t.call(this,"Possible EventEmitter memory leak detected. ".concat(a," ").concat(r.toString()," listeners added. Use emitter.setMaxListeners() to increase limit"))).emitter=e,o.type=r,o.count=a,o.name="MaxListenersExceededWarning",o}return n}(n(28)(Error)),l=function(){function e(){i(this,e),this.events=new Map,this.maxListeners=e.defaultMaxListeners,this.hasWarnedAboutPotentialMemoryLeak=!1}return r(e,null,[{key:"listenerCount",value:function(e,t){return e.listenerCount(t)}}]),r(e,[{key:"_emitInternalEvent",value:function(e,t,n){this.emit.apply(this,[e].concat([t,n]))}},{key:"_getListeners",value:function(e){return this.events.get(e)||[]}},{key:"_removeListener",value:function(e,t){var n=e.indexOf(t);return n>-1&&e.splice(n,1),[]}},{key:"_wrapOnceListener",value:function(e,t){var n=this;return function r(){n.removeListener(e,r);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];t.apply(n,a)}}},{key:"setMaxListeners",value:function(e){return this.maxListeners=e,this}},{key:"getMaxListeners",value:function(){return this.maxListeners}},{key:"eventNames",value:function(){return Array.from(this.events.keys())}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=this._getListeners(e);return a.forEach((function(e){e.apply(t,r)})),a.length>0}},{key:"addListener",value:function(e,t){this._emitInternalEvent("newListener",e,t);var 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;var r=new c(this,e,this.listenerCount(e));console.warn(r)}return this}},{key:"on",value:function(e,t){return this.addListener(e,t)}},{key:"once",value:function(e,t){return this.addListener(e,this._wrapOnceListener(e,t))}},{key:"prependListener",value:function(e,t){var n=this._getListeners(e);if(n.length>0){var r=[t].concat(n);this.events.set(e,r)}else this.events.set(e,n.concat(t));return this}},{key:"prependOnceListener",value:function(e,t){return this.prependListener(e,this._wrapOnceListener(e,t))}},{key:"removeListener",value:function(e,t){var n=this._getListeners(e);return n.length>0&&(this._removeListener(n,t),this.events.set(e,n),this._emitInternalEvent("removeListener",e,t)),this}},{key:"off",value:function(e,t){return this.removeListener(e,t)}},{key:"removeAllListeners",value:function(e){return e?this.events.delete(e):this.events.clear(),this}},{key:"listeners",value:function(e){return Array.from(this._getListeners(e))}},{key:"listenerCount",value:function(e){return this._getListeners(e).length}},{key:"rawListeners",value:function(e){return this.listeners(e)}}]),e}();l.defaultMaxListeners=10},function(e,t,n){"use strict";n.r(t);var r=n(46),i=n.n(r),a=n(12),o=n.n(a),s=n(6),u=n.n(s),c=n(7),l=n.n(c),f=n(24),p=n.n(f),d=n(16),h=n.n(d),v=n(17),m=n.n(v),g=n(14),y=n.n(g),b=n(20),_=n(201),S=n(47),w=n.n(S),x=n(3),k=n.n(x),O=n(13),T=n.n(O),A=n(11),I=n.n(A),E=function(e){var t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},N=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(0===n)return null;if(t){if(Array.isArray(t)){for(var r=[],i=0;i<t.length;i++)r[i]=e(t[i],n-1);return r}if("object"===I()(t)){var a=Object.assign({},t);for(var o in t)try{a[o]=e(t[o],n-1)}catch(e){console.debug("WARN: Failed cloning key on object, ignoring",{key:o,object:t})}return a}}return t},R=n(19),j=n(71),C=n(48);function P(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 M(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function D(e){M(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===Object(C.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 L(e,t){M(2,arguments);var n=D(e),r=P(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function B(e,t){M(2,arguments);var n=D(e),r=P(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),a=new Date(n.getTime());a.setMonth(n.getMonth()+r+1,0);var o=a.getDate();return i>=o?a:(n.setFullYear(a.getFullYear(),a.getMonth(),i),n)}function F(e,t){if(M(2,arguments),!t||"object"!==Object(C.a)(t))return new Date(NaN);var n=t.years?P(t.years):0,r=t.months?P(t.months):0,i=t.weeks?P(t.weeks):0,a=t.days?P(t.days):0,o=t.hours?P(t.hours):0,s=t.minutes?P(t.minutes):0,u=t.seconds?P(t.seconds):0,c=D(e),l=r||n?B(c,r+12*n):c,f=a||i?L(l,a+7*i):l,p=s+60*o,d=u+60*p,h=1e3*d,v=new Date(f.getTime()+h);return v}function q(e,t){M(2,arguments);var n=D(e),r=D(t);return n.getTime()>r.getTime()}function U(e,t){return M(2,arguments),D(e).getTime()-D(t).getTime()}var z=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},J=[408,429,500,503,504],G=[401],H=new Map,V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;u()(this,e),this.url=t,this.debugMode=n,this.customHeaders=r,this.sendQueue=[]}return l()(e,[{key:"postLogsToEndpoint",value:function(e){var t,n,r={promise:new Promise((function(e,r){t=e,n=r})),resolve:t,reject:n};return this.sendQueue.push({requestParams:e,deferred:r}),this.sendNextQueuedLogToServer(),this.debug("adding requestParams to sendQueue",{requestParams:e,updatedSendQueue:this.sendQueue.map((function(e){return e.requestParams})),hasPendingRequest:!!this.pendingRequest}),r.promise}},{key:"postLogsToEndpointInstantly",value:function(e,t){return z(this,void 0,void 0,k.a.mark((function n(){return k.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.debug("sending request instantly",{requestParams:e,sendQueue:this.sendQueue.map((function(e){return e.requestParams}))}),navigator.onLine){n.next=3;break}return n.abrupt("return",this.saveRequestForLater(e));case 3:return n.prev=3,n.next=6,this.sendPostRequest(e);case 6:n.next=12;break;case 8:throw n.prev=8,n.t0=n.catch(3),(null==t?void 0:t.saveOnFailure)&&this.saveRequestForLater(e),n.t0;case 12:case"end":return n.stop()}}),n,this,[[3,8]])})))}},{key:"saveRequestForLater",value:function(e){var t=this.getSavedRequests()||[],n=Object.assign({},e);delete n.accessToken,t.push(n),window.localStorage.setItem("gc_logger_requests",JSON.stringify(t))}},{key:"getSavedRequests",value:function(){var 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})}}},{key:"sendEntireQueue",value:function(){this.debug("sending all queued requests instantly to clear out sendQueue",{sendQueue:this.sendQueue.map((function(e){return e.requestParams}))});for(var e,t=[];e=this.sendQueue.shift();)t.push(this.postLogsToEndpointInstantly(e.requestParams,{saveOnFailure:!0}));return t}},{key:"resetSendQueue",value:function(){this.debug("reseting send queue without sending currently queued data",{queueLength:this.sendQueue.length}),this.sendQueue=[]}},{key:"sendNextQueuedLogToServer",value:function(){return z(this,void 0,void 0,k.a.mark((function e(){var t,n=this;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.pendingRequest&&0!==this.sendQueue.length){e.next=3;break}return this.debug("sendNextQueuedLogToServer() but not sending request",{hasPendingRequest:!!this.pendingRequest,sendQueueLength:this.sendQueue.length}),e.abrupt("return");case 3:return(t=this.sendQueue.shift()).deferred.promise.finally((function(){n.debug("queue item completed. removing from queue and resetting send queue",{queueItemRequestParams:t.requestParams,updatedSendQueue:n.sendQueue.map((function(e){return e.requestParams}))}),n.pendingRequest=void 0,n.sendNextQueuedLogToServer()})),this.pendingRequest=t,this.debug("sending logs to server",{queueItem:t.requestParams,sendQueue:this.sendQueue.map((function(e){return e.requestParams}))}),e.abrupt("return",Object(j.backOff)((function(){return n.backoffFn(t.requestParams)}),{retry:function(e){var t,r,i,a,o,s=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.status,u=null==e?void 0:e.code,c=(null===(i=null===(r=e.response)||void 0===r?void 0:r.headers)||void 0===i?void 0:i["retry-after"])||(null===(o=null===(a=e.response)||void 0===a?void 0:a.getResponseHeader)||void 0===o?void 0:o.call(a,"retry-after"));if(c){var l=F(new Date,{seconds:parseInt(c,10)});n.retryAfter&&!q(l,n.retryAfter)||(n.retryAfter=l)}return navigator.onLine&&(s&&J.includes(s)||"ERR_NETWORK"===u)},numOfAttempts:10,startingDelay:0,delayFirstAttempt:!1,maxDelay:15e3}).then((function(e){n.debug("successfully sent logs to server",{requestParams:t.requestParams,response:e}),t.deferred.resolve(e)})).catch(this.handleBackoffError.bind(this,t)));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"handleBackoffError",value:function(e,t){var n,r=null===(n=t.response)||void 0===n?void 0:n.status;r&&J.includes(r)||G.includes(r)||"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"}))}},{key:"retryAfterTimerCheck",value:function(){return z(this,void 0,void 0,k.a.mark((function e(){var t;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.retryAfter){e.next=2;break}return e.abrupt("return");case 2:if(!q(Date.now(),this.retryAfter)){e.next=7;break}return this.retryAfter=void 0,e.abrupt("return");case 7:return t=U(this.retryAfter,Date.now()),this.debug('Respecting "retry-after" response header, waiting to send request',{millisecondsToWait:t}),e.next=11,new Promise((function(e){setTimeout((function(){e(null)}),t)}));case 11:return e.abrupt("return",this.retryAfterTimerCheck());case 12:case"end":return e.stop()}}),e,this)})))}},{key:"backoffFn",value:function(e){return z(this,void 0,void 0,k.a.mark((function t(){var n,r,i,a=this;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.retryAfterTimerCheck();case 2:return n=e.accessToken,t.next=5,this.sendPostRequest(e);case 5:return r=t.sent,(i=this.getSavedRequests())&&(window.localStorage.removeItem("gc_logger_requests"),i.map((function(e){var t=Object.assign({accessToken:n},e);a.postLogsToEndpoint(t)}))),t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"sendPostRequest",value:function(e){this.debug("issuing POST request",{requestParams:e});var t=Object.assign({},e);delete t.accessToken;var n=Object.assign({authorization:"Bearer ".concat(e.accessToken),"content-type":"application/json; charset=UTF-8"},this.customHeaders||{});return Object(R.a)({method:"post",url:this.url,responseType:"text",data:t,headers:n})}},{key:"debug",value:function(e,t){this.debugMode&&console.log("%c [DEBUG:log-uploader] ".concat(e),"color: #32a0a8",N(t))}}]),e}(),W=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}u((r=r.apply(e,t||[])).next())}))},Q=function(){function e(t){var n=this;if(u()(this,e),this.isInitialized=!1,this.logBuffer=[],this.debounceTimer=null,this.logger=t,!t.config.url||!t.config.appVersion){var r="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(r,{providedConfig:t.config},{skipServer:!0}),new Error(r)}this.isInitialized=!0,this.debounceLogUploadTime=t.config.uploadDebounceTime||4e3,this.logUploader=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(n)return new V(e,t,r);var i=H.get(e);return i||(i=new V(e,t,r),H.set(e,i)),i}(t.config.url,t.config.debugMode,t.config.useUniqueLogUploader,t.config.customHeaders),window.addEventListener("unload",this.sendAllLogsInstantly.bind(this)),this.logger.on("onStop",(function(e){n.debug("`onStop` received. Clearing logBuffer and sendQueue",{logBuffer:n.logBuffer,sendQueue:n.logUploader.sendQueue}),n.logBuffer=[],n.logUploader.resetSendQueue()}))}return l()(e,[{key:"addLogToSend",value:function(e,t,n){if(this.isInitialized){var r=this.convertToLogMessage(t,n),i=this.convertToTrace(e,r),a=E(i);if(a>14500){var o=this.truncateLog(e,r);if(null===o)return void this.logger.error("truncated message is too large to send to server. not sending message",{originalTrace:i,originalTraceSize:E(i),truncatedTrace:o,truncatedTraceSize:E(o)},{skipServer:!0});a=E(o),i=o}var s,u=!this.logBuffer.length;if((s=u?{size:0,traces:[]}:this.logBuffer[this.logBuffer.length-1]).size+a>14500)return this.debug("`exceedsMaxLogSize` was `true`",{logBuffer:this.logBuffer,bufferItem:s,incomingTrace:i,incomingTraceSize:a,maxAllowedTraceSize:14500}),this.logBuffer.push({size:a,traces:[i]}),this.debug("calling sendLogsToServer(true)",{logBuffer:this.logBuffer}),void this.sendLogsToServer(!0);s.size+=a,s.traces.push(i),u&&(this.debug("`this.logBuffer` was empty. pushing new buffer item",{logBuffer:this.logBuffer,bufferItem:s}),this.logBuffer.push(s)),this.debug("calling sendLogsToServer()",{logBuffer:this.logBuffer}),this.sendLogsToServer()}}},{key:"sendAllLogsInstantly",value:function(){var e=this;return this.logUploader.sendEntireQueue().concat(this.logBuffer.map((function(t){return e.logUploader.postLogsToEndpointInstantly(e.convertToRequestParams(t.traces.reverse()),{saveOnFailure:!0})})))}},{key:"sendLogsToServer",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return W(this,void 0,void 0,k.a.mark((function n(){var r,i,a,o,s=this;return k.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.logBuffer.length){n.next=5;break}return clearTimeout(this.debounceTimer),this.debounceTimer=null,this.debug("buffer empty, not sending http request"),n.abrupt("return");case 5:if(t){n.next=8;break}return this.debounceTimer?this.debug("sendLogsToServer() 'immediate' is false. 'debounceTimer' is already running"):(this.debug("sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to ".concat(this.debounceLogUploadTime,"ms")),this.debounceTimer=setTimeout((function(){return s.sendLogsToServer(!0)}),this.debounceLogUploadTime)),n.abrupt("return");case 8:return clearTimeout(this.debounceTimer),this.debounceTimer=null,r=this.logBuffer.splice(0,1),i=T()(r,1),a=i[0],n.prev=11,this.debug("calling logUploader.postLogsToEndpoint() with",{bufferItem:a,newLogBuffer:this.logBuffer}),n.next=15,this.logUploader.postLogsToEndpoint(this.convertToRequestParams(a.traces.reverse()));case 15:n.next=23;break;case 17:n.prev=17,n.t0=n.catch(11),this.logger.emit("onError",n.t0),this.logger.error("Error sending logs to server",n.t0,{skipServer:!0}),o=(null===n.t0||void 0===n.t0?void 0:n.t0.status)?parseInt(n.t0.status,10):parseInt(null===(e=null===n.t0||void 0===n.t0?void 0:n.t0.response)||void 0===e?void 0:e.status,10),[401,403,404].includes(o)&&(this.logger.warn("received a ".concat(o," from logUploader. stopping logging to server")),this.logger.stopServerLogging());case 23:return n.prev=23,this.sendLogsToServer(),n.finish(23);case 26:case"end":return n.stop()}}),n,this,[[11,17,23,26]])})))}},{key:"truncateLog",value:function(e,t){var n,r,i=E(this.convertToTrace(e,t)),a=N(t);return a?(a.details="[[TRUNCATED]]",n=this.convertToTrace(e,a),(r=E(n))<=14500?(this.logger.warn("message too large to send to server. truncated log details",{originalLog:t,truncatedLog:a,originalTraceSize:i,truncatedTraceSize:r,maxAllowedTraceSize:14500},{skipServer:!0}),n):(a.message="".concat(a.message.substr(0,150),"... ").concat("[[TRUNCATED]]"),n=this.convertToTrace(e,a),(r=E(n))<=14500?(this.logger.warn("message too large to send to server. truncated log details & log message",{originalLog:t,truncatedLog:a,originalTraceSize:i,truncatedTraceSize:r,maxAllowedTraceSize:14500},{skipServer:!0}),n):null)):null}},{key:"convertToLogMessage",value:function(e,t){var n={clientTime:(new Date).toISOString(),clientId:this.logger.clientId,message:e,details:t},r=this.logger.config,i=r.originAppName,a=r.originAppVersion,o=r.originAppId;return i&&(n.originAppName=i,n.originAppVersion=a,n.originAppId=o),n}},{key:"convertToTrace",value:function(e,t){return{topic:this.logger.config.appName,level:e.toUpperCase(),message:w()(t)}}},{key:"convertToRequestParams",value:function(e){return{accessToken:this.logger.config.accessToken,app:{appId:this.logger.config.appName,appVersion:this.logger.config.appVersion},traces:e}}},{key:"debug",value:function(e,t){this.logger.config.debugMode&&console.log("%c [DEBUG:".concat(this.logger.config.appName,"] ").concat(e),"color: #32a852",N(t))}}]),e}();function K(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m()(this,n)}}var Y=function(e){h()(n,e);var t=K(n);function n(e){var r;return u()(this,n),(r=t.call(this)).defaultFormatter=function(e,t,n,i,a){if(i.skipDefaultFormatter)return a();t instanceof Error&&(n=n||t,t=t.message);var o=r.config.appName?"[".concat(r.config.appName,"] "):"";a(e,t="".concat(o).concat(t),n,i)},r.logMessage=function(e,t,n,i){if(!i.skipSecondaryLogger)try{var a=[t];void 0!==n&&a.push(r.config.stringify?w()(n):n),r.secondaryLogger[e].apply(r.secondaryLogger,a)}catch(e){console.error("Error logging using custom logger passed into `genesys-cloud-client-logger`",{error:e,secondaryLogger:r.secondaryLogger,message:t,details:n,messageOptions:i})}!i.skipServer&&!r.stopReason&&r.serverLogger&&r.logRank(e)>=r.logRank(r.config.logLevel)&&r.serverLogger.addLogToSend(e,t,n)},Object.defineProperty(p()(r),"clientId",{value:Object(_.a)(),writable:!1}),r.config=Object.assign({},e),r.secondaryLogger=r.config.logger||console,delete r.config.logger,-1===r.logRank(r.config.logLevel)&&(e.logLevel&&r.warn('Invalid log level: "'.concat(e.logLevel,'". Default "info" will be used instead.'),null,{skipServer:!0}),r.config.logLevel="info"),!e.appName&&e.logTopic&&(r.warn("`logTopic` has been renamed to `appName`. Please use `appName`",null,{skipServer:!0}),r.config.appName=e.logTopic),!1!==r.config.initializeServerLogging&&(r.serverLogger=new Q(p()(r))),r.config.startServerLoggingPaused&&r.stopServerLogging(),r}return l()(n,[{key:"setAccessToken",value:function(e){this.config.accessToken=e,401==this.stopReason&&this.startServerLogging()}},{key:"log",value:function(e,t,n){this.formatMessage("log",e,t,n)}},{key:"debug",value:function(e,t,n){this.formatMessage("debug",e,t,n)}},{key:"info",value:function(e,t,n){this.formatMessage("info",e,t,n)}},{key:"warn",value:function(e,t,n){this.formatMessage("warn",e,t,n)}},{key:"error",value:function(e,t,n){this.formatMessage("error",e,t,n)}},{key:"startServerLogging",value:function(){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")}},{key:"stopServerLogging",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"force";"force"===this.stopReason&&"force"!==e||(this.stopReason=e,this.emit("onStop",e))}},{key:"sendAllLogsInstantly",value:function(){var e;return(null===(e=this.serverLogger)||void 0===e?void 0:e.sendAllLogsInstantly())||[]}},{key:"formatMessage",value:function(e,t,n,r){var i=[this.defaultFormatter.bind(this)];this.config.formatters&&(i=[].concat(o()(this.config.formatters),[this.defaultFormatter.bind(this)])),this.callNextFormatter(i,e,t,n,r)}},{key:"callNextFormatter",value:function(e,t,n,r){var a=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=i()(e),u=s[0],c=s.slice(1);if(!u)return this.logMessage(t,n,r,o);var l=function(e,i,s,u){void 0!==e?a.callNextFormatter(c,e,i,s,u):a.callNextFormatter(c,t,n,r,o)};u(t,n,r,o,l)}},{key:"logRank",value:function(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}}},{key:"VERSION",get:function(){return n.VERSION}}]),n}(b.EventEmitter);Y.VERSION="4.2.13",n.d(t,"Logger",(function(){return Y}));t.default=Y}]).default;