genesys-cloud-streaming-client 19.2.0-develop.138 → 19.2.0-develop.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/types/genesys-cloud-media-session.js +1 -2
- package/dist/cjs/webrtc.js +1 -1
- package/dist/deploy-info.json +2 -2
- package/dist/es/index.bundle.js +2 -3
- package/dist/es/types/genesys-cloud-media-session.js +1 -2
- package/dist/es/webrtc.js +1 -1
- package/dist/npm/CHANGELOG.md +6 -1
- package/dist/npm/types/genesys-cloud-media-session.js +1 -2
- package/dist/npm/webrtc.js +1 -1
- package/dist/streaming-client.browser.js +2 -2
- package/dist/v19/streaming-client.browser.js +2 -2
- package/dist/v19.2.0/streaming-client.browser.js +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ window.GenesysCloudStreamingClient=function(e){var t={};function n(r){if(t[r])re
|
|
|
4
4
|
*
|
|
5
5
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
6
6
|
* @license MIT
|
|
7
|
-
*/var r=n(6),i=n(7),a=n(24),o=n(16),s=n(17),u=n(14),c=n(11);function l(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)}}var f=n(244),p=n(245),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=function(e){+e!=e&&(e=0);return v.alloc(+e)},t.INSPECT_MAX_BYTES=50;function h(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,v.prototype),t}function v(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return m(e,t,n)}function m(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!v.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|w(e,t),r=h(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(te(e,Uint8Array)){var t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return b(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e));if(te(e,ArrayBuffer)||e&&te(e.buffer,ArrayBuffer))return _(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(te(e,SharedArrayBuffer)||e&&te(e.buffer,SharedArrayBuffer)))return _(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return v.from(r,t,n);var i=function(e){if(v.isBuffer(e)){var t=0|S(e.length),n=h(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||ne(e.length)?h(0):b(e);if("Buffer"===e.type&&Array.isArray(e.data))return b(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return v.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e))}function g(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function y(e){return g(e),h(e<0?0:0|S(e))}function b(e){for(var t=e.length<0?0:0|S(e.length),n=h(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function _(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,v.prototype),r}function S(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function w(e,t){if(v.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||te(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(e));var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(i)return r?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function x(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 D(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return j(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function k(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function O(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),ne(n=+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=v.from(t,r)),v.isBuffer(t))return 0===t.length?-1:T(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function T(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 A(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a,o=t.length;for(r>o/2&&(r=o/2),a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(ne(s))return a;e[n+a]=s}return a}function I(e,t,n,r){return ee($(t,e.length-n),e,n,r)}function E(e,t,n,r){return ee(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function N(e,t,n,r){return ee(Z(t),e,n,r)}function R(e,t,n,r){return ee(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 j(e,t,n){return 0===t&&n===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var u=void 0,c=void 0,l=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(u=e[i+1]))&&(f=(31&a)<<6|63&u)>127&&(o=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&a)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&a)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}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.kMaxLength=2147483647,v.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),v.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}}),v.poolSize=8192,v.from=function(e,t,n){return m(e,t,n)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array),v.alloc=function(e,t,n){return function(e,t,n){return g(e),e<=0?h(e):void 0!==t?"string"==typeof n?h(e).fill(t,n):h(e).fill(t):h(e)}(e,t,n)},v.allocUnsafe=function(e){return y(e)},v.allocUnsafeSlow=function(e){return y(e)},v.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==v.prototype},v.compare=function(e,t){if(te(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),te(t,Uint8Array)&&(t=v.from(t,t.offset,t.byteLength)),!v.isBuffer(e)||!v.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');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},v.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}},v.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return v.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=v.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(te(a,Uint8Array))i+a.length>r.length?(v.isBuffer(a)||(a=v.from(a)),a.copy(r,i)):Uint8Array.prototype.set.call(r,a,i);else{if(!v.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},v.byteLength=w,v.prototype._isBuffer=!0,v.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)k(this,t,t+1);return this},v.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)k(this,t,t+3),k(this,t+1,t+2);return this},v.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)k(this,t,t+7),k(this,t+1,t+6),k(this,t+2,t+5),k(this,t+3,t+4);return this},v.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):x.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(e){if(!v.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===v.compare(this,e)},v.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},d&&(v.prototype[d]=v.prototype.inspect),v.prototype.compare=function(e,t,n,r,i){if(te(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),!v.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(e));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),u=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(u[f]!==l[f]){a=u[f],o=l[f];break}return a<o?-1:o<a?1:0},v.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},v.prototype.indexOf=function(e,t,n){return O(this,e,t,n,!0)},v.prototype.lastIndexOf=function(e,t,n){return O(this,e,t,n,!1)},v.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 A(this,e,t,n);case"utf8":case"utf-8":return I(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return N(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(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 M(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 D(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+=re[e[a]];return i}function L(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function B(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 F(e,t,n,r,i,a){if(!v.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 q(e,t,n,r,i){Q(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function U(e,t,n,r,i){Q(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function z(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 J(e,t,n,r,i){return t=+t,n>>>=0,i||z(e,0,n,4),p.write(e,t,n,r,23,4),n+4}function G(e,t,n,r,i){return t=+t,n>>>=0,i||z(e,0,n,8),p.write(e,t,n,r,52,8),n+8}v.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,v.prototype),r},v.prototype.readUintLE=v.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},v.prototype.readUintBE=v.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},v.prototype.readUint8=v.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readBigUInt64LE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+n*Math.pow(2,24);return BigInt(r)+(BigInt(i)<<BigInt(32))})),v.prototype.readBigUInt64BE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),v.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(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},v.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(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},v.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},v.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},v.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readBigInt64LE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),v.prototype.readBigInt64BE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n)})),v.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),p.read(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),p.read(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),p.read(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),p.read(this,e,!1,52,8)},v.prototype.writeUintLE=v.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||F(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},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||F(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},v.prototype.writeUint8=v.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigUInt64LE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeBigUInt64BE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);F(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},v.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);F(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},v.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},v.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigInt64LE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeBigInt64BE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeFloatLE=function(e,t,n){return J(this,e,t,!0,n)},v.prototype.writeFloatBE=function(e,t,n){return J(this,e,t,!1,n)},v.prototype.writeDoubleLE=function(e,t,n){return G(this,e,t,!0,n)},v.prototype.writeDoubleBE=function(e,t,n){return G(this,e,t,!1,n)},v.prototype.copy=function(e,t,n,r){if(!v.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},v.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),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!v.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));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=v.isBuffer(e)?e:v.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var H={};function V(e,t,n){H[e]=function(n){o(u,n);var s=l(u);function u(){var n;return r(this,u),n=s.call(this),Object.defineProperty(a(n),"message",{value:t.apply(a(n),arguments),writable:!0,configurable:!0}),n.name="".concat(n.name," [").concat(e,"]"),n.stack,delete n.name,n}return i(u,[{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}},{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}}]),u}(n)}function W(e){for(var t="",n=e.length,r="-"===e[0]?1:0;n>=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function Q(e,t,n,r,i,a){if(e>n||e<t){var o,s="bigint"==typeof t?"n":"";throw o=a>3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(n).concat(s),new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Y(t,e.length-(n+1))}(r,i,a)}function K(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(c(t))}),TypeError),V("ERR_OUT_OF_RANGE",(function(e,t,n){var r='The value of "'.concat(e,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>Math.pow(2,32)?i=W(String(n)):"bigint"==typeof n&&(i=String(n),(n>Math.pow(BigInt(2),BigInt(32))||n<-Math.pow(BigInt(2),BigInt(32)))&&(i=W(i)),i+="n"),r+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(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 Z(e){return f.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ee(e,t,n,r){var i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function te(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!=e}var re=function(){for(var e=new Array(256),t=0;t<16;++t)for(var n=16*t,r=0;r<16;++r)e[n+r]="0123456789abcdef"[t]+"0123456789abcdef"[r];return e}();function ie(e){return"undefined"==typeof BigInt?ae:e}function ae(){throw new Error("BigInt not supported")}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(16),s=n(17),u=n(14),c=n(28);function l(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}),t.iceIsDifferent=t.getIcePwdFromSdp=t.getUfragFromSdp=t.calculatePayloadSize=t.parseJwt=t.retryPromise=t.isVideoJid=t.isSoftphoneJid=t.isScreenRecordingJid=t.isAcdJid=t.splitIntoIndividualTopics=t.delay=t.timeoutPromise=t.StreamingClientError=void 0;var f=n(34),p=n(80),d=n(33),h=function(e){o(n,e);var t=l(n);function n(e,r,i){var o,s;return a(this,n),s=r instanceof Error?r.message:r,o=t.call(this,s),r instanceof Error&&(o.name=r.name),o.type=null!=e?e:d.StreamingClientErrorTypes.generic,o.details=i,o}return n}(c(Error));t.StreamingClientError=h,t.timeoutPromise=function(e,t,n,r){return new Promise((function(i,a){var o=setTimeout((function(){var e=new p.TimeoutError("Timeout: ".concat(n));e.details=r,a(e)}),t);e((function(e){clearTimeout(o),i(e)}),a)}))},t.delay=function(e){return new Promise((function(t){setTimeout(t,e)}))},t.splitIntoIndividualTopics=function(e){var t=[];if(e.includes("?")){var n=e.split("?"),r=n[0],i=n[1]&&n[1].split("&");i&&i.length&&i.forEach((function(e){t.push("".concat(r,".").concat(e))}))}else t.push(e);return t};t.isAcdJid=function(e){return e.startsWith("acd-")&&!t.isSoftphoneJid(e)};t.isScreenRecordingJid=function(e){return e.startsWith("screenrecording-")&&!t.isSoftphoneJid(e)};t.isSoftphoneJid=function(e){return!!e&&!!e.match(/.*@.*gjoll.*/i)};t.isVideoJid=function(e){return!(!e||!e.match(/@conference/)||t.isAcdJid(e))},t.retryPromise=function(e,t){var n,a,o,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console,l=!1,p=new Promise((function(f,p){s=function(){var l=i(r.mark((function i(){var l,f,p;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e();case 3:l=r.sent,o(l),r.next=13;break;case 7:r.prev=7,r.t0=r.catch(0),f=u,p=t(r.t0),Number.isInteger(p)&&(f=p),!1!==p?(c.debug("Retrying promise",r.t0),n=setTimeout(s,f)):a(r.t0);case 13:case"end":return r.stop()}}),i,null,[[0,7]])})));return function(){return l.apply(this,arguments)}}(),o=function(e){clearTimeout(n),l=!0,f(e)},a=function(e){clearTimeout(n),l=!0,p(e)},s()}));return{promise:p,cancel:a,complete:o,_id:f.v4(),hasCompleted:function(){return l}}};function v(e){if(!e)return null;var t=e.match(/a=ice-ufrag:(\S+)/);return t?t[1]:null}function m(e){if(!e)return null;var t=e.match(/a=ice-pwd:(\S+)/);return t?t[1]:null}t.parseJwt=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(n)},t.calculatePayloadSize=function(e){var t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},t.getUfragFromSdp=v,t.getIcePwdFromSdp=m,t.iceIsDifferent=function(e,t){return v(e)!==v(t)||m(e)!==m(t)}},function(e,t,n){"use strict";var r=n(3),i=n(11),a=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.reviveData=t.uuid=t.octetCompare=t.sleep=t.shuffle=t.promiseAny=t.timeoutPromise=void 0;for(var o=n(21),s=[],u=0;u<256;++u)s[u]=(u+256).toString(16).substr(1);function c(){return(c=a(r.mark((function e(t,n){var i,a,o,s=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>2&&void 0!==s[2]?s[2]:function(){},e.next=3,Promise.race([t,new Promise((function(e,t){a=setTimeout((function(){return t(i())}),n)}))]);case 3:return o=e.sent,clearTimeout(a),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=a(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map((function(e){return e.then((function(e){return Promise.reject(e)}),(function(e){return Promise.resolve(e)}))})));case 3:return n=e.sent,e.abrupt("return",Promise.reject(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.resolve(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(){return(f=a(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.timeoutPromise=function(e,t){return c.apply(this,arguments)},t.promiseAny=function(e){return l.apply(this,arguments)},t.shuffle=function(e){for(var t=e.length;t>0;){var n=Math.floor(Math.random()*t),r=e[t-=1];e[t]=e[n],e[n]=r}return e},t.sleep=function(e){return f.apply(this,arguments)},t.octetCompare=function(e,t){var n="string"==typeof e?o.Buffer.from(e,"utf8"):e,r="string"==typeof t?o.Buffer.from(t,"utf8"):t;return n.compare(r)},t.uuid=function(){var e=(0,o.randomBytes)(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=0;return[s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[15]]].join("")};var p=new Set(["date","expires","httpUploadRetry","idleSince","published","since","stamp","timestamp","updated","utc"]),d=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:Z|((\+|-)([\d|:]*)))?$/;t.reviveData=function(e,t){return p.has(e)&&t&&"string"==typeof t&&d.test(t)?new Date(t):t&&"object"===i(t)&&"Buffer"===t.type&&Array.isArray(t.data)?o.Buffer.from(t):t}},function(e,t,n){var r=n(14),i=n(53),a=n(230),o=n(231);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));for(var r=n(30),i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]}t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=o(e,t);if(!Object(r.a)(n))throw TypeError("Stringified UUID is invalid");return n}},function(e,t,n){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t.a=function(e){return"string"==typeof e&&r.test(e)}},function(e,t,n){"use strict";(function(e){var r=n(11),i=n.n(r),a=n(1),o=n(10),s=n(50);function u(e){return a.a.isPlainObject(e)||a.a.isArray(e)}function c(e){return a.a.endsWith(e,"[]")?e.slice(0,-2):e}function l(e,t,n){return e?e.concat(t).map((function(e,t){return e=c(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var f=a.a.toFlatObject(a.a,{},null,(function(e){return/^is[A-Z]/.test(e)}));t.a=function(t,n,r){if(!a.a.isObject(t))throw new TypeError("target must be an object");n=n||new(s.a||FormData);var p=(r=a.a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!a.a.isUndefined(t[e])}))).metaTokens,d=r.visitor||y,h=r.dots,v=r.indexes,m=(r.Blob||"undefined"!=typeof Blob&&Blob)&&a.a.isSpecCompliantForm(n);if(!a.a.isFunction(d))throw new TypeError("visitor must be a function");function g(t){if(null===t)return"";if(a.a.isDate(t))return t.toISOString();if(!m&&a.a.isBlob(t))throw new o.a("Blob is not supported. Use a Buffer instead.");return a.a.isArrayBuffer(t)||a.a.isTypedArray(t)?m&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function y(e,t,r){var o=e;if(e&&!r&&"object"===i()(e))if(a.a.endsWith(t,"{}"))t=p?t:t.slice(0,-2),e=JSON.stringify(e);else if(a.a.isArray(e)&&function(e){return a.a.isArray(e)&&!e.some(u)}(e)||(a.a.isFileList(e)||a.a.endsWith(t,"[]"))&&(o=a.a.toArray(e)))return t=c(t),o.forEach((function(e,r){!a.a.isUndefined(e)&&null!==e&&n.append(!0===v?l([t],r,h):null===v?t:t+"[]",g(e))})),!1;return!!u(e)||(n.append(l(r,t,h),g(e)),!1)}var b=[],_=Object.assign(f,{defaultVisitor:y,convertValue:g,isVisitable:u});if(!a.a.isObject(t))throw new TypeError("data must be an object");return function e(t,r){if(!a.a.isUndefined(t)){if(-1!==b.indexOf(t))throw Error("Circular reference detected in "+r.join("."));b.push(t),a.a.forEach(t,(function(t,i){!0===(!(a.a.isUndefined(t)||null===t)&&d.call(n,t,a.a.isString(i)?i.trim():i,r,_))&&e(t,r?r.concat(i):[i])})),b.pop()}}(t),n}}).call(this,n(222).Buffer)},function(e,t){var n=e.exports={};function r(){}n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.prependListener=r,n.prependOnceListener=r,n.nextTick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return window.queueMicrotask((function(){return e.apply(void 0,n)}))},n.listeners=function(e){return[]},n.cwd=function(){return"/"},n.umask=function(){return 0},n.binding=function(e){throw new Error("process.binding is not supported")},n.chdir=function(e){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionTypes=t.StreamingClientErrorTypes=void 0,function(e){e.generic="generic",e.invalid_token="invalid_token"}(t.StreamingClientErrorTypes||(t.StreamingClientErrorTypes={})),function(e){e.softphone="softphone",e.collaborateVideo="collaborateVideo",e.acdScreenShare="screenShare",e.screenRecording="screenRecording",e.unknown="unknown"}(t.SessionTypes||(t.SessionTypes={}))},function(e,t,n){"use strict";n.r(t);var r,i,a=n(51),o=n(29),s=0,u=0;var c=function(e,t,n){var c=t&&n||0,l=t||new Array(16),f=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==p){var d=e.random||(e.rng||a.a)();null==f&&(f=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==p&&(p=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:u+1,m=h-s+(v-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||h>s)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,u=v,i=p;var g=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var y=h/4294967296*1e4&268435455;l[c++]=y>>>8&255,l[c++]=255&y,l[c++]=y>>>24&15|16,l[c++]=y>>>16&255,l[c++]=p>>>8|128,l[c++]=255&p;for(var b=0;b<6;++b)l[c+b]=f[b];return t||Object(o.b)(l)},l=n(30);var f=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function p(e,t,n){function r(e,r,i,a){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=f(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+e.length);if(u.set(r),u.set(e,r.length),(u=n(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,i){a=a||0;for(var c=0;c<16;++c)i[a+c]=u[c];return i}return Object(o.b)(u)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function d(e){return 14+(e+64>>>9<<4)+1}function h(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t,n,r,i,a){return h((o=h(h(t,e),h(r,a)))<<(s=i)|o>>>32-s,n);var o,s}function m(e,t,n,r,i,a,o){return v(t&n|~t&r,e,t,i,a,o)}function g(e,t,n,r,i,a,o){return v(t&r|n&~r,e,t,i,a,o)}function y(e,t,n,r,i,a,o){return v(t^n^r,e,t,i,a,o)}function b(e,t,n,r,i,a,o){return v(n^(t|~r),e,t,i,a,o)}var _=p("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r=0;r<n;r+=8){var i=e[r>>5]>>>r%32&255,a=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[d(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,u=r,c=i,l=a;n=m(n,r,i,a,e[o],7,-680876936),a=m(a,n,r,i,e[o+1],12,-389564586),i=m(i,a,n,r,e[o+2],17,606105819),r=m(r,i,a,n,e[o+3],22,-1044525330),n=m(n,r,i,a,e[o+4],7,-176418897),a=m(a,n,r,i,e[o+5],12,1200080426),i=m(i,a,n,r,e[o+6],17,-1473231341),r=m(r,i,a,n,e[o+7],22,-45705983),n=m(n,r,i,a,e[o+8],7,1770035416),a=m(a,n,r,i,e[o+9],12,-1958414417),i=m(i,a,n,r,e[o+10],17,-42063),r=m(r,i,a,n,e[o+11],22,-1990404162),n=m(n,r,i,a,e[o+12],7,1804603682),a=m(a,n,r,i,e[o+13],12,-40341101),i=m(i,a,n,r,e[o+14],17,-1502002290),r=m(r,i,a,n,e[o+15],22,1236535329),n=g(n,r,i,a,e[o+1],5,-165796510),a=g(a,n,r,i,e[o+6],9,-1069501632),i=g(i,a,n,r,e[o+11],14,643717713),r=g(r,i,a,n,e[o],20,-373897302),n=g(n,r,i,a,e[o+5],5,-701558691),a=g(a,n,r,i,e[o+10],9,38016083),i=g(i,a,n,r,e[o+15],14,-660478335),r=g(r,i,a,n,e[o+4],20,-405537848),n=g(n,r,i,a,e[o+9],5,568446438),a=g(a,n,r,i,e[o+14],9,-1019803690),i=g(i,a,n,r,e[o+3],14,-187363961),r=g(r,i,a,n,e[o+8],20,1163531501),n=g(n,r,i,a,e[o+13],5,-1444681467),a=g(a,n,r,i,e[o+2],9,-51403784),i=g(i,a,n,r,e[o+7],14,1735328473),r=g(r,i,a,n,e[o+12],20,-1926607734),n=y(n,r,i,a,e[o+5],4,-378558),a=y(a,n,r,i,e[o+8],11,-2022574463),i=y(i,a,n,r,e[o+11],16,1839030562),r=y(r,i,a,n,e[o+14],23,-35309556),n=y(n,r,i,a,e[o+1],4,-1530992060),a=y(a,n,r,i,e[o+4],11,1272893353),i=y(i,a,n,r,e[o+7],16,-155497632),r=y(r,i,a,n,e[o+10],23,-1094730640),n=y(n,r,i,a,e[o+13],4,681279174),a=y(a,n,r,i,e[o],11,-358537222),i=y(i,a,n,r,e[o+3],16,-722521979),r=y(r,i,a,n,e[o+6],23,76029189),n=y(n,r,i,a,e[o+9],4,-640364487),a=y(a,n,r,i,e[o+12],11,-421815835),i=y(i,a,n,r,e[o+15],16,530742520),r=y(r,i,a,n,e[o+2],23,-995338651),n=b(n,r,i,a,e[o],6,-198630844),a=b(a,n,r,i,e[o+7],10,1126891415),i=b(i,a,n,r,e[o+14],15,-1416354905),r=b(r,i,a,n,e[o+5],21,-57434055),n=b(n,r,i,a,e[o+12],6,1700485571),a=b(a,n,r,i,e[o+3],10,-1894986606),i=b(i,a,n,r,e[o+10],15,-1051523),r=b(r,i,a,n,e[o+1],21,-2054922799),n=b(n,r,i,a,e[o+8],6,1873313359),a=b(a,n,r,i,e[o+15],10,-30611744),i=b(i,a,n,r,e[o+6],15,-1560198380),r=b(r,i,a,n,e[o+13],21,1309151649),n=b(n,r,i,a,e[o+4],6,-145523070),a=b(a,n,r,i,e[o+11],10,-1120210379),i=b(i,a,n,r,e[o+2],15,718787259),r=b(r,i,a,n,e[o+9],21,-343485551),n=h(n,s),r=h(r,u),i=h(i,c),a=h(a,l)}return[n,r,i,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(d(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))})),S=n(201);function w(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function x(e,t){return e<<t|e>>>32-t}var k=p("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=new Array(o),u=0;u<o;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*u+4*l]<<24|e[64*u+4*l+1]<<16|e[64*u+4*l+2]<<8|e[64*u+4*l+3];s[u]=c}s[o-1][14]=8*(e.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<o;++f){for(var p=new Uint32Array(80),d=0;d<16;++d)p[d]=s[f][d];for(var h=16;h<80;++h)p[h]=x(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);for(var v=n[0],m=n[1],g=n[2],y=n[3],b=n[4],_=0;_<80;++_){var S=Math.floor(_/20),k=x(v,5)+w(S,m,g,y)+b+t[S]+p[_]>>>0;b=y,y=g,g=x(m,30)>>>0,m=v,v=k}n[0]=n[0]+v>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var O=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};n.d(t,"v1",(function(){return c})),n.d(t,"v3",(function(){return _})),n.d(t,"v4",(function(){return S.a})),n.d(t,"v5",(function(){return k})),n.d(t,"NIL",(function(){return"00000000-0000-0000-0000-000000000000"})),n.d(t,"version",(function(){return O})),n.d(t,"validate",(function(){return l.a})),n.d(t,"stringify",(function(){return o.a})),n.d(t,"parse",(function(){return f}))},function(e,t,n){var r=n(54);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return s})),n.d(t,"__rest",(function(){return u})),n.d(t,"__decorate",(function(){return c})),n.d(t,"__param",(function(){return l})),n.d(t,"__metadata",(function(){return f})),n.d(t,"__awaiter",(function(){return p})),n.d(t,"__generator",(function(){return d})),n.d(t,"__exportStar",(function(){return h})),n.d(t,"__values",(function(){return v})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return y})),n.d(t,"__await",(function(){return b})),n.d(t,"__asyncGenerator",(function(){return _})),n.d(t,"__asyncDelegator",(function(){return S})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return x})),n.d(t,"__importStar",(function(){return k})),n.d(t,"__importDefault",(function(){return O}));var r=n(11),i=n.n(r),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){var a,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":i()(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function f(e,t){if("object"===("undefined"==typeof Reflect?"undefined":i()(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(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){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function h(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function v(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof b?Promise.resolve(n.value.v).then(u,c):l(a[0][2],n)}catch(e){l(a[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=v(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function O(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=n(42),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var a=Object.create(n(39)),o=n(87),s=n(89);a.inherits(f,o);for(var u=i(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,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(23),l=function(e){a(n,e);var t=u(n);function n(e,i){var a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"be";return r(this,n),(a=t.call(this))._block=c.Buffer.alloc(e),a._finalSize=i,a._blockSize=e,a._bigEndian="be"===o,a._len=0,a}return i(n,[{key:"_transform",value:function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)}},{key:"_flush",value:function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}},{key:"update",value:function(e,t){"string"==typeof e&&(t=t||"utf8",e=c.Buffer.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%r,u=Math.min(i-o,r-s),l=0;l<u;l++)n[s+l]=e[o+l];o+=u,(a+=u)%r==0&&this._update(n)}return this._len+=i,this}},{key:"digest",value:function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._bigEndian?(this._block.writeUInt32BE(0,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)):(this._block.writeUInt32LE(n,this._blockSize-8),this._block.writeUInt32LE(0,this._blockSize-4));else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._bigEndian?(this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)):(this._block.writeUInt32LE(r,this._blockSize-8),this._block.writeUInt32LE(i,this._blockSize-4))}this._update(this._block);var a=this._hash();return e?a.toString(e):a}},{key:"_update",value:function(e){throw new Error("_update must be implemented by subclass")}},{key:"_hash",value:function(){throw new Error("_update must be implemented by subclass")}}]),n}(n(58).Transform);t.default=l},function(e,t,n){"use strict";t.inherits=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}},function(e,t,n){"use strict";var r=n(13),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=n(41),c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];i(this,e),this.name=t,this.attributes=n,this.children=[],this.optionalNamespaces={};var a,s=o(r);try{for(s.s();!(a=s.n()).done;){var u=a.value;if("string"!=typeof u){var c=new e(u.name,u.attributes,u.children);c.parent=this,this.children.push(c)}else this.children.push(u)}}catch(e){s.e(e)}finally{s.f()}}return a(e,[{key:"getName",value:function(){return this.name.indexOf(":")>=0?this.name.substr(this.name.indexOf(":")+1):this.name}},{key:"getNamespace",value:function(){if(this.name.indexOf(":")>=0){var e=this.name.substr(0,this.name.indexOf(":"));return this.findNamespaceForPrefix(e)}return this.findNamespaceForPrefix()}},{key:"getNamespaceContext",value:function(){var e={};this.parent&&(e=this.parent.getNamespaceContext());for(var t=0,n=Object.entries(this.attributes);t<n.length;t++){var i=r(n[t],2),a=i[0],o=i[1];if(a.startsWith("xmlns:")){var s=a.substr(6);e[o]=s}}return e}},{key:"getDefaultNamespace",value:function(){return this.attributes.xmlns?this.attributes.xmlns:this.parent?this.parent.getDefaultNamespace():""}},{key:"getNamespaceRoot",value:function(e){if(this.parent){var t=this.parent.getNamespaceRoot(e);if(t)return t}for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];if(o.startsWith("xmlns:")&&s===e)return this}if(this.optionalNamespaces[e])return this}},{key:"getAttribute",value:function(e,t){if(!t)return this.attributes[e];var n=this.getNamespaceContext();return n[t]?this.attributes[[n[t],e].join(":")]:void 0}},{key:"getChild",value:function(e,t){return this.getChildren(e,t)[0]}},{key:"getChildren",value:function(e,t){var n,r=[],i=o(this.children);try{for(i.s();!(n=i.n()).done;){var a=n.value;"string"==typeof a||a.getName()!==e||t&&a.getNamespace()!==t||r.push(a)}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getText",value:function(){var e,t="",n=o(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;"string"==typeof r&&(t+=r)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"appendChild",value:function(e){return this.children.push(e),"string"!=typeof e&&(e.parent=this),e}},{key:"setAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.attributes[e]=t||void 0,""===t&&n&&(this.attributes[e]=t)}},{key:"addOptionalNamespace",value:function(e,t){this.optionalNamespaces[t]=e}},{key:"useNamespace",value:function(e,t){return this.optionalNamespaces[t]&&(e=this.optionalNamespaces[t]),this.setAttribute("xmlns:".concat(e),t),e}},{key:"toJSON",value:function(){for(var e=this.children.map((function(e){return"string"==typeof e?e:e?e.toJSON():void 0})).filter((function(e){return!!e})),t={},n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];null!=s&&(t[o]=s)}return{attributes:t,children:e,name:this.name}}},{key:"toString",value:function(){var e=this.openTag(!0);if(this.children.length){var t,n=o(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;"string"==typeof r?e+=(0,u.escapeXMLText)(r):r&&(e+=r.toString())}}catch(e){n.e(e)}finally{n.f()}e+=this.closeTag()}return e}},{key:"openTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="";t+="<".concat(this.name);for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];void 0!==s&&(t+=" ".concat(o,'="').concat((0,u.escapeXML)(s.toString()),'"'))}return e&&0===this.children.length?t+="/>":t+=">",t}},{key:"closeTag",value:function(){return"</".concat(this.name,">")}},{key:"findNamespaceForPrefix",value:function(e){if(e){var t="xmlns:"+e;if(this.attributes[t])return this.attributes[t];if(this.parent)return this.parent.findNamespaceForPrefix(e)}else{if(this.attributes.xmlns)return this.attributes.xmlns;if(this.parent)return this.parent.findNamespaceForPrefix()}return""}}]),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.basicLanguageResolver=t.escapeXMLText=t.unescapeXML=t.escapeXML=void 0;var a=(0,n(15).__importDefault)(n(56)),o={'"':""","&":"&","'":"'","<":"<",">":">"},s={"&":"&","'":"'",">":">","<":"<",""":'"'},u=/&([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);/g,c=/&|<|>|"|'/g,l=/&|<|>/g;function f(e){return o[e]}t.escapeXML=function(e){return e.replace(c,f)},t.unescapeXML=function(e){return e.replace(u,(function(e){return function(e){if(s[e])return s[e];var t=e.startsWith("&#x"),n=parseInt(e.substring(t?3:2,e.length-1),t?16:10);if(9===n||10===n||13===n||32<=n&&n<=55295||57344<=n&&n<=65533||65536<=n&&n<=1114111)return String.fromCodePoint(n);throw a.default.restrictedXML("Prohibited entity: "+e)}(e)}))},t.escapeXMLText=function(e){return e.replace(l,f)},t.basicLanguageResolver=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=new Set(e.map((function(e){return e.toLowerCase()}))),o=r(n.map((function(e){return e.toLowerCase()})));try{for(o.s();!(t=o.n()).done;){var s=t.value;if("*"!==s)for(;s.length>0;){if(a.has(s))return s;(s=s.substring(0,s.lastIndexOf("-")).toLowerCase()).lastIndexOf("-")===s.length-2&&(s=s.substring(0,s.lastIndexOf("-")))}}}catch(e){o.e(e)}finally{o.f()}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=void 0,t.nextTick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];queueMicrotask((function(){return e.apply(void 0,n)}))}},function(e,t,n){var r=n(256);function i(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=i=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var i=r(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},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.exportToSDP=t.importFromSDP=void 0;var a=(0,n(15).__importStar)(n(93));t.importFromSDP=function(e){var t=a.getMediaSections(e),n=a.getDescription(e),i={groups:[],media:[]};a.matchPrefix(n,"a=ice-lite").length>0&&(i.iceLite=!0);var o,s=r(a.matchPrefix(n,"a=group:"));try{for(s.s();!(o=s.n()).done;){var u=o.value.split(" "),c=u.shift().substr(8);i.groups.push({mids:u,semantics:c})}}catch(e){s.e(e)}finally{s.f()}var l,f=r(t);try{for(f.s();!(l=f.n()).done;){var p=l.value,d=a.getKind(p),h=a.isRejected(p),v=a.parseMLine(p),m={direction:a.getDirection(p,n),kind:d,mid:a.getMid(p),protocol:v.protocol};if(h||(m.iceParameters=a.getIceParameters(p,n),m.dtlsParameters=a.getDtlsParameters(p,n),m.setup=a.matchPrefix(p,"a=setup:")[0].substr(8),i.iceLite&&(m.iceParameters.iceLite=!0)),"audio"===d||"video"===d){m.rtpParameters=a.parseRtpParameters(p),m.rtpEncodingParameters=a.parseRtpEncodingParameters(p),m.rtcpParameters=a.parseRtcpParameters(p);var g=a.parseMsid(p);m.streams=g?[g]:[]}else"application"===d&&(m.sctp=a.parseSctpDescription(p));m.candidates=a.matchPrefix(p,"a=candidate:").map(a.parseCandidate),i.media.push(m)}}catch(e){f.e(e)}finally{f.f()}return i},t.exportToSDP=function(e){var t=[];t.push(a.writeSessionBoilerplate(e.sessionId,e.sessionVersion),"a=msid-semantic:WMS *\r\n"),(e.iceLite||e.media.filter((function(e){return e.iceParameters&&e.iceParameters.iceLite})).length>0)&&t.push("a=ice-lite\r\n");var n,i=r(e.groups||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.push("a=group:".concat(o.semantics," ").concat(o.mids.join(" "),"\r\n"))}}catch(e){i.e(e)}finally{i.f()}var s,u=r(e.media||[]);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=!(c.iceParameters&&c.dtlsParameters);if("application"===c.kind&&c.sctp)t.push(a.writeSctpDescription(c,c.sctp));else if(c.rtpParameters){var f=a.writeRtpDescription(c.kind,c.rtpParameters);l&&(f=f.replace("m=".concat(c.kind," 9 "),"m=".concat(c.kind," 0 "))),t.push(f),t.push("a=".concat(c.direction||"sendrecv","\r\n"));var p,d=r(c.streams||[]);try{for(d.s();!(p=d.n()).done;){var h=p.value;t.push("a=msid:".concat(h.stream," ").concat(h.track,"\r\n"))}}catch(e){d.e(e)}finally{d.f()}if(c.rtcpParameters&&(t.push(a.writeRtcpParameters(c.rtcpParameters)),c.rtcpParameters.cname&&c.rtpEncodingParameters&&c.rtpEncodingParameters[0].rtx)){var v=c.rtpEncodingParameters[0];t.push("a=ssrc-group:FID ".concat(v.ssrc," ").concat(v.rtx.ssrc,"\r\n")),t.push("a=ssrc:".concat(v.rtx.ssrc," cname:").concat(c.rtcpParameters.cname,"\r\n"))}}if(void 0!==c.mid&&t.push("a=mid:".concat(c.mid,"\r\n")),c.iceParameters&&t.push(a.writeIceParameters({usernameFragment:c.iceParameters.usernameFragment,password:c.iceParameters.password})),c.dtlsParameters&&c.setup&&t.push(a.writeDtlsParameters(c.dtlsParameters,c.setup)),c.candidates&&c.candidates.length){var m,g=r(c.candidates);try{for(g.s();!(m=g.n()).done;){var y=m.value;t.push("a=".concat(a.writeCandidate(y),"\r\n"))}}catch(e){g.e(e)}finally{g.f()}}}}catch(e){u.e(e)}finally{u.f()}return t.join("")}},function(e,t,n){"use strict";var r=n(4),i=n(6),a=n(7);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;var u=n(36).__importStar(n(96)),c=n(26),l=function(){function e(t){i(this,e),this._httpRetryingRequests=new Map,this.customHeaders=null==t?void 0:t.customHeaders}return a(e,[{key:"requestApiWithRetry",value:function(t,n,r){var i=this,a=c.retryPromise(this.requestApi.bind(this,t,n),(function(t){var r,i,a,o=!1;if(null==t?void 0:t.response){o=e.retryStatusCodes.has(t.response.status||0);var s=(null===(r=t.response.headers)||void 0===r?void 0:r["retry-after"])||(null===(a=(i=t.response).getResponseHeader)||void 0===a?void 0:a.call(i,"retry-after"));s&&((n.logger||console).debug("retry-after header found on response. setting retry delay",{retryAfter:s}),o=1e3*parseInt(s,10))}return o}),r,n.logger);return this._httpRetryingRequests.set(a._id,a),a.promise.then((function(){return i.cancelRetryRequest(a._id)}),(function(){return i.cancelRetryRequest(a._id)})),a}},{key:"requestApi",value:function(e,t){var n=t.logger||console,r=(new Date).getTime();t.customHeaders=s(s({},this.customHeaders||{}),t.customHeaders||{});var i=this._buildUri(t.host,e,t.version),a=s({"content-type":t.contentType||"application/json"},t.customHeaders),o={method:t.method,url:i,data:t.data,responseType:t.responseType,timeout:t.requestTimeout||3e4,headers:a};t.noAuthHeader||(o.headers.Authorization="Bearer ".concat(t.authToken));var c=this.handleResponse.bind(this,n,r,o);return u.default(o).then(c,c)}},{key:"handleResponse",value:function(e,t,n,r){var i,a,o,c=(new Date).getTime(),l=c-t+"ms";if(r instanceof u.AxiosError){if((null===(a=null===(i=r.config)||void 0===i?void 0:i.headers)||void 0===a?void 0:a.Authorization)&&(r.config.headers.Authorization="redacted"),"ECONNABORTED"===r.code)return e.debug("request error: ".concat(n.url),{message:r.message,now:c,elapsed:l},{skipServer:!0}),Promise.reject(r);var f=r.response||{},p=f.status,d=f.headers&&f.headers["inin-correlation-id"],h=f.data,v=s(s({},r),{},{text:null===(o=f.request)||void 0===o?void 0:o.response});return e.debug("request error: ".concat(n.url),{message:r.message,now:c,elapsed:l,status:p,correlationId:d,body:h},{skipServer:!0}),Promise.reject(v)}var m=r.status,g=r.headers["inin-correlation-id"],y=JSON.stringify(r.data);return e.debug("response: ".concat(n.method.toUpperCase()," ").concat(n.url),{now:c,status:m,elapsed:l,correlationId:g,body:y},{skipServer:!0}),Promise.resolve(r)}},{key:"stopAllRetries",value:function(){var e=this;Array.from(this._httpRetryingRequests.keys()).forEach((function(t){return e.cancelRetryRequest(t)}))}},{key:"cancelRetryRequest",value:function(e){var t=this._httpRetryingRequests.get(e);return t&&(t.cancel(new Error("Retry request cancelled")),this._httpRetryingRequests.delete(e)),!0}},{key:"formatRequestError",value:function(e){if(this.isSuperagentNetworkError(e))return{status:e.status,method:e.method,url:e.url,crossDomain:e.crossDomain,message:e.message,name:e.name,stack:e.stack};if(this.isSuperagentResponseError(e)){var t=e.response;return{status:e.status,correlationId:t.headers["inin-correlation-id"],message:"Error making HTTP request",method:t.req.method,name:t.error.name,stack:t.error.stack}}return e}},{key:"isSuperagentNetworkError",value:function(e){return e&&e.hasOwnProperty("status")&&e.hasOwnProperty("method")&&e.hasOwnProperty("url")}},{key:"isSuperagentResponseError",value:function(e){return!!(e&&e.response&&e.response.body&&e.response.req)}},{key:"_buildUri",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"v2";return t=t.replace(/^\/+|\/+$/g,""),0===e.indexOf("http")?"".concat(e,"/api/").concat(n,"/").concat(t):"https://api.".concat(e,"/api/").concat(n,"/").concat(t)}}]),e}();t.HttpClient=l,l.retryStatusCodes=new Set([408,413,429,500,502,503,504])},function(e,t,n){var r=n(73),i=n(78),a=n(52),o=n(75);e.exports=function(e){return r(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11),i=Object.prototype.hasOwnProperty;function a(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(n){if(null===n||"object"!==r(n))return n;if(-1!==t.indexOf(n))return"[Circular]";if(t.push(n),"function"==typeof n.toJSON)try{var o=e(n.toJSON());return t.pop(),o}catch(e){return a(e)}if(Array.isArray(n)){var s=n.map(e);return t.pop(),s}var u=Object.keys(n).reduce((function(t,r){return t[r]=e(function(e,t){if(i.call(e,t))try{return e[t]}catch(e){return a(e)}return e[t]}(n,r)),t}),{});return t.pop(),u}(e)}e.exports=function(e,t,n){return JSON.stringify(o(e),t,n)},e.exports.ensureProperties=o},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=null},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return a}));var i=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}},function(e,t,n){var r=n(74);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(e,r){var i,a=n(11);!function(o){var s="object"==a(t)&&t&&!t.nodeType&&t,u="object"==a(e)&&e&&!e.nodeType&&e,c="object"==(void 0===r?"undefined":a(r))&&r;c.global!==c&&c.window!==c&&c.self!==c||(o=c);var l,f,p=2147483647,d=/^xn--/,h=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,y=String.fromCharCode;function b(e){throw new RangeError(m[e])}function _(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+_((e=e.replace(v,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function x(e){return _(e,(function(e){var t="";return e>65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=y(e)})).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,n){var r=0;for(e=n?g(e/700):e>>1,e+=g(e/t);e>455;r+=36)e=g(e/35);return g(r+36*e/(e+38))}function T(e){var t,n,r,i,a,o,s,u,c,l,f,d=[],h=e.length,v=0,m=128,y=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&b("not-basic"),d.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<h;){for(a=v,o=1,s=36;i>=h&&b("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>g((p-v)/o))&&b("overflow"),v+=u*o,!(u<(c=s<=y?1:s>=y+26?26:s-y));s+=36)o>g(p/(l=36-c))&&b("overflow"),o*=l;y=O(v-a,t=d.length+1,0==a),g(v/t)>p-m&&b("overflow"),m+=g(v/t),v%=t,d.splice(v++,0,m)}return x(d)}function A(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,v,m,_=[];for(d=(e=w(e)).length,t=128,n=0,a=72,o=0;o<d;++o)(f=e[o])<128&&_.push(y(f));for(r=i=_.length,i&&_.push("-");r<d;){for(s=p,o=0;o<d;++o)(f=e[o])>=t&&f<s&&(s=f);for(s-t>g((p-n)/(h=r+1))&&b("overflow"),n+=(s-t)*h,t=s,o=0;o<d;++o)if((f=e[o])<t&&++n>p&&b("overflow"),f==t){for(u=n,c=36;!(u<(l=c<=a?1:c>=a+26?26:c-a));c+=36)m=u-l,v=36-l,_.push(y(k(l+m%v,0))),u=g(m/v);_.push(y(k(u,0))),a=O(n,h,r==i),n=0,++r}++n,++t}return _.join("")}if(l={version:"1.4.1",ucs2:{decode:w,encode:x},decode:T,encode:A,toASCII:function(e){return S(e,(function(e){return h.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return S(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},"object"==a(n(82))&&n(82))void 0===(i=function(){return l}.call(t,n,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=l;else for(f in l)l.hasOwnProperty(f)&&(s[f]=l[f]);else o.punycode=l}(this)}).call(this,n(81)(e),n(25))},function(e,t,n){"use strict";var r,i=n(6),a=n(7),o=n(16),s=n(17),u=n(14),c=n(28);function l(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}),t.JXTErrorCondition=void 0,function(e){e.NotWellFormed="not-well-formed",e.RestrictedXML="restricted-xml",e.AlreadyClosed="already-closed",e.UnknownRoot="unknown-stream-root"}(r=t.JXTErrorCondition||(t.JXTErrorCondition={}));var f=function(e){o(n,e);var t=l(n);function n(e){var r;return i(this,n),(r=t.call(this,e.text)).isJXTError=!0,r.condition=e.condition,r.text=e.text,r}return a(n,null,[{key:"notWellFormed",value:function(e){return new n({condition:r.NotWellFormed,text:e})}},{key:"restrictedXML",value:function(e){return new n({condition:r.RestrictedXML,text:e})}},{key:"alreadyClosed",value:function(e){return new n({condition:r.AlreadyClosed,text:e})}},{key:"unknownRoot",value:function(e){return new n({condition:r.UnknownRoot,text:e})}}]),n}(c(Error));t.default=f},function(e,t,n){"use strict";var r=n(13),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,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 u(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 u(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 u(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.childAlternateLanguageRawElement=t.childLanguageRawElement=t.childRawElement=t.staticValue=t.splicePath=t.multipleChildEnum=t.multipleChildAlternateLanguageText=t.childAlternateLanguageText=t.multipleChildIntegerAttribute=t.multipleChildAttribute=t.multipleChildText=t.childDoubleEnum=t.childEnum=t.deepMultipleChildText=t.deepChildBoolean=t.deepChildInteger=t.deepChildText=t.childBoolean=t.childTimezoneOffset=t.childJSON=t.childFloat=t.childInteger=t.childDate=t.childTextBuffer=t.childText=t.childLanguageAttribute=t.languageAttribute=t.textBuffer=t.textJSON=t.text=t.childDateAttribute=t.childFloatAttribute=t.childIntegerAttribute=t.childBooleanAttribute=t.childAttribute=t.namespacedDateAttribute=t.namespacedFloatAttribute=t.namespacedIntegerAttribute=t.namespacedBooleanAttribute=t.namespacedAttribute=t.dateAttribute=t.floatAttribute=t.integerAttribute=t.booleanAttribute=t.attribute=t.findOrCreate=t.findAll=t.getTargetLang=t.getLang=t.createElement=void 0,t.parameterMap=void 0;var c=n(15),l=n(21),f=(0,c.__importDefault)(n(40)),p=n(59);function d(e,t,n,r){if(r){e=e||r.getNamespace();var i=r.getNamespaceRoot(e);if(i){var a=i.useNamespace("",e);t="".concat(a,":").concat(t)}}var o=new f.default(t);return t.indexOf(":")<0&&(!n||e!==n)&&o.setAttribute("xmlns",e),o}function h(e,t){return(e.getAttribute("xml:lang")||t||"").toLowerCase()}function v(e,t){var n,r=[],i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(h(a,t.lang))}}catch(e){i.e(e)}finally{i.f()}return(t.resolveLanguage?t.resolveLanguage(r,t.acceptLanguages||[],t.lang):t.lang)||""}function m(e,t,n,r){var i=e.getChildren(n,t),a=h(e);return i.length?r?i.filter((function(e){if(h(e,a)===r)return!0})):i:[]}function g(e,t,n,r){t=t||e.getNamespace();var i=m(e,t,n,r);if(i.length)return i[0];var a=d(t,n,e.getDefaultNamespace(),e),o=h(e,r);return r&&o!==r&&a.setAttribute("xml:lang",r),e.appendChild(a),a}function y(e){return{importer:function(t){var n=t.getAttribute(e.name,e.namespace);return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);if(r||e.emitEmpty)if(e.namespace&&e.prefix){var i,a=t.getNamespaceRoot(e.namespace);if(a)i=a.useNamespace(e.prefix,e.namespace);else{var o=t.getNamespaceContext();o[e.namespace]||(i=t.useNamespace(e.prefix,e.namespace),o[e.namespace]=i)}t.setAttribute("".concat(i,":").concat(e.name),r,e.emitEmpty)}else t.setAttribute(e.name,r,e.emitEmpty)}}}}function b(e,t){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i=o({staticDefault:r},i),y(o(o({name:n},e),t?t(i):i))}}function _(e,t){return function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return s=o({staticDefault:a},s),y(o(o({name:i,namespace:r,prefix:n},e),t?t(s):s))}}function S(e){var t=e.converter||y(o(o({},e),{},{namespace:e.attributeNamespace}));return{importer:function(n,r){var i=n.getChild(e.element,e.namespace||n.getNamespace());return i?t.importer(i,r):e.dynamicDefault?e.dynamicDefault():e.staticDefault},exporter:function(n,r,i){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element);t.exporter(a,r,i)}}}}function w(e,t){return function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return s=o({staticDefault:a},s),S(o(o({element:r,name:i,namespace:n},e),t?t(s):s))}}function x(e){return{importer:function(t){var n=t.getText();return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(n||!e.emitEmpty){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);r&&t.children.push(r)}}else t.children.push("")}}}function k(e){var t=x(e);return{importer:function(n,r){var i=m(n,e.namespace||n.getNamespace(),e.element),a=v(i,r);if(!i.length)return e.dynamicDefault?e.dynamicDefault():e.staticDefault;if(e.matchLanguage){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(h(c,r.lang)===a)return t.importer(c,r)}}catch(e){u.e(e)}finally{u.f()}}return t.importer(i[0],r)},exporter:function(n,r,i){if(r||!e.emitEmpty){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0);t.exporter(a,r,i)}}else g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0)}}}t.createElement=d,t.getLang=h,t.getTargetLang=v,t.findAll=m,t.findOrCreate=g;var O={parseValue:function(e){return e},writeValue:function(e){return e}},T={parseValue:function(e){return parseInt(e,10)},writeValue:function(e){return e.toString()}},A={parseValue:function(e){return parseFloat(e)},writeValue:function(e){return e.toString()}},I={parseValue:function(e){return"true"===e||"1"===e||"false"!==e&&"0"!==e&&void 0},writeValue:function(e){return e?"1":"0"}},E={parseValue:function(e){return new Date(e)},writeValue:function(e){return"string"==typeof e?e:e.toISOString()}},N={parseValue:function(e){return JSON.parse(e)},writeValue:function(e){return JSON.stringify(e)}},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return{parseValue:function(t){return"base64"===e&&"="===t&&(t=""),l.Buffer.from(t.trim(),e)},writeValue:function(t){var n;return n="string"==typeof t?l.Buffer.from(t).toString(e):t?t.toString(e):"","base64"===e&&(n=n||"="),n}}},j={parseValue:function(e){var t=-1;"-"===e.charAt(0)&&(t=1,e=e.slice(1));var n=e.split(":");return(60*parseInt(n[0],10)+parseInt(n[1],10))*t},writeValue:function(e){if("string"==typeof e)return e;var t="-";e<0&&(e=-e,t="+");var n=e/60,r=e%60;return t+=(n<10?"0":"")+n+":"+(r<10?"0":"")+r}};t.attribute=b(O,(function(e){return o({dynamicDefault:e.emitEmpty?function(t){return""===t?"":e.staticDefault}:void 0},e)})),t.booleanAttribute=b(I),t.integerAttribute=b(T),t.floatAttribute=b(A),t.dateAttribute=b(E),t.namespacedAttribute=_(O),t.namespacedBooleanAttribute=_(I),t.namespacedIntegerAttribute=_(T),t.namespacedFloatAttribute=_(A),t.namespacedDateAttribute=_(E),t.childAttribute=w(O),t.childBooleanAttribute=w(I),t.childIntegerAttribute=w(T),t.childFloatAttribute=w(A),t.childDateAttribute=w(E);t.text=function(e){return x(o({staticDefault:e},O))};t.textJSON=function(){return x(o({},N))};function C(){return{importer:function(e,t){return h(e,t.lang)},exporter:function(e,t,n){t&&t.toLowerCase()!==n.lang?e.setAttribute("xml:lang",t):e.setAttribute("xml:lang",void 0)}}}t.textBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return x(o({},R(e)))},t.languageAttribute=C;t.childLanguageAttribute=function(e,t){return S(o({converter:C(),element:t,name:"xml:lang",namespace:e},O))};t.childText=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return k(o({element:t,emitEmpty:r,matchLanguage:!0,namespace:e,staticDefault:n},O))};t.childTextBuffer=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"utf8";return k(o({element:t,matchLanguage:!0,namespace:e},R(n)))};t.childDate=function(e,t){return k(o({element:t,namespace:e},E))};t.childInteger=function(e,t,n){return k(o({element:t,namespace:e,staticDefault:n},T))};t.childFloat=function(e,t,n){return k(o({element:t,namespace:e,staticDefault:n},A))};t.childJSON=function(e,t){return k(o({element:t,namespace:e},N))},t.childTimezoneOffset=function(e,t){return k(o({element:t,namespace:e,staticDefault:0},j))},t.childBoolean=function(e,t){return{importer:function(n){if(n.getChild(t,e||n.getNamespace()))return!0},exporter:function(n,r){r&&g(n,e||n.getNamespace(),t)}}};var P=function(e,t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}i.children.push(n.toString())}};t.deepChildText=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return t}}catch(e){a.e(e)}finally{a.f()}return i.getText()||t},exporter:function(t,n){P(e,t,n)}}},t.deepChildInteger=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return}}catch(e){a.e(e)}finally{a.f()}var u=i.getText();return u?parseInt(u,10):t||void 0},exporter:function(t,n){P(e,t,n)}}},t.deepChildBoolean=function(e){return{importer:function(t){var n,r=t,i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(!(r=r.getChild(a.element,a.namespace||r.getNamespace())))return!1}}catch(e){i.e(e)}finally{i.f()}return!0},exporter:function(t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}}}}},t.deepMultipleChildText=function(e){var t=e.pop();return{importer:function(n,r){var i,a=n,o=s(e);try{for(o.s();!(i=o.n()).done;){var u=i.value;if(!(a=a.getChild(u.element,u.namespace||a.getNamespace())))return[]}}catch(e){o.e(e)}finally{o.f()}var c,l=[],f=m(a,t.namespace||a.getNamespace(),t.element),p=v(f,r),d=s(f);try{for(d.s();!(c=d.n()).done;){var g=c.value;h(g,r.lang)===p&&l.push(g.getText())}}catch(e){d.e(e)}finally{d.f()}return l},exporter:function(n,r,i){if(r.length){var a,o=n,u=s(e);try{for(u.s();!(a=u.n()).done;){var c=a.value;o=g(o,c.namespace||o.getNamespace(),c.element)}}catch(e){u.e(e)}finally{u.f()}var l,f=t.namespace,p=t.element,h=s(r);try{for(h.s();!(l=h.n()).done;){var v=l.value,m=d(f||o.getNamespace(),p,i.namespace,o);m.children.push(v),o.appendChild(m)}}catch(e){h.e(e)}finally{h.f()}}}}},t.childEnum=function(e,t,n){var r,i=new Map,a=new Map,o=s(t);try{for(o.s();!(r=o.n()).done;){var u=r.value;"string"==typeof u?(i.set(u,u),a.set(u,u)):(i.set(u[1],u[0]),a.set(u[0],u[1]))}}catch(e){o.e(e)}finally{o.f()}return{importer:function(t){var r,a=s(t.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;if("string"!=typeof o&&(o.getNamespace()===(e||t.getNamespace())&&i.has(o.getName())))return i.get(o.getName())}}catch(e){a.e(e)}finally{a.f()}return n},exporter:function(t,n){a.has(n)&&g(t,e,a.get(n))}}},t.childDoubleEnum=function(e,t,n,r){var i=new Set(t),a=new Set(n);return{importer:function(t){var n,o=s(t.children);try{for(o.s();!(n=o.n()).done;){var u=n.value;if("string"!=typeof u&&(u.getNamespace()===(e||t.getNamespace())&&i.has(u.getName()))){var c,l=s(u.children);try{for(l.s();!(c=l.n()).done;){var f=c.value;if("string"!=typeof f&&(f.getNamespace()===(e||t.getNamespace())&&a.has(f.getName())))return[u.getName(),f.getName()]}}catch(e){l.e(e)}finally{l.f()}return[u.getName()]}}}catch(e){o.e(e)}finally{o.f()}return r},exporter:function(t,n){var r=g(t,e,n[0]);n[1]&&g(r,e,n[1])}}},t.multipleChildText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=v(o,r),c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value;h(l,r.lang)===u&&a.push(l.getText())}}catch(e){c.e(e)}finally{c.f()}return a},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=d(e||n.getNamespace(),t,i.namespace,n);c.children.push(u),n.appendChild(c)}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(u)}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=d(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.multipleChildIntegerAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(parseInt(u,10))}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=d(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c.toString()),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.childAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=new Set,c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var p=h(l,r.lang);if(u.has(p))continue;a.push({lang:p,value:f}),u.add(p)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=u.value;if(c){var l=d(e||n.getNamespace(),t,i.namespace,n);u.lang!==i.lang&&l.setAttribute("xml:lang",u.lang),l.children.push(c),n.appendChild(l)}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=new Map,u=!1,c=s(m(n,e||n.getNamespace(),t));try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var p=h(l,r.lang),d=o.get(p);d||(d=[],o.set(p,d),a.push({lang:p,value:d})),d.push(f),u=!0}}}catch(e){c.e(e)}finally{c.f()}return u?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u,c=a.value,l=s(c.value);try{for(l.s();!(u=l.n()).done;){var f=u.value,p=d(e||n.getNamespace(),t,i.namespace,n);c.lang!==i.lang&&p.setAttribute("xml:lang",c.lang),p.children.push(f),n.appendChild(p)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildEnum=function(e,t){var n,r=new Map,i=new Map,a=s(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"==typeof o?(r.set(o,o),i.set(o,o)):(r.set(o[1],o[0]),i.set(o[0],o[1]))}}catch(e){a.e(e)}finally{a.f()}return{importer:function(t){var n,i=[],a=s(t.children);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"!=typeof o&&(o.getNamespace()===(e||t.getNamespace())&&r.has(o.getName())&&i.push(r.get(o.getName())))}}catch(e){a.e(e)}finally{a.f()}return i},exporter:function(t,n){var r,a=s(n);try{for(a.s();!(r=a.n()).done;){var o=r.value;g(t,e,i.get(o))}}catch(e){a.e(e)}finally{a.f()}}}},t.splicePath=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{importer:function(i,a){var o=i.getChild(t,e||i.getNamespace());if(o){var u,c=[],l=s(o.children);try{for(l.s();!(u=l.n()).done;){var f=u.value;if("string"!=typeof f&&a.registry.getImportKey(f)===n){var p=a.registry.import(f);p&&c.push(p)}}}catch(e){l.e(e)}finally{l.f()}return r?c:c[0]}},exporter:function(r,i,a){var u,c=[],l=s(Array.isArray(i)?i:[i]);try{for(l.s();!(u=l.n()).done;){var f=u.value,p=a.registry.export(n,f,o(o({},a),{},{namespace:e||r.getNamespace()||void 0}));p&&c.push(p)}}catch(e){l.e(e)}finally{l.f()}if(c.length){var d,h=g(r,e||r.getNamespace(),t),v=s(c);try{for(v.s();!(d=v.n()).done;){var m=d.value;h.appendChild(m)}}catch(e){v.e(e)}finally{v.f()}}}}},t.staticValue=function(e){return{exporter:function(){},importer:function(){return e}}},t.childRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a=r.getChild(t,e||r.getNamespace());return a?n?i.sanitizers[n](a.toJSON()):a.toJSON():void 0}},exporter:function(r,i,a){"string"==typeof i&&(i=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON());if(n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}i&&r.appendChild(new f.default(i.name,i.attributes,i.children))}}},t.childLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=m(r,e||r.getNamespace(),t),u=v(o,i),c=s(o);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(h(l,i.lang)===u)return n?i.sanitizers[n](l.toJSON()):l.toJSON()}}catch(e){c.e(e)}finally{c.f()}return o[0]?n?i.sanitizers[n](o[0].toJSON()):o[0].toJSON():void 0}},exporter:function(r,i,a){"string"==typeof i&&(i=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON());if(i&&n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}if(i){var o,u=g(r,e||r.getNamespace(),t,a.lang),c=s(i.children);try{for(c.s();!(o=c.n()).done;){var l=o.value;"string"==typeof l?u.appendChild(l):l&&u.appendChild(new f.default(l.name,l.attributes,l.children))}}catch(e){c.e(e)}finally{c.f()}}}}},t.childAlternateLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=[],u=new Set,c=s(m(r,e||r.getNamespace(),t));try{for(c.s();!(a=c.n()).done;){var l=a.value,f=l.toJSON();if(n&&(f=i.sanitizers[n](f)),f){var p=h(l,i.lang);if(u.has(p))continue;o.push({lang:p,value:f}),u.add(p)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?o:void 0}},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=c.value;if("string"==typeof l)l=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(l,"</").concat(t,">")).toJSON();if(l&&n){if(!a.sanitizers||!a.sanitizers[n])continue;l=a.sanitizers[n](l)}if(l){var h=d(e||r.getNamespace(),t,a.namespace,r);r.appendChild(h),c.lang!==a.lang&&h.setAttribute("xml:lang",c.lang);var v,m=s(l.children);try{for(m.s();!(v=m.n()).done;){var g=v.value;"string"==typeof g?h.appendChild(g):h.appendChild(new f.default(g.name,g.attributes,g.children))}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){u.e(e)}finally{u.f()}}}},t.parameterMap=function(e,n,i,a){return{importer:function(r,o){var u,c={},l=m(r,e,n),f=(0,t.attribute)(i).importer,p=(0,t.attribute)(a).importer,d=s(l);try{for(d.s();!(u=d.n()).done;){var h=u.value;c[f(h,o)]=p(h,o)}}catch(e){d.e(e)}finally{d.f()}return c},exporter:function(o,s,u){for(var c=(0,t.attribute)(i).exporter,l=(0,t.attribute)(a).exporter,f=e||o.getNamespace(),p=0,h=Object.entries(s);p<h.length;p++){var v=r(h[p],2),m=v[0],g=v[1],y=d(f,n,u.namespace,o);c(y,m,u),s[m]&&l(y,g,u),o.appendChild(y)}}}}},function(e,t,n){"use strict";t.Readable=n(87),t.Writable=n(89),t.Duplex=n(37),t.Transform=n(91),t.PassThrough=n(247)},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,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){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}),t.parse=void 0;var f=n(15),p=n(20),d=n(41),h=(0,f.__importDefault)(n(40)),v=(0,f.__importDefault)(n(56));function m(e){return 97<=e&&e<=122||65<=e&&e<=90||58===e||95===e}function g(e){return 192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=767||880<=e&&e<=893||895<=e&&e<=8191||8204<=e&&e<=8205||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||65008<=e&&e<=65533||65536<=e&&e<=983039}function y(e){return m(e)||g(e)}function b(e){return m(e)||45===e||46===e||48<=e&&e<=57||183===e||768<=e&&e<=879||8255<=e&&e<=8256||g(e)}function _(e){return 32===e||10===e||13===e||9===e}var S=function(e){a(n,e);var t=l(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,n),(e=t.call(this)).allowComments=!0,e.attributes={},e.state=34,e.tagName="",e.haveDeclaration=!1,e.recordBuffer=[],void 0!==i.allowComments&&(e.allowComments=i.allowComments),e}return i(n,[{key:"write",value:function(e){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.codePointAt(0);switch(this.state){case 34:if(60===i){var a=void 0;try{a=(0,d.unescapeXML)(this.endRecord())}catch(e){return void this.emit("error",e)}a&&this.emit("text",a),this.transition(31);continue}this.record(r);continue;case 31:if(47===i){this.transition(7);continue}if(33===i){this.transition(24);continue}if(63===i){if(this.haveDeclaration)return this.restrictedXML();this.transition(25);continue}if(y(i)){this.transition(30),this.startRecord(r);continue}return this.notWellFormed();case 30:if(b(i)){this.record(r);continue}if(_(i)){this.startTag(),this.transition(32);continue}if(47===i){this.startTag(),this.transition(29);continue}if(62===i){this.startTag(),this.transition(34),this.emit("startElement",this.tagName,this.attributes);continue}return this.notWellFormed();case 29:if(62===i){this.emit("startElement",this.tagName,this.attributes),this.emit("endElement",this.tagName),this.transition(34);continue}return this.notWellFormed();case 33:if(_(i)){this.transition(32);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 32:if(_(i))continue;if(y(i)){this.startRecord(r),this.transition(0);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 7:if(y(i)){this.startRecord(r),this.transition(6);continue}return this.notWellFormed();case 6:if(b(i)){this.record(r);continue}if(_(i)){this.transition(8);continue}if(62===i){var o=this.endRecord();this.emit("endElement",o,this.attributes),this.transition(34);continue}return this.notWellFormed();case 8:if(_(i))continue;if(62===i){var s=this.endRecord();this.emit("endElement",s,this.attributes),this.transition(34);continue}return this.notWellFormed();case 0:if(b(i)){this.record(r);continue}if(61===i){this.addAttribute(),this.transition(4);continue}if(_(i)){this.addAttribute(),this.transition(3);continue}return this.notWellFormed();case 3:if(61===i){this.transition(4);continue}if(_(i))continue;return this.notWellFormed();case 4:if(34===i){this.startRecord(),this.transition(1);continue}if(39===i){this.startRecord(),this.transition(2);continue}if(_(i))continue;return this.notWellFormed();case 1:case 2:if(34===i&&1===this.state||39===i&&2===this.state){var c=this.endRecord();this.attributes[this.attributeName]=(0,d.unescapeXML)(c),this.transition(33);continue}if(60===i)return this.notWellFormed();this.record(r);continue;case 24:if(45===i){if(!this.allowComments)return this.restrictedXML();this.transition(23);continue}if(91===i){this.transition(21);continue}return this.notWellFormed();case 23:if(45===i){this.transition(14);continue}return this.notWellFormed();case 14:45===i&&this.transition(12);continue;case 12:45===i?this.transition(11):this.transition(14);continue;case 11:62===i?this.transition(34):this.transition(14);continue;case 25:if(88===i||120===i){this.transition(28);continue}return this.notWellFormed();case 28:if(77===i||109===i){this.transition(27);continue}return this.notWellFormed();case 27:if(76===i||108===i){this.transition(26);continue}return this.notWellFormed();case 26:if(_(i)){this.haveDeclaration=!0,this.transition(15);continue}return this.notWellFormed();case 13:if(62===i){this.transition(34);continue}return this.notWellFormed();case 15:63===i&&this.transition(13);continue;case 21:this.wait(i,67,20);continue;case 20:this.wait(i,68,19);continue;case 19:this.wait(i,65,18);continue;case 18:this.wait(i,84,17);continue;case 17:this.wait(i,65,16);continue;case 16:this.wait(i,91,5);continue;case 5:if(93===i){this.transition(10);continue}this.record(r);continue;case 10:93===i?this.transition(9):(this.record(String.fromCodePoint(93)),this.record(r),this.transition(5));continue;case 9:if(62===i){var l=this.endRecord();l&&this.emit("text",l),this.transition(34)}else this.record(String.fromCodePoint(93)),this.record(String.fromCodePoint(93)),this.record(r),this.transition(5);continue}}}catch(e){n.e(e)}finally{n.f()}}},{key:"end",value:function(e){e&&this.write(e),this.write=function(){}}},{key:"record",value:function(e){this.recordBuffer.push(e)}},{key:"startRecord",value:function(e){this.recordBuffer=[],e&&this.recordBuffer.push(e)}},{key:"endRecord",value:function(){var e=this.recordBuffer;return this.recordBuffer=[],e.join("")}},{key:"startTag",value:function(){this.tagName=this.endRecord(),this.attributes={}}},{key:"addAttribute",value:function(){var e=this.endRecord();if(void 0!==this.attributes[e])return this.notWellFormed();this.attributeName=e,this.attributes[e]=""}},{key:"wait",value:function(e,t,n){if(e!==t)return this.notWellFormed();this.transition(n)}},{key:"transition",value:function(e){this.state=e,34===e&&this.startRecord()}},{key:"notWellFormed",value:function(e){this.emit("error",v.default.notWellFormed(e))}},{key:"restrictedXML",value:function(e){this.emit("error",v.default.restrictedXML(e))}}]),n}(p.EventEmitter);t.parse=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new S(r),a=null;if(i.on("text",(function(e){n&&n.children.push(e)})),i.on("startElement",(function(e,r){var i=new h.default(e,r);t||(t=i),n=n?n.appendChild(i):i})),i.on("endElement",(function(e){n?e===n.name?n.parent&&(n=n.parent):i.emit("error",v.default.notWellFormed("b")):i.emit("error",v.default.notWellFormed("a"))})),i.on("error",(function(e){a=e})),i.write(e),i.end(),a)throw a;return t},t.default=S},function(e,t,n){"use strict";var r=n(4),i=n(11),a=n(3),o=n(9),s=n(6),u=n(7),c=n(24),l=n(43),f=n(16),p=n(17),d=n(14);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,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 g(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 g(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 g(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 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.StanzaMediaSession=void 0;var b=n(36),_=b.__importDefault(n(20)),S=n(61),w=n(18),x=b.__importDefault(n(95)),k=n(33),O={"Discovered new ICE candidate":{skipMessage:!0}},T=function(e){f(p,e);var t,n,r=y(p);function p(e){var t;s(this,p),(t=r.call(this,e.options)).iceCandidatesDiscovered=0,t.iceCandidatesReceivedFromPeer=0,t.reinvite=!1,t.logger=e.logger,t.conversationId=e.conversationId,t.peerConnection=t.pc,t.fromUserId=e.fromUserId,t.meetingId=e.meetingId,t.id=t.sid,t.originalRoomJid=e.originalRoomJid,t.sessionType=k.SessionTypes[e.sessionType],t.ignoreHostCandidatesFromRemote=!!e.ignoreHostCandidatesFromRemote,t.allowIPv6=!!e.allowIPv6,t.allowTCP=!!e.allowTCP,t.privAnswerMode=e.privAnswerMode;var n=new _.default;return Object.keys(n.__proto__).forEach((function(e){t[e]=n[e]})),e.optOutOfWebrtcStatsTelemetry||t.setupStatsGatherer(),t.pc.addEventListener("connectionstatechange",t.onConnectionStateChange.bind(c(t))),t.pc.addEventListener("icecandidateerror",t.onIceCandidateError.bind(c(t))),t}return u(p,[{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"onTransportInfo",value:(n=o(a.mark((function e(t,n){var r,i,o,s,u,c,f,h;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(r=t.contents)||void 0===r?void 0:r[0].transport,s=null==o?void 0:o.candidates,this.ignoreHostCandidatesFromRemote&&(null==(u=null==s?void 0:s.filter((function(e){return"host"!==e.type})))?void 0:u.length)!==(null===(i=null==o?void 0:o.candidates)||void 0===i?void 0:i.length)&&(this._log("info","Ignoring remote host ice candidates"),o.candidates=u),s){c=m(s);try{for(c.s();!(f=c.n()).done;)h=f.value,this._log("info","Received candidate from peer",{candidateType:h.type}),this.iceCandidatesReceivedFromPeer++}catch(e){c.e(e)}finally{c.f()}}return e.abrupt("return",l(d(p.prototype),"onTransportInfo",this).call(this,t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"_log",value:function(e,t){var n=O[t];if(!(null==n?void 0:n.skipMessage)){for(var r,a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];if(o.length){var u=o[0];"object"!==i(u)||Array.isArray(u)||null===u?r=v(v({},this.getLogDetails()),{},{data:u}):(Object.assign(o[0],this.getLogDetails()),r=o)}else r=[].concat(o,[this.getLogDetails()]);this.logger[e](t,r)}}},{key:"end",value:(t=o(a.mark((function e(){var t,n,r=this,i=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=i.length>0&&void 0!==i[0]?i[0]:"success",n=i.length>1&&void 0!==i[1]&&i[1],this.state="ended",this.processingQueue.kill(),"string"==typeof t&&(t={condition:t}),n||(this._log("info","sending jingle session-terminate"),this.send("session-terminate",{reason:t})),setTimeout((function(){"connected"!==r.pc.connectionState&&"connecting"!==r.pc.connectionState||r.pc.close()}),2e3),this.parent.emit("terminated",this,t),this.parent.forgetSession(this);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new x.default(this.pc),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:function(){var e=this.pc.iceConnectionState,t=this.id,n=this.conversationId,r=this.sessionType;this._log("info","ICE state changed: ",{iceState:e,sessionId:t,conversationId:n}),"disconnected"===e?"stable"===this.pc.signalingState&&(this.interruptionStart=new Date,this._log("info","Connection state is interrupted",{sessionId:t,conversationId:n,sessionType:r})):"connected"===e?(this._log("info","sending session-info: active"),this.send(w.JingleAction.SessionInfo,{info:{infoType:w.JINGLE_INFO_ACTIVE}}),this._setupDataChannel()):"failed"===e&&this._log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer}),l(d(p.prototype),"onIceStateChange",this).call(this)}},{key:"onConnectionStateChange",value:function(){var e=this.pc.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if(this._log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this._log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&this._log("info","Connection was interrupted and failed to recover",{sessionId:t,conversationId:n,sessionType:r})}},{key:"onIceCandidateError",value:function(e){var t=e;this._log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url}),console.error("IceCandidateError",t)}},{key:"onIceCandidate",value:function(e){if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var t=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(t&&!t[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this._log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this._log("debug","Processing ice candidate",e.candidate.candidate),this._log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++}return l(d(p.prototype),"onIceCandidate",this).call(this,e)}},{key:"onIceEndOfCandidates",value:function(){l(d(p.prototype),"onIceEndOfCandidates",this).call(this),this.emit("endOfCandidates")}},{key:"addTrack",value:function(e,t){var n=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",o(a.mark((function r(){var i;return a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(i=n.pc.getTransceivers().find((function(t){var n;return!t.sender.track&&(null===(n=t.receiver.track)||void 0===n?void 0:n.kind)===e.kind})))){r.next=3;break}return r.abrupt("return",i.sender.replaceTrack(e));case 3:return n.pc.addTrack(e,t),r.abrupt("return");case 5:case"end":return r.stop()}}),r)}))))}},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.pc.localDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this._log("info","creating data channel"),this.dataChannel=this.pc.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",(function(){t._log("info","data channel opened")})),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",(function(){t._log("info","closing data channel")})),this.dataChannel.addEventListener("error",(function(e){t._log("error","Error occurred with the data channel",e)})))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this._log("error","Failed to parse data channel message",{error:e})}}}]),p}(S.MediaSession);t.StanzaMediaSession=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=t.FileSession=t.MediaSession=t.ICESession=t.Session=t.exportToSDP=t.importFromSDP=void 0;var r=n(15),i=(0,r.__importDefault)(n(92));t.FileSession=i.default;var a=(0,r.__importDefault)(n(62));t.ICESession=a.default;var o=(0,r.__importDefault)(n(94));t.MediaSession=o.default;var s=(0,r.__importDefault)(n(64));t.Session=s.default;var u=(0,r.__importDefault)(n(257));t.SessionManager=u.default;var c=n(44);Object.defineProperty(t,"importFromSDP",{enumerable:!0,get:function(){return c.importFromSDP}}),Object.defineProperty(t,"exportToSDP",{enumerable:!0,get:function(){return c.exportToSDP}})},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(4),s=n(6),u=n(7),c=n(24),l=n(43),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){o(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});var b=n(15),_=(0,b.__importStar)(n(93)),S=n(18),w=n(2),x=n(44),k=n(63),O=function(e){f(b,e);var t,n,o,p,v,m=y(b);function b(e){var t;return s(this,b),(t=m.call(this,e)).bitrateLimit=0,t.candidateBuffer=[],t.transportType=w.NS_JINGLE_ICE_UDP_1,t.restartingIce=!1,t.usingRelay=!1,t.maxRelayBandwidth=e.maxRelayBandwidth,t.pc=t.parent.createPeerConnection(c(t),g(g({},e.config),{},{iceServers:e.iceServers})),t.pc.oniceconnectionstatechange=function(){t.onIceStateChange()},t.pc.onicecandidate=function(e){e.candidate?t.onIceCandidate(e):t.onIceEndOfCandidates()},t.restrictRelayBandwidth(),t}return u(b,[{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.pc.close(),l(d(b.prototype),"end",this).call(this,e,t)}},{key:"restartIce",value:(v=a(i.mark((function e(){var t=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isInitiator){e.next=2;break}return e.abrupt("return");case 2:return void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this.restartingIce=!0,e.prev=4,e.next=7,this.processLocal("restart-ice",a(i.mark((function e(){var n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.pc.createOffer({iceRestart:!0});case 2:return n=e.sent,r=(0,x.importFromSDP)(n.sdp),t.send(S.JingleAction.TransportInfo,{contents:r.media.map((function(e){return{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:(0,k.convertIntermediateToTransport)(e,t.transportType)}})),sid:t.sid}),e.next=7,t.pc.setLocalDescription(n);case 7:case"end":return e.stop()}}),e)}))));case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(4),this._log("error","Could not create WebRTC offer",e.t0),this.end(S.JingleReasonCondition.FailedTransport,!0);case 13:case"end":return e.stop()}}),e,this,[[4,9]])}))),function(){return v.apply(this,arguments)})},{key:"setMaximumBitrate",value:(p=a(i.mark((function e(t){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.maximumBitrate&&(t=Math.min(t,this.maximumBitrate)),this.currentBitrate=t,(n=this.pc.getSenders().find((function(e){return!!e.track&&"video"===e.track.kind})))&&n.getParameters){e.next=5;break}return e.abrupt("return");case 5:return e.prev=5,e.next=8,this.processLocal("set-bitrate",a(i.mark((function e(){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=n.getParameters()).encodings&&r.encodings.length||(r.encodings=[{}]),0===t?delete r.encodings[0].maxBitrate:r.encodings[0].maxBitrate=t,e.next=5,n.setParameters(r);case 5:case"end":return e.stop()}}),e)}))));case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),this._log("error","Set maximumBitrate failed",e.t0);case 13:case"end":return e.stop()}}),e,this,[[5,10]])}))),function(e){return p.apply(this,arguments)})},{key:"onTransportInfo",value:(o=a(i.mark((function e(t,n){var o,s,u,c,l,f,p,d,v,m,g,y,b,w,O,T=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.contents&&t.contents[0]&&t.contents[0].transport.gatheringComplete)){e.next=18;break}if(o={sdpMid:t.contents[0].name,candidate:""},e.prev=2,"stable"!==this.pc.signalingState){e.next=8;break}return e.next=6,this.pc.addIceCandidate(o);case 6:e.next=9;break;case 8:this.candidateBuffer.push(o);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),this._log("debug","Could not add null end-of-candidate");case 14:return e.prev=14,n(),e.finish(14);case 17:return e.abrupt("return");case 18:if(!this.pc.remoteDescription){e.next=51;break}if(s=this.pc.remoteDescription,u=(0,x.importFromSDP)(s.sdp),c=u.media.find((function(e){return e.mid===t.contents[0].name})),l=c.iceParameters.usernameFragment,!(f=t.contents[0].transport.usernameFragment)||l===f){e.next=51;break}p=h(t.contents.entries());try{for(p.s();!(d=p.n()).done;)v=r(d.value,2),m=v[0],g=v[1],y=g.transport,u.media[m].iceParameters={password:y.password,usernameFragment:y.usernameFragment},u.media[m].candidates=[]}catch(e){p.e(e)}finally{p.f()}return e.prev=27,e.next=30,this.pc.setRemoteDescription({type:s.type,sdp:(0,x.exportToSDP)(u)});case 30:return e.next=32,this.processBufferedCandidates();case 32:if("offer"!==s.type){e.next=42;break}return e.next=35,this.pc.createAnswer();case 35:return b=e.sent,e.next=38,this.pc.setLocalDescription(b);case 38:w=(0,x.importFromSDP)(b.sdp),this.send(S.JingleAction.TransportInfo,{contents:w.media.map((function(e){return{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:(0,k.convertIntermediateToTransport)(e,T.transportType)}})),sid:this.sid}),e.next=43;break;case 42:this.restartingIce=!1;case 43:e.next=51;break;case 45:return e.prev=45,e.t1=e.catch(27),this._log("error","Could not do remote ICE restart",e.t1),n(e.t1),this.end(S.JingleReasonCondition.FailedTransport),e.abrupt("return");case 51:return O=(t.contents||[]).map((function(e){var t=e.name,n=(e.transport.candidates||[]).map(function(){var e=a(i.mark((function e(n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_.writeCandidate((0,k.convertCandidateToIntermediate)(n)),!T.pc.remoteDescription||"stable"!==T.pc.signalingState){e.next=12;break}return e.prev=2,e.next=5,T.pc.addIceCandidate({sdpMid:t,candidate:r});case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),T._log("error","Could not add ICE candidate",e.t0);case 10:e.next=13;break;case 12:T.candidateBuffer.push({sdpMid:t,candidate:r});case 13:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(t){return e.apply(this,arguments)}}());return Promise.all(n)})),e.prev=52,e.next=55,Promise.all(O);case 55:n(),e.next=62;break;case 58:e.prev=58,e.t2=e.catch(52),this._log("error","Could not process transport-info: ".concat(e.t2)),n(e.t2);case 62:case"end":return e.stop()}}),e,this,[[2,11,14,17],[27,45],[52,58]])}))),function(e,t){return o.apply(this,arguments)})},{key:"onSessionAccept",value:(n=a(i.mark((function e(t,n){var r,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",r=(0,k.convertRequestToIntermediate)(t,this.peerRole),a=(0,x.exportToSDP)(r),e.prev=3,e.next=6,this.pc.setRemoteDescription({type:"answer",sdp:a});case 6:return e.next=8,this.processBufferedCandidates();case 8:this.parent.emit("accepted",this,void 0),n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(3),this._log("error","Could not process WebRTC answer: ".concat(e.t0)),n({condition:"general-error"});case 16:case"end":return e.stop()}}),e,this,[[3,12]])}))),function(e,t){return n.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,t){this._log("info","Terminating session"),this.pc.close(),l(d(b.prototype),"end",this).call(this,e.reason,!0),t()}},{key:"onIceCandidate",value:function(e){if(e.candidate&&e.candidate.candidate){var t=_.parseCandidate(e.candidate.candidate),n={contents:[{creator:S.JingleSessionRole.Initiator,name:e.candidate.sdpMid,transport:{candidates:[(0,k.convertIntermediateToCandidate)(t)],transportType:this.transportType,usernameFragment:t.usernameFragment}}]};this._log("info","Discovered new ICE candidate",n),this.send(S.JingleAction.TransportInfo,n)}}},{key:"onIceEndOfCandidates",value:function(){this._log("info","ICE end of candidates");var e=(0,x.importFromSDP)(this.pc.localDescription.sdp).media[0];this.send(S.JingleAction.TransportInfo,{contents:[{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:{gatheringComplete:!0,transportType:this.transportType,usernameFragment:e.iceParameters.usernameFragment}}]})}},{key:"onIceStateChange",value:function(){switch(this.pc.iceConnectionState){case"checking":this.connectionState="connecting";break;case"completed":case"connected":this.connectionState="connected";break;case"disconnected":if("stable"===this.pc.signalingState?this.connectionState="interrupted":this.connectionState="disconnected",this.restartingIce)return void this.end(S.JingleReasonCondition.FailedTransport);this.maybeRestartIce();break;case"failed":if("failed"===this.connectionState||this.restartingIce)return void this.end(S.JingleReasonCondition.FailedTransport);this.connectionState="failed",this.restartIce();break;case"closed":this.connectionState="disconnected",this.restartingIce?this.end(S.JingleReasonCondition.FailedTransport):this.end()}}},{key:"processBufferedCandidates",value:(t=a(i.mark((function e(){var t,n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=h(this.candidateBuffer),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=15;break}return r=n.value,e.prev=5,e.next=8,this.pc.addIceCandidate(r);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),this._log("error","Could not add ICE candidate",e.t0);case 13:e.next=3;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(1),t.e(e.t1);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.candidateBuffer=[];case 24:case"end":return e.stop()}}),e,this,[[1,17,20,23],[5,10]])}))),function(){return t.apply(this,arguments)})},{key:"restrictRelayBandwidth",value:function(){var e=this;this.pc.addEventListener("iceconnectionstatechange",a(i.mark((function t(){var n,r,a,o,s,u,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("completed"===e.pc.iceConnectionState||"connected"===e.pc.iceConnectionState){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.pc.getStats();case 4:if((n=t.sent).forEach((function(e){"transport"===e.type&&(r=n.get(e.selectedCandidatePairId))})),r||n.forEach((function(e){"candidate-pair"===e.type&&e.selected&&(r=e)})),r){t.next=9;break}return t.abrupt("return");case 9:a=!1,o="",s="",r.remoteCandidateId&&(u=n.get(r.remoteCandidateId))&&(s=u.candidateType),r.localCandidateId&&(c=n.get(r.localCandidateId))&&(o=c.candidateType),"relay"!==o&&"relay"!==s||(a=!0),e.usingRelay=a,e.parent.emit("iceConnectionType",e,{localCandidateType:o,relayed:a,remoteCandidateType:s}),a&&void 0!==e.maxRelayBandwidth&&(e.maximumBitrate=e.maxRelayBandwidth,e.currentBitrate?e.setMaximumBitrate(Math.min(e.currentBitrate,e.maximumBitrate)):e.setMaximumBitrate(e.maximumBitrate));case 18:case"end":return t.stop()}}),t)}))))}},{key:"maybeRestartIce",value:function(){var e=this;this.isInitiator&&(void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this._maybeRestartingIce=setTimeout((function(){e._maybeRestartingIce=void 0,"disconnected"===e.pc.iceConnectionState&&e.restartIce()}),2e3))}}]),b}((0,b.__importDefault)(n(64)).default);t.default=O},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.convertRequestToIntermediate=t.convertContentToIntermediate=t.convertIntermediateToRequest=t.convertIntermediateToTransport=t.convertCandidateToIntermediate=t.convertIntermediateToCandidate=t.convertIntermediateToApplication=void 0;var a=n(18),o=n(2);function s(e,t){var n=e.rtpParameters,i=e.rtcpParameters||{},s=e.rtpEncodingParameters||[],u=!1;s&&s.length&&(u=!!s[0].ssrc);var c,l={applicationType:o.NS_JINGLE_RTP_1,codecs:[],headerExtensions:[],media:e.kind,rtcpMux:i.mux,rtcpReducedSize:i.reducedSize,sourceGroups:[],sources:[],ssrc:u?s[0].ssrc.toString():void 0,streams:[]},f=r(n.headerExtensions||[]);try{for(f.s();!(c=f.n()).done;){var p=c.value,d={id:p.id,uri:p.uri};p.direction&&"sendrecv"!==p.direction&&(d.senders=(0,a.directionToSenders)(t,p.direction)),l.headerExtensions.push(d)}}catch(e){f.e(e)}finally{f.f()}i.ssrc&&i.cname&&(l.sources=[{parameters:{cname:i.cname},ssrc:i.ssrc.toString()}]),u&&s[0]&&s[0].rtx&&(l.sourceGroups=[{semantics:"FID",sources:[s[0].ssrc.toString(),s[0].rtx.ssrc.toString()]}]);var h,v=r(e.streams||[]);try{for(v.s();!(h=v.n()).done;){var m=h.value;l.streams.push({id:m.stream,track:m.track})}}catch(e){v.e(e)}finally{v.f()}var g,y=r(n.codecs||[]);try{for(y.s();!(g=y.n()).done;){var b=g.value,_={channels:b.channels,clockRate:b.clockRate,id:b.payloadType.toString(),name:b.name,parameters:b.parameters,rtcpFeedback:b.rtcpFeedback};b.maxptime&&(_.maxptime=b.maxptime),b.parameters&&b.parameters.ptime&&(_.ptime=parseInt(b.parameters.ptime,10)),l.codecs.push(_)}}catch(e){y.e(e)}finally{y.f()}return l}function u(e){return{component:"rtp"===e.component?1:"rtcp"===e.component?2:e.component,foundation:e.foundation,generation:void 0,id:void 0,ip:e.ip,network:void 0,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function c(e){return{address:e.ip,component:1===e.component?"rtp":2===e.component?"rtcp":e.component,foundation:e.foundation,ip:e.ip,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function l(e,t){var n=e.iceParameters,i=e.dtlsParameters,a={candidates:[],transportType:t};n&&(a.usernameFragment=n.usernameFragment,a.password=n.password,n.iceLite&&(a.iceLite=!0)),i&&(a.fingerprints=i.fingerprints.map((function(t){return{algorithm:t.algorithm,setup:e.setup,value:t.value}}))),e.sctp&&(a.sctp=e.sctp);var o,s=r(e.candidates||[]);try{for(s.s();!(o=s.n()).done;){var c=o.value;a.candidates.push(u(c))}}catch(e){s.e(e)}finally{s.f()}return a}function f(e,t){var n=e.application||{},i=e.transport,s=n&&n.applicationType===o.NS_JINGLE_RTP_1,u={direction:(0,a.sendersToDirection)(t,e.senders),kind:n.media||"application",mid:e.name,protocol:s?"UDP/TLS/RTP/SAVPF":"UDP/DTLS/SCTP"};if(s){if(u.rtcpParameters={compound:!n.rtcpReducedSize,mux:n.rtcpMux,reducedSize:n.rtcpReducedSize},n.sources&&n.sources.length){var l=n.sources[0];u.rtcpParameters.ssrc=parseInt(l.ssrc,10),l.parameters&&(u.rtcpParameters.cname=l.parameters.cname)}if(u.rtpParameters={codecs:[],fecMechanisms:[],headerExtensions:[],rtcp:[]},n.streams){u.streams=[];var f,p=r(n.streams);try{for(p.s();!(f=p.n()).done;){var d=f.value;u.streams.push({stream:d.id,track:d.track})}}catch(e){p.e(e)}finally{p.f()}}if(n.ssrc&&(u.rtpEncodingParameters=[{ssrc:parseInt(n.ssrc,10)}],n.sourceGroups&&n.sourceGroups.length)){var h=n.sourceGroups[0];u.rtpEncodingParameters[0].rtx={ssrc:parseInt(h.sources[1],10)}}var v,m=!1,g=!1,y=r(n.codecs||[]);try{for(y.s();!(v=y.n()).done;){var b,_=v.value,S=_.parameters||{},w=[],x=r(_.rtcpFeedback||[]);try{for(x.s();!(b=x.n()).done;){var k=b.value;w.push({parameter:k.parameter,type:k.type})}}catch(e){x.e(e)}finally{x.f()}if("red"===_.name||"ulpfec"===_.name){m=m||"red"===_.name,g=g||"ulpfec"===_.name;var O=_.name.toUpperCase();u.rtpParameters.fecMechanisms.includes(O)||u.rtpParameters.fecMechanisms.push(O)}u.rtpParameters.codecs.push({channels:_.channels,clockRate:_.clockRate,name:_.name,numChannels:_.channels,parameters:S,payloadType:parseInt(_.id,10),rtcpFeedback:w})}}catch(e){y.e(e)}finally{y.f()}var T,A=r(n.headerExtensions||[]);try{for(A.s();!(T=A.n()).done;){var I=T.value;u.rtpParameters.headerExtensions.push({direction:(0,a.sendersToDirection)(t,I.senders||"both"),id:I.id,uri:I.uri,attributes:void 0})}}catch(e){A.e(e)}finally{A.f()}}if(i){if(i.usernameFragment&&i.password&&(u.iceParameters={password:i.password,usernameFragment:i.usernameFragment},i.iceLite&&(u.iceParameters.iceLite=!0)),i.fingerprints&&i.fingerprints.length){u.dtlsParameters={fingerprints:[],role:"auto"};var E,N=r(i.fingerprints);try{for(N.s();!(E=N.n()).done;){var R=E.value;u.dtlsParameters.fingerprints.push({algorithm:R.algorithm,value:R.value})}}catch(e){N.e(e)}finally{N.f()}i.sctp&&(u.sctp=i.sctp),u.setup=i.fingerprints[0].setup}u.candidates=(i.candidates||[]).map(c)}return u}t.convertIntermediateToApplication=s,t.convertIntermediateToCandidate=u,t.convertCandidateToIntermediate=c,t.convertIntermediateToTransport=l,t.convertIntermediateToRequest=function(e,t,n){return{contents:e.media.map((function(e){return{application:"audio"===e.kind||"video"===e.kind?s(e,t):{applicationType:"datachannel",protocol:e.protocol},creator:a.JingleSessionRole.Initiator,name:e.mid,senders:(0,a.directionToSenders)(t,e.direction),transport:l(e,n)}})),groups:e.groups?e.groups.map((function(e){return{contents:e.mids,semantics:e.semantics}})):[]}},t.convertContentToIntermediate=f,t.convertRequestToIntermediate=function(e,t){var n,i={groups:[],media:[]},a=r(e.groups||[]);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.groups.push({mids:o.contents,semantics:o.semantics})}}catch(e){a.e(e)}finally{a.f()}var s,u=r(e.contents||[]);try{for(u.s();!(s=u.n()).done;){var c=s.value;i.media.push(f(c,t))}}catch(e){u.e(e)}finally{u.f()}return i}},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});var s=n(65),u=n(18),c=n(27),l={condition:u.StanzaErrorCondition.BadRequest},f={condition:u.StanzaErrorCondition.FeatureNotImplemented,jingleError:u.JingleErrorCondition.UnsupportedInfo,type:"modify"},p=function(){function e(t){var n=this;a(this,e),this.parent=t.parent,this.sid=t.sid||(0,c.uuid)(),this.peerID=t.peerID,this.role=t.initiator?u.JingleSessionRole.Initiator:u.JingleSessionRole.Responder,this._sessionState="starting",this._connectionState="starting",this.pendingApplicationTypes=t.applicationTypes||[],this.pendingAction=void 0,this.processingQueue=(0,s.priorityQueue)(function(){var e=i(r.mark((function e(t,i){var a,o,s,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ended"!==n.state){e.next=4;break}return"local"===t.type&&t.reject&&t.reject(new Error("Session ended")),i&&i(),e.abrupt("return");case 4:if("local"!==t.type){e.next=18;break}return n._log("debug","Processing local action:",t.name),e.prev=6,e.next=9,t.handler();case 9:a=e.sent,t.resolve(a),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t.reject(e.t0);case 16:return i&&i(),e.abrupt("return");case 18:return o=t.action,s=t.changes,c=t.cb,n._log("debug","Processing remote action:",o),e.abrupt("return",new Promise((function(e){var t=function(t,n){c(t,n),i&&i(),e()};switch(o){case u.JingleAction.ContentAccept:return n.onContentAccept(s,t);case u.JingleAction.ContentAdd:return n.onContentAdd(s,t);case u.JingleAction.ContentModify:return n.onContentModify(s,t);case u.JingleAction.ContentReject:return n.onContentReject(s,t);case u.JingleAction.ContentRemove:return n.onContentRemove(s,t);case u.JingleAction.DescriptionInfo:return n.onDescriptionInfo(s,t);case u.JingleAction.SecurityInfo:return n.onSecurityInfo(s,t);case u.JingleAction.SessionAccept:return n.onSessionAccept(s,t);case u.JingleAction.SessionInfo:return n.onSessionInfo(s,t);case u.JingleAction.SessionInitiate:return n.onSessionInitiate(s,t);case u.JingleAction.SessionTerminate:return n.onSessionTerminate(s,t);case u.JingleAction.TransportAccept:return n.onTransportAccept(s,t);case u.JingleAction.TransportInfo:return n.onTransportInfo(s,t);case u.JingleAction.TransportReject:return n.onTransportReject(s,t);case u.JingleAction.TransportReplace:return n.onTransportReplace(s,t);default:n._log("error","Invalid or unsupported action: "+o),t({condition:u.StanzaErrorCondition.BadRequest})}})));case 21:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(t,n){return e.apply(this,arguments)}}(),1)}return o(e,[{key:"send",value:function(e,t){(t=t||{}).sid=this.sid,t.action=e,new Set([u.JingleAction.ContentAccept,u.JingleAction.ContentAdd,u.JingleAction.ContentModify,u.JingleAction.ContentReject,u.JingleAction.ContentRemove,u.JingleAction.SessionAccept,u.JingleAction.SessionInitiate,u.JingleAction.TransportAccept,u.JingleAction.TransportReject,u.JingleAction.TransportReplace]).has(e)?this.pendingAction=e:this.pendingAction=void 0,this.parent.signal(this,{id:(0,c.uuid)(),jingle:t,to:this.peerID,type:"set"})}},{key:"processLocal",value:function(e,t){var n=this;return new Promise((function(r,i){n.processingQueue.push({handler:t,name:e,reject:i,resolve:r,type:"local"},1)}))}},{key:"process",value:function(e,t,n){this.processingQueue.push({action:e,cb:n,changes:t,type:"remote"},2)}},{key:"start",value:function(e,t){this._log("error","Can not start base sessions"),this.end("unsupported-applications",!0)}},{key:"accept",value:function(e,t){this._log("error","Can not accept base sessions"),this.end("unsupported-applications")}},{key:"cancel",value:function(){this.end("cancel")}},{key:"decline",value:function(){this.end("decline")}},{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state="ended",this.processingQueue.kill(),"string"==typeof e&&(e={condition:e}),t||this.send("session-terminate",{reason:e}),this.parent.emit("terminated",this,e),this.parent.forgetSession(this)}},{key:"_log",value:function(e,t){if(this.parent){var n,r;t=this.sid+": "+t;for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];(n=this.parent).emit.apply(n,["log",e,t].concat(a)),(r=this.parent).emit.apply(r,["log:"+e,t].concat(a))}}},{key:"onSessionInitiate",value:function(e,t){t()}},{key:"onSessionAccept",value:function(e,t){t()}},{key:"onSessionTerminate",value:function(e,t){this.end(e.reason,!0),t()}},{key:"onSessionInfo",value:function(e,t){e.info?t(f):t()}},{key:"onSecurityInfo",value:function(e,t){t(f)}},{key:"onDescriptionInfo",value:function(e,t){t(f)}},{key:"onTransportInfo",value:function(e,t){t(f)}},{key:"onContentAdd",value:function(e,t){t(),this.send(u.JingleAction.ContentReject,{reason:{condition:u.JingleReasonCondition.FailedApplication,text:"content-add is not supported"}})}},{key:"onContentAccept",value:function(e,t){t(l)}},{key:"onContentReject",value:function(e,t){t(l)}},{key:"onContentModify",value:function(e,t){t(l)}},{key:"onContentRemove",value:function(e,t){t(l)}},{key:"onTransportReplace",value:function(e,t){t(),this.send(u.JingleAction.TransportReject,{reason:{condition:u.JingleReasonCondition.FailedTransport,text:"transport-replace is not supported"}})}},{key:"onTransportAccept",value:function(e,t){t(l)}},{key:"onTransportReject",value:function(e,t){t(l)}},{key:"isInitiator",get:function(){return this.role===u.JingleSessionRole.Initiator}},{key:"peerRole",get:function(){return this.isInitiator?u.JingleSessionRole.Responder:u.JingleSessionRole.Initiator}},{key:"state",get:function(){return this._sessionState},set:function(e){e!==this._sessionState&&(this._log("info","Changing session state to: "+e),this._sessionState=e,this.parent&&this.parent.emit("sessionState",this,e))}},{key:"connectionState",get:function(){return this._connectionState},set:function(e){e!==this._connectionState&&(this._log("info","Changing connection state to: "+e),this._connectionState=e,this.parent&&this.parent.emit("connectionState",this,e))}}]),e}();t.default=p},function(e,t,n){"use strict";n.r(t),n.d(t,"all",(function(){return we})),n.d(t,"allLimit",(function(){return xe})),n.d(t,"allSeries",(function(){return ke})),n.d(t,"any",(function(){return ut})),n.d(t,"anyLimit",(function(){return ct})),n.d(t,"anySeries",(function(){return lt})),n.d(t,"apply",(function(){return l})),n.d(t,"applyEach",(function(){return B})),n.d(t,"applyEachSeries",(function(){return U})),n.d(t,"asyncify",(function(){return y})),n.d(t,"auto",(function(){return G})),n.d(t,"autoInject",(function(){return K})),n.d(t,"cargo",(function(){return Z})),n.d(t,"cargoQueue",(function(){return ee})),n.d(t,"compose",(function(){return re})),n.d(t,"concat",(function(){return oe})),n.d(t,"concatLimit",(function(){return ae})),n.d(t,"concatSeries",(function(){return se})),n.d(t,"constant",(function(){return ue})),n.d(t,"default",(function(){return wt})),n.d(t,"detect",(function(){return le})),n.d(t,"detectLimit",(function(){return fe})),n.d(t,"detectSeries",(function(){return pe})),n.d(t,"dir",(function(){return he})),n.d(t,"doDuring",(function(){return ve})),n.d(t,"doUntil",(function(){return me})),n.d(t,"doWhilst",(function(){return ve})),n.d(t,"during",(function(){return bt})),n.d(t,"each",(function(){return ye})),n.d(t,"eachLimit",(function(){return be})),n.d(t,"eachOf",(function(){return D})),n.d(t,"eachOfLimit",(function(){return C})),n.d(t,"eachOfSeries",(function(){return F})),n.d(t,"eachSeries",(function(){return _e})),n.d(t,"ensureAsync",(function(){return Se})),n.d(t,"every",(function(){return we})),n.d(t,"everyLimit",(function(){return xe})),n.d(t,"everySeries",(function(){return ke})),n.d(t,"filter",(function(){return Ie})),n.d(t,"filterLimit",(function(){return Ee})),n.d(t,"filterSeries",(function(){return Ne})),n.d(t,"find",(function(){return le})),n.d(t,"findLimit",(function(){return fe})),n.d(t,"findSeries",(function(){return pe})),n.d(t,"flatMap",(function(){return oe})),n.d(t,"flatMapLimit",(function(){return ae})),n.d(t,"flatMapSeries",(function(){return se})),n.d(t,"foldl",(function(){return te})),n.d(t,"foldr",(function(){return Ye})),n.d(t,"forEach",(function(){return ye})),n.d(t,"forEachLimit",(function(){return be})),n.d(t,"forEachOf",(function(){return D})),n.d(t,"forEachOfLimit",(function(){return C})),n.d(t,"forEachOfSeries",(function(){return F})),n.d(t,"forEachSeries",(function(){return _e})),n.d(t,"forever",(function(){return Re})),n.d(t,"groupBy",(function(){return Ce})),n.d(t,"groupByLimit",(function(){return je})),n.d(t,"groupBySeries",(function(){return Pe})),n.d(t,"inject",(function(){return te})),n.d(t,"log",(function(){return Me})),n.d(t,"map",(function(){return L})),n.d(t,"mapLimit",(function(){return ie})),n.d(t,"mapSeries",(function(){return q})),n.d(t,"mapValues",(function(){return Le})),n.d(t,"mapValuesLimit",(function(){return De})),n.d(t,"mapValuesSeries",(function(){return Be})),n.d(t,"memoize",(function(){return Fe})),n.d(t,"nextTick",(function(){return qe})),n.d(t,"parallel",(function(){return ze})),n.d(t,"parallelLimit",(function(){return Je})),n.d(t,"priorityQueue",(function(){return Qe})),n.d(t,"queue",(function(){return Ge})),n.d(t,"race",(function(){return Ke})),n.d(t,"reduce",(function(){return te})),n.d(t,"reduceRight",(function(){return Ye})),n.d(t,"reflect",(function(){return Xe})),n.d(t,"reflectAll",(function(){return $e})),n.d(t,"reject",(function(){return et})),n.d(t,"rejectLimit",(function(){return tt})),n.d(t,"rejectSeries",(function(){return nt})),n.d(t,"retry",(function(){return it})),n.d(t,"retryable",(function(){return ot})),n.d(t,"select",(function(){return Ie})),n.d(t,"selectLimit",(function(){return Ee})),n.d(t,"selectSeries",(function(){return Ne})),n.d(t,"seq",(function(){return ne})),n.d(t,"series",(function(){return st})),n.d(t,"setImmediate",(function(){return g})),n.d(t,"some",(function(){return ut})),n.d(t,"someLimit",(function(){return ct})),n.d(t,"someSeries",(function(){return lt})),n.d(t,"sortBy",(function(){return ft})),n.d(t,"timeout",(function(){return pt})),n.d(t,"times",(function(){return ht})),n.d(t,"timesLimit",(function(){return dt})),n.d(t,"timesSeries",(function(){return vt})),n.d(t,"transform",(function(){return mt})),n.d(t,"tryEach",(function(){return gt})),n.d(t,"unmemoize",(function(){return yt})),n.d(t,"until",(function(){return _t})),n.d(t,"waterfall",(function(){return St})),n.d(t,"whilst",(function(){return bt})),n.d(t,"wrapSync",(function(){return y}));var r=n(4),i=n(3),a=n(6),o=n(7),s=n(12),u=n(13),c=n(11);function l(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(void 0,n.concat(r))}}function f(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop();return e.call(this,n,i)}}var p="function"==typeof queueMicrotask&&queueMicrotask,d="function"==typeof setImmediate&&setImmediate,h="object"===("undefined"==typeof process?"undefined":c(process))&&"function"==typeof process.nextTick;function v(e){setTimeout(e,0)}function m(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e((function(){return t.apply(void 0,r)}))}}var g=m(p?queueMicrotask:d?setImmediate:h?process.nextTick:v);function y(e){return S(e)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop(),a=e.apply(this,n);return b(a,i)}:f((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return b(r,n);n(null,r)}))}function b(e,t){return e.then((function(e){_(t,null,e)}),(function(e){_(t,e&&(e instanceof Error||e.message)?e:new Error(e))}))}function _(e,t,n){try{e(t,n)}catch(e){g((function(e){throw e}),e)}}function S(e){return"AsyncFunction"===e[Symbol.toStringTag]}function w(e){if("function"!=typeof e)throw new Error("expected a function");return S(e)?y(e):e}function x(e,t){if(t||(t=e.length),!t)throw new Error("arity is undefined");return function(){for(var n=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return"function"==typeof i[t-1]?e.apply(this,i):new Promise((function(r,a){i[t-1]=function(e){if(e)return a(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(n.length>1?n:n[0])},e.apply(n,i)}))}}function k(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=x((function(n){var i=this;return e(t,(function(e,t){w(e).apply(i,r.concat(t))}),n)}));return a}}function O(e,t,n,r){t=t||[];var i=[],a=0,o=w(n);return e(t,(function(e,t,n){var r=a++;o(e,(function(e,t){i[r]=t,n(e)}))}),(function(e){r(e,i)}))}function T(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}var A={};function I(e){function t(){if(null!==e){var t=e;e=null;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}return Object.assign(t,e),t}function E(e){if(T(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t,n,r,i,a=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return a?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(a):(n=(t=e)?Object.keys(t):[],r=-1,i=n.length,function e(){var a=n[++r];return"__proto__"===a?e():r<i?{value:t[a],key:a}:null})}function N(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}function R(e,t,n,r){var i=!1,a=!1,o=!1,s=0,u=0;function c(){s>=t||o||i||(o=!0,e.next().then((function(e){var t=e.value,f=e.done;if(!a&&!i){if(o=!1,f)return i=!0,void(s<=0&&r(null));s++,n(t,u,l),u++,c()}})).catch(f))}function l(e,t){if(s-=1,!a)return e?f(e):!1===e?(i=!0,void(a=!0)):t===A||i&&s<=0?(i=!0,r(null)):void c()}function f(e){a||(o=!1,i=!0,r(e))}c()}var j=function(e){return function(t,n,r){if(r=I(r),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return r(null);if("AsyncGenerator"===t[Symbol.toStringTag])return R(t,e,n,r);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return R(t[Symbol.asyncIterator](),e,n,r);var i=E(t),a=!1,o=!1,s=0,u=!1;function c(e,t){if(!o)if(s-=1,e)a=!0,r(e);else if(!1===e)a=!0,o=!0;else{if(t===A||a&&s<=0)return a=!0,r(null);u||l()}}function l(){for(u=!0;s<e&&!a;){var t=i();if(null===t)return a=!0,void(s<=0&&r(null));s+=1,n(t.value,t.key,N(c))}u=!1}l()}};var C=x((function(e,t,n,r){return j(t)(e,w(n),r)}),4);function P(e,t,n){n=I(n);var r=0,i=0,a=e.length,o=!1;function s(e,t){!1===e&&(o=!0),!0!==o&&(e?n(e):++i!==a&&t!==A||n(null))}for(0===a&&n(null);r<a;r++)t(e[r],r,N(s))}function M(e,t,n){return C(e,1/0,t,n)}var D=x((function(e,t,n){return(T(e)?P:M)(e,w(t),n)}),3);var L=x((function(e,t,n){return O(D,e,t,n)}),3),B=k(L);var F=x((function(e,t,n){return C(e,1,t,n)}),3);var q=x((function(e,t,n){return O(F,e,t,n)}),3),U=k(q),z=Symbol("promiseCallback");function J(){var e,t;function n(n){if(n)return t(n);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e(i.length>1?i:i[0])}return n[z]=new Promise((function(n,r){e=n,t=r})),n}function G(e,t,n){"number"!=typeof t&&(n=t,t=null),n=I(n||J());var r=Object.keys(e).length;if(!r)return n(null);t||(t=r);var i={},a=0,o=!1,s=!1,c=Object.create(null),l=[],f=[],p={};function d(e,t){l.push((function(){return function(e,t){if(s)return;var r=N((function(t){for(var r=arguments.length,l=new Array(r>1?r-1:0),f=1;f<r;f++)l[f-1]=arguments[f];if(a--,!1!==t){if(l.length<2){var p=l,d=u(p,1);l=d[0]}if(t){var h={};if(Object.keys(i).forEach((function(e){h[e]=i[e]})),h[e]=l,s=!0,c=Object.create(null),o)return;n(t,h)}else i[e]=l,v(e)}else o=!0}));a++;var l=w(t[t.length-1]);t.length>1?l(i,r):l(r)}(e,t)}))}function h(){if(!o){if(0===l.length&&0===a)return n(null,i);for(;l.length&&a<t;){l.shift()()}}}function v(e){(c[e]||[]).forEach((function(e){return e()})),h()}function m(t){var n=[];return Object.keys(e).forEach((function(r){var i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)})),n}return Object.keys(e).forEach((function(t){var n=e[t];if(!Array.isArray(n))return d(t,[n]),void f.push(t);var r=n.slice(0,n.length-1),i=r.length;if(0===i)return d(t,n),void f.push(t);p[t]=i,r.forEach((function(a){if(!e[a])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(", "));!function(e,t){var n=c[e];n||(n=c[e]=[]);n.push(t)}(a,(function(){0===--i&&d(t,n)}))}))})),function(){var e,t=0;for(;f.length;)e=f.pop(),t++,m(e).forEach((function(e){0==--p[e]&&f.push(e)}));if(t!==r)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),h(),n[z]}var H=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,V=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,W=/,/,Q=/(=.+)?(\s*)$/;function K(e,t){var n={};return Object.keys(e).forEach((function(t){var r,i=e[t],a=S(i),o=!a&&1===i.length||a&&0===i.length;if(Array.isArray(i))r=s(i),i=r.pop(),n[t]=r.concat(r.length>0?c:i);else if(o)n[t]=i;else{if(r=function(e){var t=function(e){for(var t="",n=0,r=e.indexOf("*/");n<e.length;)if("/"===e[n]&&"/"===e[n+1]){var i=e.indexOf("\n",n);n=-1===i?e.length:i}else if(-1!==r&&"/"===e[n]&&"*"===e[n+1]){var a=e.indexOf("*/",n);-1!==a?(n=a+2,r=e.indexOf("*/",n)):(t+=e[n],n++)}else t+=e[n],n++;return t}(e.toString()),n=t.match(H);if(n||(n=t.match(V)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+t);return u(n,2)[1].replace(/\s/g,"").split(W).map((function(e){return e.replace(Q,"").trim()}))}(i),0===i.length&&!a&&0===r.length)throw new Error("autoInject task functions require explicit parameters.");a||r.pop(),n[t]=r.concat(c)}function c(e,t){var n=r.map((function(t){return e[t]}));n.push(t),w(i).apply(void 0,s(n))}})),G(n,t)}var Y=function(){function e(){a(this,e),this.head=this.tail=null,this.length=0}return o(e,[{key:"removeLink",value:function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}},{key:"empty",value:function(){for(;this.head;)this.shift();return this}},{key:"insertAfter",value:function(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}},{key:"insertBefore",value:function(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}},{key:"unshift",value:function(e){this.head?this.insertBefore(this.head,e):X(this,e)}},{key:"push",value:function(e){this.tail?this.insertAfter(this.tail,e):X(this,e)}},{key:"shift",value:function(){return this.head&&this.removeLink(this.head)}},{key:"pop",value:function(){return this.tail&&this.removeLink(this.tail)}},{key:"toArray",value:function(){return s(this)}},{key:Symbol.iterator,value:i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.data;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))},{key:"remove",value:function(e){for(var t=this.head;t;){var n=t.next;e(t)&&this.removeLink(t),t=n}return this}}]),e}();function X(e,t){e.length=1,e.head=e.tail=t}function $(e,t,n){var a;if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var o=w(e),s=0,u=[],c={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function l(e,t){return e?t?void(c[e]=c[e].filter((function(e){return e!==t}))):c[e]=[]:Object.keys(c).forEach((function(e){return c[e]=[]}))}function f(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];c[e].forEach((function(e){return e.apply(void 0,n)}))}var p=!1;function d(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function o(e){if(e)return n?a(e):i();for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(r.length<=1)return i(r[0]);i(r)}b.started=!0;var s=b._createTaskItem(e,n?o:r||o);if(t?b._tasks.unshift(s):b._tasks.push(s),p||(p=!0,g((function(){p=!1,b.process()}))),n||!r)return new Promise((function(e,t){i=e,a=t}))}function h(e){return function(t){s-=1;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var a=0,o=e.length;a<o;a++){var c,l=e[a],p=u.indexOf(l);0===p?u.shift():p>0&&u.splice(p,1),(c=l).callback.apply(c,[t].concat(r)),null!=t&&f("error",t,l.data)}s<=b.concurrency-b.buffer&&f("unsaturated"),b.idle()&&f("drain"),b.process()}}function v(e){return!(0!==e.length||!b.idle())&&(g((function(){return f("drain")})),!0)}var m=function(e){return function(t){if(!t)return new Promise((function(t,n){!function(e,t){c[e].push((function n(){l(e,n),t.apply(void 0,arguments)}))}(e,(function(e,r){if(e)return n(e);t(r)}))}));l(e),function(e,t){c[e].push(t)}(e,t)}},y=!1,b=(a={_tasks:new Y,_createTaskItem:function(e,t){return{data:e,callback:t}}},r(a,Symbol.iterator,i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(b._tasks[Symbol.iterator](),"t0",1);case 1:case"end":return e.stop()}}),e)}))),r(a,"concurrency",t),r(a,"payload",n),r(a,"buffer",t/4),r(a,"started",!1),r(a,"paused",!1),r(a,"push",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!1,!1,t)}))}return d(e,!1,!1,t)})),r(a,"pushAsync",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!1,!0,t)}))}return d(e,!1,!0,t)})),r(a,"kill",(function(){l(),b._tasks.empty()})),r(a,"unshift",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!0,!1,t)}))}return d(e,!0,!1,t)})),r(a,"unshiftAsync",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!0,!0,t)}))}return d(e,!0,!0,t)})),r(a,"remove",(function(e){b._tasks.remove(e)})),r(a,"process",(function(){if(!y){for(y=!0;!b.paused&&s<b.concurrency&&b._tasks.length;){var e=[],t=[],n=b._tasks.length;b.payload&&(n=Math.min(n,b.payload));for(var r=0;r<n;r++){var i=b._tasks.shift();e.push(i),u.push(i),t.push(i.data)}s+=1,0===b._tasks.length&&f("empty"),s===b.concurrency&&f("saturated");var a=N(h(e));o(t,a)}y=!1}})),r(a,"length",(function(){return b._tasks.length})),r(a,"running",(function(){return s})),r(a,"workersList",(function(){return u})),r(a,"idle",(function(){return b._tasks.length+s===0})),r(a,"pause",(function(){b.paused=!0})),r(a,"resume",(function(){!1!==b.paused&&(b.paused=!1,g(b.process))})),a);return Object.defineProperties(b,{saturated:{writable:!1,value:m("saturated")},unsaturated:{writable:!1,value:m("unsaturated")},empty:{writable:!1,value:m("empty")},drain:{writable:!1,value:m("drain")},error:{writable:!1,value:m("error")}}),b}function Z(e,t){return $(e,1,t)}function ee(e,t,n){return $(e,t,n)}var te=x((function(e,t,n,r){r=I(r);var i=w(n);return F(e,(function(e,n,r){i(t,e,(function(e,n){t=n,r(e)}))}),(function(e){return r(e,t)}))}),4);function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(w);return function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var a=n[n.length-1];return"function"==typeof a?n.pop():a=J(),te(r,n,(function(t,n,r){n.apply(e,t.concat((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(e,n)})))}),(function(e,t){return a.apply(void 0,[e].concat(s(t)))})),a[z]}}function re(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ne.apply(void 0,s(t.reverse()))}var ie=x((function(e,t,n,r){return O(j(t),e,n,r)}),4);var ae=x((function(e,t,n,r){var i=w(n);return ie(e,t,(function(e,t){i(e,(function(e){if(e)return t(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t(e,r)}))}),(function(e,t){for(var n=[],i=0;i<t.length;i++){var a;if(t[i])n=(a=n).concat.apply(a,s(t[i]))}return r(e,n)}))}),4);var oe=x((function(e,t,n){return ae(e,1/0,t,n)}),3);var se=x((function(e,t,n){return ae(e,1,t,n)}),3);function ue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.pop();return i.apply(void 0,[null].concat(t))}}function ce(e,t){return function(n,r,i,a){var o,s=!1,u=w(i);n(r,(function(n,r,i){u(n,(function(r,a){return r||!1===r?i(r):e(a)&&!o?(s=!0,o=t(!0,n),i(null,A)):void i()}))}),(function(e){if(e)return a(e);a(null,s?o:t(!1))}))}}var le=x((function(e,t,n){return ce((function(e){return e}),(function(e,t){return t}))(D,e,t,n)}),3);var fe=x((function(e,t,n,r){return ce((function(e){return e}),(function(e,t){return t}))(j(t),e,n,r)}),4);var pe=x((function(e,t,n){return ce((function(e){return e}),(function(e,t){return t}))(j(1),e,t,n)}),3);function de(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return w(t).apply(void 0,r.concat([function(t){if("object"===("undefined"==typeof console?"undefined":c(console)))if(t)console.error&&console.error(t);else if(console[e]){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];r.forEach((function(t){return console[e](t)}))}}]))}}var he=de("dir");var ve=x((function(e,t,n){n=N(n);var r,i=w(e),a=w(t);function o(e){if(e)return n(e);if(!1!==e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];r=i,a.apply(void 0,i.concat([u]))}}function u(e,t){return e?n(e):!1!==e?t?void i(o):n.apply(void 0,[null].concat(s(r))):void 0}return u(null,!0)}),3);function me(e,t,n){var r=w(t);return ve(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.pop();r.apply(void 0,t.concat([function(e,t){return i(e,!t)}]))}),n)}function ge(e){return function(t,n,r){return e(t,r)}}var ye=x((function(e,t,n){return D(e,ge(w(t)),n)}),3);var be=x((function(e,t,n,r){return j(t)(e,ge(w(n)),r)}),4);var _e=x((function(e,t,n){return be(e,1,t,n)}),3);function Se(e){return S(e)?e:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop(),a=!0;n.push((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a?g((function(){return i.apply(void 0,t)})):i.apply(void 0,t)})),e.apply(this,n),a=!1}}var we=x((function(e,t,n){return ce((function(e){return!e}),(function(e){return!e}))(D,e,t,n)}),3);var xe=x((function(e,t,n,r){return ce((function(e){return!e}),(function(e){return!e}))(j(t),e,n,r)}),4);var ke=x((function(e,t,n){return ce((function(e){return!e}),(function(e){return!e}))(F,e,t,n)}),3);function Oe(e,t,n,r){var i=new Array(t.length);e(t,(function(e,t,r){n(e,(function(e,n){i[t]=!!n,r(e)}))}),(function(e){if(e)return r(e);for(var n=[],a=0;a<t.length;a++)i[a]&&n.push(t[a]);r(null,n)}))}function Te(e,t,n,r){var i=[];e(t,(function(e,t,r){n(e,(function(n,a){if(n)return r(n);a&&i.push({index:t,value:e}),r(n)}))}),(function(e){if(e)return r(e);r(null,i.sort((function(e,t){return e.index-t.index})).map((function(e){return e.value})))}))}function Ae(e,t,n,r){return(T(t)?Oe:Te)(e,t,w(n),r)}var Ie=x((function(e,t,n){return Ae(D,e,t,n)}),3);var Ee=x((function(e,t,n,r){return Ae(j(t),e,n,r)}),4);var Ne=x((function(e,t,n){return Ae(F,e,t,n)}),3);var Re=x((function(e,t){var n=N(t),r=w(Se(e));return function e(t){if(t)return n(t);!1!==t&&r(e)}()}),2);var je=x((function(e,t,n,r){var i=w(n);return ie(e,t,(function(e,t){i(e,(function(n,r){return n?t(n):t(n,{key:r,val:e})}))}),(function(e,t){for(var n={},i=Object.prototype.hasOwnProperty,a=0;a<t.length;a++)if(t[a]){var o=t[a].key,s=t[a].val;i.call(n,o)?n[o].push(s):n[o]=[s]}return r(e,n)}))}),4);function Ce(e,t,n){return je(e,1/0,t,n)}function Pe(e,t,n){return je(e,1,t,n)}var Me=de("log");var De=x((function(e,t,n,r){r=I(r);var i={},a=w(n);return j(t)(e,(function(e,t,n){a(e,t,(function(e,r){if(e)return n(e);i[t]=r,n(e)}))}),(function(e){return r(e,i)}))}),4);function Le(e,t,n){return De(e,1/0,t,n)}function Be(e,t,n){return De(e,1,t,n)}function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=Object.create(null),r=Object.create(null),i=w(e),a=f((function(e,a){var o=t.apply(void 0,s(e));o in n?g((function(){return a.apply(void 0,[null].concat(s(n[o])))})):o in r?r[o].push(a):(r[o]=[a],i.apply(void 0,s(e).concat([function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];e||(n[o]=i);var s=r[o];delete r[o];for(var u=0,c=s.length;u<c;u++)s[u].apply(s,[e].concat(i))}])))}));return a.memo=n,a.unmemoized=e,a}var qe=m(h?process.nextTick:d?setImmediate:v),Ue=x((function(e,t,n){var r=T(t)?[]:{};e(t,(function(e,t,n){w(e)((function(e){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(a.length<2){var s=a,c=u(s,1);a=c[0]}r[t]=a,n(e)}))}),(function(e){return n(e,r)}))}),3);function ze(e,t){return Ue(D,e,t)}function Je(e,t,n){return Ue(j(t),e,n)}function Ge(e,t){var n=w(e);return $((function(e,t){n(e[0],t)}),t,1)}var He=function(){function e(){a(this,e),this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}return o(e,[{key:"empty",value:function(){return this.heap=[],this}},{key:"percUp",value:function(e){for(var t;e>0&&We(this.heap[e],this.heap[t=Ve(e)]);){var n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}},{key:"percDown",value:function(e){for(var t;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&We(this.heap[t+1],this.heap[t])&&(t+=1),!We(this.heap[e],this.heap[t]));){var n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}},{key:"push",value:function(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}},{key:"unshift",value:function(e){return this.heap.push(e)}},{key:"shift",value:function(){var e=u(this.heap,1)[0];return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}},{key:"toArray",value:function(){return s(this)}},{key:Symbol.iterator,value:i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.heap.length)){e.next=7;break}return e.next=4,this.heap[t].data;case 4:t++,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))},{key:"remove",value:function(e){for(var t=0,n=0;n<this.heap.length;n++)e(this.heap[n])||(this.heap[t]=this.heap[n],t++);this.heap.splice(t);for(var r=Ve(this.heap.length-1);r>=0;r--)this.percDown(r);return this}},{key:"length",get:function(){return this.heap.length}}]),e}();function Ve(e){return(e+1>>1)-1}function We(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}function Qe(e,t){var n=Ge(e,t),r=n.push,i=n.pushAsync;function a(e,t){return Array.isArray(e)?e.map((function(e){return{data:e,priority:t}})):{data:e,priority:t}}return n._tasks=new He,n._createTaskItem=function(e,t){return{data:e.data,priority:e.priority,callback:t}},n.push=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return r(a(e,t),n)},n.pushAsync=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return i(a(e,t),n)},delete n.unshift,delete n.unshiftAsync,n}var Ke=x((function(e,t){if(t=I(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var n=0,r=e.length;n<r;n++)w(e[n])(t)}),2);function Ye(e,t,n,r){var i=s(e).reverse();return te(i,t,n,r)}function Xe(e){var t=w(e);return f((function(e,n){return e.push((function(e){var t={};e&&(t.error=e);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(i.length>0){var o=i;i.length<=1&&(o=i[0]),t.value=o}n(null,t)})),t.apply(this,e)}))}function $e(e){var t,n=this;return Array.isArray(e)?t=e.map(Xe):(t={},Object.keys(e).forEach((function(r){t[r]=Xe.call(n,e[r])}))),t}function Ze(e,t,n,r){var i=w(n);return Ae(e,t,(function(e,t){i(e,(function(e,n){t(e,!n)}))}),r)}var et=x((function(e,t,n){return Ze(D,e,t,n)}),3);var tt=x((function(e,t,n,r){return Ze(j(t),e,n,r)}),4);var nt=x((function(e,t,n){return Ze(F,e,t,n)}),3);function rt(e){return function(){return e}}function it(e,t,n){var r={times:5,intervalFunc:rt(0)};if(arguments.length<3&&"function"==typeof e?(n=t||J(),t=e):(at(r,e),n=n||J()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=w(t),a=1;function o(){i((function(e){if(!1!==e)if(e&&a++<r.times&&("function"!=typeof r.errorFilter||r.errorFilter(e)))setTimeout(o,r.intervalFunc(a-1));else{for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];n.apply(void 0,[e].concat(i))}}))}return o(),n[z]}function at(e,t){if("object"===c(t))e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:rt(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}function ot(e,t){t||(t=e,e=null);var n=e&&e.arity||t.length;S(t)&&(n+=1);var r=w(t);return f((function(t,i){function a(e){r.apply(void 0,s(t).concat([e]))}return(t.length<n-1||null==i)&&(t.push(i),i=J()),e?it(e,a,i):it(a,i),i[z]}))}function st(e,t){return Ue(F,e,t)}var ut=x((function(e,t,n){return ce(Boolean,(function(e){return e}))(D,e,t,n)}),3);var ct=x((function(e,t,n,r){return ce(Boolean,(function(e){return e}))(j(t),e,n,r)}),4);var lt=x((function(e,t,n){return ce(Boolean,(function(e){return e}))(F,e,t,n)}),3);var ft=x((function(e,t,n){var r=w(t);return L(e,(function(e,t){r(e,(function(n,r){if(n)return t(n);t(n,{value:e,criteria:r})}))}),(function(e,t){if(e)return n(e);n(null,t.sort(i).map((function(e){return e.value})))}));function i(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}}),3);function pt(e,t,n){var r=w(e);return f((function(i,a){var o,u=!1;i.push((function(){u||(a.apply(void 0,arguments),clearTimeout(o))})),o=setTimeout((function(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),u=!0,a(r)}),t),r.apply(void 0,s(i))}))}function dt(e,t,n,r){var i=w(n);return ie(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,r)}function ht(e,t,n){return dt(e,1/0,t,n)}function vt(e,t,n){return dt(e,1,t,n)}function mt(e,t,n,r){arguments.length<=3&&"function"==typeof t&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=I(r||J());var i=w(n);return D(e,(function(e,n,r){i(t,e,n,r)}),(function(e){return r(e,t)})),r[z]}var gt=x((function(e,t){var n,r=null;return _e(e,(function(e,t){w(e)((function(e){if(!1===e)return t(e);for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];n=a.length<2?a[0]:a,r=e,t(e?null:{})}))}),(function(){return t(r,n)}))}));function yt(e){return function(){return(e.unmemoized||e).apply(void 0,arguments)}}var bt=x((function(e,t,n){n=N(n);var r=w(t),i=w(e),a=[];function o(e){if(e)return n(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];a=r,!1!==e&&i(u)}function u(e,t){return e?n(e):!1!==e?t?void r(o):n.apply(void 0,[null].concat(s(a))):void 0}return i(u)}),3);function _t(e,t,n){var r=w(e);return bt((function(e){return r((function(t,n){return e(t,!n)}))}),t,n)}var St=x((function(e,t){if(t=I(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var n=0;function r(t){w(e[n++]).apply(void 0,s(t).concat([N(i)]))}function i(i){if(!1!==i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];if(i||n===e.length)return t.apply(void 0,[i].concat(o));r(o)}}r([])})),wt={apply:l,applyEach:B,applyEachSeries:U,asyncify:y,auto:G,autoInject:K,cargo:Z,cargoQueue:ee,compose:re,concat:oe,concatLimit:ae,concatSeries:se,constant:ue,detect:le,detectLimit:fe,detectSeries:pe,dir:he,doUntil:me,doWhilst:ve,each:ye,eachLimit:be,eachOf:D,eachOfLimit:C,eachOfSeries:F,eachSeries:_e,ensureAsync:Se,every:we,everyLimit:xe,everySeries:ke,filter:Ie,filterLimit:Ee,filterSeries:Ne,forever:Re,groupBy:Ce,groupByLimit:je,groupBySeries:Pe,log:Me,map:L,mapLimit:ie,mapSeries:q,mapValues:Le,mapValuesLimit:De,mapValuesSeries:Be,memoize:Fe,nextTick:qe,parallel:ze,parallelLimit:Je,priorityQueue:Qe,queue:Ge,race:Ke,reduce:te,reduceRight:Ye,reflect:Xe,reflectAll:$e,reject:et,rejectLimit:tt,rejectSeries:nt,retry:it,retryable:ot,seq:ne,series:st,setImmediate:g,some:ut,someLimit:ct,someSeries:lt,sortBy:ft,timeout:pt,times:ht,timesLimit:dt,timesSeries:vt,transform:mt,tryEach:gt,unmemoize:yt,until:_t,waterfall:St,whilst:bt,all:we,allLimit:xe,allSeries:ke,any:ut,anyLimit:ct,anySeries:lt,find:le,findLimit:fe,findSeries:pe,flatMap:oe,flatMapLimit:ae,flatMapSeries:se,forEach:ye,forEachSeries:_e,forEachLimit:be,forEachOf:D,forEachOfSeries:F,forEachOfLimit:C,inject:te,foldl:te,foldr:Ye,select:Ie,selectLimit:Ee,selectSeries:Ne,wrapSync:y,during:bt,doDuring:ve}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9),o=n(6),s=n(7);function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.GenesysCloudMediaSession=void 0;var l=n(36).__importDefault(n(95)),f=n(20),p=n(34),d=n(26),h=n(33),v=function(){function e(t,n){var r=this;o(this,e),this.webrtcExtension=t,this.iceCandidatesDiscovered=0,this.iceCandidatesReceivedFromPeer=0,this.state="pending",this.connectionState="starting",this.id=n.id,this.fromJid=n.fromJid,this.peerID=n.peerID,this.logger=n.logger,this.conversationId=n.conversationId,this.fromUserId=n.fromUserId,this.pc=this.peerConnection=new RTCPeerConnection({iceServers:n.iceServers,iceTransportPolicy:n.iceTransportPolicy}),this.originalRoomJid=n.originalRoomJid,this.sessionType=h.SessionTypes[n.sessionType],this.ignoreHostCandidatesFromRemote=!!n.ignoreHostCandidatesFromRemote,this.allowIPv6=!!n.allowIPv6,this.allowTCP=!!n.allowTCP,this.reinvite=!!n.reinvite,this.privAnswerMode=n.privAnswerMode,this.meetingId=n.meetingId;var i=new f.EventEmitter;Object.keys(i.__proto__).forEach((function(e){r[e]=i[e]})),n.optOutOfWebrtcStatsTelemetry||this.setupStatsGatherer(),this.peerConnection.addEventListener("icecandidate",this.onIceCandidate.bind(this)),this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceStateChange.bind(this)),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange.bind(this)),this.peerConnection.addEventListener("icecandidateerror",this.onIceCandidateError.bind(this))}var t,n,r,u,v,m,g,y,b,_,S,w;return s(e,[{key:"keepStateInSyncWithPeerConnection",value:function(){var e=this;this.stateSyncTimeout&&(clearTimeout(this.stateSyncTimeout),this.stateSyncTimeout=void 0);var t=Date.now();this.stateSyncTimeout=setTimeout((function(){Date.now()-t>4e3&&(e.log("warn","MediaSession detected timer anomally. Reasons include taxed resources or system sleep."),"ended"!==e.state&&["failed","closed"].includes(e.peerConnection.connectionState)&&(e.log("warn","state mismatch between session.state and peerConnection.connectionState, manually terminating the session",{sessionId:e.id,conversationId:e.conversationId,sessionType:e.sessionType}),e.state="ended",e.onSessionTerminate())),"ended"!==e.state&&e.keepStateInSyncWithPeerConnection()}),2e3)}},{key:"setRemoteDescription",value:(w=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.peerConnection.setRemoteDescription({sdp:t,type:"offer"}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"log",value:function(e,t,n,r){n||(n={});var i=c(c({},n),this.getLogDetails());this.logger[e](t,i,r)}},{key:"sendGenesysWebrtc",value:(S=a(i.mark((function e(t){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.id=t.id||p.v4(),t.jsonrpc=t.jsonrpc||"2.0",n={type:"set",genesysWebrtc:t,from:this.webrtcExtension.jid,to:this.peerID},e.abrupt("return",this.webrtcExtension.sendIq(n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"end",value:(_=a(i.mark((function e(){var t,n,r,a=this,o=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:"success",n=o.length>1&&void 0!==o[1]&&o[1],this.state="ended",r={sessionId:this.id,reason:t.condition||t},n){e.next=7;break}return e.next=7,d.timeoutPromise((function(e,t){a.log("info","sending sdp terminate"),a.sendGenesysWebrtc({jsonrpc:"2.0",method:"terminate",params:r}).then(e,t)}),2e3,"Timeout waiting for response to termination request",{sessionId:this.id,conversationId:this.conversationId,sessionType:this.sessionType}).catch((function(e){return a.logger.error(e)}));case 7:this.onSessionTerminate(r.reason);case 8:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new l.default(this.peerConnection),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:(b=a(i.mark((function e(){var t,n,r,a,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.peerConnection.iceConnectionState,n=this.id,r=this.conversationId,a=this.sessionType,this.log("info","ICE state changed: ",{iceState:t,sessionId:n,conversationId:r}),"disconnected"!==t){e.next=9;break}"stable"===this.peerConnection.signalingState&&(this.interruptionStart=new Date,this.log("info","Connection state is interrupted",{sessionId:n,conversationId:r,sessionType:a})),e.next=18;break;case 9:if("connected"!==t){e.next=17;break}return this.log("info","sending session-info: active"),o={sessionId:this.id,status:"active"},e.next=14,this.sendGenesysWebrtc({jsonrpc:"2.0",params:o,method:"info"});case 14:this._setupDataChannel(),e.next=18;break;case 17:"failed"===t&&this.log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer});case 18:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"onConnectionStateChange",value:function(){var e=this.connectionState=this.peerConnection.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if("connected"===e&&this.keepStateInSyncWithPeerConnection(),this.log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this.log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&(this.log("info","Connection was interrupted and failed to recover, cleaning up",{sessionId:t,conversationId:n,sessionType:r}),this.state="ended",this.onSessionTerminate());this.emit("connectionState",e)}},{key:"onIceCandidateError",value:function(e){var t=e;this.log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url})}},{key:"createIceCandidate",value:function(e,t){return new RTCIceCandidate({sdpMid:e,candidate:t})}},{key:"addRemoteIceCandidate",value:(y=a(i.mark((function e(t){var n,r,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.match(/m=([^\s]+)/)[1],r=t.match(/a=([^\\\r]+)/)[1],a=this.createIceCandidate(n,r),e.next=5,this.peerConnection.addIceCandidate(a);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"onIceCandidate",value:function(e){var t,n,r,i=null===(t=e.candidate)||void 0===t?void 0:t.candidate,a=null===(n=e.candidate)||void 0===n?void 0:n.sdpMid;if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var o=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(o&&!o[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this.log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this.log("debug","Processing ice candidate",e.candidate),this.log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++,r="m=".concat(a," 9 RTP/AVP 0\r\na=").concat(i,"\r\n")}else r="a=end-of-candidates\r\n",this.emit("endOfCandidates");return this.sendGenesysWebrtc({jsonrpc:"2.0",method:"iceCandidate",params:{sessionId:this.id,sdp:r}})}},{key:"onSessionTerminate",value:function(e){this.peerConnection&&this.peerConnection.close(),this.logger.info("emitting sdp media-session (terminate)"),this.emit("terminated",{condition:e||"success"})}},{key:"addTrack",value:(g=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.peerConnection.getTransceivers().find((function(e){var n;return!e.sender.track&&(null===(n=e.receiver.track)||void 0===n?void 0:n.kind)===t.kind})))){e.next=3;break}return e.abrupt("return",r.sender.replaceTrack(t));case 3:this.peerConnection.addTrack(t,n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.peerConnection.remoteDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this.log("info","creating data channel"),this.dataChannel=this.peerConnection.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",(function(){t.log("info","data channel opened")})),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",(function(){t.log("info","closing data channel")})),this.dataChannel.addEventListener("error",(function(e){t.log("error","Error occurred with the data channel",e)})))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this.log("error","Failed to parse data channel message",{error:e})}}},{key:"accept",value:(m=a(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",e.next=3,this.peerConnection.createAnswer();case 3:return t=e.sent,e.next=6,this.peerConnection.setLocalDescription(t);case 6:return n={sdp:t.sdp,sessionId:this.id},this.logger.info("sending sdp answer",n),e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"answer",params:n}));case 9:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"mute",value:(v=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"mute",params:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"unmute",value:(u=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"unmute",params:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"removeTrack",value:(r=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"hold",value:(n=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"resume",value:(t=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"toString",value:function(){return{connectionState:this.connectionState,state:this.state,sessionType:this.sessionType,fromJid:this.fromJid,conversationId:this.conversationId,id:this.id,peerConnection:this.peerConnection}}}]),e}();t.GenesysCloudMediaSession=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.core=void 0;var r=n(15);(0,r.__exportStar)(n(99),t),(0,r.__exportStar)(n(100),t),(0,r.__exportStar)(n(101),t),(0,r.__exportStar)(n(102),t),(0,r.__exportStar)(n(103),t),(0,r.__exportStar)(n(104),t),(0,r.__exportStar)(n(105),t),(0,r.__exportStar)(n(106),t),(0,r.__exportStar)(n(107),t),(0,r.__exportStar)(n(108),t),(0,r.__exportStar)(n(109),t),(0,r.__exportStar)(n(111),t),(0,r.__exportStar)(n(112),t),(0,r.__exportStar)(n(113),t),(0,r.__exportStar)(n(114),t),(0,r.__exportStar)(n(115),t),(0,r.__exportStar)(n(116),t),(0,r.__exportStar)(n(117),t);var i=(0,r.__importDefault)(n(99)),a=(0,r.__importDefault)(n(100)),o=(0,r.__importDefault)(n(101)),s=(0,r.__importDefault)(n(102)),u=(0,r.__importDefault)(n(103)),c=(0,r.__importDefault)(n(104)),l=(0,r.__importDefault)(n(105)),f=(0,r.__importDefault)(n(106)),p=(0,r.__importDefault)(n(107)),d=(0,r.__importDefault)(n(108)),h=(0,r.__importDefault)(n(109)),v=(0,r.__importDefault)(n(111)),m=(0,r.__importDefault)(n(112)),g=(0,r.__importDefault)(n(113)),y=(0,r.__importDefault)(n(114)),b=(0,r.__importDefault)(n(115)),_=(0,r.__importDefault)(n(116)),S=(0,r.__importDefault)(n(117));t.core=function(e){e.use(f.default),e.use(c.default),e.use(o.default),e.use(u.default),e.use(p.default),e.use(_.default)},t.default=function(e){e.use(i.default),e.use(v.default),e.use(a.default),e.use(s.default),e.use(l.default),e.use(d.default),e.use(h.default),e.use(m.default),e.use(g.default),e.use(y.default),e.use(b.default),e.use(S.default)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"XRD",fields:{subject:(0,r.childText)(null,"Subject")},namespace:i.NS_XRD,path:"xrd"},{aliases:[{path:"xrd.links",multiple:!0}],element:"Link",fields:{href:(0,r.attribute)("href"),rel:(0,r.attribute)("rel"),type:(0,r.attribute)("type")},namespace:i.NS_XRD}];t.default=a},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);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){a(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=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}),t.MessengerExtension=void 0;var h=n(272),v=n(22),m=n(34),g=function(e){u(a,e);var t,n=d(a);function a(e,t){var r;return o(this,a),(r=n.call(this)).client=e,r.stanzaInstance=t,r}return s(a,[{key:"handleStanzaInstanceChange",value:function(e){this.stanzaInstance=e}},{key:"isMediaMessage",value:function(e){return!!e.mediaMessage}},{key:"handleMessage",value:function(e){if(this.isMediaMessage(e)){var t=e.from===this.stanzaInstance.jid,n=v.toBare(e.from)===this.bareJid;this.emit("mediaMessage",p(p({},e),{},{fromMyClient:t,fromMyUser:n}))}}},{key:"broadcastMessage",value:(t=i(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=m.v4(),t.id=n,t.from=this.stanzaInstance.jid,t.to||(t.to=this.bareJid),e.next=6,this.stanzaInstance.send("message",t);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"bareJid",get:function(){return v.toBare(this.stanzaInstance.jid)}},{key:"expose",get:function(){return{broadcastMessage:this.broadcastMessage.bind(this),on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeListener:this.removeListener.bind(this),addListener:this.addListener.bind(this)}}}]),a}(h.Emitter);t.MessengerExtension=g},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(6),s=n(7),u=n(24),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){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}),t.Client=void 0;var v=n(36),m=n(208),g=n(273);n(227);var y=n(228),b=n(233),_=n(259),S=n(260),w=n(26),x=n(45),k=n(33),O=v.__importDefault(n(20)),T=n(261),A=n(71),I=v.__importDefault(n(271)),E=v.__importDefault(n(199)),N=n(80),R=n(69),j=n(34),C={notifications:y.Notifications,webrtcSessions:b.WebrtcExtension,messenger:R.MessengerExtension},P=function(e){c(O,e);var t,n,l,f,d,v,y,b=h(O);function O(e){var t;o(this,O),(t=b.call(this)).connected=!1,t.connecting=!1,t.hardReconnectRequired=!0,t.isGuest=!1,t.backgroundAssistantMode=!1,t.autoReconnect=!0,t.extensions=[],t.channelReuses=0,t.hasMadeInitialAttempt=!1,t.jidResource="",t.http=new x.HttpClient({customHeaders:e.customHeaders}),t.reconnectOnNoLongerSubscribed=!1!==e.reconnectOnNoLongerSubscribed,t.useServerSidePings=!1!==e.useServerSidePings,t.config={host:e.host,apiHost:e.apiHost||e.host.replace("wss://streaming.",""),authToken:e.authToken,jwt:e.jwt,jid:e.jid,jidResource:e.jidResource,channelId:null,appName:e.appName,appVersion:e.appVersion,appId:e.appId,customHeaders:e.customHeaders},t.backgroundAssistantMode=t.checkIsBackgroundAssistant(),t.isGuest=!t.backgroundAssistantMode&&!e.authToken;var n=e.authToken||"",r="https://api.".concat(t.config.apiHost,"/api/v2/diagnostics/trace");return t.backgroundAssistantMode&&(n=e.jwt,r+="/backgroundassistant"),t.logger=new g.Logger({accessToken:n,url:r,uploadDebounceTime:1e3,initializeServerLogging:!t.isGuest&&!e.optOutOfWebrtcStatsTelemetry,appVersion:O.version,appName:"streaming-client",logLevel:t.config.logLevel||"info",logger:e.logger||console,formatters:e.logFormatters,originAppName:e.appName,originAppVersion:e.appVersion,originAppId:e.appId,customHeaders:e.customHeaders}),t.connectionManager=new T.ConnectionManager(t.logger,t.config),Object.keys(C).forEach((function(n){var r=new C[n](u(t),e);t.extensions.push(r),r.tokenBucket||(r.tokenBucket=new m.TokenBucket(20,25,1e3),r.tokenBucket.content=25),"function"==typeof r.on&&r.on("send",t.handleSendEventFromExtension.bind(u(t),r)),t[n]=r.expose,t["_".concat(n)]=r})),t}return s(O,[{key:"handleSendEventFromExtension",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.tokenBucket.removeTokens(1,(function(){var e=n.activeStanzaInstance;return e?!0===r?e.sendMessage(t):e.sendIQ(t):n.logger.warn("cannot send message, no active stanza client",{data:t,message:r},{skipServer:!0})}))}},{key:"checkIsBackgroundAssistant",value:function(){if(this.config.jwt){var e=w.parseJwt(this.config.jwt);return e&&"urn:purecloud:screenrecording"===e.iss}return!1}},{key:"addInateEventHandlers",value:function(e){this.removeStanzaBoundEventHandlers(),this.boundStanzaDisconnect=this.handleStanzaDisconnectedEvent.bind(this,e),this.boundStanzaNoLongerSubscribed=this.handleNoLongerSubscribed.bind(this,e),this.boundStanzaDuplicateId=this.handleDuplicateId.bind(this,e),this.on("stanzaDisconnected",this.boundStanzaDisconnect),this.on("notify:no_longer_subscribed",this.boundStanzaNoLongerSubscribed),this.on("notify:duplicate_id",this.boundStanzaDuplicateId),this.extensions.forEach((function(t){"function"==typeof t.handleIq&&e.on("iq",t.handleIq.bind(t)),"function"==typeof t.handleMessage&&e.on("message",t.handleMessage.bind(t))}))}},{key:"removeStanzaBoundEventHandlers",value:function(){this.boundStanzaDisconnect&&(this.off("stanzaDisconnected",this.boundStanzaDisconnect),this.boundStanzaDisconnect=void 0),this.boundStanzaNoLongerSubscribed&&(this.off("notify:no_longer_subscribed",this.boundStanzaNoLongerSubscribed),this.boundStanzaNoLongerSubscribed=void 0),this.boundStanzaDuplicateId&&(this.off("notify:duplicate_id",this.boundStanzaDuplicateId),this.boundStanzaDuplicateId=void 0)}},{key:"proxyStanzaEvents",value:function(e){var t=this;e.originalEmitter=e.emit,e.emit=function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=e.originalEmitter.apply(e,[n].concat(i));return"connected"===n?o:("disconnected"===n&&(n="stanzaDisconnected"),t.emit.apply(t,[n].concat(i)))}}},{key:"handleStanzaDisconnectedEvent",value:(y=a(i.mark((function e(t){var n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("stanzaDisconnected event received",{stanzaInstanceId:t.id,channelId:t.channelId}),this.connected=!1,this.connecting=!1,null===(n=t.pinger)||void 0===n||n.stop(),null===(r=t.serverMonitor)||void 0===r||r.stop(),this.removeAllListeners("stanzaDisconnected"),this.removeAllListeners("notify:no_longer_subscribed"),t.originalEmitter&&(t.emit=t.originalEmitter),this.activeStanzaInstance=void 0,this.emit("disconnected",{reconnecting:this.autoReconnect}),!this.autoReconnect){e.next=12;break}return e.abrupt("return",this.connect({keepTryingOnFailure:!0}));case 12:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"handleNoLongerSubscribed",value:function(e){var t,n;this.logger.warn("noLongerSubscribed event received",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0,this.reconnectOnNoLongerSubscribed||(this.autoReconnect=!1)}},{key:"handleDuplicateId",value:function(e){var t,n;this.logger.warn("duplicate_id event received, forcing hard reconnect",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0}},{key:"disconnect",value:(v=a(i.mark((function e(){var t=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("streamingClient.disconnect was called"),this.activeStanzaInstance){e.next=3;break}return e.abrupt("return");case 3:return this.jidResource="",e.abrupt("return",w.timeoutPromise((function(e){return t.autoReconnect=!1,t.http.stopAllRetries(),t.activeStanzaInstance.disconnect().then(e)}),5e3,"disconnecting streaming service"));case 5:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"getSessionStoreKey",value:function(){var e=this.config.appName||this.logger.clientId;return"".concat("sc_connectionData","_").concat(e)}},{key:"getConnectionData",value:function(){var e=sessionStorage.getItem(this.getSessionStoreKey()),t={currentDelayMs:0};if(e)try{return JSON.parse(e)}catch(e){return this.logger.warn("failed to parse streaming client connection data"),t}return t}},{key:"setConnectionData",value:function(e){sessionStorage.setItem(this.getSessionStoreKey(),JSON.stringify(e))}},{key:"increaseBackoff",value:function(){var e=this.getConnectionData(),t=Math.max(2*e.currentDelayMs,4e3),n={currentDelayMs:t,delayMsAfterNextReduction:t/2,nextDelayReductionTime:(new Date).getTime()+5*t,timeOfTotalReset:(new Date).getTime()+36e5};return this.setConnectionData(n),n}},{key:"decreaseBackoff",value:function(e){var t=this,n=this.getConnectionData(),r=5*e,i={currentDelayMs:e,delayMsAfterNextReduction:e/2,nextDelayReductionTime:(new Date).getTime()+r,timeOfTotalReset:n.timeOfTotalReset};if(n.timeOfTotalReset&&n.timeOfTotalReset<(new Date).getTime()||e<2e3)return this.logger.debug("decreaseBackoff() called, but timeOfTotalReset has elasped or next delay is below 2s. Resetting backoff"),this.setConnectionData({currentDelayMs:0});this.setConnectionData(i),clearTimeout(this.backoffReductionTimer),this.logger.debug("Setting timer for next backoff reduction since we haven't reached total reset",{msUntilReduction:r,delayMsAfterNextReduction:i.delayMsAfterNextReduction}),this.backoffReductionTimer=setTimeout((function(){return t.decreaseBackoff(i.delayMsAfterNextReduction)}),r)}},{key:"getStartingDelay",value:function(e,t){var n=Math.max(e.currentDelayMs,2e3);return e.timeOfTotalReset&&e.timeOfTotalReset<(new Date).getTime()?2e3:Math.min(n,t)}},{key:"connect",value:(d=a(i.mark((function e(t){var n,r,o,s,u,c,l,f,p,d,h,v=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.connecting){e.next=3;break}return r=new Error("Already trying to connect streaming client"),e.abrupt("return",this.logger.warn(r));case 3:return this.connecting=!0,o=(null==t?void 0:t.maxDelayBetweenConnectionAttempts)||9e4,s=(null==t?void 0:t.maxConnectionAttempts)||1,(null==t?void 0:t.keepTryingOnFailure)&&(s=1/0),clearTimeout(this.backoffReductionTimer),u=this.getConnectionData(),c=this.getStartingDelay(u,o),l=this.hasMadeInitialAttempt,this.hasMadeInitialAttempt=!0,u.currentDelayMs&&this.logger.debug("streamingClient.connect was called, but backoff is remembered",{currentDelayMs:u.currentDelayMs,delayingThisAttempt:l,clientId:this.logger.clientId,appName:this.config.appName}),e.prev=13,e.next=16,A.backOff(a(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=v.getConnectionData(),e.next=3,v.makeConnectionAttempt();case 3:t.nextDelayReductionTime&&(n=t.nextDelayReductionTime-(new Date).getTime(),v.logger.debug("Setting timer for next backoff reduction",{msUntilReduction:n,delayMsAfterNextReduction:t.delayMsAfterNextReduction}),v.backoffReductionTimer=setTimeout((function(){return v.decreaseBackoff(t.delayMsAfterNextReduction||0)}),n));case 4:case"end":return e.stop()}}),e)}))),{jitter:"none",maxDelay:o,numOfAttempts:s,startingDelay:c,delayFirstAttempt:l,retry:this.backoffConnectRetryHandler.bind(this,{maxConnectionAttempts:s})});case 16:e.next=24;break;case 18:throw e.prev=18,e.t0=e.catch(13),p=e.t0,e.t0?"AxiosError"===e.t0.name?(d=e.t0,h=d.config||{url:void 0,method:void 0},p={config:{url:h.url,method:h.method},status:null===(n=d.response)||void 0===n?void 0:n.status,code:d.code,name:d.name,message:d.message},f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Failed to connect streaming client due to network error",e.t0),this.networkErrorNeedsAuth(e.t0)&&(f=new w.StreamingClientError(k.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",e.t0))):e.t0 instanceof E.default?(f=new w.StreamingClientError(k.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",e.t0),this.saslErrorIsRetryable(e.t0)&&(f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received a SASL error",e.t0))):f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an unknown error",e.t0):(f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an undefined error"),p=f),this.logger.error("Failed to connect streaming client",{error:p}),f;case 24:case"end":return e.stop()}}),e,this,[[13,18]])}))),function(e){return d.apply(this,arguments)})},{key:"backoffConnectRetryHandler",value:(f=a(i.mark((function e(t,n,r){var a,o,s,u,c,l,f,p,d,h,v,m;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r>=t.maxConnectionAttempts)){e.next=2;break}return e.abrupt("return",!1);case 2:if(c={connectionAttempt:r,error:n},n){e.next=7;break}c.error=new Error("streaming client backoff handler received undefined error"),e.next=15;break;case 7:if("AxiosError"!==n.name){e.next=15;break}if(f=(l=n).config||{url:void 0,method:void 0},p={config:{url:f.url,method:f.method},status:null===(a=l.response)||void 0===a?void 0:a.status,code:l.code,name:l.name,message:l.message},c.error=p,!this.networkErrorNeedsAuth(n)){e.next=15;break}return this.logger.error("Streaming client received an error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 15:if(!(n instanceof E.default)){e.next=25;break}if(!this.saslErrorIsRetryable(n)){e.next=22;break}this.logger.info("hardReconnectRequired set to true due to sasl error"),this.hardReconnectRequired=!0,Object.assign(c,{channelId:n.channelId,stanzaInstanceId:n.stanzaInstanceId}),e.next=25;break;case 22:return c.error=n.condition,this.logger.error("Streaming-client received a SASL error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 25:if(n instanceof N.TimeoutError&&(c.error=n.message,(d=n.details)&&(c.details=d)),!(null==n?void 0:n.response)){e.next=36;break}if(!(h=(null===(o=n.response.headers)||void 0===o?void 0:o["retry-after"])||(null===(u=(s=n.response).getResponseHeader)||void 0===u?void 0:u.call(s,"retry-after")))){e.next=36;break}return v=1e3*parseInt(h,10),c.retryDelay=v,this.logger.error("Failed streaming client connection attempt, respecting retry-after header and will retry afterwards.",c,{skipServer:n instanceof I.default}),e.next=34,w.delay(v);case 34:return this.logger.debug("finished waiting for retry-after"),e.abrupt("return",!0);case 36:return m=this.increaseBackoff(),this.logger.error("Failed streaming client connection attempt, retrying",c,{skipServer:n instanceof I.default}),this.logger.debug("debug: retry info",{expectedRetryInMs:m.currentDelayMs,appName:this.config.appName,clientId:this.logger.clientId}),e.abrupt("return",!0);case 40:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"networkErrorNeedsAuth",value:function(e){var t;return[401,403].includes((null===(t=e.response)||void 0===t?void 0:t.status)||0)}},{key:"saslErrorIsRetryable",value:function(e){return["encryption-required","incorrect-encoding","invalid-mechanism","malformed-request","mechanism-too-weak"].includes(e.condition)}},{key:"makeConnectionAttempt",value:(l=a(i.mark((function e(){var t,n,r,a,o,s,u,c,l;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=2;break}throw new I.default("Browser is offline, skipping connection attempt");case 2:return a=this.connecting,e.prev=3,e.next=6,this.prepareForConnect();case 6:return e.next=8,this.connectionManager.getNewStanzaConnection();case 8:r=e.sent,this.connected=!0,this.connecting=!1,this.addInateEventHandlers(r),this.proxyStanzaEvents(r),o=p(this.extensions),e.prev=14,o.s();case 16:if((s=o.n()).done){e.next=23;break}if(!(u=s.value).configureNewStanzaInstance){e.next=21;break}return e.next=21,u.configureNewStanzaInstance(r);case 21:e.next=16;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(14),o.e(e.t0);case 28:return e.prev=28,o.f(),e.finish(28);case 31:c=p(this.extensions);try{for(c.s();!(l=c.n()).done;)l.value.handleStanzaInstanceChange(r)}catch(e){c.e(e)}finally{c.f()}return this.activeStanzaInstance=r,e.next=36,this.setupConnectionMonitoring(r);case 36:this.emit("connected"),e.next=51;break;case 39:if(e.prev=39,e.t1=e.catch(3),!r){e.next=50;break}return this.logger.error("Error occurred in connection attempt, but after websocket connected. Cleaning up connection so backoff is respected",{stanzaInstanceId:r.id,channelId:r.channelId}),this.removeStanzaBoundEventHandlers(),null===(t=r.pinger)||void 0===t||t.stop(),null===(n=r.serverMonitor)||void 0===n||n.stop(),e.next=48,r.disconnect();case 48:this.connected=!1,this.connecting=a;case 50:throw e.t1;case 51:case"end":return e.stop()}}),e,this,[[3,39],[14,25,28,31]])}))),function(){return l.apply(this,arguments)})},{key:"setupConnectionMonitoring",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(n=function(e){var n="".concat(e,", falling back to client-side pinging");r.logger.warn(n,{stanzaInstanceId:t.id,channelId:t.channelId}),t.pinger=new _.Ping(r,t)},!this.useServerSidePings){e.next=13;break}return e.prev=2,e.next=5,t.subscribeToNode(this._notifications.pubsubHost,"enable.server.side.pings");case 5:t.serverMonitor=new S.ServerMonitor(this,t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),n("failed to establish server-side pinging");case 11:e.next=14;break;case 13:n("client configured to not use server-side pinging");case 14:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return n.apply(this,arguments)})},{key:"prepareForConnect",value:(t=a(i.mark((function e(){var t,n,a,o,s,u,c,l;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.jwt){e.next=3;break}return this.hardReconnectRequired=!1,e.abrupt("return",this.connectionManager.setConfig(this.config));case 3:if(this.hardReconnectRequired||(this.channelReuses++,this.channelReuses>=10&&(this.logger.warn("Forcing a hard reconnect due to max channel reuses",{channelId:this.config.channelId,channelReuses:this.channelReuses}),this.channelReuses=0,this.hardReconnectRequired=!0)),!this.hardReconnectRequired){e.next=31;break}if(!this.config.jid){e.next=9;break}t=Promise.resolve(this.config.jid),e.next=13;break;case 9:return n={method:"get",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},e.next=12,this.http.requestApi("users/me",n).then((function(e){return e.data.chat.jabberId}));case 12:t=e.sent;case 13:return this.jidResource=this.config.jidResource||j.v4(),a={method:"post",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},e.next=17,this.http.requestApi("notifications/channels?connectionType=streaming",a).then((function(e){return e.data.id}));case 17:return o=e.sent,e.next=20,Promise.all([t,o]);case 20:s=e.sent,u=r(s,2),c=u[0],l=u[1],this.config.jid=c,this.config.jidResource=this.jidResource,this.config.channelId=l,this.autoReconnect=!0,this.logger.info("attempting to connect streaming client on channel",{channelId:l}),this.connectionManager.setConfig(this.config),this.hardReconnectRequired=!1;case 31:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"stopServerLogging",value:function(){this.logger.sendAllLogsInstantly(),this.logger.stopServerLogging()}},{key:"startServerLogging",value:function(){this.logger.startServerLogging()}},{key:"setAccessToken",value:function(e){this.config.authToken=e,this.logger.setAccessToken(e)}},{key:"version",get:function(){return O.version}}],[{key:"extend",value:function(e,t){if(C[e])throw new Error("Cannot register already existing namespace ".concat(e));C[e]=t}},{key:"version",get:function(){return"19.2.0"}}]),O}(O.default);t.Client=P},function(e,t,n){"use strict";var r=this&&this.__awaiter||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())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(213),o=n(214);t.backOff=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=a.getSanitizedOptions(t),[4,new s(e,n).execute()];case 1:return[2,r.sent()]}}))}))};var s=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,o.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}}))}))},e}()},function(e,t,n){var r=n(226);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default,i=n(207);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var n=function(e,t,n,r){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=r,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,n){var r=this;return this.bucketSize?e>this.bucketSize?(t.nextTick(n.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),e>this.content?i():this.parentBucket?this.parentBucket.removeTokens(e,(function(t,a){return t?n(t,null):e>r.content?i():(r.content-=e,void n(null,Math.min(a,r.content)))})):(this.content-=e,t.nextTick(n.bind(null,null,this.content)),!0)):(t.nextTick(n.bind(null,null,e,Number.POSITIVE_INFINITY)),!0);function i(){var t=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout((function(){r.removeTokens(e,n)}),t),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},e.exports=n}).call(this,n(32))},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(216),i=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise((function(t){return setTimeout(t,e.jitteredDelay)}))},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return r.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,n=this.numOfDelayedAttempts,r=e*Math.pow(t,n);return Math.min(r,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=i},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}),t.TimeoutError=void 0;var c=function(e){i(n,e);var t=u(n);function n(e){return r(this,n),t.call(this,e)}return n}(s(Error));t.TimeoutError=c},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";var r=n(13),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}),t.saslprep=t.resourceprep=t.nodeprep=t.NodePrepProhibited=t.nameprep=t.prepare=t.D2=t.D1=t.C9=t.C8=t.C7=t.C6=t.C5=t.C4=t.C3=t.C22=t.C21=t.C12=t.C11=t.B3=t.B2=t.B1=t.A1=t.Table=void 0;var u=(0,n(15).__importDefault)(n(55)),c=n(234),l=function(){function e(t,n){i(this,e),this.singles=new Set,this.ranges=[],this.mappings=new Map;var a=c.TABLE_DATA[t];this.name=t,a?(a.s&&(this.singles=new Set(a.s.split("|").map((function(e){return parseInt(e,32)})))),a.r&&(this.ranges=a.r.split("|").map((function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1];return[parseInt(i,32),parseInt(a,32)]}))),a.m&&(this.mappings=new Map(a.m.split("|").map((function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1].split(";").map((function(e){return parseInt(e,32)}));return[parseInt(i,32),a]}))))):n&&(this.singles=new Set(n))}return a(e,[{key:"contains",value:function(e){if(this.singles.has(e))return!0;for(var t=0,n=this.ranges.length-1;t<=n;){var r=Math.floor((t+n)/2),i=this.ranges[r];if(e<i[0])n=r-1;else{if(!(e>i[1]))return!0;t=r+1}}return!1}},{key:"hasMapping",value:function(e){return this.mappings.has(e)||this.contains(e)}},{key:"map",value:function(e){return this.contains(e)&&!this.mappings.has(e)?String.fromCodePoint(e).toLowerCase().codePointAt(0):this.mappings.get(e)||null}}]),e}();function f(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=u.default.ucs2.decode(i),s=[],c=o(a);try{for(c.s();!(r=c.n()).done;){var l=r.value;if(!n&&e.unassigned.contains(l))throw new Error("Unassigned code point: x"+l.toString(16));var f,p=!1,d=o(e.mappings);try{for(d.s();!(f=d.n()).done;){var h=f.value;if(h.hasMapping(l)){p=!0;var v=h.map(l);v&&(Array.isArray(v)?s=s.concat(v):s.push(v))}}}catch(e){d.e(e)}finally{d.f()}p||s.push(l)}}catch(e){c.e(e)}finally{c.f()}var m=s;if(e.normalize){var g=u.default.ucs2.encode(s),y=g.normalize("NFKC");m=u.default.ucs2.decode(y)}var b,_=!1,S=!1,w=o(m);try{for(w.s();!(b=w.n()).done;){var x,k=b.value,O=o(e.prohibited);try{for(O.s();!(x=O.n()).done;){var T=x.value;if(T.contains(k))throw new Error("Prohibited code point: x"+k.toString(16))}}catch(e){O.e(e)}finally{O.f()}if(!n&&e.unassigned.contains(k))throw new Error("Prohibited code point: x"+k.toString(16));e.bidirectional&&(_=_||t.D1.contains(k),S=S||t.D2.contains(k))}}catch(e){w.e(e)}finally{w.f()}if(e.bidirectional){if(_&&S)throw new Error("String contained both LCat and RandALCat code points");if(_&&(!t.D1.contains(m[0])||!t.D1.contains(m[m.length-1])))throw new Error("String containing RandALCat code points must start and end with RandALCat code points")}return u.default.ucs2.encode(m)}t.Table=l,t.A1=new l("A.1"),t.B1=new l("B.1"),t.B2=new l("B.2"),t.B3=new l("B.3"),t.C11=new l("C.1.1"),t.C12=new l("C.1.2"),t.C21=new l("C.2.1"),t.C22=new l("C.2.2"),t.C3=new l("C.3"),t.C4=new l("C.4"),t.C5=new l("C.5"),t.C6=new l("C.6"),t.C7=new l("C.7"),t.C8=new l("C.8"),t.C9=new l("C.9"),t.D1=new l("D.1"),t.D2=new l("D.2"),t.B1.map=function(){return null},t.C11.contains=function(e){return 32===e},t.C12.map=function(e){return t.C12.contains(e)?32:null},t.prepare=f;var p={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C12,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.nameprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(p,t,e)},t.NodePrepProhibited=new l("NodePrepProhibited",[34,38,39,47,58,60,62,64]);var d={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C11,t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9,t.NodePrepProhibited],unassigned:t.A1};t.nodeprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(d,t,e)};var h={bidirectional:!0,mappings:[t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.resourceprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(h,t,e)};var v={bidirectional:!0,mappings:[t.C12,t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.saslprep=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return f(v,t,e)}},function(e,t){e.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(12),i=n(4),a=n(13),o=n(6),s=n(7);function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(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 f(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 f(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 f(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 p=n(57),d=function(){function e(){o(this,e),this.parents=new Set,this.placeholder=!1,this.typeField="",this.versionField="",this.defaultType="",this.defaultVersion="",this.languageField="lang",this.typeValues=new Map,this.typeOrders=new Map,this.importers=new Map,this.exporters=new Map,this.children=new Map,this.childrenIndex=new Map,this.implicitChildren=new Set,this.contexts=new Map}return s(e,[{key:"addChild",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={multiple:n||!1,name:e,selector:r,translator:t},s=this.children.get(e);if(s){var u=s.translator;s.multiple=n,r&&s.selector&&r!==s.selector&&(s.selector=void 0);var c,f=l(t.importers);try{for(f.s();!(c=f.n()).done;){var p=a(c.value,2),d=p[0],h=p[1],v=(u.typeValues.get(d)||"").split("__v__"),m=a(v,2),g=m[0],y=m[1];u.updateDefinition({contexts:t.contexts,element:h.element,exporterOrdering:new Map,exporters:new Map,importerOrdering:h.fieldOrders,importers:h.fields,namespace:h.namespace,optionalNamespaces:new Map,type:g,version:y}),this.implicitChildren.has(d)||this.childrenIndex.set(d,e)}}catch(e){f.e(e)}finally{f.f()}var b,_=l(t.exporters);try{for(_.s();!(b=_.n()).done;){var S=a(b.value,2),w=S[0],x=S[1],k=w.split("__v__"),O=a(k,2),T=O[0],A=O[1];u.updateDefinition({contexts:t.contexts,element:x.element,exporterOrdering:x.fieldOrders,exporters:x.fields,importerOrdering:new Map,importers:new Map,namespace:x.namespace,optionalNamespaces:x.optionalNamespaces,type:T,version:A})}}catch(e){_.e(e)}finally{_.f()}}else{o.translator.parents.add(this),this.children.set(e,o);var I,E=l(t.importers);try{for(E.s();!(I=E.n()).done;){var N=a(I.value,1),R=N[0];this.implicitChildren.has(R)||this.childrenIndex.set(R,e)}}catch(e){E.e(e)}finally{E.f()}i&&this.implicitChildren.add(i)}}},{key:"addContext",value:function(e,t,n,r,i,a){t&&(e="".concat(e,"[").concat(t,"]"));var o=this.contexts.get(e);o||(o={typeField:"",versionField:"",typeValues:new Map}),a&&(o.impliedType=i),o.typeField=n||"",o.typeValues.set(r,i),this.contexts.set(e,o)}},{key:"getChild",value:function(e){var t=this.children.get(e);if(t)return t.translator}},{key:"getImportKey",value:function(e){return this.childrenIndex.get("{".concat(e.getNamespace(),"}").concat(e.getName()))}},{key:"updateDefinition",value:function(e){var t,n="{".concat(e.namespace,"}").concat(e.element),r=e.type||this.defaultType,i=e.version||this.defaultVersion,o=i?"".concat(r,"__v__").concat(i):r,s=this.importers.get(n)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace},u=l(e.importers);try{for(u.s();!(t=u.n()).done;){var c=a(t.value,2),f=c[0],p=c[1];s.fields.set(f,p)}}catch(e){u.e(e)}finally{u.f()}var d,h=l(e.importerOrdering);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];s.fieldOrders.set(m,g)}}catch(e){h.e(e)}finally{h.f()}this.importers.set(n,s);var y,b=this.exporters.get(o)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace,optionalNamespaces:e.optionalNamespaces},_=l(e.exporters);try{for(_.s();!(y=_.n()).done;){var S=a(y.value,2),w=S[0],x=S[1];b.fields.set(w,x)}}catch(e){_.e(e)}finally{_.f()}var k,O=l(e.exporterOrdering);try{for(O.s();!(k=O.n()).done;){var T=a(k.value,2),A=T[0],I=T[1];b.fieldOrders.set(A,I)}}catch(e){O.e(e)}finally{O.f()}var E,N=l(e.optionalNamespaces);try{for(N.s();!(E=N.n()).done;){var R=a(E.value,2),j=R[0],C=R[1];b.optionalNamespaces.set(j,C)}}catch(e){N.e(e)}finally{N.f()}this.exporters.set(o,b);var P,M=l(e.contexts);try{for(M.s();!(P=M.n()).done;){var D=a(P.value,2),L=D[0],B=D[1],F=this.contexts.get(L)||{impliedType:void 0,typeField:B.typeField,versionField:B.versionField,typeValues:new Map};F.typeField||(F.typeField=B.typeField),F.versionField||(F.versionField=B.versionField),F.impliedType||(F.impliedType=B.impliedType);var q,U=l(B.typeValues);try{for(U.s();!(q=U.n()).done;){var z=a(q.value,2),J=z[0],G=z[1];F.typeValues.set(J,G)}}catch(e){U.e(e)}finally{U.f()}this.contexts.set(L,F)}}catch(e){M.e(e)}finally{M.f()}if(e.type)this.typeValues.set(n,o),e.typeOrder&&e.type&&this.typeOrders.set(e.type,e.typeOrder);else if(this.typeField&&!e.type){var H,V=l(this.importers);try{for(V.s();!(H=V.n()).done;){var W,Q=a(H.value,2)[1],K=l(e.importers);try{for(K.s();!(W=K.n()).done;){var Y=a(W.value,2),X=Y[0],$=Y[1];Q.fields.set(X,$)}}catch(e){K.e(e)}finally{K.f()}var Z,ee=l(e.importerOrdering);try{for(ee.s();!(Z=ee.n()).done;){var te=a(Z.value,2),ne=te[0],re=te[1];Q.fieldOrders.set(ne,re)}}catch(e){ee.e(e)}finally{ee.f()}}}catch(e){V.e(e)}finally{V.f()}var ie,ae=l(this.exporters);try{for(ae.s();!(ie=ae.n()).done;){var oe,se=a(ie.value,2)[1],ue=l(e.exporters);try{for(ue.s();!(oe=ue.n()).done;){var ce=a(oe.value,2),le=ce[0],fe=ce[1];se.fields.set(le,fe)}}catch(e){ue.e(e)}finally{ue.f()}var pe,de=l(e.exporterOrdering);try{for(de.s();!(pe=de.n()).done;){var he=a(pe.value,2),ve=he[0],me=he[1];se.fieldOrders.set(ve,me)}}catch(e){de.e(e)}finally{de.f()}}}catch(e){ae.e(e)}finally{ae.f()}}}},{key:"replaceWith",value:function(e){var t,n=l(this.children);try{for(n.s();!(t=n.n()).done;){var r=a(t.value,2),i=r[0],o=r[1];e.children.set(i,o)}}catch(e){n.e(e)}finally{n.f()}var s,u=l(this.childrenIndex);try{for(u.s();!(s=u.n()).done;){var c=a(s.value,2),f=c[0],p=c[1];e.childrenIndex.set(f,p)}}catch(e){u.e(e)}finally{u.f()}var d,h=l(this.contexts);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];e.contexts.set(m,g)}}catch(e){h.e(e)}finally{h.f()}var y,b=l(this.implicitChildren);try{for(b.s();!(y=b.n()).done;){var _=y.value;e.implicitChildren.add(_)}}catch(e){b.e(e)}finally{b.f()}var S,w=l(this.parents);try{for(w.s();!(S=w.n()).done;){var x,k=l(S.value.children.values());try{for(k.s();!(x=k.n()).done;){var O=x.value;O.translator===this&&(O.translator=e)}}catch(e){k.e(e)}finally{k.f()}}}catch(e){w.e(e)}finally{w.f()}this.parents=new Set}},{key:"import",value:function(e,t){var n="{".concat(e.getNamespace(),"}").concat(e.getName()),i={},o=this.importers.get(n);if(o){var s,u=(this.typeValues.get(n)||"").split("__v__"),f=a(u,2),p=f[0],d=f[1],h=t.path||"";if(t.pathSelector&&(s=this.contexts.get("".concat(h,"[").concat(t.pathSelector,"]"))),s||(s=this.contexts.get(h)),s){if(!s.impliedType){var v=s.typeValues.get(n)||"";v&&(i[s.typeField]=v)}}else this.typeField&&p&&p!==this.defaultType&&(i[this.typeField]=p);this.versionField&&d&&d!==this.defaultVersion&&(i[this.versionField]=d);var m,g=c(c({},t),{},{data:i,importer:o,lang:(e.getAttribute("xml:lang")||t.lang||"").toLowerCase(),pathSelector:p,translator:this}),y=r(o.fieldOrders.entries()).sort((function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0})),b=y.filter((function(e){return e[1]>=0})),_=y.filter((function(e){return e[1]<0})),S=l(b);try{for(S.s();!(m=S.n()).done;){var w=a(m.value,1)[0],x=o.fields.get(w);g.path="".concat(t.path,".").concat(w);var k=x(e,g);null!=k&&(i[w]=k)}}catch(e){S.e(e)}finally{S.f()}var O,T=l(e.children);try{for(T.s();!(O=T.n()).done;){var A=O.value;if("string"!=typeof A){var I="{".concat(A.getNamespace(),"}").concat(A.getName()),E=this.childrenIndex.get(I);if(E){g.path="".concat(t.path,".").concat(E);var N=this.children.get(E),R=N.translator,j=N.multiple,C=N.selector;if(!C||C===p){var P=R.import(A,g);void 0!==P&&(j?(i[E]||(i[E]=[]),i[E].push(P)):i[E]?i[E]=R.resolveCollision(i[E],P):i[E]=P)}}}}}catch(e){T.e(e)}finally{T.f()}var M,D=l(_);try{for(D.s();!(M=D.n()).done;){var L=a(M.value,1)[0],B=o.fields.get(L);g.path="".concat(t.path,".").concat(L);var F=B(e,g);null!=F&&(i[L]=F)}}catch(e){D.e(e)}finally{D.f()}return i}}},{key:"export",value:function(e,t){if(e){var n,r=this.defaultType,i=this.defaultVersion,o=t.path||"";t.pathSelector&&(n=this.contexts.get("".concat(o,"[").concat(t.pathSelector,"]"))),n||(n=this.contexts.get(o)),n?r=n.impliedType||e[n.typeField]||this.defaultType:this.typeField&&(r=e[this.typeField]||this.defaultType),this.versionField&&(i=e[this.versionField]||this.defaultVersion);var s=i?"".concat(r,"__v__").concat(i):r,u=this.exporters.get(s);if(u){var f=(0,p.createElement)(u.namespace,u.element,t.namespace,t.element);t.element&&(f.parent=t.element);var d,h=l(u.optionalNamespaces);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];f.addOptionalNamespace(m,g)}}catch(e){h.e(e)}finally{h.f()}var y=c(c({},t),{},{data:e,element:f,exporter:u,lang:(e[this.languageField]||t.lang||"").toLowerCase(),namespace:f.getDefaultNamespace(),pathSelector:r,translator:this}),b=u.fields.get(this.languageField);b&&b(f,e[this.languageField],t);var _=Object.keys(e);_.sort((function(e,t){return(u.fieldOrders.get(e)||1e5)-(u.fieldOrders.get(t)||1e5)}));for(var S=0,w=_;S<w.length;S++){var x=w[S];if(x!==this.languageField){var k=e[x],O=u.fields.get(x);if(O)O(f,k,y);else{var T=this.children.get(x);if(T){y.path="".concat(t.path?t.path+".":"").concat(x);var A=T.translator,I=T.multiple,E=T.selector;if(!E||E===r){var N,R=l(I?null!=k?k:[]:[k]);try{for(R.s();!(N=R.n()).done;){var j=N.value,C=A.export(j,y);C&&f.appendChild(C)}}catch(e){R.e(e)}finally{R.f()}}}}}}return f}}}},{key:"resolveCollision",value:function(e,t){return(this.typeOrders.get(e[this.typeField]||this.defaultType)||0)<=(this.typeOrders.get(t[this.typeField]||this.defaultType)||0)?e:t}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;var r=n(15),i=(0,r.__importDefault)(n(38));t.Hash=i.default;var a=(0,r.__importDefault)(n(248)),o=(0,r.__importDefault)(n(249)),s=(0,r.__importDefault)(n(250)),u=(0,r.__importDefault)(n(251)),c=new Map([["md5",a.default],["sha-1",o.default],["sha-256",s.default],["sha-512",u.default],["sha1",o.default],["sha256",s.default],["sha512",u.default]]);t.default=function(e){e=e.toLowerCase();var t=c.get(e);if(t)return new t;throw new Error("Unsupported hash algorithm: "+e)}},function(e,t,n){"use strict";(function(t,r){var i,a=n(42);e.exports=m,m.ReadableState=v;n(20).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=n(20).EventEmitter,u=n(23).Buffer,c=t.Uint8Array||function(){};var l,f=Object.create(n(39)),p=n(246).BufferList,d=n(88);f.inherits(m,s);var h=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(37));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(90).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function m(e){if(i=i||n(37),!(this instanceof m))return new m(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function g(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,_(e)}(e,o)):(i||(a=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):y(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?y(e,o,t,!1):w(e,o)):y(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function y(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&_(e)),w(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=d.destroy,m.prototype._undestroy=d.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),g(this,e,t,!1,n)},m.prototype.unshift=function(e){return g(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return l||(l=n(90).StringDecoder),this._readableState.decoder=new l(e),this._readableState.encoding=e,this};function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.flowing,t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){e.emit("readable"),T(e)}function w(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(x,e,t))}function x(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function k(e){e.read(0)}function O(e,t){t.reading||e.read(0),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(t.flowing;t.flowing&&null!==e.read(););}function A(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(E,t,e))}function E(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}m.prototype.read=function(e){e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return t.length,t.ended,0===t.length&&t.ended?I(this):_(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,i=t.needReadable;return(0===t.length||t.length-e<t.highWaterMark)&&(i=!0),t.ended||t.reading?i=!1:i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(n,t))),null===(r=e>0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,i.pipesCount;var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function u(t,r){t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",u),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){e.end()}i.endEmitted?a.nextTick(s):n.once("end",s),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;t.awaitDrain,t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",l);var f=!1;var p=!1;function d(t){p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(n._readableState.awaitDrain,n._readableState.awaitDrain++,p=!0),n.pause())}function h(t){g(),e.removeListener("error",h),0===o(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",m),g()}function m(){e.removeListener("close",v),g()}function g(){n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",v),e.once("finish",m),e.emit("pipe",n),i.flowing||n.resume(),e},m.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=N(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},m.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&_(this):a.nextTick(k,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(O,e,t))}(this,e)),this},m.prototype.pause=function(){return this._readableState.flowing,!1!==this._readableState.flowing&&(this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<h.length;a++)e.on(h[a],this.emit.bind(this,h[a]));return this._read=function(t){r&&(r=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=A}).call(this,n(25),n(32))},function(e,t,n){"use strict";var r=n(42);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t){var r=n(42);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var a,o=r.nextTick;v.WritableState=h;var s=Object.create(n(39)),u=n(20).EventEmitter,c=n(23).Buffer,l=t.Uint8Array||function(){};var f,p=n(88);function d(){}function h(e,t){a=a||n(37),e=e||{};var s=t instanceof a;this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:s&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(a(i),e._writableState.errorEmitted=!0,e.emit("error",i),S(e,t))}(e,n,i,t,a);else{var s=b(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),i?o(g,e,n,s,a):g(e,n,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function v(e){if(a=a||n(37),!(f.call(v,this)||this instanceof a))return new v(e);this._writableState=new h(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function m(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function g(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)a[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;a.allBuffers=u,m(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=b(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,r.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}s.inherits(v,u),h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(h.prototype,"buffer",{get:function(){return this.getBuffer()}})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===v&&(e&&e._writableState instanceof h)}})):f=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,c.isBuffer(i)||i instanceof l);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=d),a.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),r.nextTick(i,o),a=!1),a}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,a);return u}(this,a,s,e,t,n)),o},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=p.destroy,v.prototype._undestroy=p.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(25))},function(e,t,n){"use strict";var r=n(23).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(37);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){s(e,t,n)})):s(this,null,null)}function s(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}Object.create(n(39)).inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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){a(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=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}),t.Receiver=t.Sender=void 0;var m=n(15),g=n(20),y=(0,m.__importStar)(n(21)),b=n(18),_=n(2),S=(0,m.__importDefault)(n(62)),w=n(44),x=n(63),k=function(e){u(n,e);var t=v(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(e=t.call(this)).config=h({chunkSize:16384,hash:"sha-1"},r),e.file=void 0,e.channel=void 0,e.hash=y.createHash(e.config.hash),e}return s(n,[{key:"send",value:function(e,t){var n=this;if(!this.file||!this.channel){this.file=e,this.channel=t,this.channel.binaryType="arraybuffer";var r=new FileReader,i=0,a=!1,o=function(){if(!(a||i>=e.size)){a=!0;var t=e.slice(i,i+n.config.chunkSize);r.readAsArrayBuffer(t)}};t.bufferedAmountLowThreshold=8*this.config.chunkSize,t.onbufferedamountlow=function(){o()},r.addEventListener("load",(function(t){var r=t.target.result;a=!1,i+=r.byteLength,n.channel.send(r),n.hash.update(new Uint8Array(r)),n.emit("progress",i,e.size,r),i<e.size?n.channel.bufferedAmount<=n.channel.bufferedAmountLowThreshold&&o():(n.emit("progress",e.size,e.size,null),n.emit("sentFile",{algorithm:n.config.hash,name:e.name,size:e.size,value:n.hash.digest()}))})),o()}}}]),n}(g.EventEmitter);t.Sender=k;var O=function(e){u(n,e);var t=v(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(e=t.call(this)).config=h({hash:"sha-1"},r),e.receiveBuffer=[],e.received=0,e.channel=void 0,e.hash=y.createHash(e.config.hash),e}return s(n,[{key:"receive",value:function(e,t){var n=this;this.metadata=e,this.channel=t,this.channel.binaryType="arraybuffer",this.channel.onmessage=function(e){var t=e.data.byteLength;n.received+=t,n.receiveBuffer.push(e.data),e.data&&n.hash.update(new Uint8Array(e.data)),n.emit("progress",n.received,n.metadata.size,e.data),n.received===n.metadata.size?(n.metadata.actualhash=n.hash.digest("hex"),n.emit("receivedFile",new Blob(n.receiveBuffer),n.metadata),n.receiveBuffer=[]):n.received>n.metadata.size&&(console.error("received more than expected, discarding..."),n.receiveBuffer=[])}}}]),n}(g.EventEmitter);t.Receiver=O;var T=function(e){u(l,e);var t,n,a,c=v(l);function l(e){var t;return o(this,l),(t=c.call(this,e)).sender=void 0,t.receiver=void 0,t.file=void 0,t}return s(l,[{key:"start",value:(a=i(r.mark((function e(t,n){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=n||function(){},t&&"function"!=typeof t){e.next=3;break}throw new Error("File object required");case 3:return this.state="pending",this.role="initiator",this.file=t,this.sender=new k,this.sender.on("progress",(function(e,t){a._log("info","Send progress "+e+"/"+t)})),this.sender.on("sentFile",(function(e){a._log("info","Sent file",e.name),a.send(b.JingleAction.SessionInfo,{info:{creator:b.JingleSessionRole.Initiator,file:{hashes:[{algorithm:e.algorithm,value:e.value}]},infoType:b.JINGLE_INFO_CHECKSUM_5,name:a.contentName}}),a.parent.emit("sentFile",a,e)})),this.channel=this.pc.createDataChannel("filetransfer",{ordered:!0}),this.channel.onopen=function(){a.sender.send(a.file,a.channel)},e.prev=11,e.next=14,this.processLocal(b.JingleAction.SessionInitiate,i(r.mark((function e(){var n,i,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createOffer({offerToReceiveAudio:!1,offerToReceiveVideo:!1});case 2:return n=e.sent,i=(0,w.importFromSDP)(n.sdp),o=(0,x.convertIntermediateToRequest)(i,a.role,a.transportType),a.contentName=o.contents[0].name,o.sid=a.sid,o.action=b.JingleAction.SessionInitiate,o.contents[0].application={applicationType:_.NS_JINGLE_FILE_TRANSFER_5,file:{date:t.lastModified?new Date(t.lastModified):void 0,hashesUsed:[{algorithm:"sha-1"}],name:t.name,size:t.size}},a.send("session-initiate",o),e.next=12,a.pc.setLocalDescription(n);case 12:case"end":return e.stop()}}),e)}))));case 14:n(),e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(11),this._log("error","Could not create WebRTC offer",e.t0),e.abrupt("return",this.end("failed-application",!0));case 21:case"end":return e.stop()}}),e,this,[[11,17]])}))),function(e,t){return a.apply(this,arguments)})},{key:"accept",value:(n=i(r.mark((function e(t){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Accepted incoming session"),this.role="responder",this.state="active",t=t||function(){},e.prev=4,e.next=7,this.processLocal(b.JingleAction.SessionAccept,i(r.mark((function e(){var t,i,a,o,s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.pc.createAnswer();case 2:t=e.sent,i=(0,w.importFromSDP)(t.sdp),(a=(0,x.convertIntermediateToRequest)(i,n.role,n.transportType)).sid=n.sid,a.action="session-accept",o=f(a.contents);try{for(o.s();!(s=o.n()).done;)s.value.creator="initiator"}catch(e){o.e(e)}finally{o.f()}return n.contentName=a.contents[0].name,n.send("session-accept",a),e.next=13,n.pc.setLocalDescription(t);case 13:return e.next=15,n.processBufferedCandidates();case 15:case"end":return e.stop()}}),e)}))));case 7:t(),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),this._log("error","Could not create WebRTC answer",e.t0),this.end("failed-application");case 14:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(e){return n.apply(this,arguments)})},{key:"onSessionInitiate",value:(t=i(r.mark((function e(t,n){var i,a,o,s,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Initiating incoming session"),this.role="responder",this.state="pending",this.transportType=t.contents[0].transport.transportType,i=(0,x.convertRequestToIntermediate)(t,this.peerRole),a=(0,w.exportToSDP)(i),o=t.contents[0].application,s=o.file.hashesUsed?o.file.hashesUsed:o.file.hashes||[],this.receiver=new O({hash:s[0]&&s[0].algorithm}),this.receiver.on("progress",(function(e,t){u._log("info","Receive progress "+e+"/"+t)})),this.receiver.on("receivedFile",(function(e){u.receivedFile=e,u._maybeReceivedFile()})),this.receiver.metadata=o.file,this.pc.addEventListener("datachannel",(function(e){u.channel=e.channel,u.receiver.receive(u.receiver.metadata,e.channel)})),e.prev=13,e.next=16,this.pc.setRemoteDescription({type:"offer",sdp:a});case 16:return e.next=18,this.processBufferedCandidates();case 18:n(),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(13),this._log("error","Could not create WebRTC answer",e.t0),n({condition:"general-error"});case 25:case"end":return e.stop()}}),e,this,[[13,21]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onSessionInfo",value:function(e,t){var n=e.info;n&&n.file&&n.file.hashes&&(this.receiver.metadata.hashes=n.file.hashes,this.receiver.metadata.actualhash&&this._maybeReceivedFile(),t())}},{key:"_maybeReceivedFile",value:function(){if(this.receiver.metadata.hashes&&this.receiver.metadata.hashes.length){var e,t=f(this.receiver.metadata.hashes||[]);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.value&&n.value.toString("hex")===this.receiver.metadata.actualhash)return this._log("info","File hash matches"),this.parent.emit("receivedFile",this,this.receivedFile,this.receiver.metadata),void this.end("success")}}catch(e){t.e(e)}finally{t.f()}this._log("error","File hash does not match"),this.end("media-error")}}}]),l}(S.default);t.default=T},function(e,t,n){"use strict";(function(e){var t=n(11),r={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:void 0===n[t[r]]&&(n[t[r]]=t[r+1])}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation);var n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substring(14).split(" ")},r.parseRtpMap=function(e){var t=e.substring(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substring(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},r.parseSsrcGroup=function(e){var t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substring(6)},r.parseFingerprint=function(e){var t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===t(e.keyParams)?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},r.writeIceParameters=function(e){var t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},r.parseRtpParameters=function(e){var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" ");t.profile=n[2];for(var i=3;i<n.length;i++){var a=n[i],o=r.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(o){var s=r.parseRtpMap(o),u=r.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=u.length?r.parseFmtp(u[0]):{},s.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(r.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))}));var c=r.matchPrefix(e,"a=rtcp-fb:* ").map(r.parseRtcpFb);return t.codecs.forEach((function(e){c.forEach((function(t){e.rtcpFeedback.find((function(e){return e.type===t.type&&e.parameter===t.parameter}))||e.rtcpFeedback.push(t)}))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" "+(t.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),a=-1!==i.fecMechanisms.indexOf("RED"),o=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),u=s.length>0&&s[0].ssrc,c=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substring(17).split(" ").map((function(e){return parseInt(e,10)}))}));c.length>0&&c[0].length>1&&c[0][0]===u&&(t=c[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10)};u&&t&&(r.rtx={ssrc:t}),n.push(r),a&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:u,mechanism:o?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&u&&n.push({ssrc:u});var l=r.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=l}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var a=r.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},r.writeRtcpParameters=function(e){var t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substring(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substring(19),10)),isNaN(t)&&(t=65536);var a=r.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:n.fmt,maxMessageSize:t};var o=r.matchPrefix(e,"a=sctpmap:");if(o.length>0){var s=o[0].substring(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,22)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substring(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substring(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substring(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===t(e)&&(e.exports=r)}).call(this,n(81)(e))},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(7),s=n(43),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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=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 h=n(15),v=n(18),m=(0,h.__importDefault)(n(62)),g=n(44),y=n(63);function b(e){var t=e.application;if(t.streams&&t.streams.length&&t.sources&&t.sources.length){var n=t.streams[0];t.sources[0].parameters.msid="".concat(n.id," ").concat(n.track),t.sourceGroups&&t.sourceGroups.length>0&&t.sources.push({parameters:{cname:t.sources[0].parameters.cname,msid:"".concat(n.id," ").concat(n.track)},ssrc:t.sourceGroups[0].sources[1]})}}var _=function(e){u(m,e);var t,n,c,p,h=d(m);function m(e){var t;if(a(this,m),(t=h.call(this,e)).includesAudio=!1,t.includesVideo=!1,t._ringing=!1,t.pc.addEventListener("track",(function(e){t.onAddTrack(e.track,e.streams[0])})),e.stream){var n,r=f(e.stream.getTracks());try{for(r.s();!(n=r.n()).done;){var i=n.value;t.addTrack(i,e.stream)}}catch(e){r.e(e)}finally{r.f()}}return t}return o(m,[{key:"start",value:(p=i(r.mark((function e(t,n){var a=this,o=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="pending",1===o.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this.role="initiator",this.offerOptions=t,e.prev=6,e.next=9,this.processLocal(v.JingleAction.SessionInitiate,i(r.mark((function e(){var n,i,o,s,u,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createOffer(t);case 2:n=e.sent,i=(0,g.importFromSDP)(n.sdp),(o=(0,y.convertIntermediateToRequest)(i,a.role,a.transportType)).sid=a.sid,o.action=v.JingleAction.SessionInitiate,s=f(o.contents||[]);try{for(s.s();!(u=s.n()).done;)(c=u.value).creator="initiator",b(c)}catch(e){s.e(e)}finally{s.f()}return e.next=11,a.pc.setLocalDescription(n);case 11:a.send("session-initiate",o);case 12:case"end":return e.stop()}}),e)}))));case 9:n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),this._log("error","Could not create WebRTC offer",e.t0),this.end("failed-application",!0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e,t){return p.apply(this,arguments)})},{key:"accept",value:(c=i(r.mark((function e(t,n){var a=this,o=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 1===o.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this._log("info","Accepted incoming session"),this.state="active",this.role="responder",e.prev=6,e.next=9,this.processLocal(v.JingleAction.SessionAccept,i(r.mark((function e(){var n,i,o,s,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createAnswer(t);case 2:n=e.sent,i=(0,g.importFromSDP)(n.sdp),(o=(0,y.convertIntermediateToRequest)(i,a.role,a.transportType)).sid=a.sid,o.action=v.JingleAction.SessionAccept,s=f(o.contents||[]);try{for(s.s();!(u=s.n()).done;)u.value.creator="initiator"}catch(e){s.e(e)}finally{s.f()}return e.next=11,a.pc.setLocalDescription(n);case 11:return e.next=13,a.processBufferedCandidates();case 13:a.send("session-accept",o);case 14:case"end":return e.stop()}}),e)}))));case 9:n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),this._log("error","Could not create WebRTC answer",e.t0),this.end("failed-application");case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e,t){return c.apply(this,arguments)})},{key:"end",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=f(this.pc.getReceivers());try{for(r.s();!(e=r.n()).done;){var i=e.value;this.onRemoveTrack(i.track)}}catch(e){r.e(e)}finally{r.f()}s(l(m.prototype),"end",this).call(this,t,n)}},{key:"ring",value:function(){var e=this;return this.processLocal("ring",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Ringing on incoming session"),e.ringing=!0,e.send(v.JingleAction.SessionInfo,{info:{infoType:v.JINGLE_INFO_RINGING}});case 3:case"end":return t.stop()}}),t)}))))}},{key:"mute",value:function(e,t){var n=this;return this.processLocal("mute",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Muting",t),n.send(v.JingleAction.SessionInfo,{info:{creator:e,infoType:v.JINGLE_INFO_MUTE,name:t}});case 2:case"end":return r.stop()}}),i)}))))}},{key:"unmute",value:function(e,t){var n=this;return this.processLocal("unmute",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Unmuting",t),n.send(v.JingleAction.SessionInfo,{info:{creator:e,infoType:v.JINGLE_INFO_UNMUTE,name:t}});case 2:case"end":return r.stop()}}),i)}))))}},{key:"hold",value:function(){var e=this;return this.processLocal("hold",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Placing on hold"),e.send("session-info",{info:{infoType:v.JINGLE_INFO_HOLD}});case 2:case"end":return t.stop()}}),t)}))))}},{key:"resume",value:function(){var e=this;return this.processLocal("resume",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Resuming from hold"),e.send("session-info",{info:{infoType:v.JINGLE_INFO_ACTIVE}});case 2:case"end":return t.stop()}}),t)}))))}},{key:"addTrack",value:function(e,t,n){var a=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:a.pc.addTrack?a.pc.addTrack(e,t):a.pc.addStream(t),n&&n();case 2:case"end":return r.stop()}}),i)}))))}},{key:"removeTrack",value:(n=i(r.mark((function e(t,n){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.processLocal("removetrack",i(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.pc.removeTrack(t),!n){e.next=3;break}return e.abrupt("return",n());case 3:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"onAddTrack",value:function(e,t){this._log("info","Track added"),this.parent.emit("peerTrackAdded",this,e,t)}},{key:"onRemoveTrack",value:function(e){this._log("info","Track removed"),this.parent.emit("peerTrackRemoved",this,e)}},{key:"onSessionInitiate",value:(t=i(r.mark((function e(t,n){var i,a,o,s,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._log("info","Initiating incoming session"),this.state="pending",this.role="responder",this.transportType=t.contents[0].transport.transportType,i=(0,y.convertRequestToIntermediate)(t,this.peerRole),a=f(i.media);try{for(a.s();!(o=a.n()).done;)"audio"===(s=o.value).kind&&(this.includesAudio=!0),"video"===s.kind&&(this.includesVideo=!0),s.streams||(s.streams=[{stream:"legacy",track:s.kind}])}catch(e){a.e(e)}finally{a.f()}return u=(0,g.exportToSDP)(i),e.prev=8,e.next=11,this.pc.setRemoteDescription({type:"offer",sdp:u});case 11:return e.next=13,this.processBufferedCandidates();case 13:return e.abrupt("return",n());case 16:return e.prev=16,e.t0=e.catch(8),this._log("error","Could not create WebRTC answer",e.t0),e.abrupt("return",n({condition:"general-error"}));case 20:case"end":return e.stop()}}),e,this,[[8,16]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,t){var n,r=f(this.pc.getReceivers());try{for(r.s();!(n=r.n()).done;){var i=n.value;this.onRemoveTrack(i.track)}}catch(e){r.e(e)}finally{r.f()}s(l(m.prototype),"onSessionTerminate",this).call(this,e,t)}},{key:"onSessionInfo",value:function(e,t){var n=e.info||{infoType:""};switch(n.infoType){case v.JINGLE_INFO_RINGING:return this._log("info","Outgoing session is ringing"),this.ringing=!0,this.parent.emit("ringing",this),t();case v.JINGLE_INFO_HOLD:return this._log("info","On hold"),this.parent.emit("hold",this),t();case v.JINGLE_INFO_UNHOLD:case v.JINGLE_INFO_ACTIVE:return this._log("info","Resuming from hold"),this.parent.emit("resumed",this),t();case v.JINGLE_INFO_MUTE:return this._log("info","Muting",n),this.parent.emit("mute",this,n),t();case v.JINGLE_INFO_UNMUTE:return this._log("info","Unmuting",n),this.parent.emit("unmute",this,n),t()}return t()}},{key:"ringing",get:function(){return this._ringing},set:function(e){e!==this._ringing&&(this._ringing=e)}},{key:"streams",get:function(){return"closed"!==this.pc.signalingState?this.pc.getRemoteStreams():[]}}]),m}(m.default);t.default=_},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)},s=this&&this.__awaiter||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())}))},u=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var c,l=n(20);o(n(258),t);var f=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.peerConnection=t,r.haveConnectionMetrics=!1,r.statsArr=[],c="undefined"!=typeof window,r.session=n.session,r.initiator=n.initiator,r.conference=n.conference,r.statsInterval=1e3*(n.interval||5),r.logger=n.logger||console,["new","checking"].includes(t.iceConnectionState)&&("checking"===t.iceConnectionState&&(r.logger.warn("iceConnectionState is already in checking state so ice connect time may not be accurate"),r.handleIceStateChange()),t.addEventListener("iceconnectionstatechange",r.handleIceStateChange.bind(r))),t.addEventListener("connectionstatechange",r.handleConnectionStateChange.bind(r)),"connected"===t.connectionState&&r.pollForStats(),r}return i(t,e),t.prototype.handleIceStateChange=function(){var e=this,t=this.peerConnection.iceConnectionState;if("checking"===t&&c&&(this.iceStartTime=window.performance.now()),"connected"===t){if(this.haveConnectionMetrics)return;this.haveConnectionMetrics=!0;var n=void 0,r=void 0,i=void 0;c&&(this.iceConnectionTime=window.performance.now()-this.iceStartTime,n=window.navigator.userAgent,r=window.navigator.platform,i=window.navigator.hardwareConcurrency);var a={name:"connect",userAgent:n,platform:r,cores:i,session:this.session,conference:this.conference,connectTime:this.iceConnectionTime};return this.waitForSelectedCandidatePair().then((function(t){e.gatherSelectedCandidateInfo(t,a),e.emit("stats",a)}))}if("failed"===t)return c&&(this.iceFailedTime=window.performance.now()-this.iceStartTime),this.gatherStats().then((function(){var t={name:"failure",session:e.session,initiator:e.initiator,conference:e.conference,failTime:e.iceFailedTime,iceRW:0,numLocalHostCandidates:0,numLocalSrflxCandidates:0,numLocalRelayCandidates:0,numRemoteHostCandidates:0,numRemoteSrflxCandidates:0,numRemoteRelayCandidates:0},n=e.peerConnection.localDescription.sdp.split("\r\n").filter((function(e){return e.indexOf("a=candidate:")>-1})),r=e.peerConnection.remoteDescription.sdp.split("\r\n").filter((function(e){return e.indexOf("a=candidate:")>-1}));["Host","Srflx","Relay"].forEach((function(e){t["numLocal"+e+"Candidates"]=n.filter((function(t){return t.split(" ")[7]===e.toLowerCase()})).length,t["numRemote"+e+"Candidates"]=r.filter((function(t){return t.split(" ")[7]===e.toLowerCase()})).length})),e.emit("stats",t)}))},t.prototype.waitForSelectedCandidatePair=function(e,t){var n=this;return void 0===e&&(e=300),void 0===t&&(t=1),this.gatherStats().then((function(r){return n.getSelectedCandidatePair(r)?r:t>3?Promise.reject(new Error("Max wait attempts for connected candidate info reached")):new Promise((function(r,i){setTimeout((function(){return n.waitForSelectedCandidatePair(e,t+1).then(r,i)}),e)}))}))},t.prototype.getSelectedCandidatePair=function(e){var t=null;return e.forEach((function(e){var n=e.value;"candidate-pair"===n.type&&n.nominated&&"succeeded"===n.state&&(t=n)})),t},t.prototype.gatherSelectedCandidateInfo=function(e,t){var n=this.getSelectedCandidatePair(e);if(n){var r,i,a=n.localCandidateId,o=n.remoteCandidateId;if(e.forEach((function(e){var n=e.value;a&&"local-candidate"===n.type&&n.id===a&&(r=n,t.localCandidateType=n.candidateType),o&&"remote-candidate"===n.type&&n.id===o&&(i=n,t.remoteCandidateType=n.candidateType)})),r&&i&&(t.candidatePair=r.candidateType+";"+i.candidateType,t.candidatePairDetails={local:r,remote:i,pair:n}),r){if(t.transport=r.transport||r.protocol,r.priority){var s=parseInt(r.priority,10);t.turnType={2:"udp",1:"tcp",0:"tls"}[s>>24],t.networkType=r.networkType}t.usingIPv6=r.ipAddress&&0===r.ipAddress.indexOf("[")}}},t.prototype.handleConnectionStateChange=function(){return s(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){if("connected"===(e=this.peerConnection.connectionState))this.pollForStats();else{if("disconnected"===e)return"stable"!==this.peerConnection.signalingState?[2]:[2,this.gatherStats().then((function(e){var n=t.createStatsReport(e);n.type="disconnected",t.emit("stats",n)}))];["closed","failed"].includes(e)&&this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null)}return[2]}))}))},t.prototype.pollForStats=function(){var e=this;if(!this.pollingInterval){var t=function(){return e.gatherStats().then((function(t){if(0!==t.length){var n=e.createStatsReport(t,!0);(n.tracks.length>0||n.remoteTracks.length>0)&&e.checkBitrate(n)&&e.emit("stats",n)}else e.logger.warn("Empty stats gathered, ignoring and not emitting stats")}))};c&&(window.setTimeout(t,0),this.pollingInterval=window.setInterval(t,this.statsInterval))}},t.prototype.checkBitrate=function(e){var t;return e.remoteTracks.length&&0!==(null===(t=e.remoteTracks[0])||void 0===t?void 0:t.bitrate)?(this.statsArr=[],!0):!(this.statsArr.length>=5)&&(this.statsArr.push(e),!0)},t.prototype.polyFillStats=function(e){if(!e)return[];if(Array.isArray(e))return e;var t=[];if(this.isNativeStatsReport(e))e.forEach((function(e,n){t.push({key:n,value:e})}));else{if(!(Object.keys(e).length>0))return this.logger.warn("Unknown stats results format, returning unmodified",e),[];Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})}))}return t},t.prototype.isNativeStatsReport=function(e){return void 0!==window.RTCStatsReport&&e instanceof window.RTCStatsReport},t.prototype.gatherStats=function(){return s(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),["connecting","connected"].includes(this.peerConnection.connectionState)?[4,this.peerConnection.getStats(null).then(this.polyFillStats.bind(this))]:[3,2];case 1:return[2,t.sent()];case 2:return"closed"===this.peerConnection.connectionState?(this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null),[2,[]]):[2,[]];case 3:return[3,5];case 4:return e=t.sent(),this.logger.error("Failed to gather stats. Are you using RTCPeerConnection as your connection? {expect peerconnection.getStats}",{peerConnection:this.peerConnection,err:e}),[2,Promise.reject(e)];case 5:return[2]}}))}))},t.prototype.createStatsReport=function(e,t){var n=this;void 0===t&&(t=!0);var r={name:"getStats",session:this.session,initiator:this.initiator,conference:this.conference,tracks:[],remoteTracks:[]};if(0===e.length)return r;e.filter((function(e){return["inbound-rtp","outbound-rtp"].indexOf(e.value.type)>-1})).forEach((function(t){n.processSource({source:t.value,event:r,results:e})}));var i=e.find((function(e){return"candidate-pair"===e.value.type&&"succeeded"===e.value.state&&!0===e.value.nominated}));return i&&this.processSelectedCandidatePair({report:i.value,event:r,results:e}),t&&(this.lastResult=e),r},t.prototype.processSource=function(e){var t,n,r,i,a,o,s,u=e.source,c=e.results,l=e.event,f=new Date(u.timestamp),d=this.lastResult&&this.lastResult.find((function(e){return e.key===u.id}));(d=d&&d.value)&&(t=(t=this.lastResult&&this.lastResult.find((function(e){return e.value.localId===d.id})))&&t.value),c.forEach((function(e){e.value.localId===u.id?n=e.value:e.key===u.transportId?r=e.value:e.key===u.trackId?a=e.value:e.key===u.mediaSourceId?o=e.value:e.key===u.codecId&&(s=e.value)})),r&&(i=(i=c.find((function(e){return e.key===r.selectedCandidatePairId})))&&i.value),i&&(l.candidatePairHadActiveSource=!0);var h=u.kind||u.mediaType,v="outbound-rtp"===u.type,m={track:a&&a.trackIdentifier,kind:h,jitter:p("jitter",u,n),roundTripTime:p("roundTripTime",u,n),packetsLost:p("packetsLost",u,n)||0,packetLoss:0,bytes:parseInt(v?u.bytesSent:u.bytesReceived,10)||0};if(s&&(m.codec="".concat(s.payloadType," ").concat(s.mimeType," ").concat(s.clockRate)),d){var g=parseInt(v?d.bytesSent:d.bytesReceived,10)||0,y=f.getTime()-new Date(d.timestamp).getTime();m.bitrate=Math.floor(8*(m.bytes-g)/y)}var b=p("packetsLost",d,t);v?(m.packetsSent=u.packetsSent,m.packetLoss=m.packetsLost/(m.packetsSent||1)*100,d&&(m.intervalPacketsSent=m.packetsSent-(d.packetsSent||0),m.intervalPacketsLost=m.packetsLost-(b||0),m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsSent||1)*100),m.retransmittedBytesSent=u.retransmittedBytesSent,m.retransmittedPacketsSent=u.retransmittedPacketsSent):(m.packetsReceived=u.packetsReceived,m.packetLoss=m.packetsLost/(m.packetsReceived||1)*100,d&&(m.intervalPacketsReceived=m.packetsReceived-d.packetsReceived,m.intervalPacketsLost=m.packetsLost-b,m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsReceived||1)*100)),a&&"audio"===h&&(a.remoteSource?(m.audioLevel=a.audioLevel,m.totalAudioEnergy=a.totalAudioEnergy):(m.echoReturnLoss=a.echoReturnLoss,m.echoReturnLossEnhancement=a.echoReturnLossEnhancement)),"audio"!==h||!o||a&&a.remoteSource||(m.audioLevel=o.audioLevel,m.totalAudioEnergy=o.totalAudioEnergy),Object.keys(m).forEach((function(e){return void 0===m[e]&&delete m[e]})),v?l.tracks.push(m):l.remoteTracks.push(m)},t.prototype.processSelectedCandidatePair=function(e){var t=this,n=e.report,r=e.event,i=e.results,a=n.localCandidateId,o=n.remoteCandidateId;r.localCandidateChanged=!!this.lastActiveLocalCandidate&&a!==this.lastActiveLocalCandidate.id,r.remoteCandidateChanged=!!this.lastActiveRemoteCandidate&&o!==this.lastActiveRemoteCandidate.id,(!this.lastActiveLocalCandidate||r.localCandidateChanged||r.remoteCandidateChanged)&&i.forEach((function(e){t.checkLastActiveCandidate({localId:a,remoteId:o,report:e.value})})),this.lastActiveLocalCandidate&&(r.networkType=this.lastActiveLocalCandidate.networkType,this.lastActiveRemoteCandidate&&(r.candidatePair=this.lastActiveLocalCandidate.candidateType+";"+this.lastActiveRemoteCandidate.candidateType)),r.bytesSent=n.bytesSent,r.bytesReceived=n.bytesReceived,r.requestsReceived=n.requestsReceived,r.requestsSent=n.requestsSent,r.responsesReceived=n.responsesReceived,r.responsesSent=n.responsesSent,r.consentRequestsSent=n.consentRequestsSent,r.totalRoundTripTime=n.totalRoundTripTime},t.prototype.checkLastActiveCandidate=function(e){var t=e.localId,n=e.remoteId,r=e.report;t&&"local-candidate"===r.type&&r.id===t&&(this.lastActiveLocalCandidate=r),n&&"remote-candidate"===r.type&&r.id===n&&(this.lastActiveRemoteCandidate=r)},t}(l.EventEmitter);function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.find((function(t){return t&&(t[e]||0===t[e])}));return r&&r[e]}t.default=f},function(e,t,n){"use strict";n.r(t),n.d(t,"Axios",(function(){return i})),n.d(t,"AxiosError",(function(){return a})),n.d(t,"CanceledError",(function(){return o})),n.d(t,"isCancel",(function(){return s})),n.d(t,"CancelToken",(function(){return u})),n.d(t,"VERSION",(function(){return c})),n.d(t,"all",(function(){return l})),n.d(t,"Cancel",(function(){return f})),n.d(t,"isAxiosError",(function(){return p})),n.d(t,"spread",(function(){return d})),n.d(t,"toFormData",(function(){return h})),n.d(t,"AxiosHeaders",(function(){return v})),n.d(t,"HttpStatusCode",(function(){return m})),n.d(t,"formToJSON",(function(){return g})),n.d(t,"getAdapter",(function(){return y})),n.d(t,"mergeConfig",(function(){return b}));var r=n(19);n.d(t,"default",(function(){return r.a}));var i=r.a.Axios,a=r.a.AxiosError,o=r.a.CanceledError,s=r.a.isCancel,u=r.a.CancelToken,c=r.a.VERSION,l=r.a.all,f=r.a.Cancel,p=r.a.isAxiosError,d=r.a.spread,h=r.a.toFormData,v=r.a.AxiosHeaders,m=r.a.HttpStatusCode,g=r.a.formToJSON,y=r.a.getAdapter,b=r.a.mergeConfig},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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=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 h=n(20),v=Math.pow(2,32),m=function(e,t){return(e%t+t)%t},g=function(e){u(k,e);var t,n,c,l,p,h,g,y,b,_,S,w,x=d(k);function k(){var e;return o(this,k),(e=x.call(this)).allowResume=!0,e.lastAck=0,e.handled=0,e.unacked=[],e.inboundStarted=!1,e.outboundStarted=!1,e.id=void 0,e.jid=void 0,e.allowResume=!0,e.started=!1,e.cacheHandler=function(){},e._reset(),e}return s(k,[{key:"load",value:function(e){var t;this.id=e.id,this.allowResume=null===(t=e.allowResume)||void 0===t||t,this.handled=e.handled,this.lastAck=e.lastAck,this.unacked=e.unacked,this.emit("prebound",e.jid)}},{key:"cache",value:function(e){this.cacheHandler=e}},{key:"bind",value:(w=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.jid=t,e.next=3,this._cache();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"enable",value:(S=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{allowResumption:this.allowResume,type:"enable"});case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"resume",value:(_=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{handled:this.handled,previousSession:this.id,type:"resume"});case 1:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"enabled",value:(b=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.id,this.allowResume=t.resume||!1,this.handled=0,this.inboundStarted=!0,e.next=6,this._cache();case 6:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"resumed",value:(y=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.previousSession,this.inboundStarted=!0,e.next=4,this.process(t,!0);case 4:return e.next=6,this._cache();case 6:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"failed",value:(g=a(i.mark((function e(t){var n,a,o,s,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.process(t);case 2:n=f(this.unacked);try{for(n.s();!(a=n.n()).done;)o=r(a.value,2),s=o[0],u=o[1],this.emit("failed",{kind:s,stanza:u})}catch(e){n.e(e)}finally{n.f()}return this._reset(),e.next=7,this._cache();case 7:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"ack",value:function(){this.emit("send",{handled:this.handled,type:"ack"})}},{key:"request",value:function(){this.emit("send",{type:"request"})}},{key:"process",value:(h=a(i.mark((function e(t){var n,a,o,s,u,c,l,p,d,h,g,y,b,_=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=_.length>1&&void 0!==_[1]&&_[1],void 0!==t.handled){e.next=3;break}return e.abrupt("return");case 3:for(a=m(t.handled-this.lastAck,v),o=0;o<a&&this.unacked.length>0;o++)s=this.unacked.shift(),u=r(s,2),c=u[0],l=u[1],this.emit("acked",{kind:c,stanza:l});if(this.lastAck=t.handled,n&&(p=this.unacked,this.unacked=[],p.length)){this.emit("begin-resend"),d=f(p);try{for(d.s();!(h=d.n()).done;)g=r(h.value,2),y=g[0],b=g[1],this.emit("resend",{kind:y,stanza:b})}catch(e){d.e(e)}finally{d.f()}this.emit("end-resend")}return e.next=9,this._cache();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"track",value:(p=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="enable"===n.type,"sm"!==t||!r&&"resume"!==n.type){e.next=7;break}return r&&(this.handled=0),this.outboundStarted=!0,e.next=6,this._cache();case 6:return e.abrupt("return",!1);case 7:if(this.outboundStarted){e.next=9;break}return e.abrupt("return",!1);case 9:if("message"===t||"presence"===t||"iq"===t){e.next=11;break}return e.abrupt("return",!1);case 11:return this.unacked.push([t,n]),e.next=14,this._cache();case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"handle",value:(l=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.inboundStarted){e.next=4;break}return this.handled=m(this.handled+1,v),e.next=4,this._cache();case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"hibernate",value:(c=a(i.mark((function e(){var t,n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resumable){e.next=2;break}return e.abrupt("return",this.shutdown());case 2:t=f(this.unacked);try{for(t.s();!(n=t.n()).done;)a=r(n.value,2),o=a[0],s=a[1],this.emit("hibernated",{kind:o,stanza:s})}catch(e){t.e(e)}finally{t.f()}case 4:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"shutdown",value:(n=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.failed({type:"failed"}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_cache",value:(t=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.cacheHandler({allowResume:this.allowResume,handled:this.handled,id:this.id,jid:this.jid,lastAck:this.lastAck,unacked:this.unacked});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to cache stream state",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return t.apply(this,arguments)})},{key:"_reset",value:function(){this.id="",this.inboundStarted=!1,this.outboundStarted=!1,this.lastAck=0,this.handled=0,this.unacked=[]}},{key:"started",get:function(){return this.outboundStarted&&this.inboundStarted},set:function(e){e||(this.outboundStarted=!1,this.inboundStarted=!1)}},{key:"resumable",get:function(){return this.started&&this.allowResume}}]),k}(h.EventEmitter);t.default=g},function(e,t,n){"use strict";var r=n(16),i=n(17),a=n(14),o=n(6),s=n(7);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=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return i(this,n)}}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.SCRAM=t.DIGEST=t.OAUTH=t.PLAIN=t.EXTERNAL=t.ANONYMOUS=t.Hi=t.HMAC=t.H=t.XOR=t.createClientNonce=t.Factory=t.SimpleMech=void 0;var f=n(21),p=n(83),d=function(){function e(t){o(this,e),this.authenticated=!1,this.mutuallyAuthenticated=!1,this.name=t}return s(e,[{key:"getCacheableCredentials",value:function(){return null}},{key:"processChallenge",value:function(e){}},{key:"processSuccess",value:function(e){this.authenticated=!0}},{key:"finalize",value:function(){var e={authenticated:this.authenticated,mutuallyAuthenticated:this.mutuallyAuthenticated};return this.errorData&&(e.errorData=this.errorData),e}}]),e}();t.SimpleMech=d;var h=function(){function e(){o(this,e),this.mechanisms=[]}return s(e,[{key:"register",value:function(e,t,n){this.mechanisms.push({constructor:t,name:e.toUpperCase(),priority:n}),this.mechanisms.sort((function(e,t){return t.priority-e.priority}))}},{key:"disable",value:function(e){var t=e.toUpperCase();this.mechanisms=this.mechanisms.filter((function(e){return e.name!==t}))}},{key:"createMechanism",value:function(e){var t,n=e.map((function(e){return e.toUpperCase()})),r=c(this.mechanisms);try{for(r.s();!(t=r.n()).done;){var i,a=t.value,o=c(n);try{for(o.s();!(i=o.n()).done;){if(i.value===a.name)return new a.constructor(a.name)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return null}}]),e}();function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;return(0,f.randomBytes)(e).toString("hex")}function m(e,t){for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return f.Buffer.from(n)}function g(e,t){return(0,f.createHash)(t).update(e).digest()}function y(e,t,n){return(0,f.createHmac)(n,e).update(t).digest()}function b(e,t,n,r){for(var i=y(e,f.Buffer.concat([t,f.Buffer.from("00000001","hex")]),r),a=i,o=0;o<n-1;o++)a=m(a,i=y(e,i,r));return a}function _(e){for(var t={},n=e.toString().split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;r<i;r++){var a=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);a&&(t[a[1]]=a[2])}return t}function S(e){var t,n=[],r=c(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;","===i?n.push("=2C"):"="===i?n.push("=3D"):n.push(i)}}catch(e){r.e(e)}finally{r.f()}return n.join("")}t.Factory=h,t.createClientNonce=v,t.XOR=m,t.H=g,t.HMAC=y,t.Hi=b;var w=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["trace"],required:[]}}},{key:"createResponse",value:function(e){return f.Buffer.from(e.trace||"")}}]),n}(d);t.ANONYMOUS=w;var x=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:[]}}},{key:"createResponse",value:function(e){return f.Buffer.from(e.authzid||"")}}]),n}(d);t.EXTERNAL=x;var k=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["username","password"]}}},{key:"createResponse",value:function(e){return f.Buffer.from((e.authzid||"")+"\0"+e.username+"\0"+(e.password||e.token))}}]),n}(d);t.PLAIN=k;var O=function(e){r(n,e);var t=u(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).failed=!1,r.name=e,r}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["token"]}}},{key:"createResponse",value:function(e){if(this.failed)return f.Buffer.from("");var t="n,".concat(S((0,p.saslprep)(e.authzid)),","),n="auth=Bearer ".concat(e.token,"");return f.Buffer.from(t+""+n+"","utf8")}},{key:"processChallenge",value:function(e){this.failed=!0,this.errorData=JSON.parse(e.toString("utf8"))}}]),n}(d);t.OAUTH=O;var T=function(e){r(n,e);var t=u(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).providesMutualAuthentication=!1,r.state="INITIAL",r.name=e,r}return s(n,[{key:"processChallenge",value:function(e){this.state="CHALLENGE";var t=_(e);this.authenticated=!!t.rspauth,this.realm=t.realm,this.nonce=t.nonce,this.charset=t.charset}},{key:"getExpectedCredentials",value:function(){return{optional:["authzid","clientNonce","realm"],required:["host","password","serviceName","serviceType","username"]}}},{key:"createResponse",value:function(e){if("INITIAL"===this.state||this.authenticated)return null;var t=e.serviceType+"/"+e.host;e.serviceName&&e.host!==e.serviceName&&(t+="/"+e.serviceName);var n=e.realm||this.realm||"",r=e.clientNonce||v(16),i="00000001",a="";a+='username="'+e.username+'"',n&&(a+=',realm="'+n+'"'),a+=',nonce="'+this.nonce+'"',a+=',cnonce="'+r+'"',a+=",nc="+i,a+=",qop=auth",a+=',digest-uri="'+t+'"';var o=(0,f.createHash)("md5").update(e.username).update(":").update(n).update(":").update(e.password).digest(),s=(0,f.createHash)("md5").update(o).update(":").update(this.nonce).update(":").update(r);e.authzid&&s.update(":").update(e.authzid);var u=s.digest("hex"),c=(0,f.createHash)("md5").update("AUTHENTICATE:").update(t).digest("hex");return a+=",response="+(0,f.createHash)("md5").update(u).update(":").update(this.nonce).update(":").update(i).update(":").update(r).update(":").update("auth").update(":").update(c).digest("hex"),"utf-8"===this.charset&&(a+=",charset=utf-8"),e.authzid&&(a+=',authzid="'+e.authzid+'"'),f.Buffer.from(a)}}]),n}(d);t.DIGEST=T;var A=function(){function e(t){o(this,e),this.providesMutualAuthentication=!0,this.name=t,this.state="INITIAL",this.useChannelBinding=this.name.toLowerCase().endsWith("-plus"),this.algorithm=this.name.toLowerCase().split("scram-")[1].split("-plus")[0]}return s(e,[{key:"getExpectedCredentials",value:function(){var e=["username","password"];return this.useChannelBinding&&e.push("tlsUnique"),{optional:["authzid","clientNonce"],required:e}}},{key:"getCacheableCredentials",value:function(){return this.cache}},{key:"createResponse",value:function(e){return"INITIAL"===this.state?this.initialResponse(e):this.challengeResponse(e)}},{key:"processChallenge",value:function(e){var t=_(e);this.salt=f.Buffer.from(t.s||"","base64"),this.iterationCount=parseInt(t.i,10),this.nonce=t.r,this.verifier=t.v,this.error=t.e,this.challenge=e}},{key:"processSuccess",value:function(e){this.processChallenge(e)}},{key:"finalize",value:function(){return this.verifier?this.serverSignature.toString("base64")!==this.verifier?{authenticated:!1,error:"Mutual authentication failed",mutuallyAuthenticated:!1}:{authenticated:!0,mutuallyAuthenticated:!0}:{authenticated:!1,error:this.error,mutuallyAuthenticated:!1}}},{key:"initialResponse",value:function(e){var t=S((0,p.saslprep)(e.authzid)),n=S((0,p.saslprep)(e.username));this.clientNonce=e.clientNonce||v();var r="n";e.tlsUnique&&(r=this.useChannelBinding?"p=tls-unique":"y"),this.gs2Header=f.Buffer.from(t?"".concat(r,",a=").concat(t,","):"".concat(r,",,")),this.clientFirstMessageBare=f.Buffer.from("n=".concat(n,",r=").concat(this.clientNonce));var i=f.Buffer.concat([this.gs2Header,this.clientFirstMessageBare]);return this.state="CHALLENGE",i}},{key:"challengeResponse",value:function(e){var t,n,r,i=f.Buffer.from("Client Key"),a=f.Buffer.from("Server Key"),o=f.Buffer.concat([this.gs2Header,e.tlsUnique||f.Buffer.from("")]).toString("base64"),s=f.Buffer.from("c=".concat(o,",r=").concat(this.nonce)),u=e.salt&&0===f.Buffer.compare(e.salt,this.salt);u&&e.clientKey&&e.serverKey?(n=f.Buffer.from(e.clientKey),r=f.Buffer.from(e.serverKey)):u&&e.saltedPassword?(n=y(t=f.Buffer.from(e.saltedPassword),i,this.algorithm),r=y(t,a,this.algorithm)):(n=y(t=b(f.Buffer.from((0,p.saslprep)(e.password)),this.salt,this.iterationCount,this.algorithm),i,this.algorithm),r=y(t,a,this.algorithm));var c=g(n,this.algorithm),l=f.Buffer.from(","),d=f.Buffer.concat([this.clientFirstMessageBare,l,this.challenge,l,s]),h=m(n,y(c,d,this.algorithm)).toString("base64");this.serverSignature=y(r,d,this.algorithm);var v=f.Buffer.concat([s,f.Buffer.from(",p=".concat(h))]);return this.state="FINAL",this.cache={clientKey:n,salt:this.salt,saltedPassword:t,serverKey:r},v}}]),e}();t.SCRAM=A},function(e,t,n){"use strict";var r=n(12),i=n(4),a=n(3),o=n(9);Object.defineProperty(t,"__esModule",{value:!0});var s=n(2);t.default=function(e){e.getAccountInfo=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({account:{},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.account);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.updateAccount=function(t,n){return e.sendIQ({account:n,to:t,type:"set"})},e.deleteAccount=function(t){return e.sendIQ({account:{remove:!0},to:t,type:"set"})},e.getPrivateData=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({privateStorage:i({},n,{}),type:"get"});case 2:return r=t.sent,t.abrupt("return",r.privateStorage[n]);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.setPrivateData=function(){var t=o(a.mark((function t(n,r){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({privateStorage:i({},n,r),type:"set"}));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getVCard=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({to:n,type:"get",vcard:{format:s.NS_VCARD_TEMP}});case 2:return r=t.sent,t.abrupt("return",r.vcard);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.publishVCard=function(){var t=o(a.mark((function t(n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({type:"set",vcard:n});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.enableNotifications=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.sendIQ({push:{action:"enable",form:{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/pubsub#publish-options"}].concat(r(i)),type:"submit"},jid:t,node:n},type:"set"})},e.disableNotifications=function(t,n){return e.sendIQ({push:{action:"disable",jid:t,node:n},type:"set"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.default=function(e){e.disco.addFeature((0,r.NS_PEP_NOTIFY)(r.NS_AVATAR_METADATA)),e.on("pubsub:published",(function(t){if(t.pubsub.items.node===r.NS_AVATAR_METADATA){var n=t.pubsub.items.published[0].content;e.emit("avatar",{avatars:n.versions||[],jid:t.from,source:"pubsub"})}})),e.on("presence",(function(t){t.vcardAvatar&&"string"==typeof t.vcardAvatar&&e.emit("avatar",{avatars:[{id:t.vcardAvatar}],jid:t.from,source:"vcard"})})),e.publishAvatar=function(t,n){return e.publish("",r.NS_AVATAR_DATA,{data:n,itemType:r.NS_AVATAR_DATA},t)},e.useAvatars=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.publish("",r.NS_AVATAR_METADATA,{itemType:r.NS_AVATAR_METADATA,pointers:n,versions:t},"current")},e.getAvatar=function(t,n){return e.getItem(t,r.NS_AVATAR_DATA,n)}}},function(e,t,n){"use strict";var r=n(3),i=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("bind",300,function(){var t=i(r.mark((function t(n,i){var a,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sendIQ({bind:{resource:e.config.resource},type:"set"});case 3:return a=t.sent,e.features.negotiated.bind=!0,e.emit("session:prebind",a.bind.jid),o=!n.legacySession||n.legacySession&&n.legacySession.optional,!e.sessionStarted&&o&&e.emit("session:started",e.jid),t.abrupt("return",i());case 11:return t.prev=11,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",i("disconnect","JID binding failed"));case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,n){return t.apply(this,arguments)}}()),e.registerFeature("legacySession",1e3,function(){var t=i(r.mark((function t(n,i){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.sessionStarted||n.legacySession&&n.legacySession.optional)){t.next=3;break}return e.features.negotiated.session=!0,t.abrupt("return",i());case 3:return t.prev=3,t.next=6,e.sendIQ({legacySession:!0,type:"set"});case 6:return e.features.negotiated.session=!0,e.sessionStarted||(e.sessionStarted=!0,e.emit("session:started",e.jid)),t.abrupt("return",i());case 11:return t.prev=11,t.t0=t.catch(3),t.abrupt("return",i("disconnect","Session requeset failed"));case 14:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,n){return t.apply(this,arguments)}}()),e.on("session:started",(function(){e.sessionStarted=!0})),e.on("session:prebind",(function(t){e.jid=t,e.emit("session:bound",e.jid)})),e.on("--reset-stream-features",(function(){e.sessionStarted=!1,e.features.negotiated.bind=!1,e.features.negotiated.session=!1}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.default=function(e){e.disco.addFeature(r.NS_ADHOC_COMMANDS),e.disco.addItem({name:"Ad-Hoc Commands",node:r.NS_ADHOC_COMMANDS}),e.getCommands=function(t){return e.getDiscoItems(t,r.NS_ADHOC_COMMANDS)}}},function(e,t,n){"use strict";var r=n(3),i=n(9);Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),o=n(27);function s(e){return u.apply(this,arguments)}function u(){return(u=i(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.sm.started){e.next=2;break}return e.abrupt("return",new Promise((function(e){t.once("stream:management:ack",(function(){return e()})),t.sm.request()})));case 2:return e.prev=2,e.next=5,t.ping();case 5:e.next=14;break;case 7:if(e.prev=7,e.t0=e.catch(2),!e.t0.error||"timeout"===e.t0.error.condition){e.next=13;break}return e.abrupt("return");case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,7]])})))).apply(this,arguments)}function c(e,t){e.features.negotiated.clientStateIndication&&e.send("csi",{type:t})}t.default=function(e){e.disco.addFeature(a.NS_PING),e.on("iq:get:ping",(function(t){e.sendIQResult(t)})),e.on("--reset-stream-features",(function(){e._stopKeepAliveInterval(),e.features.negotiated.streamManagement=!1,e.features.negotiated.clientStateIndication=!1})),e.markActive=function(){return c(e,"active")},e.markInactive=function(){return c(e,"inactive")},e.ping=function(){var t=i(r.mark((function t(n){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({ping:!0,to:n,type:"get"});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.enableKeepAlive=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e._keepAliveOptions=t;var n=t.interval||300,a=t.timeout||e.config.timeout||15;function u(){return c.apply(this,arguments)}function c(){return(c=i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sessionStarted){t.next=10;break}return t.prev=1,t.next=4,(0,o.timeoutPromise)(s(e),1e3*a);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(1),e.emit("stream:error",{condition:"connection-timeout",text:"Server did not respond in "+a+" seconds"}),e.transport&&(e.transport.hasStream=!1,e.transport.disconnect(!1));case 10:case"end":return t.stop()}}),t,null,[[1,6]])})))).apply(this,arguments)}clearInterval(e._keepAliveInterval),e._keepAliveInterval=setInterval(u,1e3*n)},e._stopKeepAliveInterval=function(){e._keepAliveInterval&&(clearInterval(e._keepAliveInterval),delete e._keepAliveInterval)},e.disableKeepAlive=function(){delete e._keepAliveOptions,e._stopKeepAliveInterval()},e.on("stream:management:resumed",(function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)})),e.on("stream:start",(function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)}));var t=function(){var t=i(r.mark((function t(n,a){var o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.config.useStreamManagement){t.next=2;break}return t.abrupt("return",a());case 2:if(o=function(){var t=i(r.mark((function t(n){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=n.type,t.next="enabled"===t.t0?3:"resumed"===t.t0?8:"failed"===t.t0?17:22;break;case 3:return t.next=5,e.sm.enabled(n);case 5:return e.features.negotiated.streamManagement=!0,e.off("sm",o),t.abrupt("return",a());case 8:return t.next=10,e.sm.resumed(n);case 10:return e.features.negotiated.streamManagement=!0,e.features.negotiated.bind=!0,e.sessionStarted=!0,e.sessionStarting=!1,e.off("sm",o),e.emit("stream:management:resumed",n),t.abrupt("return",a("break"));case 17:return t.next=19,e.sm.failed(n);case 19:e.off("sm",o),e.emit("session:end"),a();case 22:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.on("sm",o),e.sm.id){t.next=14;break}if(!e.features.negotiated.bind){t.next=10;break}return t.next=8,e.sm.enable();case 8:t.next=12;break;case 10:e.off("sm",o),a();case 12:t.next=21;break;case 14:if(!e.sm.id||!e.sm.allowResume){t.next=19;break}return t.next=17,e.sm.resume();case 17:t.next=21;break;case 19:e.off("sm",o),a();case 21:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();e.registerFeature("streamManagement",200,t),e.registerFeature("streamManagement",500,t),e.registerFeature("clientStateIndication",400,(function(t,n){e.features.negotiated.clientStateIndication=!0,n()}))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(15),c=(0,u.__importDefault)(n(264)),l=(0,u.__importStar)(n(22)),f=n(2);t.default=function(e){e.disco=new c.default,e.disco.addFeature(f.NS_DISCO_INFO),e.disco.addFeature(f.NS_DISCO_ITEMS),e.disco.addIdentity({category:"client",type:"web"}),e.registerFeature("caps",100,(function(t,n){var r=l.getDomain(e.jid)||e.config.server;e.emit("disco:caps",{caps:t.legacyCapabilities||[],jid:r}),e.features.negotiated.caps=!0,n()})),e.getDiscoInfo=function(){var t=a(r.mark((function t(n,i){var a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({disco:{node:i,type:"info"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",s({extensions:[],features:[],identities:[]},a.disco));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getDiscoItems=function(){var t=a(r.mark((function t(n,i){var a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({disco:{node:i,type:"items"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",s({items:[]},a.disco));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.updateCaps=function(){var t=e.config.capsNode||"https://stanzajs.org";return e.disco.updateCaps(t)},e.getCurrentCaps=function(){var t=e.disco.getCaps();if(t){var n="".concat(t[0].node,"#").concat(t[0].value);return{info:e.disco.getNodeInfo(n),legacyCapabilities:t}}},e.on("presence",(function(t){t.legacyCapabilities&&e.emit("disco:caps",{caps:t.legacyCapabilities,jid:t.from})})),e.on("iq:get:disco",(function(t){var n=t.disco,r=n.type,i=n.node;"info"===r&&e.sendIQResult(t,{disco:s(s({},e.disco.getNodeInfo(i||"")),{},{node:i,type:"info"})}),"items"===r&&e.sendIQResult(t,{disco:{items:e.disco.items.get(i||"")||[],type:"items"}})}))}},function(e,t,n){"use strict";var r=n(3),i=n(9);function a(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 o(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 o(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,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(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 s=n(15),u=n(18),c=n(2),l=(0,s.__importStar)(n(21));t.default=function(e){e.disco.addFeature("jid\\20escaping"),e.disco.addFeature(c.NS_DELAY),e.disco.addFeature(c.NS_EME_0),e.disco.addFeature(c.NS_FORWARD_0),e.disco.addFeature(c.NS_HASHES_2),e.disco.addFeature(c.NS_HASHES_1),e.disco.addFeature(c.NS_IDLE_1),e.disco.addFeature(c.NS_JSON_0),e.disco.addFeature(c.NS_OOB),e.disco.addFeature(c.NS_PSA),e.disco.addFeature(c.NS_REFERENCE_0),e.disco.addFeature(c.NS_SHIM),e.disco.addFeature(c.NS_DATAFORM),e.disco.addFeature(c.NS_DATAFORM_MEDIA),e.disco.addFeature(c.NS_DATAFORM_VALIDATION),e.disco.addFeature(c.NS_DATAFORM_LAYOUT);var t,n=a(l.getHashes());try{for(n.s();!(t=n.n()).done;){var o=t.value;e.disco.addFeature((0,c.NS_HASH_NAME)(o))}}catch(e){n.e(e)}finally{n.f()}e.disco.addFeature(c.NS_TIME),e.disco.addFeature(c.NS_VERSION),e.on("iq:get:softwareVersion",(function(t){return e.sendIQResult(t,{softwareVersion:e.config.softwareVersion||{name:"stanzajs.org",version:u.VERSION}})})),e.on("iq:get:time",(function(t){var n=new Date;e.sendIQResult(t,{time:{tzo:n.getTimezoneOffset(),utc:n}})})),e.getSoftwareVersion=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({softwareVersion:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.softwareVersion);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getTime=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({time:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.time);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getLastActivity=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({lastActivity:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.lastActivity);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(3),i=n(9);function a(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 o(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 o(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,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(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.default=function(e){e.features={handlers:Object.create(null),negotiated:Object.create(null),order:[]},e.registerFeature=function(t,n,r){this.features.order.push({name:t,priority:n}),this.features.order.sort((function(e,t){return e.priority-t.priority})),this.features.handlers[t]=r.bind(e)},e.on("features",function(){var t=i(r.mark((function t(n){var i,o,s,u,c,l,f,p,d,h,v,m,g;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:f=function(e){return new Promise((function(t){o[e](n,(function(e,n){t(e?{command:e,message:n}:null)}))}))},i=e.features.negotiated,o=e.features.handlers,s=[],u=a(e.features.order);try{for(u.s();!(c=u.n()).done;)l=c.value.name,n[l]&&o[l]&&!i[l]&&s.push(l)}catch(e){u.e(e)}finally{u.f()}p=0,d=s;case 7:if(!(p<d.length)){t.next=33;break}if(h=d[p],!i[h]){t.next=11;break}return t.abrupt("continue",30);case 11:return v="",m="",t.prev=13,t.next=16,f(h);case 16:(g=t.sent)&&(v=g.command,m=g.message||""),t.next=25;break;case 20:t.prev=20,t.t0=t.catch(13),v="disconnect",m=t.t0.message,console.error(t.t0);case 25:if(v){t.next=27;break}return t.abrupt("continue",30);case 27:return"restart"===v&&e.transport&&e.transport.restart(),"disconnect"===v&&(e.emit("stream:error",{condition:"policy-violation",text:"Failed to negotiate stream features: "+m}),e.disconnect()),t.abrupt("return");case 30:p++,t.next=7;break;case 33:case"end":return t.stop()}}),t,null,[[13,20]])})));return function(e){return t.apply(this,arguments)}}())}},function(e,t,n){"use strict";var r=n(3),i=n(12),a=n(9);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=n(2);t.default=function(e){e.discoverBindings=function(){var t=a(r.mark((function t(n){var a,s,c,l;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new Set,s=new Set,c=e.resolver.getHostMeta(n).then((function(e){var t,n,r=o(null!==(t=e.links)&&void 0!==t?t:[]);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.href&&i.rel===u.NS_ALT_CONNECTIONS_WEBSOCKET&&s.add(i.href),i.href&&i.rel===u.NS_ALT_CONNECTIONS_XBOSH&&a.add(i.href)}}catch(e){r.e(e)}finally{r.f()}})).catch((function(e){return console.error(e)})),l=e.config.allowAlternateDNSDiscovery?e.resolver.resolveTXT("_xmppconnect.".concat(n)).then((function(e){var t,n=o(e);try{for(n.s();!(t=n.n()).done;){var r,i=o(t.value);try{for(i.s();!(r=i.n()).done;){var u=r.value;if(u.startsWith("_xmpp-client-websocket=")){var c=u.substring(u.indexOf("=")+1);c&&s.add(c)}if(u.startsWith("_xmpp-client-xbosh=")){var l=u.substring(u.indexOf("=")+1);l&&a.add(l)}}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}})).catch((function(e){return console.error(e)})):Promise.resolve(),t.next=6,Promise.all([c,l]).catch((function(e){return console.error(e)}));case 6:return t.abrupt("return",{bosh:i(a).filter((function(e){return e.startsWith("https://")})),websocket:i(s).filter((function(e){return e.startsWith("wss://")}))});case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4);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}function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var l=n(15),f=n(21),p=(0,l.__importStar)(n(61)),d=n(2);t.default=function(e){var t=!!f.RTCPeerConnection,n={advertiseAudio:t,advertiseFileTransfer:t,advertiseVideo:t,bundlePolicy:"balanced",hasRTCPeerConnection:t,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require",trickleIce:!0},a=e.config.jingle,s=c(c({},n),a),u=e.jingle=new p.SessionManager(s),l=[d.NS_JINGLE_1];s.hasRTCPeerConnection&&(l.push(d.NS_JINGLE_ICE_0,d.NS_JINGLE_ICE_UDP_1,d.NS_JINGLE_DTLS_SCTP_1,d.NS_JINGLE_DTLS_0,"urn:ietf:rfc:5888"),!1===s.trickleIce&&l.push("urn:ietf:rfc:3264"),(s.advertiseAudio||s.advertiseVideo)&&l.push(d.NS_JINGLE_RTP_1,d.NS_JINGLE_RTP_RTCP_FB_0,d.NS_JINGLE_RTP_HDREXT_0,"urn:ietf:rfc:5576"),s.advertiseAudio&&l.push(d.NS_JINGLE_RTP_AUDIO),s.advertiseVideo&&l.push(d.NS_JINGLE_RTP_VIDEO),s.advertiseFileTransfer&&l.push(d.NS_JINGLE_FILE_TRANSFER_4,d.NS_JINGLE_FILE_TRANSFER_5));for(var h=0,v=l;h<v.length;h++){var m=v[h];e.disco.addFeature(m)}for(var g=function(){var t=b[y];u.on(t,(function(n,r){e.emit("jingle:"+t,n,r)}))},y=0,b=["outgoing","incoming","accepted","terminated","ringing","mute","unmute","hold","resumed"];y<b.length;y++)g();u.on("createdSession",(function(t){e.emit("jingle:created",t)})),u.on("send",function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,"set"!==n.type){t.next=8;break}return t.next=4,e.sendIQ(n);case 4:(i=t.sent).jingle||(i.jingle={}),i.jingle.sid=n.jingle.sid,u.process(i);case 8:"result"===n.type&&e.sendIQResult({type:"set",id:n.id,from:n.to},n),"error"===n.type&&e.sendIQError({type:"set",id:n.id,from:n.to},n),t.next=17;break;case 12:t.prev=12,t.t0=t.catch(0),t.t0.jingle||(t.t0.jingle=n.jingle),t.t0.jingle.sid=n.jingle.sid,u.process(t.t0);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}()),e.on("session:bound",(function(e){u.selfID=e})),e.on("iq:set:jingle",(function(e){u.process(e)})),e.on("unavailable",(function(e){u.endPeerSessions(e.from,void 0,!0)})),e.getServices=function(){var t=i(r.mark((function t(n,i,a){var o,s;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({externalServices:{type:i,version:a},to:n,type:"get"});case 2:return o=t.sent,(s=o.externalServices).services=s.services||[],t.abrupt("return",s);case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getServiceCredentials=function(){var t=i(r.mark((function t(n,i,a,o,s){var u;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({externalServiceCredentials:{host:i,port:o,type:a,version:s},to:n,type:"get"});case 2:return u=t.sent,t.abrupt("return",u.externalServiceCredentials);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r,i,a){return t.apply(this,arguments)}}(),e.discoverICEServers=i(r.mark((function t(){var n,i,a,s,u,c,l,f=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.length>0&&void 0!==f[0]?f[0]:{},t.prev=1,t.next=4,e.getServices(e.config.server,void 0,n.version);case 4:i=t.sent,a=i.services||[],s=[],u=o(a);try{for(u.s();!(c=u.n()).done;)l=c.value,e.jingle.addICEServer(l)}catch(e){u.e(e)}finally{u.f()}return t.abrupt("return",s);case 12:return t.prev=12,t.t0=t.catch(1),t.abrupt("return",[]);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})))}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(15),c=n(110),l=(0,u.__importStar)(n(22)),f=n(2);t.default=function(e){e.getHistorySearchForm=function(){var t=a(i.mark((function t(n){var r,a,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},t.next=3,e.sendIQ({archive:{type:"query",version:r.version},to:n,type:"get"});case 3:return a=t.sent,t.abrupt("return",a.archive.form);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.searchHistory=function(){var t=a(i.mark((function t(n){var r,a,o,u,p,d,h,v,m,g,y=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=y.length>1&&void 0!==y[1]?y[1]:{},a=e.nextId(),o="","string"==typeof n?o=n:(o=n.to||"",r=n),r.queryId=a,(u=r.form||{}).type="submit",p=u.fields||[],d=[{name:"FORM_TYPE",type:"hidden",value:f.NS_MAM_2}],r.with&&d.push({name:"with",type:"text-single",value:r.with}),r.start&&d.push({name:"start",type:"text-single",value:r.start.toISOString()}),r.end&&d.push({name:"end",type:"text-single",value:r.end.toISOString()}),u.fields=(0,c.mergeFields)(d,p),r.form=u,h=l.allowedResponders(e.jid,o),v=[],m=function(e){h.has(e.from)&&e.archive&&e.archive.queryId===a&&v.push(e.archive)},e.on("mam:item",m),t.prev=18,t.next=21,e.sendIQ({archive:r,id:a,to:o,type:"set"});case 21:return g=t.sent,t.abrupt("return",s(s({},g.archive),{},{results:v}));case 23:return t.prev=23,e.off("mam:item",m),t.finish(23);case 26:case"end":return t.stop()}}),t,null,[[18,,23,26]])})));return function(e){return t.apply(this,arguments)}}(),e.getHistoryPreferences=a(i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({archive:{type:"preferences"},type:"get"});case 2:return n=t.sent,t.abrupt("return",n.archive);case 4:case"end":return t.stop()}}),t)}))),e.setHistoryPreferences=function(t){return e.sendIQ({archive:s({type:"preferences"},t),type:"set"})},e.on("message",(function(t){t.archive&&e.emit("mam:item",t)}))}},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}),t.mergeFields=void 0,t.mergeFields=function(e,t){var n,r=[],i=new Map,s=o(t);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.name&&i.set(u.name,u)}}catch(e){s.e(e)}finally{s.f()}var c,l=new Set,f=o(e);try{for(f.s();!(c=f.n()).done;){var p=c.value;p.name&&i.has(p.name)?(r.push(a(a({},p),i.get(p.name))),l.add(p.name)):r.push(a({},p))}}catch(e){f.e(e)}finally{f.f()}var d,h=o(t);try{for(h.s();!(d=h.n()).done;){var v=d.value;(!v.name||v.name&&!l.has(v.name))&&r.push(a({},v))}}catch(e){h.e(e)}finally{h.f()}return r}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22)),c=n(2),l=new Set(["chat","groupchat","headline","normal"]),f=new Set(["chat","groupchat","normal"]),p=new Map([["markable",0],["received",1],["displayed",2],["acknowledged",3]]),d=function(e,t){var n;return e.marker&&(p.get(e.marker.type)<p.get(t)||"markable"===(null===(n=e.marker)||void 0===n?void 0:n.type))};function h(e,t){return v.apply(this,arguments)}function v(){return(v=a(r.mark((function e(t,n){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.sendIQ({carbons:{action:n},type:"set"});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(e){e.disco.addFeature(c.NS_ATTENTION_0),e.disco.addFeature(c.NS_CHAT_MARKERS_0),e.disco.addFeature(c.NS_CHAT_STATES),e.disco.addFeature(c.NS_CORRECTION_0),e.disco.addFeature(c.NS_RECEIPTS),e.disco.addFeature(c.NS_RTT_0),e.enableCarbons=function(){return h(e,"enable")},e.disableCarbons=function(){return h(e,"disable")},e.markReceived=function(t){return e.sendMarker(t,"received")},e.markDisplayed=function(t){return e.sendMarker(t,"displayed")},e.markAcknowledged=function(t){return e.sendMarker(t,"acknowledged")},e.getAttention=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendMessage(s(s({},n),{},{requestingAttention:!0,to:t,type:"headline"}))},e.sendMarker=function(t,n,r){if(d(t,n)||r){var i=!1!==e.config.groupchatMarkersUseStanzaID,a=t.id;if("groupchat"===t.type&&t.stanzaIds&&i){var o=t.stanzaIds.find((function(e){return u.equalBare(e.by,t.from)}));o&&(a=o.id)}e.sendMessage({marker:{id:a,type:n},to:"groupchat"===t.type?u.toBare(t.from):t.from,type:t.type})}},e.on("message",(function(t){if(t.carbon&&u.equalBare(t.from,e.jid)){var n=t.carbon.forward.message;n.delay||(n.delay=t.carbon.forward.delay||{timestamp:new Date(Date.now())}),function(e){return!!e.carbon&&"received"===e.carbon.type}(t)&&(e.emit("carbon:received",t),e.emit("message",n)),function(e){return!!e.carbon&&"sent"===e.carbon.type}(t)&&(e.emit("carbon:sent",t),e.emit("message:sent",n,!0))}(function(e){return!!e.forms&&e.forms.length>0})(t)&&e.emit("dataform",t),t.requestingAttention&&e.emit("attention",t),function(e){return!!e.rtt}(t)&&e.emit("rtt",t),function(e){return!!e.replace}(t)&&e.emit("replace",t),function(e){return!!e.chatState}(t)&&f.has(t.type||"normal")&&e.emit("chat:state",t);var r=!1!==e.config.sendReceipts,i=!1!==e.config.sendMUCReceipts,a=!1!==e.config.chatMarkers,o=!1!==e.config.groupchatMarkersUseStanzaID,s=function(e){var t;return!!e.receipt&&"request"===e.receipt.type&&l.has(null!==(t=e.type)&&void 0!==t?t:"normal")}(t),c=d(t,"received"),p=s&&r&&("groupchat"!==t.type||i);if(p||a&&c){var h="groupchat"===t.type?u.toBare(t.from):t.from,v=t.id;if("groupchat"===t.type&&t.stanzaIds&&o){var m=t.stanzaIds.find((function(e){return u.equalBare(e.by,t.from)}));m&&(v=m.id)}e.sendMessage({receipt:p?{id:t.id,type:"received"}:void 0,marker:a&&c?{id:v,type:"received"}:void 0,to:h,type:t.type})}t.receipt&&"received"===t.receipt.type&&e.emit("receipt",t),t.marker&&"markable"!==t.marker.type&&e.emit("marker:".concat(t.marker.type),t)}))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9),o=n(13);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){i(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});var f=n(15),p=n(18),d=(0,f.__importStar)(n(22)),h=n(2),v=n(27);t.default=function(e){e.disco.addFeature(h.NS_MUC),e.disco.addFeature(h.NS_MUC_DIRECT_INVITE),e.disco.addFeature(h.NS_HATS_0),e.joinedRooms=new Map,e.joiningRooms=new Map,e.leavingRooms=new Map,e.on("session:started",(function(){var t=e.joiningRooms;e.joiningRooms=new Map;var n,r=c(t);try{for(r.s();!(n=r.n()).done;){var i=o(n.value,2),a=i[0],s=i[1];e.joinRoom(a,s)}}catch(e){r.e(e)}finally{r.f()}var u=e.joinedRooms;e.joinedRooms=new Map;var l,f=c(u);try{for(f.s();!(l=f.n()).done;){var p=o(l.value,2),d=p[0],h=p[1];e.joinRoom(d,h)}}catch(e){f.e(e)}finally{f.f()}})),e.on("message",(function(t){if("groupchat"!==t.type||!t.hasSubject||t.body){if(t.muc)if("direct-invite"===t.muc.type||!t.muc.invite&&t.legacyMUC){var n="direct-invite"===t.muc.type?t.muc:t.legacyMUC;e.emit("muc:invite",{from:t.from,password:n.password,reason:n.reason,room:n.jid,thread:n.thread,type:"direct"})}else t.muc.invite?e.emit("muc:invite",{from:t.muc.invite[0].from,password:t.muc.password,reason:t.muc.invite[0].reason,room:t.from,thread:t.muc.invite[0].thread,type:"mediated"}):t.muc.decline?e.emit("muc:declined",{from:t.muc.decline.from,reason:t.muc.decline.reason,room:t.from}):e.emit("muc:other",t)}else e.emit("muc:topic",{from:t.from,room:d.toBare(t.from),topic:t.subject||""})})),e.on("presence",(function(t){var n=d.toBare(t.from);if(e.joiningRooms.has(n)&&"error"===t.type)return e.joiningRooms.delete(n),e.emit("muc:failed",t),void e.emit("muc:error",t);if(function(e){return!!e.muc}(t)){var r=t.muc.statusCodes&&t.muc.statusCodes.indexOf(p.MUCStatusCode.SelfPresence)>=0,i=t.muc.statusCodes&&t.muc.statusCodes.indexOf(p.MUCStatusCode.NickChanged)>=0;if("error"!==t.type){if("unavailable"===t.type)return e.emit("muc:unavailable",t),r&&(i?e.joinedRooms.set(n,t.muc.nick):(e.emit("muc:leave",t),e.joinedRooms.delete(n),e.leavingRooms.delete(n))),void(t.muc.destroy&&e.emit("muc:destroyed",{newRoom:t.muc.destroy.jid,password:t.muc.destroy.password,reason:t.muc.destroy.reason,room:n}));e.emit("muc:available",t);var a=e.joiningRooms.has(n)||!e.joinedRooms.has(n);r&&(e.joinedRooms.set(n,d.getResource(t.from)),a&&(e.joiningRooms.delete(n),e.emit("muc:join",t)))}else e.emit("muc:error",t)}})),e.joinRoom=function(){var t=a(r.mark((function t(n,i){var a,o=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.length>2&&void 0!==o[2]?o[2]:{},n=d.toBare(n),e.joiningRooms.set(n,i||""),i){t.next=14;break}return t.prev=4,t.next=7,e.getReservedNick(n);case 7:i=t.sent,e.joiningRooms.set(n,i),t.next=14;break;case 11:throw t.prev=11,t.t0=t.catch(4),new Error("Room nick required");case 14:return t.abrupt("return",new Promise((function(t,r){function o(r){d.equalBare(r.from,n)&&(e.off("muc:join",o),e.off("muc:failed",s),t(r))}function s(t){d.equalBare(t.from,n)&&(e.off("muc:join",o),e.off("muc:failed",s),r(t))}e.on("muc:join",o),e.on("muc:failed",s),e.sendPresence(u(u({},a),{},{muc:u(u({},a.muc),{},{type:"join"}),to:d.createFull(n,i)}))})));case 15:case"end":return t.stop()}}),t,null,[[4,11]])})));return function(e,n){return t.apply(this,arguments)}}(),e.leaveRoom=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=d.toBare(t),n=n||e.joinedRooms.get(t),e.leavingRooms.set(t,n),new Promise((function(i,a){var o=r.id||(0,v.uuid)(),s=d.allowedResponders(t);function c(n){d.equalBare(n.from,t)&&(e.off("muc:leave",c),e.off("presence:error",l),i(n))}function l(n){n.id===o&&s.has(n.from)&&(e.joinedRooms.has(t)||e.leavingRooms.delete(t),e.off("muc:leave",c),e.off("presence:error",l),a(n))}e.on("muc:leave",c),e.on("presence:error",l),e.sendPresence(u(u({},r),{},{id:o,to:d.createFull(t,n),type:"unavailable"}))}))},e.ban=function(t,n,r){return e.setRoomAffiliation(t,n,"outcast",r)},e.kick=function(t,n,r){return e.setRoomRole(t,n,"none",r)},e.invite=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(n)||(n=[n]),e.sendMessage({muc:{invite:n,type:"info"},to:t})},e.directInvite=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.sendMessage({muc:u(u({},r),{},{jid:t,type:"direct-invite"}),to:n})},e.declineInvite=function(t,n,r){e.sendMessage({muc:{decline:{reason:r,to:n},type:"info"},to:t})},e.changeNick=function(t,n){var r=(0,v.uuid)(),i=d.createFull(t,n),a=d.allowedResponders(t);return new Promise((function(t,n){function o(n){a.has(d.toBare(n.from))&&n.muc.statusCodes&&n.muc.statusCodes.includes(p.MUCStatusCode.SelfPresence)&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),t(n))}function s(i){a.has(d.toBare(i.from))&&i.id===r&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),"error"===i.type?n(i):t(i))}e.on("muc:available",o),e.on("presence:id:".concat(r),s),e.sendPresence({id:r,to:i})}))},e.setSubject=function(t,n){e.sendMessage({subject:n,to:t,type:"groupchat"})},e.getReservedNick=function(){var t=a(r.mark((function t(n){var i,a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getDiscoInfo(n,"x-roomuser-item");case 3:if(i=t.sent,!(a=i.identities[0]).name){t.next=9;break}return t.abrupt("return",a.name);case 9:throw new Error("No nickname reserved");case 10:t.next=15;break;case 12:throw t.prev=12,t.t0=t.catch(0),new Error("No nickname reserved");case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}(),e.requestRoomVoice=function(t){e.sendMessage({forms:[{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/muc#request"},{name:"muc#role",type:"text-single",value:"participant"}],type:"submit"}],to:t})},e.setRoomAffiliation=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{affiliation:r,jid:n,reason:i}]},to:t,type:"set"})},e.setRoomRole=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{nick:n,reason:i,role:r}]},to:t,type:"set"})},e.getRoomMembers=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{affiliation:"member"};return e.sendIQ({muc:{type:"user-list",users:[n]},to:t,type:"get"})},e.getRoomConfig=function(){var t=a(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({muc:{type:"configure"},to:n,type:"get"});case 2:if((i=t.sent).muc.form){t.next=5;break}throw new Error("No configuration form returned");case 5:return t.abrupt("return",i.muc.form);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.configureRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{form:u(u({},n),{},{type:"submit"}),type:"configure"},to:t,type:"set"})},e.destroyRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{destroy:n,type:"configure"},to:t,type:"set"})},e.getUniqueRoomName=function(){var e=a(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendIQ({muc:{type:"unique"},to:t,type:"get"});case 2:if((n=e.sent).muc.name){e.next=5;break}throw new Error("No unique name returned");case 5:return e.abrupt("return",n.muc.name);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.getBookmarks=a(r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getPrivateData("bookmarks");case 2:if((n=t.sent)&&n.rooms){t.next=5;break}return t.abrupt("return",[]);case 5:return t.abrupt("return",n.rooms);case 6:case"end":return t.stop()}}),t)}))),e.setBookmarks=function(t){return e.setPrivateData("bookmarks",{rooms:t})},e.addBookmark=function(){var t=a(r.mark((function t(n){var i,a,o,s,l,f;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBookmarks();case 2:i=t.sent,a=[],o=!1,s=c(i);try{for(s.s();!(l=s.n()).done;)f=l.value,d.equalBare(f.jid,n.jid)?(a.push(u(u({},f),n)),o=!0):a.push(f)}catch(e){s.e(e)}finally{s.f()}return o||a.push(n),t.abrupt("return",e.setBookmarks(a));case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.removeBookmark=function(){var t=a(r.mark((function t(n){var i,a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBookmarks();case 2:return i=t.sent,a=i.filter((function(e){return!d.equalBare(e.jid,n)})),t.abrupt("return",e.setBookmarks(a));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2);t.default=function(e){e.disco.addFeature(o.NS_ACTIVITY),e.disco.addFeature(o.NS_GEOLOC),e.disco.addFeature(o.NS_MOOD),e.disco.addFeature(o.NS_NICK),e.disco.addFeature(o.NS_TUNE),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_ACTIVITY)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_GEOLOC)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_MOOD)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_NICK)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_TUNE)),e.publishActivity=function(t){return e.publish("",o.NS_ACTIVITY,a({itemType:o.NS_ACTIVITY},t))},e.publishGeoLoc=function(t){return e.publish("",o.NS_GEOLOC,a({itemType:o.NS_GEOLOC},t))},e.publishMood=function(t){return e.publish("",o.NS_MOOD,a({itemType:o.NS_MOOD},t))},e.publishNick=function(t){return e.publish("",o.NS_NICK,{itemType:o.NS_NICK,nick:t})},e.publishTune=function(t){return e.publish("",o.NS_TUNE,a({itemType:o.NS_TUNE},t))},e.on("pubsub:published",(function(t){var n=t.pubsub.items.published[0].content;switch(t.pubsub.items.node){case o.NS_ACTIVITY:return e.emit("activity",{activity:n,jid:t.from});case o.NS_GEOLOC:return e.emit("geoloc",{geoloc:n,jid:t.from});case o.NS_MOOD:return e.emit("mood",{jid:t.from,mood:n});case o.NS_NICK:return e.emit("nick",{jid:t.from,nick:n.nick});case o.NS_TUNE:return e.emit("tune",{jid:t.from,tune:t.pubsub.items.published[0].content})}}))}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22)),c=n(2);t.default=function(e){e.disco.addFeature("".concat(c.NS_SHIM,"#SubID"),c.NS_SHIM),e.on("message",(function(t){!function(e){return!!e.pubsub&&!(e.pubsub.context&&"user"!==e.pubsub.context||!e.pubsub.affiliations)}(t)?function(e){return!!e.pubsub}(t)&&(e.emit("pubsub:event",t),!function(e){return!!e.pubsub.items&&!!e.pubsub.items.published}(t)?!function(e){return!!e.pubsub.items&&!!e.pubsub.items.retracted}(t)?!function(e){return"purge"===e.pubsub.eventType}(t)?!function(e){return"delete"===e.pubsub.eventType}(t)?!function(e){return"subscription"===e.pubsub.eventType}(t)?function(e){return"configuration"===e.pubsub.eventType}(t)&&e.emit("pubsub:config",t):e.emit("pubsub:subscription",t):e.emit("pubsub:deleted",t):e.emit("pubsub:purged",t):e.emit("pubsub:retracted",t):e.emit("pubsub:published",t)):e.emit("pubsub:affiliations",t)})),e.subscribeToNode=function(){var t=a(i.mark((function t(n,r){var a,o,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={},"string"==typeof r?(a.node=r,a.jid=u.toBare(e.jid)):(a.node=r.node,a.jid=r.jid||(r.useBareJID?u.toBare(e.jid):e.jid),o=r.options),t.next=4,e.sendIQ({pubsub:{context:"user",subscribe:a,subscriptionOptions:o?{form:o}:void 0},to:n,type:"set"});case 4:return s=t.sent,c=s.pubsub.subscription||{},s.pubsub.subscriptionOptions&&(c.options=s.pubsub.subscriptionOptions.form),t.abrupt("return",c);case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.unsubscribeFromNode=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:return a={},"string"==typeof r?(a.node=r,a.jid=u.toBare(e.jid)):(a.node=r.node,a.subid=r.subid,a.jid=r.jid||(r.useBareJID?u.toBare(e.jid):e.jid)),t.next=4,e.sendIQ({pubsub:{context:"user",unsubscribe:a},to:n,type:"set"});case 4:if((o=t.sent).pubsub&&o.pubsub.subscription){t.next=7;break}return t.abrupt("return",s(s({},a),{},{state:"none"}));case 7:return t.abrupt("return",o.pubsub.subscription);case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.publish=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",publish:{item:{content:r,id:i},node:n}},to:t,type:"set"})},e.getItem=function(){var t=a(i.mark((function t(n,r,a){var o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{context:"user",fetch:{items:[{id:a}],node:r}},to:n,type:"get"});case 2:return o=t.sent,t.abrupt("return",o.pubsub.fetch.items[0]);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getItems=function(){var t=a(i.mark((function t(n,r){var a,o,s,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.next=3,e.sendIQ({pubsub:{context:"user",fetch:{max:a.max,node:r},paging:a},to:n,type:"get"});case 3:return o=t.sent,(s=o.pubsub.fetch).paging=o.pubsub.paging,t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.retract=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",retract:{id:r,node:n,notify:i}},to:t,type:"set"})},e.purgeNode=function(t,n){return e.sendIQ({pubsub:{context:"owner",purge:n},to:t,type:"set"})},e.deleteNode=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",destroy:{node:n,redirect:r}},to:t,type:"set"})},e.createNode=function(){var t=a(i.mark((function t(n,r,a){var o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{configure:a?{form:a}:void 0,context:"user",create:{node:r}},to:n,type:"set"});case 2:if((o=t.sent).pubsub&&o.pubsub.create){t.next=5;break}return t.abrupt("return",{node:r});case 5:return t.abrupt("return",o.pubsub.create);case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getSubscriptions=function(){var t=a(i.mark((function t(n){var r,a,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},t.next=3,e.sendIQ({pubsub:{context:"user",subscriptions:r},to:n,type:"get"});case 3:return a=t.sent,t.abrupt("return",a.pubsub.subscriptions);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getAffiliations=function(t,n){return e.sendIQ({pubsub:{affiliations:{node:n}},to:t,type:"get"})},e.getNodeSubscribers=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"string"==typeof n?r.node=n:r=s(s({},r),n),e.sendIQ({pubsub:{context:"owner",subscriptions:r},to:t,type:"get"})},e.updateNodeSubscriptions=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",subscriptions:{items:r,node:n}},to:t,type:"set"})},e.getNodeAffiliations=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{affiliations:{node:r},context:"owner"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.pubsub.affiliations);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.updateNodeAffiliations=function(t,n,r){return e.sendIQ({pubsub:{affiliations:{items:r,node:n},context:"owner"},to:t,type:"set"})},e.getNodeConfig=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{configure:{node:r},context:"owner"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.pubsub.configure.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getDefaultNodeConfig=function(){var t=a(i.mark((function t(n){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{context:"owner",defaultConfiguration:{}},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.pubsub.defaultConfiguration.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.configureNode=function(){var t=a(i.mark((function t(n,r,a){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({pubsub:{configure:{form:a,node:r},context:"owner"},to:n,type:"set"}));case 1:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getDefaultSubscriptionOptions=function(){var t=a(i.mark((function t(n){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{defaultSubscriptionOptions:{}},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.pubsub.defaultSubscriptionOptions.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22));t.default=function(e){function t(e,t){return n.apply(this,arguments)}function n(){return(n=a(i.mark((function t(n,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({blockList:{action:n,jids:[r]},type:"set"});case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.on("iq:set:roster",(function(t){if(!u.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});e.emit("roster:update",t),e.sendIQResult(t)})),e.on("iq:set:blockList",(function(t){if(!u.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});var n=t.blockList;e.emit(n.action,{jids:n.jids||[]}),e.sendIQResult(t)})),e.getRoster=a(i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({roster:{version:e.config.rosterVer},type:"get"});case 2:if(!(n=t.sent).roster){t.next=10;break}return(r=n.roster.version)&&(e.config.rosterVer=r,e.emit("roster:ver",r)),n.roster.items=n.roster.items||[],t.abrupt("return",n.roster);case 10:return t.abrupt("return",{items:[]});case 11:case"end":return t.stop()}}),t)}))),e.updateRosterItem=function(){var t=a(i.mark((function t(n){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({roster:{items:[n]},type:"set"});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.removeRosterItem=function(t){return e.updateRosterItem({jid:t,subscription:"remove"})},e.subscribe=function(t){e.sendPresence({type:"subscribe",to:t})},e.unsubscribe=function(t){e.sendPresence({type:"unsubscribe",to:t})},e.acceptSubscription=function(t){e.sendPresence({type:"subscribed",to:t})},e.denySubscription=function(t){e.sendPresence({type:"unsubscribed",to:t})},e.getBlocked=a(i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({blockList:{action:"list"},type:"get"});case 2:return n=t.sent,t.abrupt("return",s({jids:[]},n.blockList));case 4:case"end":return t.stop()}}),t)}))),e.block=function(){var e=a(i.mark((function e(n){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("block",n));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.unblock=function(){var e=a(i.mark((function e(n){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("unblock",n));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.goInvisible=a(i.mark((function t(){var n,r=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>0&&void 0!==r[0]&&r[0],t.next=3,e.sendIQ({type:"set",visiblity:{probe:n,type:"invisible"}});case 3:case"end":return t.stop()}}),t)}))),e.goVisible=a(i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({type:"set",visiblity:{type:"visible"}});case 2:case"end":return t.stop()}}),t)})))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("sasl",100,function(){var t=a(r.mark((function t(n,i){var o,u,c;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.sasl.createMechanism(n.sasl.mechanisms),u=function(){var t=a(r.mark((function t(n){var a,c,l;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o){t.next=2;break}return t.abrupt("return");case 2:t.t0=n.type,t.next="success"===t.t0?5:"challenge"===t.t0?11:"failure"===t.t0||"abort"===t.t0?27:31;break;case 5:return e.features.negotiated.sasl=!0,e.off("sasl",u),e.emit("auth:success",e.config.credentials),e.transport&&(e.transport.authenticated=!0),i("restart"),t.abrupt("return");case 11:return o.processChallenge(n.value),t.prev=12,t.next=15,e.getCredentials();case 15:a=t.sent,(c=o.createResponse(a))||""===c?e.send("sasl",{type:"response",value:c}):e.send("sasl",{type:"response"}),(l=o.getCacheableCredentials())&&(e.config.credentials||(e.config.credentials={}),e.config.credentials=s(s({},e.config.credentials),l),e.emit("credentials:update",e.config.credentials)),t.next=26;break;case 22:t.prev=22,t.t1=t.catch(12),console.error(t.t1),e.send("sasl",{type:"abort"});case 26:return t.abrupt("return");case 27:return e.off("sasl",u),e.emit("auth:failed"),i("disconnect","authentication failed"),t.abrupt("return");case 31:case"end":return t.stop()}}),t,null,[[12,22]])})));return function(e){return t.apply(this,arguments)}}(),o){t.next=6;break}return e.off("sasl",u),e.emit("auth:failed"),t.abrupt("return",i("disconnect","authentication failed"));case 6:return e.on("sasl",u),e.once("--reset-stream-features",(function(){e.features.negotiated.sasl=!1,e.off("sasl",u)})),t.prev=8,t.next=11,e.getCredentials();case 11:c=t.sent,e.send("sasl",{mechanism:o.name,type:"auth",value:o.createResponse(c)}),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(8),console.error(t.t0),e.send("sasl",{type:"abort"});case 19:case"end":return t.stop()}}),t,null,[[8,15]])})));return function(e,n){return t.apply(this,arguments)}}())}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}Object.defineProperty(t,"__esModule",{value:!0});var l=(0,n(15).__importStar)(n(22)),f=n(2);t.default=function(e){function t(e){return n.apply(this,arguments)}function n(){return(n=a(i.mark((function t(n){var r,a,o,s,c,l,p;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getDiscoInfo(n);case 2:if((r=t.sent).features&&r.features.includes(f.NS_HTTP_UPLOAD_0)){t.next=5;break}return t.abrupt("return");case 5:o=u(r.extensions||[]),t.prev=6,o.s();case 8:if((s=o.n()).done){t.next=17;break}if(c=s.value,!(l=c.fields||[]).some((function(e){return"FORM_TYPE"===e.name&&e.value===f.NS_HTTP_UPLOAD_0}))){t.next=15;break}return(p=l.find((function(e){return"max-file-size"===e.name})))&&(a=parseInt(p.value,10)),t.abrupt("return",{jid:n,maxSize:a});case 15:t.next=8;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(6),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:case"end":return t.stop()}}),t,null,[[6,19,22,25]])})))).apply(this,arguments)}e.disco.addFeature(f.NS_BOB),e.getBits=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({bits:{cid:r},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.bits);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getUploadService=a(i.mark((function n(){var r,a,o,s,c,f,p,d=arguments;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=d.length>0&&void 0!==d[0]?d[0]:l.getDomain(e.jid),n.next=3,t(r);case 3:if(!(a=n.sent)){n.next=6;break}return n.abrupt("return",a);case 6:return n.next=8,e.getDiscoItems(r);case 8:o=n.sent,s=u(o.items||[]),n.prev=10,s.s();case 12:if((c=s.n()).done){n.next=23;break}if((f=c.value).jid){n.next=16;break}return n.abrupt("continue",21);case 16:return n.next=18,t(f.jid);case 18:if(!(p=n.sent)){n.next=21;break}return n.abrupt("return",p);case 21:n.next=12;break;case 23:n.next=28;break;case 25:n.prev=25,n.t0=n.catch(10),s.e(n.t0);case 28:return n.prev=28,s.f(),n.finish(28);case 31:throw new Error("No upload service discovered on: "+r);case 32:case"end":return n.stop()}}),n,null,[[10,25,28,31]])}))),e.getUploadSlot=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({httpUpload:s({type:"request"},r),to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.httpUpload);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);(0,r.__exportStar)(n(119),t),(0,r.__exportStar)(n(120),t),(0,r.__exportStar)(n(121),t),(0,r.__exportStar)(n(122),t),(0,r.__exportStar)(n(123),t),(0,r.__exportStar)(n(124),t),(0,r.__exportStar)(n(125),t),(0,r.__exportStar)(n(126),t),(0,r.__exportStar)(n(127),t),(0,r.__exportStar)(n(128),t),(0,r.__exportStar)(n(129),t),(0,r.__exportStar)(n(130),t),(0,r.__exportStar)(n(131),t),(0,r.__exportStar)(n(132),t),(0,r.__exportStar)(n(133),t),(0,r.__exportStar)(n(134),t),(0,r.__exportStar)(n(135),t),(0,r.__exportStar)(n(136),t),(0,r.__exportStar)(n(137),t),(0,r.__exportStar)(n(138),t),(0,r.__exportStar)(n(139),t),(0,r.__exportStar)(n(140),t),(0,r.__exportStar)(n(141),t),(0,r.__exportStar)(n(142),t),(0,r.__exportStar)(n(143),t),(0,r.__exportStar)(n(144),t),(0,r.__exportStar)(n(145),t),(0,r.__exportStar)(n(146),t),(0,r.__exportStar)(n(147),t),(0,r.__exportStar)(n(148),t),(0,r.__exportStar)(n(149),t),(0,r.__exportStar)(n(150),t),(0,r.__exportStar)(n(151),t),(0,r.__exportStar)(n(152),t),(0,r.__exportStar)(n(153),t),(0,r.__exportStar)(n(154),t),(0,r.__exportStar)(n(155),t),(0,r.__exportStar)(n(156),t),(0,r.__exportStar)(n(157),t),(0,r.__exportStar)(n(158),t),(0,r.__exportStar)(n(159),t),(0,r.__exportStar)(n(160),t),(0,r.__exportStar)(n(161),t),(0,r.__exportStar)(n(162),t),(0,r.__exportStar)(n(163),t),(0,r.__exportStar)(n(164),t),(0,r.__exportStar)(n(165),t),(0,r.__exportStar)(n(166),t),(0,r.__exportStar)(n(167),t),(0,r.__exportStar)(n(168),t),(0,r.__exportStar)(n(169),t),(0,r.__exportStar)(n(170),t),(0,r.__exportStar)(n(171),t),(0,r.__exportStar)(n(172),t),(0,r.__exportStar)(n(173),t),(0,r.__exportStar)(n(174),t),(0,r.__exportStar)(n(175),t),(0,r.__exportStar)(n(176),t),(0,r.__exportStar)(n(177),t),(0,r.__exportStar)(n(178),t),(0,r.__exportStar)(n(179),t),(0,r.__exportStar)(n(180),t),(0,r.__exportStar)(n(181),t),(0,r.__exportStar)(n(182),t),(0,r.__exportStar)(n(183),t),(0,r.__exportStar)(n(184),t),(0,r.__exportStar)(n(185),t),(0,r.__exportStar)(n(186),t),(0,r.__exportStar)(n(187),t),(0,r.__exportStar)(n(188),t),(0,r.__exportStar)(n(189),t),(0,r.__exportStar)(n(190),t),(0,r.__exportStar)(n(191),t),(0,r.__exportStar)(n(192),t),(0,r.__exportStar)(n(193),t),(0,r.__exportStar)(n(194),t),(0,r.__exportStar)(n(195),t),(0,r.__exportStar)(n(196),t),(0,r.__exportStar)(n(197),t),(0,r.__exportStar)(n(198),t),(0,r.__exportStar)(n(68),t);var i=(0,r.__importDefault)(n(119)),a=(0,r.__importDefault)(n(120)),o=(0,r.__importDefault)(n(121)),s=(0,r.__importDefault)(n(122)),u=(0,r.__importDefault)(n(123)),c=(0,r.__importDefault)(n(124)),l=(0,r.__importDefault)(n(125)),f=(0,r.__importDefault)(n(126)),p=(0,r.__importDefault)(n(127)),d=(0,r.__importDefault)(n(128)),h=(0,r.__importDefault)(n(129)),v=(0,r.__importDefault)(n(130)),m=(0,r.__importDefault)(n(131)),g=(0,r.__importDefault)(n(132)),y=(0,r.__importDefault)(n(133)),b=(0,r.__importDefault)(n(134)),_=(0,r.__importDefault)(n(135)),S=(0,r.__importDefault)(n(136)),w=(0,r.__importDefault)(n(137)),x=(0,r.__importDefault)(n(138)),k=(0,r.__importDefault)(n(139)),O=(0,r.__importDefault)(n(140)),T=(0,r.__importDefault)(n(141)),A=(0,r.__importDefault)(n(142)),I=(0,r.__importDefault)(n(143)),E=(0,r.__importDefault)(n(144)),N=(0,r.__importDefault)(n(145)),R=(0,r.__importDefault)(n(146)),j=(0,r.__importDefault)(n(147)),C=(0,r.__importDefault)(n(148)),P=(0,r.__importDefault)(n(149)),M=(0,r.__importDefault)(n(150)),D=(0,r.__importDefault)(n(152)),L=(0,r.__importDefault)(n(153)),B=(0,r.__importDefault)(n(154)),F=(0,r.__importDefault)(n(151)),q=(0,r.__importDefault)(n(155)),U=(0,r.__importDefault)(n(156)),z=(0,r.__importDefault)(n(157)),J=(0,r.__importDefault)(n(158)),G=(0,r.__importDefault)(n(159)),H=(0,r.__importDefault)(n(160)),V=(0,r.__importDefault)(n(161)),W=(0,r.__importDefault)(n(162)),Q=(0,r.__importDefault)(n(163)),K=(0,r.__importDefault)(n(164)),Y=(0,r.__importDefault)(n(165)),X=(0,r.__importDefault)(n(166)),$=(0,r.__importDefault)(n(167)),Z=(0,r.__importDefault)(n(168)),ee=(0,r.__importDefault)(n(169)),te=(0,r.__importDefault)(n(170)),ne=(0,r.__importDefault)(n(171)),re=(0,r.__importDefault)(n(172)),ie=(0,r.__importDefault)(n(173)),ae=(0,r.__importDefault)(n(174)),oe=(0,r.__importDefault)(n(175)),se=(0,r.__importDefault)(n(176)),ue=(0,r.__importDefault)(n(177)),ce=(0,r.__importDefault)(n(178)),le=(0,r.__importDefault)(n(179)),fe=(0,r.__importDefault)(n(180)),pe=(0,r.__importDefault)(n(181)),de=(0,r.__importDefault)(n(182)),he=(0,r.__importDefault)(n(183)),ve=(0,r.__importDefault)(n(184)),me=(0,r.__importDefault)(n(185)),ge=(0,r.__importDefault)(n(186)),ye=(0,r.__importDefault)(n(187)),be=(0,r.__importDefault)(n(188)),_e=(0,r.__importDefault)(n(189)),Se=(0,r.__importDefault)(n(190)),we=(0,r.__importDefault)(n(191)),xe=(0,r.__importDefault)(n(192)),ke=(0,r.__importDefault)(n(193)),Oe=(0,r.__importDefault)(n(194)),Te=(0,r.__importDefault)(n(195)),Ae=(0,r.__importDefault)(n(196)),Ie=(0,r.__importDefault)(n(197)),Ee=(0,r.__importDefault)(n(198)),Ne=(0,r.__importDefault)(n(68)),Re=[i.default,a.default,o.default,s.default,u.default,c.default,l.default,f.default,p.default,d.default,h.default,v.default,m.default,g.default,y.default,b.default,_.default,S.default,w.default,x.default,k.default,O.default,T.default,A.default,I.default,E.default,N.default,R.default,j.default,C.default,P.default,M.default,D.default,L.default,B.default,F.default,q.default,U.default,z.default,J.default,G.default,H.default,V.default,W.default,Q.default,K.default,Y.default,X.default,$.default,Z.default,ee.default,te.default,ne.default,re.default,ie.default,ae.default,oe.default,se.default,ue.default,ce.default,le.default,fe.default,pe.default,de.default,he.default,ve.default,me.default,ge.default,ye.default,be.default,_e.default,Se.default,we.default,xe.default,ke.default,Oe.default,Te.default,Ae.default,Ie.default,Ee.default,Ne.default];t.default=Re},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["features.legacySession","iq.legacySession"],element:"session",fields:{optional:(0,r.childBoolean)(null,"optional")},namespace:i.NS_SESSION};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:["atomentry"].concat(r((0,i.pubsubItemContentAliases)())),element:"entry",fields:{id:(0,i.childText)(null,"id"),published:(0,i.childDate)(null,"published"),updated:(0,i.childDate)(null,"updated")},namespace:a.NS_ATOM,type:a.NS_ATOM,typeField:"itemType"},{element:"summary",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.summary"},{element:"title",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.title"},{aliases:[{path:"atomentry.links",multiple:!0}],element:"link",fields:{href:(0,i.attribute)("href"),mediaType:(0,i.attribute)("type"),rel:(0,i.attribute)("rel")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.authors",multiple:!0}],element:"author",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.contributors",multiple:!0}],element:"contributor",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.categories",multiple:!0}],element:"category",fields:{term:(0,i.attribute)("term"),scheme:(0,i.attribute)("scheme"),label:(0,i.attribute)("label")},namespace:a.NS_ATOM},{element:"content",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.content"},{element:"rights",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.rights"}];t.default=o},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={defaultType:"stream",element:"stream",fields:{from:(0,a.attribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.attribute)("to"),version:(0,a.attribute)("version")},namespace:o.NS_STREAM,path:"stream",type:"stream",typeField:"action"},u={element:"features",namespace:o.NS_STREAM,path:"features"},c={element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STREAMS,"text"),condition:(0,a.childEnum)(o.NS_STREAMS,Object.values(i.StreamErrorCondition),i.StreamErrorCondition.UndefinedCondition),seeOtherHost:(0,a.childText)(o.NS_STREAMS,i.StreamErrorCondition.SeeOtherHost),text:(0,a.childText)(o.NS_STREAMS,"text")},namespace:o.NS_STREAM,path:"streamError"},l=Object.values(i.StreamType).map((function(e){return{aliases:["stanzaError","message.error","presence.error","iq.error"],defaultType:o.NS_CLIENT,element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STANZAS,"text"),by:(0,a.JIDAttribute)("by"),condition:(0,a.childEnum)(o.NS_STANZAS,Object.values(i.StanzaErrorCondition),i.StanzaErrorCondition.UndefinedCondition),gone:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Gone),redirect:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Redirect),text:(0,a.childText)(o.NS_STANZAS,"text"),type:(0,a.attribute)("type")},namespace:e,type:e,typeField:"streamType"}})),f=new Set(["from","id","lang","to","type","payloadType","error","streamType"]),p=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"iq",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),payloadType:{order:-1e4,importer:function(e,t){if("get"===t.data.type||"set"===t.data.type){if(1!==e.children.filter((function(e){return"string"!=typeof e})).length)return"invalid-payload-count";var n=Object.keys(t.data).filter((function(e){return!f.has(e)}));return 1!==n.length?"unknown-payload":n[0]}}},to:(0,a.JIDAttribute)("to"),type:(0,a.attribute)("type")},namespace:e,path:"iq",type:e,typeField:"streamType"}})),d=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"message",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"message",type:e,typeField:"streamType"}})),h=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"presence",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"presence",type:e,typeField:"streamType"}})),v=[{element:"mechanisms",fields:{mechanisms:(0,a.multipleChildText)(null,"mechanism")},namespace:o.NS_SASL,path:"features.sasl"},{element:"abort",namespace:o.NS_SASL,path:"sasl",type:"abort",typeField:"type"},{element:"auth",fields:{mechanism:(0,a.attribute)("mechanism"),value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"auth",typeField:"type"},{element:"challenge",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"challenge",typeField:"type"},{element:"response",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"response",typeField:"type"},{element:"success",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"success",typeField:"type"},{element:"failure",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_SASL,"text"),condition:(0,a.childEnum)(o.NS_SASL,Object.values(i.SASLFailureCondition)),text:(0,a.childText)(o.NS_SASL,"text")},namespace:o.NS_SASL,path:"sasl",type:"failure",typeField:"type"}],m=[{aliases:["features.tls"],defaultType:"start",element:"starttls",fields:{required:(0,a.childBoolean)(null,"required")},namespace:o.NS_STARTTLS,path:"tls",type:"start",typeField:"type"},{element:"proceed",namespace:o.NS_STARTTLS,path:"tls",type:"proceed",typeField:"type"},{element:"failure",namespace:o.NS_STARTTLS,path:"tls",type:"failure",typeField:"type"}],g={aliases:["features.bind","iq.bind"],element:"bind",fields:{jid:(0,a.childText)(null,"jid"),resource:(0,a.childText)(null,"resource")},namespace:o.NS_BIND},y=[s,u,c].concat(r(l),v,m,r(p),r(d),r(h),[g]);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({rosterPreApproval:(0,r.childBoolean)(i.NS_SUBSCRIPTION_PREAPPROVAL,"sub"),rosterVersioning:(0,r.childBoolean)(i.NS_ROSTER_VERSIONING,"ver")}),(0,r.extendMessage)({alternateLanguageBodies:(0,r.childAlternateLanguageText)(null,"body"),alternateLanguageSubjects:(0,r.childAlternateLanguageText)(null,"subject"),body:(0,r.childText)(null,"body"),hasSubject:(0,r.childBoolean)(null,"subject"),parentThread:(0,r.childAttribute)(null,"thread","parent"),subject:(0,r.childText)(null,"subject"),thread:(0,r.childText)(null,"thread"),type:(0,r.attribute)("type")}),(0,r.extendPresence)({alternateLanguageStatuses:(0,r.childAlternateLanguageText)(null,"status"),priority:(0,r.childInteger)(null,"priority",0),show:(0,r.childText)(null,"show"),status:(0,r.childText)(null,"status"),type:(0,r.attribute)("type")}),{element:"query",fields:{version:(0,r.attribute)("ver",void 0,{emitEmpty:!0})},namespace:i.NS_ROSTER,path:"iq.roster"},{aliases:[{path:"iq.roster.items",multiple:!0}],element:"item",fields:{groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),pending:(0,r.attribute)("ask"),preApproved:(0,r.booleanAttribute)("approved"),subscription:(0,r.attribute)("subscription")},namespace:i.NS_ROSTER}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"open",fields:{from:(0,r.attribute)("from"),id:(0,r.attribute)("id"),lang:(0,r.languageAttribute)(),to:(0,r.attribute)("to"),version:(0,r.attribute)("version")},namespace:i.NS_FRAMING,path:"stream",type:"open"},{element:"close",fields:{seeOtherURI:(0,r.attribute)("see-other-uri")},namespace:i.NS_FRAMING,path:"stream",type:"close"}];t.default=a},function(e,t,n){"use strict";var r=n(4);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}function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(18),c=n(5),l=n(2),f=[{aliases:[{path:"message.forms",multiple:!0}],element:"x",fields:{instructions:s(s({},(0,c.multipleChildText)(null,"instructions")),{},{exportOrder:2}),reported:s(s({},(0,c.splicePath)(null,"reported","dataformField",!0)),{},{exportOrder:3}),title:s(s({},(0,c.childText)(null,"title")),{},{exportOrder:1}),type:(0,c.attribute)("type")},namespace:l.NS_DATAFORM,optionalNamespaces:{xdv:l.NS_DATAFORM_VALIDATION},path:"dataform"},{aliases:[{path:"dataform.fields",multiple:!0},{path:"dataform.items.fields",multiple:!0}],element:"field",fields:{description:(0,c.childText)(null,"desc"),label:(0,c.attribute)("label"),name:(0,c.attribute)("var"),rawValues:s(s({},(0,c.multipleChildText)(null,"value")),{},{exporter:function(){return null}}),required:(0,c.childBoolean)(null,"required"),type:(0,c.attribute)("type"),value:{importer:function(e,t){var n=e.getAttribute("type"),r=(0,c.multipleChildText)(l.NS_DATAFORM,"value").importer(e,t),i=r[0];switch(n){case u.DataFormFieldType.TextMultiple:case u.DataFormFieldType.ListMultiple:case u.DataFormFieldType.JIDMultiple:return r;case u.DataFormFieldType.Hidden:case u.DataFormFieldType.Fixed:return 1===r.length?i:r;case u.DataFormFieldType.Boolean:if(i)return"1"===i||"true"===i;break;default:return i}},exporter:function(e,t,n){var r=(0,c.multipleChildText)(null,"value"),a=[],o=n.data&&n.data.rawValues?n.data.rawValues[0]:void 0;if("boolean"==typeof t)a="true"===o||"false"===o?[o]:[t?"1":"0"];else if(Array.isArray(t)){var s,u=i(t);try{for(u.s();!(s=u.n()).done;){var f=s.value;a.push(f.toString())}}catch(e){u.e(e)}finally{u.f()}}else a=[t.toString()];r.exporter(e,a,Object.assign({},n,{namespace:l.NS_DATAFORM}))}}},namespace:l.NS_DATAFORM,path:"dataformField"},{aliases:[{path:"dataform.fields.options",multiple:!0}],element:"option",fields:{label:(0,c.attribute)("label"),value:(0,c.childText)(null,"value")},namespace:l.NS_DATAFORM},{aliases:[{path:"dataform.items",multiple:!0}],element:"item",namespace:l.NS_DATAFORM},{element:"validate",fields:{listMax:(0,c.childIntegerAttribute)(null,"list-range","max"),listMin:(0,c.childIntegerAttribute)(null,"list-range","min"),method:(0,c.childEnum)(null,["basic","open","range","regex"],"basic"),rangeMax:(0,c.childAttribute)(null,"range","max"),rangeMin:(0,c.childAttribute)(null,"range","min"),regex:(0,c.childText)(null,"regex"),type:(0,c.attribute)("datatype","xs:string")},namespace:l.NS_DATAFORM_VALIDATION,path:"dataform.fields.validation"}];t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["presence.legacyLastActivity","iq.lastActivity"],element:"query",fields:{seconds:(0,r.integerAttribute)("seconds"),status:(0,r.text)()},namespace:i.NS_LAST_ACTIVITY}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"query",fields:{activeList:(0,r.childAttribute)(null,"active","name"),defaultList:(0,r.childAttribute)(null,"default","name")},namespace:i.NS_PRIVACY,path:"iq.privacy"},{aliases:[{path:"iq.privacy.lists",multiple:!0}],element:"list",fields:{name:(0,r.attribute)("name")},namespace:i.NS_PRIVACY},{aliases:[{path:"iq.privacy.lists.items",multiple:!0}],element:"item",fields:{action:(0,r.attribute)("action"),incomingPresence:(0,r.childBoolean)(null,"presence-in"),iq:(0,r.childBoolean)(null,"iq"),messages:(0,r.childBoolean)(null,"message"),order:(0,r.integerAttribute)("order"),outgoingPresence:(0,r.childBoolean)(null,"presence-out"),type:(0,r.attribute)("type"),value:(0,r.attribute)("value")},namespace:i.NS_PRIVACY}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["iq.disco","message.disco","features.disco"],childrenExportOrder:{identities:1,features:2,extensions:3},element:"query",fields:{features:(0,r.multipleChildAttribute)(null,"feature","var"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_INFO,path:"disco",type:"info",typeField:"type"},{aliases:[{path:"disco.identities",selector:"info",multiple:!0}],element:"identity",fields:{category:(0,r.attribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},{aliases:[{path:"disco.items",multiple:!0,selector:"items"}],element:"item",fields:{jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS},{aliases:[{path:"disco.items",multiple:!0,selector:"info"}],element:"item",fields:{category:(0,r.JIDAttribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},(0,r.addAlias)(i.NS_DATAFORM,"x",[{path:"disco.extensions",multiple:!0,selector:"info"}]),(0,r.addAlias)(i.NS_RSM,"set",[{path:"disco.paging",selector:"items"}]),{aliases:["iq.disco","message.disco","features.disco"],element:"query",fields:{node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS,path:"disco",type:"items",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),(0,r.extendPresence)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),{element:"address",fields:{alternateLanguageDescriptions:(0,r.childAlternateLanguageText)(null,"desc"),delivered:(0,r.booleanAttribute)("delivered"),description:(0,r.attribute)("desc"),jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_ADDRESS,path:"extendedAddress"}];t.default=a},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),s=n(2),u=[(0,o.addAlias)(s.NS_DATAFORM,"x",[{path:"iq.muc.form",selector:"configure"}]),{defaultType:"info",element:"x",fields:{password:(0,o.childText)(null,"password")},namespace:s.NS_MUC,path:"presence.muc",type:"join",typeField:"type"},{aliases:[{path:"presence.muc.history",selector:"join"}],element:"history",fields:{maxCharacters:(0,o.integerAttribute)("maxchars"),maxStanzas:(0,o.integerAttribute)("maxstanzas"),seconds:(0,o.integerAttribute)("seconds"),since:(0,o.dateAttribute)("since")},namespace:s.NS_MUC},{aliases:["presence.muc","message.muc"],defaultType:"info",element:"x",fields:{action:(0,o.childEnum)(null,["invite","decline","destroy"]),actor:(0,o.splicePath)(null,"item","mucactor"),affiliation:(0,o.childAttribute)(null,"item","affiliation"),jid:(0,o.childJIDAttribute)(null,"item","jid"),nick:(0,o.childAttribute)(null,"item","nick"),password:(0,o.childText)(null,"password"),reason:(0,o.deepChildText)([{namespace:null,element:"item"},{namespace:null,element:"reason"}]),role:(0,o.childAttribute)(null,"item","role"),statusCodes:(0,o.multipleChildAttribute)(null,"status","code")},namespace:s.NS_MUC_USER,type:"info",typeField:"type",typeOrder:1},{element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_USER,path:"mucactor"},{element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_USER,path:"presence.muc.destroy"},{aliases:[{path:"message.muc.invite",multiple:!0}],element:"invite",fields:{continue:(0,o.childBoolean)(null,"continue"),from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),thread:(0,o.childAttribute)(null,"continue","thread"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER},{element:"decline",fields:{from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER,path:"message.muc",type:"decline"},{element:"query",namespace:s.NS_MUC_ADMIN,path:"iq.muc",type:"user-list",typeField:"type"},{aliases:[{path:"iq.muc.users",multiple:!0,selector:"user-list"}],element:"item",fields:{affiliation:(0,o.attribute)("affiliation"),jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick"),reason:(0,o.childText)(null,"reason"),role:(0,o.attribute)("role")},namespace:s.NS_MUC_ADMIN},{aliases:["iq.muc.users.actor"],element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_ADMIN},{element:"query",namespace:s.NS_MUC_OWNER,path:"iq.muc",type:"configure",typeField:"type"},{aliases:[{path:"iq.muc.destroy",selector:"configure"}],element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_OWNER},{element:"x",fields:{action:(0,o.staticValue)("invite"),continue:(0,o.booleanAttribute)("continue"),jid:(0,o.JIDAttribute)("jid"),legacyReason:(0,o.text)(),password:(0,o.attribute)("password"),reason:(0,o.attribute)("reason"),thread:(0,o.attribute)("thread")},namespace:s.NS_MUC_DIRECT_INVITE,path:"message.muc",type:"direct-invite",typeOrder:2},{element:"unique",fields:{name:(0,o.text)()},namespace:s.NS_MUC_UNIQUE,path:"iq.muc",type:"unique"},(0,o.extendMessage)({legacyMUC:{exporter:function(e,t,n){var r=n.registry?n.registry.export("message.muc",a(a({},t),{},{type:"direct-invite"})):void 0;r&&e.appendChild(r)},exportOrder:100001,importer:function(e,t){if((0,o.findAll)(e,s.NS_MUC_USER,"x")[0]){var n=(0,o.findAll)(e,s.NS_MUC_DIRECT_INVITE,"x")[0];if(n)return t.registry?t.registry.import(n,a(a({},t),{},{path:"message"})):void 0}},importOrder:-1}})];t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["iq.ibb","message.ibb"],element:"open",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){(0,r.attribute)("stanza").exporter(e,t?"iq":"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"open",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"close",fields:{sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"close",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"data",fields:{data:(0,r.textBuffer)("base64"),seq:(0,r.integerAttribute)("seq"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"data",typeField:"action"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:[{path:"bookmarkStorage",impliedType:!0},{path:"iq.privateStorage.bookmarks",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"storage",namespace:a.NS_BOOKMARKS,type:a.NS_BOOKMARKS,typeField:"itemType"},{aliases:[{path:"bookmarkStorage.rooms",multiple:!0}],element:"conference",fields:{autoJoin:(0,i.booleanAttribute)("autojoin"),jid:(0,i.JIDAttribute)("jid"),name:(0,i.attribute)("name"),nick:(0,i.childText)(null,"nick"),password:(0,i.childText)(null,"password")},namespace:a.NS_BOOKMARKS}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={element:"query",namespace:n(2).NS_PRIVATE,path:"iq.privateStorage"};t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.command.form"]),(0,r.extendStanzaError)({commandError:(0,r.childEnum)(i.NS_ADHOC_COMMANDS,["bad-action","bad-locale","bad-payload","bad-sessionid","malformed-action","session-expired"])}),{element:"command",fields:{action:(0,r.attribute)("action"),node:(0,r.attribute)("node"),sid:(0,r.attribute)("sessionid"),status:(0,r.attribute)("status")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command"},{element:"actions",fields:{complete:(0,r.childBoolean)(null,"complete"),execute:(0,r.attribute)("execute"),next:(0,r.childBoolean)(null,"next"),prev:(0,r.childBoolean)(null,"prev")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command.availableActions"},{aliases:[{path:"iq.command.notes",multiple:!0}],element:"note",fields:{type:(0,r.attribute)("type"),value:(0,r.text)()},namespace:i.NS_ADHOC_COMMANDS}];t.default=a},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),s=n(2),u="vcardTemp.records";function c(e,t){return{aliases:[{multiple:!0,path:u}],element:e,fields:{value:(0,o.text)()},namespace:s.NS_VCARD_TEMP,type:t,typeField:"type"}}var l=[{aliases:[{path:"iq.vcard"}],defaultType:s.NS_VCARD_TEMP,element:"vCard",fields:{fullName:(0,o.childText)(null,"FN")},namespace:s.NS_VCARD_TEMP,path:"vcardTemp",type:s.NS_VCARD_TEMP,typeField:"format"},{element:"N",fields:{additional:a(a({},(0,o.childText)(null,"MIDDLE")),{},{order:3}),family:a(a({},(0,o.childText)(null,"FAMILY")),{},{order:1}),given:a(a({},(0,o.childText)(null,"GIVEN")),{},{order:2}),prefix:a(a({},(0,o.childText)(null,"PREFIX")),{},{order:4}),suffix:a(a({},(0,o.childText)(null,"SUFFIX")),{},{order:5})},namespace:s.NS_VCARD_TEMP,path:"vcardTemp.name"},c("NICKNAME","nickname"),c("BDAY","birthday"),c("JABBERID","jid"),c("TZ","timezone"),c("TITLE","title"),c("ROLE","role"),c("URL","url"),c("NOTE","note"),c("SORT-STRING","sort"),c("UID","uid"),c("REV","revision"),c("PRODID","productId"),c("DESC","description"),{aliases:[{multiple:!0,path:u}],element:"EMAIL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["internet","INTERNET"]]),value:(0,o.childText)(null,"USERID")},namespace:s.NS_VCARD_TEMP,type:"email"},{aliases:[{path:u,multiple:!0}],element:"ORG",fields:{units:a(a({},(0,o.multipleChildText)(null,"ORGUNIT")),{},{order:2}),value:a(a({},(0,o.childText)(null,"ORGNAME")),{},{order:1})},namespace:s.NS_VCARD_TEMP,type:"organization",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"ADR",fields:{city:(0,o.childText)(null,"LOCALITY"),code:(0,o.childText)(null,"PCODE"),country:(0,o.childText)(null,"CTRY"),pobox:(0,o.childText)(null,"POBOX"),preferred:(0,o.childBoolean)(null,"PREF"),region:(0,o.childText)(null,"REGION"),street:(0,o.childText)(null,"STREET"),street2:(0,o.childText)(null,"EXTADD"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["domestic","DOM"],["international","INTL"],["postal","POSTAL"],["parcel","PARCEL"]])},namespace:s.NS_VCARD_TEMP,type:"address",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LABEL",fields:{lines:(0,o.multipleChildText)(null,"LINE"),preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"]])},namespace:s.NS_VCARD_TEMP,type:"addressLabel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"TEL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["cell","CELL"],["fax","FAX"],["voice","VOICE"],["msg","MSG"]]),value:(0,o.childText)(null,"NUMBER","",!0)},namespace:s.NS_VCARD_TEMP,type:"tel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"PHOTO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"photo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LOGO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"logo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"CATEGORIES",fields:{value:(0,o.multipleChildText)(null,"KEYWORD")},namespace:s.NS_VCARD_TEMP,type:"categories",typeField:"type"}];t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.search.form"]),(0,r.addAlias)(i.NS_RSM,"set",["iq.search.paging"]),{element:"query",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH,path:"iq.search"},{aliases:[{path:"iq.search.items",multiple:!0}],element:"item",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),jid:(0,r.JIDAttribute)("jid"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["iq.pubsub.paging"],element:"set",fields:{after:(0,r.childText)(null,"after"),before:(0,r.childText)(null,"before"),count:(0,r.childInteger)(null,"count"),first:(0,r.childText)(null,"first"),firstIndex:(0,r.childIntegerAttribute)(null,"first","index"),index:(0,r.childInteger)(null,"index"),last:(0,r.childText)(null,"last"),max:(0,r.childInteger)(null,"max")},namespace:i.NS_RSM,path:"paging"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(18),a=n(5),o=n(2),s={configurable:(0,a.childBoolean)(null,"subscribe-options"),configurationRequired:(0,a.deepChildBoolean)([{namespace:null,element:"subscribe-options"},{namespace:null,element:"required"}]),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),state:(0,a.attribute)("subscription"),subid:(0,a.attribute)("subid")},u={node:(0,a.attribute)("node")},c=[{aliases:["pubsub","iq.pubsub","message.pubsub"],childrenExportOrder:{configure:0,create:100,publish:100,subscribe:100,subscriptionOptions:0},defaultType:"user",element:"pubsub",fields:{publishOptions:(0,a.splicePath)(null,"publish-options","dataform")},namespace:o.NS_PUBSUB,type:"user",typeField:"context"},{aliases:["pubsub","iq.pubsub","message.pubsub"],defaultType:"user",element:"pubsub",fields:{purge:(0,a.childAttribute)(null,"purge","node")},namespace:o.NS_PUBSUB_OWNER,type:"owner",typeField:"context"},(0,a.addAlias)(o.NS_DATAFORM,"x",["iq.pubsub.configure.form","iq.pubsub.defaultConfiguration.form","iq.pubsub.defaultSubscriptionOptions.form","iq.pubsub.subscriptionOptions.form","message.pubsub.configuration.form"]),(0,a.addAlias)(o.NS_RSM,"set",["iq.pubsub.fetch.paging"]),(0,a.extendStanzaError)({pubsubError:(0,a.childEnum)(o.NS_PUBSUB_ERRORS,Object.values(i.PubsubErrorCondition)),pubsubUnsupportedFeature:(0,a.childAttribute)(o.NS_PUBSUB_ERRORS,"unsupported","feature")}),{element:"subscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscribe"},{element:"unsubscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.unsubscribe"},{element:"options",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscriptionOptions"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"user",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"owner",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.subscription",selector:"owner"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB},{aliases:[{path:"iq.pubsub.subscription",selector:"user"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"user"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.affiliations",selector:"user",impliedType:!0},{path:"message.pubsub.affiliations",selector:"user",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.affiliations",selector:"owner",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"user"},{impliedType:!0,multiple:!0,path:"message.pubsub.affiliations.items",selector:"user"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"owner"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{element:"create",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.create"},{aliases:[{path:"iq.pubsub.destroy",selector:"owner"}],element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_OWNER},{aliases:[{path:"iq.pubsub.configure",selector:"owner",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.configure",selector:"user",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB,type:"user"},{element:"default",fields:{node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.defaultSubscriptionOptions"},{element:"default",fields:{},namespace:o.NS_PUBSUB_OWNER,path:"iq.pubsub.defaultConfiguration"},{element:"publish",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.publish"},{element:"retract",fields:{id:(0,a.childAttribute)(null,"item","id"),node:(0,a.attribute)("node"),notify:(0,a.booleanAttribute)("notify")},namespace:o.NS_PUBSUB,path:"iq.pubsub.retract"},{element:"items",fields:{max:(0,a.integerAttribute)("max_items"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.fetch"},{aliases:["pubsubitem","iq.pubsub.publish.item",{multiple:!0,path:"iq.pubsub.fetch.items"}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB},{element:"event",fields:{eventType:(0,a.childEnum)(null,["purge","delete","subscription","configuration","items"])},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub",type:"event",typeField:"context"},{aliases:[{path:"message.pubsub.items.published",multiple:!0}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB_EVENT,path:"pubsubeventitem"},{element:"purge",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.purge"},{element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.delete"},{aliases:[{path:"message.pubsub.subscription",selector:"event",impliedType:!0}],element:"subscription",fields:{expires:(r="expiry",{importer:function(e){var t=e.getAttribute(r);return"presence"===t?t:t?new Date(t):void 0},exporter:function(e,t){var n;n="string"==typeof t?t:t.toISOString(),e.setAttribute(r,n)}}),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid"),type:(0,a.attribute)("subscription")},namespace:o.NS_PUBSUB_EVENT,type:"event"},{element:"configuration",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.configuration"},{element:"items",fields:{node:(0,a.attribute)("node"),retracted:(0,a.multipleChildAttribute)(null,"retract","id")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.items"}];t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"query",fields:{activate:(0,r.childText)(null,"activate"),address:(0,r.attribute)("dstaddr"),candidateUsed:(0,r.childJIDAttribute)(null,"streamhost-used","jid"),mode:(0,r.attribute)("mode","tcp"),sid:(0,r.attribute)("sid"),udpSuccess:(0,r.childAttribute)(null,"udpsuccess","dstaddr")},namespace:i.NS_SOCKS5,path:"iq.socks5"},{aliases:[{multiple:!0,path:"iq.socks5.candidates"}],element:"streamhost",fields:{host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),uri:(0,r.attribute)("uri")},namespace:i.NS_SOCKS5}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:[{multiple:!0,path:"message.links"}],element:"x",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB},{element:"query",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB_TRANSFER,path:"iq.transferLink"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"html",fields:{alternateLanguageBodies:(0,r.childAlternateLanguageRawElement)(i.NS_XHTML,"body","xhtmlim"),body:(0,r.childLanguageRawElement)(i.NS_XHTML,"body","xhtmlim")},namespace:i.NS_XHTML_IM,path:"message.html"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({inbandRegistration:(0,r.childBoolean)(i.NS_INBAND_REGISTRATION,"register")}),(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.account.form"]),(0,r.addAlias)(i.NS_OOB,"x",["iq.account.registrationLink"]),{element:"query",fields:{address:(0,r.childText)(null,"address"),date:(0,r.childDate)(null,"date"),email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),fullName:(0,r.childText)(null,"name"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),key:(0,r.childText)(null,"key"),locality:(0,r.childText)(null,"city"),misc:(0,r.childText)(null,"misc"),nick:(0,r.childText)(null,"nick"),password:(0,r.childText)(null,"password"),phone:(0,r.childText)(null,"phone"),postalCode:(0,r.childText)(null,"zip"),region:(0,r.childText)(null,"state"),registered:(0,r.childBoolean)(null,"registered"),remove:(0,r.childBoolean)(null,"remove"),text:(0,r.childText)(null,"text"),uri:(0,r.childText)(null,"uri"),username:(0,r.childText)(null,"username")},namespace:i.NS_REGISTER,path:"iq.account"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o={aliases:[{path:"message.geoloc",impliedType:!0},{path:"dataform.fields.geoloc",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"geoloc",fields:{accuracy:(0,i.childFloat)(null,"accuracy"),altitude:(0,i.childFloat)(null,"alt"),altitudeAccuracy:(0,i.childFloat)(null,"altaccuracy"),area:(0,i.childText)(null,"area"),building:(0,i.childText)(null,"building"),country:(0,i.childText)(null,"country"),countryCode:(0,i.childText)(null,"countrycode"),datum:(0,i.childText)(null,"datum"),description:(0,i.childText)(null,"description"),error:(0,i.childFloat)(null,"error"),floor:(0,i.childText)(null,"floor"),heading:(0,i.childFloat)(null,"bearing"),lang:(0,i.languageAttribute)(),latitude:(0,i.childFloat)(null,"lat"),locality:(0,i.childText)(null,"locality"),longitude:(0,i.childFloat)(null,"lon"),postalCode:(0,i.childText)(null,"postalcode"),region:(0,i.childText)(null,"region"),room:(0,i.childText)(null,"room"),speed:(0,i.childFloat)(null,"speed"),street:(0,i.childText)(null,"street"),text:(0,i.childText)(null,"text"),timestamp:(0,i.childDate)(null,"timestamp"),tzo:(0,i.childTimezoneOffset)(null,"tzo"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_GEOLOC,type:a.NS_GEOLOC};t.default=o},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:(0,i.pubsubItemContentAliases)(),element:"data",fields:{data:(0,i.textBuffer)("base64")},namespace:a.NS_AVATAR_DATA,path:"avatar",type:a.NS_AVATAR_DATA,typeField:"itemType"},{aliases:[{path:"avatar",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"metadata",namespace:a.NS_AVATAR_METADATA,type:a.NS_AVATAR_METADATA,typeField:"itemType",childrenExportOrder:{versions:1,pointers:2}},{aliases:[{multiple:!0,path:"avatar.versions",selector:a.NS_AVATAR_METADATA}],element:"info",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),uri:(0,i.attribute)("url"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA},{aliases:[{multiple:!0,path:"avatar.pointers",selector:a.NS_AVATAR_METADATA}],element:"pointer",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(5),a=n(2);t.default=(0,i.extendMessage)({chatState:(0,i.childEnum)(a.NS_CHAT_STATES,Object.values(r.ChatState))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"query",fields:{name:(0,r.childText)(null,"name"),os:(0,r.childText)(null,"os"),version:(0,r.childText)(null,"version")},namespace:i.NS_VERSION,path:"iq.softwareVersion"};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={aliases:[{path:"message.mood",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"mood",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text"),value:(0,a.childEnum)(null,i.USER_MOODS)},namespace:o.NS_MOOD,type:o.NS_MOOD};t.default=s},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={aliases:[{path:"activity",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"activity",fields:{activity:(0,a.childDoubleEnum)(null,i.USER_ACTIVITY_GENERAL,i.USER_ACTIVITY_SPECIFIC),alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text")},namespace:o.NS_ACTIVITY,type:o.NS_ACTIVITY};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"handshake",fields:{value:(0,r.textBuffer)("hex")},namespace:i.NS_COMPONENT,path:"handshake"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{path:"presence.legacyCapabilities",multiple:!0},{path:"features.legacyCapabilities",multiple:!0}],element:"c",fields:{algorithm:(0,r.attribute)("hash"),legacy:(0,r.staticValue)(!0),node:(0,r.attribute)("node"),value:(0,r.attribute)("ver")},namespace:i.NS_DISCO_LEGACY_CAPS};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o={aliases:[{impliedType:!0,path:"tune"}].concat(r((0,i.pubsubItemContentAliases)())),element:"tune",fields:{artist:(0,i.childText)(null,"artist"),length:(0,i.childInteger)(null,"length"),rating:(0,i.childInteger)(null,"rating"),source:(0,i.childText)(null,"source"),title:(0,i.childText)(null,"title"),track:(0,i.childText)(null,"track"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_TUNE,type:a.NS_TUNE};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=["dataformLayout",{multiple:!0,path:"dataformLayout.contents"},{multiple:!0,path:"dataform.layout.contents"}],o=[{aliases:[{multiple:!0,path:"dataform.layout"}],element:"page",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT},{aliases:a,element:"section",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT,type:"section",typeField:"type"},{aliases:a,element:"text",fields:{value:(0,r.text)()},namespace:i.NS_DATAFORM_LAYOUT,type:"text",typeField:"type"},{aliases:a,element:"fieldref",fields:{field:(0,r.attribute)("var")},namespace:i.NS_DATAFORM_LAYOUT,type:"fieldref",typeField:"type"},{aliases:a,element:"reportedref",namespace:i.NS_DATAFORM_LAYOUT,type:"reportedref",typeField:"type"}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"body",fields:{acceptMediaTypes:(0,r.attribute)("accept"),ack:(0,r.integerAttribute)("ack"),authId:(0,r.attribute)("authid"),characterSets:(0,r.attribute)("charsets"),condition:(0,r.attribute)("condition"),from:(0,r.JIDAttribute)("from"),key:(0,r.attribute)("key"),lang:(0,r.languageAttribute)(),maxClientRequests:(0,r.integerAttribute)("requests"),maxHoldOpen:(0,r.integerAttribute)("hold"),maxInactivityTime:(0,r.integerAttribute)("inactivity"),maxSessionPause:(0,r.integerAttribute)("maxpause"),maxWaitTime:(0,r.integerAttribute)("wait"),mediaType:(0,r.attribute)("content"),minPollingInterval:(0,r.integerAttribute)("polling"),newKey:(0,r.attribute)("newkey"),pauseSession:(0,r.integerAttribute)("pause"),report:(0,r.integerAttribute)("report"),rid:(0,r.integerAttribute)("rid"),route:(0,r.attribute)("string"),seeOtherURI:(0,r.childText)(null,"uri"),sid:(0,r.attribute)("sid"),stream:(0,r.attribute)("stream"),time:(0,r.integerAttribute)("time"),to:(0,r.JIDAttribute)("to"),type:(0,r.attribute)("type"),version:(0,r.attribute)("ver"),xmppRestart:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restart",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppRestartLogic:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restartlogic",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppVersion:(0,r.namespacedAttribute)("xmpp",i.NS_BOSH_XMPP,"version")},namespace:i.NS_BOSH,path:"bosh"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),(0,r.extendPresence)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),{element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_SHIM,path:"header"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"compression",fields:{methods:(0,r.multipleChildText)(null,"method")},namespace:i.NS_COMPRESSION_FEATURE,path:"features.compression"},{element:"compress",fields:{method:(0,r.childText)(null,"method")},namespace:i.NS_COMPRESSION,path:"compression",type:"start",typeField:"type"},{aliases:["error.compressionError"],element:"failure",fields:{condition:(0,r.childEnum)(null,["unsupported-method","setup-failed","processing-failed"])},namespace:i.NS_COMPRESSION,path:"compression",type:"failure",typeField:"type"},{element:"compressed",namespace:i.NS_COMPRESSION,path:"compression",type:"success",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),(0,r.extendIQ)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),{element:"item",fields:{action:(0,r.attribute)("action"),groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name")},namespace:i.NS_ROSTER_EXCHANGE,path:"rosterExchange"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendPresence)({vcardAvatar:{importer:function(e){var t=(0,r.findAll)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(t.length){var n=(0,r.findAll)(t[0],i.NS_VCARD_TEMP_UPDATE,"photo");return!n.length||n[0].getText()}},exporter:function(e,t){var n=(0,r.findOrCreate)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(""===t)(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo");else{if(!0===t)return;t&&(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo").children.push(t)}}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")}),(0,r.extendIQ)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")})];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(5),a=n(2),o=[(0,i.extendStanzaError)({jingleError:(0,i.childEnum)(a.NS_JINGLE_ERRORS_1,Object.values(r.JingleErrorCondition))}),{element:"jingle",fields:{action:(0,i.attribute)("action"),initiator:(0,i.JIDAttribute)("initiator"),responder:(0,i.JIDAttribute)("responder"),sid:(0,i.attribute)("sid")},namespace:a.NS_JINGLE_1,path:"iq.jingle"},{aliases:[{multiple:!0,path:"iq.jingle.contents"}],element:"content",fields:{creator:(0,i.attribute)("creator"),disposition:(0,i.attribute)("disposition","session"),name:(0,i.attribute)("name"),senders:(0,i.attribute)("senders","both")},namespace:a.NS_JINGLE_1},{element:"reason",fields:{alternativeSession:(0,i.childText)(null,"alternative-session"),condition:(0,i.childEnum)(null,Object.values(r.JingleReasonCondition)),text:(0,i.childText)(null,"text")},namespace:a.NS_JINGLE_1,path:"iq.jingle.reason"}];t.default=o},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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=n(18),c=n(5),l=n(2);function f(){return{importer:function(e,t){var n,r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb"),i=(0,c.attribute)("type").importer,a=(0,c.attribute)("subtype").importer,s=(0,c.attribute)("value").importer,u=[],f=o(r);try{for(f.s();!(n=f.n()).done;){var p=n.value,d=i(p,t),h=a(p,t);u.push(h?{type:d,parameter:h}:{type:d})}}catch(e){f.e(e)}finally{f.f()}var v,m=o(r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int"));try{for(m.s();!(v=m.n()).done;){var g=s(v.value,t);u.push(g?{type:"trr-int",parameter:g}:{type:"trr-int"})}}catch(e){m.e(e)}finally{m.f()}return u},exporter:function(e,t,n){var r,i=(0,c.attribute)("type").exporter,a=(0,c.attribute)("subtype").exporter,s=(0,c.attribute)("value").exporter,u=o(t);try{for(u.s();!(r=u.n()).done;){var f=r.value,p=void 0;"trr-int"===f.type?(p=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int",n.namespace,e),f.parameter&&s(p,f.parameter,n)):(i(p=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb",n.namespace,e),f.type,n),f.parameter&&a(p,f.parameter,n)),e.appendChild(p)}}catch(e){u.e(e)}finally{u.f()}}}}var p="iq.jingle.info",d=[{aliases:["iq.jingle.contents.application"],childrenExportOrder:{codecs:4,encryption:5,headerExtensions:6,sourceGroups:8,sources:7,streams:9},element:"description",fields:{media:(0,c.attribute)("media"),rtcpFeedback:a(a({},f()),{},{exportOrder:3}),rtcpMux:a(a({},(0,c.childBoolean)(null,"rtcp-mux")),{},{exportOrder:1}),rtcpReducedSize:a(a({},(0,c.childBoolean)(null,"rtcp-reduced-size")),{},{exportOrder:2}),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_1,optionalNamespaces:{rtcpf:l.NS_JINGLE_RTP_RTCP_FB_0,rtph:l.NS_JINGLE_RTP_HDREXT_0},type:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.headerExtensions",selector:l.NS_JINGLE_RTP_1}],element:"rtp-hdrext",fields:{id:(0,c.integerAttribute)("id"),senders:(0,c.attribute)("senders"),uri:(0,c.attribute)("uri")},namespace:l.NS_JINGLE_RTP_HDREXT_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.codecs",selector:l.NS_JINGLE_RTP_1},"rtpcodec"],element:"payload-type",fields:{channels:(0,c.integerAttribute)("channels"),clockRate:(0,c.integerAttribute)("clockrate"),id:(0,c.attribute)("id"),maxptime:(0,c.integerAttribute)("maxptime"),name:(0,c.attribute)("name"),parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_1,"parameter","name","value"),ptime:(0,c.integerAttribute)("ptime"),rtcpFeedback:f()},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sources",selector:l.NS_JINGLE_RTP_1}],element:"source",fields:{parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_SSMA_0,"parameter","name","value"),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sourceGroups",selector:l.NS_JINGLE_RTP_1}],element:"ssrc-group",fields:{semantics:(0,c.attribute)("semantics"),sources:(0,c.multipleChildAttribute)(null,"source","ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.streams",selector:l.NS_JINGLE_RTP_1}],element:"stream",fields:{id:(0,c.attribute)("id"),track:(0,c.attribute)("track")},namespace:l.NS_JINGLE_RTP_MSID_0},{aliases:[{path:"iq.jingle.contents.application.encryption",selector:l.NS_JINGLE_RTP_1}],element:"encryption",fields:{required:(0,c.booleanAttribute)("required")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.encryption.sdes",selector:l.NS_JINGLE_RTP_1}],element:"crypto",fields:{cryptoSuite:(0,c.attribute)("crypto-suite"),keyParameters:(0,c.attribute)("key-params"),sessionParameters:(0,c.attribute)("session-params"),tag:(0,c.integerAttribute)("tag")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{path:"iq.jingle.contents.application.encryption.zrtp",selector:l.NS_JINGLE_RTP_1}],element:"zrtp-hash",fields:{value:(0,c.textBuffer)("hex"),version:(0,c.attribute)("version")},namespace:l.NS_JINGLE_RTP_1},{element:"mute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_MUTE},{element:"unmute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_UNMUTE},{element:"hold",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_HOLD},{element:"unhold",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_UNHOLD},{element:"active",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_ACTIVE},{element:"ringing",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_RINGING}];t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({nick:(0,r.childText)(i.NS_NICK,"nick")}),(0,r.extendPresence)({nick:(0,r.childText)(i.NS_NICK,"nick")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"nick",fields:{nick:(0,r.text)()},namespace:i.NS_NICK,type:i.NS_NICK}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=function(e){return[{element:"transport",fields:{gatheringComplete:(0,i.childBoolean)(null,"gathering-complete"),password:(0,i.attribute)("pwd"),usernameFragment:(0,i.attribute)("ufrag")},namespace:e,path:"iq.jingle.contents.transport",type:e,typeField:"transportType"},{aliases:[{impliedType:!0,path:"iq.jingle.contents.transport.remoteCandidate",selector:e}],element:"remote-candidate",fields:{component:(0,i.integerAttribute)("component"),ip:(0,i.attribute)("ip"),port:(0,i.integerAttribute)("port")},namespace:e,type:e,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:e}],element:"candidate",fields:{component:(0,i.integerAttribute)("component"),foundation:(0,i.attribute)("foundation"),generation:(0,i.integerAttribute)("generation"),id:(0,i.attribute)("id"),ip:(0,i.attribute)("ip"),network:(0,i.integerAttribute)("network"),port:(0,i.integerAttribute)("port"),priority:(0,i.integerAttribute)("priority"),protocol:(0,i.attribute)("protocol"),relatedAddress:(0,i.attribute)("rel-addr"),relatedPort:(0,i.attribute)("rel-port"),tcpType:(0,i.attribute)("tcptype"),type:(0,i.attribute)("type")},namespace:e,type:e,typeField:"transportType"}]},s=[].concat(r(o(a.NS_JINGLE_ICE_0)),r(o(a.NS_JINGLE_ICE_UDP_1)));t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"transport",fields:{gatheringComplete:(0,r.childBoolean)(null,"gathering-complete"),password:(0,r.attribute)("pwd"),usernameFragment:(0,r.attribute)("ufrag")},namespace:i.NS_JINGLE_RAW_UDP_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_RAW_UDP_1}],element:"candidate",fields:{component:(0,r.integerAttribute)("component"),foundation:(0,r.attribute)("foundation"),generation:(0,r.integerAttribute)("generation"),id:(0,r.attribute)("id"),ip:(0,r.attribute)("ip"),port:(0,r.integerAttribute)("port"),type:(0,r.attribute)("type")},namespace:i.NS_JINGLE_RAW_UDP_1,type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"request",namespace:i.NS_RECEIPTS,path:"message.receipt",type:"request",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_RECEIPTS,path:"message.receipt",type:"received",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"invisible",fields:{probe:(0,r.booleanAttribute)("probe")},namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"invisible",typeField:"type"},{element:"visible",namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"visible"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStanzaError)({blocked:(0,r.childBoolean)(i.NS_BLOCKING_ERRORS,"blocked")}),{element:"blocklist",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"list",typeField:"action"},{element:"block",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"block",typeField:"action"},{element:"unblock",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"unblock",typeField:"action"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({streamManagement:(0,r.childBoolean)(i.NS_SMACKS_3,"sm")}),{element:"a",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"ack",typeField:"type"},{element:"r",namespace:i.NS_SMACKS_3,path:"sm",type:"request",typeField:"type"},{element:"enable",fields:{allowResumption:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enable",typeField:"type"},{element:"enabled",fields:{id:(0,r.attribute)("id"),resume:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enabled",typeField:"type"},{element:"resume",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resume",typeField:"type"},{element:"resumed",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resumed",typeField:"type"},{element:"failed",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"failed",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendIQ)({ping:(0,r.childBoolean)(i.NS_PING,"ping")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"time",fields:{tzo:(0,r.childTimezoneOffset)(null,"tzo"),utc:(0,r.childDate)(null,"utc")},namespace:i.NS_TIME,path:"iq.time"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["message.delay","presence.delay"],element:"delay",fields:{from:(0,r.JIDAttribute)("from"),reason:(0,r.text)(),timestamp:(0,r.dateAttribute)("stamp")},namespace:i.NS_DELAY};t.default=a},function(e,t,n){"use strict";var r=n(13);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(5),a=n(2),o={2:a.NS_DISCO_EXTERNAL_2,1:a.NS_DISCO_EXTERNAL_1},s=[],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],p=l[1];s.push({aliases:["iq.externalServiceCredentials"],defaultType:"2",element:"credentials",fields:{expires:(0,i.childDateAttribute)(null,"service","expires"),host:(0,i.childAttribute)(null,"service","host"),name:(0,i.childAttribute)(null,"service","name"),password:(0,i.childAttribute)(null,"service","password"),port:(0,i.childIntegerAttribute)(null,"service","port"),restricted:(0,i.childBooleanAttribute)(null,"service","restricted"),transport:(0,i.childAttribute)(null,"service","transport"),type:(0,i.childAttribute)(null,"service","type"),username:(0,i.childAttribute)(null,"service","username")},namespace:p,type:f,typeField:"version"},{aliases:["iq.externalServices"],defaultType:"2",element:"services",fields:{type:(0,i.attribute)("type")},namespace:p,type:f,typeField:"version"},{aliases:[{path:"iq.externalServices.services",multiple:!0}],defaultType:"2",element:"service",fields:{expires:(0,i.dateAttribute)("expires"),host:(0,i.attribute)("host"),name:(0,i.attribute)("name"),password:(0,i.attribute)("password"),port:(0,i.integerAttribute)("port"),restricted:(0,i.booleanAttribute)("restricted"),transport:(0,i.attribute)("transport"),type:(0,i.attribute)("type"),username:(0,i.attribute)("username")},namespace:p,type:f,typeField:"version"})}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"media",fields:{height:(0,r.integerAttribute)("height"),width:(0,r.integerAttribute)("width")},namespace:i.NS_DATAFORM_MEDIA,path:"dataform.fields.media"},{aliases:[{multiple:!0,path:"dataform.fields.media.sources"}],element:"uri",fields:{mediaType:(0,r.attribute)("type"),uri:(0,r.text)()},namespace:i.NS_DATAFORM_MEDIA}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendMessage)({requestingAttention:(0,r.childBoolean)(i.NS_ATTENTION_0,"attention")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["iq.bits",{path:"message.bits",multiple:!0},{path:"presence.bits",multiple:!0},{path:"iq.jingle.bits",multiple:!0}],element:"data",fields:{cid:(0,r.attribute)("cid"),data:(0,r.textBuffer)("base64"),maxAge:(0,r.integerAttribute)("max-age"),mediaType:(0,r.attribute)("type")},namespace:i.NS_BOB};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_HASHES_2,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_1,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_2,"hash-used",[{path:"file.hashesUsed",multiple:!0}]),(0,r.addAlias)(i.NS_THUMBS_1,"thumbnail",[{path:"file.thumbnails",multiple:!0}])],o=0,s=[i.NS_JINGLE_FILE_TRANSFER_4,i.NS_JINGLE_FILE_TRANSFER_5];o<s.length;o++){var u=s[o];a=a.concat([{aliases:["file",{impliedType:!0,path:"iq.jingle.contents.application.file",selector:u},{impliedType:!0,path:"iq.jingle.info.file",selector:"{".concat(u,"}checksum")}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"file",fields:{date:(0,r.childDate)(null,"date"),description:(0,r.childText)(null,"desc"),mediaType:(0,r.childText)(null,"media-type"),name:(0,r.childText)(null,"name"),size:(0,r.childInteger)(null,"size")},namespace:u,type:u,typeField:"version"},{aliases:[{impliedType:!0,path:"file.range",selector:u}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"range",fields:{length:(0,r.integerAttribute)("length"),offset:(0,r.integerAttribute)("offset",0)},namespace:u,type:u,typeField:"version"},{element:"description",namespace:u,path:"iq.jingle.contents.application",type:u,typeField:"applicationType"},{element:"received",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}received"),typeField:"infoType"},{element:"checksum",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}checksum"),typeField:"infoType"}])}t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i={element:"description",namespace:r.NS_JINGLE_XML_0,path:"iq.jingle.contents.application",type:r.NS_JINGLE_XML_0,typeField:"applicationType"};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"transport",fields:{activated:(0,r.childAttribute)(null,"activated","cid"),address:(0,r.attribute)("dstaddr"),candidateError:(0,r.childBoolean)(null,"candidate-error"),candidateUsed:(0,r.childAttribute)(null,"candidate-used","cid"),mode:(0,r.attribute)("mode","tcp"),proxyError:(0,r.childBoolean)(null,"proxy-error"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_SOCKS5_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_SOCKS5_1,typeField:"transportType"},{aliases:[{multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_SOCKS5_1}],element:"candidate",fields:{cid:(0,r.attribute)("cid"),host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),priority:(0,r.integerAttribute)("priority"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_JINGLE_SOCKS5_1}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"transport",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){!1===t&&(0,r.attribute)("stanza").exporter(e,"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_IBB_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_IBB_1,typeField:"transportType"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_BOB,"data",[{path:"iq.jingle.bits",multiple:!0}]),{element:"thumbnail",fields:{height:(0,r.integerAttribute)("height"),mediaType:(0,r.attribute)("media-type"),uri:(0,r.attribute)("uri"),width:(0,r.integerAttribute)("width")},namespace:i.NS_THUMBS_1,path:"thumbnail"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_FORWARD_0,"forwarded",["message.carbon.forward"]),{element:"enable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"enable",typeField:"action"},{element:"disable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"disable",typeField:"action"},{element:"sent",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"sent",typeField:"type"},{element:"received",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"received",typeField:"type"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(18),o=n(2),s=[].concat(r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"message",["forward.message"])}))),r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"presence",["forward.presence"])}))),r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"iq",["forward.iq"])}))),[(0,i.addAlias)(o.NS_DELAY,"delay",["forward.delay"]),{aliases:["message.forward"],element:"forwarded",namespace:o.NS_FORWARD_0,path:"forward"}]);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{defaultType:"2",element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("base64"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hash",type:"2",typeField:"version"},{element:"hash-used",fields:{algorithm:(0,r.attribute)("algo"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hashUsed"},{element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("hex"),version:(0,r.staticValue)("1")},namespace:i.NS_HASHES_1,path:"hash",type:"1",typeField:"version"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"rtt",fields:{event:(0,r.attribute)("event","edit"),id:(0,r.attribute)("id"),seq:(0,r.integerAttribute)("seq")},namespace:i.NS_RTT_0,path:"message.rtt"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"t",fields:{position:(0,r.integerAttribute)("p"),text:(0,r.text)()},namespace:i.NS_RTT_0,type:"insert",typeField:"type"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"e",fields:{length:(0,r.integerAttribute)("n",1),position:(0,r.integerAttribute)("p")},namespace:i.NS_RTT_0,type:"erase",typeField:"type"},{aliases:[{multiple:!0,path:"message.rtt.actions"}],element:"w",fields:{duration:(0,r.integerAttribute)("n",0)},namespace:i.NS_RTT_0,type:"wait",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendMessage)({replace:(0,r.childAttribute)(i.NS_CORRECTION_0,"replace","id")})},function(e,t,n){"use strict";var r=n(13);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(5),a=n(2),o={2:a.NS_MAM_2,1:a.NS_MAM_1},s=[(0,i.addAlias)(a.NS_DATAFORM,"x",["iq.archive.form"]),(0,i.addAlias)(a.NS_FORWARD_0,"forwarded",["message.archive.item"]),(0,i.addAlias)(a.NS_RSM,"set",["iq.archive.paging"])],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],p=l[1];s.push({defaultType:"query",defaultVersion:"2",element:"query",fields:{node:(0,i.attribute)("node"),queryId:(0,i.attribute)("queryid")},namespace:p,path:"iq.archive",type:"query",typeField:"type",version:f,versionField:"version"},{element:"fin",fields:{complete:(0,i.booleanAttribute)("complete"),stable:(0,i.booleanAttribute)("stable")},namespace:p,path:"iq.archive",type:"result",version:f},{element:"prefs",fields:{default:(0,i.attribute)("default"),always:(0,i.deepMultipleChildText)([{namespace:null,element:"always"},{namespace:null,element:"jid"}]),never:(0,i.deepMultipleChildText)([{namespace:null,element:"never"},{namespace:null,element:"jid"}])},namespace:p,path:"iq.archive",type:"preferences",version:f},{element:"result",defaultType:"2",fields:{id:(0,i.attribute)("id"),queryId:(0,i.attribute)("queryid")},namespace:p,path:"message.archive",type:f,typeField:"version"})}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendPresence)({hats:(0,r.splicePath)(i.NS_HATS_0,"hats","hat",!0)}),{element:"hat",fields:{id:(0,r.attribute)("name"),name:(0,r.attribute)("displayName")},namespace:i.NS_HATS_0,path:"hat"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendPresence)({idleSince:(0,r.childDate)(i.NS_IDLE_1,"since")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_UDP_1},{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_0},{multiple:!0,path:"iq.jingle.contents.application.encryption.dtls",selector:i.NS_JINGLE_RTP_1}],element:"fingerprint",fields:{algorithm:(0,r.attribute)("hash"),setup:(0,r.attribute)("setup"),value:(0,r.text)()},namespace:i.NS_JINGLE_DTLS_0};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a="message.marker",o=[{element:"markable",namespace:i.NS_CHAT_MARKERS_0,path:a,type:"markable",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"received"},{element:"displayed",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"displayed"},{element:"acknowledged",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"acknowledged"}];t.default=o},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});var a=n(5),o=n(2);t.default=(0,a.extendMessage)({processingHints:{importer:function(e){var t,n={},i=!1,a=r(e.children);try{for(a.s();!(t=a.n()).done;){var s=t.value;if("string"!=typeof s&&s.getNamespace()===o.NS_HINTS)switch(s.getName()){case"no-copy":n.noCopy=!0,i=!0;break;case"no-permanent-store":n.noPermanentStore=!0,i=!0;break;case"no-store":n.noStore=!0,i=!0;break;case"store":n.store=!0,i=!0}}}catch(e){a.e(e)}finally{a.f()}return i?n:void 0},exporter:function(e,t,n){t.noCopy&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-copy",n.namespace,e)),t.noPermanentStore&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-permanent-store",n.namespace,e)),t.noStore&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-store",n.namespace,e)),t.store&&e.appendChild((0,a.createElement)(o.NS_HINTS,"store",n.namespace,e))}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({json:(0,r.childJSON)(i.NS_JSON_0,"json")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"json",fields:{json:(0,r.textJSON)()},namespace:i.NS_JSON_0,type:i.NS_JSON_0},{aliases:[{path:"message.jsonPayloads",multiple:!0}],element:"payload",fields:{type:(0,r.attribute)("datatype"),data:(0,r.childJSON)(i.NS_JSON_0,"json")},namespace:i.NS_JSON_MESSAGE_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:[{path:"iq.jingle.groups",multiple:!0}],element:"group",fields:{contents:(0,r.multipleChildAttribute)(null,"content","name"),semantics:(0,r.attribute)("semantics")},namespace:i.NS_JINGLE_GROUPING_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_UDP_1},{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_0}],element:"sctpmap",fields:{port:(0,r.integerAttribute)("number"),protocol:(0,r.attribute)("protocol"),streams:(0,r.attribute)("streams")},namespace:i.NS_JINGLE_DTLS_SCTP_1};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=[{element:"active",namespace:r.NS_CSI_0,path:"csi",type:"active",typeField:"state"},{element:"inactive",namespace:r.NS_CSI_0,path:"csi",type:"inactive",typeField:"state"}];t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.push.form","pushNotification.form"]),{element:"enable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"enable",typeField:"action"},{element:"disable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"disable",typeField:"action"},{aliases:(0,r.pubsubItemContentAliases)(),element:"notification",namespace:i.NS_PUSH_0,path:"pushNotification",type:i.NS_PUSH_0,typeField:"itemType"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({originId:(0,r.childAttribute)(i.NS_SID_0,"origin-id","id")}),{aliases:[{path:"message.stanzaIds",multiple:!0}],element:"stanza-id",fields:{by:(0,r.JIDAttribute)("by"),id:(0,r.attribute)("id")},namespace:i.NS_SID_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStanzaError)({httpUploadError:(0,r.childEnum)(i.NS_HTTP_UPLOAD_0,["file-too-large","retry"]),httpUploadMaxFileSize:(0,r.deepChildInteger)([{namespace:i.NS_HTTP_UPLOAD_0,element:"file-too-large"},{namespace:i.NS_HTTP_UPLOAD_0,element:"max-file-size"}]),httpUploadRetry:(0,r.childDateAttribute)(i.NS_HTTP_UPLOAD_0,"retry","stamp")}),{element:"request",fields:{mediaType:(0,r.attribute)("content-type"),name:(0,r.attribute)("filename"),size:(0,r.integerAttribute)("size")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"request",typeField:"type"},{element:"slot",fields:{download:(0,r.childAttribute)(null,"get","url")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"slot"},{aliases:[{path:"iq.httpUpload.upload",selector:"slot"}],element:"put",fields:{url:(0,r.attribute)("url")},namespace:i.NS_HTTP_UPLOAD_0},{aliases:[{path:"iq.httpUpload.upload.headers",multiple:!0}],element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_HTTP_UPLOAD_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"encryption",fields:{id:(0,r.attribute)("namespace"),name:(0,r.attribute)("name")},namespace:i.NS_EME_0,path:"message.encryptionMethod"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["message.omemo"],element:"encrypted",fields:{payload:(0,r.childTextBuffer)(null,"payload","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo"},{element:"header",fields:{iv:(0,r.childTextBuffer)(null,"iv","base64"),sid:(0,r.integerAttribute)("sid")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo.header"},{aliases:[{path:"omemo.header.keys",multiple:!0}],element:"key",fields:{preKey:(0,r.booleanAttribute)("prekey"),rid:(0,r.integerAttribute)("rid"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL},{aliases:(0,r.pubsubItemContentAliases)(),element:"list",fields:{devices:(0,r.multipleChildIntegerAttribute)(null,"device","id")},namespace:i.NS_OMEMO_AXOLOTL,type:i.NS_OMEMO_AXOLOTL_DEVICELIST,typeField:"itemType"},{element:"preKeyPublic",fields:{id:(0,r.integerAttribute)("preKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoPreKey"},{element:"signedPreKeyPublic",fields:{id:(0,r.integerAttribute)("signedPreKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice.signedPreKeyPublic"},{aliases:(0,r.pubsubItemContentAliases)(),element:"bundle",fields:{identityKey:(0,r.childTextBuffer)(null,"identityKey","base64"),preKeys:(0,r.splicePath)(null,"prekeys","omemoPreKey",!0),signedPreKeySignature:(0,r.childTextBuffer)(null,"signedPreKeySignature","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice",type:i.NS_OMEMO_AXOLOTL_BUNDLES,typeField:"itemType"}];t.default=a},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(e,i,a){var o;return r(this,n),(o=t.call(this)).condition=e,o.channelId=i,o.stanzaInstanceId=a,o.name="SaslError",o}return n}(s(Error));t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},i=n(51),a=n(29);t.a=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();var o=(e=e||{}).random||(e.rng||i.a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=o[s];return t}return Object(a.b)(o)}},function(e,t,n){var r=n(54);e.exports=function(e){var t={},n=!1;function i(t,i){return n=!0,i=new Promise((function(n){n(e[t](i))})),{done:!1,value:new r(i,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):i("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(236);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t);var r=n(70),i=n(66);for(var a in i)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);var o=n(60);for(var a in o)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);var s=n(200);for(var a in s)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(a);var u=n(33);for(var a in u)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(a);var c=n(69);for(var a in c)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(a);var l=n(45);n.d(t,"HttpClient",(function(){return l.HttpClient}));var f=n(26);n.d(t,"StreamingClientError",(function(){return f.StreamingClientError})),n.d(t,"parseJwt",(function(){return f.parseJwt})),t.default=r.Client},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default;function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new j(r||[]);return s(a,"_invoke",{value:I(e,n,o)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var v="suspendedStart",m="executing",g="completed",y={};function b(){}function _(){}function S(){}var w={};p(w,c,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(C([])));k&&k!==a&&o.call(k,c)&&(w=k);var O=S.prototype=b.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function I(e,n,r){var i=v;return function(a,o){if(i===m)throw new Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===v)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=h(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return _.prototype=S,s(O,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:_,configurable:!0}),_.displayName=p(S,f,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,f,"GeneratorFunction")),e.prototype=Object.create(O),e},n.awrap=function(e){return{__await:e}},T(A.prototype),p(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new A(d(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(O),p(O,f,"Generator"),p(O,c,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){t.RateLimiter=n(209),t.TokenBucket=n(77)},function(e,t,n){(function(t){var r=n(77),i=n(210),a=function(e,t,n){this.tokenBucket=new r(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=i(),this.tokensThisInterval=0,this.fireImmediately=n};a.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,n){if(e>this.tokenBucket.bucketSize)return t.nextTick(n.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,a=i();if((a<this.curIntervalStart||a-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=a,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)t.nextTick(n.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-a);setTimeout((function(){r.tokenBucket.removeTokens(e,s)}),o)}return!1}return this.tokenBucket.removeTokens(e,s);function s(t,i){if(t)return n(t,null);r.tokensThisInterval+=e,n(null,i)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=i();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},e.exports=a}).call(this,n(32))},function(e,t,n){(function(t){e.exports=function(){if(void 0!==t&&t.hrtime){var e=t.hrtime(),n=e[0],r=e[1];return 1e3*n+Math.floor(r/1e6)}return(new Date).getTime()}}).call(this,n(32))},function(e,t,n){var r=n(74);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=r(r({},i),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(215),i=n(219);t.DelayFactory=function(e,t){var n=function(e){if(!e.delayFirstAttempt)return new r.SkipFirstDelay(e);return new i.AlwaysDelay(e)}(e);return n.setAttemptNumber(t),n}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__awaiter||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())}))},o=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.apply=function(){return a(this,void 0,void 0,(function(){return o(this,(function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]}))}))},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(n(79).Delay);t.SkipFirstDelay=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(217),i=n(218);t.JitterFactory=function(e){switch(e.jitter){case"full":return r.fullJitter;case"none":default:return i.noJitter}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(79).Delay);t.AlwaysDelay=a},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(221),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(25))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,c={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[u]=i,r(u),u++},p.clearImmediate=d}function d(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(25),n(32))},function(e,t,n){"use strict";(function(e){
|
|
7
|
+
*/var r=n(6),i=n(7),a=n(24),o=n(16),s=n(17),u=n(14),c=n(11);function l(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)}}var f=n(244),p=n(245),d="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=v,t.SlowBuffer=function(e){+e!=e&&(e=0);return v.alloc(+e)},t.INSPECT_MAX_BYTES=50;function h(e){if(e>2147483647)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,v.prototype),t}function v(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return y(e)}return m(e,t,n)}function m(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!v.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|w(e,t),r=h(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(te(e,Uint8Array)){var t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return b(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e));if(te(e,ArrayBuffer)||e&&te(e.buffer,ArrayBuffer))return _(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(te(e,SharedArrayBuffer)||e&&te(e.buffer,SharedArrayBuffer)))return _(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return v.from(r,t,n);var i=function(e){if(v.isBuffer(e)){var t=0|S(e.length),n=h(t);return 0===n.length||e.copy(n,0,0,t),n}if(void 0!==e.length)return"number"!=typeof e.length||ne(e.length)?h(0):b(e);if("Buffer"===e.type&&Array.isArray(e.data))return b(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return v.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e))}function g(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function y(e){return g(e),h(e<0?0:0|S(e))}function b(e){for(var t=e.length<0?0:0|S(e.length),n=h(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function _(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,v.prototype),r}function S(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function w(e,t){if(v.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||te(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(e));var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(e).length;default:if(i)return r?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function x(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 D(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return P(this,t,n);case"latin1":case"binary":return M(this,t,n);case"base64":return j(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function k(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function O(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),ne(n=+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=v.from(t,r)),v.isBuffer(t))return 0===t.length?-1:T(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function T(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 A(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a,o=t.length;for(r>o/2&&(r=o/2),a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(ne(s))return a;e[n+a]=s}return a}function I(e,t,n,r){return ee($(t,e.length-n),e,n,r)}function E(e,t,n,r){return ee(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function N(e,t,n,r){return ee(Z(t),e,n,r)}function R(e,t,n,r){return ee(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 j(e,t,n){return 0===t&&n===e.length?f.fromByteArray(e):f.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var u=void 0,c=void 0,l=void 0,f=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(u=e[i+1]))&&(f=(31&a)<<6|63&u)>127&&(o=f);break;case 3:u=e[i+1],c=e[i+2],128==(192&u)&&128==(192&c)&&(f=(15&a)<<12|(63&u)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:u=e[i+1],c=e[i+2],l=e[i+3],128==(192&u)&&128==(192&c)&&128==(192&l)&&(f=(15&a)<<18|(63&u)<<12|(63&c)<<6|63&l)>65535&&f<1114112&&(o=f)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}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.kMaxLength=2147483647,v.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),v.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(v.prototype,"parent",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.buffer}}),Object.defineProperty(v.prototype,"offset",{enumerable:!0,get:function(){if(v.isBuffer(this))return this.byteOffset}}),v.poolSize=8192,v.from=function(e,t,n){return m(e,t,n)},Object.setPrototypeOf(v.prototype,Uint8Array.prototype),Object.setPrototypeOf(v,Uint8Array),v.alloc=function(e,t,n){return function(e,t,n){return g(e),e<=0?h(e):void 0!==t?"string"==typeof n?h(e).fill(t,n):h(e).fill(t):h(e)}(e,t,n)},v.allocUnsafe=function(e){return y(e)},v.allocUnsafeSlow=function(e){return y(e)},v.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==v.prototype},v.compare=function(e,t){if(te(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),te(t,Uint8Array)&&(t=v.from(t,t.offset,t.byteLength)),!v.isBuffer(e)||!v.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');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},v.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}},v.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return v.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=v.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(te(a,Uint8Array))i+a.length>r.length?(v.isBuffer(a)||(a=v.from(a)),a.copy(r,i)):Uint8Array.prototype.set.call(r,a,i);else{if(!v.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i)}i+=a.length}return r},v.byteLength=w,v.prototype._isBuffer=!0,v.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)k(this,t,t+1);return this},v.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)k(this,t,t+3),k(this,t+1,t+2);return this},v.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)k(this,t,t+7),k(this,t+1,t+6),k(this,t+2,t+5),k(this,t+3,t+4);return this},v.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?C(this,0,e):x.apply(this,arguments)},v.prototype.toLocaleString=v.prototype.toString,v.prototype.equals=function(e){if(!v.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===v.compare(this,e)},v.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},d&&(v.prototype[d]=v.prototype.inspect),v.prototype.compare=function(e,t,n,r,i){if(te(e,Uint8Array)&&(e=v.from(e,e.offset,e.byteLength)),!v.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(e));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),u=this.slice(r,i),l=e.slice(t,n),f=0;f<s;++f)if(u[f]!==l[f]){a=u[f],o=l[f];break}return a<o?-1:o<a?1:0},v.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},v.prototype.indexOf=function(e,t,n){return O(this,e,t,n,!0)},v.prototype.lastIndexOf=function(e,t,n){return O(this,e,t,n,!1)},v.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 A(this,e,t,n);case"utf8":case"utf-8":return I(this,e,t,n);case"ascii":case"latin1":case"binary":return E(this,e,t,n);case"base64":return N(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},v.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(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 M(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 D(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+=re[e[a]];return i}function L(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length-1;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function B(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 F(e,t,n,r,i,a){if(!v.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 q(e,t,n,r,i){Q(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function U(e,t,n,r,i){Q(t,r,i,e,n,7);var a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function z(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 J(e,t,n,r,i){return t=+t,n>>>=0,i||z(e,0,n,4),p.write(e,t,n,r,23,4),n+4}function G(e,t,n,r,i){return t=+t,n>>>=0,i||z(e,0,n,8),p.write(e,t,n,r,52,8),n+8}v.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,v.prototype),r},v.prototype.readUintLE=v.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},v.prototype.readUintBE=v.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},v.prototype.readUint8=v.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},v.prototype.readUint16LE=v.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},v.prototype.readUint16BE=v.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},v.prototype.readUint32LE=v.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},v.prototype.readUint32BE=v.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},v.prototype.readBigUInt64LE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+n*Math.pow(2,24);return BigInt(r)+(BigInt(i)<<BigInt(32))})),v.prototype.readBigUInt64BE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),v.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(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},v.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(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},v.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},v.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},v.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},v.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},v.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},v.prototype.readBigInt64LE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),v.prototype.readBigInt64BE=ie((function(e){K(e>>>=0,"offset");var t=this[e],n=this[e+7];void 0!==t&&void 0!==n||Y(e,this.length-8);var r=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+n)})),v.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),p.read(this,e,!0,23,4)},v.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),p.read(this,e,!1,23,4)},v.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),p.read(this,e,!0,52,8)},v.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),p.read(this,e,!1,52,8)},v.prototype.writeUintLE=v.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||F(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},v.prototype.writeUintBE=v.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||F(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},v.prototype.writeUint8=v.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,255,0),this[t]=255&e,t+1},v.prototype.writeUint16LE=v.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeUint16BE=v.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeUint32LE=v.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},v.prototype.writeUint32BE=v.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigUInt64LE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeBigUInt64BE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),v.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);F(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},v.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);F(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},v.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},v.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},v.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},v.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},v.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},v.prototype.writeBigInt64LE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeBigInt64BE=ie((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),v.prototype.writeFloatLE=function(e,t,n){return J(this,e,t,!0,n)},v.prototype.writeFloatBE=function(e,t,n){return J(this,e,t,!1,n)},v.prototype.writeDoubleLE=function(e,t,n){return G(this,e,t,!0,n)},v.prototype.writeDoubleBE=function(e,t,n){return G(this,e,t,!1,n)},v.prototype.copy=function(e,t,n,r){if(!v.isBuffer(e))throw new TypeError("argument should be a Buffer");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("Index out of range");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=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},v.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),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!v.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));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=v.isBuffer(e)?e:v.from(e,r),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var H={};function V(e,t,n){H[e]=function(n){o(u,n);var s=l(u);function u(){var n;return r(this,u),n=s.call(this),Object.defineProperty(a(n),"message",{value:t.apply(a(n),arguments),writable:!0,configurable:!0}),n.name="".concat(n.name," [").concat(e,"]"),n.stack,delete n.name,n}return i(u,[{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}},{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}}]),u}(n)}function W(e){for(var t="",n=e.length,r="-"===e[0]?1:0;n>=r+4;n-=3)t="_".concat(e.slice(n-3,n)).concat(t);return"".concat(e.slice(0,n)).concat(t)}function Q(e,t,n,r,i,a){if(e>n||e<t){var o,s="bigint"==typeof t?"n":"";throw o=a>3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(n).concat(s),new H.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,n){K(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||Y(t,e.length-(n+1))}(r,i,a)}function K(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,n){if(Math.floor(e)!==e)throw K(e,n),new H.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(n||"offset",">= ".concat(n?1:0," and <= ").concat(t),e)}V("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),V("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(c(t))}),TypeError),V("ERR_OUT_OF_RANGE",(function(e,t,n){var r='The value of "'.concat(e,'" is out of range.'),i=n;return Number.isInteger(n)&&Math.abs(n)>Math.pow(2,32)?i=W(String(n)):"bigint"==typeof n&&(i=String(n),(n>Math.pow(BigInt(2),BigInt(32))||n<-Math.pow(BigInt(2),BigInt(32)))&&(i=W(i)),i+="n"),r+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var X=/[^+/0-9A-Za-z-_]/g;function $(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 Z(e){return f.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ee(e,t,n,r){var i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function te(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!=e}var re=function(){for(var e=new Array(256),t=0;t<16;++t)for(var n=16*t,r=0;r<16;++r)e[n+r]="0123456789abcdef"[t]+"0123456789abcdef"[r];return e}();function ie(e){return"undefined"==typeof BigInt?ae:e}function ae(){throw new Error("BigInt not supported")}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(16),s=n(17),u=n(14),c=n(28);function l(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}),t.iceIsDifferent=t.getIcePwdFromSdp=t.getUfragFromSdp=t.calculatePayloadSize=t.parseJwt=t.retryPromise=t.isVideoJid=t.isSoftphoneJid=t.isScreenRecordingJid=t.isAcdJid=t.splitIntoIndividualTopics=t.delay=t.timeoutPromise=t.StreamingClientError=void 0;var f=n(34),p=n(80),d=n(33),h=function(e){o(n,e);var t=l(n);function n(e,r,i){var o,s;return a(this,n),s=r instanceof Error?r.message:r,o=t.call(this,s),r instanceof Error&&(o.name=r.name),o.type=null!=e?e:d.StreamingClientErrorTypes.generic,o.details=i,o}return n}(c(Error));t.StreamingClientError=h,t.timeoutPromise=function(e,t,n,r){return new Promise((function(i,a){var o=setTimeout((function(){var e=new p.TimeoutError("Timeout: ".concat(n));e.details=r,a(e)}),t);e((function(e){clearTimeout(o),i(e)}),a)}))},t.delay=function(e){return new Promise((function(t){setTimeout(t,e)}))},t.splitIntoIndividualTopics=function(e){var t=[];if(e.includes("?")){var n=e.split("?"),r=n[0],i=n[1]&&n[1].split("&");i&&i.length&&i.forEach((function(e){t.push("".concat(r,".").concat(e))}))}else t.push(e);return t};t.isAcdJid=function(e){return e.startsWith("acd-")&&!t.isSoftphoneJid(e)};t.isScreenRecordingJid=function(e){return e.startsWith("screenrecording-")&&!t.isSoftphoneJid(e)};t.isSoftphoneJid=function(e){return!!e&&!!e.match(/.*@.*gjoll.*/i)};t.isVideoJid=function(e){return!(!e||!e.match(/@conference/)||t.isAcdJid(e))},t.retryPromise=function(e,t){var n,a,o,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:15e3,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:console,l=!1,p=new Promise((function(f,p){s=function(){var l=i(r.mark((function i(){var l,f,p;return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e();case 3:l=r.sent,o(l),r.next=13;break;case 7:r.prev=7,r.t0=r.catch(0),f=u,p=t(r.t0),Number.isInteger(p)&&(f=p),!1!==p?(c.debug("Retrying promise",r.t0),n=setTimeout(s,f)):a(r.t0);case 13:case"end":return r.stop()}}),i,null,[[0,7]])})));return function(){return l.apply(this,arguments)}}(),o=function(e){clearTimeout(n),l=!0,f(e)},a=function(e){clearTimeout(n),l=!0,p(e)},s()}));return{promise:p,cancel:a,complete:o,_id:f.v4(),hasCompleted:function(){return l}}};function v(e){if(!e)return null;var t=e.match(/a=ice-ufrag:(\S+)/);return t?t[1]:null}function m(e){if(!e)return null;var t=e.match(/a=ice-pwd:(\S+)/);return t?t[1]:null}t.parseJwt=function(e){var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(n)},t.calculatePayloadSize=function(e){var t=JSON.stringify(e),n=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(n?n.length:0)},t.getUfragFromSdp=v,t.getIcePwdFromSdp=m,t.iceIsDifferent=function(e,t){return v(e)!==v(t)||m(e)!==m(t)}},function(e,t,n){"use strict";var r=n(3),i=n(11),a=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.reviveData=t.uuid=t.octetCompare=t.sleep=t.shuffle=t.promiseAny=t.timeoutPromise=void 0;for(var o=n(21),s=[],u=0;u<256;++u)s[u]=(u+256).toString(16).substr(1);function c(){return(c=a(r.mark((function e(t,n){var i,a,o,s=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=s.length>2&&void 0!==s[2]?s[2]:function(){},e.next=3,Promise.race([t,new Promise((function(e,t){a=setTimeout((function(){return t(i())}),n)}))]);case 3:return o=e.sent,clearTimeout(a),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(){return(l=a(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(t.map((function(e){return e.then((function(e){return Promise.reject(e)}),(function(e){return Promise.resolve(e)}))})));case 3:return n=e.sent,e.abrupt("return",Promise.reject(n));case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.resolve(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function f(){return(f=a(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){setTimeout((function(){return e()}),t)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.timeoutPromise=function(e,t){return c.apply(this,arguments)},t.promiseAny=function(e){return l.apply(this,arguments)},t.shuffle=function(e){for(var t=e.length;t>0;){var n=Math.floor(Math.random()*t),r=e[t-=1];e[t]=e[n],e[n]=r}return e},t.sleep=function(e){return f.apply(this,arguments)},t.octetCompare=function(e,t){var n="string"==typeof e?o.Buffer.from(e,"utf8"):e,r="string"==typeof t?o.Buffer.from(t,"utf8"):t;return n.compare(r)},t.uuid=function(){var e=(0,o.randomBytes)(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=0;return[s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],"-",s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[t++]],s[e[15]]].join("")};var p=new Set(["date","expires","httpUploadRetry","idleSince","published","since","stamp","timestamp","updated","utc"]),d=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)(?:Z|((\+|-)([\d|:]*)))?$/;t.reviveData=function(e,t){return p.has(e)&&t&&"string"==typeof t&&d.test(t)?new Date(t):t&&"object"===i(t)&&"Buffer"===t.type&&Array.isArray(t.data)?o.Buffer.from(t):t}},function(e,t,n){var r=n(14),i=n(53),a=n(230),o=n(231);function s(t){var n="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!a(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return o(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,s(t)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));for(var r=n(30),i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]}t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=o(e,t);if(!Object(r.a)(n))throw TypeError("Stringified UUID is invalid");return n}},function(e,t,n){"use strict";var r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;t.a=function(e){return"string"==typeof e&&r.test(e)}},function(e,t,n){"use strict";(function(e){var r=n(11),i=n.n(r),a=n(1),o=n(10),s=n(50);function u(e){return a.a.isPlainObject(e)||a.a.isArray(e)}function c(e){return a.a.endsWith(e,"[]")?e.slice(0,-2):e}function l(e,t,n){return e?e.concat(t).map((function(e,t){return e=c(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var f=a.a.toFlatObject(a.a,{},null,(function(e){return/^is[A-Z]/.test(e)}));t.a=function(t,n,r){if(!a.a.isObject(t))throw new TypeError("target must be an object");n=n||new(s.a||FormData);var p=(r=a.a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!a.a.isUndefined(t[e])}))).metaTokens,d=r.visitor||y,h=r.dots,v=r.indexes,m=(r.Blob||"undefined"!=typeof Blob&&Blob)&&a.a.isSpecCompliantForm(n);if(!a.a.isFunction(d))throw new TypeError("visitor must be a function");function g(t){if(null===t)return"";if(a.a.isDate(t))return t.toISOString();if(!m&&a.a.isBlob(t))throw new o.a("Blob is not supported. Use a Buffer instead.");return a.a.isArrayBuffer(t)||a.a.isTypedArray(t)?m&&"function"==typeof Blob?new Blob([t]):e.from(t):t}function y(e,t,r){var o=e;if(e&&!r&&"object"===i()(e))if(a.a.endsWith(t,"{}"))t=p?t:t.slice(0,-2),e=JSON.stringify(e);else if(a.a.isArray(e)&&function(e){return a.a.isArray(e)&&!e.some(u)}(e)||(a.a.isFileList(e)||a.a.endsWith(t,"[]"))&&(o=a.a.toArray(e)))return t=c(t),o.forEach((function(e,r){!a.a.isUndefined(e)&&null!==e&&n.append(!0===v?l([t],r,h):null===v?t:t+"[]",g(e))})),!1;return!!u(e)||(n.append(l(r,t,h),g(e)),!1)}var b=[],_=Object.assign(f,{defaultVisitor:y,convertValue:g,isVisitable:u});if(!a.a.isObject(t))throw new TypeError("data must be an object");return function e(t,r){if(!a.a.isUndefined(t)){if(-1!==b.indexOf(t))throw Error("Circular reference detected in "+r.join("."));b.push(t),a.a.forEach(t,(function(t,i){!0===(!(a.a.isUndefined(t)||null===t)&&d.call(n,t,a.a.isString(i)?i.trim():i,r,_))&&e(t,r?r.concat(i):[i])})),b.pop()}}(t),n}}).call(this,n(222).Buffer)},function(e,t){var n=e.exports={};function r(){}n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.prependListener=r,n.prependOnceListener=r,n.nextTick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return window.queueMicrotask((function(){return e.apply(void 0,n)}))},n.listeners=function(e){return[]},n.cwd=function(){return"/"},n.umask=function(){return 0},n.binding=function(e){throw new Error("process.binding is not supported")},n.chdir=function(e){throw new Error("process.chdir is not supported")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionTypes=t.StreamingClientErrorTypes=void 0,function(e){e.generic="generic",e.invalid_token="invalid_token"}(t.StreamingClientErrorTypes||(t.StreamingClientErrorTypes={})),function(e){e.softphone="softphone",e.collaborateVideo="collaborateVideo",e.acdScreenShare="screenShare",e.screenRecording="screenRecording",e.unknown="unknown"}(t.SessionTypes||(t.SessionTypes={}))},function(e,t,n){"use strict";n.r(t);var r,i,a=n(51),o=n(29),s=0,u=0;var c=function(e,t,n){var c=t&&n||0,l=t||new Array(16),f=(e=e||{}).node||r,p=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==p){var d=e.random||(e.rng||a.a)();null==f&&(f=r=[1|d[0],d[1],d[2],d[3],d[4],d[5]]),null==p&&(p=i=16383&(d[6]<<8|d[7]))}var h=void 0!==e.msecs?e.msecs:Date.now(),v=void 0!==e.nsecs?e.nsecs:u+1,m=h-s+(v-u)/1e4;if(m<0&&void 0===e.clockseq&&(p=p+1&16383),(m<0||h>s)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=h,u=v,i=p;var g=(1e4*(268435455&(h+=122192928e5))+v)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var y=h/4294967296*1e4&268435455;l[c++]=y>>>8&255,l[c++]=255&y,l[c++]=y>>>24&15|16,l[c++]=y>>>16&255,l[c++]=p>>>8|128,l[c++]=255&p;for(var b=0;b<6;++b)l[c+b]=f[b];return t||Object(o.b)(l)},l=n(30);var f=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=255&t,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=255&t,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=255&t,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=255&t,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=255&t,n};function p(e,t,n){function r(e,r,i,a){var s;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}(e)),"string"==typeof r&&(r=f(r)),16!==(null===(s=r)||void 0===s?void 0:s.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var u=new Uint8Array(16+e.length);if(u.set(r),u.set(e,r.length),(u=n(u))[6]=15&u[6]|t,u[8]=63&u[8]|128,i){a=a||0;for(var c=0;c<16;++c)i[a+c]=u[c];return i}return Object(o.b)(u)}try{r.name=e}catch(e){}return r.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",r.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",r}function d(e){return 14+(e+64>>>9<<4)+1}function h(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function v(e,t,n,r,i,a){return h((o=h(h(t,e),h(r,a)))<<(s=i)|o>>>32-s,n);var o,s}function m(e,t,n,r,i,a,o){return v(t&n|~t&r,e,t,i,a,o)}function g(e,t,n,r,i,a,o){return v(t&r|n&~r,e,t,i,a,o)}function y(e,t,n,r,i,a,o){return v(t^n^r,e,t,i,a,o)}function b(e,t,n,r,i,a,o){return v(n^(t|~r),e,t,i,a,o)}var _=p("v3",48,(function(e){if("string"==typeof e){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return function(e){for(var t=[],n=32*e.length,r=0;r<n;r+=8){var i=e[r>>5]>>>r%32&255,a=parseInt("0123456789abcdef".charAt(i>>>4&15)+"0123456789abcdef".charAt(15&i),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[d(t)-1]=t;for(var n=1732584193,r=-271733879,i=-1732584194,a=271733878,o=0;o<e.length;o+=16){var s=n,u=r,c=i,l=a;n=m(n,r,i,a,e[o],7,-680876936),a=m(a,n,r,i,e[o+1],12,-389564586),i=m(i,a,n,r,e[o+2],17,606105819),r=m(r,i,a,n,e[o+3],22,-1044525330),n=m(n,r,i,a,e[o+4],7,-176418897),a=m(a,n,r,i,e[o+5],12,1200080426),i=m(i,a,n,r,e[o+6],17,-1473231341),r=m(r,i,a,n,e[o+7],22,-45705983),n=m(n,r,i,a,e[o+8],7,1770035416),a=m(a,n,r,i,e[o+9],12,-1958414417),i=m(i,a,n,r,e[o+10],17,-42063),r=m(r,i,a,n,e[o+11],22,-1990404162),n=m(n,r,i,a,e[o+12],7,1804603682),a=m(a,n,r,i,e[o+13],12,-40341101),i=m(i,a,n,r,e[o+14],17,-1502002290),r=m(r,i,a,n,e[o+15],22,1236535329),n=g(n,r,i,a,e[o+1],5,-165796510),a=g(a,n,r,i,e[o+6],9,-1069501632),i=g(i,a,n,r,e[o+11],14,643717713),r=g(r,i,a,n,e[o],20,-373897302),n=g(n,r,i,a,e[o+5],5,-701558691),a=g(a,n,r,i,e[o+10],9,38016083),i=g(i,a,n,r,e[o+15],14,-660478335),r=g(r,i,a,n,e[o+4],20,-405537848),n=g(n,r,i,a,e[o+9],5,568446438),a=g(a,n,r,i,e[o+14],9,-1019803690),i=g(i,a,n,r,e[o+3],14,-187363961),r=g(r,i,a,n,e[o+8],20,1163531501),n=g(n,r,i,a,e[o+13],5,-1444681467),a=g(a,n,r,i,e[o+2],9,-51403784),i=g(i,a,n,r,e[o+7],14,1735328473),r=g(r,i,a,n,e[o+12],20,-1926607734),n=y(n,r,i,a,e[o+5],4,-378558),a=y(a,n,r,i,e[o+8],11,-2022574463),i=y(i,a,n,r,e[o+11],16,1839030562),r=y(r,i,a,n,e[o+14],23,-35309556),n=y(n,r,i,a,e[o+1],4,-1530992060),a=y(a,n,r,i,e[o+4],11,1272893353),i=y(i,a,n,r,e[o+7],16,-155497632),r=y(r,i,a,n,e[o+10],23,-1094730640),n=y(n,r,i,a,e[o+13],4,681279174),a=y(a,n,r,i,e[o],11,-358537222),i=y(i,a,n,r,e[o+3],16,-722521979),r=y(r,i,a,n,e[o+6],23,76029189),n=y(n,r,i,a,e[o+9],4,-640364487),a=y(a,n,r,i,e[o+12],11,-421815835),i=y(i,a,n,r,e[o+15],16,530742520),r=y(r,i,a,n,e[o+2],23,-995338651),n=b(n,r,i,a,e[o],6,-198630844),a=b(a,n,r,i,e[o+7],10,1126891415),i=b(i,a,n,r,e[o+14],15,-1416354905),r=b(r,i,a,n,e[o+5],21,-57434055),n=b(n,r,i,a,e[o+12],6,1700485571),a=b(a,n,r,i,e[o+3],10,-1894986606),i=b(i,a,n,r,e[o+10],15,-1051523),r=b(r,i,a,n,e[o+1],21,-2054922799),n=b(n,r,i,a,e[o+8],6,1873313359),a=b(a,n,r,i,e[o+15],10,-30611744),i=b(i,a,n,r,e[o+6],15,-1560198380),r=b(r,i,a,n,e[o+13],21,1309151649),n=b(n,r,i,a,e[o+4],6,-145523070),a=b(a,n,r,i,e[o+11],10,-1120210379),i=b(i,a,n,r,e[o+2],15,718787259),r=b(r,i,a,n,e[o+9],21,-343485551),n=h(n,s),r=h(r,u),i=h(i,c),a=h(a,l)}return[n,r,i,a]}(function(e){if(0===e.length)return[];for(var t=8*e.length,n=new Uint32Array(d(t)),r=0;r<t;r+=8)n[r>>5]|=(255&e[r/8])<<r%32;return n}(e),8*e.length))})),S=n(201);function w(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function x(e,t){return e<<t|e>>>32-t}var k=p("v5",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){var r=unescape(encodeURIComponent(e));e=[];for(var i=0;i<r.length;++i)e.push(r.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var a=e.length/4+2,o=Math.ceil(a/16),s=new Array(o),u=0;u<o;++u){for(var c=new Uint32Array(16),l=0;l<16;++l)c[l]=e[64*u+4*l]<<24|e[64*u+4*l+1]<<16|e[64*u+4*l+2]<<8|e[64*u+4*l+3];s[u]=c}s[o-1][14]=8*(e.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(e.length-1)&4294967295;for(var f=0;f<o;++f){for(var p=new Uint32Array(80),d=0;d<16;++d)p[d]=s[f][d];for(var h=16;h<80;++h)p[h]=x(p[h-3]^p[h-8]^p[h-14]^p[h-16],1);for(var v=n[0],m=n[1],g=n[2],y=n[3],b=n[4],_=0;_<80;++_){var S=Math.floor(_/20),k=x(v,5)+w(S,m,g,y)+b+t[S]+p[_]>>>0;b=y,y=g,g=x(m,30)>>>0,m=v,v=k}n[0]=n[0]+v>>>0,n[1]=n[1]+m>>>0,n[2]=n[2]+g>>>0,n[3]=n[3]+y>>>0,n[4]=n[4]+b>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}));var O=function(e){if(!Object(l.a)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};n.d(t,"v1",(function(){return c})),n.d(t,"v3",(function(){return _})),n.d(t,"v4",(function(){return S.a})),n.d(t,"v5",(function(){return k})),n.d(t,"NIL",(function(){return"00000000-0000-0000-0000-000000000000"})),n.d(t,"version",(function(){return O})),n.d(t,"validate",(function(){return l.a})),n.d(t,"stringify",(function(){return o.a})),n.d(t,"parse",(function(){return f}))},function(e,t,n){var r=n(54);e.exports=function(e){return new r(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return o})),n.d(t,"__assign",(function(){return s})),n.d(t,"__rest",(function(){return u})),n.d(t,"__decorate",(function(){return c})),n.d(t,"__param",(function(){return l})),n.d(t,"__metadata",(function(){return f})),n.d(t,"__awaiter",(function(){return p})),n.d(t,"__generator",(function(){return d})),n.d(t,"__exportStar",(function(){return h})),n.d(t,"__values",(function(){return v})),n.d(t,"__read",(function(){return m})),n.d(t,"__spread",(function(){return g})),n.d(t,"__spreadArrays",(function(){return y})),n.d(t,"__await",(function(){return b})),n.d(t,"__asyncGenerator",(function(){return _})),n.d(t,"__asyncDelegator",(function(){return S})),n.d(t,"__asyncValues",(function(){return w})),n.d(t,"__makeTemplateObject",(function(){return x})),n.d(t,"__importStar",(function(){return k})),n.d(t,"__importDefault",(function(){return O}));var r=n(11),i=n.n(r),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function u(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function c(e,t,n,r){var a,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":i()(Reflect))&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(a=e[u])&&(s=(o<3?a(s):o>3?a(t,n,s):a(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}function l(e,t){return function(n,r){t(n,r,e)}}function f(e,t){if("object"===("undefined"==typeof Reflect?"undefined":i()(Reflect))&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(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){e.done?i(e.value):new n((function(t){t(e.value)})).then(o,s)}u((r=r.apply(e,t||[])).next())}))}function d(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function h(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}function v(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function m(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(m(arguments[t]));return e}function y(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function _(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),a=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise((function(n,r){a.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{(n=i[e](t)).value instanceof b?Promise.resolve(n.value.v).then(u,c):l(a[0][2],n)}catch(e){l(a[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:b(e[r](t)),done:"return"===r}:i?i(t):t}:i}}function w(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=v(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,i,(t=e[n](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function k(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function O(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";var r=n(42),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var a=Object.create(n(39)),o=n(87),s=n(89);a.inherits(f,o);for(var u=i(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",p)}function p(){this.allowHalfOpen||this._writableState.ended||r.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,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(23),l=function(e){a(n,e);var t=u(n);function n(e,i){var a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"be";return r(this,n),(a=t.call(this))._block=c.Buffer.alloc(e),a._finalSize=i,a._blockSize=e,a._bigEndian="be"===o,a._len=0,a}return i(n,[{key:"_transform",value:function(e,t,n){var r=null;try{this.update(e,t)}catch(e){r=e}n(r)}},{key:"_flush",value:function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}},{key:"update",value:function(e,t){"string"==typeof e&&(t=t||"utf8",e=c.Buffer.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,a=this._len,o=0;o<i;){for(var s=a%r,u=Math.min(i-o,r-s),l=0;l<u;l++)n[s+l]=e[o+l];o+=u,(a+=u)%r==0&&this._update(n)}return this._len+=i,this}},{key:"digest",value:function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._bigEndian?(this._block.writeUInt32BE(0,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)):(this._block.writeUInt32LE(n,this._blockSize-8),this._block.writeUInt32LE(0,this._blockSize-4));else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._bigEndian?(this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)):(this._block.writeUInt32LE(r,this._blockSize-8),this._block.writeUInt32LE(i,this._blockSize-4))}this._update(this._block);var a=this._hash();return e?a.toString(e):a}},{key:"_update",value:function(e){throw new Error("_update must be implemented by subclass")}},{key:"_hash",value:function(){throw new Error("_update must be implemented by subclass")}}]),n}(n(58).Transform);t.default=l},function(e,t,n){"use strict";t.inherits=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}},function(e,t,n){"use strict";var r=n(13),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=n(41),c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];i(this,e),this.name=t,this.attributes=n,this.children=[],this.optionalNamespaces={};var a,s=o(r);try{for(s.s();!(a=s.n()).done;){var u=a.value;if("string"!=typeof u){var c=new e(u.name,u.attributes,u.children);c.parent=this,this.children.push(c)}else this.children.push(u)}}catch(e){s.e(e)}finally{s.f()}}return a(e,[{key:"getName",value:function(){return this.name.indexOf(":")>=0?this.name.substr(this.name.indexOf(":")+1):this.name}},{key:"getNamespace",value:function(){if(this.name.indexOf(":")>=0){var e=this.name.substr(0,this.name.indexOf(":"));return this.findNamespaceForPrefix(e)}return this.findNamespaceForPrefix()}},{key:"getNamespaceContext",value:function(){var e={};this.parent&&(e=this.parent.getNamespaceContext());for(var t=0,n=Object.entries(this.attributes);t<n.length;t++){var i=r(n[t],2),a=i[0],o=i[1];if(a.startsWith("xmlns:")){var s=a.substr(6);e[o]=s}}return e}},{key:"getDefaultNamespace",value:function(){return this.attributes.xmlns?this.attributes.xmlns:this.parent?this.parent.getDefaultNamespace():""}},{key:"getNamespaceRoot",value:function(e){if(this.parent){var t=this.parent.getNamespaceRoot(e);if(t)return t}for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];if(o.startsWith("xmlns:")&&s===e)return this}if(this.optionalNamespaces[e])return this}},{key:"getAttribute",value:function(e,t){if(!t)return this.attributes[e];var n=this.getNamespaceContext();return n[t]?this.attributes[[n[t],e].join(":")]:void 0}},{key:"getChild",value:function(e,t){return this.getChildren(e,t)[0]}},{key:"getChildren",value:function(e,t){var n,r=[],i=o(this.children);try{for(i.s();!(n=i.n()).done;){var a=n.value;"string"==typeof a||a.getName()!==e||t&&a.getNamespace()!==t||r.push(a)}}catch(e){i.e(e)}finally{i.f()}return r}},{key:"getText",value:function(){var e,t="",n=o(this.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;"string"==typeof r&&(t+=r)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:"appendChild",value:function(e){return this.children.push(e),"string"!=typeof e&&(e.parent=this),e}},{key:"setAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.attributes[e]=t||void 0,""===t&&n&&(this.attributes[e]=t)}},{key:"addOptionalNamespace",value:function(e,t){this.optionalNamespaces[t]=e}},{key:"useNamespace",value:function(e,t){return this.optionalNamespaces[t]&&(e=this.optionalNamespaces[t]),this.setAttribute("xmlns:".concat(e),t),e}},{key:"toJSON",value:function(){for(var e=this.children.map((function(e){return"string"==typeof e?e:e?e.toJSON():void 0})).filter((function(e){return!!e})),t={},n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];null!=s&&(t[o]=s)}return{attributes:t,children:e,name:this.name}}},{key:"toString",value:function(){var e=this.openTag(!0);if(this.children.length){var t,n=o(this.children);try{for(n.s();!(t=n.n()).done;){var r=t.value;"string"==typeof r?e+=(0,u.escapeXMLText)(r):r&&(e+=r.toString())}}catch(e){n.e(e)}finally{n.f()}e+=this.closeTag()}return e}},{key:"openTag",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t="";t+="<".concat(this.name);for(var n=0,i=Object.entries(this.attributes);n<i.length;n++){var a=r(i[n],2),o=a[0],s=a[1];void 0!==s&&(t+=" ".concat(o,'="').concat((0,u.escapeXML)(s.toString()),'"'))}return e&&0===this.children.length?t+="/>":t+=">",t}},{key:"closeTag",value:function(){return"</".concat(this.name,">")}},{key:"findNamespaceForPrefix",value:function(e){if(e){var t="xmlns:"+e;if(this.attributes[t])return this.attributes[t];if(this.parent)return this.parent.findNamespaceForPrefix(e)}else{if(this.attributes.xmlns)return this.attributes.xmlns;if(this.parent)return this.parent.findNamespaceForPrefix()}return""}}]),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.basicLanguageResolver=t.escapeXMLText=t.unescapeXML=t.escapeXML=void 0;var a=(0,n(15).__importDefault)(n(56)),o={'"':""","&":"&","'":"'","<":"<",">":">"},s={"&":"&","'":"'",">":">","<":"<",""":'"'},u=/&([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);/g,c=/&|<|>|"|'/g,l=/&|<|>/g;function f(e){return o[e]}t.escapeXML=function(e){return e.replace(c,f)},t.unescapeXML=function(e){return e.replace(u,(function(e){return function(e){if(s[e])return s[e];var t=e.startsWith("&#x"),n=parseInt(e.substring(t?3:2,e.length-1),t?16:10);if(9===n||10===n||13===n||32<=n&&n<=55295||57344<=n&&n<=65533||65536<=n&&n<=1114111)return String.fromCodePoint(n);throw a.default.restrictedXML("Prohibited entity: "+e)}(e)}))},t.escapeXMLText=function(e){return e.replace(l,f)},t.basicLanguageResolver=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=new Set(e.map((function(e){return e.toLowerCase()}))),o=r(n.map((function(e){return e.toLowerCase()})));try{for(o.s();!(t=o.n()).done;){var s=t.value;if("*"!==s)for(;s.length>0;){if(a.has(s))return s;(s=s.substring(0,s.lastIndexOf("-")).toLowerCase()).lastIndexOf("-")===s.length-2&&(s=s.substring(0,s.lastIndexOf("-")))}}}catch(e){o.e(e)}finally{o.f()}return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nextTick=void 0,t.nextTick=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];queueMicrotask((function(){return e.apply(void 0,n)}))}},function(e,t,n){var r=n(256);function i(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=i=Reflect.get.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=i=function(e,t,n){var i=r(e,t);if(i){var a=Object.getOwnPropertyDescriptor(i,t);return a.get?a.get.call(arguments.length<3?e:n):a.value}},e.exports.__esModule=!0,e.exports.default=e.exports),i.apply(this,arguments)}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},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.exportToSDP=t.importFromSDP=void 0;var a=(0,n(15).__importStar)(n(93));t.importFromSDP=function(e){var t=a.getMediaSections(e),n=a.getDescription(e),i={groups:[],media:[]};a.matchPrefix(n,"a=ice-lite").length>0&&(i.iceLite=!0);var o,s=r(a.matchPrefix(n,"a=group:"));try{for(s.s();!(o=s.n()).done;){var u=o.value.split(" "),c=u.shift().substr(8);i.groups.push({mids:u,semantics:c})}}catch(e){s.e(e)}finally{s.f()}var l,f=r(t);try{for(f.s();!(l=f.n()).done;){var p=l.value,d=a.getKind(p),h=a.isRejected(p),v=a.parseMLine(p),m={direction:a.getDirection(p,n),kind:d,mid:a.getMid(p),protocol:v.protocol};if(h||(m.iceParameters=a.getIceParameters(p,n),m.dtlsParameters=a.getDtlsParameters(p,n),m.setup=a.matchPrefix(p,"a=setup:")[0].substr(8),i.iceLite&&(m.iceParameters.iceLite=!0)),"audio"===d||"video"===d){m.rtpParameters=a.parseRtpParameters(p),m.rtpEncodingParameters=a.parseRtpEncodingParameters(p),m.rtcpParameters=a.parseRtcpParameters(p);var g=a.parseMsid(p);m.streams=g?[g]:[]}else"application"===d&&(m.sctp=a.parseSctpDescription(p));m.candidates=a.matchPrefix(p,"a=candidate:").map(a.parseCandidate),i.media.push(m)}}catch(e){f.e(e)}finally{f.f()}return i},t.exportToSDP=function(e){var t=[];t.push(a.writeSessionBoilerplate(e.sessionId,e.sessionVersion),"a=msid-semantic:WMS *\r\n"),(e.iceLite||e.media.filter((function(e){return e.iceParameters&&e.iceParameters.iceLite})).length>0)&&t.push("a=ice-lite\r\n");var n,i=r(e.groups||[]);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.push("a=group:".concat(o.semantics," ").concat(o.mids.join(" "),"\r\n"))}}catch(e){i.e(e)}finally{i.f()}var s,u=r(e.media||[]);try{for(u.s();!(s=u.n()).done;){var c=s.value,l=!(c.iceParameters&&c.dtlsParameters);if("application"===c.kind&&c.sctp)t.push(a.writeSctpDescription(c,c.sctp));else if(c.rtpParameters){var f=a.writeRtpDescription(c.kind,c.rtpParameters);l&&(f=f.replace("m=".concat(c.kind," 9 "),"m=".concat(c.kind," 0 "))),t.push(f),t.push("a=".concat(c.direction||"sendrecv","\r\n"));var p,d=r(c.streams||[]);try{for(d.s();!(p=d.n()).done;){var h=p.value;t.push("a=msid:".concat(h.stream," ").concat(h.track,"\r\n"))}}catch(e){d.e(e)}finally{d.f()}if(c.rtcpParameters&&(t.push(a.writeRtcpParameters(c.rtcpParameters)),c.rtcpParameters.cname&&c.rtpEncodingParameters&&c.rtpEncodingParameters[0].rtx)){var v=c.rtpEncodingParameters[0];t.push("a=ssrc-group:FID ".concat(v.ssrc," ").concat(v.rtx.ssrc,"\r\n")),t.push("a=ssrc:".concat(v.rtx.ssrc," cname:").concat(c.rtcpParameters.cname,"\r\n"))}}if(void 0!==c.mid&&t.push("a=mid:".concat(c.mid,"\r\n")),c.iceParameters&&t.push(a.writeIceParameters({usernameFragment:c.iceParameters.usernameFragment,password:c.iceParameters.password})),c.dtlsParameters&&c.setup&&t.push(a.writeDtlsParameters(c.dtlsParameters,c.setup)),c.candidates&&c.candidates.length){var m,g=r(c.candidates);try{for(g.s();!(m=g.n()).done;){var y=m.value;t.push("a=".concat(a.writeCandidate(y),"\r\n"))}}catch(e){g.e(e)}finally{g.f()}}}}catch(e){u.e(e)}finally{u.f()}return t.join("")}},function(e,t,n){"use strict";var r=n(4),i=n(6),a=n(7);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.HttpClient=void 0;var u=n(36).__importStar(n(96)),c=n(26),l=function(){function e(t){i(this,e),this._httpRetryingRequests=new Map,this.customHeaders=null==t?void 0:t.customHeaders}return a(e,[{key:"requestApiWithRetry",value:function(t,n,r){var i=this,a=c.retryPromise(this.requestApi.bind(this,t,n),(function(t){var r,i,a,o=!1;if(null==t?void 0:t.response){o=e.retryStatusCodes.has(t.response.status||0);var s=(null===(r=t.response.headers)||void 0===r?void 0:r["retry-after"])||(null===(a=(i=t.response).getResponseHeader)||void 0===a?void 0:a.call(i,"retry-after"));s&&((n.logger||console).debug("retry-after header found on response. setting retry delay",{retryAfter:s}),o=1e3*parseInt(s,10))}return o}),r,n.logger);return this._httpRetryingRequests.set(a._id,a),a.promise.then((function(){return i.cancelRetryRequest(a._id)}),(function(){return i.cancelRetryRequest(a._id)})),a}},{key:"requestApi",value:function(e,t){var n=t.logger||console,r=(new Date).getTime();t.customHeaders=s(s({},this.customHeaders||{}),t.customHeaders||{});var i=this._buildUri(t.host,e,t.version),a=s({"content-type":t.contentType||"application/json"},t.customHeaders),o={method:t.method,url:i,data:t.data,responseType:t.responseType,timeout:t.requestTimeout||3e4,headers:a};t.noAuthHeader||(o.headers.Authorization="Bearer ".concat(t.authToken));var c=this.handleResponse.bind(this,n,r,o);return u.default(o).then(c,c)}},{key:"handleResponse",value:function(e,t,n,r){var i,a,o,c=(new Date).getTime(),l=c-t+"ms";if(r instanceof u.AxiosError){if((null===(a=null===(i=r.config)||void 0===i?void 0:i.headers)||void 0===a?void 0:a.Authorization)&&(r.config.headers.Authorization="redacted"),"ECONNABORTED"===r.code)return e.debug("request error: ".concat(n.url),{message:r.message,now:c,elapsed:l},{skipServer:!0}),Promise.reject(r);var f=r.response||{},p=f.status,d=f.headers&&f.headers["inin-correlation-id"],h=f.data,v=s(s({},r),{},{text:null===(o=f.request)||void 0===o?void 0:o.response});return e.debug("request error: ".concat(n.url),{message:r.message,now:c,elapsed:l,status:p,correlationId:d,body:h},{skipServer:!0}),Promise.reject(v)}var m=r.status,g=r.headers["inin-correlation-id"],y=JSON.stringify(r.data);return e.debug("response: ".concat(n.method.toUpperCase()," ").concat(n.url),{now:c,status:m,elapsed:l,correlationId:g,body:y},{skipServer:!0}),Promise.resolve(r)}},{key:"stopAllRetries",value:function(){var e=this;Array.from(this._httpRetryingRequests.keys()).forEach((function(t){return e.cancelRetryRequest(t)}))}},{key:"cancelRetryRequest",value:function(e){var t=this._httpRetryingRequests.get(e);return t&&(t.cancel(new Error("Retry request cancelled")),this._httpRetryingRequests.delete(e)),!0}},{key:"formatRequestError",value:function(e){if(this.isSuperagentNetworkError(e))return{status:e.status,method:e.method,url:e.url,crossDomain:e.crossDomain,message:e.message,name:e.name,stack:e.stack};if(this.isSuperagentResponseError(e)){var t=e.response;return{status:e.status,correlationId:t.headers["inin-correlation-id"],message:"Error making HTTP request",method:t.req.method,name:t.error.name,stack:t.error.stack}}return e}},{key:"isSuperagentNetworkError",value:function(e){return e&&e.hasOwnProperty("status")&&e.hasOwnProperty("method")&&e.hasOwnProperty("url")}},{key:"isSuperagentResponseError",value:function(e){return!!(e&&e.response&&e.response.body&&e.response.req)}},{key:"_buildUri",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"v2";return t=t.replace(/^\/+|\/+$/g,""),0===e.indexOf("http")?"".concat(e,"/api/").concat(n,"/").concat(t):"https://api.".concat(e,"/api/").concat(n,"/").concat(t)}}]),e}();t.HttpClient=l,l.retryStatusCodes=new Set([408,413,429,500,502,503,504])},function(e,t,n){var r=n(73),i=n(78),a=n(52),o=n(75);e.exports=function(e){return r(e)||i(e)||a(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11),i=Object.prototype.hasOwnProperty;function a(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(n){if(null===n||"object"!==r(n))return n;if(-1!==t.indexOf(n))return"[Circular]";if(t.push(n),"function"==typeof n.toJSON)try{var o=e(n.toJSON());return t.pop(),o}catch(e){return a(e)}if(Array.isArray(n)){var s=n.map(e);return t.pop(),s}var u=Object.keys(n).reduce((function(t,r){return t[r]=e(function(e,t){if(i.call(e,t))try{return e[t]}catch(e){return a(e)}return e[t]}(n,r)),t}),{});return t.pop(),u}(e)}e.exports=function(e,t,n){return JSON.stringify(o(e),t,n)},e.exports.ensureProperties=o},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){return function(){return e.apply(t,arguments)}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=null},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return a}));var i=new Uint8Array(16);function a(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(i)}},function(e,t,n){var r=n(74);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,n(t,r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(e,r){var i,a=n(11);!function(o){var s="object"==a(t)&&t&&!t.nodeType&&t,u="object"==a(e)&&e&&!e.nodeType&&e,c="object"==(void 0===r?"undefined":a(r))&&r;c.global!==c&&c.window!==c&&c.self!==c||(o=c);var l,f,p=2147483647,d=/^xn--/,h=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,y=String.fromCharCode;function b(e){throw new RangeError(m[e])}function _(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+_((e=e.replace(v,".")).split("."),t).join(".")}function w(e){for(var t,n,r=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function x(e){return _(e,(function(e){var t="";return e>65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=y(e)})).join("")}function k(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,n){var r=0;for(e=n?g(e/700):e>>1,e+=g(e/t);e>455;r+=36)e=g(e/35);return g(r+36*e/(e+38))}function T(e){var t,n,r,i,a,o,s,u,c,l,f,d=[],h=e.length,v=0,m=128,y=72;for((n=e.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)e.charCodeAt(r)>=128&&b("not-basic"),d.push(e.charCodeAt(r));for(i=n>0?n+1:0;i<h;){for(a=v,o=1,s=36;i>=h&&b("invalid-input"),((u=(f=e.charCodeAt(i++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:36)>=36||u>g((p-v)/o))&&b("overflow"),v+=u*o,!(u<(c=s<=y?1:s>=y+26?26:s-y));s+=36)o>g(p/(l=36-c))&&b("overflow"),o*=l;y=O(v-a,t=d.length+1,0==a),g(v/t)>p-m&&b("overflow"),m+=g(v/t),v%=t,d.splice(v++,0,m)}return x(d)}function A(e){var t,n,r,i,a,o,s,u,c,l,f,d,h,v,m,_=[];for(d=(e=w(e)).length,t=128,n=0,a=72,o=0;o<d;++o)(f=e[o])<128&&_.push(y(f));for(r=i=_.length,i&&_.push("-");r<d;){for(s=p,o=0;o<d;++o)(f=e[o])>=t&&f<s&&(s=f);for(s-t>g((p-n)/(h=r+1))&&b("overflow"),n+=(s-t)*h,t=s,o=0;o<d;++o)if((f=e[o])<t&&++n>p&&b("overflow"),f==t){for(u=n,c=36;!(u<(l=c<=a?1:c>=a+26?26:c-a));c+=36)m=u-l,v=36-l,_.push(y(k(l+m%v,0))),u=g(m/v);_.push(y(k(u,0))),a=O(n,h,r==i),n=0,++r}++n,++t}return _.join("")}if(l={version:"1.4.1",ucs2:{decode:w,encode:x},decode:T,encode:A,toASCII:function(e){return S(e,(function(e){return h.test(e)?"xn--"+A(e):e}))},toUnicode:function(e){return S(e,(function(e){return d.test(e)?T(e.slice(4).toLowerCase()):e}))}},"object"==a(n(82))&&n(82))void 0===(i=function(){return l}.call(t,n,t,e))||(e.exports=i);else if(s&&u)if(e.exports==s)u.exports=l;else for(f in l)l.hasOwnProperty(f)&&(s[f]=l[f]);else o.punycode=l}(this)}).call(this,n(81)(e),n(25))},function(e,t,n){"use strict";var r,i=n(6),a=n(7),o=n(16),s=n(17),u=n(14),c=n(28);function l(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}),t.JXTErrorCondition=void 0,function(e){e.NotWellFormed="not-well-formed",e.RestrictedXML="restricted-xml",e.AlreadyClosed="already-closed",e.UnknownRoot="unknown-stream-root"}(r=t.JXTErrorCondition||(t.JXTErrorCondition={}));var f=function(e){o(n,e);var t=l(n);function n(e){var r;return i(this,n),(r=t.call(this,e.text)).isJXTError=!0,r.condition=e.condition,r.text=e.text,r}return a(n,null,[{key:"notWellFormed",value:function(e){return new n({condition:r.NotWellFormed,text:e})}},{key:"restrictedXML",value:function(e){return new n({condition:r.RestrictedXML,text:e})}},{key:"alreadyClosed",value:function(e){return new n({condition:r.AlreadyClosed,text:e})}},{key:"unknownRoot",value:function(e){return new n({condition:r.UnknownRoot,text:e})}}]),n}(c(Error));t.default=f},function(e,t,n){"use strict";var r=n(13),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,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 u(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 u(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 u(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.childAlternateLanguageRawElement=t.childLanguageRawElement=t.childRawElement=t.staticValue=t.splicePath=t.multipleChildEnum=t.multipleChildAlternateLanguageText=t.childAlternateLanguageText=t.multipleChildIntegerAttribute=t.multipleChildAttribute=t.multipleChildText=t.childDoubleEnum=t.childEnum=t.deepMultipleChildText=t.deepChildBoolean=t.deepChildInteger=t.deepChildText=t.childBoolean=t.childTimezoneOffset=t.childJSON=t.childFloat=t.childInteger=t.childDate=t.childTextBuffer=t.childText=t.childLanguageAttribute=t.languageAttribute=t.textBuffer=t.textJSON=t.text=t.childDateAttribute=t.childFloatAttribute=t.childIntegerAttribute=t.childBooleanAttribute=t.childAttribute=t.namespacedDateAttribute=t.namespacedFloatAttribute=t.namespacedIntegerAttribute=t.namespacedBooleanAttribute=t.namespacedAttribute=t.dateAttribute=t.floatAttribute=t.integerAttribute=t.booleanAttribute=t.attribute=t.findOrCreate=t.findAll=t.getTargetLang=t.getLang=t.createElement=void 0,t.parameterMap=void 0;var c=n(15),l=n(21),f=(0,c.__importDefault)(n(40)),p=n(59);function d(e,t,n,r){if(r){e=e||r.getNamespace();var i=r.getNamespaceRoot(e);if(i){var a=i.useNamespace("",e);t="".concat(a,":").concat(t)}}var o=new f.default(t);return t.indexOf(":")<0&&(!n||e!==n)&&o.setAttribute("xmlns",e),o}function h(e,t){return(e.getAttribute("xml:lang")||t||"").toLowerCase()}function v(e,t){var n,r=[],i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;r.push(h(a,t.lang))}}catch(e){i.e(e)}finally{i.f()}return(t.resolveLanguage?t.resolveLanguage(r,t.acceptLanguages||[],t.lang):t.lang)||""}function m(e,t,n,r){var i=e.getChildren(n,t),a=h(e);return i.length?r?i.filter((function(e){if(h(e,a)===r)return!0})):i:[]}function g(e,t,n,r){t=t||e.getNamespace();var i=m(e,t,n,r);if(i.length)return i[0];var a=d(t,n,e.getDefaultNamespace(),e),o=h(e,r);return r&&o!==r&&a.setAttribute("xml:lang",r),e.appendChild(a),a}function y(e){return{importer:function(t){var n=t.getAttribute(e.name,e.namespace);return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);if(r||e.emitEmpty)if(e.namespace&&e.prefix){var i,a=t.getNamespaceRoot(e.namespace);if(a)i=a.useNamespace(e.prefix,e.namespace);else{var o=t.getNamespaceContext();o[e.namespace]||(i=t.useNamespace(e.prefix,e.namespace),o[e.namespace]=i)}t.setAttribute("".concat(i,":").concat(e.name),r,e.emitEmpty)}else t.setAttribute(e.name,r,e.emitEmpty)}}}}function b(e,t){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i=o({staticDefault:r},i),y(o(o({name:n},e),t?t(i):i))}}function _(e,t){return function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return s=o({staticDefault:a},s),y(o(o({name:i,namespace:r,prefix:n},e),t?t(s):s))}}function S(e){var t=e.converter||y(o(o({},e),{},{namespace:e.attributeNamespace}));return{importer:function(n,r){var i=n.getChild(e.element,e.namespace||n.getNamespace());return i?t.importer(i,r):e.dynamicDefault?e.dynamicDefault():e.staticDefault},exporter:function(n,r,i){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element);t.exporter(a,r,i)}}}}function w(e,t){return function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return s=o({staticDefault:a},s),S(o(o({element:r,name:i,namespace:n},e),t?t(s):s))}}function x(e){return{importer:function(t){var n=t.getText();return n?e.parseValue(n):e.dynamicDefault?e.dynamicDefault(n):e.staticDefault},exporter:function(t,n){if(n||!e.emitEmpty){if(void 0!==n&&n!==e.staticDefault){var r=e.writeValue(n);r&&t.children.push(r)}}else t.children.push("")}}}function k(e){var t=x(e);return{importer:function(n,r){var i=m(n,e.namespace||n.getNamespace(),e.element),a=v(i,r);if(!i.length)return e.dynamicDefault?e.dynamicDefault():e.staticDefault;if(e.matchLanguage){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value;if(h(c,r.lang)===a)return t.importer(c,r)}}catch(e){u.e(e)}finally{u.f()}}return t.importer(i[0],r)},exporter:function(n,r,i){if(r||!e.emitEmpty){if(void 0!==r&&r!==e.staticDefault){var a=g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0);t.exporter(a,r,i)}}else g(n,e.namespace||n.getNamespace(),e.element,e.matchLanguage?i.lang:void 0)}}}t.createElement=d,t.getLang=h,t.getTargetLang=v,t.findAll=m,t.findOrCreate=g;var O={parseValue:function(e){return e},writeValue:function(e){return e}},T={parseValue:function(e){return parseInt(e,10)},writeValue:function(e){return e.toString()}},A={parseValue:function(e){return parseFloat(e)},writeValue:function(e){return e.toString()}},I={parseValue:function(e){return"true"===e||"1"===e||"false"!==e&&"0"!==e&&void 0},writeValue:function(e){return e?"1":"0"}},E={parseValue:function(e){return new Date(e)},writeValue:function(e){return"string"==typeof e?e:e.toISOString()}},N={parseValue:function(e){return JSON.parse(e)},writeValue:function(e){return JSON.stringify(e)}},R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return{parseValue:function(t){return"base64"===e&&"="===t&&(t=""),l.Buffer.from(t.trim(),e)},writeValue:function(t){var n;return n="string"==typeof t?l.Buffer.from(t).toString(e):t?t.toString(e):"","base64"===e&&(n=n||"="),n}}},j={parseValue:function(e){var t=-1;"-"===e.charAt(0)&&(t=1,e=e.slice(1));var n=e.split(":");return(60*parseInt(n[0],10)+parseInt(n[1],10))*t},writeValue:function(e){if("string"==typeof e)return e;var t="-";e<0&&(e=-e,t="+");var n=e/60,r=e%60;return t+=(n<10?"0":"")+n+":"+(r<10?"0":"")+r}};t.attribute=b(O,(function(e){return o({dynamicDefault:e.emitEmpty?function(t){return""===t?"":e.staticDefault}:void 0},e)})),t.booleanAttribute=b(I),t.integerAttribute=b(T),t.floatAttribute=b(A),t.dateAttribute=b(E),t.namespacedAttribute=_(O),t.namespacedBooleanAttribute=_(I),t.namespacedIntegerAttribute=_(T),t.namespacedFloatAttribute=_(A),t.namespacedDateAttribute=_(E),t.childAttribute=w(O),t.childBooleanAttribute=w(I),t.childIntegerAttribute=w(T),t.childFloatAttribute=w(A),t.childDateAttribute=w(E);t.text=function(e){return x(o({staticDefault:e},O))};t.textJSON=function(){return x(o({},N))};function C(){return{importer:function(e,t){return h(e,t.lang)},exporter:function(e,t,n){t&&t.toLowerCase()!==n.lang?e.setAttribute("xml:lang",t):e.setAttribute("xml:lang",void 0)}}}t.textBuffer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"utf8";return x(o({},R(e)))},t.languageAttribute=C;t.childLanguageAttribute=function(e,t){return S(o({converter:C(),element:t,name:"xml:lang",namespace:e},O))};t.childText=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return k(o({element:t,emitEmpty:r,matchLanguage:!0,namespace:e,staticDefault:n},O))};t.childTextBuffer=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"utf8";return k(o({element:t,matchLanguage:!0,namespace:e},R(n)))};t.childDate=function(e,t){return k(o({element:t,namespace:e},E))};t.childInteger=function(e,t,n){return k(o({element:t,namespace:e,staticDefault:n},T))};t.childFloat=function(e,t,n){return k(o({element:t,namespace:e,staticDefault:n},A))};t.childJSON=function(e,t){return k(o({element:t,namespace:e},N))},t.childTimezoneOffset=function(e,t){return k(o({element:t,namespace:e,staticDefault:0},j))},t.childBoolean=function(e,t){return{importer:function(n){if(n.getChild(t,e||n.getNamespace()))return!0},exporter:function(n,r){r&&g(n,e||n.getNamespace(),t)}}};var P=function(e,t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}i.children.push(n.toString())}};t.deepChildText=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return t}}catch(e){a.e(e)}finally{a.f()}return i.getText()||t},exporter:function(t,n){P(e,t,n)}}},t.deepChildInteger=function(e,t){return{importer:function(n){var r,i=n,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!(i=i.getChild(o.element,o.namespace||i.getNamespace())))return}}catch(e){a.e(e)}finally{a.f()}var u=i.getText();return u?parseInt(u,10):t||void 0},exporter:function(t,n){P(e,t,n)}}},t.deepChildBoolean=function(e){return{importer:function(t){var n,r=t,i=s(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(!(r=r.getChild(a.element,a.namespace||r.getNamespace())))return!1}}catch(e){i.e(e)}finally{i.f()}return!0},exporter:function(t,n){if(n){var r,i=t,a=s(e);try{for(a.s();!(r=a.n()).done;){var o=r.value;i=g(i,o.namespace||i.getNamespace(),o.element)}}catch(e){a.e(e)}finally{a.f()}}}}},t.deepMultipleChildText=function(e){var t=e.pop();return{importer:function(n,r){var i,a=n,o=s(e);try{for(o.s();!(i=o.n()).done;){var u=i.value;if(!(a=a.getChild(u.element,u.namespace||a.getNamespace())))return[]}}catch(e){o.e(e)}finally{o.f()}var c,l=[],f=m(a,t.namespace||a.getNamespace(),t.element),p=v(f,r),d=s(f);try{for(d.s();!(c=d.n()).done;){var g=c.value;h(g,r.lang)===p&&l.push(g.getText())}}catch(e){d.e(e)}finally{d.f()}return l},exporter:function(n,r,i){if(r.length){var a,o=n,u=s(e);try{for(u.s();!(a=u.n()).done;){var c=a.value;o=g(o,c.namespace||o.getNamespace(),c.element)}}catch(e){u.e(e)}finally{u.f()}var l,f=t.namespace,p=t.element,h=s(r);try{for(h.s();!(l=h.n()).done;){var v=l.value,m=d(f||o.getNamespace(),p,i.namespace,o);m.children.push(v),o.appendChild(m)}}catch(e){h.e(e)}finally{h.f()}}}}},t.childEnum=function(e,t,n){var r,i=new Map,a=new Map,o=s(t);try{for(o.s();!(r=o.n()).done;){var u=r.value;"string"==typeof u?(i.set(u,u),a.set(u,u)):(i.set(u[1],u[0]),a.set(u[0],u[1]))}}catch(e){o.e(e)}finally{o.f()}return{importer:function(t){var r,a=s(t.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;if("string"!=typeof o&&(o.getNamespace()===(e||t.getNamespace())&&i.has(o.getName())))return i.get(o.getName())}}catch(e){a.e(e)}finally{a.f()}return n},exporter:function(t,n){a.has(n)&&g(t,e,a.get(n))}}},t.childDoubleEnum=function(e,t,n,r){var i=new Set(t),a=new Set(n);return{importer:function(t){var n,o=s(t.children);try{for(o.s();!(n=o.n()).done;){var u=n.value;if("string"!=typeof u&&(u.getNamespace()===(e||t.getNamespace())&&i.has(u.getName()))){var c,l=s(u.children);try{for(l.s();!(c=l.n()).done;){var f=c.value;if("string"!=typeof f&&(f.getNamespace()===(e||t.getNamespace())&&a.has(f.getName())))return[u.getName(),f.getName()]}}catch(e){l.e(e)}finally{l.f()}return[u.getName()]}}}catch(e){o.e(e)}finally{o.f()}return r},exporter:function(t,n){var r=g(t,e,n[0]);n[1]&&g(r,e,n[1])}}},t.multipleChildText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=v(o,r),c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value;h(l,r.lang)===u&&a.push(l.getText())}}catch(e){c.e(e)}finally{c.f()}return a},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=d(e||n.getNamespace(),t,i.namespace,n);c.children.push(u),n.appendChild(c)}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(u)}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=d(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.multipleChildIntegerAttribute=function(e,t,n){return{importer:function(r){var i,a=[],o=s(r.getChildren(t,e||r.getNamespace()));try{for(o.s();!(i=o.n()).done;){var u=i.value.getAttribute(n);void 0!==u&&a.push(parseInt(u,10))}}catch(e){o.e(e)}finally{o.f()}return a},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=d(e||r.getNamespace(),t,a.namespace,r);l.setAttribute(n,c.toString()),r.appendChild(l)}}catch(e){u.e(e)}finally{u.f()}}}},t.childAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=m(n,e||n.getNamespace(),t),u=new Set,c=s(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var p=h(l,r.lang);if(u.has(p))continue;a.push({lang:p,value:f}),u.add(p)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u=a.value,c=u.value;if(c){var l=d(e||n.getNamespace(),t,i.namespace,n);u.lang!==i.lang&&l.setAttribute("xml:lang",u.lang),l.children.push(c),n.appendChild(l)}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildAlternateLanguageText=function(e,t){return{importer:function(n,r){var i,a=[],o=new Map,u=!1,c=s(m(n,e||n.getNamespace(),t));try{for(c.s();!(i=c.n()).done;){var l=i.value,f=l.getText();if(f){var p=h(l,r.lang),d=o.get(p);d||(d=[],o.set(p,d),a.push({lang:p,value:d})),d.push(f),u=!0}}}catch(e){c.e(e)}finally{c.f()}return u?a:void 0},exporter:function(n,r,i){var a,o=s(r);try{for(o.s();!(a=o.n()).done;){var u,c=a.value,l=s(c.value);try{for(l.s();!(u=l.n()).done;){var f=u.value,p=d(e||n.getNamespace(),t,i.namespace,n);c.lang!==i.lang&&p.setAttribute("xml:lang",c.lang),p.children.push(f),n.appendChild(p)}}catch(e){l.e(e)}finally{l.f()}}}catch(e){o.e(e)}finally{o.f()}}}},t.multipleChildEnum=function(e,t){var n,r=new Map,i=new Map,a=s(t);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"==typeof o?(r.set(o,o),i.set(o,o)):(r.set(o[1],o[0]),i.set(o[0],o[1]))}}catch(e){a.e(e)}finally{a.f()}return{importer:function(t){var n,i=[],a=s(t.children);try{for(a.s();!(n=a.n()).done;){var o=n.value;"string"!=typeof o&&(o.getNamespace()===(e||t.getNamespace())&&r.has(o.getName())&&i.push(r.get(o.getName())))}}catch(e){a.e(e)}finally{a.f()}return i},exporter:function(t,n){var r,a=s(n);try{for(a.s();!(r=a.n()).done;){var o=r.value;g(t,e,i.get(o))}}catch(e){a.e(e)}finally{a.f()}}}},t.splicePath=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return{importer:function(i,a){var o=i.getChild(t,e||i.getNamespace());if(o){var u,c=[],l=s(o.children);try{for(l.s();!(u=l.n()).done;){var f=u.value;if("string"!=typeof f&&a.registry.getImportKey(f)===n){var p=a.registry.import(f);p&&c.push(p)}}}catch(e){l.e(e)}finally{l.f()}return r?c:c[0]}},exporter:function(r,i,a){var u,c=[],l=s(Array.isArray(i)?i:[i]);try{for(l.s();!(u=l.n()).done;){var f=u.value,p=a.registry.export(n,f,o(o({},a),{},{namespace:e||r.getNamespace()||void 0}));p&&c.push(p)}}catch(e){l.e(e)}finally{l.f()}if(c.length){var d,h=g(r,e||r.getNamespace(),t),v=s(c);try{for(v.s();!(d=v.n()).done;){var m=d.value;h.appendChild(m)}}catch(e){v.e(e)}finally{v.f()}}}}},t.staticValue=function(e){return{exporter:function(){},importer:function(){return e}}},t.childRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a=r.getChild(t,e||r.getNamespace());return a?n?i.sanitizers[n](a.toJSON()):a.toJSON():void 0}},exporter:function(r,i,a){"string"==typeof i&&(i=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON());if(n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}i&&r.appendChild(new f.default(i.name,i.attributes,i.children))}}},t.childLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=m(r,e||r.getNamespace(),t),u=v(o,i),c=s(o);try{for(c.s();!(a=c.n()).done;){var l=a.value;if(h(l,i.lang)===u)return n?i.sanitizers[n](l.toJSON()):l.toJSON()}}catch(e){c.e(e)}finally{c.f()}return o[0]?n?i.sanitizers[n](o[0].toJSON()):o[0].toJSON():void 0}},exporter:function(r,i,a){"string"==typeof i&&(i=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(i,"</").concat(t,">")).toJSON());if(i&&n){if(!a.sanitizers||!a.sanitizers[n])return;i=a.sanitizers[n](i)}if(i){var o,u=g(r,e||r.getNamespace(),t,a.lang),c=s(i.children);try{for(c.s();!(o=c.n()).done;){var l=o.value;"string"==typeof l?u.appendChild(l):l&&u.appendChild(new f.default(l.name,l.attributes,l.children))}}catch(e){c.e(e)}finally{c.f()}}}}},t.childAlternateLanguageRawElement=function(e,t,n){return{importer:function(r,i){if(!n||i.sanitizers&&i.sanitizers[n]){var a,o=[],u=new Set,c=s(m(r,e||r.getNamespace(),t));try{for(c.s();!(a=c.n()).done;){var l=a.value,f=l.toJSON();if(n&&(f=i.sanitizers[n](f)),f){var p=h(l,i.lang);if(u.has(p))continue;o.push({lang:p,value:f}),u.add(p)}}}catch(e){c.e(e)}finally{c.f()}return u.size>0?o:void 0}},exporter:function(r,i,a){var o,u=s(i);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=c.value;if("string"==typeof l)l=(0,p.parse)("<".concat(t,' xmlns="').concat(e||r.getNamespace(),'">').concat(l,"</").concat(t,">")).toJSON();if(l&&n){if(!a.sanitizers||!a.sanitizers[n])continue;l=a.sanitizers[n](l)}if(l){var h=d(e||r.getNamespace(),t,a.namespace,r);r.appendChild(h),c.lang!==a.lang&&h.setAttribute("xml:lang",c.lang);var v,m=s(l.children);try{for(m.s();!(v=m.n()).done;){var g=v.value;"string"==typeof g?h.appendChild(g):h.appendChild(new f.default(g.name,g.attributes,g.children))}}catch(e){m.e(e)}finally{m.f()}}}}catch(e){u.e(e)}finally{u.f()}}}},t.parameterMap=function(e,n,i,a){return{importer:function(r,o){var u,c={},l=m(r,e,n),f=(0,t.attribute)(i).importer,p=(0,t.attribute)(a).importer,d=s(l);try{for(d.s();!(u=d.n()).done;){var h=u.value;c[f(h,o)]=p(h,o)}}catch(e){d.e(e)}finally{d.f()}return c},exporter:function(o,s,u){for(var c=(0,t.attribute)(i).exporter,l=(0,t.attribute)(a).exporter,f=e||o.getNamespace(),p=0,h=Object.entries(s);p<h.length;p++){var v=r(h[p],2),m=v[0],g=v[1],y=d(f,n,u.namespace,o);c(y,m,u),s[m]&&l(y,g,u),o.appendChild(y)}}}}},function(e,t,n){"use strict";t.Readable=n(87),t.Writable=n(89),t.Duplex=n(37),t.Transform=n(91),t.PassThrough=n(247)},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,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){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}),t.parse=void 0;var f=n(15),p=n(20),d=n(41),h=(0,f.__importDefault)(n(40)),v=(0,f.__importDefault)(n(56));function m(e){return 97<=e&&e<=122||65<=e&&e<=90||58===e||95===e}function g(e){return 192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=767||880<=e&&e<=893||895<=e&&e<=8191||8204<=e&&e<=8205||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||65008<=e&&e<=65533||65536<=e&&e<=983039}function y(e){return m(e)||g(e)}function b(e){return m(e)||45===e||46===e||48<=e&&e<=57||183===e||768<=e&&e<=879||8255<=e&&e<=8256||g(e)}function _(e){return 32===e||10===e||13===e||9===e}var S=function(e){a(n,e);var t=l(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,n),(e=t.call(this)).allowComments=!0,e.attributes={},e.state=34,e.tagName="",e.haveDeclaration=!1,e.recordBuffer=[],void 0!==i.allowComments&&(e.allowComments=i.allowComments),e}return i(n,[{key:"write",value:function(e){var t,n=u(e);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=r.codePointAt(0);switch(this.state){case 34:if(60===i){var a=void 0;try{a=(0,d.unescapeXML)(this.endRecord())}catch(e){return void this.emit("error",e)}a&&this.emit("text",a),this.transition(31);continue}this.record(r);continue;case 31:if(47===i){this.transition(7);continue}if(33===i){this.transition(24);continue}if(63===i){if(this.haveDeclaration)return this.restrictedXML();this.transition(25);continue}if(y(i)){this.transition(30),this.startRecord(r);continue}return this.notWellFormed();case 30:if(b(i)){this.record(r);continue}if(_(i)){this.startTag(),this.transition(32);continue}if(47===i){this.startTag(),this.transition(29);continue}if(62===i){this.startTag(),this.transition(34),this.emit("startElement",this.tagName,this.attributes);continue}return this.notWellFormed();case 29:if(62===i){this.emit("startElement",this.tagName,this.attributes),this.emit("endElement",this.tagName),this.transition(34);continue}return this.notWellFormed();case 33:if(_(i)){this.transition(32);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 32:if(_(i))continue;if(y(i)){this.startRecord(r),this.transition(0);continue}if(47===i){this.transition(29);continue}if(62===i){this.emit("startElement",this.tagName,this.attributes),this.transition(34);continue}return this.notWellFormed();case 7:if(y(i)){this.startRecord(r),this.transition(6);continue}return this.notWellFormed();case 6:if(b(i)){this.record(r);continue}if(_(i)){this.transition(8);continue}if(62===i){var o=this.endRecord();this.emit("endElement",o,this.attributes),this.transition(34);continue}return this.notWellFormed();case 8:if(_(i))continue;if(62===i){var s=this.endRecord();this.emit("endElement",s,this.attributes),this.transition(34);continue}return this.notWellFormed();case 0:if(b(i)){this.record(r);continue}if(61===i){this.addAttribute(),this.transition(4);continue}if(_(i)){this.addAttribute(),this.transition(3);continue}return this.notWellFormed();case 3:if(61===i){this.transition(4);continue}if(_(i))continue;return this.notWellFormed();case 4:if(34===i){this.startRecord(),this.transition(1);continue}if(39===i){this.startRecord(),this.transition(2);continue}if(_(i))continue;return this.notWellFormed();case 1:case 2:if(34===i&&1===this.state||39===i&&2===this.state){var c=this.endRecord();this.attributes[this.attributeName]=(0,d.unescapeXML)(c),this.transition(33);continue}if(60===i)return this.notWellFormed();this.record(r);continue;case 24:if(45===i){if(!this.allowComments)return this.restrictedXML();this.transition(23);continue}if(91===i){this.transition(21);continue}return this.notWellFormed();case 23:if(45===i){this.transition(14);continue}return this.notWellFormed();case 14:45===i&&this.transition(12);continue;case 12:45===i?this.transition(11):this.transition(14);continue;case 11:62===i?this.transition(34):this.transition(14);continue;case 25:if(88===i||120===i){this.transition(28);continue}return this.notWellFormed();case 28:if(77===i||109===i){this.transition(27);continue}return this.notWellFormed();case 27:if(76===i||108===i){this.transition(26);continue}return this.notWellFormed();case 26:if(_(i)){this.haveDeclaration=!0,this.transition(15);continue}return this.notWellFormed();case 13:if(62===i){this.transition(34);continue}return this.notWellFormed();case 15:63===i&&this.transition(13);continue;case 21:this.wait(i,67,20);continue;case 20:this.wait(i,68,19);continue;case 19:this.wait(i,65,18);continue;case 18:this.wait(i,84,17);continue;case 17:this.wait(i,65,16);continue;case 16:this.wait(i,91,5);continue;case 5:if(93===i){this.transition(10);continue}this.record(r);continue;case 10:93===i?this.transition(9):(this.record(String.fromCodePoint(93)),this.record(r),this.transition(5));continue;case 9:if(62===i){var l=this.endRecord();l&&this.emit("text",l),this.transition(34)}else this.record(String.fromCodePoint(93)),this.record(String.fromCodePoint(93)),this.record(r),this.transition(5);continue}}}catch(e){n.e(e)}finally{n.f()}}},{key:"end",value:function(e){e&&this.write(e),this.write=function(){}}},{key:"record",value:function(e){this.recordBuffer.push(e)}},{key:"startRecord",value:function(e){this.recordBuffer=[],e&&this.recordBuffer.push(e)}},{key:"endRecord",value:function(){var e=this.recordBuffer;return this.recordBuffer=[],e.join("")}},{key:"startTag",value:function(){this.tagName=this.endRecord(),this.attributes={}}},{key:"addAttribute",value:function(){var e=this.endRecord();if(void 0!==this.attributes[e])return this.notWellFormed();this.attributeName=e,this.attributes[e]=""}},{key:"wait",value:function(e,t,n){if(e!==t)return this.notWellFormed();this.transition(n)}},{key:"transition",value:function(e){this.state=e,34===e&&this.startRecord()}},{key:"notWellFormed",value:function(e){this.emit("error",v.default.notWellFormed(e))}},{key:"restrictedXML",value:function(e){this.emit("error",v.default.restrictedXML(e))}}]),n}(p.EventEmitter);t.parse=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=new S(r),a=null;if(i.on("text",(function(e){n&&n.children.push(e)})),i.on("startElement",(function(e,r){var i=new h.default(e,r);t||(t=i),n=n?n.appendChild(i):i})),i.on("endElement",(function(e){n?e===n.name?n.parent&&(n=n.parent):i.emit("error",v.default.notWellFormed("b")):i.emit("error",v.default.notWellFormed("a"))})),i.on("error",(function(e){a=e})),i.write(e),i.end(),a)throw a;return t},t.default=S},function(e,t,n){"use strict";var r=n(4),i=n(11),a=n(3),o=n(9),s=n(6),u=n(7),c=n(24),l=n(43),f=n(16),p=n(17),d=n(14);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,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 g(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 g(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 g(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 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.StanzaMediaSession=void 0;var b=n(36),_=b.__importDefault(n(20)),S=n(61),w=n(18),x=b.__importDefault(n(95)),k=n(33),O={"Discovered new ICE candidate":{skipMessage:!0}},T=function(e){f(p,e);var t,n,r=y(p);function p(e){var t;s(this,p),(t=r.call(this,e.options)).iceCandidatesDiscovered=0,t.iceCandidatesReceivedFromPeer=0,t.reinvite=!1,t.logger=e.logger,t.conversationId=e.conversationId,t.peerConnection=t.pc,t.fromUserId=e.fromUserId,t.meetingId=e.meetingId,t.id=t.sid,t.originalRoomJid=e.originalRoomJid,t.sessionType=k.SessionTypes[e.sessionType],t.ignoreHostCandidatesFromRemote=!!e.ignoreHostCandidatesFromRemote,t.allowIPv6=!!e.allowIPv6,t.allowTCP=!!e.allowTCP,t.privAnswerMode=e.privAnswerMode;var n=new _.default;return Object.keys(n.__proto__).forEach((function(e){t[e]=n[e]})),e.optOutOfWebrtcStatsTelemetry||t.setupStatsGatherer(),t.pc.addEventListener("connectionstatechange",t.onConnectionStateChange.bind(c(t))),t.pc.addEventListener("icecandidateerror",t.onIceCandidateError.bind(c(t))),t}return u(p,[{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"onTransportInfo",value:(n=o(a.mark((function e(t,n){var r,i,o,s,u,c,f,h;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(r=t.contents)||void 0===r?void 0:r[0].transport,s=null==o?void 0:o.candidates,this.ignoreHostCandidatesFromRemote&&(null==(u=null==s?void 0:s.filter((function(e){return"host"!==e.type})))?void 0:u.length)!==(null===(i=null==o?void 0:o.candidates)||void 0===i?void 0:i.length)&&(this._log("info","Ignoring remote host ice candidates"),o.candidates=u),s){c=m(s);try{for(c.s();!(f=c.n()).done;)h=f.value,this._log("info","Received candidate from peer",{candidateType:h.type}),this.iceCandidatesReceivedFromPeer++}catch(e){c.e(e)}finally{c.f()}}return e.abrupt("return",l(d(p.prototype),"onTransportInfo",this).call(this,t,n));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"_log",value:function(e,t){var n=O[t];if(!(null==n?void 0:n.skipMessage)){for(var r,a=arguments.length,o=new Array(a>2?a-2:0),s=2;s<a;s++)o[s-2]=arguments[s];if(o.length){var u=o[0];"object"!==i(u)||Array.isArray(u)||null===u?r=v(v({},this.getLogDetails()),{},{data:u}):(Object.assign(o[0],this.getLogDetails()),r=o)}else r=[].concat(o,[this.getLogDetails()]);this.logger[e](t,r)}}},{key:"end",value:(t=o(a.mark((function e(){var t,n,r=this,i=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=i.length>0&&void 0!==i[0]?i[0]:"success",n=i.length>1&&void 0!==i[1]&&i[1],this.state="ended",this.processingQueue.kill(),"string"==typeof t&&(t={condition:t}),n||(this._log("info","sending jingle session-terminate"),this.send("session-terminate",{reason:t})),setTimeout((function(){"connected"!==r.pc.connectionState&&"connecting"!==r.pc.connectionState||r.pc.close()}),2e3),this.parent.emit("terminated",this,t),this.parent.forgetSession(this);case 9:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new x.default(this.pc),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:function(){var e=this.pc.iceConnectionState,t=this.id,n=this.conversationId,r=this.sessionType;this._log("info","ICE state changed: ",{iceState:e,sessionId:t,conversationId:n}),"disconnected"===e?"stable"===this.pc.signalingState&&(this.interruptionStart=new Date,this._log("info","Connection state is interrupted",{sessionId:t,conversationId:n,sessionType:r})):"connected"===e?(this._log("info","sending session-info: active"),this.send(w.JingleAction.SessionInfo,{info:{infoType:w.JINGLE_INFO_ACTIVE}}),this._setupDataChannel()):"failed"===e&&this._log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer}),l(d(p.prototype),"onIceStateChange",this).call(this)}},{key:"onConnectionStateChange",value:function(){var e=this.pc.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if(this._log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this._log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&this._log("info","Connection was interrupted and failed to recover",{sessionId:t,conversationId:n,sessionType:r})}},{key:"onIceCandidateError",value:function(e){var t=e;this._log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url}),console.error("IceCandidateError",t)}},{key:"onIceCandidate",value:function(e){if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var t=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(t&&!t[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this._log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this._log("debug","Processing ice candidate",e.candidate.candidate),this._log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++}return l(d(p.prototype),"onIceCandidate",this).call(this,e)}},{key:"onIceEndOfCandidates",value:function(){l(d(p.prototype),"onIceEndOfCandidates",this).call(this),this.emit("endOfCandidates")}},{key:"addTrack",value:function(e,t){var n=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",o(a.mark((function r(){var i;return a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(i=n.pc.getTransceivers().find((function(t){var n;return!t.sender.track&&(null===(n=t.receiver.track)||void 0===n?void 0:n.kind)===e.kind})))){r.next=3;break}return r.abrupt("return",i.sender.replaceTrack(e));case 3:return n.pc.addTrack(e,t),r.abrupt("return");case 5:case"end":return r.stop()}}),r)}))))}},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.pc.localDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this._log("info","creating data channel"),this.dataChannel=this.pc.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",(function(){t._log("info","data channel opened")})),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",(function(){t._log("info","closing data channel")})),this.dataChannel.addEventListener("error",(function(e){t._log("error","Error occurred with the data channel",e)})))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this._log("error","Failed to parse data channel message",{error:e})}}}]),p}(S.MediaSession);t.StanzaMediaSession=T},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionManager=t.FileSession=t.MediaSession=t.ICESession=t.Session=t.exportToSDP=t.importFromSDP=void 0;var r=n(15),i=(0,r.__importDefault)(n(92));t.FileSession=i.default;var a=(0,r.__importDefault)(n(62));t.ICESession=a.default;var o=(0,r.__importDefault)(n(94));t.MediaSession=o.default;var s=(0,r.__importDefault)(n(64));t.Session=s.default;var u=(0,r.__importDefault)(n(257));t.SessionManager=u.default;var c=n(44);Object.defineProperty(t,"importFromSDP",{enumerable:!0,get:function(){return c.importFromSDP}}),Object.defineProperty(t,"exportToSDP",{enumerable:!0,get:function(){return c.exportToSDP}})},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(4),s=n(6),u=n(7),c=n(24),l=n(43),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){o(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});var b=n(15),_=(0,b.__importStar)(n(93)),S=n(18),w=n(2),x=n(44),k=n(63),O=function(e){f(b,e);var t,n,o,p,v,m=y(b);function b(e){var t;return s(this,b),(t=m.call(this,e)).bitrateLimit=0,t.candidateBuffer=[],t.transportType=w.NS_JINGLE_ICE_UDP_1,t.restartingIce=!1,t.usingRelay=!1,t.maxRelayBandwidth=e.maxRelayBandwidth,t.pc=t.parent.createPeerConnection(c(t),g(g({},e.config),{},{iceServers:e.iceServers})),t.pc.oniceconnectionstatechange=function(){t.onIceStateChange()},t.pc.onicecandidate=function(e){e.candidate?t.onIceCandidate(e):t.onIceEndOfCandidates()},t.restrictRelayBandwidth(),t}return u(b,[{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.pc.close(),l(d(b.prototype),"end",this).call(this,e,t)}},{key:"restartIce",value:(v=a(i.mark((function e(){var t=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isInitiator){e.next=2;break}return e.abrupt("return");case 2:return void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this.restartingIce=!0,e.prev=4,e.next=7,this.processLocal("restart-ice",a(i.mark((function e(){var n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.pc.createOffer({iceRestart:!0});case 2:return n=e.sent,r=(0,x.importFromSDP)(n.sdp),t.send(S.JingleAction.TransportInfo,{contents:r.media.map((function(e){return{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:(0,k.convertIntermediateToTransport)(e,t.transportType)}})),sid:t.sid}),e.next=7,t.pc.setLocalDescription(n);case 7:case"end":return e.stop()}}),e)}))));case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(4),this._log("error","Could not create WebRTC offer",e.t0),this.end(S.JingleReasonCondition.FailedTransport,!0);case 13:case"end":return e.stop()}}),e,this,[[4,9]])}))),function(){return v.apply(this,arguments)})},{key:"setMaximumBitrate",value:(p=a(i.mark((function e(t){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.maximumBitrate&&(t=Math.min(t,this.maximumBitrate)),this.currentBitrate=t,(n=this.pc.getSenders().find((function(e){return!!e.track&&"video"===e.track.kind})))&&n.getParameters){e.next=5;break}return e.abrupt("return");case 5:return e.prev=5,e.next=8,this.processLocal("set-bitrate",a(i.mark((function e(){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=n.getParameters()).encodings&&r.encodings.length||(r.encodings=[{}]),0===t?delete r.encodings[0].maxBitrate:r.encodings[0].maxBitrate=t,e.next=5,n.setParameters(r);case 5:case"end":return e.stop()}}),e)}))));case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),this._log("error","Set maximumBitrate failed",e.t0);case 13:case"end":return e.stop()}}),e,this,[[5,10]])}))),function(e){return p.apply(this,arguments)})},{key:"onTransportInfo",value:(o=a(i.mark((function e(t,n){var o,s,u,c,l,f,p,d,v,m,g,y,b,w,O,T=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.contents&&t.contents[0]&&t.contents[0].transport.gatheringComplete)){e.next=18;break}if(o={sdpMid:t.contents[0].name,candidate:""},e.prev=2,"stable"!==this.pc.signalingState){e.next=8;break}return e.next=6,this.pc.addIceCandidate(o);case 6:e.next=9;break;case 8:this.candidateBuffer.push(o);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),this._log("debug","Could not add null end-of-candidate");case 14:return e.prev=14,n(),e.finish(14);case 17:return e.abrupt("return");case 18:if(!this.pc.remoteDescription){e.next=51;break}if(s=this.pc.remoteDescription,u=(0,x.importFromSDP)(s.sdp),c=u.media.find((function(e){return e.mid===t.contents[0].name})),l=c.iceParameters.usernameFragment,!(f=t.contents[0].transport.usernameFragment)||l===f){e.next=51;break}p=h(t.contents.entries());try{for(p.s();!(d=p.n()).done;)v=r(d.value,2),m=v[0],g=v[1],y=g.transport,u.media[m].iceParameters={password:y.password,usernameFragment:y.usernameFragment},u.media[m].candidates=[]}catch(e){p.e(e)}finally{p.f()}return e.prev=27,e.next=30,this.pc.setRemoteDescription({type:s.type,sdp:(0,x.exportToSDP)(u)});case 30:return e.next=32,this.processBufferedCandidates();case 32:if("offer"!==s.type){e.next=42;break}return e.next=35,this.pc.createAnswer();case 35:return b=e.sent,e.next=38,this.pc.setLocalDescription(b);case 38:w=(0,x.importFromSDP)(b.sdp),this.send(S.JingleAction.TransportInfo,{contents:w.media.map((function(e){return{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:(0,k.convertIntermediateToTransport)(e,T.transportType)}})),sid:this.sid}),e.next=43;break;case 42:this.restartingIce=!1;case 43:e.next=51;break;case 45:return e.prev=45,e.t1=e.catch(27),this._log("error","Could not do remote ICE restart",e.t1),n(e.t1),this.end(S.JingleReasonCondition.FailedTransport),e.abrupt("return");case 51:return O=(t.contents||[]).map((function(e){var t=e.name,n=(e.transport.candidates||[]).map(function(){var e=a(i.mark((function e(n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=_.writeCandidate((0,k.convertCandidateToIntermediate)(n)),!T.pc.remoteDescription||"stable"!==T.pc.signalingState){e.next=12;break}return e.prev=2,e.next=5,T.pc.addIceCandidate({sdpMid:t,candidate:r});case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(2),T._log("error","Could not add ICE candidate",e.t0);case 10:e.next=13;break;case 12:T.candidateBuffer.push({sdpMid:t,candidate:r});case 13:case"end":return e.stop()}}),e,null,[[2,7]])})));return function(t){return e.apply(this,arguments)}}());return Promise.all(n)})),e.prev=52,e.next=55,Promise.all(O);case 55:n(),e.next=62;break;case 58:e.prev=58,e.t2=e.catch(52),this._log("error","Could not process transport-info: ".concat(e.t2)),n(e.t2);case 62:case"end":return e.stop()}}),e,this,[[2,11,14,17],[27,45],[52,58]])}))),function(e,t){return o.apply(this,arguments)})},{key:"onSessionAccept",value:(n=a(i.mark((function e(t,n){var r,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",r=(0,k.convertRequestToIntermediate)(t,this.peerRole),a=(0,x.exportToSDP)(r),e.prev=3,e.next=6,this.pc.setRemoteDescription({type:"answer",sdp:a});case 6:return e.next=8,this.processBufferedCandidates();case 8:this.parent.emit("accepted",this,void 0),n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(3),this._log("error","Could not process WebRTC answer: ".concat(e.t0)),n({condition:"general-error"});case 16:case"end":return e.stop()}}),e,this,[[3,12]])}))),function(e,t){return n.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,t){this._log("info","Terminating session"),this.pc.close(),l(d(b.prototype),"end",this).call(this,e.reason,!0),t()}},{key:"onIceCandidate",value:function(e){if(e.candidate&&e.candidate.candidate){var t=_.parseCandidate(e.candidate.candidate),n={contents:[{creator:S.JingleSessionRole.Initiator,name:e.candidate.sdpMid,transport:{candidates:[(0,k.convertIntermediateToCandidate)(t)],transportType:this.transportType,usernameFragment:t.usernameFragment}}]};this._log("info","Discovered new ICE candidate",n),this.send(S.JingleAction.TransportInfo,n)}}},{key:"onIceEndOfCandidates",value:function(){this._log("info","ICE end of candidates");var e=(0,x.importFromSDP)(this.pc.localDescription.sdp).media[0];this.send(S.JingleAction.TransportInfo,{contents:[{creator:S.JingleSessionRole.Initiator,name:e.mid,transport:{gatheringComplete:!0,transportType:this.transportType,usernameFragment:e.iceParameters.usernameFragment}}]})}},{key:"onIceStateChange",value:function(){switch(this.pc.iceConnectionState){case"checking":this.connectionState="connecting";break;case"completed":case"connected":this.connectionState="connected";break;case"disconnected":if("stable"===this.pc.signalingState?this.connectionState="interrupted":this.connectionState="disconnected",this.restartingIce)return void this.end(S.JingleReasonCondition.FailedTransport);this.maybeRestartIce();break;case"failed":if("failed"===this.connectionState||this.restartingIce)return void this.end(S.JingleReasonCondition.FailedTransport);this.connectionState="failed",this.restartIce();break;case"closed":this.connectionState="disconnected",this.restartingIce?this.end(S.JingleReasonCondition.FailedTransport):this.end()}}},{key:"processBufferedCandidates",value:(t=a(i.mark((function e(){var t,n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=h(this.candidateBuffer),e.prev=1,t.s();case 3:if((n=t.n()).done){e.next=15;break}return r=n.value,e.prev=5,e.next=8,this.pc.addIceCandidate(r);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(5),this._log("error","Could not add ICE candidate",e.t0);case 13:e.next=3;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(1),t.e(e.t1);case 20:return e.prev=20,t.f(),e.finish(20);case 23:this.candidateBuffer=[];case 24:case"end":return e.stop()}}),e,this,[[1,17,20,23],[5,10]])}))),function(){return t.apply(this,arguments)})},{key:"restrictRelayBandwidth",value:function(){var e=this;this.pc.addEventListener("iceconnectionstatechange",a(i.mark((function t(){var n,r,a,o,s,u,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("completed"===e.pc.iceConnectionState||"connected"===e.pc.iceConnectionState){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.pc.getStats();case 4:if((n=t.sent).forEach((function(e){"transport"===e.type&&(r=n.get(e.selectedCandidatePairId))})),r||n.forEach((function(e){"candidate-pair"===e.type&&e.selected&&(r=e)})),r){t.next=9;break}return t.abrupt("return");case 9:a=!1,o="",s="",r.remoteCandidateId&&(u=n.get(r.remoteCandidateId))&&(s=u.candidateType),r.localCandidateId&&(c=n.get(r.localCandidateId))&&(o=c.candidateType),"relay"!==o&&"relay"!==s||(a=!0),e.usingRelay=a,e.parent.emit("iceConnectionType",e,{localCandidateType:o,relayed:a,remoteCandidateType:s}),a&&void 0!==e.maxRelayBandwidth&&(e.maximumBitrate=e.maxRelayBandwidth,e.currentBitrate?e.setMaximumBitrate(Math.min(e.currentBitrate,e.maximumBitrate)):e.setMaximumBitrate(e.maximumBitrate));case 18:case"end":return t.stop()}}),t)}))))}},{key:"maybeRestartIce",value:function(){var e=this;this.isInitiator&&(void 0!==this._maybeRestartingIce&&clearTimeout(this._maybeRestartingIce),this._maybeRestartingIce=setTimeout((function(){e._maybeRestartingIce=void 0,"disconnected"===e.pc.iceConnectionState&&e.restartIce()}),2e3))}}]),b}((0,b.__importDefault)(n(64)).default);t.default=O},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.convertRequestToIntermediate=t.convertContentToIntermediate=t.convertIntermediateToRequest=t.convertIntermediateToTransport=t.convertCandidateToIntermediate=t.convertIntermediateToCandidate=t.convertIntermediateToApplication=void 0;var a=n(18),o=n(2);function s(e,t){var n=e.rtpParameters,i=e.rtcpParameters||{},s=e.rtpEncodingParameters||[],u=!1;s&&s.length&&(u=!!s[0].ssrc);var c,l={applicationType:o.NS_JINGLE_RTP_1,codecs:[],headerExtensions:[],media:e.kind,rtcpMux:i.mux,rtcpReducedSize:i.reducedSize,sourceGroups:[],sources:[],ssrc:u?s[0].ssrc.toString():void 0,streams:[]},f=r(n.headerExtensions||[]);try{for(f.s();!(c=f.n()).done;){var p=c.value,d={id:p.id,uri:p.uri};p.direction&&"sendrecv"!==p.direction&&(d.senders=(0,a.directionToSenders)(t,p.direction)),l.headerExtensions.push(d)}}catch(e){f.e(e)}finally{f.f()}i.ssrc&&i.cname&&(l.sources=[{parameters:{cname:i.cname},ssrc:i.ssrc.toString()}]),u&&s[0]&&s[0].rtx&&(l.sourceGroups=[{semantics:"FID",sources:[s[0].ssrc.toString(),s[0].rtx.ssrc.toString()]}]);var h,v=r(e.streams||[]);try{for(v.s();!(h=v.n()).done;){var m=h.value;l.streams.push({id:m.stream,track:m.track})}}catch(e){v.e(e)}finally{v.f()}var g,y=r(n.codecs||[]);try{for(y.s();!(g=y.n()).done;){var b=g.value,_={channels:b.channels,clockRate:b.clockRate,id:b.payloadType.toString(),name:b.name,parameters:b.parameters,rtcpFeedback:b.rtcpFeedback};b.maxptime&&(_.maxptime=b.maxptime),b.parameters&&b.parameters.ptime&&(_.ptime=parseInt(b.parameters.ptime,10)),l.codecs.push(_)}}catch(e){y.e(e)}finally{y.f()}return l}function u(e){return{component:"rtp"===e.component?1:"rtcp"===e.component?2:e.component,foundation:e.foundation,generation:void 0,id:void 0,ip:e.ip,network:void 0,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function c(e){return{address:e.ip,component:1===e.component?"rtp":2===e.component?"rtcp":e.component,foundation:e.foundation,ip:e.ip,port:e.port,priority:e.priority,protocol:e.protocol,relatedAddress:e.relatedAddress,relatedPort:e.relatedPort,tcpType:e.tcpType,type:e.type}}function l(e,t){var n=e.iceParameters,i=e.dtlsParameters,a={candidates:[],transportType:t};n&&(a.usernameFragment=n.usernameFragment,a.password=n.password,n.iceLite&&(a.iceLite=!0)),i&&(a.fingerprints=i.fingerprints.map((function(t){return{algorithm:t.algorithm,setup:e.setup,value:t.value}}))),e.sctp&&(a.sctp=e.sctp);var o,s=r(e.candidates||[]);try{for(s.s();!(o=s.n()).done;){var c=o.value;a.candidates.push(u(c))}}catch(e){s.e(e)}finally{s.f()}return a}function f(e,t){var n=e.application||{},i=e.transport,s=n&&n.applicationType===o.NS_JINGLE_RTP_1,u={direction:(0,a.sendersToDirection)(t,e.senders),kind:n.media||"application",mid:e.name,protocol:s?"UDP/TLS/RTP/SAVPF":"UDP/DTLS/SCTP"};if(s){if(u.rtcpParameters={compound:!n.rtcpReducedSize,mux:n.rtcpMux,reducedSize:n.rtcpReducedSize},n.sources&&n.sources.length){var l=n.sources[0];u.rtcpParameters.ssrc=parseInt(l.ssrc,10),l.parameters&&(u.rtcpParameters.cname=l.parameters.cname)}if(u.rtpParameters={codecs:[],fecMechanisms:[],headerExtensions:[],rtcp:[]},n.streams){u.streams=[];var f,p=r(n.streams);try{for(p.s();!(f=p.n()).done;){var d=f.value;u.streams.push({stream:d.id,track:d.track})}}catch(e){p.e(e)}finally{p.f()}}if(n.ssrc&&(u.rtpEncodingParameters=[{ssrc:parseInt(n.ssrc,10)}],n.sourceGroups&&n.sourceGroups.length)){var h=n.sourceGroups[0];u.rtpEncodingParameters[0].rtx={ssrc:parseInt(h.sources[1],10)}}var v,m=!1,g=!1,y=r(n.codecs||[]);try{for(y.s();!(v=y.n()).done;){var b,_=v.value,S=_.parameters||{},w=[],x=r(_.rtcpFeedback||[]);try{for(x.s();!(b=x.n()).done;){var k=b.value;w.push({parameter:k.parameter,type:k.type})}}catch(e){x.e(e)}finally{x.f()}if("red"===_.name||"ulpfec"===_.name){m=m||"red"===_.name,g=g||"ulpfec"===_.name;var O=_.name.toUpperCase();u.rtpParameters.fecMechanisms.includes(O)||u.rtpParameters.fecMechanisms.push(O)}u.rtpParameters.codecs.push({channels:_.channels,clockRate:_.clockRate,name:_.name,numChannels:_.channels,parameters:S,payloadType:parseInt(_.id,10),rtcpFeedback:w})}}catch(e){y.e(e)}finally{y.f()}var T,A=r(n.headerExtensions||[]);try{for(A.s();!(T=A.n()).done;){var I=T.value;u.rtpParameters.headerExtensions.push({direction:(0,a.sendersToDirection)(t,I.senders||"both"),id:I.id,uri:I.uri,attributes:void 0})}}catch(e){A.e(e)}finally{A.f()}}if(i){if(i.usernameFragment&&i.password&&(u.iceParameters={password:i.password,usernameFragment:i.usernameFragment},i.iceLite&&(u.iceParameters.iceLite=!0)),i.fingerprints&&i.fingerprints.length){u.dtlsParameters={fingerprints:[],role:"auto"};var E,N=r(i.fingerprints);try{for(N.s();!(E=N.n()).done;){var R=E.value;u.dtlsParameters.fingerprints.push({algorithm:R.algorithm,value:R.value})}}catch(e){N.e(e)}finally{N.f()}i.sctp&&(u.sctp=i.sctp),u.setup=i.fingerprints[0].setup}u.candidates=(i.candidates||[]).map(c)}return u}t.convertIntermediateToApplication=s,t.convertIntermediateToCandidate=u,t.convertCandidateToIntermediate=c,t.convertIntermediateToTransport=l,t.convertIntermediateToRequest=function(e,t,n){return{contents:e.media.map((function(e){return{application:"audio"===e.kind||"video"===e.kind?s(e,t):{applicationType:"datachannel",protocol:e.protocol},creator:a.JingleSessionRole.Initiator,name:e.mid,senders:(0,a.directionToSenders)(t,e.direction),transport:l(e,n)}})),groups:e.groups?e.groups.map((function(e){return{contents:e.mids,semantics:e.semantics}})):[]}},t.convertContentToIntermediate=f,t.convertRequestToIntermediate=function(e,t){var n,i={groups:[],media:[]},a=r(e.groups||[]);try{for(a.s();!(n=a.n()).done;){var o=n.value;i.groups.push({mids:o.contents,semantics:o.semantics})}}catch(e){a.e(e)}finally{a.f()}var s,u=r(e.contents||[]);try{for(u.s();!(s=u.n()).done;){var c=s.value;i.media.push(f(c,t))}}catch(e){u.e(e)}finally{u.f()}return i}},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});var s=n(65),u=n(18),c=n(27),l={condition:u.StanzaErrorCondition.BadRequest},f={condition:u.StanzaErrorCondition.FeatureNotImplemented,jingleError:u.JingleErrorCondition.UnsupportedInfo,type:"modify"},p=function(){function e(t){var n=this;a(this,e),this.parent=t.parent,this.sid=t.sid||(0,c.uuid)(),this.peerID=t.peerID,this.role=t.initiator?u.JingleSessionRole.Initiator:u.JingleSessionRole.Responder,this._sessionState="starting",this._connectionState="starting",this.pendingApplicationTypes=t.applicationTypes||[],this.pendingAction=void 0,this.processingQueue=(0,s.priorityQueue)(function(){var e=i(r.mark((function e(t,i){var a,o,s,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("ended"!==n.state){e.next=4;break}return"local"===t.type&&t.reject&&t.reject(new Error("Session ended")),i&&i(),e.abrupt("return");case 4:if("local"!==t.type){e.next=18;break}return n._log("debug","Processing local action:",t.name),e.prev=6,e.next=9,t.handler();case 9:a=e.sent,t.resolve(a),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t.reject(e.t0);case 16:return i&&i(),e.abrupt("return");case 18:return o=t.action,s=t.changes,c=t.cb,n._log("debug","Processing remote action:",o),e.abrupt("return",new Promise((function(e){var t=function(t,n){c(t,n),i&&i(),e()};switch(o){case u.JingleAction.ContentAccept:return n.onContentAccept(s,t);case u.JingleAction.ContentAdd:return n.onContentAdd(s,t);case u.JingleAction.ContentModify:return n.onContentModify(s,t);case u.JingleAction.ContentReject:return n.onContentReject(s,t);case u.JingleAction.ContentRemove:return n.onContentRemove(s,t);case u.JingleAction.DescriptionInfo:return n.onDescriptionInfo(s,t);case u.JingleAction.SecurityInfo:return n.onSecurityInfo(s,t);case u.JingleAction.SessionAccept:return n.onSessionAccept(s,t);case u.JingleAction.SessionInfo:return n.onSessionInfo(s,t);case u.JingleAction.SessionInitiate:return n.onSessionInitiate(s,t);case u.JingleAction.SessionTerminate:return n.onSessionTerminate(s,t);case u.JingleAction.TransportAccept:return n.onTransportAccept(s,t);case u.JingleAction.TransportInfo:return n.onTransportInfo(s,t);case u.JingleAction.TransportReject:return n.onTransportReject(s,t);case u.JingleAction.TransportReplace:return n.onTransportReplace(s,t);default:n._log("error","Invalid or unsupported action: "+o),t({condition:u.StanzaErrorCondition.BadRequest})}})));case 21:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(t,n){return e.apply(this,arguments)}}(),1)}return o(e,[{key:"send",value:function(e,t){(t=t||{}).sid=this.sid,t.action=e,new Set([u.JingleAction.ContentAccept,u.JingleAction.ContentAdd,u.JingleAction.ContentModify,u.JingleAction.ContentReject,u.JingleAction.ContentRemove,u.JingleAction.SessionAccept,u.JingleAction.SessionInitiate,u.JingleAction.TransportAccept,u.JingleAction.TransportReject,u.JingleAction.TransportReplace]).has(e)?this.pendingAction=e:this.pendingAction=void 0,this.parent.signal(this,{id:(0,c.uuid)(),jingle:t,to:this.peerID,type:"set"})}},{key:"processLocal",value:function(e,t){var n=this;return new Promise((function(r,i){n.processingQueue.push({handler:t,name:e,reject:i,resolve:r,type:"local"},1)}))}},{key:"process",value:function(e,t,n){this.processingQueue.push({action:e,cb:n,changes:t,type:"remote"},2)}},{key:"start",value:function(e,t){this._log("error","Can not start base sessions"),this.end("unsupported-applications",!0)}},{key:"accept",value:function(e,t){this._log("error","Can not accept base sessions"),this.end("unsupported-applications")}},{key:"cancel",value:function(){this.end("cancel")}},{key:"decline",value:function(){this.end("decline")}},{key:"end",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.state="ended",this.processingQueue.kill(),"string"==typeof e&&(e={condition:e}),t||this.send("session-terminate",{reason:e}),this.parent.emit("terminated",this,e),this.parent.forgetSession(this)}},{key:"_log",value:function(e,t){if(this.parent){var n,r;t=this.sid+": "+t;for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];(n=this.parent).emit.apply(n,["log",e,t].concat(a)),(r=this.parent).emit.apply(r,["log:"+e,t].concat(a))}}},{key:"onSessionInitiate",value:function(e,t){t()}},{key:"onSessionAccept",value:function(e,t){t()}},{key:"onSessionTerminate",value:function(e,t){this.end(e.reason,!0),t()}},{key:"onSessionInfo",value:function(e,t){e.info?t(f):t()}},{key:"onSecurityInfo",value:function(e,t){t(f)}},{key:"onDescriptionInfo",value:function(e,t){t(f)}},{key:"onTransportInfo",value:function(e,t){t(f)}},{key:"onContentAdd",value:function(e,t){t(),this.send(u.JingleAction.ContentReject,{reason:{condition:u.JingleReasonCondition.FailedApplication,text:"content-add is not supported"}})}},{key:"onContentAccept",value:function(e,t){t(l)}},{key:"onContentReject",value:function(e,t){t(l)}},{key:"onContentModify",value:function(e,t){t(l)}},{key:"onContentRemove",value:function(e,t){t(l)}},{key:"onTransportReplace",value:function(e,t){t(),this.send(u.JingleAction.TransportReject,{reason:{condition:u.JingleReasonCondition.FailedTransport,text:"transport-replace is not supported"}})}},{key:"onTransportAccept",value:function(e,t){t(l)}},{key:"onTransportReject",value:function(e,t){t(l)}},{key:"isInitiator",get:function(){return this.role===u.JingleSessionRole.Initiator}},{key:"peerRole",get:function(){return this.isInitiator?u.JingleSessionRole.Responder:u.JingleSessionRole.Initiator}},{key:"state",get:function(){return this._sessionState},set:function(e){e!==this._sessionState&&(this._log("info","Changing session state to: "+e),this._sessionState=e,this.parent&&this.parent.emit("sessionState",this,e))}},{key:"connectionState",get:function(){return this._connectionState},set:function(e){e!==this._connectionState&&(this._log("info","Changing connection state to: "+e),this._connectionState=e,this.parent&&this.parent.emit("connectionState",this,e))}}]),e}();t.default=p},function(e,t,n){"use strict";n.r(t),n.d(t,"all",(function(){return we})),n.d(t,"allLimit",(function(){return xe})),n.d(t,"allSeries",(function(){return ke})),n.d(t,"any",(function(){return ut})),n.d(t,"anyLimit",(function(){return ct})),n.d(t,"anySeries",(function(){return lt})),n.d(t,"apply",(function(){return l})),n.d(t,"applyEach",(function(){return B})),n.d(t,"applyEachSeries",(function(){return U})),n.d(t,"asyncify",(function(){return y})),n.d(t,"auto",(function(){return G})),n.d(t,"autoInject",(function(){return K})),n.d(t,"cargo",(function(){return Z})),n.d(t,"cargoQueue",(function(){return ee})),n.d(t,"compose",(function(){return re})),n.d(t,"concat",(function(){return oe})),n.d(t,"concatLimit",(function(){return ae})),n.d(t,"concatSeries",(function(){return se})),n.d(t,"constant",(function(){return ue})),n.d(t,"default",(function(){return wt})),n.d(t,"detect",(function(){return le})),n.d(t,"detectLimit",(function(){return fe})),n.d(t,"detectSeries",(function(){return pe})),n.d(t,"dir",(function(){return he})),n.d(t,"doDuring",(function(){return ve})),n.d(t,"doUntil",(function(){return me})),n.d(t,"doWhilst",(function(){return ve})),n.d(t,"during",(function(){return bt})),n.d(t,"each",(function(){return ye})),n.d(t,"eachLimit",(function(){return be})),n.d(t,"eachOf",(function(){return D})),n.d(t,"eachOfLimit",(function(){return C})),n.d(t,"eachOfSeries",(function(){return F})),n.d(t,"eachSeries",(function(){return _e})),n.d(t,"ensureAsync",(function(){return Se})),n.d(t,"every",(function(){return we})),n.d(t,"everyLimit",(function(){return xe})),n.d(t,"everySeries",(function(){return ke})),n.d(t,"filter",(function(){return Ie})),n.d(t,"filterLimit",(function(){return Ee})),n.d(t,"filterSeries",(function(){return Ne})),n.d(t,"find",(function(){return le})),n.d(t,"findLimit",(function(){return fe})),n.d(t,"findSeries",(function(){return pe})),n.d(t,"flatMap",(function(){return oe})),n.d(t,"flatMapLimit",(function(){return ae})),n.d(t,"flatMapSeries",(function(){return se})),n.d(t,"foldl",(function(){return te})),n.d(t,"foldr",(function(){return Ye})),n.d(t,"forEach",(function(){return ye})),n.d(t,"forEachLimit",(function(){return be})),n.d(t,"forEachOf",(function(){return D})),n.d(t,"forEachOfLimit",(function(){return C})),n.d(t,"forEachOfSeries",(function(){return F})),n.d(t,"forEachSeries",(function(){return _e})),n.d(t,"forever",(function(){return Re})),n.d(t,"groupBy",(function(){return Ce})),n.d(t,"groupByLimit",(function(){return je})),n.d(t,"groupBySeries",(function(){return Pe})),n.d(t,"inject",(function(){return te})),n.d(t,"log",(function(){return Me})),n.d(t,"map",(function(){return L})),n.d(t,"mapLimit",(function(){return ie})),n.d(t,"mapSeries",(function(){return q})),n.d(t,"mapValues",(function(){return Le})),n.d(t,"mapValuesLimit",(function(){return De})),n.d(t,"mapValuesSeries",(function(){return Be})),n.d(t,"memoize",(function(){return Fe})),n.d(t,"nextTick",(function(){return qe})),n.d(t,"parallel",(function(){return ze})),n.d(t,"parallelLimit",(function(){return Je})),n.d(t,"priorityQueue",(function(){return Qe})),n.d(t,"queue",(function(){return Ge})),n.d(t,"race",(function(){return Ke})),n.d(t,"reduce",(function(){return te})),n.d(t,"reduceRight",(function(){return Ye})),n.d(t,"reflect",(function(){return Xe})),n.d(t,"reflectAll",(function(){return $e})),n.d(t,"reject",(function(){return et})),n.d(t,"rejectLimit",(function(){return tt})),n.d(t,"rejectSeries",(function(){return nt})),n.d(t,"retry",(function(){return it})),n.d(t,"retryable",(function(){return ot})),n.d(t,"select",(function(){return Ie})),n.d(t,"selectLimit",(function(){return Ee})),n.d(t,"selectSeries",(function(){return Ne})),n.d(t,"seq",(function(){return ne})),n.d(t,"series",(function(){return st})),n.d(t,"setImmediate",(function(){return g})),n.d(t,"some",(function(){return ut})),n.d(t,"someLimit",(function(){return ct})),n.d(t,"someSeries",(function(){return lt})),n.d(t,"sortBy",(function(){return ft})),n.d(t,"timeout",(function(){return pt})),n.d(t,"times",(function(){return ht})),n.d(t,"timesLimit",(function(){return dt})),n.d(t,"timesSeries",(function(){return vt})),n.d(t,"transform",(function(){return mt})),n.d(t,"tryEach",(function(){return gt})),n.d(t,"unmemoize",(function(){return yt})),n.d(t,"until",(function(){return _t})),n.d(t,"waterfall",(function(){return St})),n.d(t,"whilst",(function(){return bt})),n.d(t,"wrapSync",(function(){return y}));var r=n(4),i=n(3),a=n(6),o=n(7),s=n(12),u=n(13),c=n(11);function l(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.apply(void 0,n.concat(r))}}function f(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop();return e.call(this,n,i)}}var p="function"==typeof queueMicrotask&&queueMicrotask,d="function"==typeof setImmediate&&setImmediate,h="object"===("undefined"==typeof process?"undefined":c(process))&&"function"==typeof process.nextTick;function v(e){setTimeout(e,0)}function m(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return e((function(){return t.apply(void 0,r)}))}}var g=m(p?queueMicrotask:d?setImmediate:h?process.nextTick:v);function y(e){return S(e)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop(),a=e.apply(this,n);return b(a,i)}:f((function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&"function"==typeof r.then)return b(r,n);n(null,r)}))}function b(e,t){return e.then((function(e){_(t,null,e)}),(function(e){_(t,e&&(e instanceof Error||e.message)?e:new Error(e))}))}function _(e,t,n){try{e(t,n)}catch(e){g((function(e){throw e}),e)}}function S(e){return"AsyncFunction"===e[Symbol.toStringTag]}function w(e){if("function"!=typeof e)throw new Error("expected a function");return S(e)?y(e):e}function x(e,t){if(t||(t=e.length),!t)throw new Error("arity is undefined");return function(){for(var n=this,r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return"function"==typeof i[t-1]?e.apply(this,i):new Promise((function(r,a){i[t-1]=function(e){if(e)return a(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(n.length>1?n:n[0])},e.apply(n,i)}))}}function k(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var a=x((function(n){var i=this;return e(t,(function(e,t){w(e).apply(i,r.concat(t))}),n)}));return a}}function O(e,t,n,r){t=t||[];var i=[],a=0,o=w(n);return e(t,(function(e,t,n){var r=a++;o(e,(function(e,t){i[r]=t,n(e)}))}),(function(e){r(e,i)}))}function T(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}var A={};function I(e){function t(){if(null!==e){var t=e;e=null;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}return Object.assign(t,e),t}function E(e){if(T(e))return function(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}(e);var t,n,r,i,a=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return a?function(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}(a):(n=(t=e)?Object.keys(t):[],r=-1,i=n.length,function e(){var a=n[++r];return"__proto__"===a?e():r<i?{value:t[a],key:a}:null})}function N(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}function R(e,t,n,r){var i=!1,a=!1,o=!1,s=0,u=0;function c(){s>=t||o||i||(o=!0,e.next().then((function(e){var t=e.value,f=e.done;if(!a&&!i){if(o=!1,f)return i=!0,void(s<=0&&r(null));s++,n(t,u,l),u++,c()}})).catch(f))}function l(e,t){if(s-=1,!a)return e?f(e):!1===e?(i=!0,void(a=!0)):t===A||i&&s<=0?(i=!0,r(null)):void c()}function f(e){a||(o=!1,i=!0,r(e))}c()}var j=function(e){return function(t,n,r){if(r=I(r),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return r(null);if("AsyncGenerator"===t[Symbol.toStringTag])return R(t,e,n,r);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return R(t[Symbol.asyncIterator](),e,n,r);var i=E(t),a=!1,o=!1,s=0,u=!1;function c(e,t){if(!o)if(s-=1,e)a=!0,r(e);else if(!1===e)a=!0,o=!0;else{if(t===A||a&&s<=0)return a=!0,r(null);u||l()}}function l(){for(u=!0;s<e&&!a;){var t=i();if(null===t)return a=!0,void(s<=0&&r(null));s+=1,n(t.value,t.key,N(c))}u=!1}l()}};var C=x((function(e,t,n,r){return j(t)(e,w(n),r)}),4);function P(e,t,n){n=I(n);var r=0,i=0,a=e.length,o=!1;function s(e,t){!1===e&&(o=!0),!0!==o&&(e?n(e):++i!==a&&t!==A||n(null))}for(0===a&&n(null);r<a;r++)t(e[r],r,N(s))}function M(e,t,n){return C(e,1/0,t,n)}var D=x((function(e,t,n){return(T(e)?P:M)(e,w(t),n)}),3);var L=x((function(e,t,n){return O(D,e,t,n)}),3),B=k(L);var F=x((function(e,t,n){return C(e,1,t,n)}),3);var q=x((function(e,t,n){return O(F,e,t,n)}),3),U=k(q),z=Symbol("promiseCallback");function J(){var e,t;function n(n){if(n)return t(n);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];e(i.length>1?i:i[0])}return n[z]=new Promise((function(n,r){e=n,t=r})),n}function G(e,t,n){"number"!=typeof t&&(n=t,t=null),n=I(n||J());var r=Object.keys(e).length;if(!r)return n(null);t||(t=r);var i={},a=0,o=!1,s=!1,c=Object.create(null),l=[],f=[],p={};function d(e,t){l.push((function(){return function(e,t){if(s)return;var r=N((function(t){for(var r=arguments.length,l=new Array(r>1?r-1:0),f=1;f<r;f++)l[f-1]=arguments[f];if(a--,!1!==t){if(l.length<2){var p=l,d=u(p,1);l=d[0]}if(t){var h={};if(Object.keys(i).forEach((function(e){h[e]=i[e]})),h[e]=l,s=!0,c=Object.create(null),o)return;n(t,h)}else i[e]=l,v(e)}else o=!0}));a++;var l=w(t[t.length-1]);t.length>1?l(i,r):l(r)}(e,t)}))}function h(){if(!o){if(0===l.length&&0===a)return n(null,i);for(;l.length&&a<t;){l.shift()()}}}function v(e){(c[e]||[]).forEach((function(e){return e()})),h()}function m(t){var n=[];return Object.keys(e).forEach((function(r){var i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)})),n}return Object.keys(e).forEach((function(t){var n=e[t];if(!Array.isArray(n))return d(t,[n]),void f.push(t);var r=n.slice(0,n.length-1),i=r.length;if(0===i)return d(t,n),void f.push(t);p[t]=i,r.forEach((function(a){if(!e[a])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(", "));!function(e,t){var n=c[e];n||(n=c[e]=[]);n.push(t)}(a,(function(){0===--i&&d(t,n)}))}))})),function(){var e,t=0;for(;f.length;)e=f.pop(),t++,m(e).forEach((function(e){0==--p[e]&&f.push(e)}));if(t!==r)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),h(),n[z]}var H=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,V=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,W=/,/,Q=/(=.+)?(\s*)$/;function K(e,t){var n={};return Object.keys(e).forEach((function(t){var r,i=e[t],a=S(i),o=!a&&1===i.length||a&&0===i.length;if(Array.isArray(i))r=s(i),i=r.pop(),n[t]=r.concat(r.length>0?c:i);else if(o)n[t]=i;else{if(r=function(e){var t=function(e){for(var t="",n=0,r=e.indexOf("*/");n<e.length;)if("/"===e[n]&&"/"===e[n+1]){var i=e.indexOf("\n",n);n=-1===i?e.length:i}else if(-1!==r&&"/"===e[n]&&"*"===e[n+1]){var a=e.indexOf("*/",n);-1!==a?(n=a+2,r=e.indexOf("*/",n)):(t+=e[n],n++)}else t+=e[n],n++;return t}(e.toString()),n=t.match(H);if(n||(n=t.match(V)),!n)throw new Error("could not parse args in autoInject\nSource:\n"+t);return u(n,2)[1].replace(/\s/g,"").split(W).map((function(e){return e.replace(Q,"").trim()}))}(i),0===i.length&&!a&&0===r.length)throw new Error("autoInject task functions require explicit parameters.");a||r.pop(),n[t]=r.concat(c)}function c(e,t){var n=r.map((function(t){return e[t]}));n.push(t),w(i).apply(void 0,s(n))}})),G(n,t)}var Y=function(){function e(){a(this,e),this.head=this.tail=null,this.length=0}return o(e,[{key:"removeLink",value:function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}},{key:"empty",value:function(){for(;this.head;)this.shift();return this}},{key:"insertAfter",value:function(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}},{key:"insertBefore",value:function(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}},{key:"unshift",value:function(e){this.head?this.insertBefore(this.head,e):X(this,e)}},{key:"push",value:function(e){this.tail?this.insertAfter(this.tail,e):X(this,e)}},{key:"shift",value:function(){return this.head&&this.removeLink(this.head)}},{key:"pop",value:function(){return this.tail&&this.removeLink(this.tail)}},{key:"toArray",value:function(){return s(this)}},{key:Symbol.iterator,value:i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.data;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))},{key:"remove",value:function(e){for(var t=this.head;t;){var n=t.next;e(t)&&this.removeLink(t),t=n}return this}}]),e}();function X(e,t){e.length=1,e.head=e.tail=t}function $(e,t,n){var a;if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var o=w(e),s=0,u=[],c={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function l(e,t){return e?t?void(c[e]=c[e].filter((function(e){return e!==t}))):c[e]=[]:Object.keys(c).forEach((function(e){return c[e]=[]}))}function f(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];c[e].forEach((function(e){return e.apply(void 0,n)}))}var p=!1;function d(e,t,n,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");var i,a;function o(e){if(e)return n?a(e):i();for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(r.length<=1)return i(r[0]);i(r)}b.started=!0;var s=b._createTaskItem(e,n?o:r||o);if(t?b._tasks.unshift(s):b._tasks.push(s),p||(p=!0,g((function(){p=!1,b.process()}))),n||!r)return new Promise((function(e,t){i=e,a=t}))}function h(e){return function(t){s-=1;for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var a=0,o=e.length;a<o;a++){var c,l=e[a],p=u.indexOf(l);0===p?u.shift():p>0&&u.splice(p,1),(c=l).callback.apply(c,[t].concat(r)),null!=t&&f("error",t,l.data)}s<=b.concurrency-b.buffer&&f("unsaturated"),b.idle()&&f("drain"),b.process()}}function v(e){return!(0!==e.length||!b.idle())&&(g((function(){return f("drain")})),!0)}var m=function(e){return function(t){if(!t)return new Promise((function(t,n){!function(e,t){c[e].push((function n(){l(e,n),t.apply(void 0,arguments)}))}(e,(function(e,r){if(e)return n(e);t(r)}))}));l(e),function(e,t){c[e].push(t)}(e,t)}},y=!1,b=(a={_tasks:new Y,_createTaskItem:function(e,t){return{data:e,callback:t}}},r(a,Symbol.iterator,i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(b._tasks[Symbol.iterator](),"t0",1);case 1:case"end":return e.stop()}}),e)}))),r(a,"concurrency",t),r(a,"payload",n),r(a,"buffer",t/4),r(a,"started",!1),r(a,"paused",!1),r(a,"push",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!1,!1,t)}))}return d(e,!1,!1,t)})),r(a,"pushAsync",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!1,!0,t)}))}return d(e,!1,!0,t)})),r(a,"kill",(function(){l(),b._tasks.empty()})),r(a,"unshift",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!0,!1,t)}))}return d(e,!0,!1,t)})),r(a,"unshiftAsync",(function(e,t){if(Array.isArray(e)){if(v(e))return;return e.map((function(e){return d(e,!0,!0,t)}))}return d(e,!0,!0,t)})),r(a,"remove",(function(e){b._tasks.remove(e)})),r(a,"process",(function(){if(!y){for(y=!0;!b.paused&&s<b.concurrency&&b._tasks.length;){var e=[],t=[],n=b._tasks.length;b.payload&&(n=Math.min(n,b.payload));for(var r=0;r<n;r++){var i=b._tasks.shift();e.push(i),u.push(i),t.push(i.data)}s+=1,0===b._tasks.length&&f("empty"),s===b.concurrency&&f("saturated");var a=N(h(e));o(t,a)}y=!1}})),r(a,"length",(function(){return b._tasks.length})),r(a,"running",(function(){return s})),r(a,"workersList",(function(){return u})),r(a,"idle",(function(){return b._tasks.length+s===0})),r(a,"pause",(function(){b.paused=!0})),r(a,"resume",(function(){!1!==b.paused&&(b.paused=!1,g(b.process))})),a);return Object.defineProperties(b,{saturated:{writable:!1,value:m("saturated")},unsaturated:{writable:!1,value:m("unsaturated")},empty:{writable:!1,value:m("empty")},drain:{writable:!1,value:m("drain")},error:{writable:!1,value:m("error")}}),b}function Z(e,t){return $(e,1,t)}function ee(e,t,n){return $(e,t,n)}var te=x((function(e,t,n,r){r=I(r);var i=w(n);return F(e,(function(e,n,r){i(t,e,(function(e,n){t=n,r(e)}))}),(function(e){return r(e,t)}))}),4);function ne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(w);return function(){for(var e=this,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];var a=n[n.length-1];return"function"==typeof a?n.pop():a=J(),te(r,n,(function(t,n,r){n.apply(e,t.concat((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];r(e,n)})))}),(function(e,t){return a.apply(void 0,[e].concat(s(t)))})),a[z]}}function re(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ne.apply(void 0,s(t.reverse()))}var ie=x((function(e,t,n,r){return O(j(t),e,n,r)}),4);var ae=x((function(e,t,n,r){var i=w(n);return ie(e,t,(function(e,t){i(e,(function(e){if(e)return t(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t(e,r)}))}),(function(e,t){for(var n=[],i=0;i<t.length;i++){var a;if(t[i])n=(a=n).concat.apply(a,s(t[i]))}return r(e,n)}))}),4);var oe=x((function(e,t,n){return ae(e,1/0,t,n)}),3);var se=x((function(e,t,n){return ae(e,1,t,n)}),3);function ue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n.pop();return i.apply(void 0,[null].concat(t))}}function ce(e,t){return function(n,r,i,a){var o,s=!1,u=w(i);n(r,(function(n,r,i){u(n,(function(r,a){return r||!1===r?i(r):e(a)&&!o?(s=!0,o=t(!0,n),i(null,A)):void i()}))}),(function(e){if(e)return a(e);a(null,s?o:t(!1))}))}}var le=x((function(e,t,n){return ce((function(e){return e}),(function(e,t){return t}))(D,e,t,n)}),3);var fe=x((function(e,t,n,r){return ce((function(e){return e}),(function(e,t){return t}))(j(t),e,n,r)}),4);var pe=x((function(e,t,n){return ce((function(e){return e}),(function(e,t){return t}))(j(1),e,t,n)}),3);function de(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return w(t).apply(void 0,r.concat([function(t){if("object"===("undefined"==typeof console?"undefined":c(console)))if(t)console.error&&console.error(t);else if(console[e]){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];r.forEach((function(t){return console[e](t)}))}}]))}}var he=de("dir");var ve=x((function(e,t,n){n=N(n);var r,i=w(e),a=w(t);function o(e){if(e)return n(e);if(!1!==e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];r=i,a.apply(void 0,i.concat([u]))}}function u(e,t){return e?n(e):!1!==e?t?void i(o):n.apply(void 0,[null].concat(s(r))):void 0}return u(null,!0)}),3);function me(e,t,n){var r=w(t);return ve(e,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=t.pop();r.apply(void 0,t.concat([function(e,t){return i(e,!t)}]))}),n)}function ge(e){return function(t,n,r){return e(t,r)}}var ye=x((function(e,t,n){return D(e,ge(w(t)),n)}),3);var be=x((function(e,t,n,r){return j(t)(e,ge(w(n)),r)}),4);var _e=x((function(e,t,n){return be(e,1,t,n)}),3);function Se(e){return S(e)?e:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.pop(),a=!0;n.push((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];a?g((function(){return i.apply(void 0,t)})):i.apply(void 0,t)})),e.apply(this,n),a=!1}}var we=x((function(e,t,n){return ce((function(e){return!e}),(function(e){return!e}))(D,e,t,n)}),3);var xe=x((function(e,t,n,r){return ce((function(e){return!e}),(function(e){return!e}))(j(t),e,n,r)}),4);var ke=x((function(e,t,n){return ce((function(e){return!e}),(function(e){return!e}))(F,e,t,n)}),3);function Oe(e,t,n,r){var i=new Array(t.length);e(t,(function(e,t,r){n(e,(function(e,n){i[t]=!!n,r(e)}))}),(function(e){if(e)return r(e);for(var n=[],a=0;a<t.length;a++)i[a]&&n.push(t[a]);r(null,n)}))}function Te(e,t,n,r){var i=[];e(t,(function(e,t,r){n(e,(function(n,a){if(n)return r(n);a&&i.push({index:t,value:e}),r(n)}))}),(function(e){if(e)return r(e);r(null,i.sort((function(e,t){return e.index-t.index})).map((function(e){return e.value})))}))}function Ae(e,t,n,r){return(T(t)?Oe:Te)(e,t,w(n),r)}var Ie=x((function(e,t,n){return Ae(D,e,t,n)}),3);var Ee=x((function(e,t,n,r){return Ae(j(t),e,n,r)}),4);var Ne=x((function(e,t,n){return Ae(F,e,t,n)}),3);var Re=x((function(e,t){var n=N(t),r=w(Se(e));return function e(t){if(t)return n(t);!1!==t&&r(e)}()}),2);var je=x((function(e,t,n,r){var i=w(n);return ie(e,t,(function(e,t){i(e,(function(n,r){return n?t(n):t(n,{key:r,val:e})}))}),(function(e,t){for(var n={},i=Object.prototype.hasOwnProperty,a=0;a<t.length;a++)if(t[a]){var o=t[a].key,s=t[a].val;i.call(n,o)?n[o].push(s):n[o]=[s]}return r(e,n)}))}),4);function Ce(e,t,n){return je(e,1/0,t,n)}function Pe(e,t,n){return je(e,1,t,n)}var Me=de("log");var De=x((function(e,t,n,r){r=I(r);var i={},a=w(n);return j(t)(e,(function(e,t,n){a(e,t,(function(e,r){if(e)return n(e);i[t]=r,n(e)}))}),(function(e){return r(e,i)}))}),4);function Le(e,t,n){return De(e,1/0,t,n)}function Be(e,t,n){return De(e,1,t,n)}function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e},n=Object.create(null),r=Object.create(null),i=w(e),a=f((function(e,a){var o=t.apply(void 0,s(e));o in n?g((function(){return a.apply(void 0,[null].concat(s(n[o])))})):o in r?r[o].push(a):(r[o]=[a],i.apply(void 0,s(e).concat([function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),a=1;a<t;a++)i[a-1]=arguments[a];e||(n[o]=i);var s=r[o];delete r[o];for(var u=0,c=s.length;u<c;u++)s[u].apply(s,[e].concat(i))}])))}));return a.memo=n,a.unmemoized=e,a}var qe=m(h?process.nextTick:d?setImmediate:v),Ue=x((function(e,t,n){var r=T(t)?[]:{};e(t,(function(e,t,n){w(e)((function(e){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(a.length<2){var s=a,c=u(s,1);a=c[0]}r[t]=a,n(e)}))}),(function(e){return n(e,r)}))}),3);function ze(e,t){return Ue(D,e,t)}function Je(e,t,n){return Ue(j(t),e,n)}function Ge(e,t){var n=w(e);return $((function(e,t){n(e[0],t)}),t,1)}var He=function(){function e(){a(this,e),this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}return o(e,[{key:"empty",value:function(){return this.heap=[],this}},{key:"percUp",value:function(e){for(var t;e>0&&We(this.heap[e],this.heap[t=Ve(e)]);){var n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}},{key:"percDown",value:function(e){for(var t;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&We(this.heap[t+1],this.heap[t])&&(t+=1),!We(this.heap[e],this.heap[t]));){var n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}},{key:"push",value:function(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}},{key:"unshift",value:function(e){return this.heap.push(e)}},{key:"shift",value:function(){var e=u(this.heap,1)[0];return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}},{key:"toArray",value:function(){return s(this)}},{key:Symbol.iterator,value:i.mark((function e(){var t;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<this.heap.length)){e.next=7;break}return e.next=4,this.heap[t].data;case 4:t++,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))},{key:"remove",value:function(e){for(var t=0,n=0;n<this.heap.length;n++)e(this.heap[n])||(this.heap[t]=this.heap[n],t++);this.heap.splice(t);for(var r=Ve(this.heap.length-1);r>=0;r--)this.percDown(r);return this}},{key:"length",get:function(){return this.heap.length}}]),e}();function Ve(e){return(e+1>>1)-1}function We(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}function Qe(e,t){var n=Ge(e,t),r=n.push,i=n.pushAsync;function a(e,t){return Array.isArray(e)?e.map((function(e){return{data:e,priority:t}})):{data:e,priority:t}}return n._tasks=new He,n._createTaskItem=function(e,t){return{data:e.data,priority:e.priority,callback:t}},n.push=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return r(a(e,t),n)},n.pushAsync=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;return i(a(e,t),n)},delete n.unshift,delete n.unshiftAsync,n}var Ke=x((function(e,t){if(t=I(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var n=0,r=e.length;n<r;n++)w(e[n])(t)}),2);function Ye(e,t,n,r){var i=s(e).reverse();return te(i,t,n,r)}function Xe(e){var t=w(e);return f((function(e,n){return e.push((function(e){var t={};e&&(t.error=e);for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];if(i.length>0){var o=i;i.length<=1&&(o=i[0]),t.value=o}n(null,t)})),t.apply(this,e)}))}function $e(e){var t,n=this;return Array.isArray(e)?t=e.map(Xe):(t={},Object.keys(e).forEach((function(r){t[r]=Xe.call(n,e[r])}))),t}function Ze(e,t,n,r){var i=w(n);return Ae(e,t,(function(e,t){i(e,(function(e,n){t(e,!n)}))}),r)}var et=x((function(e,t,n){return Ze(D,e,t,n)}),3);var tt=x((function(e,t,n,r){return Ze(j(t),e,n,r)}),4);var nt=x((function(e,t,n){return Ze(F,e,t,n)}),3);function rt(e){return function(){return e}}function it(e,t,n){var r={times:5,intervalFunc:rt(0)};if(arguments.length<3&&"function"==typeof e?(n=t||J(),t=e):(at(r,e),n=n||J()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=w(t),a=1;function o(){i((function(e){if(!1!==e)if(e&&a++<r.times&&("function"!=typeof r.errorFilter||r.errorFilter(e)))setTimeout(o,r.intervalFunc(a-1));else{for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];n.apply(void 0,[e].concat(i))}}))}return o(),n[z]}function at(e,t){if("object"===c(t))e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:rt(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}function ot(e,t){t||(t=e,e=null);var n=e&&e.arity||t.length;S(t)&&(n+=1);var r=w(t);return f((function(t,i){function a(e){r.apply(void 0,s(t).concat([e]))}return(t.length<n-1||null==i)&&(t.push(i),i=J()),e?it(e,a,i):it(a,i),i[z]}))}function st(e,t){return Ue(F,e,t)}var ut=x((function(e,t,n){return ce(Boolean,(function(e){return e}))(D,e,t,n)}),3);var ct=x((function(e,t,n,r){return ce(Boolean,(function(e){return e}))(j(t),e,n,r)}),4);var lt=x((function(e,t,n){return ce(Boolean,(function(e){return e}))(F,e,t,n)}),3);var ft=x((function(e,t,n){var r=w(t);return L(e,(function(e,t){r(e,(function(n,r){if(n)return t(n);t(n,{value:e,criteria:r})}))}),(function(e,t){if(e)return n(e);n(null,t.sort(i).map((function(e){return e.value})))}));function i(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:n>r?1:0}}),3);function pt(e,t,n){var r=w(e);return f((function(i,a){var o,u=!1;i.push((function(){u||(a.apply(void 0,arguments),clearTimeout(o))})),o=setTimeout((function(){var t=e.name||"anonymous",r=new Error('Callback function "'+t+'" timed out.');r.code="ETIMEDOUT",n&&(r.info=n),u=!0,a(r)}),t),r.apply(void 0,s(i))}))}function dt(e,t,n,r){var i=w(n);return ie(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,r)}function ht(e,t,n){return dt(e,1/0,t,n)}function vt(e,t,n){return dt(e,1,t,n)}function mt(e,t,n,r){arguments.length<=3&&"function"==typeof t&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=I(r||J());var i=w(n);return D(e,(function(e,n,r){i(t,e,n,r)}),(function(e){return r(e,t)})),r[z]}var gt=x((function(e,t){var n,r=null;return _e(e,(function(e,t){w(e)((function(e){if(!1===e)return t(e);for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];n=a.length<2?a[0]:a,r=e,t(e?null:{})}))}),(function(){return t(r,n)}))}));function yt(e){return function(){return(e.unmemoized||e).apply(void 0,arguments)}}var bt=x((function(e,t,n){n=N(n);var r=w(t),i=w(e),a=[];function o(e){if(e)return n(e);for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];a=r,!1!==e&&i(u)}function u(e,t){return e?n(e):!1!==e?t?void r(o):n.apply(void 0,[null].concat(s(a))):void 0}return i(u)}),3);function _t(e,t,n){var r=w(e);return bt((function(e){return r((function(t,n){return e(t,!n)}))}),t,n)}var St=x((function(e,t){if(t=I(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var n=0;function r(t){w(e[n++]).apply(void 0,s(t).concat([N(i)]))}function i(i){if(!1!==i){for(var a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];if(i||n===e.length)return t.apply(void 0,[i].concat(o));r(o)}}r([])})),wt={apply:l,applyEach:B,applyEachSeries:U,asyncify:y,auto:G,autoInject:K,cargo:Z,cargoQueue:ee,compose:re,concat:oe,concatLimit:ae,concatSeries:se,constant:ue,detect:le,detectLimit:fe,detectSeries:pe,dir:he,doUntil:me,doWhilst:ve,each:ye,eachLimit:be,eachOf:D,eachOfLimit:C,eachOfSeries:F,eachSeries:_e,ensureAsync:Se,every:we,everyLimit:xe,everySeries:ke,filter:Ie,filterLimit:Ee,filterSeries:Ne,forever:Re,groupBy:Ce,groupByLimit:je,groupBySeries:Pe,log:Me,map:L,mapLimit:ie,mapSeries:q,mapValues:Le,mapValuesLimit:De,mapValuesSeries:Be,memoize:Fe,nextTick:qe,parallel:ze,parallelLimit:Je,priorityQueue:Qe,queue:Ge,race:Ke,reduce:te,reduceRight:Ye,reflect:Xe,reflectAll:$e,reject:et,rejectLimit:tt,rejectSeries:nt,retry:it,retryable:ot,seq:ne,series:st,setImmediate:g,some:ut,someLimit:ct,someSeries:lt,sortBy:ft,timeout:pt,times:ht,timesLimit:dt,timesSeries:vt,transform:mt,tryEach:gt,unmemoize:yt,until:_t,waterfall:St,whilst:bt,all:we,allLimit:xe,allSeries:ke,any:ut,anyLimit:ct,anySeries:lt,find:le,findLimit:fe,findSeries:pe,flatMap:oe,flatMapLimit:ae,flatMapSeries:se,forEach:ye,forEachSeries:_e,forEachLimit:be,forEachOf:D,forEachOfSeries:F,forEachOfLimit:C,inject:te,foldl:te,foldr:Ye,select:Ie,selectLimit:Ee,selectSeries:Ne,wrapSync:y,during:bt,doDuring:ve}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9),o=n(6),s=n(7);function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.GenesysCloudMediaSession=void 0;var l=n(36).__importDefault(n(95)),f=n(20),p=n(34),d=n(26),h=n(33),v=function(){function e(t,n){var r=this;o(this,e),this.webrtcExtension=t,this.iceCandidatesDiscovered=0,this.iceCandidatesReceivedFromPeer=0,this.state="pending",this.connectionState="starting",this.id=n.id,this.fromJid=n.fromJid,this.peerID=n.peerID,this.logger=n.logger,this.conversationId=n.conversationId,this.fromUserId=n.fromUserId,this.pc=this.peerConnection=new RTCPeerConnection({iceServers:n.iceServers,iceTransportPolicy:n.iceTransportPolicy}),this.originalRoomJid=n.originalRoomJid,this.sessionType=h.SessionTypes[n.sessionType],this.ignoreHostCandidatesFromRemote=!!n.ignoreHostCandidatesFromRemote,this.allowIPv6=!!n.allowIPv6,this.allowTCP=!!n.allowTCP,this.reinvite=!!n.reinvite,this.privAnswerMode=n.privAnswerMode,this.meetingId=n.meetingId;var i=new f.EventEmitter;Object.keys(i.__proto__).forEach((function(e){r[e]=i[e]})),n.optOutOfWebrtcStatsTelemetry||this.setupStatsGatherer(),this.peerConnection.addEventListener("icecandidate",this.onIceCandidate.bind(this)),this.peerConnection.addEventListener("iceconnectionstatechange",this.onIceStateChange.bind(this)),this.peerConnection.addEventListener("connectionstatechange",this.onConnectionStateChange.bind(this)),this.peerConnection.addEventListener("icecandidateerror",this.onIceCandidateError.bind(this))}var t,n,r,u,v,m,g,y,b,_,S,w;return s(e,[{key:"keepStateInSyncWithPeerConnection",value:function(){var e=this;this.stateSyncTimeout&&(clearTimeout(this.stateSyncTimeout),this.stateSyncTimeout=void 0);var t=Date.now();this.stateSyncTimeout=setTimeout((function(){Date.now()-t>4e3&&(e.log("warn","MediaSession detected timer anomally. Reasons include taxed resources or system sleep."),"ended"!==e.state&&["failed","closed"].includes(e.peerConnection.connectionState)&&(e.log("warn","state mismatch between session.state and peerConnection.connectionState, manually terminating the session",{sessionId:e.id,conversationId:e.conversationId,sessionType:e.sessionType}),e.onSessionTerminate())),"ended"!==e.state&&e.keepStateInSyncWithPeerConnection()}),2e3)}},{key:"setRemoteDescription",value:(w=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.peerConnection.setRemoteDescription({sdp:t,type:"offer"}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"getLogDetails",value:function(){return{conversationId:this.conversationId,sessionId:this.id,sessionType:this.sessionType}}},{key:"log",value:function(e,t,n,r){n||(n={});var i=c(c({},n),this.getLogDetails());this.logger[e](t,i,r)}},{key:"sendGenesysWebrtc",value:(S=a(i.mark((function e(t){var n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.id=t.id||p.v4(),t.jsonrpc=t.jsonrpc||"2.0",n={type:"set",genesysWebrtc:t,from:this.webrtcExtension.jid,to:this.peerID},e.abrupt("return",this.webrtcExtension.sendIq(n));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"end",value:(_=a(i.mark((function e(){var t,n,r,a=this,o=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:"success",n=o.length>1&&void 0!==o[1]&&o[1],this.state="ended",r={sessionId:this.id,reason:t.condition||t},n){e.next=7;break}return e.next=7,d.timeoutPromise((function(e,t){a.log("info","sending sdp terminate"),a.sendGenesysWebrtc({jsonrpc:"2.0",method:"terminate",params:r}).then(e,t)}),2e3,"Timeout waiting for response to termination request",{sessionId:this.id,conversationId:this.conversationId,sessionType:this.sessionType}).catch((function(e){return a.logger.error(e)}));case 7:this.onSessionTerminate(r.reason);case 8:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"setupStatsGatherer",value:function(){this.statsGatherer=new l.default(this.peerConnection),this.statsGatherer.on("stats",this.emit.bind(this,"stats"))}},{key:"onIceStateChange",value:(b=a(i.mark((function e(){var t,n,r,a,o;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.peerConnection.iceConnectionState,n=this.id,r=this.conversationId,a=this.sessionType,this.log("info","ICE state changed: ",{iceState:t,sessionId:n,conversationId:r}),"disconnected"!==t){e.next=9;break}"stable"===this.peerConnection.signalingState&&(this.interruptionStart=new Date,this.log("info","Connection state is interrupted",{sessionId:n,conversationId:r,sessionType:a})),e.next=18;break;case 9:if("connected"!==t){e.next=17;break}return this.log("info","sending session-info: active"),o={sessionId:this.id,status:"active"},e.next=14,this.sendGenesysWebrtc({jsonrpc:"2.0",params:o,method:"info"});case 14:this._setupDataChannel(),e.next=18;break;case 17:"failed"===t&&this.log("info","ICE connection failed",{candidatesDiscovered:this.iceCandidatesDiscovered,candidatesReceivedFromPeer:this.iceCandidatesReceivedFromPeer});case 18:case"end":return e.stop()}}),e,this)}))),function(){return b.apply(this,arguments)})},{key:"onConnectionStateChange",value:function(){var e=this.connectionState=this.peerConnection.connectionState,t=this.id,n=this.conversationId,r=this.sessionType;if("connected"===e&&this.keepStateInSyncWithPeerConnection(),this.log("info","Connection state changed: ",{connectionState:e,sessionId:t,conversationId:n,sessionType:r}),this.interruptionStart)if("connected"===e){var i=(new Date).getTime()-this.interruptionStart.getTime();this.log("info","Connection was interrupted but was successfully recovered/connected",{sessionId:t,conversationId:n,sessionType:r,timeToRecover:i}),this.interruptionStart=void 0}else"failed"===e&&(this.log("info","Connection was interrupted and failed to recover, cleaning up",{sessionId:t,conversationId:n,sessionType:r}),this.onSessionTerminate());this.emit("connectionState",e)}},{key:"onIceCandidateError",value:function(e){var t=e;this.log("error","IceCandidateError",{errorCode:t.errorCode,errorText:t.errorText,url:t.url})}},{key:"createIceCandidate",value:function(e,t){return new RTCIceCandidate({sdpMid:e,candidate:t})}},{key:"addRemoteIceCandidate",value:(y=a(i.mark((function e(t){var n,r,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.match(/m=([^\s]+)/)[1],r=t.match(/a=([^\\\r]+)/)[1],a=this.createIceCandidate(n,r),e.next=5,this.peerConnection.addIceCandidate(a);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"onIceCandidate",value:function(e){var t,n,r,i=null===(t=e.candidate)||void 0===t?void 0:t.candidate,a=null===(n=e.candidate)||void 0===n?void 0:n.sdpMid;if(e.candidate){if(!this.allowTCP&&"tcp"===e.candidate.protocol)return;if(!this.allowIPv6){var o=/.+udp [^ ]+ ([^ ]+).*typ host/.exec(e.candidate.candidate);if(o&&!o[1].match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/))return void this.log("debug","Filtering out IPv6 candidate",e.candidate.candidate)}this.log("debug","Processing ice candidate",e.candidate),this.log("info","Discovered ice candidate to send to peer",{type:e.candidate.type}),this.iceCandidatesDiscovered++,r="m=".concat(a," 9 RTP/AVP 0\r\na=").concat(i,"\r\n")}else r="a=end-of-candidates\r\n",this.emit("endOfCandidates");return this.sendGenesysWebrtc({jsonrpc:"2.0",method:"iceCandidate",params:{sessionId:this.id,sdp:r}})}},{key:"onSessionTerminate",value:function(e){this.state="ended",this.peerConnection&&this.peerConnection.close(),this.logger.info("emitting sdp media-session (terminate)"),this.emit("terminated",{condition:e||"success"})}},{key:"addTrack",value:(g=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this.peerConnection.getTransceivers().find((function(e){var n;return!e.sender.track&&(null===(n=e.receiver.track)||void 0===n?void 0:n.kind)===t.kind})))){e.next=3;break}return e.abrupt("return",r.sender.replaceTrack(t));case 3:this.peerConnection.addTrack(t,n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"_setupDataChannel",value:function(){var e,t=this;this.dataChannel||(null===(e=this.peerConnection.remoteDescription)||void 0===e?void 0:e.sdp.includes("webrtc-datachannel"))&&(this.log("info","creating data channel"),this.dataChannel=this.peerConnection.createDataChannel("videoConferenceControl"),this.dataChannel.addEventListener("open",(function(){t.log("info","data channel opened")})),this.dataChannel.addEventListener("message",this._handleDataChannelMessage.bind(this)),this.dataChannel.addEventListener("close",(function(){t.log("info","closing data channel")})),this.dataChannel.addEventListener("error",(function(e){t.log("error","Error occurred with the data channel",e)})))}},{key:"_handleDataChannelMessage",value:function(e){try{var t=JSON.parse(e.data);this.emit("dataChannelMessage",t)}catch(e){this.log("error","Failed to parse data channel message",{error:e})}}},{key:"accept",value:(m=a(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="active",e.next=3,this.peerConnection.createAnswer();case 3:return t=e.sent,e.next=6,this.peerConnection.setLocalDescription(t);case 6:return n={sdp:t.sdp,sessionId:this.id},this.logger.info("sending sdp answer",n),e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"answer",params:n}));case 9:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"mute",value:(v=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"mute",params:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"unmute",value:(u=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={sessionId:this.id,type:n},e.abrupt("return",this.sendGenesysWebrtc({jsonrpc:"2.0",method:"unmute",params:r}));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"removeTrack",value:(r=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return r.apply(this,arguments)})},{key:"hold",value:(n=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"resume",value:(t=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Not Implemented");case 1:case"end":return e.stop()}}),e)}))),function(){return t.apply(this,arguments)})},{key:"toString",value:function(){return{connectionState:this.connectionState,state:this.state,sessionType:this.sessionType,fromJid:this.fromJid,conversationId:this.conversationId,id:this.id,peerConnection:this.peerConnection}}}]),e}();t.GenesysCloudMediaSession=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.core=void 0;var r=n(15);(0,r.__exportStar)(n(99),t),(0,r.__exportStar)(n(100),t),(0,r.__exportStar)(n(101),t),(0,r.__exportStar)(n(102),t),(0,r.__exportStar)(n(103),t),(0,r.__exportStar)(n(104),t),(0,r.__exportStar)(n(105),t),(0,r.__exportStar)(n(106),t),(0,r.__exportStar)(n(107),t),(0,r.__exportStar)(n(108),t),(0,r.__exportStar)(n(109),t),(0,r.__exportStar)(n(111),t),(0,r.__exportStar)(n(112),t),(0,r.__exportStar)(n(113),t),(0,r.__exportStar)(n(114),t),(0,r.__exportStar)(n(115),t),(0,r.__exportStar)(n(116),t),(0,r.__exportStar)(n(117),t);var i=(0,r.__importDefault)(n(99)),a=(0,r.__importDefault)(n(100)),o=(0,r.__importDefault)(n(101)),s=(0,r.__importDefault)(n(102)),u=(0,r.__importDefault)(n(103)),c=(0,r.__importDefault)(n(104)),l=(0,r.__importDefault)(n(105)),f=(0,r.__importDefault)(n(106)),p=(0,r.__importDefault)(n(107)),d=(0,r.__importDefault)(n(108)),h=(0,r.__importDefault)(n(109)),v=(0,r.__importDefault)(n(111)),m=(0,r.__importDefault)(n(112)),g=(0,r.__importDefault)(n(113)),y=(0,r.__importDefault)(n(114)),b=(0,r.__importDefault)(n(115)),_=(0,r.__importDefault)(n(116)),S=(0,r.__importDefault)(n(117));t.core=function(e){e.use(f.default),e.use(c.default),e.use(o.default),e.use(u.default),e.use(p.default),e.use(_.default)},t.default=function(e){e.use(i.default),e.use(v.default),e.use(a.default),e.use(s.default),e.use(l.default),e.use(d.default),e.use(h.default),e.use(m.default),e.use(g.default),e.use(y.default),e.use(b.default),e.use(S.default)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"XRD",fields:{subject:(0,r.childText)(null,"Subject")},namespace:i.NS_XRD,path:"xrd"},{aliases:[{path:"xrd.links",multiple:!0}],element:"Link",fields:{href:(0,r.attribute)("href"),rel:(0,r.attribute)("rel"),type:(0,r.attribute)("type")},namespace:i.NS_XRD}];t.default=a},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);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){a(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=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}),t.MessengerExtension=void 0;var h=n(272),v=n(22),m=n(34),g=function(e){u(a,e);var t,n=d(a);function a(e,t){var r;return o(this,a),(r=n.call(this)).client=e,r.stanzaInstance=t,r}return s(a,[{key:"handleStanzaInstanceChange",value:function(e){this.stanzaInstance=e}},{key:"isMediaMessage",value:function(e){return!!e.mediaMessage}},{key:"handleMessage",value:function(e){if(this.isMediaMessage(e)){var t=e.from===this.stanzaInstance.jid,n=v.toBare(e.from)===this.bareJid;this.emit("mediaMessage",p(p({},e),{},{fromMyClient:t,fromMyUser:n}))}}},{key:"broadcastMessage",value:(t=i(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=m.v4(),t.id=n,t.from=this.stanzaInstance.jid,t.to||(t.to=this.bareJid),e.next=6,this.stanzaInstance.send("message",t);case 6:return e.abrupt("return",n);case 7:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"bareJid",get:function(){return v.toBare(this.stanzaInstance.jid)}},{key:"expose",get:function(){return{broadcastMessage:this.broadcastMessage.bind(this),on:this.on.bind(this),once:this.once.bind(this),off:this.off.bind(this),removeListener:this.removeListener.bind(this),addListener:this.addListener.bind(this)}}}]),a}(h.Emitter);t.MessengerExtension=g},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(6),s=n(7),u=n(24),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){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}),t.Client=void 0;var v=n(36),m=n(208),g=n(273);n(227);var y=n(228),b=n(233),_=n(259),S=n(260),w=n(26),x=n(45),k=n(33),O=v.__importDefault(n(20)),T=n(261),A=n(71),I=v.__importDefault(n(271)),E=v.__importDefault(n(199)),N=n(80),R=n(69),j=n(34),C={notifications:y.Notifications,webrtcSessions:b.WebrtcExtension,messenger:R.MessengerExtension},P=function(e){c(O,e);var t,n,l,f,d,v,y,b=h(O);function O(e){var t;o(this,O),(t=b.call(this)).connected=!1,t.connecting=!1,t.hardReconnectRequired=!0,t.isGuest=!1,t.backgroundAssistantMode=!1,t.autoReconnect=!0,t.extensions=[],t.channelReuses=0,t.hasMadeInitialAttempt=!1,t.jidResource="",t.http=new x.HttpClient({customHeaders:e.customHeaders}),t.reconnectOnNoLongerSubscribed=!1!==e.reconnectOnNoLongerSubscribed,t.useServerSidePings=!1!==e.useServerSidePings,t.config={host:e.host,apiHost:e.apiHost||e.host.replace("wss://streaming.",""),authToken:e.authToken,jwt:e.jwt,jid:e.jid,jidResource:e.jidResource,channelId:null,appName:e.appName,appVersion:e.appVersion,appId:e.appId,customHeaders:e.customHeaders},t.backgroundAssistantMode=t.checkIsBackgroundAssistant(),t.isGuest=!t.backgroundAssistantMode&&!e.authToken;var n=e.authToken||"",r="https://api.".concat(t.config.apiHost,"/api/v2/diagnostics/trace");return t.backgroundAssistantMode&&(n=e.jwt,r+="/backgroundassistant"),t.logger=new g.Logger({accessToken:n,url:r,uploadDebounceTime:1e3,initializeServerLogging:!t.isGuest&&!e.optOutOfWebrtcStatsTelemetry,appVersion:O.version,appName:"streaming-client",logLevel:t.config.logLevel||"info",logger:e.logger||console,formatters:e.logFormatters,originAppName:e.appName,originAppVersion:e.appVersion,originAppId:e.appId,customHeaders:e.customHeaders}),t.connectionManager=new T.ConnectionManager(t.logger,t.config),Object.keys(C).forEach((function(n){var r=new C[n](u(t),e);t.extensions.push(r),r.tokenBucket||(r.tokenBucket=new m.TokenBucket(20,25,1e3),r.tokenBucket.content=25),"function"==typeof r.on&&r.on("send",t.handleSendEventFromExtension.bind(u(t),r)),t[n]=r.expose,t["_".concat(n)]=r})),t}return s(O,[{key:"handleSendEventFromExtension",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return e.tokenBucket.removeTokens(1,(function(){var e=n.activeStanzaInstance;return e?!0===r?e.sendMessage(t):e.sendIQ(t):n.logger.warn("cannot send message, no active stanza client",{data:t,message:r},{skipServer:!0})}))}},{key:"checkIsBackgroundAssistant",value:function(){if(this.config.jwt){var e=w.parseJwt(this.config.jwt);return e&&"urn:purecloud:screenrecording"===e.iss}return!1}},{key:"addInateEventHandlers",value:function(e){this.removeStanzaBoundEventHandlers(),this.boundStanzaDisconnect=this.handleStanzaDisconnectedEvent.bind(this,e),this.boundStanzaNoLongerSubscribed=this.handleNoLongerSubscribed.bind(this,e),this.boundStanzaDuplicateId=this.handleDuplicateId.bind(this,e),this.on("stanzaDisconnected",this.boundStanzaDisconnect),this.on("notify:no_longer_subscribed",this.boundStanzaNoLongerSubscribed),this.on("notify:duplicate_id",this.boundStanzaDuplicateId),this.extensions.forEach((function(t){"function"==typeof t.handleIq&&e.on("iq",t.handleIq.bind(t)),"function"==typeof t.handleMessage&&e.on("message",t.handleMessage.bind(t))}))}},{key:"removeStanzaBoundEventHandlers",value:function(){this.boundStanzaDisconnect&&(this.off("stanzaDisconnected",this.boundStanzaDisconnect),this.boundStanzaDisconnect=void 0),this.boundStanzaNoLongerSubscribed&&(this.off("notify:no_longer_subscribed",this.boundStanzaNoLongerSubscribed),this.boundStanzaNoLongerSubscribed=void 0),this.boundStanzaDuplicateId&&(this.off("notify:duplicate_id",this.boundStanzaDuplicateId),this.boundStanzaDuplicateId=void 0)}},{key:"proxyStanzaEvents",value:function(e){var t=this;e.originalEmitter=e.emit,e.emit=function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=e.originalEmitter.apply(e,[n].concat(i));return"connected"===n?o:("disconnected"===n&&(n="stanzaDisconnected"),t.emit.apply(t,[n].concat(i)))}}},{key:"handleStanzaDisconnectedEvent",value:(y=a(i.mark((function e(t){var n,r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("stanzaDisconnected event received",{stanzaInstanceId:t.id,channelId:t.channelId}),this.connected=!1,this.connecting=!1,null===(n=t.pinger)||void 0===n||n.stop(),null===(r=t.serverMonitor)||void 0===r||r.stop(),this.removeAllListeners("stanzaDisconnected"),this.removeAllListeners("notify:no_longer_subscribed"),t.originalEmitter&&(t.emit=t.originalEmitter),this.activeStanzaInstance=void 0,this.emit("disconnected",{reconnecting:this.autoReconnect}),!this.autoReconnect){e.next=12;break}return e.abrupt("return",this.connect({keepTryingOnFailure:!0}));case 12:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"handleNoLongerSubscribed",value:function(e){var t,n;this.logger.warn("noLongerSubscribed event received",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0,this.reconnectOnNoLongerSubscribed||(this.autoReconnect=!1)}},{key:"handleDuplicateId",value:function(e){var t,n;this.logger.warn("duplicate_id event received, forcing hard reconnect",{stanzaInstanceId:e.id,channelId:e.channelId}),null===(t=e.pinger)||void 0===t||t.stop(),null===(n=e.serverMonitor)||void 0===n||n.stop(),this.hardReconnectRequired=!0}},{key:"disconnect",value:(v=a(i.mark((function e(){var t=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.info("streamingClient.disconnect was called"),this.activeStanzaInstance){e.next=3;break}return e.abrupt("return");case 3:return this.jidResource="",e.abrupt("return",w.timeoutPromise((function(e){return t.autoReconnect=!1,t.http.stopAllRetries(),t.activeStanzaInstance.disconnect().then(e)}),5e3,"disconnecting streaming service"));case 5:case"end":return e.stop()}}),e,this)}))),function(){return v.apply(this,arguments)})},{key:"getSessionStoreKey",value:function(){var e=this.config.appName||this.logger.clientId;return"".concat("sc_connectionData","_").concat(e)}},{key:"getConnectionData",value:function(){var e=sessionStorage.getItem(this.getSessionStoreKey()),t={currentDelayMs:0};if(e)try{return JSON.parse(e)}catch(e){return this.logger.warn("failed to parse streaming client connection data"),t}return t}},{key:"setConnectionData",value:function(e){sessionStorage.setItem(this.getSessionStoreKey(),JSON.stringify(e))}},{key:"increaseBackoff",value:function(){var e=this.getConnectionData(),t=Math.max(2*e.currentDelayMs,4e3),n={currentDelayMs:t,delayMsAfterNextReduction:t/2,nextDelayReductionTime:(new Date).getTime()+5*t,timeOfTotalReset:(new Date).getTime()+36e5};return this.setConnectionData(n),n}},{key:"decreaseBackoff",value:function(e){var t=this,n=this.getConnectionData(),r=5*e,i={currentDelayMs:e,delayMsAfterNextReduction:e/2,nextDelayReductionTime:(new Date).getTime()+r,timeOfTotalReset:n.timeOfTotalReset};if(n.timeOfTotalReset&&n.timeOfTotalReset<(new Date).getTime()||e<2e3)return this.logger.debug("decreaseBackoff() called, but timeOfTotalReset has elasped or next delay is below 2s. Resetting backoff"),this.setConnectionData({currentDelayMs:0});this.setConnectionData(i),clearTimeout(this.backoffReductionTimer),this.logger.debug("Setting timer for next backoff reduction since we haven't reached total reset",{msUntilReduction:r,delayMsAfterNextReduction:i.delayMsAfterNextReduction}),this.backoffReductionTimer=setTimeout((function(){return t.decreaseBackoff(i.delayMsAfterNextReduction)}),r)}},{key:"getStartingDelay",value:function(e,t){var n=Math.max(e.currentDelayMs,2e3);return e.timeOfTotalReset&&e.timeOfTotalReset<(new Date).getTime()?2e3:Math.min(n,t)}},{key:"connect",value:(d=a(i.mark((function e(t){var n,r,o,s,u,c,l,f,p,d,h,v=this;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.connecting){e.next=3;break}return r=new Error("Already trying to connect streaming client"),e.abrupt("return",this.logger.warn(r));case 3:return this.connecting=!0,o=(null==t?void 0:t.maxDelayBetweenConnectionAttempts)||9e4,s=(null==t?void 0:t.maxConnectionAttempts)||1,(null==t?void 0:t.keepTryingOnFailure)&&(s=1/0),clearTimeout(this.backoffReductionTimer),u=this.getConnectionData(),c=this.getStartingDelay(u,o),l=this.hasMadeInitialAttempt,this.hasMadeInitialAttempt=!0,u.currentDelayMs&&this.logger.debug("streamingClient.connect was called, but backoff is remembered",{currentDelayMs:u.currentDelayMs,delayingThisAttempt:l,clientId:this.logger.clientId,appName:this.config.appName}),e.prev=13,e.next=16,A.backOff(a(i.mark((function e(){var t,n;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=v.getConnectionData(),e.next=3,v.makeConnectionAttempt();case 3:t.nextDelayReductionTime&&(n=t.nextDelayReductionTime-(new Date).getTime(),v.logger.debug("Setting timer for next backoff reduction",{msUntilReduction:n,delayMsAfterNextReduction:t.delayMsAfterNextReduction}),v.backoffReductionTimer=setTimeout((function(){return v.decreaseBackoff(t.delayMsAfterNextReduction||0)}),n));case 4:case"end":return e.stop()}}),e)}))),{jitter:"none",maxDelay:o,numOfAttempts:s,startingDelay:c,delayFirstAttempt:l,retry:this.backoffConnectRetryHandler.bind(this,{maxConnectionAttempts:s})});case 16:e.next=24;break;case 18:throw e.prev=18,e.t0=e.catch(13),p=e.t0,e.t0?"AxiosError"===e.t0.name?(d=e.t0,h=d.config||{url:void 0,method:void 0},p={config:{url:h.url,method:h.method},status:null===(n=d.response)||void 0===n?void 0:n.status,code:d.code,name:d.name,message:d.message},f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Failed to connect streaming client due to network error",e.t0),this.networkErrorNeedsAuth(e.t0)&&(f=new w.StreamingClientError(k.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",e.t0))):e.t0 instanceof E.default?(f=new w.StreamingClientError(k.StreamingClientErrorTypes.invalid_token,"Failed to connect streaming client due to invalid token",e.t0),this.saslErrorIsRetryable(e.t0)&&(f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received a SASL error",e.t0))):f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an unknown error",e.t0):(f=new w.StreamingClientError(k.StreamingClientErrorTypes.generic,"Streaming client connection attempted and received an undefined error"),p=f),this.logger.error("Failed to connect streaming client",{error:p}),f;case 24:case"end":return e.stop()}}),e,this,[[13,18]])}))),function(e){return d.apply(this,arguments)})},{key:"backoffConnectRetryHandler",value:(f=a(i.mark((function e(t,n,r){var a,o,s,u,c,l,f,p,d,h,v,m;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r>=t.maxConnectionAttempts)){e.next=2;break}return e.abrupt("return",!1);case 2:if(c={connectionAttempt:r,error:n},n){e.next=7;break}c.error=new Error("streaming client backoff handler received undefined error"),e.next=15;break;case 7:if("AxiosError"!==n.name){e.next=15;break}if(f=(l=n).config||{url:void 0,method:void 0},p={config:{url:f.url,method:f.method},status:null===(a=l.response)||void 0===a?void 0:a.status,code:l.code,name:l.name,message:l.message},c.error=p,!this.networkErrorNeedsAuth(n)){e.next=15;break}return this.logger.error("Streaming client received an error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 15:if(!(n instanceof E.default)){e.next=25;break}if(!this.saslErrorIsRetryable(n)){e.next=22;break}this.logger.info("hardReconnectRequired set to true due to sasl error"),this.hardReconnectRequired=!0,Object.assign(c,{channelId:n.channelId,stanzaInstanceId:n.stanzaInstanceId}),e.next=25;break;case 22:return c.error=n.condition,this.logger.error("Streaming-client received a SASL error that it can't recover from and will not attempt to reconnect",c),e.abrupt("return",!1);case 25:if(n instanceof N.TimeoutError&&(c.error=n.message,(d=n.details)&&(c.details=d)),!(null==n?void 0:n.response)){e.next=36;break}if(!(h=(null===(o=n.response.headers)||void 0===o?void 0:o["retry-after"])||(null===(u=(s=n.response).getResponseHeader)||void 0===u?void 0:u.call(s,"retry-after")))){e.next=36;break}return v=1e3*parseInt(h,10),c.retryDelay=v,this.logger.error("Failed streaming client connection attempt, respecting retry-after header and will retry afterwards.",c,{skipServer:n instanceof I.default}),e.next=34,w.delay(v);case 34:return this.logger.debug("finished waiting for retry-after"),e.abrupt("return",!0);case 36:return m=this.increaseBackoff(),this.logger.error("Failed streaming client connection attempt, retrying",c,{skipServer:n instanceof I.default}),this.logger.debug("debug: retry info",{expectedRetryInMs:m.currentDelayMs,appName:this.config.appName,clientId:this.logger.clientId}),e.abrupt("return",!0);case 40:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"networkErrorNeedsAuth",value:function(e){var t;return[401,403].includes((null===(t=e.response)||void 0===t?void 0:t.status)||0)}},{key:"saslErrorIsRetryable",value:function(e){return["encryption-required","incorrect-encoding","invalid-mechanism","malformed-request","mechanism-too-weak"].includes(e.condition)}},{key:"makeConnectionAttempt",value:(l=a(i.mark((function e(){var t,n,r,a,o,s,u,c,l;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(navigator.onLine){e.next=2;break}throw new I.default("Browser is offline, skipping connection attempt");case 2:return a=this.connecting,e.prev=3,e.next=6,this.prepareForConnect();case 6:return e.next=8,this.connectionManager.getNewStanzaConnection();case 8:r=e.sent,this.connected=!0,this.connecting=!1,this.addInateEventHandlers(r),this.proxyStanzaEvents(r),o=p(this.extensions),e.prev=14,o.s();case 16:if((s=o.n()).done){e.next=23;break}if(!(u=s.value).configureNewStanzaInstance){e.next=21;break}return e.next=21,u.configureNewStanzaInstance(r);case 21:e.next=16;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(14),o.e(e.t0);case 28:return e.prev=28,o.f(),e.finish(28);case 31:c=p(this.extensions);try{for(c.s();!(l=c.n()).done;)l.value.handleStanzaInstanceChange(r)}catch(e){c.e(e)}finally{c.f()}return this.activeStanzaInstance=r,e.next=36,this.setupConnectionMonitoring(r);case 36:this.emit("connected"),e.next=51;break;case 39:if(e.prev=39,e.t1=e.catch(3),!r){e.next=50;break}return this.logger.error("Error occurred in connection attempt, but after websocket connected. Cleaning up connection so backoff is respected",{stanzaInstanceId:r.id,channelId:r.channelId}),this.removeStanzaBoundEventHandlers(),null===(t=r.pinger)||void 0===t||t.stop(),null===(n=r.serverMonitor)||void 0===n||n.stop(),e.next=48,r.disconnect();case 48:this.connected=!1,this.connecting=a;case 50:throw e.t1;case 51:case"end":return e.stop()}}),e,this,[[3,39],[14,25,28,31]])}))),function(){return l.apply(this,arguments)})},{key:"setupConnectionMonitoring",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(n=function(e){var n="".concat(e,", falling back to client-side pinging");r.logger.warn(n,{stanzaInstanceId:t.id,channelId:t.channelId}),t.pinger=new _.Ping(r,t)},!this.useServerSidePings){e.next=13;break}return e.prev=2,e.next=5,t.subscribeToNode(this._notifications.pubsubHost,"enable.server.side.pings");case 5:t.serverMonitor=new S.ServerMonitor(this,t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),n("failed to establish server-side pinging");case 11:e.next=14;break;case 13:n("client configured to not use server-side pinging");case 14:case"end":return e.stop()}}),e,this,[[2,8]])}))),function(e){return n.apply(this,arguments)})},{key:"prepareForConnect",value:(t=a(i.mark((function e(){var t,n,a,o,s,u,c,l;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.config.jwt){e.next=3;break}return this.hardReconnectRequired=!1,e.abrupt("return",this.connectionManager.setConfig(this.config));case 3:if(this.hardReconnectRequired||(this.channelReuses++,this.channelReuses>=10&&(this.logger.warn("Forcing a hard reconnect due to max channel reuses",{channelId:this.config.channelId,channelReuses:this.channelReuses}),this.channelReuses=0,this.hardReconnectRequired=!0)),!this.hardReconnectRequired){e.next=31;break}if(!this.config.jid){e.next=9;break}t=Promise.resolve(this.config.jid),e.next=13;break;case 9:return n={method:"get",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},e.next=12,this.http.requestApi("users/me",n).then((function(e){return e.data.chat.jabberId}));case 12:t=e.sent;case 13:return this.jidResource=this.config.jidResource||j.v4(),a={method:"post",host:this.config.apiHost,authToken:this.config.authToken,logger:this.logger},e.next=17,this.http.requestApi("notifications/channels?connectionType=streaming",a).then((function(e){return e.data.id}));case 17:return o=e.sent,e.next=20,Promise.all([t,o]);case 20:s=e.sent,u=r(s,2),c=u[0],l=u[1],this.config.jid=c,this.config.jidResource=this.jidResource,this.config.channelId=l,this.autoReconnect=!0,this.logger.info("attempting to connect streaming client on channel",{channelId:l}),this.connectionManager.setConfig(this.config),this.hardReconnectRequired=!1;case 31:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"stopServerLogging",value:function(){this.logger.sendAllLogsInstantly(),this.logger.stopServerLogging()}},{key:"startServerLogging",value:function(){this.logger.startServerLogging()}},{key:"setAccessToken",value:function(e){this.config.authToken=e,this.logger.setAccessToken(e)}},{key:"version",get:function(){return O.version}}],[{key:"extend",value:function(e,t){if(C[e])throw new Error("Cannot register already existing namespace ".concat(e));C[e]=t}},{key:"version",get:function(){return"19.2.0"}}]),O}(O.default);t.Client=P},function(e,t,n){"use strict";var r=this&&this.__awaiter||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())}))},i=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(213),o=n(214);t.backOff=function(e,t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=a.getSanitizedOptions(t),[4,new s(e,n).execute()];case 1:return[2,r.sent()]}}))}))};var s=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,o.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}}))}))},e}()},function(e,t,n){var r=n(226);e.exports=function(e){return function(){return new r(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(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},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default,i=n(207);e.exports=function(e){var t=i(e,"string");return"symbol"===r(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){(function(t){var n=function(e,t,n,r){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=r,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(e,n){var r=this;return this.bucketSize?e>this.bucketSize?(t.nextTick(n.bind(null,"Requested tokens "+e+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),e>this.content?i():this.parentBucket?this.parentBucket.removeTokens(e,(function(t,a){return t?n(t,null):e>r.content?i():(r.content-=e,void n(null,Math.min(a,r.content)))})):(this.content-=e,t.nextTick(n.bind(null,null,this.content)),!0)):(t.nextTick(n.bind(null,null,e,Number.POSITIVE_INFINITY)),!0);function i(){var t=Math.ceil((e-r.content)*(r.interval/r.tokensPerInterval));return setTimeout((function(){r.removeTokens(e,n)}),t),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},e.exports=n}).call(this,n(32))},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(216),i=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise((function(t){return setTimeout(t,e.jitteredDelay)}))},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return r.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,n=this.numOfDelayedAttempts,r=e*Math.pow(t,n);return Math.min(r,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=i},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}),t.TimeoutError=void 0;var c=function(e){i(n,e);var t=u(n);function n(e){return r(this,n),t.call(this,e)}return n}(s(Error));t.TimeoutError=c},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";var r=n(13),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}),t.saslprep=t.resourceprep=t.nodeprep=t.NodePrepProhibited=t.nameprep=t.prepare=t.D2=t.D1=t.C9=t.C8=t.C7=t.C6=t.C5=t.C4=t.C3=t.C22=t.C21=t.C12=t.C11=t.B3=t.B2=t.B1=t.A1=t.Table=void 0;var u=(0,n(15).__importDefault)(n(55)),c=n(234),l=function(){function e(t,n){i(this,e),this.singles=new Set,this.ranges=[],this.mappings=new Map;var a=c.TABLE_DATA[t];this.name=t,a?(a.s&&(this.singles=new Set(a.s.split("|").map((function(e){return parseInt(e,32)})))),a.r&&(this.ranges=a.r.split("|").map((function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1];return[parseInt(i,32),parseInt(a,32)]}))),a.m&&(this.mappings=new Map(a.m.split("|").map((function(e){var t=e.split(":"),n=r(t,2),i=n[0],a=n[1].split(";").map((function(e){return parseInt(e,32)}));return[parseInt(i,32),a]}))))):n&&(this.singles=new Set(n))}return a(e,[{key:"contains",value:function(e){if(this.singles.has(e))return!0;for(var t=0,n=this.ranges.length-1;t<=n;){var r=Math.floor((t+n)/2),i=this.ranges[r];if(e<i[0])n=r-1;else{if(!(e>i[1]))return!0;t=r+1}}return!1}},{key:"hasMapping",value:function(e){return this.mappings.has(e)||this.contains(e)}},{key:"map",value:function(e){return this.contains(e)&&!this.mappings.has(e)?String.fromCodePoint(e).toLowerCase().codePointAt(0):this.mappings.get(e)||null}}]),e}();function f(e,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=u.default.ucs2.decode(i),s=[],c=o(a);try{for(c.s();!(r=c.n()).done;){var l=r.value;if(!n&&e.unassigned.contains(l))throw new Error("Unassigned code point: x"+l.toString(16));var f,p=!1,d=o(e.mappings);try{for(d.s();!(f=d.n()).done;){var h=f.value;if(h.hasMapping(l)){p=!0;var v=h.map(l);v&&(Array.isArray(v)?s=s.concat(v):s.push(v))}}}catch(e){d.e(e)}finally{d.f()}p||s.push(l)}}catch(e){c.e(e)}finally{c.f()}var m=s;if(e.normalize){var g=u.default.ucs2.encode(s),y=g.normalize("NFKC");m=u.default.ucs2.decode(y)}var b,_=!1,S=!1,w=o(m);try{for(w.s();!(b=w.n()).done;){var x,k=b.value,O=o(e.prohibited);try{for(O.s();!(x=O.n()).done;){var T=x.value;if(T.contains(k))throw new Error("Prohibited code point: x"+k.toString(16))}}catch(e){O.e(e)}finally{O.f()}if(!n&&e.unassigned.contains(k))throw new Error("Prohibited code point: x"+k.toString(16));e.bidirectional&&(_=_||t.D1.contains(k),S=S||t.D2.contains(k))}}catch(e){w.e(e)}finally{w.f()}if(e.bidirectional){if(_&&S)throw new Error("String contained both LCat and RandALCat code points");if(_&&(!t.D1.contains(m[0])||!t.D1.contains(m[m.length-1])))throw new Error("String containing RandALCat code points must start and end with RandALCat code points")}return u.default.ucs2.encode(m)}t.Table=l,t.A1=new l("A.1"),t.B1=new l("B.1"),t.B2=new l("B.2"),t.B3=new l("B.3"),t.C11=new l("C.1.1"),t.C12=new l("C.1.2"),t.C21=new l("C.2.1"),t.C22=new l("C.2.2"),t.C3=new l("C.3"),t.C4=new l("C.4"),t.C5=new l("C.5"),t.C6=new l("C.6"),t.C7=new l("C.7"),t.C8=new l("C.8"),t.C9=new l("C.9"),t.D1=new l("D.1"),t.D2=new l("D.2"),t.B1.map=function(){return null},t.C11.contains=function(e){return 32===e},t.C12.map=function(e){return t.C12.contains(e)?32:null},t.prepare=f;var p={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C12,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.nameprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(p,t,e)},t.NodePrepProhibited=new l("NodePrepProhibited",[34,38,39,47,58,60,62,64]);var d={bidirectional:!0,mappings:[t.B1,t.B2],normalize:!0,prohibited:[t.C11,t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9,t.NodePrepProhibited],unassigned:t.A1};t.nodeprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(d,t,e)};var h={bidirectional:!0,mappings:[t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.resourceprep=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return f(h,t,e)};var v={bidirectional:!0,mappings:[t.C12,t.B1],normalize:!0,prohibited:[t.C12,t.C21,t.C22,t.C3,t.C4,t.C5,t.C6,t.C7,t.C8,t.C9],unassigned:t.A1};t.saslprep=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return f(v,t,e)}},function(e,t){e.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=n(12),i=n(4),a=n(13),o=n(6),s=n(7);function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(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 f(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 f(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 f(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 p=n(57),d=function(){function e(){o(this,e),this.parents=new Set,this.placeholder=!1,this.typeField="",this.versionField="",this.defaultType="",this.defaultVersion="",this.languageField="lang",this.typeValues=new Map,this.typeOrders=new Map,this.importers=new Map,this.exporters=new Map,this.children=new Map,this.childrenIndex=new Map,this.implicitChildren=new Set,this.contexts=new Map}return s(e,[{key:"addChild",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={multiple:n||!1,name:e,selector:r,translator:t},s=this.children.get(e);if(s){var u=s.translator;s.multiple=n,r&&s.selector&&r!==s.selector&&(s.selector=void 0);var c,f=l(t.importers);try{for(f.s();!(c=f.n()).done;){var p=a(c.value,2),d=p[0],h=p[1],v=(u.typeValues.get(d)||"").split("__v__"),m=a(v,2),g=m[0],y=m[1];u.updateDefinition({contexts:t.contexts,element:h.element,exporterOrdering:new Map,exporters:new Map,importerOrdering:h.fieldOrders,importers:h.fields,namespace:h.namespace,optionalNamespaces:new Map,type:g,version:y}),this.implicitChildren.has(d)||this.childrenIndex.set(d,e)}}catch(e){f.e(e)}finally{f.f()}var b,_=l(t.exporters);try{for(_.s();!(b=_.n()).done;){var S=a(b.value,2),w=S[0],x=S[1],k=w.split("__v__"),O=a(k,2),T=O[0],A=O[1];u.updateDefinition({contexts:t.contexts,element:x.element,exporterOrdering:x.fieldOrders,exporters:x.fields,importerOrdering:new Map,importers:new Map,namespace:x.namespace,optionalNamespaces:x.optionalNamespaces,type:T,version:A})}}catch(e){_.e(e)}finally{_.f()}}else{o.translator.parents.add(this),this.children.set(e,o);var I,E=l(t.importers);try{for(E.s();!(I=E.n()).done;){var N=a(I.value,1),R=N[0];this.implicitChildren.has(R)||this.childrenIndex.set(R,e)}}catch(e){E.e(e)}finally{E.f()}i&&this.implicitChildren.add(i)}}},{key:"addContext",value:function(e,t,n,r,i,a){t&&(e="".concat(e,"[").concat(t,"]"));var o=this.contexts.get(e);o||(o={typeField:"",versionField:"",typeValues:new Map}),a&&(o.impliedType=i),o.typeField=n||"",o.typeValues.set(r,i),this.contexts.set(e,o)}},{key:"getChild",value:function(e){var t=this.children.get(e);if(t)return t.translator}},{key:"getImportKey",value:function(e){return this.childrenIndex.get("{".concat(e.getNamespace(),"}").concat(e.getName()))}},{key:"updateDefinition",value:function(e){var t,n="{".concat(e.namespace,"}").concat(e.element),r=e.type||this.defaultType,i=e.version||this.defaultVersion,o=i?"".concat(r,"__v__").concat(i):r,s=this.importers.get(n)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace},u=l(e.importers);try{for(u.s();!(t=u.n()).done;){var c=a(t.value,2),f=c[0],p=c[1];s.fields.set(f,p)}}catch(e){u.e(e)}finally{u.f()}var d,h=l(e.importerOrdering);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];s.fieldOrders.set(m,g)}}catch(e){h.e(e)}finally{h.f()}this.importers.set(n,s);var y,b=this.exporters.get(o)||{element:e.element,fieldOrders:new Map,fields:new Map,namespace:e.namespace,optionalNamespaces:e.optionalNamespaces},_=l(e.exporters);try{for(_.s();!(y=_.n()).done;){var S=a(y.value,2),w=S[0],x=S[1];b.fields.set(w,x)}}catch(e){_.e(e)}finally{_.f()}var k,O=l(e.exporterOrdering);try{for(O.s();!(k=O.n()).done;){var T=a(k.value,2),A=T[0],I=T[1];b.fieldOrders.set(A,I)}}catch(e){O.e(e)}finally{O.f()}var E,N=l(e.optionalNamespaces);try{for(N.s();!(E=N.n()).done;){var R=a(E.value,2),j=R[0],C=R[1];b.optionalNamespaces.set(j,C)}}catch(e){N.e(e)}finally{N.f()}this.exporters.set(o,b);var P,M=l(e.contexts);try{for(M.s();!(P=M.n()).done;){var D=a(P.value,2),L=D[0],B=D[1],F=this.contexts.get(L)||{impliedType:void 0,typeField:B.typeField,versionField:B.versionField,typeValues:new Map};F.typeField||(F.typeField=B.typeField),F.versionField||(F.versionField=B.versionField),F.impliedType||(F.impliedType=B.impliedType);var q,U=l(B.typeValues);try{for(U.s();!(q=U.n()).done;){var z=a(q.value,2),J=z[0],G=z[1];F.typeValues.set(J,G)}}catch(e){U.e(e)}finally{U.f()}this.contexts.set(L,F)}}catch(e){M.e(e)}finally{M.f()}if(e.type)this.typeValues.set(n,o),e.typeOrder&&e.type&&this.typeOrders.set(e.type,e.typeOrder);else if(this.typeField&&!e.type){var H,V=l(this.importers);try{for(V.s();!(H=V.n()).done;){var W,Q=a(H.value,2)[1],K=l(e.importers);try{for(K.s();!(W=K.n()).done;){var Y=a(W.value,2),X=Y[0],$=Y[1];Q.fields.set(X,$)}}catch(e){K.e(e)}finally{K.f()}var Z,ee=l(e.importerOrdering);try{for(ee.s();!(Z=ee.n()).done;){var te=a(Z.value,2),ne=te[0],re=te[1];Q.fieldOrders.set(ne,re)}}catch(e){ee.e(e)}finally{ee.f()}}}catch(e){V.e(e)}finally{V.f()}var ie,ae=l(this.exporters);try{for(ae.s();!(ie=ae.n()).done;){var oe,se=a(ie.value,2)[1],ue=l(e.exporters);try{for(ue.s();!(oe=ue.n()).done;){var ce=a(oe.value,2),le=ce[0],fe=ce[1];se.fields.set(le,fe)}}catch(e){ue.e(e)}finally{ue.f()}var pe,de=l(e.exporterOrdering);try{for(de.s();!(pe=de.n()).done;){var he=a(pe.value,2),ve=he[0],me=he[1];se.fieldOrders.set(ve,me)}}catch(e){de.e(e)}finally{de.f()}}}catch(e){ae.e(e)}finally{ae.f()}}}},{key:"replaceWith",value:function(e){var t,n=l(this.children);try{for(n.s();!(t=n.n()).done;){var r=a(t.value,2),i=r[0],o=r[1];e.children.set(i,o)}}catch(e){n.e(e)}finally{n.f()}var s,u=l(this.childrenIndex);try{for(u.s();!(s=u.n()).done;){var c=a(s.value,2),f=c[0],p=c[1];e.childrenIndex.set(f,p)}}catch(e){u.e(e)}finally{u.f()}var d,h=l(this.contexts);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];e.contexts.set(m,g)}}catch(e){h.e(e)}finally{h.f()}var y,b=l(this.implicitChildren);try{for(b.s();!(y=b.n()).done;){var _=y.value;e.implicitChildren.add(_)}}catch(e){b.e(e)}finally{b.f()}var S,w=l(this.parents);try{for(w.s();!(S=w.n()).done;){var x,k=l(S.value.children.values());try{for(k.s();!(x=k.n()).done;){var O=x.value;O.translator===this&&(O.translator=e)}}catch(e){k.e(e)}finally{k.f()}}}catch(e){w.e(e)}finally{w.f()}this.parents=new Set}},{key:"import",value:function(e,t){var n="{".concat(e.getNamespace(),"}").concat(e.getName()),i={},o=this.importers.get(n);if(o){var s,u=(this.typeValues.get(n)||"").split("__v__"),f=a(u,2),p=f[0],d=f[1],h=t.path||"";if(t.pathSelector&&(s=this.contexts.get("".concat(h,"[").concat(t.pathSelector,"]"))),s||(s=this.contexts.get(h)),s){if(!s.impliedType){var v=s.typeValues.get(n)||"";v&&(i[s.typeField]=v)}}else this.typeField&&p&&p!==this.defaultType&&(i[this.typeField]=p);this.versionField&&d&&d!==this.defaultVersion&&(i[this.versionField]=d);var m,g=c(c({},t),{},{data:i,importer:o,lang:(e.getAttribute("xml:lang")||t.lang||"").toLowerCase(),pathSelector:p,translator:this}),y=r(o.fieldOrders.entries()).sort((function(e,t){return e[1]>t[1]?-1:e[1]<t[1]?1:0})),b=y.filter((function(e){return e[1]>=0})),_=y.filter((function(e){return e[1]<0})),S=l(b);try{for(S.s();!(m=S.n()).done;){var w=a(m.value,1)[0],x=o.fields.get(w);g.path="".concat(t.path,".").concat(w);var k=x(e,g);null!=k&&(i[w]=k)}}catch(e){S.e(e)}finally{S.f()}var O,T=l(e.children);try{for(T.s();!(O=T.n()).done;){var A=O.value;if("string"!=typeof A){var I="{".concat(A.getNamespace(),"}").concat(A.getName()),E=this.childrenIndex.get(I);if(E){g.path="".concat(t.path,".").concat(E);var N=this.children.get(E),R=N.translator,j=N.multiple,C=N.selector;if(!C||C===p){var P=R.import(A,g);void 0!==P&&(j?(i[E]||(i[E]=[]),i[E].push(P)):i[E]?i[E]=R.resolveCollision(i[E],P):i[E]=P)}}}}}catch(e){T.e(e)}finally{T.f()}var M,D=l(_);try{for(D.s();!(M=D.n()).done;){var L=a(M.value,1)[0],B=o.fields.get(L);g.path="".concat(t.path,".").concat(L);var F=B(e,g);null!=F&&(i[L]=F)}}catch(e){D.e(e)}finally{D.f()}return i}}},{key:"export",value:function(e,t){if(e){var n,r=this.defaultType,i=this.defaultVersion,o=t.path||"";t.pathSelector&&(n=this.contexts.get("".concat(o,"[").concat(t.pathSelector,"]"))),n||(n=this.contexts.get(o)),n?r=n.impliedType||e[n.typeField]||this.defaultType:this.typeField&&(r=e[this.typeField]||this.defaultType),this.versionField&&(i=e[this.versionField]||this.defaultVersion);var s=i?"".concat(r,"__v__").concat(i):r,u=this.exporters.get(s);if(u){var f=(0,p.createElement)(u.namespace,u.element,t.namespace,t.element);t.element&&(f.parent=t.element);var d,h=l(u.optionalNamespaces);try{for(h.s();!(d=h.n()).done;){var v=a(d.value,2),m=v[0],g=v[1];f.addOptionalNamespace(m,g)}}catch(e){h.e(e)}finally{h.f()}var y=c(c({},t),{},{data:e,element:f,exporter:u,lang:(e[this.languageField]||t.lang||"").toLowerCase(),namespace:f.getDefaultNamespace(),pathSelector:r,translator:this}),b=u.fields.get(this.languageField);b&&b(f,e[this.languageField],t);var _=Object.keys(e);_.sort((function(e,t){return(u.fieldOrders.get(e)||1e5)-(u.fieldOrders.get(t)||1e5)}));for(var S=0,w=_;S<w.length;S++){var x=w[S];if(x!==this.languageField){var k=e[x],O=u.fields.get(x);if(O)O(f,k,y);else{var T=this.children.get(x);if(T){y.path="".concat(t.path?t.path+".":"").concat(x);var A=T.translator,I=T.multiple,E=T.selector;if(!E||E===r){var N,R=l(I?null!=k?k:[]:[k]);try{for(R.s();!(N=R.n()).done;){var j=N.value,C=A.export(j,y);C&&f.appendChild(C)}}catch(e){R.e(e)}finally{R.f()}}}}}}return f}}}},{key:"resolveCollision",value:function(e,t){return(this.typeOrders.get(e[this.typeField]||this.defaultType)||0)<=(this.typeOrders.get(t[this.typeField]||this.defaultType)||0)?e:t}}]),e}();t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;var r=n(15),i=(0,r.__importDefault)(n(38));t.Hash=i.default;var a=(0,r.__importDefault)(n(248)),o=(0,r.__importDefault)(n(249)),s=(0,r.__importDefault)(n(250)),u=(0,r.__importDefault)(n(251)),c=new Map([["md5",a.default],["sha-1",o.default],["sha-256",s.default],["sha-512",u.default],["sha1",o.default],["sha256",s.default],["sha512",u.default]]);t.default=function(e){e=e.toLowerCase();var t=c.get(e);if(t)return new t;throw new Error("Unsupported hash algorithm: "+e)}},function(e,t,n){"use strict";(function(t,r){var i,a=n(42);e.exports=m,m.ReadableState=v;n(20).EventEmitter;var o=function(e,t){return e.listeners(t).length},s=n(20).EventEmitter,u=n(23).Buffer,c=t.Uint8Array||function(){};var l,f=Object.create(n(39)),p=n(246).BufferList,d=n(88);f.inherits(m,s);var h=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(i=i||n(37));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=n(90).StringDecoder),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function m(e){if(i=i||n(37),!(this instanceof m))return new m(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function g(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,_(e)}(e,o)):(i||(a=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):y(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?y(e,o,t,!1):w(e,o)):y(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function y(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&_(e)),w(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=d.destroy,m.prototype._undestroy=d.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),g(this,e,t,!1,n)},m.prototype.unshift=function(e){return g(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return l||(l=n(90).StringDecoder),this._readableState.decoder=new l(e),this._readableState.encoding=e,this};function b(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function _(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.flowing,t.emittedReadable=!0,t.sync?a.nextTick(S,e):S(e))}function S(e){e.emit("readable"),T(e)}function w(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(x,e,t))}function x(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function k(e){e.read(0)}function O(e,t){t.reading||e.read(0),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),T(e),t.flowing&&!t.reading&&e.read(0)}function T(e){var t=e._readableState;for(t.flowing;t.flowing&&null!==e.read(););}function A(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(E,t,e))}function E(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function N(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}m.prototype.read=function(e){e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return t.length,t.ended,0===t.length&&t.ended?I(this):_(this),null;if(0===(e=b(e,t))&&t.ended)return 0===t.length&&I(this),null;var r,i=t.needReadable;return(0===t.length||t.length-e<t.highWaterMark)&&(i=!0),t.ended||t.reading?i=!1:i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=b(n,t))),null===(r=e>0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&I(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,i.pipesCount;var s=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:g;function u(t,r){t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",h),e.removeListener("unpipe",u),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){e.end()}i.endEmitted?a.nextTick(s):n.once("end",s),e.on("unpipe",u);var l=function(e){return function(){var t=e._readableState;t.awaitDrain,t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,T(e))}}(n);e.on("drain",l);var f=!1;var p=!1;function d(t){p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==N(i.pipes,e))&&!f&&(n._readableState.awaitDrain,n._readableState.awaitDrain++,p=!0),n.pause())}function h(t){g(),e.removeListener("error",h),0===o(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",m),g()}function m(){e.removeListener("close",v),g()}function g(){n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",h),e.once("close",v),e.once("finish",m),e.emit("pipe",n),i.flowing||n.resume(),e},m.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)r[a].emit("unpipe",this,n);return this}var o=N(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},m.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&_(this):a.nextTick(k,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(O,e,t))}(this,e)),this},m.prototype.pause=function(){return this._readableState.flowing,!1!==this._readableState.flowing&&(this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var i in e.on("end",(function(){if(n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){(n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(t.push(i)||(r=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<h.length;a++)e.on(h[a],this.emit.bind(this,h[a]));return this._read=function(t){r&&(r=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=A}).call(this,n(25),n(32))},function(e,t,n){"use strict";var r=n(42);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t){var r=n(42);function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var a,o=r.nextTick;v.WritableState=h;var s=Object.create(n(39)),u=n(20).EventEmitter,c=n(23).Buffer,l=t.Uint8Array||function(){};var f,p=n(88);function d(){}function h(e,t){a=a||n(37),e=e||{};var s=t instanceof a;this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:s&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(S,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(a(i),e._writableState.errorEmitted=!0,e.emit("error",i),S(e,t))}(e,n,i,t,a);else{var s=b(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),i?o(g,e,n,s,a):g(e,n,s,a)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function v(e){if(a=a||n(37),!(f.call(v,this)||this instanceof a))return new v(e);this._writableState=new h(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function m(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function g(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),S(e,t)}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0,u=!0;n;)a[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;a.allBuffers=u,m(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(m(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function b(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),S(e,t)}))}function S(e,t){var n=b(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,r.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}s.inherits(v,u),h.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(h.prototype,"buffer",{get:function(){return this.getBuffer()}})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===v&&(e&&e._writableState instanceof h)}})):f=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,c.isBuffer(i)||i instanceof l);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=d),a.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),r.nextTick(i,o),a=!1),a}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,s,r,i,a);return u}(this,a,s,e,t,n)),o},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},v.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,S(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=p.destroy,v.prototype._undestroy=p.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(25))},function(e,t,n){"use strict";var r=n(23).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(t[r]))>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(37);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",o)}function o(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){s(e,t,n)})):s(this,null,null)}function s(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}Object.create(n(39)).inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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){a(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=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}),t.Receiver=t.Sender=void 0;var m=n(15),g=n(20),y=(0,m.__importStar)(n(21)),b=n(18),_=n(2),S=(0,m.__importDefault)(n(62)),w=n(44),x=n(63),k=function(e){u(n,e);var t=v(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(e=t.call(this)).config=h({chunkSize:16384,hash:"sha-1"},r),e.file=void 0,e.channel=void 0,e.hash=y.createHash(e.config.hash),e}return s(n,[{key:"send",value:function(e,t){var n=this;if(!this.file||!this.channel){this.file=e,this.channel=t,this.channel.binaryType="arraybuffer";var r=new FileReader,i=0,a=!1,o=function(){if(!(a||i>=e.size)){a=!0;var t=e.slice(i,i+n.config.chunkSize);r.readAsArrayBuffer(t)}};t.bufferedAmountLowThreshold=8*this.config.chunkSize,t.onbufferedamountlow=function(){o()},r.addEventListener("load",(function(t){var r=t.target.result;a=!1,i+=r.byteLength,n.channel.send(r),n.hash.update(new Uint8Array(r)),n.emit("progress",i,e.size,r),i<e.size?n.channel.bufferedAmount<=n.channel.bufferedAmountLowThreshold&&o():(n.emit("progress",e.size,e.size,null),n.emit("sentFile",{algorithm:n.config.hash,name:e.name,size:e.size,value:n.hash.digest()}))})),o()}}}]),n}(g.EventEmitter);t.Sender=k;var O=function(e){u(n,e);var t=v(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,n),(e=t.call(this)).config=h({hash:"sha-1"},r),e.receiveBuffer=[],e.received=0,e.channel=void 0,e.hash=y.createHash(e.config.hash),e}return s(n,[{key:"receive",value:function(e,t){var n=this;this.metadata=e,this.channel=t,this.channel.binaryType="arraybuffer",this.channel.onmessage=function(e){var t=e.data.byteLength;n.received+=t,n.receiveBuffer.push(e.data),e.data&&n.hash.update(new Uint8Array(e.data)),n.emit("progress",n.received,n.metadata.size,e.data),n.received===n.metadata.size?(n.metadata.actualhash=n.hash.digest("hex"),n.emit("receivedFile",new Blob(n.receiveBuffer),n.metadata),n.receiveBuffer=[]):n.received>n.metadata.size&&(console.error("received more than expected, discarding..."),n.receiveBuffer=[])}}}]),n}(g.EventEmitter);t.Receiver=O;var T=function(e){u(l,e);var t,n,a,c=v(l);function l(e){var t;return o(this,l),(t=c.call(this,e)).sender=void 0,t.receiver=void 0,t.file=void 0,t}return s(l,[{key:"start",value:(a=i(r.mark((function e(t,n){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=n||function(){},t&&"function"!=typeof t){e.next=3;break}throw new Error("File object required");case 3:return this.state="pending",this.role="initiator",this.file=t,this.sender=new k,this.sender.on("progress",(function(e,t){a._log("info","Send progress "+e+"/"+t)})),this.sender.on("sentFile",(function(e){a._log("info","Sent file",e.name),a.send(b.JingleAction.SessionInfo,{info:{creator:b.JingleSessionRole.Initiator,file:{hashes:[{algorithm:e.algorithm,value:e.value}]},infoType:b.JINGLE_INFO_CHECKSUM_5,name:a.contentName}}),a.parent.emit("sentFile",a,e)})),this.channel=this.pc.createDataChannel("filetransfer",{ordered:!0}),this.channel.onopen=function(){a.sender.send(a.file,a.channel)},e.prev=11,e.next=14,this.processLocal(b.JingleAction.SessionInitiate,i(r.mark((function e(){var n,i,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createOffer({offerToReceiveAudio:!1,offerToReceiveVideo:!1});case 2:return n=e.sent,i=(0,w.importFromSDP)(n.sdp),o=(0,x.convertIntermediateToRequest)(i,a.role,a.transportType),a.contentName=o.contents[0].name,o.sid=a.sid,o.action=b.JingleAction.SessionInitiate,o.contents[0].application={applicationType:_.NS_JINGLE_FILE_TRANSFER_5,file:{date:t.lastModified?new Date(t.lastModified):void 0,hashesUsed:[{algorithm:"sha-1"}],name:t.name,size:t.size}},a.send("session-initiate",o),e.next=12,a.pc.setLocalDescription(n);case 12:case"end":return e.stop()}}),e)}))));case 14:n(),e.next=21;break;case 17:return e.prev=17,e.t0=e.catch(11),this._log("error","Could not create WebRTC offer",e.t0),e.abrupt("return",this.end("failed-application",!0));case 21:case"end":return e.stop()}}),e,this,[[11,17]])}))),function(e,t){return a.apply(this,arguments)})},{key:"accept",value:(n=i(r.mark((function e(t){var n=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Accepted incoming session"),this.role="responder",this.state="active",t=t||function(){},e.prev=4,e.next=7,this.processLocal(b.JingleAction.SessionAccept,i(r.mark((function e(){var t,i,a,o,s;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.pc.createAnswer();case 2:t=e.sent,i=(0,w.importFromSDP)(t.sdp),(a=(0,x.convertIntermediateToRequest)(i,n.role,n.transportType)).sid=n.sid,a.action="session-accept",o=f(a.contents);try{for(o.s();!(s=o.n()).done;)s.value.creator="initiator"}catch(e){o.e(e)}finally{o.f()}return n.contentName=a.contents[0].name,n.send("session-accept",a),e.next=13,n.pc.setLocalDescription(t);case 13:return e.next=15,n.processBufferedCandidates();case 15:case"end":return e.stop()}}),e)}))));case 7:t(),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(4),this._log("error","Could not create WebRTC answer",e.t0),this.end("failed-application");case 14:case"end":return e.stop()}}),e,this,[[4,10]])}))),function(e){return n.apply(this,arguments)})},{key:"onSessionInitiate",value:(t=i(r.mark((function e(t,n){var i,a,o,s,u=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._log("info","Initiating incoming session"),this.role="responder",this.state="pending",this.transportType=t.contents[0].transport.transportType,i=(0,x.convertRequestToIntermediate)(t,this.peerRole),a=(0,w.exportToSDP)(i),o=t.contents[0].application,s=o.file.hashesUsed?o.file.hashesUsed:o.file.hashes||[],this.receiver=new O({hash:s[0]&&s[0].algorithm}),this.receiver.on("progress",(function(e,t){u._log("info","Receive progress "+e+"/"+t)})),this.receiver.on("receivedFile",(function(e){u.receivedFile=e,u._maybeReceivedFile()})),this.receiver.metadata=o.file,this.pc.addEventListener("datachannel",(function(e){u.channel=e.channel,u.receiver.receive(u.receiver.metadata,e.channel)})),e.prev=13,e.next=16,this.pc.setRemoteDescription({type:"offer",sdp:a});case 16:return e.next=18,this.processBufferedCandidates();case 18:n(),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(13),this._log("error","Could not create WebRTC answer",e.t0),n({condition:"general-error"});case 25:case"end":return e.stop()}}),e,this,[[13,21]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onSessionInfo",value:function(e,t){var n=e.info;n&&n.file&&n.file.hashes&&(this.receiver.metadata.hashes=n.file.hashes,this.receiver.metadata.actualhash&&this._maybeReceivedFile(),t())}},{key:"_maybeReceivedFile",value:function(){if(this.receiver.metadata.hashes&&this.receiver.metadata.hashes.length){var e,t=f(this.receiver.metadata.hashes||[]);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.value&&n.value.toString("hex")===this.receiver.metadata.actualhash)return this._log("info","File hash matches"),this.parent.emit("receivedFile",this,this.receivedFile,this.receiver.metadata),void this.end("success")}}catch(e){t.e(e)}finally{t.f()}this._log("error","File hash does not match"),this.end("media-error")}}}]),l}(S.default);t.default=T},function(e,t,n){"use strict";(function(e){var t=n(11),r={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};r.localCName=r.generateIdentifier(),r.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},r.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},r.getDescription=function(e){var t=r.splitSections(e);return t&&t[0]},r.getMediaSections=function(e){var t=r.splitSections(e);return t.shift(),t},r.matchPrefix=function(e,t){return r.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},r.parseCandidate=function(e){for(var t,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[t[1]]||t[1],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:void 0===n[t[r]]&&(n[t[r]]=t[r+1])}return n},r.writeCandidate=function(e){var t=[];t.push(e.foundation);var n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},r.parseIceOptions=function(e){return e.substring(14).split(" ")},r.parseRtpMap=function(e){var t=e.substring(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},r.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},r.parseExtmap=function(e){var t=e.substring(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1],attributes:t.slice(2).join(" ")}},r.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+(e.attributes?" "+e.attributes:"")+"\r\n"},r.parseFmtp=function(e){for(var t,n={},r=e.substring(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)n[(t=r[i].trim().split("="))[0].trim()]=t[1];return n},r.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){void 0!==e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},r.parseRtcpFb=function(e){var t=e.substring(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},r.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},r.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substring(7,t),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substring(t+1,r),n.value=e.substring(r+1)):n.attribute=e.substring(t+1),n},r.parseSsrcGroup=function(e){var t=e.substring(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},r.getMid=function(e){var t=r.matchPrefix(e,"a=mid:")[0];if(t)return t.substring(6)},r.parseFingerprint=function(e){var t=e.substring(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1].toUpperCase()}},r.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:r.matchPrefix(e+t,"a=fingerprint:").map(r.parseFingerprint)}},r.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},r.parseCryptoLine=function(e){var t=e.substring(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},r.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===t(e.keyParams)?r.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},r.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substring(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},r.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},r.getCryptoParameters=function(e,t){return r.matchPrefix(e+t,"a=crypto:").map(r.parseCryptoLine)},r.getIceParameters=function(e,t){var n=r.matchPrefix(e+t,"a=ice-ufrag:")[0],i=r.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&i?{usernameFragment:n.substring(12),password:i.substring(10)}:null},r.writeIceParameters=function(e){var t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},r.parseRtpParameters=function(e){var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=r.splitLines(e)[0].split(" ");t.profile=n[2];for(var i=3;i<n.length;i++){var a=n[i],o=r.matchPrefix(e,"a=rtpmap:"+a+" ")[0];if(o){var s=r.parseRtpMap(o),u=r.matchPrefix(e,"a=fmtp:"+a+" ");switch(s.parameters=u.length?r.parseFmtp(u[0]):{},s.rtcpFeedback=r.matchPrefix(e,"a=rtcp-fb:"+a+" ").map(r.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}r.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(r.parseExtmap(e))}));var c=r.matchPrefix(e,"a=rtcp-fb:* ").map(r.parseRtcpFb);return t.codecs.forEach((function(e){c.forEach((function(t){e.rtcpFeedback.find((function(e){return e.type===t.type&&e.parameter===t.parameter}))||e.rtcpFeedback.push(t)}))})),t},r.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" "+(t.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=r.writeRtpMap(e),n+=r.writeFmtp(e),n+=r.writeRtcpFb(e)}));var i=0;return t.codecs.forEach((function(e){e.maxptime>i&&(i=e.maxptime)})),i>0&&(n+="a=maxptime:"+i+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=r.writeExtmap(e)})),n},r.parseRtpEncodingParameters=function(e){var t,n=[],i=r.parseRtpParameters(e),a=-1!==i.fecMechanisms.indexOf("RED"),o=-1!==i.fecMechanisms.indexOf("ULPFEC"),s=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),u=s.length>0&&s[0].ssrc,c=r.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substring(17).split(" ").map((function(e){return parseInt(e,10)}))}));c.length>0&&c[0].length>1&&c[0][0]===u&&(t=c[0][1]),i.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var r={ssrc:u,codecPayloadType:parseInt(e.parameters.apt,10)};u&&t&&(r.rtx={ssrc:t}),n.push(r),a&&((r=JSON.parse(JSON.stringify(r))).fec={ssrc:u,mechanism:o?"red+ulpfec":"red"},n.push(r))}})),0===n.length&&u&&n.push({ssrc:u});var l=r.matchPrefix(e,"b=");return l.length&&(l=0===l[0].indexOf("b=TIAS:")?parseInt(l[0].substring(7),10):0===l[0].indexOf("b=AS:")?1e3*parseInt(l[0].substring(5),10)*.95-16e3:void 0,n.forEach((function(e){e.maxBitrate=l}))),n},r.parseRtcpParameters=function(e){var t={},n=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var i=r.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=i.length>0,t.compound=0===i.length;var a=r.matchPrefix(e,"a=rtcp-mux");return t.mux=a.length>0,t},r.writeRtcpParameters=function(e){var t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},r.parseMsid=function(e){var t,n=r.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substring(7).split(" "))[0],track:t[1]};var i=r.matchPrefix(e,"a=ssrc:").map((function(e){return r.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return i.length>0?{stream:(t=i[0].value.split(" "))[0],track:t[1]}:void 0},r.parseSctpDescription=function(e){var t,n=r.parseMLine(e),i=r.matchPrefix(e,"a=max-message-size:");i.length>0&&(t=parseInt(i[0].substring(19),10)),isNaN(t)&&(t=65536);var a=r.matchPrefix(e,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:n.fmt,maxMessageSize:t};var o=r.matchPrefix(e,"a=sctpmap:");if(o.length>0){var s=o[0].substring(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:t}}},r.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},r.generateSessionId=function(){return Math.random().toString().substr(2,22)},r.writeSessionBoilerplate=function(e,t,n){var i=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||r.generateSessionId())+" "+i+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},r.getDirection=function(e,t){for(var n=r.splitLines(e),i=0;i<n.length;i++)switch(n[i]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[i].substring(2)}return t?r.getDirection(t):"sendrecv"},r.getKind=function(e){return r.splitLines(e)[0].split(" ")[0].substring(2)},r.isRejected=function(e){return"0"===e.split(" ",2)[1]},r.parseMLine=function(e){var t=r.splitLines(e)[0].substring(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},r.parseOLine=function(e){var t=r.matchPrefix(e,"o=")[0].substring(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},r.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=r.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===t(e)&&(e.exports=r)}).call(this,n(81)(e))},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(6),o=n(7),s=n(43),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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=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 h=n(15),v=n(18),m=(0,h.__importDefault)(n(62)),g=n(44),y=n(63);function b(e){var t=e.application;if(t.streams&&t.streams.length&&t.sources&&t.sources.length){var n=t.streams[0];t.sources[0].parameters.msid="".concat(n.id," ").concat(n.track),t.sourceGroups&&t.sourceGroups.length>0&&t.sources.push({parameters:{cname:t.sources[0].parameters.cname,msid:"".concat(n.id," ").concat(n.track)},ssrc:t.sourceGroups[0].sources[1]})}}var _=function(e){u(m,e);var t,n,c,p,h=d(m);function m(e){var t;if(a(this,m),(t=h.call(this,e)).includesAudio=!1,t.includesVideo=!1,t._ringing=!1,t.pc.addEventListener("track",(function(e){t.onAddTrack(e.track,e.streams[0])})),e.stream){var n,r=f(e.stream.getTracks());try{for(r.s();!(n=r.n()).done;){var i=n.value;t.addTrack(i,e.stream)}}catch(e){r.e(e)}finally{r.f()}}return t}return o(m,[{key:"start",value:(p=i(r.mark((function e(t,n){var a=this,o=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.state="pending",1===o.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this.role="initiator",this.offerOptions=t,e.prev=6,e.next=9,this.processLocal(v.JingleAction.SessionInitiate,i(r.mark((function e(){var n,i,o,s,u,c;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createOffer(t);case 2:n=e.sent,i=(0,g.importFromSDP)(n.sdp),(o=(0,y.convertIntermediateToRequest)(i,a.role,a.transportType)).sid=a.sid,o.action=v.JingleAction.SessionInitiate,s=f(o.contents||[]);try{for(s.s();!(u=s.n()).done;)(c=u.value).creator="initiator",b(c)}catch(e){s.e(e)}finally{s.f()}return e.next=11,a.pc.setLocalDescription(n);case 11:a.send("session-initiate",o);case 12:case"end":return e.stop()}}),e)}))));case 9:n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),this._log("error","Could not create WebRTC offer",e.t0),this.end("failed-application",!0);case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e,t){return p.apply(this,arguments)})},{key:"accept",value:(c=i(r.mark((function e(t,n){var a=this,o=arguments;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return 1===o.length&&"function"==typeof t&&(n=t,t={}),n=n||function(){},t=t||{},this._log("info","Accepted incoming session"),this.state="active",this.role="responder",e.prev=6,e.next=9,this.processLocal(v.JingleAction.SessionAccept,i(r.mark((function e(){var n,i,o,s,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.pc.createAnswer(t);case 2:n=e.sent,i=(0,g.importFromSDP)(n.sdp),(o=(0,y.convertIntermediateToRequest)(i,a.role,a.transportType)).sid=a.sid,o.action=v.JingleAction.SessionAccept,s=f(o.contents||[]);try{for(s.s();!(u=s.n()).done;)u.value.creator="initiator"}catch(e){s.e(e)}finally{s.f()}return e.next=11,a.pc.setLocalDescription(n);case 11:return e.next=13,a.processBufferedCandidates();case 13:a.send("session-accept",o);case 14:case"end":return e.stop()}}),e)}))));case 9:n(),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(6),this._log("error","Could not create WebRTC answer",e.t0),this.end("failed-application");case 16:case"end":return e.stop()}}),e,this,[[6,12]])}))),function(e,t){return c.apply(this,arguments)})},{key:"end",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"success",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=f(this.pc.getReceivers());try{for(r.s();!(e=r.n()).done;){var i=e.value;this.onRemoveTrack(i.track)}}catch(e){r.e(e)}finally{r.f()}s(l(m.prototype),"end",this).call(this,t,n)}},{key:"ring",value:function(){var e=this;return this.processLocal("ring",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Ringing on incoming session"),e.ringing=!0,e.send(v.JingleAction.SessionInfo,{info:{infoType:v.JINGLE_INFO_RINGING}});case 3:case"end":return t.stop()}}),t)}))))}},{key:"mute",value:function(e,t){var n=this;return this.processLocal("mute",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Muting",t),n.send(v.JingleAction.SessionInfo,{info:{creator:e,infoType:v.JINGLE_INFO_MUTE,name:t}});case 2:case"end":return r.stop()}}),i)}))))}},{key:"unmute",value:function(e,t){var n=this;return this.processLocal("unmute",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n._log("info","Unmuting",t),n.send(v.JingleAction.SessionInfo,{info:{creator:e,infoType:v.JINGLE_INFO_UNMUTE,name:t}});case 2:case"end":return r.stop()}}),i)}))))}},{key:"hold",value:function(){var e=this;return this.processLocal("hold",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Placing on hold"),e.send("session-info",{info:{infoType:v.JINGLE_INFO_HOLD}});case 2:case"end":return t.stop()}}),t)}))))}},{key:"resume",value:function(){var e=this;return this.processLocal("resume",i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e._log("info","Resuming from hold"),e.send("session-info",{info:{infoType:v.JINGLE_INFO_ACTIVE}});case 2:case"end":return t.stop()}}),t)}))))}},{key:"addTrack",value:function(e,t,n){var a=this;return"audio"===e.kind&&(this.includesAudio=!0),"video"===e.kind&&(this.includesVideo=!0),this.processLocal("addtrack",i(r.mark((function i(){return r.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:a.pc.addTrack?a.pc.addTrack(e,t):a.pc.addStream(t),n&&n();case 2:case"end":return r.stop()}}),i)}))))}},{key:"removeTrack",value:(n=i(r.mark((function e(t,n){var a=this;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.processLocal("removetrack",i(r.mark((function e(){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a.pc.removeTrack(t),!n){e.next=3;break}return e.abrupt("return",n());case 3:case"end":return e.stop()}}),e)})))));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"onAddTrack",value:function(e,t){this._log("info","Track added"),this.parent.emit("peerTrackAdded",this,e,t)}},{key:"onRemoveTrack",value:function(e){this._log("info","Track removed"),this.parent.emit("peerTrackRemoved",this,e)}},{key:"onSessionInitiate",value:(t=i(r.mark((function e(t,n){var i,a,o,s,u;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._log("info","Initiating incoming session"),this.state="pending",this.role="responder",this.transportType=t.contents[0].transport.transportType,i=(0,y.convertRequestToIntermediate)(t,this.peerRole),a=f(i.media);try{for(a.s();!(o=a.n()).done;)"audio"===(s=o.value).kind&&(this.includesAudio=!0),"video"===s.kind&&(this.includesVideo=!0),s.streams||(s.streams=[{stream:"legacy",track:s.kind}])}catch(e){a.e(e)}finally{a.f()}return u=(0,g.exportToSDP)(i),e.prev=8,e.next=11,this.pc.setRemoteDescription({type:"offer",sdp:u});case 11:return e.next=13,this.processBufferedCandidates();case 13:return e.abrupt("return",n());case 16:return e.prev=16,e.t0=e.catch(8),this._log("error","Could not create WebRTC answer",e.t0),e.abrupt("return",n({condition:"general-error"}));case 20:case"end":return e.stop()}}),e,this,[[8,16]])}))),function(e,n){return t.apply(this,arguments)})},{key:"onSessionTerminate",value:function(e,t){var n,r=f(this.pc.getReceivers());try{for(r.s();!(n=r.n()).done;){var i=n.value;this.onRemoveTrack(i.track)}}catch(e){r.e(e)}finally{r.f()}s(l(m.prototype),"onSessionTerminate",this).call(this,e,t)}},{key:"onSessionInfo",value:function(e,t){var n=e.info||{infoType:""};switch(n.infoType){case v.JINGLE_INFO_RINGING:return this._log("info","Outgoing session is ringing"),this.ringing=!0,this.parent.emit("ringing",this),t();case v.JINGLE_INFO_HOLD:return this._log("info","On hold"),this.parent.emit("hold",this),t();case v.JINGLE_INFO_UNHOLD:case v.JINGLE_INFO_ACTIVE:return this._log("info","Resuming from hold"),this.parent.emit("resumed",this),t();case v.JINGLE_INFO_MUTE:return this._log("info","Muting",n),this.parent.emit("mute",this,n),t();case v.JINGLE_INFO_UNMUTE:return this._log("info","Unmuting",n),this.parent.emit("unmute",this,n),t()}return t()}},{key:"ringing",get:function(){return this._ringing},set:function(e){e!==this._ringing&&(this._ringing=e)}},{key:"streams",get:function(){return"closed"!==this.pc.signalingState?this.pc.getRemoteStreams():[]}}]),m}(m.default);t.default=_},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||a(t,e,n)},s=this&&this.__awaiter||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())}))},u=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var c,l=n(20);o(n(258),t);var f=function(e){function t(t,n){void 0===n&&(n={});var r=e.call(this)||this;return r.peerConnection=t,r.haveConnectionMetrics=!1,r.statsArr=[],c="undefined"!=typeof window,r.session=n.session,r.initiator=n.initiator,r.conference=n.conference,r.statsInterval=1e3*(n.interval||5),r.logger=n.logger||console,["new","checking"].includes(t.iceConnectionState)&&("checking"===t.iceConnectionState&&(r.logger.warn("iceConnectionState is already in checking state so ice connect time may not be accurate"),r.handleIceStateChange()),t.addEventListener("iceconnectionstatechange",r.handleIceStateChange.bind(r))),t.addEventListener("connectionstatechange",r.handleConnectionStateChange.bind(r)),"connected"===t.connectionState&&r.pollForStats(),r}return i(t,e),t.prototype.handleIceStateChange=function(){var e=this,t=this.peerConnection.iceConnectionState;if("checking"===t&&c&&(this.iceStartTime=window.performance.now()),"connected"===t){if(this.haveConnectionMetrics)return;this.haveConnectionMetrics=!0;var n=void 0,r=void 0,i=void 0;c&&(this.iceConnectionTime=window.performance.now()-this.iceStartTime,n=window.navigator.userAgent,r=window.navigator.platform,i=window.navigator.hardwareConcurrency);var a={name:"connect",userAgent:n,platform:r,cores:i,session:this.session,conference:this.conference,connectTime:this.iceConnectionTime};return this.waitForSelectedCandidatePair().then((function(t){e.gatherSelectedCandidateInfo(t,a),e.emit("stats",a)}))}if("failed"===t)return c&&(this.iceFailedTime=window.performance.now()-this.iceStartTime),this.gatherStats().then((function(){var t={name:"failure",session:e.session,initiator:e.initiator,conference:e.conference,failTime:e.iceFailedTime,iceRW:0,numLocalHostCandidates:0,numLocalSrflxCandidates:0,numLocalRelayCandidates:0,numRemoteHostCandidates:0,numRemoteSrflxCandidates:0,numRemoteRelayCandidates:0},n=e.peerConnection.localDescription.sdp.split("\r\n").filter((function(e){return e.indexOf("a=candidate:")>-1})),r=e.peerConnection.remoteDescription.sdp.split("\r\n").filter((function(e){return e.indexOf("a=candidate:")>-1}));["Host","Srflx","Relay"].forEach((function(e){t["numLocal"+e+"Candidates"]=n.filter((function(t){return t.split(" ")[7]===e.toLowerCase()})).length,t["numRemote"+e+"Candidates"]=r.filter((function(t){return t.split(" ")[7]===e.toLowerCase()})).length})),e.emit("stats",t)}))},t.prototype.waitForSelectedCandidatePair=function(e,t){var n=this;return void 0===e&&(e=300),void 0===t&&(t=1),this.gatherStats().then((function(r){return n.getSelectedCandidatePair(r)?r:t>3?Promise.reject(new Error("Max wait attempts for connected candidate info reached")):new Promise((function(r,i){setTimeout((function(){return n.waitForSelectedCandidatePair(e,t+1).then(r,i)}),e)}))}))},t.prototype.getSelectedCandidatePair=function(e){var t=null;return e.forEach((function(e){var n=e.value;"candidate-pair"===n.type&&n.nominated&&"succeeded"===n.state&&(t=n)})),t},t.prototype.gatherSelectedCandidateInfo=function(e,t){var n=this.getSelectedCandidatePair(e);if(n){var r,i,a=n.localCandidateId,o=n.remoteCandidateId;if(e.forEach((function(e){var n=e.value;a&&"local-candidate"===n.type&&n.id===a&&(r=n,t.localCandidateType=n.candidateType),o&&"remote-candidate"===n.type&&n.id===o&&(i=n,t.remoteCandidateType=n.candidateType)})),r&&i&&(t.candidatePair=r.candidateType+";"+i.candidateType,t.candidatePairDetails={local:r,remote:i,pair:n}),r){if(t.transport=r.transport||r.protocol,r.priority){var s=parseInt(r.priority,10);t.turnType={2:"udp",1:"tcp",0:"tls"}[s>>24],t.networkType=r.networkType}t.usingIPv6=r.ipAddress&&0===r.ipAddress.indexOf("[")}}},t.prototype.handleConnectionStateChange=function(){return s(this,void 0,void 0,(function(){var e,t=this;return u(this,(function(n){if("connected"===(e=this.peerConnection.connectionState))this.pollForStats();else{if("disconnected"===e)return"stable"!==this.peerConnection.signalingState?[2]:[2,this.gatherStats().then((function(e){var n=t.createStatsReport(e);n.type="disconnected",t.emit("stats",n)}))];["closed","failed"].includes(e)&&this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null)}return[2]}))}))},t.prototype.pollForStats=function(){var e=this;if(!this.pollingInterval){var t=function(){return e.gatherStats().then((function(t){if(0!==t.length){var n=e.createStatsReport(t,!0);(n.tracks.length>0||n.remoteTracks.length>0)&&e.checkBitrate(n)&&e.emit("stats",n)}else e.logger.warn("Empty stats gathered, ignoring and not emitting stats")}))};c&&(window.setTimeout(t,0),this.pollingInterval=window.setInterval(t,this.statsInterval))}},t.prototype.checkBitrate=function(e){var t;return e.remoteTracks.length&&0!==(null===(t=e.remoteTracks[0])||void 0===t?void 0:t.bitrate)?(this.statsArr=[],!0):!(this.statsArr.length>=5)&&(this.statsArr.push(e),!0)},t.prototype.polyFillStats=function(e){if(!e)return[];if(Array.isArray(e))return e;var t=[];if(this.isNativeStatsReport(e))e.forEach((function(e,n){t.push({key:n,value:e})}));else{if(!(Object.keys(e).length>0))return this.logger.warn("Unknown stats results format, returning unmodified",e),[];Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})}))}return t},t.prototype.isNativeStatsReport=function(e){return void 0!==window.RTCStatsReport&&e instanceof window.RTCStatsReport},t.prototype.gatherStats=function(){return s(this,void 0,void 0,(function(){var e;return u(this,(function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),["connecting","connected"].includes(this.peerConnection.connectionState)?[4,this.peerConnection.getStats(null).then(this.polyFillStats.bind(this))]:[3,2];case 1:return[2,t.sent()];case 2:return"closed"===this.peerConnection.connectionState?(this.pollingInterval&&(c&&window.clearInterval(this.pollingInterval),this.pollingInterval=null),[2,[]]):[2,[]];case 3:return[3,5];case 4:return e=t.sent(),this.logger.error("Failed to gather stats. Are you using RTCPeerConnection as your connection? {expect peerconnection.getStats}",{peerConnection:this.peerConnection,err:e}),[2,Promise.reject(e)];case 5:return[2]}}))}))},t.prototype.createStatsReport=function(e,t){var n=this;void 0===t&&(t=!0);var r={name:"getStats",session:this.session,initiator:this.initiator,conference:this.conference,tracks:[],remoteTracks:[]};if(0===e.length)return r;e.filter((function(e){return["inbound-rtp","outbound-rtp"].indexOf(e.value.type)>-1})).forEach((function(t){n.processSource({source:t.value,event:r,results:e})}));var i=e.find((function(e){return"candidate-pair"===e.value.type&&"succeeded"===e.value.state&&!0===e.value.nominated}));return i&&this.processSelectedCandidatePair({report:i.value,event:r,results:e}),t&&(this.lastResult=e),r},t.prototype.processSource=function(e){var t,n,r,i,a,o,s,u=e.source,c=e.results,l=e.event,f=new Date(u.timestamp),d=this.lastResult&&this.lastResult.find((function(e){return e.key===u.id}));(d=d&&d.value)&&(t=(t=this.lastResult&&this.lastResult.find((function(e){return e.value.localId===d.id})))&&t.value),c.forEach((function(e){e.value.localId===u.id?n=e.value:e.key===u.transportId?r=e.value:e.key===u.trackId?a=e.value:e.key===u.mediaSourceId?o=e.value:e.key===u.codecId&&(s=e.value)})),r&&(i=(i=c.find((function(e){return e.key===r.selectedCandidatePairId})))&&i.value),i&&(l.candidatePairHadActiveSource=!0);var h=u.kind||u.mediaType,v="outbound-rtp"===u.type,m={track:a&&a.trackIdentifier,kind:h,jitter:p("jitter",u,n),roundTripTime:p("roundTripTime",u,n),packetsLost:p("packetsLost",u,n)||0,packetLoss:0,bytes:parseInt(v?u.bytesSent:u.bytesReceived,10)||0};if(s&&(m.codec="".concat(s.payloadType," ").concat(s.mimeType," ").concat(s.clockRate)),d){var g=parseInt(v?d.bytesSent:d.bytesReceived,10)||0,y=f.getTime()-new Date(d.timestamp).getTime();m.bitrate=Math.floor(8*(m.bytes-g)/y)}var b=p("packetsLost",d,t);v?(m.packetsSent=u.packetsSent,m.packetLoss=m.packetsLost/(m.packetsSent||1)*100,d&&(m.intervalPacketsSent=m.packetsSent-(d.packetsSent||0),m.intervalPacketsLost=m.packetsLost-(b||0),m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsSent||1)*100),m.retransmittedBytesSent=u.retransmittedBytesSent,m.retransmittedPacketsSent=u.retransmittedPacketsSent):(m.packetsReceived=u.packetsReceived,m.packetLoss=m.packetsLost/(m.packetsReceived||1)*100,d&&(m.intervalPacketsReceived=m.packetsReceived-d.packetsReceived,m.intervalPacketsLost=m.packetsLost-b,m.intervalPacketLoss=m.intervalPacketsLost/(m.intervalPacketsReceived||1)*100)),a&&"audio"===h&&(a.remoteSource?(m.audioLevel=a.audioLevel,m.totalAudioEnergy=a.totalAudioEnergy):(m.echoReturnLoss=a.echoReturnLoss,m.echoReturnLossEnhancement=a.echoReturnLossEnhancement)),"audio"!==h||!o||a&&a.remoteSource||(m.audioLevel=o.audioLevel,m.totalAudioEnergy=o.totalAudioEnergy),Object.keys(m).forEach((function(e){return void 0===m[e]&&delete m[e]})),v?l.tracks.push(m):l.remoteTracks.push(m)},t.prototype.processSelectedCandidatePair=function(e){var t=this,n=e.report,r=e.event,i=e.results,a=n.localCandidateId,o=n.remoteCandidateId;r.localCandidateChanged=!!this.lastActiveLocalCandidate&&a!==this.lastActiveLocalCandidate.id,r.remoteCandidateChanged=!!this.lastActiveRemoteCandidate&&o!==this.lastActiveRemoteCandidate.id,(!this.lastActiveLocalCandidate||r.localCandidateChanged||r.remoteCandidateChanged)&&i.forEach((function(e){t.checkLastActiveCandidate({localId:a,remoteId:o,report:e.value})})),this.lastActiveLocalCandidate&&(r.networkType=this.lastActiveLocalCandidate.networkType,this.lastActiveRemoteCandidate&&(r.candidatePair=this.lastActiveLocalCandidate.candidateType+";"+this.lastActiveRemoteCandidate.candidateType)),r.bytesSent=n.bytesSent,r.bytesReceived=n.bytesReceived,r.requestsReceived=n.requestsReceived,r.requestsSent=n.requestsSent,r.responsesReceived=n.responsesReceived,r.responsesSent=n.responsesSent,r.consentRequestsSent=n.consentRequestsSent,r.totalRoundTripTime=n.totalRoundTripTime},t.prototype.checkLastActiveCandidate=function(e){var t=e.localId,n=e.remoteId,r=e.report;t&&"local-candidate"===r.type&&r.id===t&&(this.lastActiveLocalCandidate=r),n&&"remote-candidate"===r.type&&r.id===n&&(this.lastActiveRemoteCandidate=r)},t}(l.EventEmitter);function p(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.find((function(t){return t&&(t[e]||0===t[e])}));return r&&r[e]}t.default=f},function(e,t,n){"use strict";n.r(t),n.d(t,"Axios",(function(){return i})),n.d(t,"AxiosError",(function(){return a})),n.d(t,"CanceledError",(function(){return o})),n.d(t,"isCancel",(function(){return s})),n.d(t,"CancelToken",(function(){return u})),n.d(t,"VERSION",(function(){return c})),n.d(t,"all",(function(){return l})),n.d(t,"Cancel",(function(){return f})),n.d(t,"isAxiosError",(function(){return p})),n.d(t,"spread",(function(){return d})),n.d(t,"toFormData",(function(){return h})),n.d(t,"AxiosHeaders",(function(){return v})),n.d(t,"HttpStatusCode",(function(){return m})),n.d(t,"formToJSON",(function(){return g})),n.d(t,"getAdapter",(function(){return y})),n.d(t,"mergeConfig",(function(){return b}));var r=n(19);n.d(t,"default",(function(){return r.a}));var i=r.a.Axios,a=r.a.AxiosError,o=r.a.CanceledError,s=r.a.isCancel,u=r.a.CancelToken,c=r.a.VERSION,l=r.a.all,f=r.a.Cancel,p=r.a.isAxiosError,d=r.a.spread,h=r.a.toFormData,v=r.a.AxiosHeaders,m=r.a.HttpStatusCode,g=r.a.formToJSON,y=r.a.getAdapter,b=r.a.mergeConfig},function(e,t,n){"use strict";var r=n(13),i=n(3),a=n(9),o=n(6),s=n(7),u=n(16),c=n(17),l=n(14);function f(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 p(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 p(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 p(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 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=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 h=n(20),v=Math.pow(2,32),m=function(e,t){return(e%t+t)%t},g=function(e){u(k,e);var t,n,c,l,p,h,g,y,b,_,S,w,x=d(k);function k(){var e;return o(this,k),(e=x.call(this)).allowResume=!0,e.lastAck=0,e.handled=0,e.unacked=[],e.inboundStarted=!1,e.outboundStarted=!1,e.id=void 0,e.jid=void 0,e.allowResume=!0,e.started=!1,e.cacheHandler=function(){},e._reset(),e}return s(k,[{key:"load",value:function(e){var t;this.id=e.id,this.allowResume=null===(t=e.allowResume)||void 0===t||t,this.handled=e.handled,this.lastAck=e.lastAck,this.unacked=e.unacked,this.emit("prebound",e.jid)}},{key:"cache",value:function(e){this.cacheHandler=e}},{key:"bind",value:(w=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.jid=t,e.next=3,this._cache();case 3:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"enable",value:(S=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{allowResumption:this.allowResume,type:"enable"});case 1:case"end":return e.stop()}}),e,this)}))),function(){return S.apply(this,arguments)})},{key:"resume",value:(_=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.emit("send",{handled:this.handled,previousSession:this.id,type:"resume"});case 1:case"end":return e.stop()}}),e,this)}))),function(){return _.apply(this,arguments)})},{key:"enabled",value:(b=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.id,this.allowResume=t.resume||!1,this.handled=0,this.inboundStarted=!0,e.next=6,this._cache();case 6:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"resumed",value:(y=a(i.mark((function e(t){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.id=t.previousSession,this.inboundStarted=!0,e.next=4,this.process(t,!0);case 4:return e.next=6,this._cache();case 6:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"failed",value:(g=a(i.mark((function e(t){var n,a,o,s,u;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.process(t);case 2:n=f(this.unacked);try{for(n.s();!(a=n.n()).done;)o=r(a.value,2),s=o[0],u=o[1],this.emit("failed",{kind:s,stanza:u})}catch(e){n.e(e)}finally{n.f()}return this._reset(),e.next=7,this._cache();case 7:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"ack",value:function(){this.emit("send",{handled:this.handled,type:"ack"})}},{key:"request",value:function(){this.emit("send",{type:"request"})}},{key:"process",value:(h=a(i.mark((function e(t){var n,a,o,s,u,c,l,p,d,h,g,y,b,_=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=_.length>1&&void 0!==_[1]&&_[1],void 0!==t.handled){e.next=3;break}return e.abrupt("return");case 3:for(a=m(t.handled-this.lastAck,v),o=0;o<a&&this.unacked.length>0;o++)s=this.unacked.shift(),u=r(s,2),c=u[0],l=u[1],this.emit("acked",{kind:c,stanza:l});if(this.lastAck=t.handled,n&&(p=this.unacked,this.unacked=[],p.length)){this.emit("begin-resend"),d=f(p);try{for(d.s();!(h=d.n()).done;)g=r(h.value,2),y=g[0],b=g[1],this.emit("resend",{kind:y,stanza:b})}catch(e){d.e(e)}finally{d.f()}this.emit("end-resend")}return e.next=9,this._cache();case 9:case"end":return e.stop()}}),e,this)}))),function(e){return h.apply(this,arguments)})},{key:"track",value:(p=a(i.mark((function e(t,n){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r="enable"===n.type,"sm"!==t||!r&&"resume"!==n.type){e.next=7;break}return r&&(this.handled=0),this.outboundStarted=!0,e.next=6,this._cache();case 6:return e.abrupt("return",!1);case 7:if(this.outboundStarted){e.next=9;break}return e.abrupt("return",!1);case 9:if("message"===t||"presence"===t||"iq"===t){e.next=11;break}return e.abrupt("return",!1);case 11:return this.unacked.push([t,n]),e.next=14,this._cache();case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"handle",value:(l=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.inboundStarted){e.next=4;break}return this.handled=m(this.handled+1,v),e.next=4,this._cache();case 4:case"end":return e.stop()}}),e,this)}))),function(){return l.apply(this,arguments)})},{key:"hibernate",value:(c=a(i.mark((function e(){var t,n,a,o,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.resumable){e.next=2;break}return e.abrupt("return",this.shutdown());case 2:t=f(this.unacked);try{for(t.s();!(n=t.n()).done;)a=r(n.value,2),o=a[0],s=a[1],this.emit("hibernated",{kind:o,stanza:s})}catch(e){t.e(e)}finally{t.f()}case 4:case"end":return e.stop()}}),e,this)}))),function(){return c.apply(this,arguments)})},{key:"shutdown",value:(n=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.failed({type:"failed"}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"_cache",value:(t=a(i.mark((function e(){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.cacheHandler({allowResume:this.allowResume,handled:this.handled,id:this.id,jid:this.jid,lastAck:this.lastAck,unacked:this.unacked});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error("Failed to cache stream state",e.t0);case 8:case"end":return e.stop()}}),e,this,[[0,5]])}))),function(){return t.apply(this,arguments)})},{key:"_reset",value:function(){this.id="",this.inboundStarted=!1,this.outboundStarted=!1,this.lastAck=0,this.handled=0,this.unacked=[]}},{key:"started",get:function(){return this.outboundStarted&&this.inboundStarted},set:function(e){e||(this.outboundStarted=!1,this.inboundStarted=!1)}},{key:"resumable",get:function(){return this.started&&this.allowResume}}]),k}(h.EventEmitter);t.default=g},function(e,t,n){"use strict";var r=n(16),i=n(17),a=n(14),o=n(6),s=n(7);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=a(e);if(t){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return i(this,n)}}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.SCRAM=t.DIGEST=t.OAUTH=t.PLAIN=t.EXTERNAL=t.ANONYMOUS=t.Hi=t.HMAC=t.H=t.XOR=t.createClientNonce=t.Factory=t.SimpleMech=void 0;var f=n(21),p=n(83),d=function(){function e(t){o(this,e),this.authenticated=!1,this.mutuallyAuthenticated=!1,this.name=t}return s(e,[{key:"getCacheableCredentials",value:function(){return null}},{key:"processChallenge",value:function(e){}},{key:"processSuccess",value:function(e){this.authenticated=!0}},{key:"finalize",value:function(){var e={authenticated:this.authenticated,mutuallyAuthenticated:this.mutuallyAuthenticated};return this.errorData&&(e.errorData=this.errorData),e}}]),e}();t.SimpleMech=d;var h=function(){function e(){o(this,e),this.mechanisms=[]}return s(e,[{key:"register",value:function(e,t,n){this.mechanisms.push({constructor:t,name:e.toUpperCase(),priority:n}),this.mechanisms.sort((function(e,t){return t.priority-e.priority}))}},{key:"disable",value:function(e){var t=e.toUpperCase();this.mechanisms=this.mechanisms.filter((function(e){return e.name!==t}))}},{key:"createMechanism",value:function(e){var t,n=e.map((function(e){return e.toUpperCase()})),r=c(this.mechanisms);try{for(r.s();!(t=r.n()).done;){var i,a=t.value,o=c(n);try{for(o.s();!(i=o.n()).done;){if(i.value===a.name)return new a.constructor(a.name)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){r.e(e)}finally{r.f()}return null}}]),e}();function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;return(0,f.randomBytes)(e).toString("hex")}function m(e,t){for(var n=[],r=0;r<e.length;r++)n.push(e[r]^t[r]);return f.Buffer.from(n)}function g(e,t){return(0,f.createHash)(t).update(e).digest()}function y(e,t,n){return(0,f.createHmac)(n,e).update(t).digest()}function b(e,t,n,r){for(var i=y(e,f.Buffer.concat([t,f.Buffer.from("00000001","hex")]),r),a=i,o=0;o<n-1;o++)a=m(a,i=y(e,i,r));return a}function _(e){for(var t={},n=e.toString().split(/,(?=(?:[^"]|"[^"]*")*$)/),r=0,i=n.length;r<i;r++){var a=/(\w+)=["]?([^"]+)["]?$/.exec(n[r]);a&&(t[a[1]]=a[2])}return t}function S(e){var t,n=[],r=c(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;","===i?n.push("=2C"):"="===i?n.push("=3D"):n.push(i)}}catch(e){r.e(e)}finally{r.f()}return n.join("")}t.Factory=h,t.createClientNonce=v,t.XOR=m,t.H=g,t.HMAC=y,t.Hi=b;var w=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["trace"],required:[]}}},{key:"createResponse",value:function(e){return f.Buffer.from(e.trace||"")}}]),n}(d);t.ANONYMOUS=w;var x=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:[]}}},{key:"createResponse",value:function(e){return f.Buffer.from(e.authzid||"")}}]),n}(d);t.EXTERNAL=x;var k=function(e){r(n,e);var t=u(n);function n(){return o(this,n),t.apply(this,arguments)}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["username","password"]}}},{key:"createResponse",value:function(e){return f.Buffer.from((e.authzid||"")+"\0"+e.username+"\0"+(e.password||e.token))}}]),n}(d);t.PLAIN=k;var O=function(e){r(n,e);var t=u(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).failed=!1,r.name=e,r}return s(n,[{key:"getExpectedCredentials",value:function(){return{optional:["authzid"],required:["token"]}}},{key:"createResponse",value:function(e){if(this.failed)return f.Buffer.from("");var t="n,".concat(S((0,p.saslprep)(e.authzid)),","),n="auth=Bearer ".concat(e.token,"");return f.Buffer.from(t+""+n+"","utf8")}},{key:"processChallenge",value:function(e){this.failed=!0,this.errorData=JSON.parse(e.toString("utf8"))}}]),n}(d);t.OAUTH=O;var T=function(e){r(n,e);var t=u(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).providesMutualAuthentication=!1,r.state="INITIAL",r.name=e,r}return s(n,[{key:"processChallenge",value:function(e){this.state="CHALLENGE";var t=_(e);this.authenticated=!!t.rspauth,this.realm=t.realm,this.nonce=t.nonce,this.charset=t.charset}},{key:"getExpectedCredentials",value:function(){return{optional:["authzid","clientNonce","realm"],required:["host","password","serviceName","serviceType","username"]}}},{key:"createResponse",value:function(e){if("INITIAL"===this.state||this.authenticated)return null;var t=e.serviceType+"/"+e.host;e.serviceName&&e.host!==e.serviceName&&(t+="/"+e.serviceName);var n=e.realm||this.realm||"",r=e.clientNonce||v(16),i="00000001",a="";a+='username="'+e.username+'"',n&&(a+=',realm="'+n+'"'),a+=',nonce="'+this.nonce+'"',a+=',cnonce="'+r+'"',a+=",nc="+i,a+=",qop=auth",a+=',digest-uri="'+t+'"';var o=(0,f.createHash)("md5").update(e.username).update(":").update(n).update(":").update(e.password).digest(),s=(0,f.createHash)("md5").update(o).update(":").update(this.nonce).update(":").update(r);e.authzid&&s.update(":").update(e.authzid);var u=s.digest("hex"),c=(0,f.createHash)("md5").update("AUTHENTICATE:").update(t).digest("hex");return a+=",response="+(0,f.createHash)("md5").update(u).update(":").update(this.nonce).update(":").update(i).update(":").update(r).update(":").update("auth").update(":").update(c).digest("hex"),"utf-8"===this.charset&&(a+=",charset=utf-8"),e.authzid&&(a+=',authzid="'+e.authzid+'"'),f.Buffer.from(a)}}]),n}(d);t.DIGEST=T;var A=function(){function e(t){o(this,e),this.providesMutualAuthentication=!0,this.name=t,this.state="INITIAL",this.useChannelBinding=this.name.toLowerCase().endsWith("-plus"),this.algorithm=this.name.toLowerCase().split("scram-")[1].split("-plus")[0]}return s(e,[{key:"getExpectedCredentials",value:function(){var e=["username","password"];return this.useChannelBinding&&e.push("tlsUnique"),{optional:["authzid","clientNonce"],required:e}}},{key:"getCacheableCredentials",value:function(){return this.cache}},{key:"createResponse",value:function(e){return"INITIAL"===this.state?this.initialResponse(e):this.challengeResponse(e)}},{key:"processChallenge",value:function(e){var t=_(e);this.salt=f.Buffer.from(t.s||"","base64"),this.iterationCount=parseInt(t.i,10),this.nonce=t.r,this.verifier=t.v,this.error=t.e,this.challenge=e}},{key:"processSuccess",value:function(e){this.processChallenge(e)}},{key:"finalize",value:function(){return this.verifier?this.serverSignature.toString("base64")!==this.verifier?{authenticated:!1,error:"Mutual authentication failed",mutuallyAuthenticated:!1}:{authenticated:!0,mutuallyAuthenticated:!0}:{authenticated:!1,error:this.error,mutuallyAuthenticated:!1}}},{key:"initialResponse",value:function(e){var t=S((0,p.saslprep)(e.authzid)),n=S((0,p.saslprep)(e.username));this.clientNonce=e.clientNonce||v();var r="n";e.tlsUnique&&(r=this.useChannelBinding?"p=tls-unique":"y"),this.gs2Header=f.Buffer.from(t?"".concat(r,",a=").concat(t,","):"".concat(r,",,")),this.clientFirstMessageBare=f.Buffer.from("n=".concat(n,",r=").concat(this.clientNonce));var i=f.Buffer.concat([this.gs2Header,this.clientFirstMessageBare]);return this.state="CHALLENGE",i}},{key:"challengeResponse",value:function(e){var t,n,r,i=f.Buffer.from("Client Key"),a=f.Buffer.from("Server Key"),o=f.Buffer.concat([this.gs2Header,e.tlsUnique||f.Buffer.from("")]).toString("base64"),s=f.Buffer.from("c=".concat(o,",r=").concat(this.nonce)),u=e.salt&&0===f.Buffer.compare(e.salt,this.salt);u&&e.clientKey&&e.serverKey?(n=f.Buffer.from(e.clientKey),r=f.Buffer.from(e.serverKey)):u&&e.saltedPassword?(n=y(t=f.Buffer.from(e.saltedPassword),i,this.algorithm),r=y(t,a,this.algorithm)):(n=y(t=b(f.Buffer.from((0,p.saslprep)(e.password)),this.salt,this.iterationCount,this.algorithm),i,this.algorithm),r=y(t,a,this.algorithm));var c=g(n,this.algorithm),l=f.Buffer.from(","),d=f.Buffer.concat([this.clientFirstMessageBare,l,this.challenge,l,s]),h=m(n,y(c,d,this.algorithm)).toString("base64");this.serverSignature=y(r,d,this.algorithm);var v=f.Buffer.concat([s,f.Buffer.from(",p=".concat(h))]);return this.state="FINAL",this.cache={clientKey:n,salt:this.salt,saltedPassword:t,serverKey:r},v}}]),e}();t.SCRAM=A},function(e,t,n){"use strict";var r=n(12),i=n(4),a=n(3),o=n(9);Object.defineProperty(t,"__esModule",{value:!0});var s=n(2);t.default=function(e){e.getAccountInfo=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({account:{},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.account);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.updateAccount=function(t,n){return e.sendIQ({account:n,to:t,type:"set"})},e.deleteAccount=function(t){return e.sendIQ({account:{remove:!0},to:t,type:"set"})},e.getPrivateData=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({privateStorage:i({},n,{}),type:"get"});case 2:return r=t.sent,t.abrupt("return",r.privateStorage[n]);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.setPrivateData=function(){var t=o(a.mark((function t(n,r){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({privateStorage:i({},n,r),type:"set"}));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getVCard=function(){var t=o(a.mark((function t(n){var r;return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({to:n,type:"get",vcard:{format:s.NS_VCARD_TEMP}});case 2:return r=t.sent,t.abrupt("return",r.vcard);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.publishVCard=function(){var t=o(a.mark((function t(n){return a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({type:"set",vcard:n});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.enableNotifications=function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e.sendIQ({push:{action:"enable",form:{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/pubsub#publish-options"}].concat(r(i)),type:"submit"},jid:t,node:n},type:"set"})},e.disableNotifications=function(t,n){return e.sendIQ({push:{action:"disable",jid:t,node:n},type:"set"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.default=function(e){e.disco.addFeature((0,r.NS_PEP_NOTIFY)(r.NS_AVATAR_METADATA)),e.on("pubsub:published",(function(t){if(t.pubsub.items.node===r.NS_AVATAR_METADATA){var n=t.pubsub.items.published[0].content;e.emit("avatar",{avatars:n.versions||[],jid:t.from,source:"pubsub"})}})),e.on("presence",(function(t){t.vcardAvatar&&"string"==typeof t.vcardAvatar&&e.emit("avatar",{avatars:[{id:t.vcardAvatar}],jid:t.from,source:"vcard"})})),e.publishAvatar=function(t,n){return e.publish("",r.NS_AVATAR_DATA,{data:n,itemType:r.NS_AVATAR_DATA},t)},e.useAvatars=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.publish("",r.NS_AVATAR_METADATA,{itemType:r.NS_AVATAR_METADATA,pointers:n,versions:t},"current")},e.getAvatar=function(t,n){return e.getItem(t,r.NS_AVATAR_DATA,n)}}},function(e,t,n){"use strict";var r=n(3),i=n(9);Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("bind",300,function(){var t=i(r.mark((function t(n,i){var a,o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.sendIQ({bind:{resource:e.config.resource},type:"set"});case 3:return a=t.sent,e.features.negotiated.bind=!0,e.emit("session:prebind",a.bind.jid),o=!n.legacySession||n.legacySession&&n.legacySession.optional,!e.sessionStarted&&o&&e.emit("session:started",e.jid),t.abrupt("return",i());case 11:return t.prev=11,t.t0=t.catch(0),console.error(t.t0),t.abrupt("return",i("disconnect","JID binding failed"));case 15:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e,n){return t.apply(this,arguments)}}()),e.registerFeature("legacySession",1e3,function(){var t=i(r.mark((function t(n,i){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.sessionStarted||n.legacySession&&n.legacySession.optional)){t.next=3;break}return e.features.negotiated.session=!0,t.abrupt("return",i());case 3:return t.prev=3,t.next=6,e.sendIQ({legacySession:!0,type:"set"});case 6:return e.features.negotiated.session=!0,e.sessionStarted||(e.sessionStarted=!0,e.emit("session:started",e.jid)),t.abrupt("return",i());case 11:return t.prev=11,t.t0=t.catch(3),t.abrupt("return",i("disconnect","Session requeset failed"));case 14:case"end":return t.stop()}}),t,null,[[3,11]])})));return function(e,n){return t.apply(this,arguments)}}()),e.on("session:started",(function(){e.sessionStarted=!0})),e.on("session:prebind",(function(t){e.jid=t,e.emit("session:bound",e.jid)})),e.on("--reset-stream-features",(function(){e.sessionStarted=!1,e.features.negotiated.bind=!1,e.features.negotiated.session=!1}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.default=function(e){e.disco.addFeature(r.NS_ADHOC_COMMANDS),e.disco.addItem({name:"Ad-Hoc Commands",node:r.NS_ADHOC_COMMANDS}),e.getCommands=function(t){return e.getDiscoItems(t,r.NS_ADHOC_COMMANDS)}}},function(e,t,n){"use strict";var r=n(3),i=n(9);Object.defineProperty(t,"__esModule",{value:!0});var a=n(2),o=n(27);function s(e){return u.apply(this,arguments)}function u(){return(u=i(r.mark((function e(t){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.sm.started){e.next=2;break}return e.abrupt("return",new Promise((function(e){t.once("stream:management:ack",(function(){return e()})),t.sm.request()})));case 2:return e.prev=2,e.next=5,t.ping();case 5:e.next=14;break;case 7:if(e.prev=7,e.t0=e.catch(2),!e.t0.error||"timeout"===e.t0.error.condition){e.next=13;break}return e.abrupt("return");case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,7]])})))).apply(this,arguments)}function c(e,t){e.features.negotiated.clientStateIndication&&e.send("csi",{type:t})}t.default=function(e){e.disco.addFeature(a.NS_PING),e.on("iq:get:ping",(function(t){e.sendIQResult(t)})),e.on("--reset-stream-features",(function(){e._stopKeepAliveInterval(),e.features.negotiated.streamManagement=!1,e.features.negotiated.clientStateIndication=!1})),e.markActive=function(){return c(e,"active")},e.markInactive=function(){return c(e,"inactive")},e.ping=function(){var t=i(r.mark((function t(n){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({ping:!0,to:n,type:"get"});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.enableKeepAlive=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e._keepAliveOptions=t;var n=t.interval||300,a=t.timeout||e.config.timeout||15;function u(){return c.apply(this,arguments)}function c(){return(c=i(r.mark((function t(){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.sessionStarted){t.next=10;break}return t.prev=1,t.next=4,(0,o.timeoutPromise)(s(e),1e3*a);case 4:t.next=10;break;case 6:t.prev=6,t.t0=t.catch(1),e.emit("stream:error",{condition:"connection-timeout",text:"Server did not respond in "+a+" seconds"}),e.transport&&(e.transport.hasStream=!1,e.transport.disconnect(!1));case 10:case"end":return t.stop()}}),t,null,[[1,6]])})))).apply(this,arguments)}clearInterval(e._keepAliveInterval),e._keepAliveInterval=setInterval(u,1e3*n)},e._stopKeepAliveInterval=function(){e._keepAliveInterval&&(clearInterval(e._keepAliveInterval),delete e._keepAliveInterval)},e.disableKeepAlive=function(){delete e._keepAliveOptions,e._stopKeepAliveInterval()},e.on("stream:management:resumed",(function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)})),e.on("stream:start",(function(){e._keepAliveOptions&&e.enableKeepAlive(e._keepAliveOptions)}));var t=function(){var t=i(r.mark((function t(n,a){var o;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.config.useStreamManagement){t.next=2;break}return t.abrupt("return",a());case 2:if(o=function(){var t=i(r.mark((function t(n){return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=n.type,t.next="enabled"===t.t0?3:"resumed"===t.t0?8:"failed"===t.t0?17:22;break;case 3:return t.next=5,e.sm.enabled(n);case 5:return e.features.negotiated.streamManagement=!0,e.off("sm",o),t.abrupt("return",a());case 8:return t.next=10,e.sm.resumed(n);case 10:return e.features.negotiated.streamManagement=!0,e.features.negotiated.bind=!0,e.sessionStarted=!0,e.sessionStarting=!1,e.off("sm",o),e.emit("stream:management:resumed",n),t.abrupt("return",a("break"));case 17:return t.next=19,e.sm.failed(n);case 19:e.off("sm",o),e.emit("session:end"),a();case 22:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.on("sm",o),e.sm.id){t.next=14;break}if(!e.features.negotiated.bind){t.next=10;break}return t.next=8,e.sm.enable();case 8:t.next=12;break;case 10:e.off("sm",o),a();case 12:t.next=21;break;case 14:if(!e.sm.id||!e.sm.allowResume){t.next=19;break}return t.next=17,e.sm.resume();case 17:t.next=21;break;case 19:e.off("sm",o),a();case 21:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}();e.registerFeature("streamManagement",200,t),e.registerFeature("streamManagement",500,t),e.registerFeature("clientStateIndication",400,(function(t,n){e.features.negotiated.clientStateIndication=!0,n()}))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(15),c=(0,u.__importDefault)(n(264)),l=(0,u.__importStar)(n(22)),f=n(2);t.default=function(e){e.disco=new c.default,e.disco.addFeature(f.NS_DISCO_INFO),e.disco.addFeature(f.NS_DISCO_ITEMS),e.disco.addIdentity({category:"client",type:"web"}),e.registerFeature("caps",100,(function(t,n){var r=l.getDomain(e.jid)||e.config.server;e.emit("disco:caps",{caps:t.legacyCapabilities||[],jid:r}),e.features.negotiated.caps=!0,n()})),e.getDiscoInfo=function(){var t=a(r.mark((function t(n,i){var a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({disco:{node:i,type:"info"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",s({extensions:[],features:[],identities:[]},a.disco));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getDiscoItems=function(){var t=a(r.mark((function t(n,i){var a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({disco:{node:i,type:"items"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",s({items:[]},a.disco));case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.updateCaps=function(){var t=e.config.capsNode||"https://stanzajs.org";return e.disco.updateCaps(t)},e.getCurrentCaps=function(){var t=e.disco.getCaps();if(t){var n="".concat(t[0].node,"#").concat(t[0].value);return{info:e.disco.getNodeInfo(n),legacyCapabilities:t}}},e.on("presence",(function(t){t.legacyCapabilities&&e.emit("disco:caps",{caps:t.legacyCapabilities,jid:t.from})})),e.on("iq:get:disco",(function(t){var n=t.disco,r=n.type,i=n.node;"info"===r&&e.sendIQResult(t,{disco:s(s({},e.disco.getNodeInfo(i||"")),{},{node:i,type:"info"})}),"items"===r&&e.sendIQResult(t,{disco:{items:e.disco.items.get(i||"")||[],type:"items"}})}))}},function(e,t,n){"use strict";var r=n(3),i=n(9);function a(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 o(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 o(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,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(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 s=n(15),u=n(18),c=n(2),l=(0,s.__importStar)(n(21));t.default=function(e){e.disco.addFeature("jid\\20escaping"),e.disco.addFeature(c.NS_DELAY),e.disco.addFeature(c.NS_EME_0),e.disco.addFeature(c.NS_FORWARD_0),e.disco.addFeature(c.NS_HASHES_2),e.disco.addFeature(c.NS_HASHES_1),e.disco.addFeature(c.NS_IDLE_1),e.disco.addFeature(c.NS_JSON_0),e.disco.addFeature(c.NS_OOB),e.disco.addFeature(c.NS_PSA),e.disco.addFeature(c.NS_REFERENCE_0),e.disco.addFeature(c.NS_SHIM),e.disco.addFeature(c.NS_DATAFORM),e.disco.addFeature(c.NS_DATAFORM_MEDIA),e.disco.addFeature(c.NS_DATAFORM_VALIDATION),e.disco.addFeature(c.NS_DATAFORM_LAYOUT);var t,n=a(l.getHashes());try{for(n.s();!(t=n.n()).done;){var o=t.value;e.disco.addFeature((0,c.NS_HASH_NAME)(o))}}catch(e){n.e(e)}finally{n.f()}e.disco.addFeature(c.NS_TIME),e.disco.addFeature(c.NS_VERSION),e.on("iq:get:softwareVersion",(function(t){return e.sendIQResult(t,{softwareVersion:e.config.softwareVersion||{name:"stanzajs.org",version:u.VERSION}})})),e.on("iq:get:time",(function(t){var n=new Date;e.sendIQResult(t,{time:{tzo:n.getTimezoneOffset(),utc:n}})})),e.getSoftwareVersion=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({softwareVersion:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.softwareVersion);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getTime=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({time:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.time);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getLastActivity=function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({lastActivity:{},to:n,type:"get"});case 2:return i=t.sent,t.abrupt("return",i.lastActivity);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(3),i=n(9);function a(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 o(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 o(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,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,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(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.default=function(e){e.features={handlers:Object.create(null),negotiated:Object.create(null),order:[]},e.registerFeature=function(t,n,r){this.features.order.push({name:t,priority:n}),this.features.order.sort((function(e,t){return e.priority-t.priority})),this.features.handlers[t]=r.bind(e)},e.on("features",function(){var t=i(r.mark((function t(n){var i,o,s,u,c,l,f,p,d,h,v,m,g;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:f=function(e){return new Promise((function(t){o[e](n,(function(e,n){t(e?{command:e,message:n}:null)}))}))},i=e.features.negotiated,o=e.features.handlers,s=[],u=a(e.features.order);try{for(u.s();!(c=u.n()).done;)l=c.value.name,n[l]&&o[l]&&!i[l]&&s.push(l)}catch(e){u.e(e)}finally{u.f()}p=0,d=s;case 7:if(!(p<d.length)){t.next=33;break}if(h=d[p],!i[h]){t.next=11;break}return t.abrupt("continue",30);case 11:return v="",m="",t.prev=13,t.next=16,f(h);case 16:(g=t.sent)&&(v=g.command,m=g.message||""),t.next=25;break;case 20:t.prev=20,t.t0=t.catch(13),v="disconnect",m=t.t0.message,console.error(t.t0);case 25:if(v){t.next=27;break}return t.abrupt("continue",30);case 27:return"restart"===v&&e.transport&&e.transport.restart(),"disconnect"===v&&(e.emit("stream:error",{condition:"policy-violation",text:"Failed to negotiate stream features: "+m}),e.disconnect()),t.abrupt("return");case 30:p++,t.next=7;break;case 33:case"end":return t.stop()}}),t,null,[[13,20]])})));return function(e){return t.apply(this,arguments)}}())}},function(e,t,n){"use strict";var r=n(3),i=n(12),a=n(9);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=n(2);t.default=function(e){e.discoverBindings=function(){var t=a(r.mark((function t(n){var a,s,c,l;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=new Set,s=new Set,c=e.resolver.getHostMeta(n).then((function(e){var t,n,r=o(null!==(t=e.links)&&void 0!==t?t:[]);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.href&&i.rel===u.NS_ALT_CONNECTIONS_WEBSOCKET&&s.add(i.href),i.href&&i.rel===u.NS_ALT_CONNECTIONS_XBOSH&&a.add(i.href)}}catch(e){r.e(e)}finally{r.f()}})).catch((function(e){return console.error(e)})),l=e.config.allowAlternateDNSDiscovery?e.resolver.resolveTXT("_xmppconnect.".concat(n)).then((function(e){var t,n=o(e);try{for(n.s();!(t=n.n()).done;){var r,i=o(t.value);try{for(i.s();!(r=i.n()).done;){var u=r.value;if(u.startsWith("_xmpp-client-websocket=")){var c=u.substring(u.indexOf("=")+1);c&&s.add(c)}if(u.startsWith("_xmpp-client-xbosh=")){var l=u.substring(u.indexOf("=")+1);l&&a.add(l)}}}catch(e){i.e(e)}finally{i.f()}}}catch(e){n.e(e)}finally{n.f()}})).catch((function(e){return console.error(e)})):Promise.resolve(),t.next=6,Promise.all([c,l]).catch((function(e){return console.error(e)}));case 6:return t.abrupt("return",{bosh:i(a).filter((function(e){return e.startsWith("https://")})),websocket:i(s).filter((function(e){return e.startsWith("wss://")}))});case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(3),i=n(9),a=n(4);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}function u(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 c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var l=n(15),f=n(21),p=(0,l.__importStar)(n(61)),d=n(2);t.default=function(e){var t=!!f.RTCPeerConnection,n={advertiseAudio:t,advertiseFileTransfer:t,advertiseVideo:t,bundlePolicy:"balanced",hasRTCPeerConnection:t,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",rtcpMuxPolicy:"require",trickleIce:!0},a=e.config.jingle,s=c(c({},n),a),u=e.jingle=new p.SessionManager(s),l=[d.NS_JINGLE_1];s.hasRTCPeerConnection&&(l.push(d.NS_JINGLE_ICE_0,d.NS_JINGLE_ICE_UDP_1,d.NS_JINGLE_DTLS_SCTP_1,d.NS_JINGLE_DTLS_0,"urn:ietf:rfc:5888"),!1===s.trickleIce&&l.push("urn:ietf:rfc:3264"),(s.advertiseAudio||s.advertiseVideo)&&l.push(d.NS_JINGLE_RTP_1,d.NS_JINGLE_RTP_RTCP_FB_0,d.NS_JINGLE_RTP_HDREXT_0,"urn:ietf:rfc:5576"),s.advertiseAudio&&l.push(d.NS_JINGLE_RTP_AUDIO),s.advertiseVideo&&l.push(d.NS_JINGLE_RTP_VIDEO),s.advertiseFileTransfer&&l.push(d.NS_JINGLE_FILE_TRANSFER_4,d.NS_JINGLE_FILE_TRANSFER_5));for(var h=0,v=l;h<v.length;h++){var m=v[h];e.disco.addFeature(m)}for(var g=function(){var t=b[y];u.on(t,(function(n,r){e.emit("jingle:"+t,n,r)}))},y=0,b=["outgoing","incoming","accepted","terminated","ringing","mute","unmute","hold","resumed"];y<b.length;y++)g();u.on("createdSession",(function(t){e.emit("jingle:created",t)})),u.on("send",function(){var t=i(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,"set"!==n.type){t.next=8;break}return t.next=4,e.sendIQ(n);case 4:(i=t.sent).jingle||(i.jingle={}),i.jingle.sid=n.jingle.sid,u.process(i);case 8:"result"===n.type&&e.sendIQResult({type:"set",id:n.id,from:n.to},n),"error"===n.type&&e.sendIQError({type:"set",id:n.id,from:n.to},n),t.next=17;break;case 12:t.prev=12,t.t0=t.catch(0),t.t0.jingle||(t.t0.jingle=n.jingle),t.t0.jingle.sid=n.jingle.sid,u.process(t.t0);case 17:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}()),e.on("session:bound",(function(e){u.selfID=e})),e.on("iq:set:jingle",(function(e){u.process(e)})),e.on("unavailable",(function(e){u.endPeerSessions(e.from,void 0,!0)})),e.getServices=function(){var t=i(r.mark((function t(n,i,a){var o,s;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({externalServices:{type:i,version:a},to:n,type:"get"});case 2:return o=t.sent,(s=o.externalServices).services=s.services||[],t.abrupt("return",s);case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getServiceCredentials=function(){var t=i(r.mark((function t(n,i,a,o,s){var u;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({externalServiceCredentials:{host:i,port:o,type:a,version:s},to:n,type:"get"});case 2:return u=t.sent,t.abrupt("return",u.externalServiceCredentials);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r,i,a){return t.apply(this,arguments)}}(),e.discoverICEServers=i(r.mark((function t(){var n,i,a,s,u,c,l,f=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=f.length>0&&void 0!==f[0]?f[0]:{},t.prev=1,t.next=4,e.getServices(e.config.server,void 0,n.version);case 4:i=t.sent,a=i.services||[],s=[],u=o(a);try{for(u.s();!(c=u.n()).done;)l=c.value,e.jingle.addICEServer(l)}catch(e){u.e(e)}finally{u.f()}return t.abrupt("return",s);case 12:return t.prev=12,t.t0=t.catch(1),t.abrupt("return",[]);case 15:case"end":return t.stop()}}),t,null,[[1,12]])})))}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(15),c=n(110),l=(0,u.__importStar)(n(22)),f=n(2);t.default=function(e){e.getHistorySearchForm=function(){var t=a(i.mark((function t(n){var r,a,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},t.next=3,e.sendIQ({archive:{type:"query",version:r.version},to:n,type:"get"});case 3:return a=t.sent,t.abrupt("return",a.archive.form);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.searchHistory=function(){var t=a(i.mark((function t(n){var r,a,o,u,p,d,h,v,m,g,y=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=y.length>1&&void 0!==y[1]?y[1]:{},a=e.nextId(),o="","string"==typeof n?o=n:(o=n.to||"",r=n),r.queryId=a,(u=r.form||{}).type="submit",p=u.fields||[],d=[{name:"FORM_TYPE",type:"hidden",value:f.NS_MAM_2}],r.with&&d.push({name:"with",type:"text-single",value:r.with}),r.start&&d.push({name:"start",type:"text-single",value:r.start.toISOString()}),r.end&&d.push({name:"end",type:"text-single",value:r.end.toISOString()}),u.fields=(0,c.mergeFields)(d,p),r.form=u,h=l.allowedResponders(e.jid,o),v=[],m=function(e){h.has(e.from)&&e.archive&&e.archive.queryId===a&&v.push(e.archive)},e.on("mam:item",m),t.prev=18,t.next=21,e.sendIQ({archive:r,id:a,to:o,type:"set"});case 21:return g=t.sent,t.abrupt("return",s(s({},g.archive),{},{results:v}));case 23:return t.prev=23,e.off("mam:item",m),t.finish(23);case 26:case"end":return t.stop()}}),t,null,[[18,,23,26]])})));return function(e){return t.apply(this,arguments)}}(),e.getHistoryPreferences=a(i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({archive:{type:"preferences"},type:"get"});case 2:return n=t.sent,t.abrupt("return",n.archive);case 4:case"end":return t.stop()}}),t)}))),e.setHistoryPreferences=function(t){return e.sendIQ({archive:s({type:"preferences"},t),type:"set"})},e.on("message",(function(t){t.archive&&e.emit("mam:item",t)}))}},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}),t.mergeFields=void 0,t.mergeFields=function(e,t){var n,r=[],i=new Map,s=o(t);try{for(s.s();!(n=s.n()).done;){var u=n.value;u.name&&i.set(u.name,u)}}catch(e){s.e(e)}finally{s.f()}var c,l=new Set,f=o(e);try{for(f.s();!(c=f.n()).done;){var p=c.value;p.name&&i.has(p.name)?(r.push(a(a({},p),i.get(p.name))),l.add(p.name)):r.push(a({},p))}}catch(e){f.e(e)}finally{f.f()}var d,h=o(t);try{for(h.s();!(d=h.n()).done;){var v=d.value;(!v.name||v.name&&!l.has(v.name))&&r.push(a({},v))}}catch(e){h.e(e)}finally{h.f()}return r}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22)),c=n(2),l=new Set(["chat","groupchat","headline","normal"]),f=new Set(["chat","groupchat","normal"]),p=new Map([["markable",0],["received",1],["displayed",2],["acknowledged",3]]),d=function(e,t){var n;return e.marker&&(p.get(e.marker.type)<p.get(t)||"markable"===(null===(n=e.marker)||void 0===n?void 0:n.type))};function h(e,t){return v.apply(this,arguments)}function v(){return(v=a(r.mark((function e(t,n){return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.sendIQ({carbons:{action:n},type:"set"});case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}t.default=function(e){e.disco.addFeature(c.NS_ATTENTION_0),e.disco.addFeature(c.NS_CHAT_MARKERS_0),e.disco.addFeature(c.NS_CHAT_STATES),e.disco.addFeature(c.NS_CORRECTION_0),e.disco.addFeature(c.NS_RECEIPTS),e.disco.addFeature(c.NS_RTT_0),e.enableCarbons=function(){return h(e,"enable")},e.disableCarbons=function(){return h(e,"disable")},e.markReceived=function(t){return e.sendMarker(t,"received")},e.markDisplayed=function(t){return e.sendMarker(t,"displayed")},e.markAcknowledged=function(t){return e.sendMarker(t,"acknowledged")},e.getAttention=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendMessage(s(s({},n),{},{requestingAttention:!0,to:t,type:"headline"}))},e.sendMarker=function(t,n,r){if(d(t,n)||r){var i=!1!==e.config.groupchatMarkersUseStanzaID,a=t.id;if("groupchat"===t.type&&t.stanzaIds&&i){var o=t.stanzaIds.find((function(e){return u.equalBare(e.by,t.from)}));o&&(a=o.id)}e.sendMessage({marker:{id:a,type:n},to:"groupchat"===t.type?u.toBare(t.from):t.from,type:t.type})}},e.on("message",(function(t){if(t.carbon&&u.equalBare(t.from,e.jid)){var n=t.carbon.forward.message;n.delay||(n.delay=t.carbon.forward.delay||{timestamp:new Date(Date.now())}),function(e){return!!e.carbon&&"received"===e.carbon.type}(t)&&(e.emit("carbon:received",t),e.emit("message",n)),function(e){return!!e.carbon&&"sent"===e.carbon.type}(t)&&(e.emit("carbon:sent",t),e.emit("message:sent",n,!0))}(function(e){return!!e.forms&&e.forms.length>0})(t)&&e.emit("dataform",t),t.requestingAttention&&e.emit("attention",t),function(e){return!!e.rtt}(t)&&e.emit("rtt",t),function(e){return!!e.replace}(t)&&e.emit("replace",t),function(e){return!!e.chatState}(t)&&f.has(t.type||"normal")&&e.emit("chat:state",t);var r=!1!==e.config.sendReceipts,i=!1!==e.config.sendMUCReceipts,a=!1!==e.config.chatMarkers,o=!1!==e.config.groupchatMarkersUseStanzaID,s=function(e){var t;return!!e.receipt&&"request"===e.receipt.type&&l.has(null!==(t=e.type)&&void 0!==t?t:"normal")}(t),c=d(t,"received"),p=s&&r&&("groupchat"!==t.type||i);if(p||a&&c){var h="groupchat"===t.type?u.toBare(t.from):t.from,v=t.id;if("groupchat"===t.type&&t.stanzaIds&&o){var m=t.stanzaIds.find((function(e){return u.equalBare(e.by,t.from)}));m&&(v=m.id)}e.sendMessage({receipt:p?{id:t.id,type:"received"}:void 0,marker:a&&c?{id:v,type:"received"}:void 0,to:h,type:t.type})}t.receipt&&"received"===t.receipt.type&&e.emit("receipt",t),t.marker&&"markable"!==t.marker.type&&e.emit("marker:".concat(t.marker.type),t)}))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9),o=n(13);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){i(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});var f=n(15),p=n(18),d=(0,f.__importStar)(n(22)),h=n(2),v=n(27);t.default=function(e){e.disco.addFeature(h.NS_MUC),e.disco.addFeature(h.NS_MUC_DIRECT_INVITE),e.disco.addFeature(h.NS_HATS_0),e.joinedRooms=new Map,e.joiningRooms=new Map,e.leavingRooms=new Map,e.on("session:started",(function(){var t=e.joiningRooms;e.joiningRooms=new Map;var n,r=c(t);try{for(r.s();!(n=r.n()).done;){var i=o(n.value,2),a=i[0],s=i[1];e.joinRoom(a,s)}}catch(e){r.e(e)}finally{r.f()}var u=e.joinedRooms;e.joinedRooms=new Map;var l,f=c(u);try{for(f.s();!(l=f.n()).done;){var p=o(l.value,2),d=p[0],h=p[1];e.joinRoom(d,h)}}catch(e){f.e(e)}finally{f.f()}})),e.on("message",(function(t){if("groupchat"!==t.type||!t.hasSubject||t.body){if(t.muc)if("direct-invite"===t.muc.type||!t.muc.invite&&t.legacyMUC){var n="direct-invite"===t.muc.type?t.muc:t.legacyMUC;e.emit("muc:invite",{from:t.from,password:n.password,reason:n.reason,room:n.jid,thread:n.thread,type:"direct"})}else t.muc.invite?e.emit("muc:invite",{from:t.muc.invite[0].from,password:t.muc.password,reason:t.muc.invite[0].reason,room:t.from,thread:t.muc.invite[0].thread,type:"mediated"}):t.muc.decline?e.emit("muc:declined",{from:t.muc.decline.from,reason:t.muc.decline.reason,room:t.from}):e.emit("muc:other",t)}else e.emit("muc:topic",{from:t.from,room:d.toBare(t.from),topic:t.subject||""})})),e.on("presence",(function(t){var n=d.toBare(t.from);if(e.joiningRooms.has(n)&&"error"===t.type)return e.joiningRooms.delete(n),e.emit("muc:failed",t),void e.emit("muc:error",t);if(function(e){return!!e.muc}(t)){var r=t.muc.statusCodes&&t.muc.statusCodes.indexOf(p.MUCStatusCode.SelfPresence)>=0,i=t.muc.statusCodes&&t.muc.statusCodes.indexOf(p.MUCStatusCode.NickChanged)>=0;if("error"!==t.type){if("unavailable"===t.type)return e.emit("muc:unavailable",t),r&&(i?e.joinedRooms.set(n,t.muc.nick):(e.emit("muc:leave",t),e.joinedRooms.delete(n),e.leavingRooms.delete(n))),void(t.muc.destroy&&e.emit("muc:destroyed",{newRoom:t.muc.destroy.jid,password:t.muc.destroy.password,reason:t.muc.destroy.reason,room:n}));e.emit("muc:available",t);var a=e.joiningRooms.has(n)||!e.joinedRooms.has(n);r&&(e.joinedRooms.set(n,d.getResource(t.from)),a&&(e.joiningRooms.delete(n),e.emit("muc:join",t)))}else e.emit("muc:error",t)}})),e.joinRoom=function(){var t=a(r.mark((function t(n,i){var a,o=arguments;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.length>2&&void 0!==o[2]?o[2]:{},n=d.toBare(n),e.joiningRooms.set(n,i||""),i){t.next=14;break}return t.prev=4,t.next=7,e.getReservedNick(n);case 7:i=t.sent,e.joiningRooms.set(n,i),t.next=14;break;case 11:throw t.prev=11,t.t0=t.catch(4),new Error("Room nick required");case 14:return t.abrupt("return",new Promise((function(t,r){function o(r){d.equalBare(r.from,n)&&(e.off("muc:join",o),e.off("muc:failed",s),t(r))}function s(t){d.equalBare(t.from,n)&&(e.off("muc:join",o),e.off("muc:failed",s),r(t))}e.on("muc:join",o),e.on("muc:failed",s),e.sendPresence(u(u({},a),{},{muc:u(u({},a.muc),{},{type:"join"}),to:d.createFull(n,i)}))})));case 15:case"end":return t.stop()}}),t,null,[[4,11]])})));return function(e,n){return t.apply(this,arguments)}}(),e.leaveRoom=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t=d.toBare(t),n=n||e.joinedRooms.get(t),e.leavingRooms.set(t,n),new Promise((function(i,a){var o=r.id||(0,v.uuid)(),s=d.allowedResponders(t);function c(n){d.equalBare(n.from,t)&&(e.off("muc:leave",c),e.off("presence:error",l),i(n))}function l(n){n.id===o&&s.has(n.from)&&(e.joinedRooms.has(t)||e.leavingRooms.delete(t),e.off("muc:leave",c),e.off("presence:error",l),a(n))}e.on("muc:leave",c),e.on("presence:error",l),e.sendPresence(u(u({},r),{},{id:o,to:d.createFull(t,n),type:"unavailable"}))}))},e.ban=function(t,n,r){return e.setRoomAffiliation(t,n,"outcast",r)},e.kick=function(t,n,r){return e.setRoomRole(t,n,"none",r)},e.invite=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Array.isArray(n)||(n=[n]),e.sendMessage({muc:{invite:n,type:"info"},to:t})},e.directInvite=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};e.sendMessage({muc:u(u({},r),{},{jid:t,type:"direct-invite"}),to:n})},e.declineInvite=function(t,n,r){e.sendMessage({muc:{decline:{reason:r,to:n},type:"info"},to:t})},e.changeNick=function(t,n){var r=(0,v.uuid)(),i=d.createFull(t,n),a=d.allowedResponders(t);return new Promise((function(t,n){function o(n){a.has(d.toBare(n.from))&&n.muc.statusCodes&&n.muc.statusCodes.includes(p.MUCStatusCode.SelfPresence)&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),t(n))}function s(i){a.has(d.toBare(i.from))&&i.id===r&&(e.off("muc:available",o),e.off("presence:id:".concat(r),s),"error"===i.type?n(i):t(i))}e.on("muc:available",o),e.on("presence:id:".concat(r),s),e.sendPresence({id:r,to:i})}))},e.setSubject=function(t,n){e.sendMessage({subject:n,to:t,type:"groupchat"})},e.getReservedNick=function(){var t=a(r.mark((function t(n){var i,a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.getDiscoInfo(n,"x-roomuser-item");case 3:if(i=t.sent,!(a=i.identities[0]).name){t.next=9;break}return t.abrupt("return",a.name);case 9:throw new Error("No nickname reserved");case 10:t.next=15;break;case 12:throw t.prev=12,t.t0=t.catch(0),new Error("No nickname reserved");case 15:case"end":return t.stop()}}),t,null,[[0,12]])})));return function(e){return t.apply(this,arguments)}}(),e.requestRoomVoice=function(t){e.sendMessage({forms:[{fields:[{name:"FORM_TYPE",type:"hidden",value:"http://jabber.org/protocol/muc#request"},{name:"muc#role",type:"text-single",value:"participant"}],type:"submit"}],to:t})},e.setRoomAffiliation=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{affiliation:r,jid:n,reason:i}]},to:t,type:"set"})},e.setRoomRole=function(t,n,r,i){return e.sendIQ({muc:{type:"user-list",users:[{nick:n,reason:i,role:r}]},to:t,type:"set"})},e.getRoomMembers=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{affiliation:"member"};return e.sendIQ({muc:{type:"user-list",users:[n]},to:t,type:"get"})},e.getRoomConfig=function(){var t=a(r.mark((function t(n){var i;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({muc:{type:"configure"},to:n,type:"get"});case 2:if((i=t.sent).muc.form){t.next=5;break}throw new Error("No configuration form returned");case 5:return t.abrupt("return",i.muc.form);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.configureRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{form:u(u({},n),{},{type:"submit"}),type:"configure"},to:t,type:"set"})},e.destroyRoom=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.sendIQ({muc:{destroy:n,type:"configure"},to:t,type:"set"})},e.getUniqueRoomName=function(){var e=a(r.mark((function e(t){var n;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendIQ({muc:{type:"unique"},to:t,type:"get"});case 2:if((n=e.sent).muc.name){e.next=5;break}throw new Error("No unique name returned");case 5:return e.abrupt("return",n.muc.name);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),e.getBookmarks=a(r.mark((function t(){var n;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getPrivateData("bookmarks");case 2:if((n=t.sent)&&n.rooms){t.next=5;break}return t.abrupt("return",[]);case 5:return t.abrupt("return",n.rooms);case 6:case"end":return t.stop()}}),t)}))),e.setBookmarks=function(t){return e.setPrivateData("bookmarks",{rooms:t})},e.addBookmark=function(){var t=a(r.mark((function t(n){var i,a,o,s,l,f;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBookmarks();case 2:i=t.sent,a=[],o=!1,s=c(i);try{for(s.s();!(l=s.n()).done;)f=l.value,d.equalBare(f.jid,n.jid)?(a.push(u(u({},f),n)),o=!0):a.push(f)}catch(e){s.e(e)}finally{s.f()}return o||a.push(n),t.abrupt("return",e.setBookmarks(a));case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.removeBookmark=function(){var t=a(r.mark((function t(n){var i,a;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getBookmarks();case 2:return i=t.sent,a=i.filter((function(e){return!d.equalBare(e.jid,n)})),t.abrupt("return",e.setBookmarks(a));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(2);t.default=function(e){e.disco.addFeature(o.NS_ACTIVITY),e.disco.addFeature(o.NS_GEOLOC),e.disco.addFeature(o.NS_MOOD),e.disco.addFeature(o.NS_NICK),e.disco.addFeature(o.NS_TUNE),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_ACTIVITY)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_GEOLOC)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_MOOD)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_NICK)),e.disco.addFeature((0,o.NS_PEP_NOTIFY)(o.NS_TUNE)),e.publishActivity=function(t){return e.publish("",o.NS_ACTIVITY,a({itemType:o.NS_ACTIVITY},t))},e.publishGeoLoc=function(t){return e.publish("",o.NS_GEOLOC,a({itemType:o.NS_GEOLOC},t))},e.publishMood=function(t){return e.publish("",o.NS_MOOD,a({itemType:o.NS_MOOD},t))},e.publishNick=function(t){return e.publish("",o.NS_NICK,{itemType:o.NS_NICK,nick:t})},e.publishTune=function(t){return e.publish("",o.NS_TUNE,a({itemType:o.NS_TUNE},t))},e.on("pubsub:published",(function(t){var n=t.pubsub.items.published[0].content;switch(t.pubsub.items.node){case o.NS_ACTIVITY:return e.emit("activity",{activity:n,jid:t.from});case o.NS_GEOLOC:return e.emit("geoloc",{geoloc:n,jid:t.from});case o.NS_MOOD:return e.emit("mood",{jid:t.from,mood:n});case o.NS_NICK:return e.emit("nick",{jid:t.from,nick:n.nick});case o.NS_TUNE:return e.emit("tune",{jid:t.from,tune:t.pubsub.items.published[0].content})}}))}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22)),c=n(2);t.default=function(e){e.disco.addFeature("".concat(c.NS_SHIM,"#SubID"),c.NS_SHIM),e.on("message",(function(t){!function(e){return!!e.pubsub&&!(e.pubsub.context&&"user"!==e.pubsub.context||!e.pubsub.affiliations)}(t)?function(e){return!!e.pubsub}(t)&&(e.emit("pubsub:event",t),!function(e){return!!e.pubsub.items&&!!e.pubsub.items.published}(t)?!function(e){return!!e.pubsub.items&&!!e.pubsub.items.retracted}(t)?!function(e){return"purge"===e.pubsub.eventType}(t)?!function(e){return"delete"===e.pubsub.eventType}(t)?!function(e){return"subscription"===e.pubsub.eventType}(t)?function(e){return"configuration"===e.pubsub.eventType}(t)&&e.emit("pubsub:config",t):e.emit("pubsub:subscription",t):e.emit("pubsub:deleted",t):e.emit("pubsub:purged",t):e.emit("pubsub:retracted",t):e.emit("pubsub:published",t)):e.emit("pubsub:affiliations",t)})),e.subscribeToNode=function(){var t=a(i.mark((function t(n,r){var a,o,s,c;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={},"string"==typeof r?(a.node=r,a.jid=u.toBare(e.jid)):(a.node=r.node,a.jid=r.jid||(r.useBareJID?u.toBare(e.jid):e.jid),o=r.options),t.next=4,e.sendIQ({pubsub:{context:"user",subscribe:a,subscriptionOptions:o?{form:o}:void 0},to:n,type:"set"});case 4:return s=t.sent,c=s.pubsub.subscription||{},s.pubsub.subscriptionOptions&&(c.options=s.pubsub.subscriptionOptions.form),t.abrupt("return",c);case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.unsubscribeFromNode=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:return a={},"string"==typeof r?(a.node=r,a.jid=u.toBare(e.jid)):(a.node=r.node,a.subid=r.subid,a.jid=r.jid||(r.useBareJID?u.toBare(e.jid):e.jid)),t.next=4,e.sendIQ({pubsub:{context:"user",unsubscribe:a},to:n,type:"set"});case 4:if((o=t.sent).pubsub&&o.pubsub.subscription){t.next=7;break}return t.abrupt("return",s(s({},a),{},{state:"none"}));case 7:return t.abrupt("return",o.pubsub.subscription);case 8:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.publish=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",publish:{item:{content:r,id:i},node:n}},to:t,type:"set"})},e.getItem=function(){var t=a(i.mark((function t(n,r,a){var o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{context:"user",fetch:{items:[{id:a}],node:r}},to:n,type:"get"});case 2:return o=t.sent,t.abrupt("return",o.pubsub.fetch.items[0]);case 4:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getItems=function(){var t=a(i.mark((function t(n,r){var a,o,s,u=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>2&&void 0!==u[2]?u[2]:{},t.next=3,e.sendIQ({pubsub:{context:"user",fetch:{max:a.max,node:r},paging:a},to:n,type:"get"});case 3:return o=t.sent,(s=o.pubsub.fetch).paging=o.pubsub.paging,t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.retract=function(t,n,r,i){return e.sendIQ({pubsub:{context:"user",retract:{id:r,node:n,notify:i}},to:t,type:"set"})},e.purgeNode=function(t,n){return e.sendIQ({pubsub:{context:"owner",purge:n},to:t,type:"set"})},e.deleteNode=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",destroy:{node:n,redirect:r}},to:t,type:"set"})},e.createNode=function(){var t=a(i.mark((function t(n,r,a){var o;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{configure:a?{form:a}:void 0,context:"user",create:{node:r}},to:n,type:"set"});case 2:if((o=t.sent).pubsub&&o.pubsub.create){t.next=5;break}return t.abrupt("return",{node:r});case 5:return t.abrupt("return",o.pubsub.create);case 6:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getSubscriptions=function(){var t=a(i.mark((function t(n){var r,a,o=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},t.next=3,e.sendIQ({pubsub:{context:"user",subscriptions:r},to:n,type:"get"});case 3:return a=t.sent,t.abrupt("return",a.pubsub.subscriptions);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.getAffiliations=function(t,n){return e.sendIQ({pubsub:{affiliations:{node:n}},to:t,type:"get"})},e.getNodeSubscribers=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return"string"==typeof n?r.node=n:r=s(s({},r),n),e.sendIQ({pubsub:{context:"owner",subscriptions:r},to:t,type:"get"})},e.updateNodeSubscriptions=function(t,n,r){return e.sendIQ({pubsub:{context:"owner",subscriptions:{items:r,node:n}},to:t,type:"set"})},e.getNodeAffiliations=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{affiliations:{node:r},context:"owner"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.pubsub.affiliations);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.updateNodeAffiliations=function(t,n,r){return e.sendIQ({pubsub:{affiliations:{items:r,node:n},context:"owner"},to:t,type:"set"})},e.getNodeConfig=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{configure:{node:r},context:"owner"},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.pubsub.configure.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getDefaultNodeConfig=function(){var t=a(i.mark((function t(n){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{context:"owner",defaultConfiguration:{}},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.pubsub.defaultConfiguration.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.configureNode=function(){var t=a(i.mark((function t(n,r,a){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",e.sendIQ({pubsub:{configure:{form:a,node:r},context:"owner"},to:n,type:"set"}));case 1:case"end":return t.stop()}}),t)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.getDefaultSubscriptionOptions=function(){var t=a(i.mark((function t(n){var r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({pubsub:{defaultSubscriptionOptions:{}},to:n,type:"get"});case 2:return r=t.sent,t.abrupt("return",r.pubsub.defaultSubscriptionOptions.form||{});case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=(0,n(15).__importStar)(n(22));t.default=function(e){function t(e,t){return n.apply(this,arguments)}function n(){return(n=a(i.mark((function t(n,r){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({blockList:{action:n,jids:[r]},type:"set"});case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}e.on("iq:set:roster",(function(t){if(!u.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});e.emit("roster:update",t),e.sendIQResult(t)})),e.on("iq:set:blockList",(function(t){if(!u.allowedResponders(e.jid).has(t.from))return e.sendIQError(t,{error:{condition:"service-unavailable",type:"cancel"}});var n=t.blockList;e.emit(n.action,{jids:n.jids||[]}),e.sendIQResult(t)})),e.getRoster=a(i.mark((function t(){var n,r;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({roster:{version:e.config.rosterVer},type:"get"});case 2:if(!(n=t.sent).roster){t.next=10;break}return(r=n.roster.version)&&(e.config.rosterVer=r,e.emit("roster:ver",r)),n.roster.items=n.roster.items||[],t.abrupt("return",n.roster);case 10:return t.abrupt("return",{items:[]});case 11:case"end":return t.stop()}}),t)}))),e.updateRosterItem=function(){var t=a(i.mark((function t(n){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({roster:{items:[n]},type:"set"});case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.removeRosterItem=function(t){return e.updateRosterItem({jid:t,subscription:"remove"})},e.subscribe=function(t){e.sendPresence({type:"subscribe",to:t})},e.unsubscribe=function(t){e.sendPresence({type:"unsubscribe",to:t})},e.acceptSubscription=function(t){e.sendPresence({type:"subscribed",to:t})},e.denySubscription=function(t){e.sendPresence({type:"unsubscribed",to:t})},e.getBlocked=a(i.mark((function t(){var n;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({blockList:{action:"list"},type:"get"});case 2:return n=t.sent,t.abrupt("return",s({jids:[]},n.blockList));case 4:case"end":return t.stop()}}),t)}))),e.block=function(){var e=a(i.mark((function e(n){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("block",n));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.unblock=function(){var e=a(i.mark((function e(n){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t("unblock",n));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.goInvisible=a(i.mark((function t(){var n,r=arguments;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=r.length>0&&void 0!==r[0]&&r[0],t.next=3,e.sendIQ({type:"set",visiblity:{probe:n,type:"invisible"}});case 3:case"end":return t.stop()}}),t)}))),e.goVisible=a(i.mark((function t(){return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({type:"set",visiblity:{type:"visible"}});case 2:case"end":return t.stop()}}),t)})))}},function(e,t,n){"use strict";var r=n(3),i=n(4),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e.registerFeature("sasl",100,function(){var t=a(r.mark((function t(n,i){var o,u,c;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.sasl.createMechanism(n.sasl.mechanisms),u=function(){var t=a(r.mark((function t(n){var a,c,l;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o){t.next=2;break}return t.abrupt("return");case 2:t.t0=n.type,t.next="success"===t.t0?5:"challenge"===t.t0?11:"failure"===t.t0||"abort"===t.t0?27:31;break;case 5:return e.features.negotiated.sasl=!0,e.off("sasl",u),e.emit("auth:success",e.config.credentials),e.transport&&(e.transport.authenticated=!0),i("restart"),t.abrupt("return");case 11:return o.processChallenge(n.value),t.prev=12,t.next=15,e.getCredentials();case 15:a=t.sent,(c=o.createResponse(a))||""===c?e.send("sasl",{type:"response",value:c}):e.send("sasl",{type:"response"}),(l=o.getCacheableCredentials())&&(e.config.credentials||(e.config.credentials={}),e.config.credentials=s(s({},e.config.credentials),l),e.emit("credentials:update",e.config.credentials)),t.next=26;break;case 22:t.prev=22,t.t1=t.catch(12),console.error(t.t1),e.send("sasl",{type:"abort"});case 26:return t.abrupt("return");case 27:return e.off("sasl",u),e.emit("auth:failed"),i("disconnect","authentication failed"),t.abrupt("return");case 31:case"end":return t.stop()}}),t,null,[[12,22]])})));return function(e){return t.apply(this,arguments)}}(),o){t.next=6;break}return e.off("sasl",u),e.emit("auth:failed"),t.abrupt("return",i("disconnect","authentication failed"));case 6:return e.on("sasl",u),e.once("--reset-stream-features",(function(){e.features.negotiated.sasl=!1,e.off("sasl",u)})),t.prev=8,t.next=11,e.getCredentials();case 11:c=t.sent,e.send("sasl",{mechanism:o.name,type:"auth",value:o.createResponse(c)}),t.next=19;break;case 15:t.prev=15,t.t0=t.catch(8),console.error(t.t0),e.send("sasl",{type:"abort"});case 19:case"end":return t.stop()}}),t,null,[[8,15]])})));return function(e,n){return t.apply(this,arguments)}}())}},function(e,t,n){"use strict";var r=n(4),i=n(3),a=n(9);function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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}Object.defineProperty(t,"__esModule",{value:!0});var l=(0,n(15).__importStar)(n(22)),f=n(2);t.default=function(e){function t(e){return n.apply(this,arguments)}function n(){return(n=a(i.mark((function t(n){var r,a,o,s,c,l,p;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getDiscoInfo(n);case 2:if((r=t.sent).features&&r.features.includes(f.NS_HTTP_UPLOAD_0)){t.next=5;break}return t.abrupt("return");case 5:o=u(r.extensions||[]),t.prev=6,o.s();case 8:if((s=o.n()).done){t.next=17;break}if(c=s.value,!(l=c.fields||[]).some((function(e){return"FORM_TYPE"===e.name&&e.value===f.NS_HTTP_UPLOAD_0}))){t.next=15;break}return(p=l.find((function(e){return"max-file-size"===e.name})))&&(a=parseInt(p.value,10)),t.abrupt("return",{jid:n,maxSize:a});case 15:t.next=8;break;case 17:t.next=22;break;case 19:t.prev=19,t.t0=t.catch(6),o.e(t.t0);case 22:return t.prev=22,o.f(),t.finish(22);case 25:case"end":return t.stop()}}),t,null,[[6,19,22,25]])})))).apply(this,arguments)}e.disco.addFeature(f.NS_BOB),e.getBits=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({bits:{cid:r},to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.bits);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),e.getUploadService=a(i.mark((function n(){var r,a,o,s,c,f,p,d=arguments;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=d.length>0&&void 0!==d[0]?d[0]:l.getDomain(e.jid),n.next=3,t(r);case 3:if(!(a=n.sent)){n.next=6;break}return n.abrupt("return",a);case 6:return n.next=8,e.getDiscoItems(r);case 8:o=n.sent,s=u(o.items||[]),n.prev=10,s.s();case 12:if((c=s.n()).done){n.next=23;break}if((f=c.value).jid){n.next=16;break}return n.abrupt("continue",21);case 16:return n.next=18,t(f.jid);case 18:if(!(p=n.sent)){n.next=21;break}return n.abrupt("return",p);case 21:n.next=12;break;case 23:n.next=28;break;case 25:n.prev=25,n.t0=n.catch(10),s.e(n.t0);case 28:return n.prev=28,s.f(),n.finish(28);case 31:throw new Error("No upload service discovered on: "+r);case 32:case"end":return n.stop()}}),n,null,[[10,25,28,31]])}))),e.getUploadSlot=function(){var t=a(i.mark((function t(n,r){var a;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.sendIQ({httpUpload:s({type:"request"},r),to:n,type:"get"});case 2:return a=t.sent,t.abrupt("return",a.httpUpload);case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15);(0,r.__exportStar)(n(119),t),(0,r.__exportStar)(n(120),t),(0,r.__exportStar)(n(121),t),(0,r.__exportStar)(n(122),t),(0,r.__exportStar)(n(123),t),(0,r.__exportStar)(n(124),t),(0,r.__exportStar)(n(125),t),(0,r.__exportStar)(n(126),t),(0,r.__exportStar)(n(127),t),(0,r.__exportStar)(n(128),t),(0,r.__exportStar)(n(129),t),(0,r.__exportStar)(n(130),t),(0,r.__exportStar)(n(131),t),(0,r.__exportStar)(n(132),t),(0,r.__exportStar)(n(133),t),(0,r.__exportStar)(n(134),t),(0,r.__exportStar)(n(135),t),(0,r.__exportStar)(n(136),t),(0,r.__exportStar)(n(137),t),(0,r.__exportStar)(n(138),t),(0,r.__exportStar)(n(139),t),(0,r.__exportStar)(n(140),t),(0,r.__exportStar)(n(141),t),(0,r.__exportStar)(n(142),t),(0,r.__exportStar)(n(143),t),(0,r.__exportStar)(n(144),t),(0,r.__exportStar)(n(145),t),(0,r.__exportStar)(n(146),t),(0,r.__exportStar)(n(147),t),(0,r.__exportStar)(n(148),t),(0,r.__exportStar)(n(149),t),(0,r.__exportStar)(n(150),t),(0,r.__exportStar)(n(151),t),(0,r.__exportStar)(n(152),t),(0,r.__exportStar)(n(153),t),(0,r.__exportStar)(n(154),t),(0,r.__exportStar)(n(155),t),(0,r.__exportStar)(n(156),t),(0,r.__exportStar)(n(157),t),(0,r.__exportStar)(n(158),t),(0,r.__exportStar)(n(159),t),(0,r.__exportStar)(n(160),t),(0,r.__exportStar)(n(161),t),(0,r.__exportStar)(n(162),t),(0,r.__exportStar)(n(163),t),(0,r.__exportStar)(n(164),t),(0,r.__exportStar)(n(165),t),(0,r.__exportStar)(n(166),t),(0,r.__exportStar)(n(167),t),(0,r.__exportStar)(n(168),t),(0,r.__exportStar)(n(169),t),(0,r.__exportStar)(n(170),t),(0,r.__exportStar)(n(171),t),(0,r.__exportStar)(n(172),t),(0,r.__exportStar)(n(173),t),(0,r.__exportStar)(n(174),t),(0,r.__exportStar)(n(175),t),(0,r.__exportStar)(n(176),t),(0,r.__exportStar)(n(177),t),(0,r.__exportStar)(n(178),t),(0,r.__exportStar)(n(179),t),(0,r.__exportStar)(n(180),t),(0,r.__exportStar)(n(181),t),(0,r.__exportStar)(n(182),t),(0,r.__exportStar)(n(183),t),(0,r.__exportStar)(n(184),t),(0,r.__exportStar)(n(185),t),(0,r.__exportStar)(n(186),t),(0,r.__exportStar)(n(187),t),(0,r.__exportStar)(n(188),t),(0,r.__exportStar)(n(189),t),(0,r.__exportStar)(n(190),t),(0,r.__exportStar)(n(191),t),(0,r.__exportStar)(n(192),t),(0,r.__exportStar)(n(193),t),(0,r.__exportStar)(n(194),t),(0,r.__exportStar)(n(195),t),(0,r.__exportStar)(n(196),t),(0,r.__exportStar)(n(197),t),(0,r.__exportStar)(n(198),t),(0,r.__exportStar)(n(68),t);var i=(0,r.__importDefault)(n(119)),a=(0,r.__importDefault)(n(120)),o=(0,r.__importDefault)(n(121)),s=(0,r.__importDefault)(n(122)),u=(0,r.__importDefault)(n(123)),c=(0,r.__importDefault)(n(124)),l=(0,r.__importDefault)(n(125)),f=(0,r.__importDefault)(n(126)),p=(0,r.__importDefault)(n(127)),d=(0,r.__importDefault)(n(128)),h=(0,r.__importDefault)(n(129)),v=(0,r.__importDefault)(n(130)),m=(0,r.__importDefault)(n(131)),g=(0,r.__importDefault)(n(132)),y=(0,r.__importDefault)(n(133)),b=(0,r.__importDefault)(n(134)),_=(0,r.__importDefault)(n(135)),S=(0,r.__importDefault)(n(136)),w=(0,r.__importDefault)(n(137)),x=(0,r.__importDefault)(n(138)),k=(0,r.__importDefault)(n(139)),O=(0,r.__importDefault)(n(140)),T=(0,r.__importDefault)(n(141)),A=(0,r.__importDefault)(n(142)),I=(0,r.__importDefault)(n(143)),E=(0,r.__importDefault)(n(144)),N=(0,r.__importDefault)(n(145)),R=(0,r.__importDefault)(n(146)),j=(0,r.__importDefault)(n(147)),C=(0,r.__importDefault)(n(148)),P=(0,r.__importDefault)(n(149)),M=(0,r.__importDefault)(n(150)),D=(0,r.__importDefault)(n(152)),L=(0,r.__importDefault)(n(153)),B=(0,r.__importDefault)(n(154)),F=(0,r.__importDefault)(n(151)),q=(0,r.__importDefault)(n(155)),U=(0,r.__importDefault)(n(156)),z=(0,r.__importDefault)(n(157)),J=(0,r.__importDefault)(n(158)),G=(0,r.__importDefault)(n(159)),H=(0,r.__importDefault)(n(160)),V=(0,r.__importDefault)(n(161)),W=(0,r.__importDefault)(n(162)),Q=(0,r.__importDefault)(n(163)),K=(0,r.__importDefault)(n(164)),Y=(0,r.__importDefault)(n(165)),X=(0,r.__importDefault)(n(166)),$=(0,r.__importDefault)(n(167)),Z=(0,r.__importDefault)(n(168)),ee=(0,r.__importDefault)(n(169)),te=(0,r.__importDefault)(n(170)),ne=(0,r.__importDefault)(n(171)),re=(0,r.__importDefault)(n(172)),ie=(0,r.__importDefault)(n(173)),ae=(0,r.__importDefault)(n(174)),oe=(0,r.__importDefault)(n(175)),se=(0,r.__importDefault)(n(176)),ue=(0,r.__importDefault)(n(177)),ce=(0,r.__importDefault)(n(178)),le=(0,r.__importDefault)(n(179)),fe=(0,r.__importDefault)(n(180)),pe=(0,r.__importDefault)(n(181)),de=(0,r.__importDefault)(n(182)),he=(0,r.__importDefault)(n(183)),ve=(0,r.__importDefault)(n(184)),me=(0,r.__importDefault)(n(185)),ge=(0,r.__importDefault)(n(186)),ye=(0,r.__importDefault)(n(187)),be=(0,r.__importDefault)(n(188)),_e=(0,r.__importDefault)(n(189)),Se=(0,r.__importDefault)(n(190)),we=(0,r.__importDefault)(n(191)),xe=(0,r.__importDefault)(n(192)),ke=(0,r.__importDefault)(n(193)),Oe=(0,r.__importDefault)(n(194)),Te=(0,r.__importDefault)(n(195)),Ae=(0,r.__importDefault)(n(196)),Ie=(0,r.__importDefault)(n(197)),Ee=(0,r.__importDefault)(n(198)),Ne=(0,r.__importDefault)(n(68)),Re=[i.default,a.default,o.default,s.default,u.default,c.default,l.default,f.default,p.default,d.default,h.default,v.default,m.default,g.default,y.default,b.default,_.default,S.default,w.default,x.default,k.default,O.default,T.default,A.default,I.default,E.default,N.default,R.default,j.default,C.default,P.default,M.default,D.default,L.default,B.default,F.default,q.default,U.default,z.default,J.default,G.default,H.default,V.default,W.default,Q.default,K.default,Y.default,X.default,$.default,Z.default,ee.default,te.default,ne.default,re.default,ie.default,ae.default,oe.default,se.default,ue.default,ce.default,le.default,fe.default,pe.default,de.default,he.default,ve.default,me.default,ge.default,ye.default,be.default,_e.default,Se.default,we.default,xe.default,ke.default,Oe.default,Te.default,Ae.default,Ie.default,Ee.default,Ne.default];t.default=Re},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["features.legacySession","iq.legacySession"],element:"session",fields:{optional:(0,r.childBoolean)(null,"optional")},namespace:i.NS_SESSION};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:["atomentry"].concat(r((0,i.pubsubItemContentAliases)())),element:"entry",fields:{id:(0,i.childText)(null,"id"),published:(0,i.childDate)(null,"published"),updated:(0,i.childDate)(null,"updated")},namespace:a.NS_ATOM,type:a.NS_ATOM,typeField:"itemType"},{element:"summary",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.summary"},{element:"title",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.title"},{aliases:[{path:"atomentry.links",multiple:!0}],element:"link",fields:{href:(0,i.attribute)("href"),mediaType:(0,i.attribute)("type"),rel:(0,i.attribute)("rel")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.authors",multiple:!0}],element:"author",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.contributors",multiple:!0}],element:"contributor",fields:{name:(0,i.childText)(null,"name"),uri:(0,i.childText)(null,"uri"),email:(0,i.childText)(null,"email")},namespace:a.NS_ATOM},{aliases:[{path:"atomentry.categories",multiple:!0}],element:"category",fields:{term:(0,i.attribute)("term"),scheme:(0,i.attribute)("scheme"),label:(0,i.attribute)("label")},namespace:a.NS_ATOM},{element:"content",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.content"},{element:"rights",fields:{text:(0,i.text)(),type:(0,i.attribute)("type","text")},namespace:a.NS_ATOM,path:"atomentry.rights"}];t.default=o},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={defaultType:"stream",element:"stream",fields:{from:(0,a.attribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.attribute)("to"),version:(0,a.attribute)("version")},namespace:o.NS_STREAM,path:"stream",type:"stream",typeField:"action"},u={element:"features",namespace:o.NS_STREAM,path:"features"},c={element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STREAMS,"text"),condition:(0,a.childEnum)(o.NS_STREAMS,Object.values(i.StreamErrorCondition),i.StreamErrorCondition.UndefinedCondition),seeOtherHost:(0,a.childText)(o.NS_STREAMS,i.StreamErrorCondition.SeeOtherHost),text:(0,a.childText)(o.NS_STREAMS,"text")},namespace:o.NS_STREAM,path:"streamError"},l=Object.values(i.StreamType).map((function(e){return{aliases:["stanzaError","message.error","presence.error","iq.error"],defaultType:o.NS_CLIENT,element:"error",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_STANZAS,"text"),by:(0,a.JIDAttribute)("by"),condition:(0,a.childEnum)(o.NS_STANZAS,Object.values(i.StanzaErrorCondition),i.StanzaErrorCondition.UndefinedCondition),gone:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Gone),redirect:(0,a.childText)(o.NS_STANZAS,i.StanzaErrorCondition.Redirect),text:(0,a.childText)(o.NS_STANZAS,"text"),type:(0,a.attribute)("type")},namespace:e,type:e,typeField:"streamType"}})),f=new Set(["from","id","lang","to","type","payloadType","error","streamType"]),p=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"iq",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),payloadType:{order:-1e4,importer:function(e,t){if("get"===t.data.type||"set"===t.data.type){if(1!==e.children.filter((function(e){return"string"!=typeof e})).length)return"invalid-payload-count";var n=Object.keys(t.data).filter((function(e){return!f.has(e)}));return 1!==n.length?"unknown-payload":n[0]}}},to:(0,a.JIDAttribute)("to"),type:(0,a.attribute)("type")},namespace:e,path:"iq",type:e,typeField:"streamType"}})),d=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"message",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"message",type:e,typeField:"streamType"}})),h=Object.values(i.StreamType).map((function(e){return{childrenExportOrder:{error:2e5},defaultType:o.NS_CLIENT,element:"presence",fields:{from:(0,a.JIDAttribute)("from"),id:(0,a.attribute)("id"),lang:(0,a.languageAttribute)(),to:(0,a.JIDAttribute)("to")},namespace:e,path:"presence",type:e,typeField:"streamType"}})),v=[{element:"mechanisms",fields:{mechanisms:(0,a.multipleChildText)(null,"mechanism")},namespace:o.NS_SASL,path:"features.sasl"},{element:"abort",namespace:o.NS_SASL,path:"sasl",type:"abort",typeField:"type"},{element:"auth",fields:{mechanism:(0,a.attribute)("mechanism"),value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"auth",typeField:"type"},{element:"challenge",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"challenge",typeField:"type"},{element:"response",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"response",typeField:"type"},{element:"success",fields:{value:(0,a.textBuffer)("base64")},namespace:o.NS_SASL,path:"sasl",type:"success",typeField:"type"},{element:"failure",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(o.NS_SASL,"text"),condition:(0,a.childEnum)(o.NS_SASL,Object.values(i.SASLFailureCondition)),text:(0,a.childText)(o.NS_SASL,"text")},namespace:o.NS_SASL,path:"sasl",type:"failure",typeField:"type"}],m=[{aliases:["features.tls"],defaultType:"start",element:"starttls",fields:{required:(0,a.childBoolean)(null,"required")},namespace:o.NS_STARTTLS,path:"tls",type:"start",typeField:"type"},{element:"proceed",namespace:o.NS_STARTTLS,path:"tls",type:"proceed",typeField:"type"},{element:"failure",namespace:o.NS_STARTTLS,path:"tls",type:"failure",typeField:"type"}],g={aliases:["features.bind","iq.bind"],element:"bind",fields:{jid:(0,a.childText)(null,"jid"),resource:(0,a.childText)(null,"resource")},namespace:o.NS_BIND},y=[s,u,c].concat(r(l),v,m,r(p),r(d),r(h),[g]);t.default=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({rosterPreApproval:(0,r.childBoolean)(i.NS_SUBSCRIPTION_PREAPPROVAL,"sub"),rosterVersioning:(0,r.childBoolean)(i.NS_ROSTER_VERSIONING,"ver")}),(0,r.extendMessage)({alternateLanguageBodies:(0,r.childAlternateLanguageText)(null,"body"),alternateLanguageSubjects:(0,r.childAlternateLanguageText)(null,"subject"),body:(0,r.childText)(null,"body"),hasSubject:(0,r.childBoolean)(null,"subject"),parentThread:(0,r.childAttribute)(null,"thread","parent"),subject:(0,r.childText)(null,"subject"),thread:(0,r.childText)(null,"thread"),type:(0,r.attribute)("type")}),(0,r.extendPresence)({alternateLanguageStatuses:(0,r.childAlternateLanguageText)(null,"status"),priority:(0,r.childInteger)(null,"priority",0),show:(0,r.childText)(null,"show"),status:(0,r.childText)(null,"status"),type:(0,r.attribute)("type")}),{element:"query",fields:{version:(0,r.attribute)("ver",void 0,{emitEmpty:!0})},namespace:i.NS_ROSTER,path:"iq.roster"},{aliases:[{path:"iq.roster.items",multiple:!0}],element:"item",fields:{groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),pending:(0,r.attribute)("ask"),preApproved:(0,r.booleanAttribute)("approved"),subscription:(0,r.attribute)("subscription")},namespace:i.NS_ROSTER}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"open",fields:{from:(0,r.attribute)("from"),id:(0,r.attribute)("id"),lang:(0,r.languageAttribute)(),to:(0,r.attribute)("to"),version:(0,r.attribute)("version")},namespace:i.NS_FRAMING,path:"stream",type:"open"},{element:"close",fields:{seeOtherURI:(0,r.attribute)("see-other-uri")},namespace:i.NS_FRAMING,path:"stream",type:"close"}];t.default=a},function(e,t,n){"use strict";var r=n(4);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}function o(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 s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var u=n(18),c=n(5),l=n(2),f=[{aliases:[{path:"message.forms",multiple:!0}],element:"x",fields:{instructions:s(s({},(0,c.multipleChildText)(null,"instructions")),{},{exportOrder:2}),reported:s(s({},(0,c.splicePath)(null,"reported","dataformField",!0)),{},{exportOrder:3}),title:s(s({},(0,c.childText)(null,"title")),{},{exportOrder:1}),type:(0,c.attribute)("type")},namespace:l.NS_DATAFORM,optionalNamespaces:{xdv:l.NS_DATAFORM_VALIDATION},path:"dataform"},{aliases:[{path:"dataform.fields",multiple:!0},{path:"dataform.items.fields",multiple:!0}],element:"field",fields:{description:(0,c.childText)(null,"desc"),label:(0,c.attribute)("label"),name:(0,c.attribute)("var"),rawValues:s(s({},(0,c.multipleChildText)(null,"value")),{},{exporter:function(){return null}}),required:(0,c.childBoolean)(null,"required"),type:(0,c.attribute)("type"),value:{importer:function(e,t){var n=e.getAttribute("type"),r=(0,c.multipleChildText)(l.NS_DATAFORM,"value").importer(e,t),i=r[0];switch(n){case u.DataFormFieldType.TextMultiple:case u.DataFormFieldType.ListMultiple:case u.DataFormFieldType.JIDMultiple:return r;case u.DataFormFieldType.Hidden:case u.DataFormFieldType.Fixed:return 1===r.length?i:r;case u.DataFormFieldType.Boolean:if(i)return"1"===i||"true"===i;break;default:return i}},exporter:function(e,t,n){var r=(0,c.multipleChildText)(null,"value"),a=[],o=n.data&&n.data.rawValues?n.data.rawValues[0]:void 0;if("boolean"==typeof t)a="true"===o||"false"===o?[o]:[t?"1":"0"];else if(Array.isArray(t)){var s,u=i(t);try{for(u.s();!(s=u.n()).done;){var f=s.value;a.push(f.toString())}}catch(e){u.e(e)}finally{u.f()}}else a=[t.toString()];r.exporter(e,a,Object.assign({},n,{namespace:l.NS_DATAFORM}))}}},namespace:l.NS_DATAFORM,path:"dataformField"},{aliases:[{path:"dataform.fields.options",multiple:!0}],element:"option",fields:{label:(0,c.attribute)("label"),value:(0,c.childText)(null,"value")},namespace:l.NS_DATAFORM},{aliases:[{path:"dataform.items",multiple:!0}],element:"item",namespace:l.NS_DATAFORM},{element:"validate",fields:{listMax:(0,c.childIntegerAttribute)(null,"list-range","max"),listMin:(0,c.childIntegerAttribute)(null,"list-range","min"),method:(0,c.childEnum)(null,["basic","open","range","regex"],"basic"),rangeMax:(0,c.childAttribute)(null,"range","max"),rangeMin:(0,c.childAttribute)(null,"range","min"),regex:(0,c.childText)(null,"regex"),type:(0,c.attribute)("datatype","xs:string")},namespace:l.NS_DATAFORM_VALIDATION,path:"dataform.fields.validation"}];t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["presence.legacyLastActivity","iq.lastActivity"],element:"query",fields:{seconds:(0,r.integerAttribute)("seconds"),status:(0,r.text)()},namespace:i.NS_LAST_ACTIVITY}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"query",fields:{activeList:(0,r.childAttribute)(null,"active","name"),defaultList:(0,r.childAttribute)(null,"default","name")},namespace:i.NS_PRIVACY,path:"iq.privacy"},{aliases:[{path:"iq.privacy.lists",multiple:!0}],element:"list",fields:{name:(0,r.attribute)("name")},namespace:i.NS_PRIVACY},{aliases:[{path:"iq.privacy.lists.items",multiple:!0}],element:"item",fields:{action:(0,r.attribute)("action"),incomingPresence:(0,r.childBoolean)(null,"presence-in"),iq:(0,r.childBoolean)(null,"iq"),messages:(0,r.childBoolean)(null,"message"),order:(0,r.integerAttribute)("order"),outgoingPresence:(0,r.childBoolean)(null,"presence-out"),type:(0,r.attribute)("type"),value:(0,r.attribute)("value")},namespace:i.NS_PRIVACY}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["iq.disco","message.disco","features.disco"],childrenExportOrder:{identities:1,features:2,extensions:3},element:"query",fields:{features:(0,r.multipleChildAttribute)(null,"feature","var"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_INFO,path:"disco",type:"info",typeField:"type"},{aliases:[{path:"disco.identities",selector:"info",multiple:!0}],element:"identity",fields:{category:(0,r.attribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},{aliases:[{path:"disco.items",multiple:!0,selector:"items"}],element:"item",fields:{jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name"),node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS},{aliases:[{path:"disco.items",multiple:!0,selector:"info"}],element:"item",fields:{category:(0,r.JIDAttribute)("category"),lang:(0,r.languageAttribute)(),name:(0,r.attribute)("name"),type:(0,r.attribute)("type")},namespace:i.NS_DISCO_INFO},(0,r.addAlias)(i.NS_DATAFORM,"x",[{path:"disco.extensions",multiple:!0,selector:"info"}]),(0,r.addAlias)(i.NS_RSM,"set",[{path:"disco.paging",selector:"items"}]),{aliases:["iq.disco","message.disco","features.disco"],element:"query",fields:{node:(0,r.attribute)("node")},namespace:i.NS_DISCO_ITEMS,path:"disco",type:"items",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),(0,r.extendPresence)({addresses:(0,r.splicePath)(i.NS_ADDRESS,"addresses","extendedAddress",!0)}),{element:"address",fields:{alternateLanguageDescriptions:(0,r.childAlternateLanguageText)(null,"desc"),delivered:(0,r.booleanAttribute)("delivered"),description:(0,r.attribute)("desc"),jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_ADDRESS,path:"extendedAddress"}];t.default=a},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),s=n(2),u=[(0,o.addAlias)(s.NS_DATAFORM,"x",[{path:"iq.muc.form",selector:"configure"}]),{defaultType:"info",element:"x",fields:{password:(0,o.childText)(null,"password")},namespace:s.NS_MUC,path:"presence.muc",type:"join",typeField:"type"},{aliases:[{path:"presence.muc.history",selector:"join"}],element:"history",fields:{maxCharacters:(0,o.integerAttribute)("maxchars"),maxStanzas:(0,o.integerAttribute)("maxstanzas"),seconds:(0,o.integerAttribute)("seconds"),since:(0,o.dateAttribute)("since")},namespace:s.NS_MUC},{aliases:["presence.muc","message.muc"],defaultType:"info",element:"x",fields:{action:(0,o.childEnum)(null,["invite","decline","destroy"]),actor:(0,o.splicePath)(null,"item","mucactor"),affiliation:(0,o.childAttribute)(null,"item","affiliation"),jid:(0,o.childJIDAttribute)(null,"item","jid"),nick:(0,o.childAttribute)(null,"item","nick"),password:(0,o.childText)(null,"password"),reason:(0,o.deepChildText)([{namespace:null,element:"item"},{namespace:null,element:"reason"}]),role:(0,o.childAttribute)(null,"item","role"),statusCodes:(0,o.multipleChildAttribute)(null,"status","code")},namespace:s.NS_MUC_USER,type:"info",typeField:"type",typeOrder:1},{element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_USER,path:"mucactor"},{element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_USER,path:"presence.muc.destroy"},{aliases:[{path:"message.muc.invite",multiple:!0}],element:"invite",fields:{continue:(0,o.childBoolean)(null,"continue"),from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),thread:(0,o.childAttribute)(null,"continue","thread"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER},{element:"decline",fields:{from:(0,o.JIDAttribute)("from"),reason:(0,o.childText)(null,"reason"),to:(0,o.JIDAttribute)("to")},namespace:s.NS_MUC_USER,path:"message.muc",type:"decline"},{element:"query",namespace:s.NS_MUC_ADMIN,path:"iq.muc",type:"user-list",typeField:"type"},{aliases:[{path:"iq.muc.users",multiple:!0,selector:"user-list"}],element:"item",fields:{affiliation:(0,o.attribute)("affiliation"),jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick"),reason:(0,o.childText)(null,"reason"),role:(0,o.attribute)("role")},namespace:s.NS_MUC_ADMIN},{aliases:["iq.muc.users.actor"],element:"actor",fields:{jid:(0,o.JIDAttribute)("jid"),nick:(0,o.attribute)("nick")},namespace:s.NS_MUC_ADMIN},{element:"query",namespace:s.NS_MUC_OWNER,path:"iq.muc",type:"configure",typeField:"type"},{aliases:[{path:"iq.muc.destroy",selector:"configure"}],element:"destroy",fields:{jid:(0,o.JIDAttribute)("jid"),password:(0,o.childText)(null,"password"),reason:(0,o.childText)(null,"reason")},namespace:s.NS_MUC_OWNER},{element:"x",fields:{action:(0,o.staticValue)("invite"),continue:(0,o.booleanAttribute)("continue"),jid:(0,o.JIDAttribute)("jid"),legacyReason:(0,o.text)(),password:(0,o.attribute)("password"),reason:(0,o.attribute)("reason"),thread:(0,o.attribute)("thread")},namespace:s.NS_MUC_DIRECT_INVITE,path:"message.muc",type:"direct-invite",typeOrder:2},{element:"unique",fields:{name:(0,o.text)()},namespace:s.NS_MUC_UNIQUE,path:"iq.muc",type:"unique"},(0,o.extendMessage)({legacyMUC:{exporter:function(e,t,n){var r=n.registry?n.registry.export("message.muc",a(a({},t),{},{type:"direct-invite"})):void 0;r&&e.appendChild(r)},exportOrder:100001,importer:function(e,t){if((0,o.findAll)(e,s.NS_MUC_USER,"x")[0]){var n=(0,o.findAll)(e,s.NS_MUC_DIRECT_INVITE,"x")[0];if(n)return t.registry?t.registry.import(n,a(a({},t),{},{path:"message"})):void 0}},importOrder:-1}})];t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["iq.ibb","message.ibb"],element:"open",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){(0,r.attribute)("stanza").exporter(e,t?"iq":"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"open",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"close",fields:{sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"close",typeField:"action"},{aliases:["iq.ibb","message.ibb"],element:"data",fields:{data:(0,r.textBuffer)("base64"),seq:(0,r.integerAttribute)("seq"),sid:(0,r.attribute)("sid")},namespace:i.NS_IBB,type:"data",typeField:"action"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:[{path:"bookmarkStorage",impliedType:!0},{path:"iq.privateStorage.bookmarks",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"storage",namespace:a.NS_BOOKMARKS,type:a.NS_BOOKMARKS,typeField:"itemType"},{aliases:[{path:"bookmarkStorage.rooms",multiple:!0}],element:"conference",fields:{autoJoin:(0,i.booleanAttribute)("autojoin"),jid:(0,i.JIDAttribute)("jid"),name:(0,i.attribute)("name"),nick:(0,i.childText)(null,"nick"),password:(0,i.childText)(null,"password")},namespace:a.NS_BOOKMARKS}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={element:"query",namespace:n(2).NS_PRIVATE,path:"iq.privateStorage"};t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.command.form"]),(0,r.extendStanzaError)({commandError:(0,r.childEnum)(i.NS_ADHOC_COMMANDS,["bad-action","bad-locale","bad-payload","bad-sessionid","malformed-action","session-expired"])}),{element:"command",fields:{action:(0,r.attribute)("action"),node:(0,r.attribute)("node"),sid:(0,r.attribute)("sessionid"),status:(0,r.attribute)("status")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command"},{element:"actions",fields:{complete:(0,r.childBoolean)(null,"complete"),execute:(0,r.attribute)("execute"),next:(0,r.childBoolean)(null,"next"),prev:(0,r.childBoolean)(null,"prev")},namespace:i.NS_ADHOC_COMMANDS,path:"iq.command.availableActions"},{aliases:[{path:"iq.command.notes",multiple:!0}],element:"note",fields:{type:(0,r.attribute)("type"),value:(0,r.text)()},namespace:i.NS_ADHOC_COMMANDS}];t.default=a},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5),s=n(2),u="vcardTemp.records";function c(e,t){return{aliases:[{multiple:!0,path:u}],element:e,fields:{value:(0,o.text)()},namespace:s.NS_VCARD_TEMP,type:t,typeField:"type"}}var l=[{aliases:[{path:"iq.vcard"}],defaultType:s.NS_VCARD_TEMP,element:"vCard",fields:{fullName:(0,o.childText)(null,"FN")},namespace:s.NS_VCARD_TEMP,path:"vcardTemp",type:s.NS_VCARD_TEMP,typeField:"format"},{element:"N",fields:{additional:a(a({},(0,o.childText)(null,"MIDDLE")),{},{order:3}),family:a(a({},(0,o.childText)(null,"FAMILY")),{},{order:1}),given:a(a({},(0,o.childText)(null,"GIVEN")),{},{order:2}),prefix:a(a({},(0,o.childText)(null,"PREFIX")),{},{order:4}),suffix:a(a({},(0,o.childText)(null,"SUFFIX")),{},{order:5})},namespace:s.NS_VCARD_TEMP,path:"vcardTemp.name"},c("NICKNAME","nickname"),c("BDAY","birthday"),c("JABBERID","jid"),c("TZ","timezone"),c("TITLE","title"),c("ROLE","role"),c("URL","url"),c("NOTE","note"),c("SORT-STRING","sort"),c("UID","uid"),c("REV","revision"),c("PRODID","productId"),c("DESC","description"),{aliases:[{multiple:!0,path:u}],element:"EMAIL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["internet","INTERNET"]]),value:(0,o.childText)(null,"USERID")},namespace:s.NS_VCARD_TEMP,type:"email"},{aliases:[{path:u,multiple:!0}],element:"ORG",fields:{units:a(a({},(0,o.multipleChildText)(null,"ORGUNIT")),{},{order:2}),value:a(a({},(0,o.childText)(null,"ORGNAME")),{},{order:1})},namespace:s.NS_VCARD_TEMP,type:"organization",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"ADR",fields:{city:(0,o.childText)(null,"LOCALITY"),code:(0,o.childText)(null,"PCODE"),country:(0,o.childText)(null,"CTRY"),pobox:(0,o.childText)(null,"POBOX"),preferred:(0,o.childBoolean)(null,"PREF"),region:(0,o.childText)(null,"REGION"),street:(0,o.childText)(null,"STREET"),street2:(0,o.childText)(null,"EXTADD"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["domestic","DOM"],["international","INTL"],["postal","POSTAL"],["parcel","PARCEL"]])},namespace:s.NS_VCARD_TEMP,type:"address",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LABEL",fields:{lines:(0,o.multipleChildText)(null,"LINE"),preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"]])},namespace:s.NS_VCARD_TEMP,type:"addressLabel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"TEL",fields:{preferred:(0,o.childBoolean)(null,"PREF"),types:(0,o.multipleChildEnum)(null,[["home","HOME"],["work","WORK"],["cell","CELL"],["fax","FAX"],["voice","VOICE"],["msg","MSG"]]),value:(0,o.childText)(null,"NUMBER","",!0)},namespace:s.NS_VCARD_TEMP,type:"tel",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"PHOTO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"photo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"LOGO",fields:{data:(0,o.childText)(null,"BINVAL"),mediaType:(0,o.childText)(null,"TYPE"),url:(0,o.childText)(null,"EXTVAL")},namespace:s.NS_VCARD_TEMP,type:"logo",typeField:"type"},{aliases:[{multiple:!0,path:u}],element:"CATEGORIES",fields:{value:(0,o.multipleChildText)(null,"KEYWORD")},namespace:s.NS_VCARD_TEMP,type:"categories",typeField:"type"}];t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.search.form"]),(0,r.addAlias)(i.NS_RSM,"set",["iq.search.paging"]),{element:"query",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH,path:"iq.search"},{aliases:[{path:"iq.search.items",multiple:!0}],element:"item",fields:{email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),givenName:(0,r.childText)(null,"first"),jid:(0,r.JIDAttribute)("jid"),nick:(0,r.childText)(null,"nick")},namespace:i.NS_SEARCH}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["iq.pubsub.paging"],element:"set",fields:{after:(0,r.childText)(null,"after"),before:(0,r.childText)(null,"before"),count:(0,r.childInteger)(null,"count"),first:(0,r.childText)(null,"first"),firstIndex:(0,r.childIntegerAttribute)(null,"first","index"),index:(0,r.childInteger)(null,"index"),last:(0,r.childText)(null,"last"),max:(0,r.childInteger)(null,"max")},namespace:i.NS_RSM,path:"paging"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(18),a=n(5),o=n(2),s={configurable:(0,a.childBoolean)(null,"subscribe-options"),configurationRequired:(0,a.deepChildBoolean)([{namespace:null,element:"subscribe-options"},{namespace:null,element:"required"}]),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),state:(0,a.attribute)("subscription"),subid:(0,a.attribute)("subid")},u={node:(0,a.attribute)("node")},c=[{aliases:["pubsub","iq.pubsub","message.pubsub"],childrenExportOrder:{configure:0,create:100,publish:100,subscribe:100,subscriptionOptions:0},defaultType:"user",element:"pubsub",fields:{publishOptions:(0,a.splicePath)(null,"publish-options","dataform")},namespace:o.NS_PUBSUB,type:"user",typeField:"context"},{aliases:["pubsub","iq.pubsub","message.pubsub"],defaultType:"user",element:"pubsub",fields:{purge:(0,a.childAttribute)(null,"purge","node")},namespace:o.NS_PUBSUB_OWNER,type:"owner",typeField:"context"},(0,a.addAlias)(o.NS_DATAFORM,"x",["iq.pubsub.configure.form","iq.pubsub.defaultConfiguration.form","iq.pubsub.defaultSubscriptionOptions.form","iq.pubsub.subscriptionOptions.form","message.pubsub.configuration.form"]),(0,a.addAlias)(o.NS_RSM,"set",["iq.pubsub.fetch.paging"]),(0,a.extendStanzaError)({pubsubError:(0,a.childEnum)(o.NS_PUBSUB_ERRORS,Object.values(i.PubsubErrorCondition)),pubsubUnsupportedFeature:(0,a.childAttribute)(o.NS_PUBSUB_ERRORS,"unsupported","feature")}),{element:"subscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscribe"},{element:"unsubscribe",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.unsubscribe"},{element:"options",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid")},namespace:o.NS_PUBSUB,path:"iq.pubsub.subscriptionOptions"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"user",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.subscriptions",selector:"owner",impliedType:!0}],element:"subscriptions",fields:{jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.subscription",selector:"owner"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB},{aliases:[{path:"iq.pubsub.subscription",selector:"user"},{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"user"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.subscriptions.items",selector:"owner"}],element:"subscription",fields:s,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.affiliations",selector:"user",impliedType:!0},{path:"message.pubsub.affiliations",selector:"user",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB,type:"user"},{aliases:[{path:"iq.pubsub.affiliations",selector:"owner",impliedType:!0}],element:"affiliations",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"user"},{impliedType:!0,multiple:!0,path:"message.pubsub.affiliations.items",selector:"user"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,type:"user"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.pubsub.affiliations.items",selector:"owner"}],element:"affiliation",fields:{affiliation:(0,a.attribute)("affiliation"),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB_OWNER,type:"owner"},{element:"create",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.create"},{aliases:[{path:"iq.pubsub.destroy",selector:"owner"}],element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_OWNER},{aliases:[{path:"iq.pubsub.configure",selector:"owner",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB_OWNER,type:"owner"},{aliases:[{path:"iq.pubsub.configure",selector:"user",impliedType:!0}],element:"configure",fields:u,namespace:o.NS_PUBSUB,type:"user"},{element:"default",fields:{node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.defaultSubscriptionOptions"},{element:"default",fields:{},namespace:o.NS_PUBSUB_OWNER,path:"iq.pubsub.defaultConfiguration"},{element:"publish",fields:u,namespace:o.NS_PUBSUB,path:"iq.pubsub.publish"},{element:"retract",fields:{id:(0,a.childAttribute)(null,"item","id"),node:(0,a.attribute)("node"),notify:(0,a.booleanAttribute)("notify")},namespace:o.NS_PUBSUB,path:"iq.pubsub.retract"},{element:"items",fields:{max:(0,a.integerAttribute)("max_items"),node:(0,a.attribute)("node")},namespace:o.NS_PUBSUB,path:"iq.pubsub.fetch"},{aliases:["pubsubitem","iq.pubsub.publish.item",{multiple:!0,path:"iq.pubsub.fetch.items"}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB},{element:"event",fields:{eventType:(0,a.childEnum)(null,["purge","delete","subscription","configuration","items"])},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub",type:"event",typeField:"context"},{aliases:[{path:"message.pubsub.items.published",multiple:!0}],element:"item",fields:{id:(0,a.attribute)("id"),publisher:(0,a.JIDAttribute)("publisher")},namespace:o.NS_PUBSUB_EVENT,path:"pubsubeventitem"},{element:"purge",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.purge"},{element:"delete",fields:{node:(0,a.attribute)("node"),redirect:(0,a.childAttribute)(null,"redirect","uri")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.delete"},{aliases:[{path:"message.pubsub.subscription",selector:"event",impliedType:!0}],element:"subscription",fields:{expires:(r="expiry",{importer:function(e){var t=e.getAttribute(r);return"presence"===t?t:t?new Date(t):void 0},exporter:function(e,t){var n;n="string"==typeof t?t:t.toISOString(),e.setAttribute(r,n)}}),jid:(0,a.JIDAttribute)("jid"),node:(0,a.attribute)("node"),subid:(0,a.attribute)("subid"),type:(0,a.attribute)("subscription")},namespace:o.NS_PUBSUB_EVENT,type:"event"},{element:"configuration",fields:u,namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.configuration"},{element:"items",fields:{node:(0,a.attribute)("node"),retracted:(0,a.multipleChildAttribute)(null,"retract","id")},namespace:o.NS_PUBSUB_EVENT,path:"message.pubsub.items"}];t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"query",fields:{activate:(0,r.childText)(null,"activate"),address:(0,r.attribute)("dstaddr"),candidateUsed:(0,r.childJIDAttribute)(null,"streamhost-used","jid"),mode:(0,r.attribute)("mode","tcp"),sid:(0,r.attribute)("sid"),udpSuccess:(0,r.childAttribute)(null,"udpsuccess","dstaddr")},namespace:i.NS_SOCKS5,path:"iq.socks5"},{aliases:[{multiple:!0,path:"iq.socks5.candidates"}],element:"streamhost",fields:{host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),uri:(0,r.attribute)("uri")},namespace:i.NS_SOCKS5}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:[{multiple:!0,path:"message.links"}],element:"x",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB},{element:"query",fields:{description:(0,r.childText)(null,"desc"),url:(0,r.childText)(null,"url")},namespace:i.NS_OOB_TRANSFER,path:"iq.transferLink"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"html",fields:{alternateLanguageBodies:(0,r.childAlternateLanguageRawElement)(i.NS_XHTML,"body","xhtmlim"),body:(0,r.childLanguageRawElement)(i.NS_XHTML,"body","xhtmlim")},namespace:i.NS_XHTML_IM,path:"message.html"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({inbandRegistration:(0,r.childBoolean)(i.NS_INBAND_REGISTRATION,"register")}),(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.account.form"]),(0,r.addAlias)(i.NS_OOB,"x",["iq.account.registrationLink"]),{element:"query",fields:{address:(0,r.childText)(null,"address"),date:(0,r.childDate)(null,"date"),email:(0,r.childText)(null,"email"),familyName:(0,r.childText)(null,"last"),fullName:(0,r.childText)(null,"name"),givenName:(0,r.childText)(null,"first"),instructions:(0,r.childText)(null,"instructions"),key:(0,r.childText)(null,"key"),locality:(0,r.childText)(null,"city"),misc:(0,r.childText)(null,"misc"),nick:(0,r.childText)(null,"nick"),password:(0,r.childText)(null,"password"),phone:(0,r.childText)(null,"phone"),postalCode:(0,r.childText)(null,"zip"),region:(0,r.childText)(null,"state"),registered:(0,r.childBoolean)(null,"registered"),remove:(0,r.childBoolean)(null,"remove"),text:(0,r.childText)(null,"text"),uri:(0,r.childText)(null,"uri"),username:(0,r.childText)(null,"username")},namespace:i.NS_REGISTER,path:"iq.account"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o={aliases:[{path:"message.geoloc",impliedType:!0},{path:"dataform.fields.geoloc",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"geoloc",fields:{accuracy:(0,i.childFloat)(null,"accuracy"),altitude:(0,i.childFloat)(null,"alt"),altitudeAccuracy:(0,i.childFloat)(null,"altaccuracy"),area:(0,i.childText)(null,"area"),building:(0,i.childText)(null,"building"),country:(0,i.childText)(null,"country"),countryCode:(0,i.childText)(null,"countrycode"),datum:(0,i.childText)(null,"datum"),description:(0,i.childText)(null,"description"),error:(0,i.childFloat)(null,"error"),floor:(0,i.childText)(null,"floor"),heading:(0,i.childFloat)(null,"bearing"),lang:(0,i.languageAttribute)(),latitude:(0,i.childFloat)(null,"lat"),locality:(0,i.childText)(null,"locality"),longitude:(0,i.childFloat)(null,"lon"),postalCode:(0,i.childText)(null,"postalcode"),region:(0,i.childText)(null,"region"),room:(0,i.childText)(null,"room"),speed:(0,i.childFloat)(null,"speed"),street:(0,i.childText)(null,"street"),text:(0,i.childText)(null,"text"),timestamp:(0,i.childDate)(null,"timestamp"),tzo:(0,i.childTimezoneOffset)(null,"tzo"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_GEOLOC,type:a.NS_GEOLOC};t.default=o},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=[{aliases:(0,i.pubsubItemContentAliases)(),element:"data",fields:{data:(0,i.textBuffer)("base64")},namespace:a.NS_AVATAR_DATA,path:"avatar",type:a.NS_AVATAR_DATA,typeField:"itemType"},{aliases:[{path:"avatar",impliedType:!0}].concat(r((0,i.pubsubItemContentAliases)())),element:"metadata",namespace:a.NS_AVATAR_METADATA,type:a.NS_AVATAR_METADATA,typeField:"itemType",childrenExportOrder:{versions:1,pointers:2}},{aliases:[{multiple:!0,path:"avatar.versions",selector:a.NS_AVATAR_METADATA}],element:"info",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),uri:(0,i.attribute)("url"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA},{aliases:[{multiple:!0,path:"avatar.pointers",selector:a.NS_AVATAR_METADATA}],element:"pointer",fields:{bytes:(0,i.integerAttribute)("bytes"),height:(0,i.integerAttribute)("height"),id:(0,i.attribute)("id"),mediaType:(0,i.attribute)("type"),width:(0,i.integerAttribute)("width")},namespace:a.NS_AVATAR_METADATA}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(5),a=n(2);t.default=(0,i.extendMessage)({chatState:(0,i.childEnum)(a.NS_CHAT_STATES,Object.values(r.ChatState))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"query",fields:{name:(0,r.childText)(null,"name"),os:(0,r.childText)(null,"os"),version:(0,r.childText)(null,"version")},namespace:i.NS_VERSION,path:"iq.softwareVersion"};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={aliases:[{path:"message.mood",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"mood",fields:{alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text"),value:(0,a.childEnum)(null,i.USER_MOODS)},namespace:o.NS_MOOD,type:o.NS_MOOD};t.default=s},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(18),a=n(5),o=n(2),s={aliases:[{path:"activity",impliedType:!0}].concat(r((0,a.pubsubItemContentAliases)())),element:"activity",fields:{activity:(0,a.childDoubleEnum)(null,i.USER_ACTIVITY_GENERAL,i.USER_ACTIVITY_SPECIFIC),alternateLanguageText:(0,a.childAlternateLanguageText)(null,"text"),text:(0,a.childText)(null,"text")},namespace:o.NS_ACTIVITY,type:o.NS_ACTIVITY};t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"handshake",fields:{value:(0,r.textBuffer)("hex")},namespace:i.NS_COMPONENT,path:"handshake"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{path:"presence.legacyCapabilities",multiple:!0},{path:"features.legacyCapabilities",multiple:!0}],element:"c",fields:{algorithm:(0,r.attribute)("hash"),legacy:(0,r.staticValue)(!0),node:(0,r.attribute)("node"),value:(0,r.attribute)("ver")},namespace:i.NS_DISCO_LEGACY_CAPS};t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o={aliases:[{impliedType:!0,path:"tune"}].concat(r((0,i.pubsubItemContentAliases)())),element:"tune",fields:{artist:(0,i.childText)(null,"artist"),length:(0,i.childInteger)(null,"length"),rating:(0,i.childInteger)(null,"rating"),source:(0,i.childText)(null,"source"),title:(0,i.childText)(null,"title"),track:(0,i.childText)(null,"track"),uri:(0,i.childText)(null,"uri")},namespace:a.NS_TUNE,type:a.NS_TUNE};t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=["dataformLayout",{multiple:!0,path:"dataformLayout.contents"},{multiple:!0,path:"dataform.layout.contents"}],o=[{aliases:[{multiple:!0,path:"dataform.layout"}],element:"page",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT},{aliases:a,element:"section",fields:{label:(0,r.attribute)("label")},namespace:i.NS_DATAFORM_LAYOUT,type:"section",typeField:"type"},{aliases:a,element:"text",fields:{value:(0,r.text)()},namespace:i.NS_DATAFORM_LAYOUT,type:"text",typeField:"type"},{aliases:a,element:"fieldref",fields:{field:(0,r.attribute)("var")},namespace:i.NS_DATAFORM_LAYOUT,type:"fieldref",typeField:"type"},{aliases:a,element:"reportedref",namespace:i.NS_DATAFORM_LAYOUT,type:"reportedref",typeField:"type"}];t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"body",fields:{acceptMediaTypes:(0,r.attribute)("accept"),ack:(0,r.integerAttribute)("ack"),authId:(0,r.attribute)("authid"),characterSets:(0,r.attribute)("charsets"),condition:(0,r.attribute)("condition"),from:(0,r.JIDAttribute)("from"),key:(0,r.attribute)("key"),lang:(0,r.languageAttribute)(),maxClientRequests:(0,r.integerAttribute)("requests"),maxHoldOpen:(0,r.integerAttribute)("hold"),maxInactivityTime:(0,r.integerAttribute)("inactivity"),maxSessionPause:(0,r.integerAttribute)("maxpause"),maxWaitTime:(0,r.integerAttribute)("wait"),mediaType:(0,r.attribute)("content"),minPollingInterval:(0,r.integerAttribute)("polling"),newKey:(0,r.attribute)("newkey"),pauseSession:(0,r.integerAttribute)("pause"),report:(0,r.integerAttribute)("report"),rid:(0,r.integerAttribute)("rid"),route:(0,r.attribute)("string"),seeOtherURI:(0,r.childText)(null,"uri"),sid:(0,r.attribute)("sid"),stream:(0,r.attribute)("stream"),time:(0,r.integerAttribute)("time"),to:(0,r.JIDAttribute)("to"),type:(0,r.attribute)("type"),version:(0,r.attribute)("ver"),xmppRestart:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restart",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppRestartLogic:(0,r.namespacedBooleanAttribute)("xmpp",i.NS_BOSH_XMPP,"restartlogic",void 0,{writeValue:function(e){return e?"true":"false"}}),xmppVersion:(0,r.namespacedAttribute)("xmpp",i.NS_BOSH_XMPP,"version")},namespace:i.NS_BOSH,path:"bosh"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),(0,r.extendPresence)({headers:(0,r.splicePath)(i.NS_SHIM,"headers","header",!0)}),{element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_SHIM,path:"header"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"compression",fields:{methods:(0,r.multipleChildText)(null,"method")},namespace:i.NS_COMPRESSION_FEATURE,path:"features.compression"},{element:"compress",fields:{method:(0,r.childText)(null,"method")},namespace:i.NS_COMPRESSION,path:"compression",type:"start",typeField:"type"},{aliases:["error.compressionError"],element:"failure",fields:{condition:(0,r.childEnum)(null,["unsupported-method","setup-failed","processing-failed"])},namespace:i.NS_COMPRESSION,path:"compression",type:"failure",typeField:"type"},{element:"compressed",namespace:i.NS_COMPRESSION,path:"compression",type:"success",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),(0,r.extendIQ)({rosterExchange:(0,r.splicePath)(i.NS_ROSTER_EXCHANGE,"x","rosterExchange",!0)}),{element:"item",fields:{action:(0,r.attribute)("action"),groups:(0,r.multipleChildText)(null,"group"),jid:(0,r.JIDAttribute)("jid"),name:(0,r.attribute)("name")},namespace:i.NS_ROSTER_EXCHANGE,path:"rosterExchange"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendPresence)({vcardAvatar:{importer:function(e){var t=(0,r.findAll)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(t.length){var n=(0,r.findAll)(t[0],i.NS_VCARD_TEMP_UPDATE,"photo");return!n.length||n[0].getText()}},exporter:function(e,t){var n=(0,r.findOrCreate)(e,i.NS_VCARD_TEMP_UPDATE,"x");if(""===t)(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo");else{if(!0===t)return;t&&(0,r.findOrCreate)(n,i.NS_VCARD_TEMP_UPDATE,"photo").children.push(t)}}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")}),(0,r.extendIQ)({captcha:(0,r.splicePath)(i.NS_CAPTCHA,"captcha","dataform")})];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),i=n(5),a=n(2),o=[(0,i.extendStanzaError)({jingleError:(0,i.childEnum)(a.NS_JINGLE_ERRORS_1,Object.values(r.JingleErrorCondition))}),{element:"jingle",fields:{action:(0,i.attribute)("action"),initiator:(0,i.JIDAttribute)("initiator"),responder:(0,i.JIDAttribute)("responder"),sid:(0,i.attribute)("sid")},namespace:a.NS_JINGLE_1,path:"iq.jingle"},{aliases:[{multiple:!0,path:"iq.jingle.contents"}],element:"content",fields:{creator:(0,i.attribute)("creator"),disposition:(0,i.attribute)("disposition","session"),name:(0,i.attribute)("name"),senders:(0,i.attribute)("senders","both")},namespace:a.NS_JINGLE_1},{element:"reason",fields:{alternativeSession:(0,i.childText)(null,"alternative-session"),condition:(0,i.childEnum)(null,Object.values(r.JingleReasonCondition)),text:(0,i.childText)(null,"text")},namespace:a.NS_JINGLE_1,path:"iq.jingle.reason"}];t.default=o},function(e,t,n){"use strict";var r=n(4);function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}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=n(18),c=n(5),l=n(2);function f(){return{importer:function(e,t){var n,r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb"),i=(0,c.attribute)("type").importer,a=(0,c.attribute)("subtype").importer,s=(0,c.attribute)("value").importer,u=[],f=o(r);try{for(f.s();!(n=f.n()).done;){var p=n.value,d=i(p,t),h=a(p,t);u.push(h?{type:d,parameter:h}:{type:d})}}catch(e){f.e(e)}finally{f.f()}var v,m=o(r=(0,c.findAll)(e,l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int"));try{for(m.s();!(v=m.n()).done;){var g=s(v.value,t);u.push(g?{type:"trr-int",parameter:g}:{type:"trr-int"})}}catch(e){m.e(e)}finally{m.f()}return u},exporter:function(e,t,n){var r,i=(0,c.attribute)("type").exporter,a=(0,c.attribute)("subtype").exporter,s=(0,c.attribute)("value").exporter,u=o(t);try{for(u.s();!(r=u.n()).done;){var f=r.value,p=void 0;"trr-int"===f.type?(p=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb-trr-int",n.namespace,e),f.parameter&&s(p,f.parameter,n)):(i(p=(0,c.createElement)(l.NS_JINGLE_RTP_RTCP_FB_0,"rtcp-fb",n.namespace,e),f.type,n),f.parameter&&a(p,f.parameter,n)),e.appendChild(p)}}catch(e){u.e(e)}finally{u.f()}}}}var p="iq.jingle.info",d=[{aliases:["iq.jingle.contents.application"],childrenExportOrder:{codecs:4,encryption:5,headerExtensions:6,sourceGroups:8,sources:7,streams:9},element:"description",fields:{media:(0,c.attribute)("media"),rtcpFeedback:a(a({},f()),{},{exportOrder:3}),rtcpMux:a(a({},(0,c.childBoolean)(null,"rtcp-mux")),{},{exportOrder:1}),rtcpReducedSize:a(a({},(0,c.childBoolean)(null,"rtcp-reduced-size")),{},{exportOrder:2}),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_1,optionalNamespaces:{rtcpf:l.NS_JINGLE_RTP_RTCP_FB_0,rtph:l.NS_JINGLE_RTP_HDREXT_0},type:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.headerExtensions",selector:l.NS_JINGLE_RTP_1}],element:"rtp-hdrext",fields:{id:(0,c.integerAttribute)("id"),senders:(0,c.attribute)("senders"),uri:(0,c.attribute)("uri")},namespace:l.NS_JINGLE_RTP_HDREXT_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.codecs",selector:l.NS_JINGLE_RTP_1},"rtpcodec"],element:"payload-type",fields:{channels:(0,c.integerAttribute)("channels"),clockRate:(0,c.integerAttribute)("clockrate"),id:(0,c.attribute)("id"),maxptime:(0,c.integerAttribute)("maxptime"),name:(0,c.attribute)("name"),parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_1,"parameter","name","value"),ptime:(0,c.integerAttribute)("ptime"),rtcpFeedback:f()},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sources",selector:l.NS_JINGLE_RTP_1}],element:"source",fields:{parameters:(0,c.parameterMap)(l.NS_JINGLE_RTP_SSMA_0,"parameter","name","value"),ssrc:(0,c.attribute)("ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.sourceGroups",selector:l.NS_JINGLE_RTP_1}],element:"ssrc-group",fields:{semantics:(0,c.attribute)("semantics"),sources:(0,c.multipleChildAttribute)(null,"source","ssrc")},namespace:l.NS_JINGLE_RTP_SSMA_0},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.streams",selector:l.NS_JINGLE_RTP_1}],element:"stream",fields:{id:(0,c.attribute)("id"),track:(0,c.attribute)("track")},namespace:l.NS_JINGLE_RTP_MSID_0},{aliases:[{path:"iq.jingle.contents.application.encryption",selector:l.NS_JINGLE_RTP_1}],element:"encryption",fields:{required:(0,c.booleanAttribute)("required")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{multiple:!0,path:"iq.jingle.contents.application.encryption.sdes",selector:l.NS_JINGLE_RTP_1}],element:"crypto",fields:{cryptoSuite:(0,c.attribute)("crypto-suite"),keyParameters:(0,c.attribute)("key-params"),sessionParameters:(0,c.attribute)("session-params"),tag:(0,c.integerAttribute)("tag")},namespace:l.NS_JINGLE_RTP_1},{aliases:[{path:"iq.jingle.contents.application.encryption.zrtp",selector:l.NS_JINGLE_RTP_1}],element:"zrtp-hash",fields:{value:(0,c.textBuffer)("hex"),version:(0,c.attribute)("version")},namespace:l.NS_JINGLE_RTP_1},{element:"mute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_MUTE},{element:"unmute",fields:{creator:(0,c.attribute)("creator"),name:(0,c.attribute)("name")},namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_UNMUTE},{element:"hold",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_HOLD},{element:"unhold",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_UNHOLD},{element:"active",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_ACTIVE},{element:"ringing",namespace:l.NS_JINGLE_RTP_INFO_1,path:p,type:u.JINGLE_INFO_RINGING}];t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({nick:(0,r.childText)(i.NS_NICK,"nick")}),(0,r.extendPresence)({nick:(0,r.childText)(i.NS_NICK,"nick")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"nick",fields:{nick:(0,r.text)()},namespace:i.NS_NICK,type:i.NS_NICK}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(2),o=function(e){return[{element:"transport",fields:{gatheringComplete:(0,i.childBoolean)(null,"gathering-complete"),password:(0,i.attribute)("pwd"),usernameFragment:(0,i.attribute)("ufrag")},namespace:e,path:"iq.jingle.contents.transport",type:e,typeField:"transportType"},{aliases:[{impliedType:!0,path:"iq.jingle.contents.transport.remoteCandidate",selector:e}],element:"remote-candidate",fields:{component:(0,i.integerAttribute)("component"),ip:(0,i.attribute)("ip"),port:(0,i.integerAttribute)("port")},namespace:e,type:e,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:e}],element:"candidate",fields:{component:(0,i.integerAttribute)("component"),foundation:(0,i.attribute)("foundation"),generation:(0,i.integerAttribute)("generation"),id:(0,i.attribute)("id"),ip:(0,i.attribute)("ip"),network:(0,i.integerAttribute)("network"),port:(0,i.integerAttribute)("port"),priority:(0,i.integerAttribute)("priority"),protocol:(0,i.attribute)("protocol"),relatedAddress:(0,i.attribute)("rel-addr"),relatedPort:(0,i.attribute)("rel-port"),tcpType:(0,i.attribute)("tcptype"),type:(0,i.attribute)("type")},namespace:e,type:e,typeField:"transportType"}]},s=[].concat(r(o(a.NS_JINGLE_ICE_0)),r(o(a.NS_JINGLE_ICE_UDP_1)));t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"transport",fields:{gatheringComplete:(0,r.childBoolean)(null,"gathering-complete"),password:(0,r.attribute)("pwd"),usernameFragment:(0,r.attribute)("ufrag")},namespace:i.NS_JINGLE_RAW_UDP_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"},{aliases:[{impliedType:!0,multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_RAW_UDP_1}],element:"candidate",fields:{component:(0,r.integerAttribute)("component"),foundation:(0,r.attribute)("foundation"),generation:(0,r.integerAttribute)("generation"),id:(0,r.attribute)("id"),ip:(0,r.attribute)("ip"),port:(0,r.integerAttribute)("port"),type:(0,r.attribute)("type")},namespace:i.NS_JINGLE_RAW_UDP_1,type:i.NS_JINGLE_RAW_UDP_1,typeField:"transportType"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"request",namespace:i.NS_RECEIPTS,path:"message.receipt",type:"request",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_RECEIPTS,path:"message.receipt",type:"received",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"invisible",fields:{probe:(0,r.booleanAttribute)("probe")},namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"invisible",typeField:"type"},{element:"visible",namespace:i.NS_INVISIBLE_0,path:"iq.visibility",type:"visible"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStanzaError)({blocked:(0,r.childBoolean)(i.NS_BLOCKING_ERRORS,"blocked")}),{element:"blocklist",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"list",typeField:"action"},{element:"block",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"block",typeField:"action"},{element:"unblock",fields:{jids:(0,r.multipleChildAttribute)(null,"item","jid")},namespace:i.NS_BLOCKING,path:"iq.blockList",type:"unblock",typeField:"action"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStreamFeatures)({streamManagement:(0,r.childBoolean)(i.NS_SMACKS_3,"sm")}),{element:"a",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"ack",typeField:"type"},{element:"r",namespace:i.NS_SMACKS_3,path:"sm",type:"request",typeField:"type"},{element:"enable",fields:{allowResumption:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enable",typeField:"type"},{element:"enabled",fields:{id:(0,r.attribute)("id"),resume:(0,r.booleanAttribute)("resume")},namespace:i.NS_SMACKS_3,path:"sm",type:"enabled",typeField:"type"},{element:"resume",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resume",typeField:"type"},{element:"resumed",fields:{handled:(0,r.integerAttribute)("h"),previousSession:(0,r.attribute)("previd")},namespace:i.NS_SMACKS_3,path:"sm",type:"resumed",typeField:"type"},{element:"failed",fields:{handled:(0,r.integerAttribute)("h")},namespace:i.NS_SMACKS_3,path:"sm",type:"failed",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendIQ)({ping:(0,r.childBoolean)(i.NS_PING,"ping")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"time",fields:{tzo:(0,r.childTimezoneOffset)(null,"tzo"),utc:(0,r.childDate)(null,"utc")},namespace:i.NS_TIME,path:"iq.time"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["message.delay","presence.delay"],element:"delay",fields:{from:(0,r.JIDAttribute)("from"),reason:(0,r.text)(),timestamp:(0,r.dateAttribute)("stamp")},namespace:i.NS_DELAY};t.default=a},function(e,t,n){"use strict";var r=n(13);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(5),a=n(2),o={2:a.NS_DISCO_EXTERNAL_2,1:a.NS_DISCO_EXTERNAL_1},s=[],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],p=l[1];s.push({aliases:["iq.externalServiceCredentials"],defaultType:"2",element:"credentials",fields:{expires:(0,i.childDateAttribute)(null,"service","expires"),host:(0,i.childAttribute)(null,"service","host"),name:(0,i.childAttribute)(null,"service","name"),password:(0,i.childAttribute)(null,"service","password"),port:(0,i.childIntegerAttribute)(null,"service","port"),restricted:(0,i.childBooleanAttribute)(null,"service","restricted"),transport:(0,i.childAttribute)(null,"service","transport"),type:(0,i.childAttribute)(null,"service","type"),username:(0,i.childAttribute)(null,"service","username")},namespace:p,type:f,typeField:"version"},{aliases:["iq.externalServices"],defaultType:"2",element:"services",fields:{type:(0,i.attribute)("type")},namespace:p,type:f,typeField:"version"},{aliases:[{path:"iq.externalServices.services",multiple:!0}],defaultType:"2",element:"service",fields:{expires:(0,i.dateAttribute)("expires"),host:(0,i.attribute)("host"),name:(0,i.attribute)("name"),password:(0,i.attribute)("password"),port:(0,i.integerAttribute)("port"),restricted:(0,i.booleanAttribute)("restricted"),transport:(0,i.attribute)("transport"),type:(0,i.attribute)("type"),username:(0,i.attribute)("username")},namespace:p,type:f,typeField:"version"})}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"media",fields:{height:(0,r.integerAttribute)("height"),width:(0,r.integerAttribute)("width")},namespace:i.NS_DATAFORM_MEDIA,path:"dataform.fields.media"},{aliases:[{multiple:!0,path:"dataform.fields.media.sources"}],element:"uri",fields:{mediaType:(0,r.attribute)("type"),uri:(0,r.text)()},namespace:i.NS_DATAFORM_MEDIA}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendMessage)({requestingAttention:(0,r.childBoolean)(i.NS_ATTENTION_0,"attention")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:["iq.bits",{path:"message.bits",multiple:!0},{path:"presence.bits",multiple:!0},{path:"iq.jingle.bits",multiple:!0}],element:"data",fields:{cid:(0,r.attribute)("cid"),data:(0,r.textBuffer)("base64"),maxAge:(0,r.integerAttribute)("max-age"),mediaType:(0,r.attribute)("type")},namespace:i.NS_BOB};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});for(var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_HASHES_2,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_1,"hash",[{path:"file.hashes",multiple:!0},{path:"file.range.hashes",multiple:!0}]),(0,r.addAlias)(i.NS_HASHES_2,"hash-used",[{path:"file.hashesUsed",multiple:!0}]),(0,r.addAlias)(i.NS_THUMBS_1,"thumbnail",[{path:"file.thumbnails",multiple:!0}])],o=0,s=[i.NS_JINGLE_FILE_TRANSFER_4,i.NS_JINGLE_FILE_TRANSFER_5];o<s.length;o++){var u=s[o];a=a.concat([{aliases:["file",{impliedType:!0,path:"iq.jingle.contents.application.file",selector:u},{impliedType:!0,path:"iq.jingle.info.file",selector:"{".concat(u,"}checksum")}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"file",fields:{date:(0,r.childDate)(null,"date"),description:(0,r.childText)(null,"desc"),mediaType:(0,r.childText)(null,"media-type"),name:(0,r.childText)(null,"name"),size:(0,r.childInteger)(null,"size")},namespace:u,type:u,typeField:"version"},{aliases:[{impliedType:!0,path:"file.range",selector:u}],defaultType:i.NS_JINGLE_FILE_TRANSFER_5,element:"range",fields:{length:(0,r.integerAttribute)("length"),offset:(0,r.integerAttribute)("offset",0)},namespace:u,type:u,typeField:"version"},{element:"description",namespace:u,path:"iq.jingle.contents.application",type:u,typeField:"applicationType"},{element:"received",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}received"),typeField:"infoType"},{element:"checksum",fields:{creator:(0,r.attribute)("creator"),name:(0,r.attribute)("name")},namespace:u,path:"iq.jingle.info",type:"{".concat(u,"}checksum"),typeField:"infoType"}])}t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i={element:"description",namespace:r.NS_JINGLE_XML_0,path:"iq.jingle.contents.application",type:r.NS_JINGLE_XML_0,typeField:"applicationType"};t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"transport",fields:{activated:(0,r.childAttribute)(null,"activated","cid"),address:(0,r.attribute)("dstaddr"),candidateError:(0,r.childBoolean)(null,"candidate-error"),candidateUsed:(0,r.childAttribute)(null,"candidate-used","cid"),mode:(0,r.attribute)("mode","tcp"),proxyError:(0,r.childBoolean)(null,"proxy-error"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_SOCKS5_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_SOCKS5_1,typeField:"transportType"},{aliases:[{multiple:!0,path:"iq.jingle.contents.transport.candidates",selector:i.NS_JINGLE_SOCKS5_1}],element:"candidate",fields:{cid:(0,r.attribute)("cid"),host:(0,r.attribute)("host"),jid:(0,r.JIDAttribute)("jid"),port:(0,r.integerAttribute)("port"),priority:(0,r.integerAttribute)("priority"),type:(0,r.attribute)("type"),uri:(0,r.attribute)("uri")},namespace:i.NS_JINGLE_SOCKS5_1}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"transport",fields:{ack:{importer:function(e,t){return"message"!==(0,r.attribute)("stanza","iq").importer(e,t)},exporter:function(e,t,n){!1===t&&(0,r.attribute)("stanza").exporter(e,"message",n)}},blockSize:(0,r.integerAttribute)("block-size"),sid:(0,r.attribute)("sid")},namespace:i.NS_JINGLE_IBB_1,path:"iq.jingle.contents.transport",type:i.NS_JINGLE_IBB_1,typeField:"transportType"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_BOB,"data",[{path:"iq.jingle.bits",multiple:!0}]),{element:"thumbnail",fields:{height:(0,r.integerAttribute)("height"),mediaType:(0,r.attribute)("media-type"),uri:(0,r.attribute)("uri"),width:(0,r.integerAttribute)("width")},namespace:i.NS_THUMBS_1,path:"thumbnail"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_FORWARD_0,"forwarded",["message.carbon.forward"]),{element:"enable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"enable",typeField:"action"},{element:"disable",namespace:i.NS_CARBONS_2,path:"iq.carbons",type:"disable",typeField:"action"},{element:"sent",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"sent",typeField:"type"},{element:"received",namespace:i.NS_CARBONS_2,path:"message.carbon",type:"received",typeField:"type"}];t.default=a},function(e,t,n){"use strict";var r=n(12);Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),a=n(18),o=n(2),s=[].concat(r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"message",["forward.message"])}))),r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"presence",["forward.presence"])}))),r(Object.values(a.StreamType).map((function(e){return(0,i.addAlias)(e,"iq",["forward.iq"])}))),[(0,i.addAlias)(o.NS_DELAY,"delay",["forward.delay"]),{aliases:["message.forward"],element:"forwarded",namespace:o.NS_FORWARD_0,path:"forward"}]);t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{defaultType:"2",element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("base64"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hash",type:"2",typeField:"version"},{element:"hash-used",fields:{algorithm:(0,r.attribute)("algo"),version:(0,r.staticValue)("2")},namespace:i.NS_HASHES_2,path:"hashUsed"},{element:"hash",fields:{algorithm:(0,r.attribute)("algo"),value:(0,r.textBuffer)("hex"),version:(0,r.staticValue)("1")},namespace:i.NS_HASHES_1,path:"hash",type:"1",typeField:"version"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{element:"rtt",fields:{event:(0,r.attribute)("event","edit"),id:(0,r.attribute)("id"),seq:(0,r.integerAttribute)("seq")},namespace:i.NS_RTT_0,path:"message.rtt"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"t",fields:{position:(0,r.integerAttribute)("p"),text:(0,r.text)()},namespace:i.NS_RTT_0,type:"insert",typeField:"type"},{aliases:[{path:"message.rtt.actions",multiple:!0}],element:"e",fields:{length:(0,r.integerAttribute)("n",1),position:(0,r.integerAttribute)("p")},namespace:i.NS_RTT_0,type:"erase",typeField:"type"},{aliases:[{multiple:!0,path:"message.rtt.actions"}],element:"w",fields:{duration:(0,r.integerAttribute)("n",0)},namespace:i.NS_RTT_0,type:"wait",typeField:"type"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendMessage)({replace:(0,r.childAttribute)(i.NS_CORRECTION_0,"replace","id")})},function(e,t,n){"use strict";var r=n(13);Object.defineProperty(t,"__esModule",{value:!0});for(var i=n(5),a=n(2),o={2:a.NS_MAM_2,1:a.NS_MAM_1},s=[(0,i.addAlias)(a.NS_DATAFORM,"x",["iq.archive.form"]),(0,i.addAlias)(a.NS_FORWARD_0,"forwarded",["message.archive.item"]),(0,i.addAlias)(a.NS_RSM,"set",["iq.archive.paging"])],u=0,c=Object.entries(o);u<c.length;u++){var l=r(c[u],2),f=l[0],p=l[1];s.push({defaultType:"query",defaultVersion:"2",element:"query",fields:{node:(0,i.attribute)("node"),queryId:(0,i.attribute)("queryid")},namespace:p,path:"iq.archive",type:"query",typeField:"type",version:f,versionField:"version"},{element:"fin",fields:{complete:(0,i.booleanAttribute)("complete"),stable:(0,i.booleanAttribute)("stable")},namespace:p,path:"iq.archive",type:"result",version:f},{element:"prefs",fields:{default:(0,i.attribute)("default"),always:(0,i.deepMultipleChildText)([{namespace:null,element:"always"},{namespace:null,element:"jid"}]),never:(0,i.deepMultipleChildText)([{namespace:null,element:"never"},{namespace:null,element:"jid"}])},namespace:p,path:"iq.archive",type:"preferences",version:f},{element:"result",defaultType:"2",fields:{id:(0,i.attribute)("id"),queryId:(0,i.attribute)("queryid")},namespace:p,path:"message.archive",type:f,typeField:"version"})}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendPresence)({hats:(0,r.splicePath)(i.NS_HATS_0,"hats","hat",!0)}),{element:"hat",fields:{id:(0,r.attribute)("name"),name:(0,r.attribute)("displayName")},namespace:i.NS_HATS_0,path:"hat"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2);t.default=(0,r.extendPresence)({idleSince:(0,r.childDate)(i.NS_IDLE_1,"since")})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_UDP_1},{multiple:!0,path:"iq.jingle.contents.transport.fingerprints",selector:i.NS_JINGLE_ICE_0},{multiple:!0,path:"iq.jingle.contents.application.encryption.dtls",selector:i.NS_JINGLE_RTP_1}],element:"fingerprint",fields:{algorithm:(0,r.attribute)("hash"),setup:(0,r.attribute)("setup"),value:(0,r.text)()},namespace:i.NS_JINGLE_DTLS_0};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a="message.marker",o=[{element:"markable",namespace:i.NS_CHAT_MARKERS_0,path:a,type:"markable",typeField:"type"},{element:"received",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"received"},{element:"displayed",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"displayed"},{element:"acknowledged",fields:{id:(0,r.attribute)("id")},namespace:i.NS_CHAT_MARKERS_0,path:a,type:"acknowledged"}];t.default=o},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});var a=n(5),o=n(2);t.default=(0,a.extendMessage)({processingHints:{importer:function(e){var t,n={},i=!1,a=r(e.children);try{for(a.s();!(t=a.n()).done;){var s=t.value;if("string"!=typeof s&&s.getNamespace()===o.NS_HINTS)switch(s.getName()){case"no-copy":n.noCopy=!0,i=!0;break;case"no-permanent-store":n.noPermanentStore=!0,i=!0;break;case"no-store":n.noStore=!0,i=!0;break;case"store":n.store=!0,i=!0}}}catch(e){a.e(e)}finally{a.f()}return i?n:void 0},exporter:function(e,t,n){t.noCopy&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-copy",n.namespace,e)),t.noPermanentStore&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-permanent-store",n.namespace,e)),t.noStore&&e.appendChild((0,a.createElement)(o.NS_HINTS,"no-store",n.namespace,e)),t.store&&e.appendChild((0,a.createElement)(o.NS_HINTS,"store",n.namespace,e))}}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({json:(0,r.childJSON)(i.NS_JSON_0,"json")}),{aliases:(0,r.pubsubItemContentAliases)(),element:"json",fields:{json:(0,r.textJSON)()},namespace:i.NS_JSON_0,type:i.NS_JSON_0},{aliases:[{path:"message.jsonPayloads",multiple:!0}],element:"payload",fields:{type:(0,r.attribute)("datatype"),data:(0,r.childJSON)(i.NS_JSON_0,"json")},namespace:i.NS_JSON_MESSAGE_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:[{path:"iq.jingle.groups",multiple:!0}],element:"group",fields:{contents:(0,r.multipleChildAttribute)(null,"content","name"),semantics:(0,r.attribute)("semantics")},namespace:i.NS_JINGLE_GROUPING_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={aliases:[{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_UDP_1},{path:"iq.jingle.contents.transport.sctp",selector:i.NS_JINGLE_ICE_0}],element:"sctpmap",fields:{port:(0,r.integerAttribute)("number"),protocol:(0,r.attribute)("protocol"),streams:(0,r.attribute)("streams")},namespace:i.NS_JINGLE_DTLS_SCTP_1};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),i=[{element:"active",namespace:r.NS_CSI_0,path:"csi",type:"active",typeField:"state"},{element:"inactive",namespace:r.NS_CSI_0,path:"csi",type:"inactive",typeField:"state"}];t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.addAlias)(i.NS_DATAFORM,"x",["iq.push.form","pushNotification.form"]),{element:"enable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"enable",typeField:"action"},{element:"disable",fields:{jid:(0,r.JIDAttribute)("jid"),node:(0,r.attribute)("node")},namespace:i.NS_PUSH_0,path:"iq.push",type:"disable",typeField:"action"},{aliases:(0,r.pubsubItemContentAliases)(),element:"notification",namespace:i.NS_PUSH_0,path:"pushNotification",type:i.NS_PUSH_0,typeField:"itemType"}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendMessage)({originId:(0,r.childAttribute)(i.NS_SID_0,"origin-id","id")}),{aliases:[{path:"message.stanzaIds",multiple:!0}],element:"stanza-id",fields:{by:(0,r.JIDAttribute)("by"),id:(0,r.attribute)("id")},namespace:i.NS_SID_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[(0,r.extendStanzaError)({httpUploadError:(0,r.childEnum)(i.NS_HTTP_UPLOAD_0,["file-too-large","retry"]),httpUploadMaxFileSize:(0,r.deepChildInteger)([{namespace:i.NS_HTTP_UPLOAD_0,element:"file-too-large"},{namespace:i.NS_HTTP_UPLOAD_0,element:"max-file-size"}]),httpUploadRetry:(0,r.childDateAttribute)(i.NS_HTTP_UPLOAD_0,"retry","stamp")}),{element:"request",fields:{mediaType:(0,r.attribute)("content-type"),name:(0,r.attribute)("filename"),size:(0,r.integerAttribute)("size")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"request",typeField:"type"},{element:"slot",fields:{download:(0,r.childAttribute)(null,"get","url")},namespace:i.NS_HTTP_UPLOAD_0,path:"iq.httpUpload",type:"slot"},{aliases:[{path:"iq.httpUpload.upload",selector:"slot"}],element:"put",fields:{url:(0,r.attribute)("url")},namespace:i.NS_HTTP_UPLOAD_0},{aliases:[{path:"iq.httpUpload.upload.headers",multiple:!0}],element:"header",fields:{name:(0,r.attribute)("name"),value:(0,r.text)()},namespace:i.NS_HTTP_UPLOAD_0}];t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a={element:"encryption",fields:{id:(0,r.attribute)("namespace"),name:(0,r.attribute)("name")},namespace:i.NS_EME_0,path:"message.encryptionMethod"};t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n(2),a=[{aliases:["message.omemo"],element:"encrypted",fields:{payload:(0,r.childTextBuffer)(null,"payload","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo"},{element:"header",fields:{iv:(0,r.childTextBuffer)(null,"iv","base64"),sid:(0,r.integerAttribute)("sid")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemo.header"},{aliases:[{path:"omemo.header.keys",multiple:!0}],element:"key",fields:{preKey:(0,r.booleanAttribute)("prekey"),rid:(0,r.integerAttribute)("rid"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL},{aliases:(0,r.pubsubItemContentAliases)(),element:"list",fields:{devices:(0,r.multipleChildIntegerAttribute)(null,"device","id")},namespace:i.NS_OMEMO_AXOLOTL,type:i.NS_OMEMO_AXOLOTL_DEVICELIST,typeField:"itemType"},{element:"preKeyPublic",fields:{id:(0,r.integerAttribute)("preKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoPreKey"},{element:"signedPreKeyPublic",fields:{id:(0,r.integerAttribute)("signedPreKeyId"),value:(0,r.textBuffer)("base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice.signedPreKeyPublic"},{aliases:(0,r.pubsubItemContentAliases)(),element:"bundle",fields:{identityKey:(0,r.childTextBuffer)(null,"identityKey","base64"),preKeys:(0,r.splicePath)(null,"prekeys","omemoPreKey",!0),signedPreKeySignature:(0,r.childTextBuffer)(null,"signedPreKeySignature","base64")},namespace:i.NS_OMEMO_AXOLOTL,path:"omemoDevice",type:i.NS_OMEMO_AXOLOTL_BUNDLES,typeField:"itemType"}];t.default=a},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(e,i,a){var o;return r(this,n),(o=t.call(this)).condition=e,o.channelId=i,o.stanzaInstanceId=a,o.name="SaslError",o}return n}(s(Error));t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},function(e,t,n){"use strict";var r={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},i=n(51),a=n(29);t.a=function(e,t,n){if(r.randomUUID&&!t&&!e)return r.randomUUID();var o=(e=e||{}).random||(e.rng||i.a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){n=n||0;for(var s=0;s<16;++s)t[n+s]=o[s];return t}return Object(a.b)(o)}},function(e,t,n){var r=n(54);e.exports=function(e){var t={},n=!1;function i(t,i){return n=!0,i=new Promise((function(n){n(e[t](i))})),{done:!1,value:new r(i,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return n?(n=!1,e):i("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(236);e.exports=function(e,t){if(null==e)return{};var n,i,a=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";n.r(t);var r=n(70),i=n(66);for(var a in i)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);var o=n(60);for(var a in o)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);var s=n(200);for(var a in s)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return s[e]}))}(a);var u=n(33);for(var a in u)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(a);var c=n(69);for(var a in c)["HttpClient","StreamingClientError","parseJwt","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(a);var l=n(45);n.d(t,"HttpClient",(function(){return l.HttpClient}));var f=n(26);n.d(t,"StreamingClientError",(function(){return f.StreamingClientError})),n.d(t,"parseJwt",(function(){return f.parseJwt})),t.default=r.Client},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default;function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=i=function(){return n},e.exports.__esModule=!0,e.exports.default=e.exports;var t,n={},a=Object.prototype,o=a.hasOwnProperty,s=Object.defineProperty||function(e,t,n){e[t]=n.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",f=u.toStringTag||"@@toStringTag";function p(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new j(r||[]);return s(a,"_invoke",{value:I(e,n,o)}),a}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=d;var v="suspendedStart",m="executing",g="completed",y={};function b(){}function _(){}function S(){}var w={};p(w,c,(function(){return this}));var x=Object.getPrototypeOf,k=x&&x(x(C([])));k&&k!==a&&o.call(k,c)&&(w=k);var O=S.prototype=b.prototype=Object.create(w);function T(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==r(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,s,u)}),(function(e){n("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return n("throw",e,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(a,a):a()}})}function I(e,n,r){var i=v;return function(a,o){if(i===m)throw new Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(r.method=a,r.arg=o;;){var s=r.delegate;if(s){var u=E(s,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===v)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=m;var c=h(e,n,r);if("normal"===c.type){if(i=r.done?g:"suspendedYield",c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(i=g,r.method="throw",r.arg=c.arg)}}}function E(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=h(i,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var o=a.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function C(e){if(e||""===e){var n=e[c];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(o.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(r(e)+" is not iterable")}return _.prototype=S,s(O,"constructor",{value:S,configurable:!0}),s(S,"constructor",{value:_,configurable:!0}),_.displayName=p(S,f,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,S):(e.__proto__=S,p(e,f,"GeneratorFunction")),e.prototype=Object.create(O),e},n.awrap=function(e){return{__await:e}},T(A.prototype),p(A.prototype,l,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,i,a){void 0===a&&(a=Promise);var o=new A(d(e,t,r,i),a);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},T(O),p(O,f,"Generator"),p(O,c,(function(){return this})),p(O,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=C,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!e)for(var n in this)"t"===n.charAt(0)&&o.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,i){return s.type="throw",s.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:C(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){var r=n(11).default;e.exports=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){t.RateLimiter=n(209),t.TokenBucket=n(77)},function(e,t,n){(function(t){var r=n(77),i=n(210),a=function(e,t,n){this.tokenBucket=new r(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=i(),this.tokensThisInterval=0,this.fireImmediately=n};a.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,n){if(e>this.tokenBucket.bucketSize)return t.nextTick(n.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var r=this,a=i();if((a<this.curIntervalStart||a-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=a,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)t.nextTick(n.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-a);setTimeout((function(){r.tokenBucket.removeTokens(e,s)}),o)}return!1}return this.tokenBucket.removeTokens(e,s);function s(t,i){if(t)return n(t,null);r.tokensThisInterval+=e,n(null,i)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=i();if((t<this.curIntervalStart||t-this.curIntervalStart>=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},e.exports=a}).call(this,n(32))},function(e,t,n){(function(t){e.exports=function(){if(void 0!==t&&t.hrtime){var e=t.hrtime(),n=e[0],r=e[1];return 1e3*n+Math.floor(r/1e6)}return(new Date).getTime()}}).call(this,n(32))},function(e,t,n){var r=n(74);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var i={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=r(r({},i),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(215),i=n(219);t.DelayFactory=function(e,t){var n=function(e){if(!e.delayFirstAttempt)return new r.SkipFirstDelay(e);return new i.AlwaysDelay(e)}(e);return n.setAttemptNumber(t),n}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__awaiter||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())}))},o=this&&this.__generator||function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.apply=function(){return a(this,void 0,void 0,(function(){return o(this,(function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]}))}))},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(n(79).Delay);t.SkipFirstDelay=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(217),i=n(218);t.JitterFactory=function(e){switch(e.jitter){case"full":return r.fullJitter;case"none":default:return i.noJitter}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(n(79).Delay);t.AlwaysDelay=a},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(221),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(25))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,a,o,s,u=1,c={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&h(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(o+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[u]=i,r(u),u++},p.clearImmediate=d}function d(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(25),n(32))},function(e,t,n){"use strict";(function(e){
|
|
8
8
|
/*!
|
|
9
9
|
* The buffer module from node.js, for the browser.
|
|
10
10
|
*
|
|
@@ -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(){f.webrtcSessions=f.webrtcSessions.filter((function(e){return e.id!==l.id}))})),this.webrtcSessions.push(l),delete this.sessionsMap[l.id],this.logger.info("emitting sdp media-session (offer"),this.applyEarlyIceCandidates(l),e.abrupt("return",this.emit(B,l));case 27: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=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";
|
|
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,"<"),"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;
|