jiuyiUniapp/jiuyi/node_modules/.ignored/easemob-websdk/miniProgram/Easemob-chat.js

1 line
398 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.websdk=t():e.websdk=t()}(this,(function(){return function(){var e={188:function(e,t,r){var o,n,i;!function(a){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=a();else if(null!=r.amdO)n=[],void 0===(i="function"==typeof(o=a)?o.apply(t,n):o)||(e.exports=i);else{var s=a(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=s.btoa),"function"!=typeof c.atob&&(c.atob=s.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var o,n,i=String(r),a=0,s=e,c="";i.charAt(0|a)||(s="=",a%1);c+=s.charAt(63&o>>8-a%1*8)){if((n=i.charCodeAt(a+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c},atob:function(r){var o=String(r).replace(/[=]+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,a=0,s=0,c="";i=o.charAt(s++);~i&&(n=a%4?64*n+i:i,a++%4)?c+=String.fromCharCode(255&n>>(-2*a&6)):0)i=e.indexOf(i);return c}}}))},720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function a(e,t){var r,o,a;return t?(a=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=c(e,e<0?-1:0,!1),a&&(n[e]=r),r)}function s(e,t){if(isNaN(e))return t?E:g;if(t){if(e<0)return E;if(e>=h)return R}else{if(e<=-f)return O;if(e+1>=f)return _}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,o){return new r(e,t,o)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return l(e.substring(1),t,r).neg();for(var n=s(u(r,8)),i=g,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(n)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),g=a(0);r.ZERO=g;var E=a(0,!0);r.UZERO=E;var y=a(1);r.ONE=y;var T=a(1,!0);r.UONE=T;var v=a(-1);r.NEG_ONE=v;var _=c(-1,2147483647,!1);r.MAX_VALUE=_;var R=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=R;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var I=r.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(n),l=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(e){return o(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(e){if(o(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(y)},I.neg=I.negate,I.add=function(e){o(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=n+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},I.subtract=function(e){return o(e)||(e=d(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(O))return e.isOdd()?O:g;if(e.eq(O))return this.isOdd()?O:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,E=0,y=0,T=0;return y+=(T+=a*h)>>>16,E+=(y+=i*h)>>>16,y&=65535,E+=(y+=a*p)>>>16,f+=(E+=n*h)>>>16,E&=65535,f+=(E+=i*p)>>>16,E&=65535,f+=(E+=a*l)>>>16,f+=r*h+n*p+i*l+a*u,c((y&=65535)<<16|(T&=65535),(f&=65535)<<16|(E&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(o(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?E:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return T;i=E}else{if(this.eq(O))return e.eq(y)||e.eq(v)?O:e.eq(O)?y:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:v:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(O))return this.unsigned?E:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(n);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=y),i=i.add(p),n=n.sub(h)}return i},I.div=I.divide,I.modulo=function(e){return o(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return c(~this.low,~this.high,this.unsigned)},I.and=function(e){return o(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return o(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return o(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},969:function(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],o=0;o<r.length;)r[o].fn===t?r.splice(o,1):++o;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],o=1;o<arguments.length;)r.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,r)}return this}},728:function(e){"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise((function(n,a){r[o]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}}))}},440:function(e){"use strict";var t=e.exports;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),o=new Array(123),n=0;n<64;)o[r[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;t.encode=function(e,t,o){for(var n,i=null,a=[],s=0,c=0;t<o;){var u=e[t++];switch(c){case 0:a[s++]=r[u>>2],n=(3&u)<<4,c=1;break;case 1:a[s++]=r[n|u>>4],n=(15&u)<<2,c=2;break;case 2:a[s++]=r[n|u>>6],a[s++]=r[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=r[n],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var i="invalid encoding";t.decode=function(e,t,r){for(var n,a=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(i);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(i);return r-a},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},72:function(e){e.exports=o;var t,r=/\/|\./;function o(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:t}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},525:function(e,t,r){var o,n,i=e.exports;function a(e,t,r,i){var a=i.m,s=i.d,c=i.types,u=i.ksi,l=void 0!==u;if(e.resolvedType)if(e.resolvedType instanceof o){for(var d=l?s[r][u]:s[r],p=e.resolvedType.values,h=Object.keys(p),f=0;f<h.length;f++)if(!(e.repeated&&p[h[f]]===e.typeDefault||h[f]!=d&&p[h[f]]!=d)){l?a[r][u]=p[h[f]]:a[r]=p[h[f]];break}}else{if("object"!=typeof(l?s[r][u]:s[r]))throw TypeError(e.fullName+": object expected");l?a[r][u]=c[t].fromObject(s[r][u]):a[r]=c[t].fromObject(s[r])}else{var m=!1;switch(e.type){case"double":case"float":l?a[r][u]=Number(s[r][u]):a[r]=Number(s[r]);break;case"uint32":case"fixed32":l?a[r][u]=s[r][u]>>>0:a[r]=s[r]>>>0;break;case"int32":case"sint32":case"sfixed32":l?a[r][u]=0|s[r][u]:a[r]=0|s[r];break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":n.Long?l?a[r][u]=n.Long.fromValue(s[r][u]).unsigned=m:a[r]=n.Long.fromValue(s[r]).unsigned=m:"string"==typeof(l?s[r][u]:s[r])?l?a[r][u]=parseInt(s[r][u],10):a[r]=parseInt(s[r],10):"number"==typeof(l?s[r][u]:s[r])?l?a[r][u]=s[r][u]:a[r]=s[r]:"object"==typeof(l?s[r][u]:s[r])&&(l?a[r][u]=new n.LongBits(s[r][u].low>>>0,s[r][u].high>>>0).toNumber(m):a[r]=new n.LongBits(s[r].low>>>0,s[r].high>>>0).toNumber(m));break;case"bytes":"string"==typeof(l?s[r][u]:s[r])?l?n.base64.decode(s[r][u],a[r][u]=n.newBuffer(n.base64.length(s[r][u])),0):n.base64.decode(s[r],a[r]=n.newBuffer(n.base64.length(s[r])),0):(l?s[r][u]:s[r]).length&&(l?a[r][u]=s[r][u]:a[r]=s[r]);break;case"string":l?a[r][u]=String(s[r][u]):a[r]=String(s[r]);break;case"bool":l?a[r][u]=Boolean(s[r][u]):a[r]=Boolean(s[r])}}}function s(e,t,r,i){var a=i.m,s=i.d,c=i.types,u=i.ksi,l=i.o,d=void 0!==u;if(e.resolvedType)e.resolvedType instanceof o?d?s[r][u]=l.enums===String?c[t].values[a[r][u]]:a[r][u]:s[r]=l.enums===String?c[t].values[a[r]]:a[r]:d?s[r][u]=c[t].toObject(a[r][u],l):s[r]=c[t].toObject(a[r],l);else{var p=!1;switch(e.type){case"double":case"float":d?s[r][u]=l.json&&!isFinite(a[r][u])?String(a[r][u]):a[r][u]:s[r]=l.json&&!isFinite(a[r])?String(a[r]):a[r];break;case"uint64":p=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":"number"==typeof a[r][u]?d?s[r][u]=l.longs===String?String(a[r][u]):a[r][u]:s[r]=l.longs===String?String(a[r]):a[r]:d?s[r][u]=l.longs===String?n.Long.prototype.toString.call(a[r][u]):l.longs===Number?new n.LongBits(a[r][u].low>>>0,a[r][u].high>>>0).toNumber(p):a[r][u]:s[r]=l.longs===String?n.Long.prototype.toString.call(a[r]):l.longs===Number?new n.LongBits(a[r].low>>>0,a[r].high>>>0).toNumber(p):a[r];break;case"bytes":d?s[r][u]=l.bytes===String?n.base64.encode(a[r][u],0,a[r][u].length):l.bytes===Array?Array.prototype.slice.call(a[r][u]):a[r][u]:s[r]=l.bytes===String?n.base64.encode(a[r],0,a[r].length):l.bytes===Array?Array.prototype.slice.call(a[r]):a[r];break;default:d?s[r][u]=a[r][u]:s[r]=a[r]}}}i._configure=function(){o=r(582),n=r(935)},i.fromObject=function(e){var t=e.fieldsArray;return function(e){return function(r){if(r instanceof this.ctor)return r;if(!t.length)return new this.ctor;for(var i=new this.ctor,s=0;s<t.length;++s){var c,u=t[s].resolve(),l=u.name;if(u.map){if(r[l]){if("object"!=typeof r[l])throw TypeError(u.fullName+": object expected");i[l]={}}var d=Object.keys(r[l]);for(c=0;c<d.length;++c)a(u,s,l,n.merge(n.copy(e),{m:i,d:r,ksi:d[c]}))}else if(u.repeated){if(r[l]){if(!Array.isArray(r[l]))throw TypeError(u.fullName+": array expected");for(i[l]=[],c=0;c<r[l].length;++c)a(u,s,l,n.merge(n.copy(e),{m:i,d:r,ksi:c}))}}else(u.resolvedType instanceof o||null!=r[l])&&a(u,s,l,n.merge(n.copy(e),{m:i,d:r}))}return i}}},i.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);return function(r){return t.length?function(i,a){a=a||{};for(var c,u,l={},d=[],p=[],h=[],f=0;f<t.length;++f)t[f].partOf||(t[f].resolve().repeated?d:t[f].map?p:h).push(t[f]);if(d.length&&(a.arrays||a.defaults))for(f=0;f<d.length;++f)l[d[f].name]=[];if(p.length&&(a.objects||a.defaults))for(f=0;f<p.length;++f)l[p[f].name]={};if(h.length&&a.defaults)for(f=0;f<h.length;++f)if(u=(c=h[f]).name,c.resolvedType instanceof o)l[u]=a.enums=String?c.resolvedType.valuesById[c.typeDefault]:c.typeDefault;else if(c.long)if(n.Long){var m=new n.Long(c.typeDefault.low,c.typeDefault.high,c.typeDefault.unsigned);l[u]=a.longs===String?m.toString():a.longs===Number?m.toNumber():m}else l[u]=a.longs===String?c.typeDefault.toString():c.typeDefault.toNumber();else c.bytes?l[u]=a.bytes===String?String.fromCharCode.apply(String,c.typeDefault):Array.prototype.slice.call(c.typeDefault).join("*..*").split("*..*"):l[u]=c.typeDefault;var g=!1;for(f=0;f<t.length;++f){u=(c=t[f]).name;var E,y,T=e._fieldsArray.indexOf(c);if(c.map){if(g||(g=!0),i[u]&&(E=Object.keys(i[u]).length))for(l[u]={},y=0;y<E.length;++y)s(c,T,u,n.merge(n.copy(r),{m:i,d:l,ksi:E[y],o:a}))}else if(c.repeated){if(i[u]&&i[u].length)for(l[u]=[],y=0;y<i[u].length;++y)s(c,T,u,n.merge(n.copy(r),{m:i,d:l,ksi:y,o:a}))}else null!=i[u]&&i.hasOwnProperty(u)&&s(c,T,u,n.merge(n.copy(r),{m:i,d:l,o:a})),c.partOf&&a.oneofs&&(l[c.partOf.name]=u)}return l}:function(){return{}}}}},888:function(e,t,r){var o,n,i;function a(e){return"missing required '"+e.name+"'"}function s(e){return function(t){var r=t.Reader,s=t.types,c=t.util;return function(t,u){t instanceof r||(t=r.create(t));for(var l,d=void 0===u?t.len:t.pos+u,p=new this.ctor;t.pos<d;){var h=t.uint32();if(e.group&&4==(7&h))break;for(var f=h>>>3,m=0,g=!1;m<e.fieldsArray.length;++m){var E=e._fieldsArray[m].resolve(),y=E.name,T=E.resolvedType instanceof o?"int32":E.type;if(f==E.id){if(g=!0,E.map)t.skip().pos++,p[y]===c.emptyObject&&(p[y]={}),l=t[E.keyType](),t.pos++,null!=n.long[E.keyType]?null==n.basic[T]?p[y]["object"==typeof l?c.longToHash(l):l]=s[m].decode(t,t.uint32()):p[y]["object"==typeof l?c.longToHash(l):l]=t[T]():null==n.basic[T]?p[y]=s[m].decode(t,t.uint32()):p[y]=t[T]();else if(E.repeated)if(p[y]&&p[y].length||(p[y]=[]),null!=n.packed[T]&&2==(7&h))for(var v=t.uint32()+t.pos;t.pos<v;)p[y].push(t[T]());else null==n.basic[T]?E.resolvedType.group?p[y].push(s[m].decode(t)):p[y].push(s[m].decode(t,t.uint32())):p[y].push(t[T]());else null==n.basic[T]?E.resolvedType.group?p[y]=s[m].decode(t):p[y]=s[m].decode(t,t.uint32()):p[y]=t[T]();break}}g||(console.log("t",h),t.skipType(7&h))}for(m=0;m<e._fieldsArray.length;++m){var _=e._fieldsArray[m];if(_.required&&!p.hasOwnProperty(_.name))throw i.ProtocolError(a(_),{instance:p})}return p}}}e.exports=s,s._configure=function(){o=r(582),n=r(696),i=r(935)}},929:function(e,t,r){var o,n;function i(e){return function(t){var r=t.Writer,i=t.types,a=t.util;return function(t,s){s=s||r.create();for(var c=e.fieldsArray.slice().sort(a.compareFieldsById),u=0;u<c.length;u++){var l=c[u],d=e._fieldsArray.indexOf(l),p=l.resolvedType instanceof o?"uint32":l.type,h=n.basic[p],f=t[l.name];if(l.resolvedType instanceof o&&"string"==typeof f&&(f=i[d].values[f]),l.map){if(null!=f&&t.hasOwnProperty(l.name))for(var m=Object.keys(f),g=0;g<m.length;++g)s.uint32((l.id<<3|2)>>>0).fork().uint32(8|n.mapKey[l.keyType])[l.keyType](m[g]),void 0===h?i[d].encode(f[m[g]],s.uint32(18).fork()).ldelim().ldelim():s.uint32(16|h)[p](f[m[g]]).ldelim()}else if(l.repeated){if(f&&f.length)if(l.packed&&void 0!==n.packed[p]){s.uint32((l.id<<3|2)>>>0).fork();for(var E=0;E<f.length;E++)s[p](f[E]);s.ldelim()}else for(var y=0;y<f.length;y++)void 0===h?l.resolvedType.group?i[d].encode(f[y],s.uint32((l.id<<3|3)>>>0)).uint32((l.id<<3|4)>>>0):i[d].encode(f[y],s.uint32((l.id<<3|2)>>>0).fork()).ldelim():s.uint32((l.id<<3|h)>>>0)[p](f[y])}else(!l.optional||null!=f&&t.hasOwnProperty(l.name))&&(l.optional||null!=f&&t.hasOwnProperty(l.name)||console.warn("注意啦!!!很大概率会报错 类型:",t.$type?t.$type.name:"不晓得","没有设置对应的属性:",l.name,"检查是不是proto文件属性设置为了required"),void 0===h?l.resolvedType.group?i[d].encode(f,s.uint32((l.id<<3|3)>>>0)).uint32((l.id<<3|4)>>>0):i[d].encode(f,s.uint32((l.id<<3|2)>>>0).fork()).ldelim():s.uint32((l.id<<3|h)>>>0)[p](f))}return s}}}e.exports=i,i._configure=function(){o=r(582),n=r(696)}},582:function(e,t,r){e.exports=i;var o=r(998);((i.prototype=Object.create(o.prototype)).constructor=i).className="Enum";var n=r(476);function i(e,t,r,n,i){if(o.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var a=Object.keys(t),s=0;s<a.length;++s)"number"==typeof t[a[s]]&&(this.valuesById[this.values[a[s]]=t[a[s]]]=a[s])}i.fromJSON=function(e,t){var r=new i(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return util.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},i.prototype.add=function(e,t,r){if(!util.isString(e))throw TypeError("name must be a string");if(!util.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},i.prototype.remove=function(e){if(!util.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},i.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},i.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},286:function(e,t,r){e.exports=u;var o,n,i,a,s=r(998);((u.prototype=Object.create(s.prototype)).constructor=u).className="Field";var c=/^required|optional|repeated$/;function u(e,t,r,o,a,u,l){if(i.isObject(o)?(l=a,u=o,o=a=void 0):i.isObject(a)&&(l=u,u=a,a=void 0),s.call(this,e,u),!i.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!i.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==a&&!i.isString(a))throw TypeError("extend must be a string");this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=a||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!i.Long&&void 0!==n.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),s.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof a?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=i.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;i.utf8.write(this.typeDefault,e=i.newBuffer(i.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=i.emptyObject:this.repeated?this.defaultValue=i.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof a&&(this.parent.ctor.prototype[this.name]=this.defaultValue),s.prototype.resolve.call(this)},u.d=function(e,t,r,o){return"function"==typeof t?t=i.decorateType(t).name:t&&"object"==typeof t&&(t=i.decorateEnum(t).name),function(n,a){i.decorateType(n.constructor).add(new u(a,e,t,r,{default:o}))}},u._configure=function(){a=r(192),o=r(582),n=r(696),i=r(935)}},283:function(e){function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=128===r[3];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3]}function i(e,o,n){t[0]=e,o[n]=r[3],o[n+1]=r[2],o[n+2]=r[1],o[n+3]=r[0]}function a(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],t[0]}function s(e,o){return r[3]=e[o],r[2]=e[o+1],r[1]=e[o+2],r[0]=e[o+3],t[0]}e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n,e.readFloatLE=o?a:s,e.readFloatBE=o?s:a}():function(){function t(e,t,r,o){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,o);else if(isNaN(t))e(2143289344,r,o);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,o);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,o)}}function a(e,t,r){var o=e(t,r),n=2*(o>>31)+1,i=o>>>23&255,a=8388607&o;return 255===i?a?NaN:n*(1/0):0===i?1401298464324817e-60*n*a:n*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o),e.readFloatLE=a.bind(null,n),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=128===r[7];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3],o[n+4]=r[4],o[n+5]=r[5],o[n+6]=r[6],o[n+7]=r[7]}function i(e,o,n){t[0]=e,o[n]=r[7],o[n+1]=r[6],o[n+2]=r[5],o[n+3]=r[4],o[n+4]=r[3],o[n+5]=r[2],o[n+6]=r[1],o[n+7]=r[0]}function a(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],r[4]=e[o+4],r[5]=e[o+5],r[6]=e[o+6],r[7]=e[o+7],t[0]}function s(e,o){return r[7]=e[o],r[6]=e[o+1],r[5]=e[o+2],r[4]=e[o+3],r[3]=e[o+4],r[2]=e[o+5],r[1]=e[o+6],r[0]=e[o+7],t[0]}e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n,e.readDoubleLE=o?a:s,e.readDoubleBE=o?s:a}():function(){function t(e,t,r,o,n,i){var a=o<0?1:0;if(a&&(o=-o),0===o)e(0,n,i+t),e(1/o>0?0:2147483648,n,i+r);else if(isNaN(o))e(0,n,i+t),e(2146959360,n,i+r);else if(o>17976931348623157e292)e(0,n,i+t),e((a<<31|2146435072)>>>0,n,i+r);else{var s;if(o<22250738585072014e-324)e((s=o/5e-324)>>>0,n,i+t),e((a<<31|s/4294967296)>>>0,n,i+r);else{var c=Math.floor(Math.log(o)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=o*Math.pow(2,-c))>>>0,n,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,n,i+r)}}}function a(e,t,r,o,n){var i=e(o,n+t),a=e(o,n+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=a.bind(null,n,0,4),e.readDoubleBE=a.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},939:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function a(e,t){var r,o,a;return t?(a=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=c(e,e<0?-1:0,!1),a&&(n[e]=r),r)}function s(e,t){if(isNaN(e))return t?E:g;if(t){if(e<0)return E;if(e>=h)return R}else{if(e<=-f)return O;if(e+1>=f)return _}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,o){return new r(e,t,o)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return l(e.substring(1),t,r).neg();for(var n=s(u(r,8)),i=g,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(n)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),g=a(0);r.ZERO=g;var E=a(0,!0);r.UZERO=E;var y=a(1);r.ONE=y;var T=a(1,!0);r.UONE=T;var v=a(-1);r.NEG_ONE=v;var _=c(-1,2147483647,!1);r.MAX_VALUE=_;var R=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=R;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var I=r.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(n),l=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(e){return o(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(e){if(o(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(y)},I.neg=I.negate,I.add=function(e){o(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=n+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},I.subtract=function(e){return o(e)||(e=d(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(O))return e.isOdd()?O:g;if(e.eq(O))return this.isOdd()?O:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,E=0,y=0,T=0;return y+=(T+=a*h)>>>16,E+=(y+=i*h)>>>16,y&=65535,E+=(y+=a*p)>>>16,f+=(E+=n*h)>>>16,E&=65535,f+=(E+=i*p)>>>16,E&=65535,f+=(E+=a*l)>>>16,f+=r*h+n*p+i*l+a*u,c((y&=65535)<<16|(T&=65535),(f&=65535)<<16|(E&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(o(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?E:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return E;if(e.gt(this.shru(1)))return T;i=E}else{if(this.eq(O))return e.eq(y)||e.eq(v)?O:e.eq(O)?y:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?y:v:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(O))return this.unsigned?E:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(n);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=y),i=i.add(p),n=n.sub(h)}return i},I.div=I.divide,I.modulo=function(e){return o(e)||(e=d(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return c(~this.low,~this.high,this.unsigned)},I.and=function(e){return o(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return o(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return o(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},365:function(e,t,r){e.exports=n;var o=r(935);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new n(r,o)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if("string"==typeof e||e instanceof String){if(!o.Long)return n.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;n.fromHash=function(e){return e===a?i:new n((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},435:function(e,t,r){e.exports=a;var o,n,i=r(286);function a(e,t,r,o,a,s){if(i.call(this,e,t,o,void 0,void 0,a,s),!n.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}((a.prototype=Object.create(i.prototype)).constructor=a).className="MapField",a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=n.decorateType(r).name:r&&"object"==typeof r&&(r=n.decorateEnum(r).name),function(o,i){n.decorateType(o.constructor).add(new a(i,e,t,r))}},a._configure=function(){o=r(696),n=r(935)}},339:function(e,t,r){"use strict";var o;function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}e.exports=n,n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return arguments.length?1==arguments.length?this.$type.encode(arguments[0]):this.$type.encode(arguments[0],arguments[1]):this.$type.encode(this)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return e=e||this,this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)},n.set=function(e,t){n[e]=t},n.get=function(e){return n[e]},n._configure=function(){o=r(935)}},484:function(e,t,r){"use strict";e.exports=i;var o,n=r(998);function i(e,t,r,i,a,s,c,u){if(o.isObject(a)?(c=a,a=s=void 0):o.isObject(s)&&(c=s,s=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u}((i.prototype=Object.create(n.prototype)).constructor=i).className="Method",i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))},i._configure=function(){o=r(935)}},476:function(e,t,r){e.exports=l;var o,n,i,a,s,c=r(998);function u(e,t){if(e&&e.length){for(var r={},o=0;o<e.length;++o)r[e[o].name]=e[o].toJSON(t);return r}}function l(e,t){c.call(this,e,t),this.nested=void 0,this._nestedArray=null}function d(e){return e._nestedArray=null,e}((l.prototype=Object.create(c.prototype)).constructor=l).className="Namespace",l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=u,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>=t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),l.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),i=0;i<r.length;++i)t=e[r[i]],this.add((void 0!==t.fields?a.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?s.fromJSON:void 0!==t.id?n.fromJSON:l.fromJSON)(r[i],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof n&&void 0!==e.extend||e instanceof a||e instanceof o||e instanceof s||e instanceof l))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof a||t instanceof s)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,i=0;i<r.length;++i)e.add(r[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),d(this)},l.prototype.remove=function(e){if(!(e instanceof c))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),d(this)},l.prototype.define=function(e,t){if(i.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var o=e.shift();if(r.nested&&r.nested[o]){if(!((r=r.nested[o])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(o))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof l&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof l&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[a,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(){o=r(582),n=r(286),i=r(935),a=r(192),s=r(447)}},998:function(e,t,r){"use strict";var o,n;function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}e.exports=i,i.className="ReflectionObject",Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)this.setOption(r[o],e[r[o]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=r(685),o=r(935)}},735:function(e,t,r){e.exports=a;var o,n,i=r(998);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),i.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}((a.prototype=Object.create(i.prototype)).constructor=a).className="OneOf",a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){i.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){n.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:n.oneOfGetter(e),set:n.oneOfSetter(e)})}},a._configure=function(){o=r(286),n=r(935)}},845:function(e,t,r){"use strict";var o,n,i,a,s,c,u,l,d,p,h;e.exports=I,I.filename=null,I.defaults={keepCase:!1};var f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,E=/^-?0[x][0-9a-fA-F]+$/,y=/^0[0-7]+$/,T=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,_=/^[a-zA-Z_][a-zA-Z_0-9]*$/,R=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,O=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;function I(e,t,r){t instanceof n||(r=t,t=new n),r||(r=I.defaults);var S,C,A,N,M,b=o(e,r.alternateCommentMode||!1),U=b.next,w=b.push,P=b.peek,k=b.skip,L=b.cmnt,D=!0,G=!1,x=t,B=r.keepCase?function(e){return e}:h.camelCase;function j(e,t,r){var o=I.filename;return r||(I.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+b.line+")")}function H(){var e,t=[];do{if('"'!==(e=U())&&"'"!==e)throw j(e);t.push(U()),k(e),e=P()}while('"'===e||"'"===e);return t.join("")}function F(e){var t=U();switch(t){case"'":case'"':return w(t),H();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(y.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw j(e,"number",!0)}(t)}catch(r){if(e&&R.test(t))return t;throw j(t,"value")}}function W(e,t){var r,o;do{!t||'"'!==(r=P())&&"'"!==r?e.push([o=K(U()),k("to",!0)?K(U()):o]):e.push(H())}while(k(",",!0));k(";")}function K(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw j(e,"id");if(m.test(e))return parseInt(e,10);if(E.test(e))return parseInt(e,16);if(T.test(e))return parseInt(e,8);throw j(e,"id")}function q(){if(void 0!==S)throw j("package");if(S=U(),!R.test(S))throw j(S,"name");x=x.define(S),k(";")}function z(){var e,t=P();switch(t){case"weak":e=A||(A=[]),U();break;case"public":U();default:e=C||(C=[])}t=H(),k(";"),e.push(t)}function V(){if(k("="),N=H(),!(G="proto3"===N)&&"proto2"!==N)throw j(N,"syntax");k(";")}function J(e,t){switch(t){case"option":return Q(e,t),k(";"),!0;case"message":return function(e,t){if(!_.test(t=U()))throw j(t,"type name");var r=new i(t);X(r,(function(e){if(!J(r,e))switch(e){case"map":!function(e){k("<");var t=U();if(void 0===p.mapKey[t])throw j(t,"type");k(",");var r=U();if(!R.test(r))throw j(r,"type");k(">");var o=U();if(!_.test(o))throw j(o,"name");k("=");var n=new s(B(o),K(U()),t,r);X(n,(function(e){if("option"!==e)throw j(e);Q(n,e),k(";")}),(function(){ee(n)})),e.add(n)}(r);break;case"required":case"optional":case"repeated":Y(r,e);break;case"oneof":!function(e,t){if(!_.test(t=U()))throw j(t,"name");var r=new c(B(t));X(r,(function(e){"option"===e?(Q(r,e),k(";")):(w(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":W(r.extensions||(r.extensions=[]));break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:if(!G||!R.test(e))throw j(e);w(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!_.test(t=U()))throw j(t,"name");var r=new u(t);X(r,(function(e){switch(e){case"option":Q(r,e),k(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!_.test(t))throw j(t,"name");k("=");var r=K(U(),!0),o={};X(o,(function(e){if("option"!==e)throw j(e);Q(o,e),k(";")}),(function(){ee(o)})),e.add(t,r,o.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!_.test(t=U()))throw j(t,"service name");var r=new l(t);X(r,(function(e){if(!J(r,e)){if("rpc"!==e)throw j(e);!function(e,t){var r=t;if(!_.test(t=U()))throw j(t,"name");var o,n,i,a,s=t;if(k("("),k("stream",!0)&&(n=!0),!R.test(t=U()))throw j(t);if(o=t,k(")"),k("returns"),k("("),k("stream",!0)&&(a=!0),!R.test(t=U()))throw j(t);i=t,k(")");var c=new d(s,r,o,i,n,a);X(c,(function(e){if("option"!==e)throw j(e);Q(c,e),k(";")})),e.add(c)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!R.test(t=U()))throw j(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":case"optional":Y(e,t,r);break;default:if(!G||!R.test(t))throw j(t);w(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var o=b.line;if(e&&(e.comment=L(),e.filename=I.filename),k("{",!0)){for(var n;"}"!==(n=U());)t(n);k(";",!0)}else r&&r(),k(";"),e&&"string"!=typeof e.comment&&(e.comment=L(o))}function Y(e,t,r){var o=U();if("group"!==o){if(!R.test(o))throw j(o,"type");var n=U();if(!_.test(n))throw j(n,"name");n=B(n),k("=");var s=new a(n,K(U()),o,t,r);X(s,(function(e){if("option"!==e)throw j(e);Q(s,e),k(";")}),(function(){ee(s)})),e.add(s),G||!s.repeated||void 0===p.packed[o]&&void 0!==p.basic[o]||s.setOption("packed",!1,!0)}else!function(e,t){var r=U();if(!_.test(r))throw j(r,"name");var o=h.lcFirst(r);r===o&&(r=h.ucFirst(r)),k("=");var n=K(U()),s=new i(r);s.group=!0;var c=new a(o,n,r,t);c.filename=I.filename,X(s,(function(e){switch(e){case"option":Q(s,e),k(";");break;case"required":case"optional":case"repeated":Y(s,e);break;default:throw j(e)}})),e.add(s).add(c)}(e,t)}function Q(e,t){var r=k("(",!0);if(!R.test(t=U()))throw j(t,"name");var o=t;r&&(k(")"),o="("+o+")",t=P(),O.test(t)&&(o+=t,U())),k("="),$(e,o)}function $(e,t){if(k("{",!0))do{if(!_.test(M=U()))throw j(M,"name");"{"===P()?$(e,t+"."+M):(k(":"),"{"===P()?$(e,t+"."+M):Z(e,t+"."+M,F(!0)))}while(!k("}",!0));else Z(e,t,F(!0))}function Z(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(k("[",!0)){do{Q(e,"option")}while(k(",",!0));k("]")}return e}for(;null!==(M=U());)switch(M){case"package":if(!D)throw j(M);q();break;case"import":if(!D)throw j(M);z();break;case"syntax":if(!D)throw j(M);V();break;case"option":if(!D)throw j(M);Q(x,M),k(";");break;default:if(J(x,M)){D=!1;continue}throw j(M)}return I.filename=null,{package:S,imports:C,weakImports:A,syntax:N,root:t}}I._configure=function(){o=r(869),n=r(685),i=r(192),a=r(286),s=r(435),c=r(735),u=r(582),l=r(447),d=r(484),p=r(696),h=r(935)}},444:function(e){var t=e.exports,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),o=r(e),n="";o&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):o?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};t.resolve=function(e,t,n){return n||(t=o(t)),r(t)?t:(n||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},997:function(e){e.exports=function(e,t,r){var o=r||8192,n=o>>>1,i=null,a=o;return function(r){if(r<1||r>n)return e(r);a+r>o&&(i=e(o),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},494:function(e,t,r){e.exports=s;var o,n,i=r(935);function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function s(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array||Array.isArray(e)?new s(e):("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&console.warn(""),new s(new Uint8Array(e)))}:function(e){if(Array.isArray(e))return new s(e)};function l(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function p(){if(this.pos+8>this.len)throw a(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}s.create=i.Buffer?function(e){return(s.create=function(e){return i.Buffer.isBuffer(e)?new(void 0)(e):u(e)})(e)}:u,s.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,s.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return c}),s.prototype.int32=function(){return 0|this.uint32()},s.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},s.prototype.bool=function(){return 0!==this.uint32()},s.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},s.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},s.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},s.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},s.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},s.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},s.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},s.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},s._configure=function(){o=r(365),n=r(498);var e=i.Long?"toLong":"toNumber";i.merge(s.prototype,{int64:function(){return l.call(this)[e](!1)},uint64:function(){return l.call(this)[e](!0)},sint64:function(){return l.call(this).zzDecode()[e](!1)},fixed64:function(){return p.call(this)[e](!0)},sfixed64:function(){return p.call(this)[e](!1)}})}},685:function(e,t,r){e.exports=d;var o=r(476);((d.prototype=Object.create(o.prototype)).constructor=d).className="Root";var n,i,a,s=r(286),c=r(582),u=r(735),l=r(935);function d(e){o.call(this,"",e),this.deferred=[],this.files=[],this.names=[]}function p(){}d.fromJSON=function(e,t){return e="string"==typeof e?JSON.parse(e):e,t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.parseFromPbString=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return l.asPromise(e,n,t,r);var s=null;if("string"==typeof t)s=JSON.parse(t);else{if("object"!=typeof t)return void console.log("pb格式转化失败");s=t}function c(e,t){if(o){var r=o;o=null,r(e,t)}}function u(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var o,a=i(t,n,r),s=0;if(a.imports)for(;s<a.imports.length;++s)d(o=a.imports[s]);if(a.weakImports){for(s=0;s<a.weakImports.length;++s)o=a.weakImports[s];d(o)}}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}c(null,n)}function d(e){n.names.indexOf(e)>-1||(n.names.push(e),e in a&&u(e,a[e]))}u(s.name,s.pbJsonStr)},d.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return l.asPromise(e,n,t,r);var s=o===p;function c(e,t){if(o){var r=o;if(o=null,s)throw e;r(e,t)}}function u(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var o,a=i(t,n,r),u=0;if(a.imports)for(;u<a.imports.length;++u)(o=n.resolvePath(e,a.imports[u]))&&d(o);if(a.weakImports)for(u=0;u<a.weakImports.length;++u)(o=n.resolvePath(e,a.weakImports[u]))&&d(o,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}s||h||c(null,n)}function d(e,t){var r=e.lastIndexOf("google/protobuf/");if(r>-1){var i=e.substring(r);i in a&&(e=i)}if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in a)s?u(e,a[e]):(++h,setTimeout((function(){--h,u(e,a[e])})));else if(s){var d;try{d=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}u(e,d)}else++h,l.fetch(e,(function(r,i){--h,o&&(r?t?h||c(null,n):c(r):u(e,i))}))}var h=0;l.isString(t)&&(t=[t]);for(var f,m=0;m<t.length;++m)(f=n.resolvePath("",t[m]))&&d(f);if(s)return n;h||c(null,n)},d.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},d.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return o.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var o=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,r.add(o),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},d._configure=function(){n=r(192),i=r(845),a=r(72),s=r(286),c=r(582),u=r(735),l=r(935)}},889:function(e){e.exports={}},325:function(e,t,r){"use strict";e.exports=n;var o=r(935);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(o.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return o.asPromise(e,s,t,r,n,i);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof n))try{r=n[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},447:function(e,t,r){"use strict";e.exports=s;var o,n,i,a=r(476);function s(e,t){a.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}((s.prototype=Object.create(a.prototype)).constructor=s).className="Service",s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=a.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return n.toObject(["options",t&&t.options||void 0,"methods",a.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=n.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||a.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return a.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,c(this)):a.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return a.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var o,a=new i.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var c=n.lcFirst((o=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");a[c]=n.codegen(["r","c"],n.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return a},s._configure=function(){o=r(484),n=r(935),i=r(325)}},869:function(e){e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,a=/\n/g,s=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function d(e,c){e=e.toString();var u=0,d=e.length,p=1,h=null,f=null,m=0,g=!1,E=[],y=null;function T(e){return Error("illegal "+e+" (line "+p+")")}function v(t){return e.charAt(t)}function _(t,r){h=e.charAt(t++),m=p,g=!1;var o,s=t-(c?2:3);do{if(--s<0||"\n"===(o=e.charAt(s))){g=!0;break}}while(" "===o||"\t"===o);for(var u=e.substring(t,r).split(a),l=0;l<u.length;++l)u[l]=u[l].replace(c?i:n,"").trim();f=u.join("\n").trim()}function R(t){var r=O(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function O(e){for(var t=e;t<d&&"\n"!==v(t);)t++;return t}function I(){if(E.length>0)return E.shift();if(y)return function(){var t="'"===y?o:r;t.lastIndex=u-1;var n=t.exec(e);if(!n)throw T("string");return u=t.lastIndex,S(y),y=null,l(n[1])}();var n,i,a,h,f;do{if(u===d)return null;for(n=!1;s.test(a=v(u));)if("\n"===a&&++p,++u===d)return null;if("/"===v(u)){if(++u===d)throw T("comment");if("/"===v(u))if(c){if(h=u,f=!1,R(u)){f=!0;do{if((u=O(u))===d)break;u++}while(R(u))}else u=Math.min(d,O(u)+1);f&&_(h,u),p++,n=!0}else{for(f="/"===v(h=u+1);"\n"!==v(++u);)if(u===d)return null;++u,f&&_(h,u-1),++p,n=!0}else{if("*"!==(a=v(u)))return"/";h=u+1,f=c||"*"===v(h);do{if("\n"===a&&++p,++u===d)throw T("comment");i=a,a=v(u)}while("*"!==i||"/"!==a);++u,f&&_(h,u-2),n=!0}}}while(n);var m=u;if(t.lastIndex=0,!t.test(v(m++)))for(;m<d&&!t.test(v(m));)++m;var g=e.substring(u,u=m);return'"'!==g&&"'"!==g||(y=g),g}function S(e){E.push(e)}function C(){if(!E.length){var e=I();if(null===e)return null;S(e)}return E[0]}return Object.defineProperty({next:I,peek:C,push:S,skip:function(e,t){var r=C();if(r===e)return I(),!0;if(!t)throw T("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===p-1&&(c||"*"===h||g)&&(t=f):(m<e&&C(),m!==e||g||!c&&"/"!==h||(t=f)),t}},"line",{get:function(){return p}})}d.unescape=l},192:function(e,t,r){e.exports=y;var o,n,i,a,s,c,u,l,d,p,h,f,m,g,E=r(476);function y(e,t){E.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function T(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}((y.prototype=Object.create(E.prototype)).constructor=y).className="Type",Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=u.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=u.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this))},set:function(e){var t=e.prototype;t instanceof i||((e.prototype=new i).constructor=e,u.merge(e.prototype,t)),e.$type=e.prototype.$type=this,u.merge(e,i,!0),u.merge(e.prototype,i,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r){var n=this._oneofsArray[r].resolve().name,a=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=0;return{setter:function(r){if(!(e.indexOf(r)<0)){t[r]=1;for(var o=0;o<e.length;++o)e[o]!==r&&delete this[e[o]]}},getter:function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}}}(this._oneofsArray[r].oneof);o[n]={get:a.getter,set:a.setter}}r&&Object.defineProperties(e.prototype,o)}}}),y.generateConstructor=function(e){return function(t){for(var r,o=0;o<e.fieldsArray.length;o++)(r=e._fieldsArray[o]).map?this[r.name]={}:r.repeated&&(this[r.name]=[]);if(t)for(var n=Object.keys(t),i=0;i<n.length;++i)null!=t[n[i]]&&(this[n[i]]=t[n[i]])}},y.fromJSON=function(e,t){var r=new y(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var i=Object.keys(t.fields),s=0;s<i.length;++s)r.add((void 0!==t.fields[i[s]].keyType?g.fromJSON:n.fromJSON)(i[s],t.fields[i[s]]));if(t.oneofs)for(i=Object.keys(t.oneofs),s=0;s<i.length;++s)r.add(a.fromJSON(i[s],t.oneofs[i[s]]));if(t.nested)for(i=Object.keys(t.nested),s=0;s<i.length;++s){var c=t.nested[i[s]];r.add((void 0!==c.id?n.fromJSON:void 0!==c.fields?y.fromJSON:void 0!==c.values?o.fromJSON:void 0!==c.methods?h.fromJSON:E.fromJSON)(i[s],c))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},y.prototype.toJSON=function(e){var t=E.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return{options:t&&t.options||void 0,oneofs:E.arrayToJSON(this.oneofsArray,e),fields:E.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},extensions:this.extensions&&this.extensions.length?this.extensions:void 0,reserved:this.reserved&&this.reserved.length?this.reserved:void 0,group:this.group||void 0,nested:t&&t.nested||void 0,comment:r?this.comment:void 0}},y.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return E.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof n&&void 0===e.extend){if(this._fieldsById&&this._fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),T(this)}return e instanceof a?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),T(this)):E.prototype.add.call(this,e)},y.prototype.remove=function(e){if(e instanceof n&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),T(this)}if(e instanceof a){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),T(this)}return E.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return E.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return E.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:s,types:t,util:u}),this.decode=p(this)({Reader:c,types:t,util:u}),this.verify=l(this)({types:t,util:u}),this.fromObject=m.fromObject(this)({types:t,util:u}),this.toObject=m.toObject(this)({types:t,util:u});var o=f[e];if(o){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(n),n.toObject=this.toObject,this.toObject=o.toObject.bind(n)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof c||(e=c.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){u.decorateType(t,e)}},y._configure=function(){o=r(582),n=r(286),i=r(339),a=r(735),s=r(244),c=r(494),u=r(935),l=r(216),d=r(929),p=r(888),h=r(447),f=r(834),m=r(525),g=r(435)}},696:function(e,t,r){"use strict";var o=e.exports,n=r(935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,o={};for(t|=0;r<e.length;)o[i[r+t]]=e[r++];return o}o.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),o.long=a([0,0,0,1,1],7),o.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0]),o._configure=function(){n=r(935)}},498:function(e){"use strict";var t=e.exports;t.length=function(e){for(var t=0,r=0,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var o,n=null,i=[],a=0;t<r;)(o=e[t++])<128?i[a++]=o:o>191&&o<224?i[a++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(o>>10),i[a++]=56320+(1023&o)):i[a++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),a=0);return n?(a&&n.push(String.fromCharCode.apply(String,i.slice(0,a))),n.join("")):String.fromCharCode.apply(String,i.slice(0,a))},t.write=function(e,t,r){for(var o,n,i=r,a=0;a<e.length;++a)(o=e.charCodeAt(a))<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&56320==(64512&(n=e.charCodeAt(a+1)))?(o=65536+((1023&o)<<10)+(1023&n),++a,t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128);return r-i}},935:function(e,t,r){var o=e.exports,n=r(889);o.LongBits=r(365),o.Long=r(939),o.pool=r(997),o.float=r(283),o.asPromise=r(728),o.EventEmitter=r(969),o.path=r(444),o.base64=r(440),o.utf8=r(498),o.compareFieldsById=function(e,t){return e.id-t.id},o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),o=0;o<t.length;)r[o]=e[t[o++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var o=e[r++],n=e[r++];void 0!==n&&(t[o]=n)}return t},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.isObject=function(e){return e&&"object"==typeof e},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.merge=function(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)void 0!==e[o[n]]&&r||(e[o[n]]=t[o[n]]);return e},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;Type||(Type=r(192));var n=new Type(t||e.name);return o.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n},o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.copy=function(e){if("object"!=typeof e)return e;var t={};for(var r in e)t[r]=e[r];return t},o.deepCopy=function e(t){if("object"!=typeof t)return t;var r={};for(var o in t)r[o]=e(t[o]);return r},o.ProtocolError=function(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&merge(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o.Buffer=null,o.newBuffer=function(e){return"number"==typeof e?new o.Array(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.stringToBytes=function(e){var t,r,o=[];t=e.length;for(var n=0;n<t;n++)(r=e.charCodeAt(n))>=65536&&r<=1114111?(o.push(r>>18&7|240),o.push(r>>12&63|128),o.push(r>>6&63|128),o.push(63&r|128)):r>=2048&&r<=65535?(o.push(r>>12&15|224),o.push(r>>6&63|128),o.push(63&r|128)):r>=128&&r<=2047?(o.push(r>>6&31|192),o.push(63&r|128)):o.push(255&r);return o},o.byteToString=function(e){if("string"==typeof e)return e;for(var t="",r=e,o=0;o<r.length;o++){var n=r[o].toString(2),i=n.match(/^1+?(?=0)/);if(i&&8==n.length){for(var a=i[0].length,s=r[o].toString(2).slice(7-a),c=1;c<a;c++)s+=r[c+o].toString(2).slice(2);t+=String.fromCharCode(parseInt(s,2)),o+=a-1}else t+=String.fromCharCode(r[o])}return t},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Object.defineProperty(o,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(r(685)))}})},216:function(e,t,r){var o,n;function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,a){var s=a.types;if(e.resolvedType)if(e.resolvedType instanceof o){if(Object.keys(e.resolvedType.values).indexOf(r)<0)return i(e,"enum value")}else{var c=s[t].verify(r);if(c)return e.name+"."+c}else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.isInteger(r))return i(e,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(n.isInteger(r)||r&&n.isInteger(r.low)&&n.isInteger(r.high)))return i(e,"integer|Long");break;case"float":case"double":if("number"!=typeof r)return i(e,"number");break;case"bool":if("boolean"!=typeof r)return i(e,"boolean");break;case"string":if(!n.isString(r))return i(e,"string");break;case"bytes":if(!(r&&"number"==typeof r.length||n.isString(r)))return i(e,"buffer")}}function s(e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.key32Re.test(t))return i(e,"integer key");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!n.key64Re.test(t))return i(e,"integer|Long key");break;case"bool":if(!n.key2Re.test(t))return i(e,"boolean key")}}function c(e){return function(t){return function(r){var o;if("object"!=typeof r||null===r)return"object expected";var c,u={};e.oneofsArray.length&&(c={});for(var l=0;l<e.fieldsArray.length;++l){var d,p=e._fieldsArray[l].resolve(),h=r[p.name];if(!p.optional||null!=h&&r.hasOwnProperty(p.name))if(p.map){if(!n.isObject(h))return i(p,"object");var f=Object.keys(h);for(d=0;d<f.length;++d){if(o=s(p,f[d]))return o;if(o=a(p,l,h[f[d]],t))return o}}else if(p.repeated){if(!Array.isArray(h))return i(p,"array");for(d=0;d<h.length;++d)if(o=a(p,l,h[d],t))return o}else{if(p.partOf){var m=p.partOf.name;if(1===u[p.partOf.name]&&1===c[m])return p.partOf.name+": multiple values";c[m]=1}if(o=a(p,l,h,t))return o}}}}}e.exports=c,c._configure=function(){o=r(582),n=r(935)}},834:function(e,t,r){var o,n=t;n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=this.lookup(e["@type"]);if(t){var r="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return this.create({type_url:"/"+r,value:t.encode(t.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){if(t&&t.json&&e.type_url&&e.value){var r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=this.lookup(r);n&&(e=n.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var i=e.$type.toObject(e,t);return i["@type"]=e.$type.fullName,i}return this.toObject(e,t)}},n._configure=function(){o=r(339)}},244:function(e,t,r){e.exports=u;var o,n=r(935),i=r(498);function a(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function s(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function u(){this.len=0,this.head=new a(s,0,0),this.tail=this.head,this.states=null}function l(e,t,r){t[r]=255&e}function d(e,t){this.len=e,this.next=void 0,this.val=t}function p(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function h(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}u.create=n.Buffer?function(){return(u.create=function(){return new(void 0)})()}:function(){return new u},u.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(e,t,r){return this.tail=this.tail.next=new a(e,t,r),this.len+=t,this},d.prototype=Object.create(a.prototype),d.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},u.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new d((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},u.prototype.int32=function(e){return e<0?this._push(p,10,o.fromNumber(e)):this.uint32(e)},u.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},u.prototype.uint64=function(e){var t=o.from(e);return this._push(p,t.length(),t)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(p,t.length(),t)},u.prototype.bool=function(e){return this._push(l,1,e?1:0)},u.prototype.fixed32=function(e){return this._push(h,4,e>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(e){var t=o.from(e);return this._push(h,4,t.lo)._push(h,4,t.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},u.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var f=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var o=0;o<e.length;++o)t[r+o]=e[o]};u.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(l,1,0);if(n.isString(e)){var r=u.alloc(t=i.length(e));i.write(e,r,0),e=r}return this.uint32(t)._push(f,t,e)},u.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(l,1,0)},u.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new a(s,0,0),this.len=0,this},u.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new a(s,0,0),this.len=0),this},u.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},u.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},u._configure=function(){o=r(365),r(440),i=r(498)}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.amdO={},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){"use strict";r.r(o),r.d(o,{default:function(){return Ca}});var e={};r.r(e),r.d(e,{acceptContactInvite:function(){return Or},acceptInvitation:function(){return Rr},addContact:function(){return Tr},addReaction:function(){return kr},addToBlackList:function(){return Cr},addUsersToBlacklist:function(){return Ar},addUsersToBlocklist:function(){return Nr},declineContactInvite:function(){return Sr},declineInvitation:function(){return Ir},deleteContact:function(){return _r},deleteConversation:function(){return lr},deleteReaction:function(){return Lr},deleteSession:function(){return ur},fetchHistoryMessages:function(){return gr},fetchUserInfoById:function(){return hr},getAllContacts:function(){return zr},getBlacklist:function(){return tr},getBlocklist:function(){return rr},getContacts:function(){return nr},getContactsWithCursor:function(){return Vr},getConversationlist:function(){return cr},getHistoryMessages:function(){return yr},getReactionDetail:function(){return xr},getReactionList:function(){return Dr},getReactionlist:function(){return Gr},getRoster:function(){return or},getServerConversations:function(){return Hr},getServerPinnedConversations:function(){return Wr},getSessionList:function(){return sr},getTokenExpireTimestamp:function(){return mr},modifyMessage:function(){return Pr},pinConversation:function(){return Kr},recallMessage:function(){return wr},removeFromBlackList:function(){return Mr},removeHistoryMessages:function(){return jr},removeRoster:function(){return vr},removeUserFromBlackList:function(){return br},removeUserFromBlocklist:function(){return Ur},reportMessage:function(){return Br},setContactRemark:function(){return qr},updateCurrentUserNick:function(){return fr},updateOwnUserInfo:function(){return dr},updateUserInfo:function(){return pr},uploadPushToken:function(){return ar},uploadToken:function(){return ir}});var t={};r.r(t),r.d(t,{acceptGroupInvite:function(){return No},acceptGroupJoinRequest:function(){return Io},addUsersToGroupAllowlist:function(){return rn},addUsersToGroupWhitelist:function(){return tn},agreeInviteIntoGroup:function(){return Ao},agreeJoinGroup:function(){return Oo},blockGroup:function(){return $r},blockGroupMember:function(){return Wo},blockGroupMembers:function(){return qo},blockGroupMessages:function(){return Zr},changeGroupOwner:function(){return io},changeOwner:function(){return no},createGroup:function(){return Qr},createGroupNew:function(){return Yr},deleteGroupSharedFile:function(){return En},destroyGroup:function(){return Eo},disableSendGroupMsg:function(){return Zo},dissolveGroup:function(){return go},downloadGroupSharedFile:function(){return vn},enableSendGroupMsg:function(){return en},fetchGroupAnnouncement:function(){return fn},fetchGroupSharedFileList:function(){return yn},getGroup:function(){return ro},getGroupAdmin:function(){return lo},getGroupAllowlist:function(){return cn},getGroupBlacklist:function(){return Qo},getGroupBlacklistNew:function(){return Yo},getGroupBlocklist:function(){return $o},getGroupInfo:function(){return ao},getGroupMemberAttributes:function(){return Rn},getGroupMembersAttributes:function(){return On},getGroupMsgReadUser:function(){return hn},getGroupMuteList:function(){return jo},getGroupMutelist:function(){return Ho},getGroupSharedFilelist:function(){return Tn},getGroupWhitelist:function(){return sn},getJoinedGroups:function(){return oo},getMuted:function(){return Bo},getPublicGroups:function(){return to},groupBlockMulti:function(){return Ko},groupBlockSingle:function(){return Fo},inviteToGroup:function(){return vo},inviteUsersToGroup:function(){return _o},isGroupWhiteUser:function(){return un},isInGroupAllowlist:function(){return dn},isInGroupMutelist:function(){return pn},isInGroupWhiteList:function(){return ln},joinGroup:function(){return Ro},leaveGroup:function(){return To},listGroupMember:function(){return co},listGroupMembers:function(){return uo},listGroups:function(){return eo},modifyGroup:function(){return so},mute:function(){return Lo},muteGroupMember:function(){return Do},quitGroup:function(){return yo},rejectGroupInvite:function(){return bo},rejectGroupJoinRequest:function(){return Co},rejectInviteIntoGroup:function(){return Mo},rejectJoinGroup:function(){return So},removeAdmin:function(){return fo},removeGroupAdmin:function(){return mo},removeGroupAllowlistMember:function(){return an},removeGroupBlockMulti:function(){return Jo},removeGroupBlockSingle:function(){return zo},removeGroupMember:function(){return wo},removeGroupMembers:function(){return ko},removeGroupWhitelistMember:function(){return nn},removeMultiGroupMember:function(){return Po},removeMute:function(){return Go},removeSingleGroupMember:function(){return Uo},rmUsersFromGroupWhitelist:function(){return on},setAdmin:function(){return po},setGroupAdmin:function(){return ho},setGroupMemberAttributes:function(){return _n},unblockGroupMember:function(){return Vo},unblockGroupMembers:function(){return Xo},unmuteGroupMember:function(){return xo},updateGroupAnnouncement:function(){return mn},uploadGroupSharedFile:function(){return gn}});var n={};r.r(n),r.d(n,{addUsersToChatRoom:function(){return Pn},addUsersToChatRoomAllowlist:function(){return ci},addUsersToChatRoomWhitelist:function(){return si},blockChatRoomMember:function(){return Xn},blockChatRoomMembers:function(){return Qn},chatRoomBlockMulti:function(){return Yn},chatRoomBlockSingle:function(){return Jn},createChatRoom:function(){return Sn},deleteChatRoomSharedFile:function(){return vi},destroyChatRoom:function(){return Cn},disableSendChatRoomMsg:function(){return ii},enableSendChatRoomMsg:function(){return ai},fetchChatRoomAnnouncement:function(){return Ei},fetchChatRoomSharedFileList:function(){return _i},getChatRoomAdmin:function(){return Bn},getChatRoomAllowlist:function(){return hi},getChatRoomAttributes:function(){return Oi},getChatRoomBlacklist:function(){return oi},getChatRoomBlacklistNew:function(){return ri},getChatRoomBlocklist:function(){return ni},getChatRoomDetails:function(){return An},getChatRoomMuteList:function(){return zn},getChatRoomMuted:function(){return qn},getChatRoomMutelist:function(){return Vn},getChatRoomSharedFilelist:function(){return Ri},getChatRoomWhitelist:function(){return pi},getChatRooms:function(){return In},isChatRoomWhiteUser:function(){return fi},isInChatRoomAllowlist:function(){return mi},isInChatRoomMutelist:function(){return gi},joinChatRoom:function(){return kn},leaveChatRoom:function(){return Dn},listChatRoomMember:function(){return Gn},listChatRoomMembers:function(){return xn},modifyChatRoom:function(){return Nn},muteChatRoomMember:function(){return Fn},quitChatRoom:function(){return Ln},removeChatRoomAdmin:function(){return Hn},removeChatRoomAllowlistMember:function(){return di},removeChatRoomAttribute:function(){return Ai},removeChatRoomAttributes:function(){return Ci},removeChatRoomBlockMulti:function(){return ei},removeChatRoomBlockSingle:function(){return $n},removeChatRoomMember:function(){return bn},removeChatRoomMembers:function(){return wn},removeChatRoomWhitelistMember:function(){return li},removeMultiChatRoomMember:function(){return Un},removeMuteChatRoomMember:function(){return Wn},removeSingleChatRoomMember:function(){return Mn},rmUsersFromChatRoomWhitelist:function(){return ui},setChatRoomAdmin:function(){return jn},setChatRoomAttribute:function(){return Si},setChatRoomAttributes:function(){return Ii},unblockChatRoomMember:function(){return Zn},unblockChatRoomMembers:function(){return ti},unmuteChatRoomMember:function(){return Kn},updateChatRoomAnnouncement:function(){return yi},uploadChatRoomSharedFile:function(){return Ti}});var i={};r.r(i),r.d(i,{getPresenceStatus:function(){return Li},getSubscribedPresenceList:function(){return Pi},getSubscribedPresencelist:function(){return ki},publishPresence:function(){return bi},subscribePresence:function(){return Ui},unsubscribePresence:function(){return wi}});var a={};r.r(a),r.d(a,{clearRemindTypeForConversation:function(){return Bi},getPushPerformLanguage:function(){return Wi},getSilentModeForAll:function(){return Gi},getSilentModeForConversation:function(){return ji},getSilentModeForConversations:function(){return Hi},setPushPerformLanguage:function(){return Fi},setSilentModeForAll:function(){return Di},setSilentModeForConversation:function(){return xi}});var s={};r.r(s),r.d(s,{changeChatThreadName:function(){return Yi},createChatThread:function(){return zi},destroyChatThread:function(){return Xi},getChatThreadDetail:function(){return ra},getChatThreadLastMessage:function(){return ta},getChatThreadMembers:function(){return Qi},getChatThreads:function(){return ea},getJoinedChatThreads:function(){return Zi},joinChatThread:function(){return Vi},leaveChatThread:function(){return Ji},removeChatThreadMember:function(){return $i}});var c={};r.r(c),r.d(c,{getSupportedLanguages:function(){return oa},translateMessage:function(){return na}});var u={};function l(){u.converter._configure(),u.decoder._configure(),u.encoder._configure(),u.Field._configure(),u.MapField._configure(),u.Message._configure(),u.Namespace._configure(),u.Method._configure(),u.ReflectionObject._configure(),u.OneOf._configure(),u.parse._configure(),u.Reader._configure(),u.Root._configure(),u.Service._configure(),u.verifier._configure(),u.Type._configure(),u.types._configure(),u.wrappers._configure(),u.Writer._configure()}u.build="minimal",u.Writer=r(244),u.encoder=r(929),u.Reader=r(494),u.util=r(935),u.rpc=r(325),u.roots=r(889),u.verifier=r(216),u.tokenize=r(869),u.parse=r(845),u.common=r(72),u.ReflectionObject=r(998),u.Namespace=r(476),u.Root=r(685),u.Enum=r(582),u.Type=r(192),u.Field=r(286),u.OneOf=r(735),u.MapField=r(435),u.Service=r(447),u.Method=r(484),u.converter=r(525),u.decoder=r(888),u.Message=r(339),u.wrappers=r(834),u.types=r(696),u.util=r(935),u.configure=l,u.load=function(e,t,r){return"function"==typeof t?(r=t,t=new u.Root):t||(t=new u.Root),t.load(e,r)},u.loadSync=function(e,t){return t||(t=new u.Root),t.loadSync(e)},u.parseFromPbString=function(e,t,r){return"function"==typeof t?(r=t,t=new u.Root):t||(t=new u.Root),t.parseFromPbString(e,r)},l();var d,p=u,h=r(720),f=r.n(h),m=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();!function(e){e[e.REQUEST_SUCCESS=0]="REQUEST_SUCCESS",e[e.REQUEST_TIMEOUT=-1]="REQUEST_TIMEOUT",e[e.REQUEST_UNKNOWN=-2]="REQUEST_UNKNOWN",e[e.REQUEST_PARAMETER_ERROR=-3]="REQUEST_PARAMETER_ERROR",e[e.REQUEST_ABORT=-4]="REQUEST_ABORT",e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.MAX_LIMIT=50]="MAX_LIMIT",e[e.MESSAGE_NOT_FOUND=51]="MESSAGE_NOT_FOUND",e[e.NO_PERMISSION=52]="NO_PERMISSION",e[e.OPERATION_UNSUPPORTED=53]="OPERATION_UNSUPPORTED",e[e.OPERATION_NOT_ALLOWED=54]="OPERATION_NOT_ALLOWED",e[e.LOCAL_DB_OPERATION_FAILED=55]="LOCAL_DB_OPERATION_FAILED",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.PARSE_FILE_ERROR=203]="PARSE_FILE_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.MESSAGE_PARAMETER_ERROR=205]="MESSAGE_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.MESSAGE_MODERATION_BLOCKED=508]="MESSAGE_MODERATION_BLOCKED",e[e.MESSAGE_CURRENT_LIMITING=509]="MESSAGE_CURRENT_LIMITING",e[e.MESSAGE_WEBSOCKET_DISCONNECTED=510]="MESSAGE_WEBSOCKET_DISCONNECTED",e[e.MESSAGE_SIZE_LIMIT=511]="MESSAGE_SIZE_LIMIT",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.GROUP_MEMBERS_FULL=606]="GROUP_MEMBERS_FULL",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.GROUP_ALREADY_JOINED=601]="GROUP_ALREADY_JOINED",e[e.GROUP_MEMBERS_LIMIT=607]="GROUP_MEMBERS_LIMIT",e[e.GROUP_IS_DISABLED=608]="GROUP_IS_DISABLED",e[e.GROUP_MEMBER_ATTRIBUTES_SET_FAILED=609]="GROUP_MEMBER_ATTRIBUTES_SET_FAILED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_NOT_JOINED=702]="CHATROOM_NOT_JOINED",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.PRESENCE_PARAM_EXCEED=1100]="PRESENCE_PARAM_EXCEED",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_CREATING=1102]="REACTION_CREATING",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.TRANSLATION_NOT_VALID=1200]="TRANSLATION_NOT_VALID",e[e.TRANSLATION_TEXT_TOO_LONG=1201]="TRANSLATION_TEXT_TOO_LONG",e[e.TRANSLATION_FAILED=1204]="TRANSLATION_FAILED",e[e.THREAD_NOT_EXIST=1300]="THREAD_NOT_EXIST",e[e.THREAD_ALREADY_EXIST=1301]="THREAD_ALREADY_EXIST",e[e.MODIFY_MESSAGE_NOT_EXIST=1302]="MODIFY_MESSAGE_NOT_EXIST",e[e.MODIFY_MESSAGE_FORMAT_ERROR=1303]="MODIFY_MESSAGE_FORMAT_ERROR",e[e.MODIFY_MESSAGE_FAILED=1304]="MODIFY_MESSAGE_FAILED",e[e.CONVERSATION_NOT_EXIST=1400]="CONVERSATION_NOT_EXIST"}(d||(d={}));var g,E,y,T,v,_,R=function(){return R=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},R.apply(this,arguments)},O=function(e,t,r,o){var n,i,a,s,c,u,l,p,h,f,m,g,E,y,T,v,_,O,I,S,C,A,N,M=e.response;M&&"string"==typeof M&&(M=JSON.parse(M));var b=e.status,U={elapse:o,httpCode:b,errDesc:null==M?void 0:M.error_description};if(400===b){if(40002===M.error_code)return void t({type:d.THREAD_ALREADY_EXIST,message:null==M?void 0:M.error_description,extraInfo:U});if(40009===M.error_code)return void t({type:d.OPERATION_UNSUPPORTED,message:null==M?void 0:M.error_description,extraInfo:U});if(60005===M.error_code)return void t({type:d.GROUP_MEMBER_ATTRIBUTES_SET_FAILED,message:(null==M?void 0:M.desc)||(null==M?void 0:M.error_description),extraInfo:U});if(60010===M.error_code)return void((null==M?void 0:M.error_description.includes("exceeds chatgroup user metadata single value limit"))?t({type:d.MAX_LIMIT,message:(null==M?void 0:M.desc)||M.error_description,extraInfo:U}):t({type:d.NO_PERMISSION,message:(null==M?void 0:M.desc)||M.error_description,extraInfo:U}));if(60011===M.error_code)return void t({type:d.CHATROOM_NOT_JOINED,message:null==M?void 0:M.desc,extraInfo:U});if(60006===M.error_code||60007===M.error_code||60009===M.error_code||60012===M.error_code)return void t({type:d.MAX_LIMIT,message:(null==M?void 0:M.desc)||(null==M?void 0:M.error_description),extraInfo:U});if(null===(n=M.error_description)||void 0===n?void 0:n.includes("are not members of this group"))return(null===(i=e.responseURL)||void 0===i?void 0:i.includes("chatgroups"))?t({type:d.GROUP_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):t({type:d.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}),void r({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:U});if("the app not open presence"===(null==M?void 0:M.result))return void t({type:d.SERVICE_NOT_ENABLED,message:null==M?void 0:M.result,extraInfo:U});if(null==M?void 0:M.error_description.includes("remark length must less"))return void t({type:d.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:U});switch(null==M?void 0:M.error_description){case"the user is already operation this message":t({type:d.REACTION_ALREADY_ADDED,message:null==M?void 0:M.error_description,extraInfo:U});break;case"The quantity has exceeded the limit!":t({type:d.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:U});break;case"The user not in this group!":t({type:d.GROUP_NOT_JOINED,message:null==M?void 0:M.error_description,extraInfo:U});break;case"the user operation is illegal!":t({type:d.REACTION_OPERATION_IS_ILLEGAL,message:null==M?void 0:M.error_description,extraInfo:U});break;case"this appKey is not open reaction service!":case"this appKey not open message roaming":t({type:d.SERVICE_NOT_ENABLED,message:null==M?void 0:M.error_description,extraInfo:U});break;case"this message is creating reaction, please try again.":t({type:d.REACTION_CREATING,message:null==M?void 0:M.error_description,extraInfo:U});break;case"groupId can not be null!":t({type:d.GROUP_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:U});break;case"The input text is too long.":t({type:d.TRANSLATION_TEXT_TOO_LONG,message:null==M?void 0:M.error_description,extraInfo:U});break;case"The target language is not valid.":t({type:d.TRANSLATION_NOT_VALID,message:null==M?void 0:M.error_description,extraInfo:U});break;case"report failed, get message by id failed":t({type:d.MESSAGE_NOT_FOUND,message:null==M?void 0:M.error_description,extraInfo:U});break;case"ext is too big ":t({type:d.PRESENCE_PARAM_EXCEED,message:null==M?void 0:M.error_description,extraInfo:U});break;case"Request body not readable.Please check content type is correct!":t({type:d.REQUEST_PARAMETER_ERROR,message:null==M?void 0:M.error_description,extraInfo:U});break;case"updateRemark | they are not friends, please add as a friend first.":t({type:d.USER_NOT_FRIEND,message:null==M?void 0:M.error_description,extraInfo:U});break;default:t({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:U}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:null==M?void 0:M.error_description,data:e.responseText,extraInfo:U})}}else if(401===b)40001===M.error_code||60001===M.error_code||"Unable to authenticate (OAuth)"===M.error_description?t({type:d.NO_PERMISSION,message:null==M?void 0:M.error_description,extraInfo:U}):(r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:U}),t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:U}));else if(403===b)4e4===M.error_code||60004===M.error_code||15002===M.error_code?t({type:d.SERVICE_NOT_ENABLED,message:null==M?void 0:M.error_description,extraInfo:U}):40003===M.error_code||40004===M.error_code?t({type:d.THREAD_ALREADY_EXIST,message:null==M?void 0:M.error_description,extraInfo:U}):40005===M.error_code||40007===M.error_code||91002===M.error_code?t({type:d.MAX_LIMIT,message:null==M?void 0:M.error_description,extraInfo:U}):60002===M.error_code&&t({type:d.PERMISSION_DENIED,message:null==M?void 0:M.error_description,extraInfo:U}),"group member list is full!"===M.error_description?(null===(a=e.responseURL)||void 0===a?void 0:a.includes("chatgroups"))?t({type:d.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):t({type:d.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(s=M.error_description)||void 0===s?void 0:s.includes(M.error_description.includes("already in group")))?(null===(c=e.responseURL)||void 0===c?void 0:c.includes("chatgroups"))&&t({type:d.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(u=M.error_description)||void 0===u?void 0:u.includes("are not members of this group"))?(null===(l=e.responseURL)||void 0===l?void 0:l.includes("chatgroups"))?t({type:d.GROUP_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):t({type:d.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(p=M.error_description)||void 0===p?void 0:p.includes("service not open!"))||(null===(h=M.error_description)||void 0===h?void 0:h.includes("message report not open"))||(null===(f=M.error_description)||void 0===f?void 0:f.includes("messageroaming function not open"))?t({type:d.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(m=M.error_description)||void 0===m?void 0:m.includes("members size is greater than max user size !"))?t({type:d.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(g=M.error_description)||void 0===g?void 0:g.includes("can not operate this group, reason: group is disabled"))?t({type:d.GROUP_IS_DISABLED,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):(null===(E=M.error_description)||void 0===E?void 0:E.includes("Invitee's contact max count"))||(null===(y=M.error_description)||void 0===y?void 0:y.includes("Inviter's contact max count"))?t({type:d.MAX_LIMIT,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):t({type:d.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:R(R({},U),{errDesc:"permission denied"})}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:U});else if(404===b)40011===M.error_code?t({type:d.THREAD_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:U}):40012===M.error_code?t({type:d.NO_PERMISSION,message:null==M?void 0:M.error_description,extraInfo:U}):60003===M.error_code||20004===M.error_code?t({type:d.GROUP_NOT_JOINED,message:null==M?void 0:M.error_description,extraInfo:U}):91001===M.error_code&&t({type:d.CONVERSATION_NOT_EXIST,message:null==M?void 0:M.error_description,extraInfo:U}),(null===(T=M.error_description)||void 0===T?void 0:T.includes("do not find this group"))||(null===(v=M.error_description)||void 0===v?void 0:v.includes("does not exist"))?(null===(_=e.responseURL)||void 0===_?void 0:_.includes("chatgroups"))?t({type:d.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:R(R({},U),{errDesc:"The chat room dose not exist."})}):t({type:d.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:R(R({},U),{errDesc:"The chat room dose not exist."})}):(null===(O=M.error_description)||void 0===O?void 0:O.includes("username"))&&(null===(I=M.error_description)||void 0===I?void 0:I.includes("doesn't exist!'"))||(null===(S=M.error_description)||void 0===S?void 0:S.includes("user not found"))||(null===(C=M.error_description)||void 0===C?void 0:C.includes("Service resource not found"))&&"UserNotFoundException"===(null==M?void 0:M.exception)?t({type:d.USER_NOT_FOUND,data:e.response||e.responseText,message:M.error_description,extraInfo:U}):t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:U}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:U});else if(406===b)90004===M.error_code&&t({type:d.OPERATION_NOT_ALLOWED,message:null==M?void 0:M.error_description,extraInfo:U});else if(429===b||503===b){if(null===(A=M.error_description)||void 0===A?void 0:A.includes("The request has reached the maximum limit"))return void t({type:d.MAX_LIMIT,message:e.responseText,extraInfo:U});t({type:d.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:R(R({},U),{errDesc:"Server is busy."})}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:R(R({},U),{errDesc:"Server is busy."})})}else if(500===b){if(40006===M.error_code||40008===M.error_code||40010===M.error_code)return void t({type:d.SERVER_UNKNOWN_ERROR,message:null==M?void 0:M.error_description,extraInfo:U});if(90005===M.error_code||99999===M.error_code)return void t({type:d.REQUEST_UNKNOWN,message:null==M?void 0:M.error_description,extraInfo:U});if(null===(N=M.error_description)||void 0===N?void 0:N.includes("translte failed!"))return void t({type:d.TRANSLATION_FAILED,message:e.responseText,extraInfo:U});t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:U}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:U})}else t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:R(R({},U),{errDesc:"ajax error"})}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:R(R({},U),{errDesc:"ajax error"})})};!function(e){e[e.UNKNOWOPERATION=-1]="UNKNOWOPERATION",e[e.REST_GET_SESSION_LIST=1]="REST_GET_SESSION_LIST",e[e.REST_DEL_SESSION=2]="REST_DEL_SESSION",e[e.REST_GET_HISTORY_MESSAGE=3]="REST_GET_HISTORY_MESSAGE",e[e.REST_PIN_CONVERSATION=4]="REST_PIN_CONVERSATION",e[e.REST_OPERATE=100]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=101]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=102]="MSYNC_RECALLMESSAGE",e[e.MSYNC_MODIFYMESSAGE=103]="MSYNC_MODIFYMESSAGE",e[e.MSYNC_OPERATE=200]="MSYNC_OPERATE",e[e.ROSTER_ADD=201]="ROSTER_ADD",e[e.ROSTER_REMOVE=202]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=203]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=204]="ROSTER_DECLINE",e[e.ROSTER_BAN=205]="ROSTER_BAN",e[e.ROSTER_ALLOW=206]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=207]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=208]="ROSTER_CONTACTS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS=209]="ROSTER_GET_ALL_CONTACTS_REMARKS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE=210]="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e[e.ROSTER_SET_CONTACT_REMARK=211]="ROSTER_SET_CONTACT_REMARK",e[e.ROSTER_OPERATE=300]="ROSTER_OPERATE",e[e.USER_LOGIN=301]="USER_LOGIN",e[e.USER_CREATE=302]="USER_CREATE",e[e.USER_UPDATE_USERINFO=303]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=304]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=305]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=306]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_OPERATE=400]="USER_OPERATE",e[e.GROUP_CREATEGROUP=401]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=402]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=403]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=404]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=405]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=406]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=407]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=408]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=409]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=410]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=411]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=412]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=413]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=414]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=415]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=416]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=417]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=418]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=419]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=420]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=421]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=422]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=423]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=424]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=425]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=426]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=427]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=428]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=429]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=430]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=431]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=432]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=433]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=434]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=435]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=436]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=437]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=438]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=439]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=440]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=441]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=442]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_MEMBER_SET_META_DATA=443]="GROUP_MEMBER_SET_META_DATA",e[e.GROUP_MEMBER_FETCH_META_DATA=444]="GROUP_MEMBER_FETCH_META_DATA",e[e.GROUP_OPERATE=500]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=501]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=502]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=503]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=504]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=505]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=506]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=507]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=508]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=509]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=510]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=511]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=512]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=513]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=514]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=515]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=516]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=517]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=518]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=519]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=520]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=521]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=522]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=523]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=524]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=525]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=526]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=527]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=528]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=529]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=530]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=531]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=532]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=533]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_SET_META_DATA=534]="CHATROOM_SET_META_DATA",e[e.CHATROOM_DELETE_META_DATA=535]="CHATROOM_DELETE_META_DATA",e[e.CHATROOM_FETCH_META_DATA=536]="CHATROOM_FETCH_META_DATA",e[e.CHATROOM_OPERATE=600]="CHATROOM_OPERATE"}(g||(g={})),function(e){e.SDK_INTERNAL="SDK_INTERNAL",e.LOGIN="USER_LOGIN",e.REGISTER="USER_CREATE",e.GET_CHATROOM_LIST="CHATROOM_FETCH_CHATROOMSWITHPAGE",e.CREATE_CHATROOM="CHATROOM_CREATECHATROOM",e.DESTROY_CHATROOM="CHATROOM_DESTORYCHATROOM",e.GET_CHATROOM_DETAIL="CHATROOM_FETCH_SPECIFICATION",e.MODIFY_CHATROOM="CHATROOM_CHANGE_ATTRIBUTE",e.REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBER",e.MULTI_REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBERS",e.ADD_USERS_TO_CHATROOM="CHATROOM_ADD_MEMBERS",e.JOIN_CHATROOM="CHATROOM_JOINCAHTROOM",e.QUIT_CHATROOM="CHATROOM_LEAVECAHTROOM",e.LIST_CHATROOM_MEMBERS="CHATROOM_FETCH_MEMBERS",e.GET_CHATROOM_ADMIN="CHATROOM_GET_ADMIN",e.SET_CHATROOM_ADMIN="CHATROOM_SET_ADMIN",e.REMOVE_CHATROOM_ADMIN="CHATROOM_REMOVE_ADMIN",e.MUTE_CHATROOM_MEMBER="CHATROOM_MUTE_USER",e.REMOVE_MUTE_CHATROOM_MEMBER="CHATROOM_UNMUTE_USER",e.GET_MUTE_CHATROOM_MEMBERS="CHATROOM_FETCH_MUTES",e.SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USER",e.MULTI_SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USERS",e.REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USER",e.MULTI_REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USERS",e.GET_CHATROOM_BLOCK_MEMBERS="CHATROOM_FETCH_BANS",e.DISABLED_CHATROOM_SEND_MSG="CHATROOM_MUTE_ALLMEMEBERS",e.ENABLE_CHATROOM_SEND_MSG="CHATROOM_UNMUTE_ALLMEMEBERS",e.ADD_CHATROOM_WHITE_USERS="CHATROOM_ADD_WHITELIST",e.REMOVE_CHATROOM_WHITE_USERS="CHATROOM_REMOVE_WHITELIST",e.GET_CHATROOM_WHITE_USERS="CHATROOM_FETCH_WHITELIST",e.CHECK_CHATROOM_WHITE_USER="CHATROOM_FETCH_MEMBERIN_WHITELIST",e.GET_CHATROOM_ANN="CHATROOM_FETCH_ANNOUNCEMENT",e.UPDATE_CHATROOM_ANN="CHATROOM_UPDATE_ANNOUNCEMENT",e.DELETE_CHATROOM_FILE="CHATROOM_REMOVE_SHARE_FILE",e.GET_CHATROOM_FILES="CHATROOM_GET_SHARE_FILE_LIST",e.UPLOAD_CHATROOM_FILE="CHATROOM_UPLOAD_FILE",e.SET_CHATROOM_ATTR="CHATROOM_SET_META_DATA",e.DELETE_CHATROOM_ATTR="CHATROOM_DELETE_META_DATA",e.GET_CHATROOM_ATTR="CHATROOM_FETCH_META_DATA",e.CREATE_GROUP="GROUP_CREATEGROUP",e.BLOCK_GROUP="GROUP_BLOCK_MESSAGE",e.LIST_GROUP="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e.GET_USER_GROUP="GROUP_FETCH_USERS_GROUP",e.CHANGE_OWNER="GROUP_CHANGE_OWNER",e.GET_GROUP_INFO="GROUP_FETCH_SPECIFICATION",e.MODIFY_GROUP="GROUP_CHANGE_GROUPATTRIBUTE",e.LIST_GROUP_MEMBER="GROUP_FETCH_MEMEBERS",e.GET_GROUP_ADMIN="GROUP_GET_ADMIN",e.SET_GROUP_ADMIN="GROUP_SET_ADMIN",e.REMOVE_GROUP_ADMIN="GROUP_REMOVE_ADMIN",e.DISSOLVE_GROUP="GROUP_DESTOTYGROUP",e.QUIT_GROUP="GROUP_LEAVEGROUP",e.INVITE_TO_GROUP="GROUP_INVITE_TO_GROUP",e.JOIN_GROUP="GROUP_JOIN_PUBLICGROUP",e.AGREE_JOIN_GROUP="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e.REJECT_JOIN_GROUP="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e.AGREE_INVITE_GROUP="GROUP_ACCEPT_INVITATION",e.REJECT_INVITE_GROUP="GROUP_DECLINE_INVITATION",e.REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBER",e.MULTI_REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBERS",e.MUTE_GROUP_MEMBER="GROUP_MUTE_MEMBERS",e.UNMUTE_GROUP_MEMBER="GROUP_UNMUTE_MEMBERS",e.GET_GROUP_MUTE_LIST="GROUP_FETCH_MUTES",e.BLOCK_GROUP_MEMBER="GROUP_BLOCK_MEMBER",e.BLOCK_GROUP_MEMBERS="GROUP_BLOCK_MEMBERS",e.UNBLOCK_GROUP_MEMBER="GROUP_UNBLOCK_MEMBER",e.UNBLOCK_GROUP_MEMBERS="GROUP_UNBLOCK_MEMBERS",e.GET_GROUP_BLACK_LIST="GROUP_GET_BLOCK_LIST",e.DISABLED_SEND_GROUP_MSG="GROUP_MUTE_ALLMEMBERS",e.ENABLE_SEND_GROUP_MSG="GROUP_UNMUTE_ALLMEMBERS",e.ADD_USERS_TO_GROUP_WHITE="GROUP_ADD_WHITELIST",e.REMOVE_GROUP_WHITE_MEMBER="GROUP_REMOVE_WHITELIST",e.GET_GROUP_WHITE_LIST="GROUP_FETCH_WHITELIST",e.IS_IN_GROUP_WHITE_LIST="GROUP_IS_IN_WHITELIST",e.GET_GROUP_MSG_READ_USER="GROUP_GET_READ_USERS",e.GET_GROUP_ANN="GROUP_FETCH_ANNOUNCEMENT",e.UPDATE_GROUP_ANN="GROUP_UPDATE_ANNOUNCEMENT",e.UPLOAD_GROUP_FILE="GROUP_UPLOAD_SHAREDFILE",e.DELETE_GROUP_FILE="GROUP_DELETE_SHAREDFILE",e.GET_GROUP_FILE_LIST="GROUP_FETCH_SHAREDFILE",e.DOWN_GROUP_FILE="GROUP_DOWNLOAD_SHAREDFILE",e.SET_GROUP_MEMBER_ATTRS="GROUP_MEMBER_SET_META_DATA",e.GET_GROUP_MEMBER_ATTR="GROUP_MEMBER_FETCH_META_DATA",e.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_MESSAGE",e.PIN_CONVERSATION="REST_PIN_CONVERSATION",e.UPDATE_USER_INFO="USER_UPDATE_USERINFO",e.GET_USER_INFO="USER_FETCH_USERINFO",e.UPDATE_USER_NICK="USER_UPDATE_NICK",e.UPLOAD_PUSH_TOKEN="USER_UPLOAD_PUSH_TOKEN",e.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.ROSTER_GET_ALL_CONTACTS_REMARKS="ROSTER_GET_ALL_CONTACTS_REMARKS",e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e.ROSTER_SET_CONTACT_REMARK="ROSTER_SET_CONTACT_REMARK",e.ROSTER_ADD="ROSTER_ADD",e.ROSTER_REMOVE="ROSTER_REMOVE",e.ROSTER_ACCEPT="ROSTER_ACCEPT",e.ROSTER_DECLINE="ROSTER_DECLINE",e.ROSTER_BAN="ROSTER_BAN",e.ROSTER_ALLOW="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE",e.MODIFY_MESSAGE="MSYNC_MODIFYMESSAGE"}(E||(E={})),function(e){e.GET_DNS="REST_DNSLIST",e.LOGIN_BY_AGORA_TOKEN="LOGIN_BY_AGORA_TOKEN",e.LOGIN_BY_PWD="LOGIN_BY_PWD",e.RESISTER="REGISTER"}(y||(y={})),function(e){e[e["5G"]=7]="5G",e[e["4G"]=7]="4G",e[e["3G"]=7]="3G",e[e["2G"]=7]="2G",e[e["SLOW-2G"]=7]="SLOW-2G",e[e.WIFI=2]="WIFI",e[e.LAN=1]="LAN",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.NONE=0]="NONE",e[e.UNKNOWN=-1]="UNKNOWN",e[e["WEBIM UNABLE TO GET"]=-2]="WEBIM UNABLE TO GET"}(T||(T={})),function(e){e[e.success=200]="success",e[e.failed=500]="failed"}(v||(v={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(_||(_={}));var I=new Map,S=1e3,C=9675,A=-1;function N(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}var M,b="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),U=function(){},w={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(M||(M={}));var P=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=M,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory;var o=this._getPersistedLevel();null==o&&(o=null===t?"WARN":t),this.logs=[],this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(o,!1,"")}return e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=M[e]),void 0===e&&(e=0),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw Error("log.setLevel() called with invalid level: "+e);if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r),"undefined"==typeof console&&e<M.SILENT)throw Error("No console available for logging")},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),o=document.createElement("a");o.style.display="none",o.href=r,o.setAttribute("download","sdklog"),document.body.appendChild(o),o.click()}},e.prototype._bindMethod=function(e,t,r){var o=this,n=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof n.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=o.getTime();n.call.apply(n,function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}([e,"".concat(a," IM SDK [").concat("log"===t?"debug":t,"]: ")],r,!1)),o.onLog&&o.onLog({time:a,level:"log"===t?"debug":t,logs:r})};try{return Function.prototype.bind.call(n,e,"".concat(i," IM SDK [").concat("log"===t?"debug":t,"]: "))}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",o="";e.forEach((function(e){o+="object"==typeof e?JSON.stringify(e)+" ":e+" "})),this._cacheLogCall(r+o)},e.prototype._cacheLogCall=function(e){var t=k(e),r=this.logBytes+t,o=this.config.maxCache;if(!(t>=o)){if(r<o)this.logBytes+=t;else for(var n=r-o,i=0;i<n;){var a=this.logs.shift();void 0!==a&&(i+=k(a))}this.logs.push(e)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";"undefined"!=typeof window&&(window.localStorage&&(window.localStorage[this.storageLogLevelKey]=t),this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";"))},e.prototype.replaceLoggingMethods=function(e,t){for(var r=0;r<this.logMethods.length;r++){var o=this.logMethods[r];this[o]=r<e?U:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&b?N:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):U)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){return function(){"undefined"!=typeof console&&(this.replaceLoggingMethods.call(this,t,r),this[e].apply(this,arguments))}.bind(this)},e}();function k(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var L=new P;L.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");return this};var D="undefined"!=typeof window?window.log:void 0;L.noConflict=function(){return"undefined"!=typeof window&&window.log===L&&(window.log=D),L},L.getLoggers=function(){return w};var G=L,x=function(){return x=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},x.apply(this,arguments)},B=function(){};function j(e,t){var r,o=this;return V().platform===q.WEB?new Promise((function(t,o){var n=e.dataType||"text",i=e.success||B,a=e.error||B,s=new XMLHttpRequest;s.ontimeout=function(){o({type:d.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:s})},s.onerror=function(){o({type:d.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:s})},s.onabort=function(){o({type:d.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:s})},s.onreadystatechange=function(){if(4===s.readyState){var e=(new Date).getTime()-r,c=s.status||0,u={elapse:e,httpCode:c};if(200===c){$.ajaxUnconventionalErrorTimes=0;try{switch(n){case"text":return i(s.responseText),void t(s.responseText);case"json":var l=JSON.parse(s.responseText);return l.extraInfo=u,i(l),void t(l);case"xml":return s.responseXML&&s.responseXML.documentElement?(i(s.responseXML.documentElement),void t(s.responseXML.documentElement)):(a({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void o({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:a({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"Invalid dataType"}),o({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"Invalid dataType"})}return t(s.response||s.responseText),void i(s.response||s.responseText,s)}catch(e){o(e)}return}[400,401,403,404,429,500,503].includes(c)||(G.debug("rest api request fail status:",c),$.ajaxUnconventionalErrorTimes++),O(s,o,a,e)}0===s.readyState&&(a({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"Request not initialized"}),o({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText,message:"Request not initialized"}))},e.responseType&&s.responseType&&(s.responseType=e.responseType),e.mimeType&&s.overrideMimeType(e.mimeType);var c=e.type||"POST",u=e.data||null,l="";if("get"===c.toLowerCase()&&u){for(var p in u)u.hasOwnProperty(p)&&(l+=p+"="+u[p]+"&");l=l?l.slice(0,-1):l,e.url+=(e.url.indexOf("?")>0?"&":"?")+(l?l+"&":l)+"_v="+(new Date).getTime(),u=null,l=""}r=(new Date).getTime(),s.open(c,e.url);var h=e.headers||{};for(var f in h["Content-Type"]||(h["Content-Type"]="application/json"),h)h.hasOwnProperty(f)&&s.setRequestHeader(f,h[f]);s.send(u)})).then((function(r){return o.dataReport&&t&&t!==E.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:x({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},Q(r.extraInfo))}),t!==E.SDK_INTERNAL&&delete r.extraInfo,"Object"===H(r)?x(x({},r),{type:d.REQUEST_SUCCESS}):{data:r,type:d.REQUEST_SUCCESS}})).catch((function(r){throw o.dataReport&&t&&t!==E.SDK_INTERNAL&&o.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:x({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},Q(r.extraInfo))}),t!==E.SDK_INTERNAL&&delete r.extraInfo,r})):F.call(this,e,t)}function H(e){return Object.prototype.toString.call(e).slice(8,-1)}function F(e,t){var r=this;return new Promise((function(t,r){var o=e.success||B,n=e.error||B,i=e.type||"POST",a=e.data||null,s="",c=(new Date).getTime(),u=$.getEnvInfo();if("get"===i.toLowerCase()&&a){for(var l in a)a.hasOwnProperty(l)&&(s+=l+"="+a[l]+"&");s=s?s.slice(0,-1):s,e.url+=(e.url.indexOf("?")>0?"&":"?")+(s?s+"&":s)+"_v="+(new Date).getTime(),a=null,s=""}var d={url:e.url,data:e.data,method:i,headers:{},success:function(e){var i,a,s,u,l,d={elapse:(new Date).getTime()-c,httpCode:Number((null===(i=e.statusCode)||void 0===i?void 0:i.toString())||(null===(a=e.status)||void 0===a?void 0:a.toString())),errDesc:(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.error_description)||""};if("200"===(null===(u=e.statusCode)||void 0===u?void 0:u.toString())||"200"===(null===(l=e.status)||void 0===l?void 0:l.toString())){e.data.extraInfo=d;var p=e.data;o(p),t(p)}else e.extraInfo=d,n(p=e),r(p)},complete:function(){},fail:function(e){var t={elapse:(new Date).getTime()-c,httpCode:A,errDesc:"request:fail"};e.extraInfo=t,e.data={error:"request:fail",error_description:"request:fail"},n(e),r(e)}};if("zfb"===u.platform||"dd"===u.platform?d.headers=e.headers:d.header=e.headers,"dd"===u.platform)return dd.httpRequest(d);u.global.request(d)})).then((function(o){return r.dataReport&&t&&t!==E.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:x({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},Q(o.extraInfo))}),t!==E.SDK_INTERNAL&&delete o.extraInfo,"Object"===H(o)?x(x({},o),{type:d.REQUEST_SUCCESS}):{data:o,type:d.REQUEST_SUCCESS}})).catch((function(o){throw r.dataReport&&t&&t!==E.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:x({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},Q(o.extraInfo))}),t!==E.SDK_INTERNAL&&delete o.extraInfo,o}))}var W,K,q,z=(W=function(e,t){var r=V();if(r.platform!==q.WEB){var o=r.global,n=function(r){r.isConnected?e():t()};o.offNetworkStatusChange&&o.offNetworkStatusChange(n),o.onNetworkStatusChange&&o.onNetworkStatusChange(n)}else"undefined"!=typeof addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!W)return K;K=W.apply(void 0,e),W=null});function V(){return"undefined"!=typeof swan&&J(swan)?{platform:q.BAIDU,global:swan}:"undefined"!=typeof tt&&J(tt)?{platform:q.TT,global:tt}:"undefined"!=typeof dd&&J(dd)?{platform:q.DD,global:dd}:"undefined"!=typeof my&&J(my)?{platform:q.ZFB,global:my}:"undefined"!=typeof wx&&J(wx)?{platform:q.WX,global:wx}:"undefined"!=typeof uni&&J(uni)?{platform:q.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:q.WEB,global:window}:{platform:q.NODE,global:r.g||{}}}function J(e){for(var t=["canIUse","getSystemInfo"],r=0,o=t.length;r<o;r++)if(!e[t[r]])return!1;return!0}function X(e,t){var r,o,n,i,a=this,s=(new Date).getTime(),c=e.accessToken;if(c){var u=e.appKey,l=[],p="",h="";if(u&&(p=(l=u.split("#"))[0],h=l[1]),p||h){var f=e.apiUrl,m=e.uploadUrl||f+"/"+p+"/"+h+"/chatfiles";if((null===(o=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===o?void 0:o.size)<=0)e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var g=new XMLHttpRequest;g.upload&&(null===(i=(n=g.upload).addEventListener)||void 0===i||i.call(n,"progress",e.onFileUploadProgress||B,!1)),g.addEventListener("abort",e.onFileUploadCanceled||B,!1),g.addEventListener("error",(function(e){T({type:d.WEBIM_UPLOADFILE_ERROR,data:g})}),!1),g.addEventListener("load",(function(r){try{var o=JSON.parse(g.responseText);if(400===g.status)return T({type:d.WEBIM_UPLOADFILE_ERROR,data:o}),!1;try{!function(r){var o=(new Date).getTime()-s;a.dataReport&&t&&[E.UPLOAD_MSG_ATTACH,E.UPLOAD_CHATROOM_FILE,E.UPLOAD_GROUP_FILE].includes(t)&&a.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:(null==r?void 0:r.error)?0:1,requestMethod:"POST",requestName:t,requestElapse:o,requestUrl:m,code:g.status,codeDesc:(null==r?void 0:r.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(r)}(o)}catch(r){T({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:r})}}catch(r){T({type:d.WEBIM_UPLOADFILE_ERROR,data:g.responseText})}}),!1),g.open("POST",m),g.setRequestHeader("restrict-access","true"),g.setRequestHeader("Accept","*/*"),g.setRequestHeader("Authorization","Bearer "+c);var y=new FormData;y.append("file",e.file.data),e.thumbnailWidth&&y.append("thumbnail-width",e.thumbnailWidth+""),e.thumbnailHeight&&y.append("thumbnail-height",e.thumbnailHeight+""),g.send(y)}}else e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"});function T(r){var o=(new Date).getTime()-s;a.dataReport&&t&&[E.UPLOAD_MSG_ATTACH,E.UPLOAD_CHATROOM_FILE,E.UPLOAD_GROUP_FILE].includes(t)&&a.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:t,requestElapse:o,requestUrl:m,code:(null==g?void 0:g.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(r)}}function Y(e,t){e.onFileDownloadComplete=e.onFileDownloadComplete||B,e.onFileDownloadError=e.onFileDownloadError||B;var r=(new Date).getTime(),o=new XMLHttpRequest,n=this;o.addEventListener("load",(function(i){var a=(new Date).getTime()-r;n.dataReport&&t&&t===E.DOWN_GROUP_FILE&&n.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:200===o.status?1:0,requestMethod:"POST",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:o.status,codeDesc:200===o.status?"":"download file error"}}),e.onFileDownloadComplete&&e.onFileDownloadComplete(o.response)}),!1),o.addEventListener("error",(function(i){var a=(new Date).getTime()-r;n.dataReport&&t&&t===E.DOWN_GROUP_FILE&&n.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:(null==o?void 0:o.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:d.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}),!1);var i=e.method||"GET",a=e.responseType||"blob",s=e.mimeType||"text/plain; charset=x-user-defined";o.open(i,e.url),"undefined"!=typeof Blob?o.responseType=a:o.overrideMimeType(s);var c={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+this.context.accessToken},u=e.headers||{};for(var l in u)c[l]=u[l];for(var l in c)c[l]&&o.setRequestHeader(l,c[l]);o.send(null)}function Q(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,o=e.httpCode,n=void 0===o?0:o,i=e.errDesc;return{requestElapse:r,code:n,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(q||(q={}));var $={autoIncrement:0,ajaxUnconventionalErrorTimes:0,ajax:j,getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:{}},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var o=r.files;if(o.length>0){var n=o.item(0);t.data=n,t.url=window.URL.createObjectURL(n),t.filename=(null==n?void 0:n.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");n=document.getElementById(e).value,t.url=n;var i=n.lastIndexOf("/"),a=n.lastIndexOf("\\"),s=Math.max(i,a);t.filename=s<0?n:n.substring(s+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t},uploadFile:X,flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];for(var n=0,i=t?e[n].apply(this,r):r[0];++n<t;)i=e[n].call(this,i);return i}},listenNetwork:z,getEnvInfo:V,wxRequest:F,parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:Y,parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:Q,Uint8ArrayToString:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}},Z=r(188),ee=r.n(Z),te=function(){return te=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},te.apply(this,arguments)};function re(e){var t,r,o,n=e.id,i=e.payload,a=e.timestamp,s=e.to,c=i.bodies&&i.bodies.length>0?i.bodies[0]:{},u={},l={},d=i.type?i.type:s.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";switch(d="chat"===d?"singleChat":d,c.type){case"txt":var p=null===(t=null==i?void 0:i.meta)||void 0===t?void 0:t.edit_msg;if(u={id:n,type:"txt",chatType:d,msg:c.msg||"",to:i.to||"",from:i.from,time:a,ext:i.ext},p){var h=p.edit_time,f=p.operator,m=p.count;u.modifiedInfo={operationTime:h,operatorId:f,operationCount:m}}break;case"img":u={id:n,type:"img",chatType:d,to:i.to,from:i.from,time:a,ext:i.ext,width:(null===(r=c.size)||void 0===r?void 0:r.width)||0,height:(null===(o=c.size)||void 0===o?void 0:o.height)||0,secret:c.secret||"",url:(null==c?void 0:c.url)||"",file_length:c.file_length||0,file:{}};break;case"video":u={id:n,type:"video",chatType:d,from:i.from,to:i.to,url:(null==c?void 0:c.url)||"",secret:c.secret||"",filename:c.filename,length:c.length||0,file:{},file_length:c.file_length||0,filetype:i.ext.file_type||"",ext:i.ext,time:a};break;case"loc":u={id:n,type:"loc",chatType:d,from:i.from,to:i.to,buildingName:c.buildingName||"",addr:c.addr,lat:c.lat,lng:c.lng,ext:i.ext,time:a};break;case"audio":u={id:n,type:"audio",chatType:d,from:i.from,to:i.to,secret:c.secret||"",ext:i.ext,time:a,url:(null==c?void 0:c.url)||"",file:{},filename:c.filename,length:c.length||0,file_length:c.file_length||0,filetype:i.ext.file_type||""};break;case"file":u={id:n,type:"file",chatType:d,from:i.from,to:i.to,ext:i.ext,time:a,url:(null==c?void 0:c.url)||"",secret:c.secret||"",file:{},filename:c.filename||"",file_length:c.file_length||0,filetype:i.ext.file_type||""};break;case"cmd":u={id:n,type:"cmd",chatType:d,from:i.from,to:i.to,ext:i.ext,time:a,action:c.action||""};break;case"custom":u={id:n,type:"custom",chatType:d,from:i.from,to:i.to,ext:i.ext,time:a,customEvent:c.customEvent||"",customExts:c.customExts||""};break;case"combine":u={id:n,type:"combine",chatType:d,msg:c.msg||"",to:i.to||"",from:i.from,time:a,ext:i.ext,title:c.title||"",summary:c.summary||"",url:(null==c?void 0:c.url)||"",compatibleText:c.text,combineLevel:c.combineLevel||0,secret:c.secret||"",filename:c.filename||"",file_length:c.file_length||0};break;default:G.error("unexpected message: ".concat(e))}if(i.msgConfig&&(l.msgConfig=i.msgConfig),null==i?void 0:i.meta){var g=i.meta;g.thread&&(l.chatThread={messageId:g.thread.msg_parent_id,parentId:g.thread.muc_parent_id,chatThreadName:g.thread.thread_name}),g.reaction&&(l.reactions=g.reaction),g.translations&&(l.translations=g.translations)}return te(te({},u),l)}var oe,ne=function(e){return"".concat(e.conversationType,"-").concat(e.conversationId)},ie=function(e){var t=e.isRecallSelfMsg,r=e.conversation,o=e.recalledMsgTime,n=r.unReadCount,i=void 0===n?0:n,a=r.unreadCountClearTimestamp;return t||(void 0===a?0:a)>o?i:i&&i>0?i-1:0},ae=function(e){var t,r=0;if(0===e.length)return r;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r},se=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||"",chatType:e.chatType}},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),ce=function(){function e(e){this.id=e.id,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e.create=function(e){return{id:$.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),ue=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from||"",time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),le=function(){function e(e){var t=e.type,r=e.id||$.getUniqueId();this.id=r,this.type=t,this.value=""}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),isChatThread:e.isChatThread},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){var t,r;return(null===(t=e.msgConfig)||void 0===t?void 0:t.languages)&&Array.isArray(null===(r=e.msgConfig)||void 0===r?void 0:r.languages),{type:"txt",id:$.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),de=function(){function e(e){var t=e.type,r=e.id;this.id=r||$.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),ext:e.ext,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),pe=function(){function e(e){var t=e.type,r=e.id||$.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),he=function(){function e(e){var t=e.type,r=e.id;this.id=r||$.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),fe=function(){function e(e){var t=e.type,r=e.id||$.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&$.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,thumbnailWidth:e.thumbnailWidth,thumbnailHeight:e.thumbnailHeight}},e}(),me=function(){function e(e){var t=e.type,r=e.id||$.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&$.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),ge=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&$.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),Ee=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&$.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,isChatThread:e.isChatThread}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:$.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,file_length:e.file_length,to:e.to,from:e.from||"",ext:e.ext,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList}},e}(),ye=function(){function e(e){var t=e.type,r=e.id||$.getUniqueId();this.id=r,this.type=t,this.value=""}return e.create=function(e){return{type:"combine",id:$.getUniqueId(),to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,compatibleText:e.compatibleText,title:e.title,summary:e.summary,messageList:e.messageList,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete}},e}(),Te=function(){function e(t,r){return this.type=t,this.id=r||$.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new se({type:"read",id:e.id});case"delivery":return new ce({type:"delivery",id:e.id});case"channel":return new ue({type:"channel",id:e.id});case"txt":return new le({type:"txt",id:e.id});case"cmd":return new de({type:"cmd",id:e.id});case"custom":return new pe({type:"custom",id:e.id});case"loc":return new he({type:"loc",id:e.id});case"img":return new fe({type:"img",id:e.id});case"audio":return new me({type:"audio",id:e.id});case"video":return new ge({type:"video",id:e.id});case"file":return new Ee({type:"file",id:e.id})}},e.create=function(e){return"txt"!==(t=e).type||"version"in t?function(e){return"img"===e.type&&!("version"in e)}(e)?fe.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?de.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?Ee.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?me.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?ge.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?pe.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?he.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?ue.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?ce.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?se.create(e):function(e){return"combine"===e.type&&!("version"in e)}(e)?ye.create(e):{}:le.create(e);var t},e.prototype.set=function(e){},e}();!function(e){e[e.CREATE=0]="CREATE",e[e.FAIL=1]="FAIL",e[e.INPROGRESS=2]="INPROGRESS",e[e.SUCCESS=3]="SUCCESS"}(oe||(oe={}));var ve=function(){return ve=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ve.apply(this,arguments)},_e=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},Re=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Oe={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM",8:"COMBINE"};function Ie(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var o=e[r].varintValue,n=new(f())(o.low,o.high,o.unsigned).toString();t[e[r].key]=0!==Number(n)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(o=e[r].varintValue,n=new(f())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}function Se(e){var t,r,o,n,i,a,s,c,u,l,d,p,h,f,m,g,E,y,T,v,_,R,O,I,S,C,A;return _e(this,void 0,void 0,(function(){var N,M,b,U,w,P,k,L,D,x,B,j,H,F,W,K,q,z,V,J,X,Y,Q,$,Z,ee,te,ne,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,Ee,ye,Te,ve,_e,Se,Ce,Ae,Ne,Me;return Re(this,(function(Re){switch(Re.label){case 0:switch(N=e.status,M=e.thirdMessage,b=e.msgBody,U=e.msgId,w=e.type,P=e.from,k=e.to,L=e.time,D=e.onlineState,x=e.chatType,B=e.ignoreCallback,j=e.priority,H=e.format,F=e.broadcast,W=void 0!==F&&F,K={},q={},z=N.errorCode>0,V=N.errorCode,J=N.reason,X={},Y=[],Q=[],$={},Z="",ee=0,te=null,ne=null,M.ext&&(X=Ie(M.ext)),M.meta&&"string"==typeof M.meta&&((ae=JSON.parse(M.meta)).reaction&&(Y=ae.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),ae.translations&&(Q=ae.translations),ae.edit_msg&&(se=ae.edit_msg,ce=se.count,ue=se.operator,le=se.edit_time,de=se.sender,pe=se.send_time,$={operationTime:le,operatorId:ue,operationCount:ce},Z=de,ee=pe),ae.thread&&"{}"!==JSON.stringify(ae.thread)&&(te={messageId:ae.thread.msg_parent_id,parentId:ae.thread.muc_parent_id,chatThreadName:ae.thread.thread_name}),ae.thread_overview&&"{}"!==JSON.stringify(ae.thread_overview)&&(ne={id:ae.thread_overview.id,parentId:ae.thread_overview.muc_parent_id,name:ae.thread_overview.name,lastMessage:ae.thread_overview.last_message&&"{}"!==JSON.stringify(ae.thread_overview.last_message)?re(ae.thread_overview.last_message):null,createTimestamp:ae.thread_overview.create_timestamp,updateTimestamp:ae.thread_overview.update_timestamp,messageCount:ae.thread_overview.message_count||0})),b.type){case 0:return[3,1];case 1:return[3,7];case 2:return[3,10];case 3:return[3,13];case 4:return[3,16];case 5:return[3,19];case 6:return[3,22];case 7:return[3,23];case 8:return[3,26]}return[3,27];case 1:return Object.prototype.hasOwnProperty.call(b,"subType")&&0===b.subType?(ie=(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),he={id:U,type:"combine",chatType:x,to:k,from:P,ext:X,time:Number(L),onlineState:D,title:b.title||"",summary:b.summary||"",url:ie||"",secret:b.secretKey||"",file_length:b.fileLength||0,filename:b.displayName||"",compatibleText:b.text,combineLevel:b.combineLevel||0},K.msgConfig&&(he.msgConfig=K.msgConfig),Y.length>0&&(he.reactions=Y),te&&(he.chatThread=te),ne&&(he.chatThreadOverview=ne),"chatRoom"===x&&(he.priority=j,he.broadcast=W),q=he,B?[3,3]:[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(he,oe.SUCCESS)]):[3,4];case 2:Re.sent(),null===(o=this.eventHandler)||void 0===o||o.dispatch("onCombineMessage",he),Re.label=3;case 3:return[3,28];case 4:return!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,data:b.text,ext:X,sourceMsg:b.text,time:L,msgConfig:M.msgConfig,onlineState:D}).msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onTextMessage&&this.onTextMessage(K),fe={id:U,type:"txt",chatType:x,msg:b.text,to:k,from:P,ext:X,time:Number(L),onlineState:D},K.msgConfig&&(fe.msgConfig=K.msgConfig),Y.length>0&&(fe.reactions=Y),te&&(fe.chatThread=te),ne&&(fe.chatThreadOverview=ne),Q.length>0&&(fe.translations=Q),$.operationCount>0&&(fe.modifiedInfo=$,M.type===Be.EDIT&&(fe.from=Z,fe.time=ee)),"chatRoom"===x&&(fe.priority=j,fe.broadcast=W),q=fe,B?[3,6]:[4,null===(i=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===i?void 0:i.storeMessage(fe,oe.SUCCESS)];case 5:Re.sent(),null===(a=this.eventHandler)||void 0===a||a.dispatch("onTextMessage",fe),Re.label=6;case 6:return[3,28];case 7:return me=(null===(s=null==b?void 0:b.size)||void 0===s?void 0:s.width)||0,ge=(null===(c=null==b?void 0:b.size)||void 0===c?void 0:c.height)||0,ie=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,url:ie,secret:b.secretKey,filename:b.displayName,thumb:this.useOwnUploadFun?"":"".concat(ie,"&thumbnail=true"),thumb_secret:b.secretKey,file_length:b.fileLength||"",width:me,height:ge,filetype:b.filetype||"",accessToken:this.token,ext:X,time:L,msgConfig:M.msgConfig,onlineState:D}).delay&&delete K.delay,!K.msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onPictureMessage&&this.onPictureMessage(K),Ee={id:U,type:"img",chatType:x,from:P,to:k,url:ie||"",width:me,height:ge,secret:b.secretKey||"",thumb:this.useOwnUploadFun?"":"".concat(ie,"&thumbnail=true"),thumb_secret:b.secretKey,file_length:b.fileLength||0,ext:X,time:Number(L),onlineState:D},K.msgConfig&&(Ee.msgConfig=K.msgConfig),Y.length>0&&(Ee.reactions=Y),te&&(Ee.chatThread=te),ne&&(Ee.chatThreadOverview=ne),"chatRoom"===x&&(Ee.priority=j,Ee.broadcast=W),q=Ee,B?[3,9]:[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.storeMessage(Ee,oe.SUCCESS)];case 8:Re.sent(),null===(d=this.eventHandler)||void 0===d||d.dispatch("onImageMessage",Ee),Re.label=9;case 9:return[3,28];case 10:return ie=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,url:ie,secret:b.secretKey,filename:b.displayName,length:b.duration||"",file_length:b.fileLength||"",filetype:b.filetype||"",accessToken:this.token||"",ext:X,time:L,msgConfig:M.msgConfig,onlineState:D}).delay&&delete K.delay,!K.msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onVideoMessage&&this.onVideoMessage(K),ye={id:U,type:"video",chatType:x,from:P,to:k,url:ie,secret:b.secretKey,filename:b.displayName,length:b.duration||0,file:{},file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:X,time:Number(L),onlineState:D},K.msgConfig&&(ye.msgConfig=K.msgConfig),Y.length>0&&(ye.reactions=Y),te&&(ye.chatThread=te),ne&&(ye.chatThreadOverview=ne),"chatRoom"===x&&(ye.priority=j,ye.broadcast=W),q=ye,B?[3,12]:[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.storeMessage(ye,oe.SUCCESS)];case 11:Re.sent(),null===(f=this.eventHandler)||void 0===f||f.dispatch("onVideoMessage",ye),Re.label=12;case 12:return[3,28];case 13:return!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,addr:b.address,buildingName:b.buildingName,lat:b.latitude,lng:b.longitude,ext:X,time:L,msgConfig:M.msgConfig,onlineState:D}).delay&&delete K.delay,!K.msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onLocationMessage&&this.onLocationMessage(K),Te={id:U,type:"loc",chatType:x,from:P,to:k,buildingName:b.buildingName,addr:b.address,lat:b.latitude,lng:b.longitude,ext:X,time:Number(L),onlineState:D},K.msgConfig&&(Te.msgConfig=K.msgConfig),Y.length>0&&(Te.reactions=Y),te&&(Te.chatThread=te),ne&&(Te.chatThreadOverview=ne),"chatRoom"===x&&(Te.priority=j,Te.broadcast=W),q=Te,B?[3,15]:[4,null===(g=null===(m=this._localCache)||void 0===m?void 0:m.getInstance())||void 0===g?void 0:g.storeMessage(Te,oe.SUCCESS)];case 14:Re.sent(),null===(E=this.eventHandler)||void 0===E||E.dispatch("onLocationMessage",Te),Re.label=15;case 15:return[3,28];case 16:return ie=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,url:ie,secret:b.secretKey,filename:b.displayName,file_length:b.fileLength||"",accessToken:this.token||"",ext:X,length:b.duration,time:L,msgConfig:M.msgConfig,onlineState:D}).delay&&delete K.delay,!K.msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onAudioMessage&&this.onAudioMessage(K),ve={id:U,type:"audio",chatType:x,from:P,to:k,url:ie,secret:b.secretKey,file:{},filename:b.displayName,length:b.duration||0,file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:X,time:Number(L),onlineState:D},K.msgConfig&&(ve.msgConfig=K.msgConfig),Y.length>0&&(ve.reactions=Y),te&&(ve.chatThread=te),ne&&(ve.chatThreadOverview=ne),"chatRoom"===x&&(ve.priority=j,ve.broadcast=W),q=ve,B?[3,18]:[4,null===(T=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===T?void 0:T.storeMessage(ve,oe.SUCCESS)];case 17:Re.sent(),null===(v=this.eventHandler)||void 0===v||v.dispatch("onAudioMessage",ve),Re.label=18;case 18:return[3,28];case 19:return ie=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,url:ie,secret:b.secretKey,filename:b.displayName,file_length:b.fileLength,accessToken:this.token||"",ext:X,time:L,msgConfig:M.msgConfig,onlineState:D}).delay&&delete K.delay,!K.msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onFileMessage&&this.onFileMessage(K),_e={id:U,type:"file",chatType:x,from:P,to:k,url:ie,secret:b.secretKey,file:{},filename:b.displayName,length:b.duration||0,file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:X,time:Number(L),onlineState:D},K.msgConfig&&(_e.msgConfig=K.msgConfig),Y.length>0&&(_e.reactions=Y),te&&(_e.chatThread=te),ne&&(_e.chatThreadOverview=ne),"chatRoom"===x&&(_e.priority=j,_e.broadcast=W),q=_e,B?[3,21]:[4,null===(R=null===(_=this._localCache)||void 0===_?void 0:_.getInstance())||void 0===R?void 0:R.storeMessage(_e,oe.SUCCESS)];case 20:Re.sent(),null===(O=this.eventHandler)||void 0===O||O.dispatch("onFileMessage",_e),Re.label=21;case 21:return[3,28];case 22:return!(K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,action:b.action,ext:X,time:L,msgConfig:M.msgConfig,onlineState:D}).msgConfig&&delete M.msgConfig,K.error=z,K.errorText=J,K.errorCode=V,!B&&this.onCmdMessage&&this.onCmdMessage(K),Se={id:U,type:"cmd",chatType:x,from:P,to:k,action:b.action,ext:X,time:Number(L),onlineState:D},K.msgConfig&&(Se.msgConfig=K.msgConfig),Y.length>0&&(Se.reactions=Y),te&&(Se.chatThread=te),ne&&(Se.chatThreadOverview=ne),"chatRoom"===x&&(Se.priority=j,Se.broadcast=W),q=Se,B||null===(I=this.eventHandler)||void 0===I||I.dispatch("onCmdMessage",Se),[3,28];case 23:return Ce={},Ae={},M.contents[0].customExts&&(Ce=Ie(M.contents[0].customExts)),M.contents[0].params&&(Ae=Ie(M.contents[0].params)),K={id:U,type:w,contentsType:Oe[b.type],from:P,to:k,customEvent:b.customEvent,params:Ae,customExts:Ce,ext:X,time:L,onlineState:D},!B&&this.onCustomMessage&&this.onCustomMessage(K),Ne={id:U,type:"custom",chatType:x,from:P,to:k,customEvent:b.customEvent,params:Ae,customExts:Ce,ext:X,time:Number(L),onlineState:D},K.msgConfig&&(Ne.msgConfig=K.msgConfig),Y.length>0&&(Ne.reactions=Y),te&&(Ne.chatThread=te),ne&&(Ne.chatThreadOverview=ne),"chatRoom"===x&&(Ne.priority=j,Ne.broadcast=W),q=Ne,B?[3,25]:[4,null===(C=null===(S=this._localCache)||void 0===S?void 0:S.getInstance())||void 0===C?void 0:C.storeMessage(Ne,oe.SUCCESS)];case 24:Re.sent(),null===(A=this.eventHandler)||void 0===A||A.dispatch("onCustomMessage",Ne),Re.label=25;case 25:return[3,28];case 26:return ie=(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&(ie="".concat(ie,"&share-secret=").concat(b.secretKey)),Me={id:U,type:"combine",chatType:x,to:k,from:P,ext:X,time:Number(L),onlineState:D,title:b.title||"",summary:b.summary||"",url:ie||"",secret:b.secretKey||"",file_length:b.fileLength||0,filename:b.displayName||"",compatibleText:b.text,combineLevel:b.combineLevel||0},K.msgConfig&&(Me.msgConfig=K.msgConfig),Y.length>0&&(Me.reactions=Y),te&&(Me.chatThread=te),ne&&(Me.chatThreadOverview=ne),"chatRoom"===x&&(Me.priority=j,Me.broadcast=W),q=Me,!B&&this.eventHandler&&this.eventHandler.dispatch("onCombineMessage",Me),[3,28];case 27:return G.error("Unknow message type, message:",b),[3,28];case 28:return H?[2,q]:[2,K]}}))}))}function Ce(e,t,r){if(this.delivery&&e!==t){var o=this.getUniqueId(),n=new Te("delivery",o);n.set({ackId:r,to:e}),G.debug("send delivery ack"),this.send(n.body)}}var Ae=function(e,t,r,o){var n,i,a,s,c,u,l,d,p,h,m,g,E,y,T,v,_,R,O,I;return _e(this,void 0,void 0,(function(){var S,C,A,N,M,b,U,w,P,k,L,D,x,B,j,H,F,W,K,q,z,V,J,X,Y,Q,Z,ee,te;return Re(this,(function(re){switch(re.label){case 0:if(S=new(f())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),C=this.root.lookup("easemob.pb.MessageBody"),A=C.decode(e.payload),N=1,e.meta&&e.meta.length)switch($.parseNotify(e.meta).is_online){case 0:N=0;break;case 1:N=1;break;default:N=2}else N=3;switch(M=new(f())(e.id.low,e.id.high,e.id.unsigned).toString(),b=A.ackMessageId?new(f())(A.ackMessageId.low,A.ackMessageId.high,A.ackMessageId.unsigned).toString():"",U="",w=A.from&&A.from.name,P=A.to&&A.to.name,G.debug("thirdMessage:",A),A.type){case Be.SINGLECHAT:return[3,1];case Be.GROUPCHAT:return[3,2];case Be.CHATROOM:return[3,3];case Be.READ_ACK:return[3,4];case Be.DELIVER_ACK:return[3,5];case Be.RECALL:return[3,6];case Be.CHANNEL_ACK:return[3,15];case Be.EDIT:return[3,16]}return[3,19];case 1:return U="chat","agoraToken"===this.grantType&&(U="singleChat"),this.delivery&&!r&&w!==this.context.userId&&Ce.call(this,w,P,M),[3,20];case 2:return U="groupchat","agoraToken"===this.grantType&&(U="groupChat"),[3,20];case 3:return U="chatroom","agoraToken"===this.grantType&&(U="chatRoom"),N=1,[3,20];case 4:return U="read_ack",k=void 0,A.ext[0]&&JSON.parse(A.ext[0].stringValue)?(k={id:M,type:"read",from:w,to:P,mid:b,groupReadCount:A.ext[0]&&JSON.parse(A.ext[0].stringValue),ackContent:A.ackContent,onlineState:N},this.onReadMessage&&this.onReadMessage(k),null===(n=this.eventHandler)||void 0===n||n.dispatch("onReadMessage",k),[2]):(k={id:M,type:"read",from:w,to:P,mid:b,onlineState:N},this.onReadMessage&&this.onReadMessage(k),null===(i=this.eventHandler)||void 0===i||i.dispatch("onReadMessage",k),[2]);case 5:return U="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:M,type:"delivery",from:w,to:P,mid:b,onlineState:N}),L={id:M,type:"delivery",from:w,to:P,mid:b,onlineState:N},null===(a=this.eventHandler)||void 0===a||a.dispatch("onDeliveredMessage",L),[2];case 6:return U="recall",D={id:M,from:w||"admin",to:P,mid:b,onlineState:N},x=P===this.user?w:P,[4,null===(c=null===(s=this._localCache)||void 0===s?void 0:s.getInstance())||void 0===c?void 0:c.getMessageByServerMsgId(D.mid)];case 7:return(B=re.sent())?[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.removeMsgByServerMsgId(D.mid)]:[3,9];case 8:re.sent(),re.label=9;case 9:return"singleChat"!==(null==B?void 0:B.chatType)&&"groupChat"!==(null==B?void 0:B.chatType)?[3,14]:(j=(null==B?void 0:B.from)===this.user||""===(null==B?void 0:B.from),[4,null===(p=null===(d=this._localCache)||void 0===d?void 0:d.getInstance())||void 0===p?void 0:p.getConversationLastMessage(x,B.chatType)]);case 10:return H=re.sent(),[4,null===(m=null===(h=this._localCache)||void 0===h?void 0:h.getInstance())||void 0===m?void 0:m.getConversationBySessionId(ne({conversationId:x,conversationType:B.chatType}))];case 11:return(F=re.sent())?[4,null===(E=null===(g=this._localCache)||void 0===g?void 0:g.getInstance())||void 0===E?void 0:E.updateLocalConversation(ne({conversationId:x,conversationType:B.chatType}),{lastMessageId:null==H?void 0:H.serverMsgId,unReadCount:ie({conversation:F,isRecallSelfMsg:j,recalledMsgTime:B.time})})]:[3,13];case 12:re.sent(),re.label=13;case 13:re.label=14;case 14:return this.onRecallMessage&&this.onRecallMessage(D),null===(y=this.eventHandler)||void 0===y||y.dispatch("onRecallMessage",D),[2];case 15:return this.onChannelMessage&&this.onChannelMessage({id:M,type:"channel",chatType:"singleChat",from:w,to:P,time:Number(S),onlineState:N}),W={id:M,type:"channel",chatType:"singleChat",from:w,to:P,time:Number(S),onlineState:N},null===(T=this.eventHandler)||void 0===T||T.dispatch("onChannelMessage",W),[2];case 16:return K={errorCode:0,reason:""},[4,Se.call(this,{status:K,thirdMessage:A,msgBody:A.contents[0],msgId:M,type:U,from:w,to:P,time:S,onlineState:N,ignoreCallback:!0,format:!0})];case 17:return q=re.sent(),z=!!e.to&&-1!==e.to.domain.indexOf("conference"),q.chatType=z?"groupChat":"singleChat",V=A.editMessageId&&new(f())(A.editMessageId.low,A.editMessageId.high,A.editMessageId.unsigned).toString(),J={id:V,type:q.type,chatType:q.chatType,msg:q.msg,to:q.to,from:q.from,time:q.time,modifiedInfo:q.modifiedInfo},q.translations&&(J.translations=q.translations),[4,null===(_=null===(v=this._localCache)||void 0===v?void 0:v.getInstance())||void 0===_?void 0:_.getMessageByServerMsgId(V)];case 18:return"txt"===(null==(X=re.sent())?void 0:X.type)&&(null===(O=null===(R=this._localCache)||void 0===R?void 0:R.getInstance())||void 0===O||O.putMessageToDB(ve(ve({},X),{msg:J.msg,modifiedInfo:J.modifiedInfo,translations:J.translations}))),"txt"===q.type&&(null===(I=this.eventHandler)||void 0===I||I.dispatch("onModifiedMessage",J)),[2];case 19:return G.error("unexpected message type: ".concat(A.type)),[2];case 20:Y="normal",Z=!1,"chat"===U.toLowerCase()||"singleChat"===U?Q="singleChat":"groupchat"===U.toLowerCase()||"groupChat"===U?Q="groupChat":(Q="chatRoom",N=1,e.ext&&(ee=Ie(e.ext),Z=!!(null==ee?void 0:ee.is_broadcast),Y=0===ee.chatroom_msg_tag?"high":2===ee.chatroom_msg_tag?"low":"normal")),te=0,re.label=21;case 21:return te<A.contents.length?[4,Se.call(this,{status:t,thirdMessage:A,msgBody:A.contents[te],msgId:M,type:U,from:w,to:P,time:S,onlineState:N,chatType:Q,ignoreCallback:r,priority:Y,format:o,broadcast:Z})]:[3,24];case 22:return[2,re.sent()];case 23:return te++,[3,21];case 24:return[2]}}))}))},Ne=["public","members_only","allow_user_invites","invite_need_confirm"],Me={name:"name",title:"name",description:"description",public:"public",members_only:"approval",allow_user_invites:"allowInvites",max_users:"maxUsers",invite_need_confirm:"inviteNeedConfirm",custom:"ext",last_modified:"lastModified"};function be(e,t){var r,o,n,i,a,s,c=this,u=this.context,l=u.userId,d=u.jid,p=t.from.name===l&&d.clientResource!==t.from.clientResource;return t.isThread?(n={id:t.mucId.name,name:t.mucName,operation:"",parentId:t.mucParentId.name,operator:t.from.name,userName:t.to.length?t.to[0].name:""},i={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):(o={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status},a={operation:"",id:t.mucId.name,from:t.from.name},t.isChatroom&&(null===(r=null==t?void 0:t.eventInfo)||void 0===r?void 0:r.ext)&&(s=JSON.parse(t.eventInfo.ext))),({45:function(){var e,r,o;a.operation="memberAttributesUpdate";var n=JSON.parse(null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||{};a.attributes=n.properties||{},a.userId=n.username||"",p?null===(r=c.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",a):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupEvent",a)},44:function(){var e;a.operation="removeChatRoomAttributes",a.attributes=s.result.successKeys,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},43:function(){var e;a.operation="updateChatRoomAttributes";var t={};s.result.successKeys.forEach((function(e){t[e]=s.properties[e]})),a.attributes=t,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},42:function(){},41:function(){},40:function(){},39:function(){},38:function(){var e;i.operation="chatThreadNameUpdate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},37:function(){var e;n.operation="userRemove",null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",n)},36:function(){var e;i.operation="chatThreadLeave",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},35:function(){var e;i.operation="chatThreadJoin",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},34:function(){var e;i.operation="chatThreadDestroy",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},33:function(){var e;i.operation="chatThreadCreate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},32:function(){var e,r,n,i;o.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="unmuteAllMembers",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},31:function(){var e,r,n,i;o.type=t.isChatroom?"muteChatRoom":"muteGroup",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="muteAllMembers",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},30:function(){var e,r,n,i;o.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="removeAllowlistMember",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},29:function(){var e,r,n,i;o.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="addUserToAllowlist",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},28:function(){var e,r,n,i;o.type="deleteFile",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="deleteFile",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},27:function(){var e,r,n,i;o.type="uploadFile",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="uploadFile",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},26:function(){var e,r,n,i;o.type="deleteAnnouncement",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="deleteAnnouncement",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},25:function(){var e,r,n,i;o.type="updateAnnouncement",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="updateAnnouncement",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},24:function(){var e,r,n,i;o.type="removeMute",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="unmuteMember",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},23:function(){var e,r,n,i;o.type="addMute",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="muteMember",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},22:function(){var e,r,n,i;o.type="removeAdmin",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="removeAdmin",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},21:function(){var e,r,n,i;o.type="addAdmin",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="setAdmin",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},20:function(){var e,r,n,i;o.type="changeOwner",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="changeOwner",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},19:function(){var e,r,n,i;o.type="direct_joined",o.groupName=t.mucName,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="directJoined",a.name=t.mucName,t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},18:function(){var e,r,n,i;o.type=t.isChatroom?"leaveChatRoom":"leaveGroup",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="memberAbsence",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},17:function(){var e,r,n,i;o.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="memberPresence",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},16:function(){var e,r;o.type="unblock",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},15:function(){var e,r;o.type="block",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},14:function(){var e,r,n,i,s,u=t.isChatroom;if(!u){var l=JSON.parse((null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||"{}",(function(e,t){return"last_modified"===e?Number(t):Ne.includes(e)?"true"===t||!0===t:t}));a.detail=o.detail={},Object.keys(l).forEach((function(e){var t=Me[e];if(t){var r=l[e];a.detail&&(a.detail[t]=r),o.detail&&(o.detail[t]=r)}}))}o.type="update",c.onPresence&&c.onPresence(o),u?null===(r=c.eventHandler)||void 0===r||r.dispatch("onChatroomChange",o):null===(n=c.eventHandler)||void 0===n||n.dispatch("onGroupChange",o),a.operation="updateInfo",u?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},13:function(){var e,r,n,i;o.type="allow",o.reason=t.reason,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="unblockMember",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},12:function(){var e,r;o.type="ban",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},11:function(){var e,r;o.type="getBlackList",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},10:function(){var e,r,n,i;o.type="removedFromGroup",o.kicked=o.to,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="removeMember",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},9:function(){var e,r,n,i;o.type="invite_decline",o.kicked=o.to,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="rejectInvite",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},8:function(){var e,r,n,i;o.type="invite_accept",o.kicked=o.to,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="acceptInvite",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},7:function(){var e,r,n,i;o.type="invite",o.kicked=o.to,o.groupName=t.mucName,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="inviteToJoin",a.name=t.mucName,t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},6:function(){var e,r,n,i;o.type="joinPublicGroupDeclined",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="joinPublicGroupDeclined",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):(a.userId=t.to.length?t.to[0].name:"",null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a))},5:function(){var e,r,n,i;o.type="joinPublicGroupSuccess",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="acceptRequest",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},4:function(){var e,r,n,i;o.type="joinGroupNotifications",o.reason=t.reason,c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="requestToJoin",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},3:function(){var e,r;o.type="leave",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},2:function(){var e,r;o.type="join",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o)},1:function(){var e,r,n,i;o.type="deleteGroupChat",c.onPresence&&c.onPresence(o),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",o),a.operation="destroy",t.isChatroom?null===(n=c.eventHandler)||void 0===n||n.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},0:function(){var e,r;a.operation="create",t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupEvent",a)}}[e]||function(){console.error("No match operation ".concat(e))})()}var Ue=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;G.debug("onMucMessage",t),be.call(this,r,t)},we={handleRosterMsg:function(e){var t,r,o,n,i,a,s=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:s.to[0].name,from:s.from.name,status:s.reason};switch(s.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactRefuse",c);break;case 6:case 7:break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(a=this.eventHandler)||void 0===a||a.dispatch("onContactRefuse",c);break;default:G.error("handleRosterMsg:",s)}this.onPresence&&c.type&&this.onPresence(c)}},Pe=function(e){var t,r,o,n,i,a,s=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);switch(s.operation){case 0:this.onStatisticMessage&&this.onStatisticMessage(s),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",s);break;case 1:a=m.create({type:d.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.logOut=!0,this.onError&&this.onError(a),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",a);break;case 2:a=m.create({type:d.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(a),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",a);break;case 3:a=m.create({type:d.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(a),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",a);break;case 4:a=m.create({type:d.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(a),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",a);break;default:G.error("handleStatisticsMsg:",s)}};function ke(e){var t,r=[],o=[],n=e.data;n&&n.values&&n.values.forEach((function(e){Object.entries(e.status).forEach((function(e){o.push({device:e[0],status:Number(e[1])})})),r.push({userId:e.uid,lastTime:Number(e.last_time),expire:Number(e.expiry),ext:e.ext,statusDetails:o})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function Le(e){var t=this;e.data.forEach((function(e){var r,o={from:e.from,to:e.to,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions,ts:e.ts};null===(r=t.eventHandler)||void 0===r||r.dispatch("onReactionChange",o)}))}function De(e){var t,r,o,n;if(e.data){var i=e.data,a={id:i.id||"",name:i.name||"",parentId:i.muc_parent_id||"",messageId:i.msg_parent_id||"",timestamp:i.timestamp||0,operator:i.from||"",operation:""};switch(i.operation){case"create":a.operation="create",a.createTimestamp=a.timestamp,a.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",a);break;case"update_msg":a.operation="update",a.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?a.lastMessage=re(i.last_message):"{}"===JSON.stringify(i.last_message)&&(a.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",a);break;case"update":a.operation="update",a.messageCount=i.message_count,null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",a);break;case"delete":a.operation="destroy",null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",a)}}}function Ge(e){var t,r=e.data;if(r.resource!==this.clientResource){var o={operation:"deleteRoaming",conversationId:r.to,chatType:"chat"===r.chatType?"singleChat":"groupChat",resource:r.resource};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",o)}}function xe(e){var t,r=e.data,o={operation:"del"===r.op?"deleteConversation":"top"===r.op?"pinnedConversation":"unpinnedConversation",conversationId:r.id,conversationType:"chat"===r.type?"singleChat":"groupChat",timestamp:r.ts};this.clientResource!==r.res&&(null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",o))}var Be,je=function(e){var t=$.parseNotify(e.payload);switch(t.type){case"presence":ke.call(this,t);break;case"reaction":Le.call(this,t);break;case"thread":De.call(this,t);break;case"roaming_delete":Ge.call(this,t);break;case"conv":xe.call(this,t);break;default:G.error("unexpected notify type: ".concat(t.type))}},He=1,Fe=function(){return Fe=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Fe.apply(this,arguments)},We=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},Ke=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},qe=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};!function(e){e[e.NORMAL=0]="NORMAL",e[e.SINGLECHAT=1]="SINGLECHAT",e[e.GROUPCHAT=2]="GROUPCHAT",e[e.CHATROOM=3]="CHATROOM",e[e.READ_ACK=4]="READ_ACK",e[e.DELIVER_ACK=5]="DELIVER_ACK",e[e.RECALL=6]="RECALL",e[e.CHANNEL_ACK=7]="CHANNEL_ACK",e[e.EDIT=8]="EDIT"}(Be||(Be={}));var ze=$.getEnvInfo();function Ve(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r="random_"+n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),a=i.decode(o);a.compressType=this.compressType,a.encryptType=this.encryptType,a.osType=this.osType,a.version=this.version,a.deviceName=t,a.resource=e,a.deviceUuid=r,a.authToken='{"token":"$t$'+this.token+'"}',a.actionVersion="v2.0",a=i.encode(a).finish();var s=this.root.lookup("easemob.pb.MSync"),c=s.decode(o);return c.version=this.version,c.guid=this.context.jid,c.auth="$t$"+this.token,c.command=3,c.deviceId=t,c.serviceId=this.dataReport.getServiceId(),c.encryptType=this.encryptType,c.payload=a,s.encode(c).finish()}function Je(e,t){var r=this,o=$.getEnvInfo();if("web"===o.platform||"zfb"===o.platform||"dd"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=ee().btoa(n),"web"===o.platform?n:{data:n,isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(G.debug("send message fail and reconnect"),r.reconnecting||r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var a=e;return{data:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnecting||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function Xe(e,t){switch(e.ns){case 0:Pe.call(this,e);break;case 1:Ae.call(this,e,t);break;case 2:Ue.call(this,e);break;case 3:we.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this);break;case 5:je.call(this,e);break;default:G.error("distributeMeta",e)}}function Ye(e,t){for(var r=function(r){var n=new(f())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return"continue";var i=e[r].from.name,a=e[r].to?e[r].to.name:"",s=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=o.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:a,isGroup:s}),Xe.call(o,e[r],t)},o=this,n=0;n<e.length;n++)r(n)}function Qe(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");t=t.decode(e.payload);var r=new(f())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();if(this.expirationTime&&this.compareTokenExpireTime(Number(r),this.expirationTime),0===t.unread.length)st.call(this);else for(var o=0;o<t.unread.length;o++)G.debug("pull unread message",t.unread),et.call(this,t.unread[o].queue);st.call(this)}function $e(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var o=this.root.lookup("easemob.pb.Meta").decode(e);o.id=(new Date).valueOf(),o.ns=0,o.payload=r;var n=this.root.lookup("easemob.pb.CommSyncUL"),i=n.decode(e);i.meta=o,i=n.encode(i).finish();var a=this.root.lookup("easemob.pb.MSync"),s=a.decode(e);return s.version=this.version,s.encryptType=[0],s.command=0,s.payload=i,a.encode(s).finish()}function Ze(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),o=r.decode(t);o.queue=e,o=r.encode(o).finish();var n=this.root.lookup("easemob.pb.MSync"),i=n.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=o,n.encode(i).finish()}function et(e){G.debug("sendBackqueue");var t=Ze.call(this,e);St.call(this,t)}function rt(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(f())(e.low,e.high,e.unsigned).toString(),n=o.encode(n).finish();var i=this.root.lookup("easemob.pb.MSync"),a=i.decode(r);return a.version=this.version,a.encryptType=this.encryptType,a.command=0,a.payload=n,i.encode(a).finish()}function ot(){var e;this.times=1,this.autoReconnectNumTotal=0,this.onOpened&&this.onOpened(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onConnected"),at.call(this),ut.call(this),ct.call(this),st.call(this)}function nt(e,t){G.debug("sendLastSession");var r=rt.call(this,e,t);St.call(this,r)}function it(e){var t,r,o,n,i,a,s=this,c=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=c.resource),this.clientResource=c.resource,0===c.status.errorCode){if(c.authToken){var u=JSON.parse(c.authToken).expires_in;if(!this.tokenExpiredTimer&&!this.tokenWillExpireTimer){var l=Date.now();this.expirationTime=u;var p=this.expirationTime-l;this.expiresIn=p<0?0:p,this.tokenExpireTimeCountDown(this.expiresIn)}}this.reconnecting=!1,this.logOut=!1,"zfb"!==ze.platform&&"dd"!==ze.platform||(this.sock.readyState=1),this._localCache?(null===(t=this._localCache)||void 0===t?void 0:t.getInstance())?ot.call(this):this._localCache&&new this._localCache({user:this.user,dbName:"cache_".concat(Math.abs(ae(this.appKey)),"_").concat(this.user),version:He,onInit:function(){return We(s,void 0,void 0,(function(){return Ke(this,(function(e){return G.debug("localCache init success"),ot.call(this),[2]}))}))}}):ot.call(this)}else{var h=void 0,f=c.status.reason;switch(f){case"Sorry, the app day live count limit":h=m.create({type:d.MAX_LIMIT,message:"Sorry, the daily active user limit for this app has been reached"}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",h);break;case"Sorry, the app online count limit":h=m.create({type:d.MAX_LIMIT,message:"Sorry, the maximum number limit of online users for this app has been reached"}),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",h);break;case"Sorry, the app month live count limit":h=m.create({type:d.MAX_LIMIT,message:"Sorry, the monthly active user limit for this app has been reached"}),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",h);break;case"Sorry, who are you?":h=m.create({type:d.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",h);break;default:h=m.create({type:d.SERVER_UNKNOWN_ERROR,message:f}),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",h)}}}function at(){var e,t;if((null===(e=this.unMSyncSendMsgMap)||void 0===e?void 0:e.size)>0){for(var r=Array.from(this.unMSyncSendMsgMap.keys()),o=0;o<r.length;o++){var n=this.unMSyncSendMsgMap.get(r[o]);St.call(this,n,r[o])}null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear()}}function st(){var e=$e.call(this);St.call(this,e)}function ct(){var e=dt.call(this);St.call(this,e)}function ut(){var e=this;lt.call(this),this.heartBeatID=setInterval((function(){ct.call(e)}),this.heartBeatWait)}function lt(){clearInterval(this.heartBeatID)}function dt(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function pt(e,t){return e.some((function(e){return e.name===t.name}))}function ht(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice"),o=r.decode(e.payload),n=pt(this._queues,o.queue);G.debug("receive notice",r,this._queues),n||this.clientResource===o.queue.clientResource&&o.queue.name===this.context.userId||(this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout((function(){var e=o.queue;pt(t._queues,e)&&(et.call(t,e),G.debug("⬇q:",e))}),1e4),this._queues.push(o.queue),1===this._queues.length&&et.call(this,o.queue))}function ft(e){if("string"==typeof e){var t=JSON.parse(e);if(Array.isArray(t)){var r=t[0],o=t[1];this.closeInfo={code:r,reason:o}}}}function mt(e){return We(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c;return Ke(this,(function(u){if(t=$.getEnvInfo(),r=this.root.lookup("easemob.pb.MSync"),"miniCore"===this.name){try{e.data instanceof ArrayBuffer||(G.debug("received message: ".concat(e.data)),ft.call(this,e.data)),n=new Uint8Array(e.data),o=r.decode(n)}catch(e){throw new Error("decode message fail.")}return[2,o]}if("web"===t.platform||"zfb"===t.platform||"dd"===t.platform){for('[401,"normal closed"]'===e.data&&(G.debug("received message: ".concat(e.data)),ft.call(this,e.data)),i=ee().atob(e.data),a=[],s=0,c=i.length;s<c;++s)a.push(i.charCodeAt(s));return[2,r.decode(a)]}try{e.data instanceof ArrayBuffer||(G.debug("received message: ".concat(e.data)),ft.call(this,e.data)),o=r.decode(e.data)}catch(e){throw new Error("decode message fail.")}return[2,o]}))}))}function gt(e){var t=this;e.then((function(e){if(e)switch(e.command){case 0:Et.call(t,e);break;case 1:Qe.call(t,e);break;case 2:ht.call(t,e);break;case 3:it.call(t,e);break;default:G.error("unexpected msync command: ".concat(e.command))}else G.error("unexpected msync result: ".concat(e))}))}function Et(e){var t,r,o,n,i,a,s,c,u,l,p,h,g,E,y,T,_,R,O,S,C,A,N,M,b,U,w,P,k,L,D,G,x,B,j,H,F,W,K,q,z;return We(this,void 0,void 0,(function(){var V,J,X,Y,Q,Z,ee,te,re,ne,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ge,Ee,ye,Te,ve,_e,Re,Oe,Ie=this;return Ke(this,(function(Se){switch(Se.label){case 0:if(V=(V=this.root.lookup("easemob.pb.CommSyncDL")).decode(e.payload),J=new(f())(V.serverId.low,V.serverId.high,V.serverId.unsigned).toString(),X=new(f())(V.metaId.low,V.metaId.high,V.metaId.unsigned).toString(),!(Number(X)>0))return[3,10];if(!V.status)return[3,9];if(0!==V.status.errorCode)return[3,8];if(null==(Y=this._msgHash[X])?void 0:Y.isHandleChatroom){try{Q="join"===(null===(t=this._msgHash[X])||void 0===t?void 0:t.operation),(null===(r=this._msgHash[X])||void 0===r?void 0:r.resolve)instanceof Function&&Q&&this._msgHash[X].resolve({type:0,data:{action:"apply",id:this._msgHash[X].roomId,result:!0,user:this.context.userId}}),(null===(o=this._msgHash[X])||void 0===o?void 0:o.success)instanceof Function&&Q&&this._msgHash[X].success({type:0,data:{action:"apply",id:this._msgHash[X].roomId,result:!0,user:this.context.userId}}),(null===(n=this._msgHash[X])||void 0===n?void 0:n.resolve)instanceof Function&&!Q&&this._msgHash[X].resolve({type:0,data:{result:!0}}),(null===(i=this._msgHash[X])||void 0===i?void 0:i.success)instanceof Function&&!Q&&this._msgHash[X].success({type:0,data:{result:!0}})}catch(e){_e=m.create({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e}),this.onError&&this.onError(_e),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",_e)}delete this._msgHash[X]}if(!Y||Y.isHandleChatroom)return[3,7];if(Z=null,ee="",te=0,0!==V.metas.length)try{(re=$.parseNotify(V.metas[0].payload)).edit_msg&&(ne=re.edit_msg,ie=ne.count,ae=ne.operator,se=ne.edit_time,ce=ne.sender,ue=ne.send_time,Z={operationTime:se,operatorId:ae,operationCount:ie},ee=ce,te=Number(ue))}catch(e){_e=m.create({type:d.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),this.onError&&this.onError(_e),null===(s=this.eventHandler)||void 0===s||s.dispatch("onError",_e)}I.has(X)&&(I.get(X).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:v.success,msgId:J}}),I.delete(X)),Se.label=1;case 1:return Se.trys.push([1,5,,6]),le={localMsgId:X,serverMsgId:J},Z&&(this._msgHash[X].modifiedInfo=Z,de=this._msgHash[X],pe=de.editMessageId,Te=de.type,he=de.chatType,fe=de.msg,me=de.to,ge=de.translations,Ee={id:pe,type:Te,chatType:he,msg:fe,modifiedInfo:Z,to:me,from:ee,time:Number(te)},ge&&(Ee.translations=ge),le.message=Ee,null===(l=null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.getMessageByServerMsgId(pe))||void 0===l||l.then((function(e){var t,r;e&&"txt"===e.type&&(null===(r=null===(t=Ie._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.putMessageToDB(Fe(Fe({},e),{msg:Ee.msg,modifiedInfo:Ee.modifiedInfo,translations:Ee.translations})))}))),[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.updateLocalMessage(X,{serverMsgId:J,status:oe.SUCCESS})];case 2:return Se.sent(),(null===(g=this._msgHash[X])||void 0===g?void 0:g.success)instanceof Function?[4,this._msgHash[X].success(X,J)]:[3,4];case 3:Se.sent(),Se.label=4;case 4:return(null===(E=this._msgHash[X])||void 0===E?void 0:E.resolve)instanceof Function&&this._msgHash[X].resolve(le),[3,6];case 5:return ye=Se.sent(),_e=m.create({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:ye}),this.onError&&this.onError(_e),null===(y=this.eventHandler)||void 0===y||y.dispatch("onError",_e),[3,6];case 6:this.onReceivedMessage&&this.onReceivedMessage({id:X,mid:J,to:this._msgHash[X].to,time:0}),null===(T=this.eventHandler)||void 0===T||T.dispatch("onReceivedMessage",{id:X,mid:J,to:this._msgHash[X].to}),delete this._msgHash[X],Se.label=7;case 7:return[3,9];case 8:if(15===V.status.errorCode)(null===(_=this._msgHash[X])||void 0===_?void 0:_.fail)instanceof Function&&this._msgHash[X].fail({type:d.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject({type:d.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),null===(O=null===(R=this._localCache)||void 0===R?void 0:R.getInstance())||void 0===O||O.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL});else if(1===V.status.errorCode){switch(Te=void 0,V.status.reason){case"blocked":Te=d.PERMISSION_DENIED;break;case"group not found":Te=d.GROUP_NOT_EXIST;break;case"not in group or chatroom":Te=d.GROUP_NOT_JOINED;break;case"exceed recall time limit":Te=d.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":Te=d.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":Te=d.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":Te=d.USER_NOT_FRIEND,V.status.reason="not contact";break;case"group is disabled":Te=d.GROUP_IS_DISABLED,V.status.reason="group is disabled";break;case"limit directed users":Te=d.MAX_LIMIT;break;case"Sorry, edit limit reached":Te=d.MAX_LIMIT,V.status.reason="Modify message limit reached";break;case"Sorry, message does not exist":Te=d.MODIFY_MESSAGE_NOT_EXIST,V.status.reason="The message does not exist.";break;case"Sorry, You do not have permission":Te=d.PERMISSION_DENIED,V.status.reason="You do not have the modified permission.";break;case"Sorry, format is incorrect":Te=d.MODIFY_MESSAGE_FORMAT_ERROR,V.status.reason="The modify messaged format error.";break;case"Sorry, edit is not available":Te=d.SERVICE_NOT_ENABLED,V.status.reason="The message modify function is not activated.";break;case"Sorry, edit fail":Te=d.MODIFY_MESSAGE_FAILED,V.status.reason="Modify message failed.";break;default:V.status.reason.includes("grpID")&&V.status.reason.includes("does not exist!")?(Te=d.CHATROOM_NOT_EXIST,V.status.reason="The chat room dose not exist."):V.status.reason.includes("username")&&V.status.reason.includes("doesn't exist!")?Te=d.USER_NOT_FOUND:"group member list is full!"===V.status.reason?Te=d.CHATROOM_MEMBERS_FULL:V.status.reason.includes("can not join this group")&&V.status.reason.includes("is in the blacklist")?(Te=d.PERMISSION_DENIED,V.status.reason="permission denied"):Te="can not operate this group, reason: group is disabled"===V.status.reason?d.GROUP_IS_DISABLED:V.status.reason.includes("moderation")?d.MESSAGE_MODERATION_BLOCKED:d.SERVER_UNKNOWN_ERROR}this._msgHash[X]&&((null===(S=this._msgHash[X])||void 0===S?void 0:S.isHandleChatroom)?(ve=m.create({type:Te,message:V.status.reason||"",data:""}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].error instanceof Function&&this._msgHash[X].error(ve)):(ve=m.create({type:Te,message:V.status.reason||"",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail({type:Te,reason:V.status.reason?V.status.reason:"",data:{id:X,mid:J}}),null===(A=null===(C=this._localCache)||void 0===C?void 0:C.getInstance())||void 0===A||A.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL})),delete this._msgHash[X])}else if(7===V.status.errorCode)"sensitive words"===V.status.reason&&this._msgHash[X]?(ve=m.create({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:X,mid:J,reason:"sensitive words"}}),null===(M=null===(N=this._localCache)||void 0===N?void 0:N.getInstance())||void 0===M||M.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL})):"blocked by mod_antispam"===V.status.reason&&this._msgHash[X]?(ve=m.create({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:X,mid:J,reason:"blocked by mod_antispam"}}),null===(U=null===(b=this._localCache)||void 0===b?void 0:b.getInstance())||void 0===U||U.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL})):"user is mute"===V.status.reason&&this._msgHash[X]?(ve=m.create({type:d.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail(ve),null===(P=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===P||P.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL})):"traffic limit"===V.status.reason&&this._msgHash[X]?(ve=m.create({type:d.MESSAGE_CURRENT_LIMITING,message:"traffic limit",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail(ve),null===(L=null===(k=this._localCache)||void 0===k?void 0:k.getInstance())||void 0===L||L.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL})):"Sorry, data is too large"===V.status.reason&&this._msgHash[X]&&(ve=m.create({type:d.MESSAGE_SIZE_LIMIT,message:"Sorry, data is too large",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail(ve),null===(G=null===(D=this._localCache)||void 0===D?void 0:D.getInstance())||void 0===G||G.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL}));else if(19===V.status.errorCode)this._msgHash[X]&&(I.has(X)&&(I.get(X).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:d.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:V.status.reason||"",msgId:J}}),I.delete(X)),ve=m.create({type:d.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:V.status.reason||"",data:{id:X,mid:J}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail({type:d.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:X,mid:J,reason:V.status.reason}}),null===(B=null===(x=this._localCache)||void 0===x?void 0:x.getInstance())||void 0===B||B.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL}));else if(this._msgHash[X]){I.has(X)&&(I.get(X).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:d.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(j=V.status)||void 0===j?void 0:j.reason)||"",msgId:J}}),I.delete(X));try{ve=m.create({type:d.WEBIM_LOAD_MSG_ERROR,message:(null===(H=V.status)||void 0===H?void 0:H.reason)||"",data:{id:X,mid:J,reason:V.status&&V.status.reason}}),this._msgHash[X].reject instanceof Function&&this._msgHash[X].reject(ve),null===(W=null===(F=this._localCache)||void 0===F?void 0:F.getInstance())||void 0===W||W.updateLocalMessage(X,{serverMsgId:J,status:oe.FAIL}),this._msgHash[X].fail instanceof Function&&this._msgHash[X].fail({type:d.WEBIM_LOAD_MSG_ERROR,data:{errorCode:V.status&&V.status.errorCode,reason:V.status&&V.status.reason}})}catch(e){_e=m.create({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e}),this.onError&&this.onError(_e),null===(K=this.eventHandler)||void 0===K||K.dispatch("onError",_e)}delete this._msgHash[X]}else I.has(X)&&(I.get(X).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:J}}),I.delete(X)),_e=m.create({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"}),this.onError&&this.onError(_e),null===(q=this.eventHandler)||void 0===q||q.dispatch("onError",_e);Se.label=9;case 9:return[2];case 10:if(0!==V.metas.length)try{Ye.call(this,V.metas,V.status)}catch(e){_e=m.create({type:d.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),this.onError&&this.onError(_e),null===(z=this.eventHandler)||void 0===z||z.dispatch("onError",_e)}finally{V.isLast?(Re=-1,this._queues.some((function(e,t){return e.name===V.name&&(Re=t,!0)}))&&Re>0&&this._queues.splice(Re,1),this._queues.length>0&&(et.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))):nt.call(this,V.nextKey,V.queue)}else V.isLast&&(Oe=-1,this._queues.some((function(e,t){return e.name===V.queue.name&&(Oe=t,!0)}))&&this._queues.splice(Oe,1),this._queues.length>0&&(et.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer)));return[2]}}))}))}function yt(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),o=[];for(var n in e){var i=r.decode(t);i.key=n,"object"==typeof e[n]?(i.type=8,i.stringValue=JSON.stringify(e[n])):"string"==typeof e[n]?(i.type=7,i.stringValue=e[n]):"boolean"==typeof e[n]?(i.type=1,i.varintValue=!0===e[n]?1:0):Number.isInteger(e[n])?(i.type=2,i.varintValue=e[n]):(i.type=6,i.doubleValue=e[n]),o.push(i)}return o}function Tt(e){var t,r,o,n=[];if(this.root){var i,a=this.root.lookup("easemob.pb.MessageBody.Content").decode(n);switch(i=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":a.type=0,a.text=e.msg;break;case"img":a.type=1,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename):e.file?(a.displayName=e.file.filename,a.remotePath=e.file.url,a.secretKey=e.file.secret,a.fileLength=e.file.file_length,a.size=e.file.size,a.thumbnailDisplayName=e.file.filename):(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.size=e.size,a.thumbnailDisplayName=e.filename),e.isBuildCombinedMsg&&(a.size={height:e.height,width:e.width});break;case"video":a.type=2,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename);break;case"loc":a.type=3,a.latitude=e.lat,a.longitude=e.lng,a.address=e.addr,a.buildingName=e.buildingName,a.latitude=e.lat;break;case"audio":a.type=4,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename);break;case"file":a.type=5,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.thumbnailDisplayName=e.filename);break;case"cmd":a.type=6,a.action=e.action;break;case"custom":a.type=7,a.customEvent=e.customEvent,a.customExts=yt.call(this,e.customExts);break;case"combine":a.type=0,a.subType=0,a.text=e.compatibleText,a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.title=e.title,a.summary=e.summary,a.combineLevel=e.combineLevel}var s=[];e.ext&&(s=yt.call(this,e.ext));var c=this.root.lookup("easemob.pb.MessageBody"),u=c.decode(n),l=e.from||this.context.jid.name;u.from={name:e.isBuildCombinedMsg?l:this.context.jid.name},u.to={name:e.to},"channel"===e.type?u.type=Be.CHANNEL_ACK:"recall"===e.type?(u.type=Be.RECALL,u.ackMessageId=e.ackId):"delivery"===e.type?(u.type=Be.DELIVER_ACK,u.ackMessageId=e.ackId):"read"===e.type?(u.type=Be.READ_ACK,u.ackMessageId=e.ackId,"groupChat"===i&&(u.msgConfig={allowGroupAck:!0},u.ackContent=e.ackContent)):"chatRoom"===i?u.type=Be.CHATROOM:"groupChat"===i?(u.type=Be.GROUPCHAT,e.msgConfig&&(u.msgConfig={allowGroupAck:!0})):"singleChat"===i&&(u.type=Be.SINGLECHAT),e.editMessageId&&(u.type=Be.EDIT,u.editMessageId=e.editMessageId),u.contents=[a],u.ext=s;var p=function(e){var t={};return"translations"in e&&(t.translations=e.translations),"isChatThread"in e&&e.isChatThread&&(t.thread={}),Object.keys(t).length>0?JSON.stringify(t):""}(e);p&&(u.meta=p),u=c.encode(u).finish();var h=this.root.lookup("easemob.pb.Meta"),m=h.decode(n);m.id=e.id;var g="easemob.com";if("chatRoom"!==i&&"groupChat"!==i||(g="conference.easemob.com"),m.to={appKey:this.appKey,name:e.to,domain:g},"chatRoom"===i&&(m.ext=yt.call(this,function(e){return{chatroom_msg_tag:"high"===e.priority?0:"low"===e.priority?2:1}}(e))),m.ns=1,m.payload=u,m.routetype=e.deliverOnlineOnly?1:0,"singleChat"!==i&&Array.isArray(e.receiverList)&&(null===(o=e.receiverList)||void 0===o?void 0:o.length)>0&&(m.directedUsers=e.receiverList,m.routetype=2,G.debug("receiverList:",e.receiverList,"thirdMessage",m)),e.isBuildCombinedMsg)return m.timestamp=f().fromValue(e.time),h.encode(m).finish();var E=this.root.lookup("easemob.pb.CommSyncUL"),y=E.decode(n);y.meta=m,y=E.encode(y).finish();var T=this.root.lookup("easemob.pb.MSync"),v=T.decode(n);return v.version=this.version,v.encryptType=this.encryptType,v.command=0,v.payload=y,T.encode(v).finish()}e.fail&&e.fail({type:d.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function vt(e){var t,r,o=this,n=Fe({},e);if(e.file)return n.accessToken=this.token,n.appKey=this.appKey,n.apiUrl=this.apiUrl,n.body&&n.body.url?Tt.call(this,n):new Promise((function(t,r){var i=n.onFileUploadComplete;n.onFileUploadComplete=function(t){var r,a,s,c;if(t.entities[0]["file-metadata"]){var u=t.entities[0]["file-metadata"]["content-length"];n.file_length=u,n.filetype=t.entities[0]["file-metadata"]["content-type"],u>204800&&(n.thumbnail=!0)}n.body={type:n.type||"file",secret:t.entities[0]["share-secret"],filename:n.file.filename||n.filename,url:(o.isHttpDNS?o.apiUrl+t.uri.substr(t.uri.indexOf("/",9)):t.uri)+"/"+t.entities[0].uuid,length:n.length||0,filetype:n.filetype||n.file.filetype,file_length:(null===(a=null===(r=n.file)||void 0===r?void 0:r.data)||void 0===a?void 0:a.size)||0,size:{width:n.width||0,height:n.height||0}},n.file.url=t.uri,e.secret=t.entities[0]["share-secret"];var l=(o.isHttpDNS?o.apiUrl+t.uri.substr(t.uri.indexOf("/",9)):t.uri)+"/"+t.entities[0].uuid;e.url=l,t.url=l,"img"===n.type&&(e.thumb="".concat(l,"?thumbnail=true"),t.thumb="".concat(l,"?thumbnail=true")),i instanceof Function&&i(t,n.id);var d=Tt.call(o,n);I.size<=S&&I.set(n.id,{rpt:o.dataReport.geOperateFun({operationName:E.SEND_MSG})}),null===(c=null===(s=o._localCache)||void 0===s?void 0:s.getInstance())||void 0===c||c.storeMessage(e,oe.INPROGRESS),St.call(o,d)},$.uploadFile.call(o,n,E.UPLOAD_MSG_ATTACH)}));if("combine"===e.type){n.accessToken=this.token,n.appKey=this.appKey,n.apiUrl=this.apiUrl;var i=n.onFileUploadComplete,a=n.onFileUploadError;return new Promise((function(t,r){var s,c,u,l;if((null===(s=e.messageList)||void 0===s?void 0:s.length)>300||0===(null===(c=e.messageList)||void 0===c?void 0:c.length))return o._msgHash[n.id].reject({type:d.MAX_LIMIT,message:"The number of combined messages exceeded the limit."});var p=qe([],e.messageList,!0),h=0;if(p.forEach((function(e){(null==e?void 0:e.combineLevel)>h&&(h=null==e?void 0:e.combineLevel)})),n.combineLevel=h+1,n.combineLevel>10)return o._msgHash[n.id].reject({type:d.MAX_LIMIT,message:"The level of the merged message exceeded the limit."});var f=_t.call(o,p),m=function(t,r){var a,s,c,u,l,d,p=(o.isHttpDNS?o.apiUrl+t.uri.substr(t.uri.indexOf("/",9)):t.uri)+"/"+t.entities[0].uuid,h=null===(a=t.entities[0])||void 0===a?void 0:a["share-secret"],f=p+"?em-redirect=true";h&&(f="".concat(f,"&share-secret=").concat(h)),i instanceof Function&&i({url:f,secret:h}),e.url=f,e.secret=h,n.url=p,n.secret=t.entities[0]["share-secret"],n.filename=(null===(s=n.file)||void 0===s?void 0:s.filename)||(null==r?void 0:r.fileName),n.file_length=(null===(u=null===(c=n.file)||void 0===c?void 0:c.data)||void 0===u?void 0:u.size)||(null==r?void 0:r.fileLength)||0,null===(d=null===(l=o._localCache)||void 0===l?void 0:l.getInstance())||void 0===d||d.storeMessage(e,oe.INPROGRESS);var m=Tt.call(o,n);St.call(o,m)},g=$.getEnvInfo();if("web"!==g.platform&&"node"!==g.platform&&"quick_app"!==g.platform&&(null===(l=null===(u=g.global)||void 0===u?void 0:u.canIUse)||void 0===l?void 0:l.call(u,"getFileSystemManager"))){var y=g.global.getFileSystemManager(),T=o.apiUrl+"/"+o.orgName+"/"+o.appName+"/chatfiles";y.writeFile({filePath:"".concat(g.global.env.USER_DATA_PATH,"/combine"),data:f.buffer,encoding:"binary",success:function(e){g.global.uploadFile({url:T,filePath:"".concat(g.global.env.USER_DATA_PATH,"/combine"),name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+n.accessToken},success:function(e){if(200===e.statusCode){G.debug("upload success",e);var t=JSON.parse(e.data);m(t,{fileName:"combine",fileLength:f.length})}else G.debug("upload fail"),n.onFileUploadError instanceof Function&&n.onFileUploadError(e),this._msgHash[n.id].reject({type:d.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},fail:function(t){G.debug("upload fail"),n.onFileUploadError instanceof Function&&n.onFileUploadError(e),this._msgHash[n.id].reject({type:d.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:t})}})},fail:function(e){G.debug("write file fail",e),this._msgHash[n.id].reject({type:d.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})}})}else{var v=new File([f],"combine",{type:"application/octet-stream"}),_={url:URL.createObjectURL(v),filename:n.id,data:v};n.file=_,n.onFileUploadComplete=function(e){m(e)},n.onFileUploadError=function(e){a instanceof Function&&a(e),o._msgHash[n.id].reject({type:d.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},$.uploadFile.call(o,n,E.UPLOAD_MSG_ATTACH)}}))}"img"===e.type&&(n.body||(n.body=Fe(Fe({},n),{size:{width:n.width||0,height:n.height||0}}))),null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.storeMessage(e,oe.INPROGRESS);var s=Tt.call(this,n);St.call(this,s)}function _t(e){for(var t=Uint8Array.from("cm",(function(e){return e.charCodeAt(0)})),r=0;r<e.length;r++){for(var o=e[r],n=Fe(Fe({},o),{isBuildCombinedMsg:!0}),i=this.mSync.encodeChatMsg.call(this,n),a=i.length,s=new Uint8Array(4),c=0;c<4;c++)s[c]=a>>8*(3-c)&255;G.debug("message length:",s);var u=new Uint8Array(t.length+s.length+i.length);u.set(t),u.set(s,t.length),u.set(i,t.length+s.length),t=u}var l=new Uint8Array(t.length+1),d=0;for(r=2;r<t.length;r++)r%2==1&&(d^=t[r]);return l.set(t),G.debug("checkResult:",d),l[t.length]=d,l}function Rt(e,t,r){var o=[],n=this.root.lookup("easemob.pb.MUCBody"),i=n.decode(o);i.mucId={appKey:this.appKey,name:e,domain:"conference.easemob.com"},i.operation="join"===r?2:3,i.from={name:this.context.userId},i.isChatroom=!0,i=n.encode(i).finish();var a=this.root.lookup("easemob.pb.Meta").decode(o);a.id=t,a.from={appKey:this.appKey,name:this.context.userId,domain:"easemob.com",client_resource:this.context.jid.clientResource},a.to={domain:"easemob.com"},a.ns=2,a.payload=i;var s=this.root.lookup("easemob.pb.CommSyncUL"),c=s.decode(o);c.meta=a,c=s.encode(c).finish();var u=this.root.lookup("easemob.pb.MSync"),l=u.decode(o);return l.version=this.version,l.encryptType=this.encryptType,l.command=0,l.payload=c,u.encode(l).finish()}function Ot(e,t){var r=$.getUniqueId(),o=Rt.call(this,e.roomId,r,t);return St.call(this,Fe(Fe({},e),{isHandleChatroom:!0,joinMsg:o,id:r,operation:t}),r)}function It(e){var t=this;return new Promise((function(r,o){var n,i,a,s,c,u;if(t.logOut)return o({type:d.WEBIM_CONNECTION_CLOSED,message:"not login"});if(!e.id||"string"!=typeof e.id||""===e.id)return o({type:d.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "id"'});if(!e.to||"string"!=typeof e.to||""===e.to)return o({type:d.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "to"'});var l="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,p="delivery"===e.type||"read"===e.type||"channel"===e.type,h="cmd"===e.type,f="recall"===e.type,m=null==e?void 0:e.editMessageId,g=!(p||f||h||m);if(e.id){if(!l&&!p||l&&t.useOwnUploadFun){var y="recall"===e.type?E.SEND_RECALL_MSG:E.SEND_MSG;m&&(y=E.MODIFY_MESSAGE),I.size<=S&&I.set(e.id,{rpt:t.dataReport.geOperateFun({operationName:y})})}g&&(null===(i=null===(n=t._localCache)||void 0===n?void 0:n.getInstance())||void 0===i||i.storeMessage(e,oe.CREATE)),t._msgHash[e.id]=Fe(Fe({},e),{resolve:r,reject:o})}if(l||"combine"===e.type)return vt.call(t,e);if("txt"===e.type&&(null===(a=e.msgConfig)||void 0===a?void 0:a.languages)&&Array.isArray(null===(s=e.msgConfig)||void 0===s?void 0:s.languages)&&e.msgConfig.languages.length>0){var T=t.translateMessage||t.translation.translateMessage;if(!T)throw new Error("there is no method to translate message");T.call(t,{text:e.msg,languages:e.msgConfig.languages}).then((function(r){var o,n,i,a=null===(o=r.data[0])||void 0===o?void 0:o.translations;a=a.map((function(e){return{code:e.to,text:e.text}})),e.translations=a,t._msgHash[e.id].translations=a,null===(i=null===(n=t._localCache)||void 0===n?void 0:n.getInstance())||void 0===i||i.storeMessage(e,oe.INPROGRESS);var s=Tt.call(t,e);St.call(t,s,e.id)})).catch((function(e){o(e)}))}else{g&&(null===(u=null===(c=t._localCache)||void 0===c?void 0:c.getInstance())||void 0===u||u.storeMessage(e,oe.INPROGRESS));var v=Tt.call(t,e);St.call(t,v,e.id)}}))}function St(e,t){var r,o,n=this;if(e.isHandleChatroom){if(!this.isOpened()){var i={data:"",type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};return Promise.reject(i)}return new Promise((function(r,o){var i;n._msgHash[e.id]=Fe(Fe({},e),{resolve:r,reject:o}),i="miniCore"===n.name?e.joinMsg:Je.call(n,e.joinMsg,t),n.sock.send(i)}))}if(!this.isOpened())return null===(r=this.unMSyncSendMsgMap)||void 0===r||r.set(t,e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.socketHost.length&&this.isHttpDNS||!this.isHttpDNS)&&(G.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnecting||this.reconnect()),void(this.onError&&this.onError({type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));o="miniCore"===this.name?e:Je.call(this,e,t),this.sock.send(o)}var Ct=function(e,t){return e.send=It,e.sendMsg=It,G.debug("init Msync by ".concat(e.name)),{generateProvision:Ve.bind(e),base64transform:Je.bind(e),distributeMeta:Xe.bind(e),decodeMeta:Ye.bind(e),decodeUnreadDL:Qe.bind(e),_rebuild:$e.bind(e),_lastsession:rt.bind(e),receiveProvision:it.bind(e),isInQueue:pt.bind(e),decodeNotice:ht.bind(e),decodeMSync:mt.bind(e),distributeMSync:gt.bind(e),encodeChatMsg:Tt.bind(e),upLoadFile:vt.bind(e),send:It.bind(e),stopHeartBeat:lt.bind(e),handleChatRoom:Ot.bind(e)}},At=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in G.debug("dispatch event: "+e,t||""),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}(),Nt=function(){};function Mt(e){this.onOpened=e.onOpened||Nt,this.onPresence=e.onPresence||Nt,this.onTextMessage=e.onTextMessage||Nt,this.onPictureMessage=e.onPictureMessage||Nt,this.onAudioMessage=e.onAudioMessage||Nt,this.onVideoMessage=e.onVideoMessage||Nt,this.onFileMessage=e.onFileMessage||Nt,this.onLocationMessage=e.onLocationMessage||Nt,this.onCmdMessage=e.onCmdMessage||Nt,this.onCustomMessage=e.onCustomMessage||Nt,this.onReceivedMessage=e.onReceivedMessage||Nt,this.onDeliveredMessage=e.onDeliveredMessage||Nt,this.onReadMessage=e.onReadMessage||Nt,this.onRecallMessage=e.onRecallMessage||Nt,this.onChannelMessage=e.onChannelMessage||Nt,this.onError=e.onError||Nt,this.onOffline=e.onOffline||Nt,this.onOnline=e.onOnline||Nt,this.onStatisticMessage=e.onStatisticMessage||Nt,this.onContactInvited=e.onContactInvited||Nt,this.onContactAgreed=e.onContactAgreed||Nt,this.onContactRefuse=e.onContactRefuse||Nt,this.onContactDeleted=e.onContactDeleted||Nt,this.onContactAdded=e.onContactAdded||Nt,this.onTokenWillExpire=e.onTokenWillExpire||Nt,this.onTokenExpired=e.onTokenExpired||Nt,this.onClosed=e.onClosed||Nt,this.onPresenceStatusChange=e.onPresenceStatusChange||Nt}var bt={biz:"",debug:!1,token:""},Ut="https://data-reporting.agora.io/report",wt="https://data-reporting.sh.agoralab.co/report",Pt=function(e){var t=Number(g[e]);return t===g.USER_LOGIN?"MANUALLOGIN":t===g.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>g.UNKNOWOPERATION&&t<g.REST_OPERATE?"REST":t>g.REST_OPERATE&&t<g.MSYNC_OPERATE?"MESSAGE":t>g.MSYNC_OPERATE&&t<g.ROSTER_OPERATE?"ROSTER":t>g.ROSTER_OPERATE&&t<g.USER_OPERATE?"USER":t>g.USER_OPERATE&&t<g.GROUP_OPERATE?"GROUP":t>g.GROUP_OPERATE&&t<g.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},kt=function(){return(new Date).getTime()},Lt=function(e){return[q.BAIDU,q.WX,q.DD,q.ZFB,q.TT,q.QUICK_APP,q.UNI].includes(e.platform)},Dt=function(){return e=1,t=99999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e;var e,t},Gt={},xt=1e3,Bt=function(){function e(e){this.eventQueue=[],this.stock=xt,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit ".concat(xt," per minute")):(this.eventQueue.push(e),this.consume(),this.stock-=1)},e.prototype.consume=function(){var e=this;0!==this.eventQueue.length&&(this.timer&&this.eventQueue.length<=10&&clearTimeout(this.timer),this.timer=setTimeout((function(){var t,r=e.eventQueue.splice(0,10),o=r.filter((function(e){return e.appId===r[0].appId})),n=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,n),e.batchSend(o)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=xt}),6e4);"undefined"!=typeof addEventListener&&addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var o=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,o=t.appId,n=t.data,i=t.debug,a=t.onSuccess;if(!r)throw new Error("biz is not defined");Gt.global||(Gt=$.getEnvInfo());var s=Gt;if(Lt(s)){var c={url:i?wt:Ut,data:n,method:"POST",success:function(){null==a||a()},fail:function(){},complete:function(){}},u={token:e,appid:null!=o?o:"",sendts:"".concat(Math.floor((new Date).getTime()/1e3)),biz:r,debug:"".concat(i)};if("zfb"===s.platform||"dd"===s.platform?c.headers=u:c.header=u,"dd"===s.platform)return s.global.httpRequest(c);s.global.request(c)}else{var l=new XMLHttpRequest;l.onreadystatechange=function(){2===l.readyState&&(null==a||a())},l.open("POST",i?wt:Ut),l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("token",e),l.setRequestHeader("appid",null!=o?o:""),l.setRequestHeader("sendts","".concat(Math.floor((new Date).getTime()/1e3))),l.setRequestHeader("biz",r),l.setRequestHeader("debug","".concat(i)),l.send(JSON.stringify(n))}}catch(e){console.error(e)}}(this.config.token,{biz:null===(t=e[0])||void 0===t?void 0:t.biz,appId:null===(r=e[0])||void 0===r?void 0:r.appId,data:o,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),jt=function(){return jt=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},jt.apply(this,arguments)},Ht=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=bt,e&&this.init(e)}return e.prototype.init=function(e){var t;if(void 0===e&&(e={}),!e.biz||!e.token)throw new Error("Event Report: biz or token is not defined");try{this.appId=null!==(t=e.appId)&&void 0!==t?t:"",this.biz=e.biz,this.config=jt(jt({},bt),e),this.eventQueue=new Bt(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.send=function(e,t,r){var o;if(void 0===t&&(t={}),this.inited){var n=jt(jt({},t),{eventId:Number(e),biz:this.biz,appId:null!==(o=null==r?void 0:r.appId)&&void 0!==o?o:this.appId});this.eventQueue.add(n),this.log(n)}else console.error("Event Report: init is not called")},e.prototype.log=function(e){try{if(this.config.debug){var t=e.payload,r=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(e,["payload"]);console.log("%c Event Report: ".concat(this.config.biz," "),"background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),Ft=function(){return Ft=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ft.apply(this,arguments)},Wt={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},Kt=function(){function e(e){this.platform=$.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,Lt(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel="direct",this.options=function(e,t){t.platform||(t=$.getEnvInfo());var r=e.org,o=e.appkey,n=e.deviceId,i=e.sdkVersion,a=(null===navigator||void 0===navigator?void 0:navigator.userAgent)||"".concat(t.platform,"_mini_program");return{org:r,appkey:o,deviceId:n,sdkServiceId:"sid_".concat($.getUniqueId(),"_").concat(Dt()),did:a,sdkVersion:i,os:7,sdkProduct:_.web}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(){return e.instance},e.prototype.getServiceId=function(){return this.sid||"sid_0"},e.prototype.setIsReportDt=function(e){this.isReportDt=e,e&&this.rptEventQueue()},e.prototype.setIsCollectDt=function(e){this.isCollectDt=e,e||(this.eventQueue=[])},e.prototype.rptEventQueue=function(){var e=this;this.eventQueue.length&&this.eventQueue.forEach((function(t,r){Ht.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,Ht.init({biz:"im",token:"32f24ab2ddb74f508aa9286c356cec84",appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,o=e.sdkVersion,n=e.deviceId;this.reportData(9674,{did:t,os:r,sdkVersion:o,deviceId:n})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,o=0,n="",i=kt(),a=e.uid,s=e.operationName;a&&(this.uid=a);var c={uid:this.uid,operationId:"opr_".concat($.getUniqueId(),"_").concat(Dt()),requestid:"req_".concat($.getUniqueId(),"_").concat(Dt()),operationName:s};return function(e){var a,u,l,d;if(e.data.isSuccess?(o=0,n=""):(0===e.data.code&&(e.data.code=A),o=null!==(a=e.data.code)&&void 0!==a?a:o,n=null!==(u=e.data.codeDesc)&&void 0!==u?u:n),(null===(l=e.data)||void 0===l?void 0:l.accessChannel)&&(t.accessChannel=null===(d=e.data)||void 0===d?void 0:d.accessChannel),e.isRetry?(r++,e.data.subrequestid="".concat(r)):(c.requestid="req_".concat($.getUniqueId(),"_").concat(Dt()),r=1),e.data.isLastApi){var p=kt();e.data.requestElapse=p-i,e.data.requestMethod="",e.data.subrequestid="0",e.data.code=200===o?0:o,e.data.codeDesc=n}else e.data.requestName||(e.data.requestName=s);e.data.requestElapse||(e.data.requestElapse=kt()-i),t.reportData.call(t,C,Ft(Ft(Ft(Ft({},Wt),c),e.data),{accessChannel:t.accessChannel,operationType:Pt(s)})),e.isEndApi&&t.reportData.call(t,C,Ft(Ft(Ft({},c),Wt),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",code:200===o?0:o,codeDesc:n,requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:Pt(s)}))}},e.prototype.reportData=function(e,t){return r=this,o=void 0,i=function(){var r,o,n,i,a,s,c,u;return function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),r=kt(),o=0,e!==C?[3,2]:[4,(d=this.platform,new Promise((function(e){var t;d.platform||(d=$.getEnvInfo());var r="";if(d.platform===q.WEB){var o=navigator.connection;(null==o?void 0:o.type)?(null==o||o.type,r=T.WIFI):(null==o?void 0:o.effectiveType)&&(r=T[o.effectiveType.toLocaleUpperCase()]),e(r)}else d.platform===q.NODE?(r=T.UNKNOWN,e(r)):null===(t=d.global)||void 0===t||t.getNetworkType({success:function(t){r=T[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:o=l.sent(),l.label=2;case 2:return n=this.options,i=n.appkey,a=n.sdkServiceId,s=n.sdkProduct,c=Ft({lts:r,net:o,appkey:i,sdkServiceId:a,sdkProduct:s},t),this.isReportDt?Ht.send(e,c):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:c}),[3,4];case 3:return u=l.sent(),console.warn(u),[3,4];case 4:return[2]}var d}))},new((n=void 0)||(n=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}c((i=i.apply(r,o||[])).next())}));var r,o,n,i},e}(),qt=Kt;function zt(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:d.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function Vt(){var e;if(!this.context.accessToken){var t=m.create({type:d.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function Jt(){return Vt.call(this)&&zt.call(this)}function Xt(e){var t=e.data,r=e.type;return{data:{status:Object.keys(t.errorKeys).length>0?"fail":"success",errorKeys:t.errorKeys,successKeys:t.successKeys},type:r}}function Yt(e){var t=e.data,r=void 0;return Object.keys(t.errorKeys).length>0&&Object.keys(t.errorKeys).forEach((function(e){var o=t.errorKeys[e];r=o.includes("is not part of you")?m.create({type:d.NO_PERMISSION,message:o}):o.includes("size of metadata for this single chatroom exceeds the user defined limit")||o.includes("total size of chatroom metadata for this app exceeds the user defined limit")||o.includes("is exceeding maximum limit")?m.create({type:d.MAX_LIMIT,message:o}):o.includes("is not Legal")?m.create({type:d.REQUEST_PARAMETER_ERROR,message:o}):o.includes("Failed to update userMetadata. Concurrent updates not allowed")?m.create({type:d.OPERATION_NOT_ALLOWED,message:o}):m.create({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:o})})),r}var Qt=function(){return Qt=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Qt.apply(this,arguments)},$t=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},Zt=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},er={chat:"singleChat",chatroom:"chatRoom",groupchat:"groupChat",singleChat:"singleChat",chatRoom:"chatRoom",groupChat:"groupChat"};function tr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i},success:function(t){var r={};t.data.forEach((function(e){r[e]={name:e}})),"function"==typeof(null==e?void 0:e.success)&&e.success(t)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return G.debug("Call getBlocklist"),j.call(this,a,E.GET_BLACK_LIST)}var rr=tr,or=nr;function nr(e){var t=this;if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},success:function(r){var o=[];r.data.forEach((function(e){o.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(o)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return G.debug("Call getContacts"),j.call(this,s,E.GET_CONTACTS)}function ir(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');if("string"!=typeof e.deviceToken||""===e.deviceToken)throw Error('Invalid parameter: "deviceToken"');if("string"!=typeof e.notifierName||""===e.notifierName)throw Error('Invalid parameter: "notifierName"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user),type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call uploadPushToken",e),j.call(this,a,E.UPLOAD_PUSH_TOKEN)}var ar=ir;function sr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/user_channels"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return G.debug("Call getSessionList"),j.call(this,a,E.GET_SESSION_LIST)}function cr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=!!(e&&"number"==typeof e.pageNum&&"number"==typeof e.pageSize&&e.pageNum>0&&e.pageSize>0),s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/user_channels").concat(a?"/page":""),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return a&&(s.data={pageNum:e.pageNum,pageSize:e.pageSize}),G.debug("Call getConversationlist"),j.call(this,s,E.GET_SESSION_LIST).then((function(e){return function(e){var t=e.data.channel_infos;return null==t||t.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=re(e.meta)):e.lastMessage=e.meta,delete e.meta})),e}(e)}))}function ur(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: ".concat(e.channel));if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: ".concat(e.deleteRoam));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r,o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=o.jid;r="singleChat"===e.chatType?"chat":"groupChat";var c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/user/").concat(this.user,"/user_channel?resource=").concat(s.clientResource),dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call deleteSession",e),j.call(this,c,E.DELETE_SESSION)}var lr=ur;function dr(e,t){if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],c={};if("undefined"!=typeof wx||"undefined"!=typeof qq)if("string"==typeof e&&void 0!==t){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");s.forEach((function(t){s.includes(t)&&void 0!==e[t]&&(c[t]=e[t])}))}else if("string"==typeof e){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var u=[];s.forEach((function(t){if(s.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);u.push(r+"="+o)}})),c=u.join("&")}var l={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/metadata/user/").concat(this.user),type:"PUT",data:c,dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/x-www-form-urlencoded"}};return G.debug("Call updateOwnUserInfo",e),j.call(this,l,E.UPDATE_USER_INFO)}var pr=dr;function hr(e,t){if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o,n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=[];if("string"==typeof e)c=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");c=e}o="string"==typeof t?[t]:t&&"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/metadata/user/get"),type:"POST",data:JSON.stringify({targets:c,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return G.debug("Call fetchUserInfoById",e),j.call(this,u,E.GET_USER_INFO)}function fr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user),type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call updateCurrentUserNick",e),j.call(this,a)}function mr(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "token"');var t=this.context,r=t.orgName,o=t.appName,n={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/sdk/users/").concat(this.user,"/token/expires"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return G.debug("Call getTokenExpireTimestamp",e),j.call(this,n,E.SDK_INTERNAL)}function gr(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!Jt.call(t)){var n=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=this,i=t.count||20;Er.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(o){if(o.msgs.length>=i||o.is_last){var a=o.msgs.splice(0,i).reverse();t.success&&t.success(a),r(a)}else e.call(n,Qt(Qt({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),G.debug("Call fetchHistoryMessages",e)}))}function Er(e){var t=this,r=e.queue,o=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),n=this.context.userId,i=e.start||-1,a=e.count||20;if(o.msgs.length>=a||o.is_last)"function"==typeof e.success&&e.success(o);else{o&&o.next_key&&(i=o.next_key),e.start&&(i=e.start);var s={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},c=this.context,u=c.orgName,l=c.appName,p={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/users/").concat(n,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(s),success:function(r){return $t(t,void 0,void 0,(function(){var t,n,i,a,s,c,u=this;return Zt(this,(function(l){switch(l.label){case 0:if(t=null==r?void 0:r.data,!r.data.msgs)return"function"==typeof e.success&&e.success(o),o.is_last=!0,o.next_key="",[2];n=t.msgs,i=n.length,o.is_last=t.is_last,o.next_key=t.next_key,a=function(t){return $t(u,void 0,void 0,(function(){var r,o,n,i,a;return Zt(this,(function(s){switch(s.label){case 0:for(r=[],t=ee().atob(t),o=0,n=t.length;o<n;++o)r.push(t.charCodeAt(o));return i=(i=this.context.root.lookup("easemob.pb.Meta")).decode(r),a={errorCode:0,reason:""},1!==i.ns?[3,2]:[4,Ae.call(this,i,a,!0,e.format)];case 1:return[2,s.sent()];case 2:return[2]}}))}))},s=0,l.label=1;case 1:return s<i?[4,a(n[s].msg)]:[3,4];case 2:(c=l.sent())&&o.msgs.push(c),l.label=3;case 3:return s++,[3,1];case 4:return"function"==typeof e.success&&e.success(o),[2]}}))}))},error:function(e){if(e.error&&e.error_description){var r=m.create({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:"fetch history messages error",data:e});t.onError&&t.onError(r)}}};j.call(this,p,E.GET_HISTORY_MSG).catch((function(t){"function"==typeof e.fail&&e.fail(t)}))}}function yr(e){var t=this;return new Promise((function(r,o){var n=e.targetId,i=e.cursor,a=void 0===i?-1:i,s=e.pageSize,c=void 0===s?20:s,u=e.chatType,l=e.searchDirection,p=e.searchOptions,h=void 0===p?{}:p,f=h.msgTypes,g=void 0===f?[]:f,E=h.startTime,y=void 0===E?null:E,T=h.endTime,v=void 0===T?null:T,_=h.from,R=void 0===_?null:_;if("string"!=typeof n||""===n)throw Error('"Invalid parameter": "targetId"');if(R&&"string"!=typeof R)throw Error('"Invalid parameter": "searchOptions.from"');if(g&&!Array.isArray(g))throw Error('"Invalid parameter": "searchOptions.msgTypes"');if(y&&"number"!=typeof y)throw Error('"Invalid parameter": "searchOptions.startTime"');if(v&&"number"!=typeof y)throw Error('"Invalid parameter": "searchOptions.endTime"');if(!Jt.call(t)){var O=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return o(O)}var I=t.context,S=I.orgName,C=I.appName,A=I.userId,N="groupChat"===e.chatType?"@conference.easemob.com":"@easemob.com",M={queue:"".concat(n).concat(N),start:a,pull_number:c,is_positive:"down"===l,msgType:g.join(",")||"",end:-1,startTime:y,endTime:v,userId:"singleChat"===u?null:R},b={url:"".concat(t.apiUrl,"/").concat(S,"/").concat(C,"/users/").concat(A,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(M),success:function(o){return $t(t,void 0,void 0,(function(){var t,n,i,a,s,c,u,l,d=this;return Zt(this,(function(p){switch(p.label){case 0:t=null==o?void 0:o.data,n=t.msgs||[],i=function(e){return $t(d,void 0,void 0,(function(){var t,r,o,n,i;return Zt(this,(function(a){switch(a.label){case 0:for(t=[],e=ee().atob(e),r=0,o=e.length;r<o;++r)t.push(e.charCodeAt(r));return n=(n=this.context.root.lookup("easemob.pb.Meta")).decode(t),i={errorCode:0,reason:""},1!==n.ns?[3,2]:[4,Ae.call(this,n,i,!0,!0)];case 1:return[2,a.sent()];case 2:return[2]}}))}))},a=[],s=0,p.label=1;case 1:return s<n.length?[4,i(n[s].msg)]:[3,4];case 2:(c=p.sent())&&a.push(c),p.label=3;case 3:return s++,[3,1];case 4:return t.msgs=a,u={cursor:t.next_key,messages:a,isLast:t.is_last},null===(l=e.success)||void 0===l||l.call(e,u),r(u),[2]}}))}))},error:e.fail};j.call(t,b).catch((function(e){o(e)})),G.debug("Call getHistoryMessages",e)}))}function Tr(e,t){return $t(this,void 0,void 0,(function(){var r,o,n,i,a,s,c;return Zt(this,(function(u){switch(u.label){case 0:if(!Jt.call(this))return r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return G.debug("Call addContact",e,t),o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=o.jid,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(this.user,"/contacts/apply?resource=").concat(s.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:[e],reason:t}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}},[4,j.call(this,c,E.ROSTER_ADD)];case 1:return u.sent(),[2]}}))}))}var vr=_r;function _r(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return Zt(this,(function(c){switch(c.label){case 0:if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return G.debug("Call deleteContact",e),r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/contacts/users/").concat(e,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,s,E.ROSTER_REMOVE)];case 1:return c.sent(),[2]}}))}))}function Rr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return Zt(this,(function(c){switch(c.label){case 0:if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return G.debug("Call acceptInvitation",e),r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/contacts/accept/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,s,E.ROSTER_ACCEPT)];case 1:return c.sent(),[2]}}))}))}var Or=Rr;function Ir(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return Zt(this,(function(c){switch(c.label){case 0:if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return G.debug("Call declineInvitation",e),r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/contacts/decline/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,s,E.ROSTER_DECLINE)];case 1:return c.sent(),[2]}}))}))}var Sr=Ir;function Cr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u;return Zt(this,(function(l){switch(l.label){case 0:if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return G.debug("Call addToBlockList",e),n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,j.call(this,u,E.ROSTER_BAN).then((function(e){return{type:e.type,data:{userIds:(null==e?void 0:e.data)||[]}}}))];case 1:return[2,l.sent()]}}))}))}var Ar=Cr,Nr=Cr;function Mr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u;return Zt(this,(function(l){switch(l.label){case 0:if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if(r=e.name,o=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');o=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');o=r}return G.debug("Call removeFromBlockList",e),n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",data:JSON.stringify({usernames:o}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,j.call(this,u,E.ROSTER_ALLOW)];case 1:return l.sent(),[2]}}))}))}var br=Mr,Ur=Mr;function wr(e){var t=this,r=this.getUniqueId(),o={id:r,to:e.to};this._msgHash[r]=Qt({},o);var n="";void 0!==e.chatType?n=e.chatType:void 0!==e.type&&(n="chat"===e.type?"singleChat":e.type);var i={id:r,type:"recall",chatType:n,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,success:function(r){return $t(t,void 0,void 0,(function(){var t,o,i,a,s,c,u,l,d;return Zt(this,(function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),"singleChat"!==n&&"groupChat"!==n?[3,4]:[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.removeMsgByServerMsgId(e.mid)];case 1:return p.sent(),[4,null===(s=null===(a=this._localCache)||void 0===a?void 0:a.getInstance())||void 0===s?void 0:s.getConversationLastMessage(e.to,n)];case 2:return t=p.sent(),[4,null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.updateLocalConversation(ne({conversationId:e.to,conversationType:n}),{lastMessageId:null==t?void 0:t.serverMsgId})];case 3:p.sent(),p.label=4;case 4:return null===(l=null==e?void 0:e.success)||void 0===l||l.call(e,r),[3,6];case 5:return p.sent(),null===(d=null==e?void 0:e.success)||void 0===d||d.call(e,r),[3,6];case 6:return[2]}}))}))},fail:e.fail};return G.debug("Call recallMessage",e),this.mSync.send(i,this)}function Pr(e){var t=e||{},r=t.messageId,o=t.modifiedMessage;if(G.debug("Call modifyMessage",r,o),""===r)throw Error('Invalid parameter: "messageId"');if("txt"!==o.type)throw Error('Invalid parameter: "modifiedMessage.type"');return this.mSync.send(Qt({editMessageId:r},o))}function kr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u;return Zt(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.reaction,s=e.messageId,c={msgId:s,message:a},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/reaction/user/").concat(this.user),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,u)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return l.sent(),[2]}}))}))}function Lr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c;return Zt(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: ".concat(e.reaction));return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.messageId,s=e.reaction,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/reaction/user/").concat(this.user,"?msgId=").concat(a,"&message=").concat(s),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,c)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return u.sent(),[2]}}))}))}function Dr(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatType,s=e.messageId,c={msgIdList:"string"==typeof s?[s]:s,msgType:"singleChat"===a?"chat":"groupchat",groupId:e.groupId||null},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/reaction/user/").concat(this.user),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,u).then((function(e){var t=e.data;return null==t||t.forEach((function(e){null==e||e.reactionList.forEach((function(e){e.isAddedBySelf=e.state,delete e.state,delete e.reactionId}))})),e}))}var Gr=Dr;function xr(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.cursor,s=e.pageSize,c={msgId:e.messageId,message:e.reaction,currentPage:a||null,pageSize:s||20},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/reaction/user/").concat(this.user,"/detail"),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,u).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function Br(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u,l,p;return Zt(this,(function(h){switch(h.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: ".concat(e.reportType));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: ".concat(e.reportReason));return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.reportType,s=e.reportReason,c=e.messageId,u={username:this.user,reportType:a,reportReason:s},l="".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/user/").concat(this.user,"/moderation/report/message/").concat(c),p={url:l,type:"POST",data:JSON.stringify(u),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,p)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return h.sent(),[2]}}))}))}function jr(e){var t;return $t(this,void 0,void 0,(function(){var r,o,n,i,a,s,c,u,l;return Zt(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter targetId": '+e.targetId);if(!["singleChat","groupChat"].includes(e.chatType))throw Error('"Invalid parameter chatType": '+e.chatType);if(e.beforeTimeStamp&&("number"!=typeof e.beforeTimeStamp||e.beforeTimeStamp<0||(null===(t=e.beforeTimeStamp)||void 0===t?void 0:t.toString().length)>18))throw Error('"Invalid parameter beforeTimeStamp": '+e.beforeTimeStamp);if(e.messageIds&&!(Array.isArray(e.messageIds)&&e.messageIds.length>0&&e.messageIds.length<=20))throw Error('"Invalid parameter messageIds": '+e.messageIds);if(!e.messageIds&&!e.beforeTimeStamp)throw Error("messageIds or beforeTimeStamp field is required.");return Jt.call(this)?(o=this.context,n=o.orgName,i=o.appName,a=o.userId,s="singleChat"===e.chatType?"userId":"groupId",c="singleChat"===e.chatType?"chat":"group",u=e.messageIds?"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"?").concat(s,"=").concat(e.targetId,"&msgIdList=").concat(e.messageIds,"&resource=").concat(this.clientResource):"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"/time?").concat(s,"=").concat(e.targetId,"&delTime=").concat(e.beforeTimeStamp,"&&resource=").concat(this.clientResource),l={url:u,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}},G.debug("Call removeHistoryMessages",e),[4,j.call(this,l)]):(r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(r)]);case 1:return p.sent(),[2]}}))}))}function Hr(e){var t=this;if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||""},headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return G.debug("Call getServerConversations",e),new Promise((function(e,r){j.call(t,s,E.GET_SESSION_LIST).then((function(r){return $t(t,void 0,void 0,(function(){var t,o=this;return Zt(this,(function(n){switch(n.label){case 0:return t=Fr(r),this._localCache?[4,Promise.all(t.data.conversations.map((function(e){return $t(o,void 0,void 0,(function(){var t,r,o=this;return Zt(this,(function(n){return null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.storeMessage(e.lastMessage,oe.SUCCESS,!0).then((function(){var t,r;null===(r=null===(t=o._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.updateLocalConversation(ne({conversationId:e.conversationId,conversationType:e.conversationType}),{unReadCount:e.unReadCount})})),[2]}))}))})))]:[3,2];case 1:return n.sent(),e(t),[2];case 2:return e(t),[2]}}))}))})).catch((function(e){r(e)}))}))}function Fr(e){var t=e.data,r=t.cursor,o=t.channel_infos,n=[];null==o||o.forEach((function(e){var t=null;(null==e?void 0:e.meta)&&"{}"!==JSON.stringify(e.meta)&&(e.meta.payload=JSON.parse(e.meta.payload),"delivery"!==(t=re(e.meta)).type&&"read"!==t.type&&"channel"!==t.type&&(t.chatType=er[t.chatType]));var r={conversationId:e.session_to,conversationType:"chat"===e.session_type?"singleChat":"groupChat",isPinned:e.is_top,pinnedTime:e.is_top?e.update_top_status_time:0,unReadCount:e.unread_num,lastMessage:t};n.push(r)}));var i={conversations:n,cursor:r||""};return{type:e.type,data:i}}function Wr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",is_top:!0},headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call getServerConversations",e),j.call(this,a,E.GET_SESSION_LIST).then((function(e){return Fr(e)}))}function Kr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u,l,p,h,f,g;return Zt(this,(function(y){if(!Jt.call(this))return t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)];if(r=e.conversationId,o=e.conversationType,n=e.isPinned,i="singleChat"===o?"chat":"groupChat","string"!=typeof r||""===r)throw Error("Invalid parameter conversationId: ".concat(r));if(!["singleChat","groupChat"].includes(o))throw Error("Invalid parameter conversationType: ".concat(o));if("boolean"!=typeof n)throw Error("Invalid parameter isPinned: ".concat(n));return a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l=a.jid,p={type:i,to:r},h=n?"":"type=".concat(i,"&to=").concat(r,"&"),f="".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/user_channel/top?").concat(h,"resource=").concat(l.clientResource),g={url:f,type:n?"POST":"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},n&&(g.data=JSON.stringify(p)),G.debug("Call pinConversation",e),[2,j.call(this,g,E.PIN_CONVERSATION).then((function(e){var t=e.type,r=e.data;return{type:t,data:{isPinned:r.is_top||!1,pinnedTime:r.is_top?r.update_top_status_time:0}}}))]}))}))}function qr(e){return $t(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u,l;return Zt(this,(function(p){switch(p.label){case 0:if(t=e.userId,r=e.remark,!Jt.call(this))return o=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(o)];if("string"!=typeof t||""===t)throw Error('Invalid parameter: "userId"');if("string"!=typeof r)throw Error('Invalid parameter: "remark"');return G.debug("Call setContactRemark",e),n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u="".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(this.context.userId,"/contacts/users/").concat(t,"?resource=").concat(c.clientResource),l={url:u,type:"PUT",data:JSON.stringify({remark:r}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,j.call(this,l,E.ROSTER_SET_CONTACT_REMARK)];case 1:return p.sent(),[2]}}))}))}function zr(){if(!Jt.call(this)){var e=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(e)}var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(this.user,"/contacts/users?needReturnRemark=true"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n}};return G.debug("Call getAllContacts"),j.call(this,i,E.ROSTER_GET_ALL_CONTACTS_REMARKS).then((function(e){var t=((null==e?void 0:e.entities)||[]).map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:t}}))}function Vr(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}G.debug("Call getContactsWithCursor",e);var r=e||{},o=r.pageSize,n=void 0===o?20:o,i=r.cursor,a=void 0===i?"":i;if(n&&"number"!=typeof n)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,p={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"/contacts?needReturnRemark=true&limit=").concat(n,"&cursor=").concat(a),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+l}};return j.call(this,p,E.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE).then((function(e){var t,r,o=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.contacts)||[],n=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.cursor)||"",i=o.map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:{cursor:n,contacts:i}}}))}var Jr=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},Xr=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Yr(e){if(!e||!e.data)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups?resource=").concat(a.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,desc:e.data.desc,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm,maxusers:e.data.maxusers,custom:e.data.ext}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:function(t){e.success&&e.success(t)},error:e.error};return G.debug("Call createGroup:",e),j.call(this,s,E.CREATE_GROUP)}var Qr=Yr;function $r(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=o.jid,c={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},u={type:"PUT",url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(this.user,"?resource=").concat(s.clientResource),data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call blockGroupMessages",e),j.call(this,u,E.BLOCK_GROUP)}var Zr=$r;function eo(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={limit:e.limit,cursor:e.cursor};e.cursor||delete a.cursor;var s={url:this.apiUrl+"/"+o+"/"+n+"/publicchatgroups",type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call listGroups",e),j.call(this,s,E.LIST_GROUP)}var to=eo;function ro(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return G.debug("Call getJoinedGroups",e),j.call(this,a,E.GET_USER_GROUP)}function oo(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.needAffiliations||e.needRole?"/chatgroups/user/".concat(this.user,"?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&needAffiliations=").concat(e.needAffiliations,"&needRole=").concat(e.needRole):"/users/".concat(this.user,"/joined_chatgroups?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize),s={url:this.apiUrl+"/"+o+"/"+n+a,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return G.debug("Call getGroup",e),j.call(this,s,E.GET_USER_GROUP).then((function(e){var t=e.uri,r=e.entities,o=[];return t.includes("joined_chatgroups")||(r.forEach((function(e){var t={affiliationsCount:e.affiliations_count,groupName:e.name,groupId:e.groupId,role:e.permission,disabled:e.disabled,approval:e.membersonly,allowInvites:e.allowinvites,description:e.description,maxUsers:e.maxusers,public:e.public};o.push(t)})),e.entities=o),e}))}function no(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=o.jid,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/chatgroups/").concat(e.groupId,"?resource=").concat(s.clientResource),type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return G.debug("Call changeOwner",e),j.call(this,c,E.CHANGE_OWNER)}var io=no;function ao(e){if("string"!=typeof e.groupId&&!Array.isArray(e.groupId))throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupInfo",e),j.call(this,a,E.GET_GROUP_INFO)}function so(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={groupname:e.groupName,description:e.description,custom:e.ext},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call modifyGroup",e),j.call(this,u,E.MODIFY_GROUP)}function co(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call listGroupMember",e),j.call(this,s,E.LIST_GROUP_MEMBER)}var uo=co;function lo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+a+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupAdmin",e),j.call(this,s,E.GET_GROUP_ADMIN)}function po(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/admin?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call setGroupAdmin",e),j.call(this,u,E.SET_GROUP_ADMIN)}var ho=po;function fo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeAdmin",e),j.call(this,u,E.REMOVE_GROUP_ADMIN)}var mo=fo;function go(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"?version=v3&resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call destroyGroup",e),j.call(this,c,E.DISSOLVE_GROUP)}var Eo=go;function yo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call quitGroup",e),j.call(this,c,E.QUIT_GROUP)}var To=yo;function vo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/invite?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call inviteUsersToGroup",e),j.call(this,u,E.INVITE_TO_GROUP)}var _o=vo;function Ro(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(e.groupId,"/apply?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call joinGroup",e),j.call(this,s,E.JOIN_GROUP)}function Oo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!0,reason:"no clue"},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call agreeJoinGroup",e),j.call(this,u,E.AGREE_JOIN_GROUP)}var Io=Oo;function So(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call rejectGroupJoinRequest",e),j.call(this,u,E.REJECT_JOIN_GROUP)}var Co=So;function Ao(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!0},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call acceptGroupInvite",e),j.call(this,u,E.AGREE_INVITE_GROUP)}var No=Ao;function Mo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!1},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call rejectGroupInvite",e),j.call(this,u,E.REJECT_INVITE_GROUP)}var bo=Mo;function Uo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/users/").concat(o,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeGroupMember",e),j.call(this,u,E.REMOVE_GROUP_MEMBER)}var wo=Uo;function Po(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.users.join(","),u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeGroupMembers",e),j.call(this,u,E.MULTI_REMOVE_GROUP_MEMBER)}var ko=Po;function Lo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:"string"==typeof e.username?[e.username]:e.username,mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/mute?resource=").concat(a.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return G.debug("Call muteGroupMember",e),j.call(this,u,E.MUTE_GROUP_MEMBER)}var Do=Lo;function Go(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unmuteGroupMember",e),j.call(this,u,E.UNMUTE_GROUP_MEMBER)}var xo=Go;function Bo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+a+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupMuteList",e),j.call(this,s,E.GET_GROUP_MUTE_LIST)}var jo=Bo,Ho=Bo;function Fo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call blockGroupMember",e),j.call(this,u,E.BLOCK_GROUP_MEMBER)}var Wo=Fo;function Ko(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/blocks/users?resource=").concat(a.clientResource),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call blockGroupMembers",e),j.call(this,u,E.BLOCK_GROUP_MEMBERS)}var qo=Ko;function zo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unblockGroupMember",e),j.call(this,u,E.UNBLOCK_GROUP_MEMBER)}var Vo=zo;function Jo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unblockGroupMembers",e),j.call(this,u,E.UNBLOCK_GROUP_MEMBERS)}var Xo=Jo;function Yo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+a+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupBlacklist",e),j.call(this,s,E.GET_GROUP_BLACK_LIST)}var Qo=Yo,$o=Yo;function Zo(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call disableSendGroupMsg",e),j.call(this,c,E.DISABLED_SEND_GROUP_MSG)}function en(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call enableSendGroupMsg",e),j.call(this,c,E.ENABLE_SEND_GROUP_MSG)}function tn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/white/users?resource=").concat(a.clientResource),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call addUsersToGroupWhitelist",e),j.call(this,u,E.ADD_USERS_TO_GROUP_WHITE)}var rn=tn;function on(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeGroupAllowlistMember",e),j.call(this,c,E.REMOVE_GROUP_WHITE_MEMBER)}var nn=on,an=on;function sn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+a+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupAllowlist",e),j.call(this,s,E.GET_GROUP_WHITE_LIST)}var cn=sn;function un(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+a+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call isInGroupAllowlist",e),j.call(this,s,E.IS_IN_GROUP_WHITE_LIST)}var ln=un,dn=un;function pn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+o+"/"+n+"/sdk/group/"+e.groupId+"/mute/"+a,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return G.debug("Call isInGroupMutelist",e),j.call(this,s).then((function(e){return e.data}))}function hn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+i},success:e.success,error:e.error};return G.debug("Call getGroupMsgReadUser",e),j.call(this,a,E.GET_GROUP_MSG_READ_USER)}function fn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.groupId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(a,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call fetchGroupAnnouncement",e),j.call(this,s,E.GET_GROUP_ANN)}function mn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/announcement?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call updateGroupAnnouncement",e),j.call(this,u,E.UPDATE_GROUP_ANN)}function gn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Jt.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=t.jid,a=e.groupId;X.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/chatgroups/").concat(a,"/share_files?resource=").concat(i.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},E.UPLOAD_GROUP_FILE),G.debug("Call uploadGroupSharedFile",e)}}function En(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call deleteGroupSharedFile",e),j.call(this,u,E.DELETE_GROUP_FILE)}function yn(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.pageNum||1,s=e.pageSize||10,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatgroups/").concat(c,"/share_files?pagenum=").concat(a,"&pagesize=").concat(s),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getGroupSharedFilelist",e),j.call(this,u,E.GET_GROUP_FILE_LIST)}var Tn=yn;function vn(e){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=this.apiUrl,a=e.groupId,s=e.fileId;Y.call(this,{url:"".concat(i,"/").concat(r,"/").concat(o,"/chatgroups/").concat(a,"/share_files/").concat(s),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:n,id:s,secret:e.secret},E.DOWN_GROUP_FILE),G.debug("Call downloadGroupSharedFile",e)}function _n(e){return Jr(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u,l,p;return Xr(this,(function(h){switch(h.label){case 0:if(t=e.groupId,r=e.userId,o=e.memberAttributes,"string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if("string"!=typeof r||""===r)throw Error('Invalid parameter: "userId"');if("object"!=typeof o)throw Error('Invalid parameter: "memberAttributes"');return Jt.call(this)?(i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u=i.jid,l={metaData:o},p={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/sdk/metadata/chatgroup/").concat(t,"/user/").concat(r,"?resource=").concat(u.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},G.debug("Call setGroupMemberAttributes",e),[4,j.call(this,p,E.SET_GROUP_MEMBER_ATTRS)]):(n=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(n)]);case 1:return h.sent(),[2]}}))}))}function Rn(e){var t=e.groupId,r=e.userId;return On.call(this,{groupId:t,userIds:[r]}).then((function(e){var t;return{type:e.type,data:null===(t=e.data)||void 0===t?void 0:t[r]}}))}function On(e){var t=e.groupId,r=e.userIds,o=e.keys,n=void 0===o?[]:o;if("string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(r)||(null==r?void 0:r.length)<=0)throw Error('Invalid parameter: "userIds"');if(!Array.isArray(n))throw Error('Invalid parameter: "keys"');if(!Jt.call(this)){var i=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(i)}var a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l={targets:r,properties:n},p={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/metadata/chatgroup/").concat(t,"/get"),type:"POST",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return G.debug("Call getGroupMembersAttributes",e),j.call(this,p,E.GET_GROUP_MEMBER_ATTR).then((function(e){return{type:e.type,data:(null==e?void 0:e.data)||{}}}))}function In(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+a+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},data:o,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:d.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return G.debug("Call getChatRooms",e),j.call(this,c,E.GET_CHATROOM_LIST)}function Sn(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,a=(o.accessToken,o.jid),s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/chatrooms?resource=").concat(a.clientResource),dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+e.token||0,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call createChatRoom",e),j.call(this,s,E.CREATE_CHATROOM)}function Cn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,r.jid),a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(e.chatRoomId,"?resource=").concat(i.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+e.token||0},success:e.success,error:e.error};return G.debug("Call destroyChatRoom",e),j.call(this,a,E.DESTROY_CHATROOM)}function An(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getChatRoomDetails",e),j.call(this,a,E.GET_CHATROOM_DETAIL)}function Nn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call modifyChatRoom",e),j.call(this,u,E.MODIFY_CHATROOM)}function Mn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeChatRoomMember",e),j.call(this,u,E.REMOVE_CHATROOM_MEMBER)}var bn=Mn;function Un(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users/").concat(o,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeChatRoomMembers",e),j.call(this,u,E.MULTI_REMOVE_CHATROOM_MEMBER)}var wn=Un;function Pn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,a=n.appName,s=n.accessToken,c=n.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call addUsersToChatRoom",e),j.call(this,u,E.ADD_USERS_TO_CHATROOM)}function kn(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}return G.debug("Call joinChatRoom",e),this.mSync.handleChatRoom(e,"join")}function Ln(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}return G.debug("Call leaveChatRoom",e),this.mSync.handleChatRoom(e,"leave")}var Dn=Ln;function Gn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call listChatRoomMembers",e),j.call(this,s,E.LIST_CHATROOM_MEMBERS)}var xn=Gn;function Bn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+a+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getChatRoomAdmin",e),j.call(this,s,E.GET_CHATROOM_ADMIN)}function jn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/admin?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call setChatRoomAdmin",e),j.call(this,u,E.SET_CHATROOM_ADMIN)}function Hn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeChatRoomAdmin",e),j.call(this,u,E.REMOVE_CHATROOM_ADMIN)}function Fn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:[e.username],mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/mute?resource=").concat(a.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return G.debug("Call muteChatRoomMember",e),j.call(this,u,E.MUTE_CHATROOM_MEMBER)}function Wn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unmuteChatRoomMember",e),j.call(this,u,E.REMOVE_MUTE_CHATROOM_MEMBER)}var Kn=Wn;function qn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+a+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getChatRoomMutelist",e),j.call(this,s,E.GET_MUTE_CHATROOM_MEMBERS)}var zn=qn,Vn=qn;function Jn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call blockChatRoomMember",e),j.call(this,u,E.SET_CHATROOM_MEMBER_TO_BLACK)}var Xn=Jn;function Yn(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/blocks/users?resource=").concat(a.clientResource),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Chat blockChatRoomMembers:",u),j.call(this,u,E.MULTI_SET_CHATROOM_MEMBER_TO_BLACK)}var Qn=Yn;function $n(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unblockChatRoomMember",e),j.call(this,u,E.REMOVE_CHATROOM_MEMBER_BLACK)}var Zn=$n;function ei(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call unblockChatRoomMembers",e),j.call(this,u,E.MULTI_REMOVE_CHATROOM_MEMBER_BLACK)}var ti=ei;function ri(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+a+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getChatRoomBlocklist",e),j.call(this,s,E.GET_CHATROOM_BLOCK_MEMBERS)}var oi=ri,ni=ri;function ii(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call disableSendChatRoomMsg",e),j.call(this,c,E.DISABLED_CHATROOM_SEND_MSG)}function ai(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call enableSendChatRoomMsg",e),j.call(this,c,E.ENABLE_CHATROOM_SEND_MSG)}function si(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/white/users?resource=").concat(a.clientResource),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call addUsersToChatRoomWhitelist",e),j.call(this,u,E.ADD_USERS_TO_CHATROOM)}var ci=si;function ui(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call removeChatRoomAllowlistMember",e),j.call(this,c,E.REMOVE_CHATROOM_WHITE_USERS)}var li=ui,di=ui;function pi(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+a+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getChatRoomAllowlist",e),j.call(this,s,E.GET_CHATROOM_WHITE_USERS)}var hi=pi;function fi(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+a+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call isInChatRoomAllowlist",e),j.call(this,s,E.CHECK_CHATROOM_WHITE_USER)}var mi=fi;function gi(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+o+"/"+n+"/sdk/chatrooms/"+e.chatRoomId+"/mute/"+a,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return G.debug("Call isInChatRoomMutelist",e),j.call(this,s).then((function(e){return e.data}))}function Ei(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(a,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call fetchChatRoomAnnouncement",e),j.call(this,s,E.GET_CHATROOM_ANN)}function yi(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/announcement?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call updateChatRoomAnnouncement:",e),j.call(this,u,E.UPDATE_CHATROOM_ANN)}function Ti(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Jt.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=t.jid,a=e.roomId;X.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/chatrooms/").concat(a,"/share_files?resource=").concat(i.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey},E.UPLOAD_CHATROOM_FILE),G.debug("Call uploadChatRoomSharedFile",e)}}function vi(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call deleteChatRoomSharedFile",e),j.call(this,u,E.DELETE_CHATROOM_FILE)}function _i(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/chatrooms/").concat(a,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return G.debug("Call fetchChatRoomSharedFileList",e),j.call(this,s,E.GET_CHATROOM_FILES)}var Ri=_i;function Oi(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(e.attributeKeys&&!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributeKeys": '+e.attributeKeys);if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=(r.jid,e.chatRoomId),s={keys:e.attributeKeys},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/metadata/chatroom/").concat(a),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call getChatRoomAttributes:",e),j.call(this,c,E.GET_CHATROOM_ATTR).then((function(e){return{data:e.data,type:e.type}}))}function Ii(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("object"!=typeof e.attributes)throw Error("Invalid parameter attributes: "+e.attributes);if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributes,u=e.autoDelete,l=void 0===u||u,p=e.isForced?"/forced":"",h={metaData:c,autoDelete:l?"DELETE":"NO_DELETE"},f={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/metadata/chatroom/").concat(s,"/user/").concat(a)+p,type:"PUT",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call setChatRoomAttributes:",e),j.call(this,f,E.SET_CHATROOM_ATTR).then((function(e){return Xt(e)}))}function Si(e){var t;if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error("Invalid parameter attributeKey: "+e.attributeKey);if("string"!=typeof e.attributeValue||""===e.attributeValue)throw Error("Invalid parameter attributeValue: "+e.attributeValue);if(!Jt.call(this)){var r=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,a=o.accessToken,s=o.userId,c=e.chatRoomId,u=e.attributeKey,l=e.attributeValue,p=e.autoDelete,h=void 0===p||p,f=e.isForced?"/forced":"",g={metaData:(t={},t[u]=l,t),autoDelete:h?"DELETE":"NO_DELETE"},y={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/metadata/chatroom/").concat(c,"/user/").concat(s)+f,type:"PUT",dataType:"json",data:JSON.stringify(g),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return G.debug("Call setChatRoomAttribute:",e),j.call(this,y,E.SET_CHATROOM_ATTR).then((function(e){var t=Yt(e);if(t)throw t}))}function Ci(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributes": '+e.attributeKeys);if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKeys,u=e.isForced?"/forced":"",l={keys:c},p={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call removeChatRoomAttributes:",e),j.call(this,p,E.DELETE_CHATROOM_ATTR).then((function(e){return Xt(e)}))}function Ai(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error('"Invalid parameter attributeKey": '+e.attributeKey);if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKey,u=e.isForced?"/forced":"",l={keys:[c]},p={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return G.debug("Call removeChatRoomAttribute:",e),j.call(this,p,E.DELETE_CHATROOM_ATTR).then((function(e){var t=Yt(e);if(t)throw t}))}var Ni=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},Mi=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function bi(e){return Ni(this,void 0,void 0,(function(){var t,r,o,n,i,a,s,c,u;return Mi(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return Jt.call(this)?(r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s=this.context.jid.clientResource,c={ext:e.description},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/presence/").concat(s,"/1"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error},G.debug("Call publishPresence:",e),[4,j.call(this,u)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return l.sent(),[2]}}))}))}function Ui(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,a=r.accessToken,s={usernames:e.usernames},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(i,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call subscribePresence:",e),j.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function wi(e){return Ni(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return Mi(this,(function(c){switch(c.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(i,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error},G.debug("Call unsubscribePresence:",e),[4,j.call(this,s)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return c.sent(),[2]}}))}))}function Pi(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(i,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getSubscribedPresenceList:",e),j.call(this,s).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var ki=Pi;function Li(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={usernames:e.usernames},o=this.context,n=o.orgName,i=o.appName,a=o.userId,s=o.accessToken,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getPresenceStatus:",e),j.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function Di(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,o=r.startTime,n=r.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of endTime"');if(!n.hours||"number"!=typeof n.hours||!n.minutes||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}if(!Jt.call(this)){var i=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(i)}var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,p={};switch(t){case 0:p={type:e.options.remindType};break;case 1:p={ignoreDuration:e.options.duration};break;case 2:var h=e.options;o=h.startTime,n=h.endTime,p={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(n.hours,":").concat(n.minutes)}}var f={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/user/").concat(l),type:"PUT",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call setSilentModeForAll:",e),j.call(this,f)}function Gi(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/notification/user/").concat(a),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return G.debug("Call getSilentModeForAll:",e),j.call(this,s)}function xi(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,o=r.startTime,n=r.endTime;if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of startTime"');if(!o.hours||"number"!=typeof o.hours||!o.minutes||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of endTime"');if(!n.hours||"number"!=typeof n.hours||!n.minutes||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}if(!Jt.call(this)){var i=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(i)}var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,p="chatgroup",h={};switch(t){case 0:h={type:e.options.remindType};break;case 1:h={ignoreDuration:e.options.duration};break;case 2:var f=e.options;o=f.startTime,n=f.endTime,h={ignoreInterval:"".concat(o.hours,":").concat(o.minutes,"-").concat(n.hours,":").concat(n.minutes)}}"singleChat"===e.type&&(p="user");var g={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/").concat(p,"/").concat(e.conversationId),type:"PUT",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call setSilentModeForConversation:",e),j.call(this,g)}function Bi(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s="chatgroup";"singleChat"===e.type&&(s="user");var c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/notification/").concat(s,"/").concat(e.conversationId),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call clearRemindTypeForConversation:",e),j.call(this,c)}function ji(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s="chatgroup";"singleChat"===e.type&&(s="user");var c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/notification/").concat(s,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getSilentModeForConversation:",e),j.call(this,c)}function Hi(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s=[],c=[];e.conversationList.forEach((function(e){"singleChat"===e.type?s.push(e.id):c.push(e.id)}));var u=s.length?s.join(","):"",l=c.length?c.join(","):"",p={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/notification?user=").concat(u,"&group=").concat(l),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call getSilentModeForConversations:",e),j.call(this,p)}function Fi(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={translationLanguage:e.language},o=this.context,n=o.accessToken,i=o.orgName,a=o.appName,s=o.userId,c={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(s,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return G.debug("Call setPushPerformLanguage:",e),j.call(this,c)}function Wi(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(i,"/users/").concat(a,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return G.debug("Call getPushPerformLanguage:",e),j.call(this,s)}var Ki=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},qi=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function zi(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,c).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function Vi(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/join?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s).then((function(e){var t=e.data.detail;return t.messageId=t.msgId,t.parentId=t.groupId,delete t.msgId,delete t.groupId,e}))}function Ji(e){return Ki(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return qi(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,s)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return c.sent(),[2]}}))}))}function Xi(e){return Ki(this,void 0,void 0,(function(){var t,r,o,n,i,a,s;return qi(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return Jt.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,j.call(this,s)]):(t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return c.sent(),[2]}}))}))}function Yi(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={name:e.name},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,c)}function Qi(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"/users"),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s)}function $i(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: ".concat(e.username));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId,"/users/").concat(e.username,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s)}function Zi(e){if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:e.parentId?"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/threads/chatgroups/").concat(e.parentId,"/user/").concat(this.user):"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/threads/user/").concat(this.user),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function ea(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={cursor:e.cursor||"",limit:e.pageSize||20},s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/threads/chatgroups/").concat(e.parentId),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function ta(e){if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: ".concat(e.chatThreadIds));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={threadIds:e.chatThreadIds},s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/message"),type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,s).then((function(e){return function(e){var t=e.entities;return null==t||t.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=re(e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}(e)}))}function ra(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/thread/").concat(e.chatThreadId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return j.call(this,a).then((function(e){return e.data.affiliationsCount=e.data.affiliations_count,e.data.messageId=e.data.msgId,e.data.parentId=e.data.groupId,delete e.data.affiliations_count,delete e.data.msgId,delete e.data.groupId,e}))}function oa(){if(!Jt.call(this)){var e=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(e)}var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(o,"/users/").concat(this.user,"/translate/support/language"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n}};return G.debug("Call getSupportedLanguages"),j.call(this,i)}function na(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');if(!Jt.call(this)){var t=m.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,a="".concat(this.apiUrl,"/").concat(o,"/").concat(n,"/users/").concat(this.user,"/translate"),s={text:e.text,to:e.languages},c={url:a,dataType:"json",type:"POST",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i}};return G.debug("Call translateMessage"),j.call(this,c)}var ia=function(){return ia=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ia.apply(this,arguments)},aa=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},sa=$.getEnvInfo(),ca="web"===sa.platform,ua=function(){},la={CLOSED:3,CLOSING:2,CONNECTING:0,OPEN:1},da=function(){function r(o){var u;if(this.name="connection",this.max_cache_length=100,this.isDebug=o.isDebug||!1,this.isReport=!1,this.isHttpDNS=void 0===o.isHttpDNS?ca:o.isHttpDNS,this.heartBeatWait=o.heartBeatWait||3e4,this.autoReconnectNumMax=o.autoReconnectNumMax||5,this.refreshDNSIntervals=this.autoReconnectNumMax<5?this.autoReconnectNumMax:5,this.delivery=o.delivery||!1,this.dnsArr=["https://rs.easemob.com","https://rs.chat.agora.io","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.appKey=o.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=o.apiUrl||"",this.url=o.url||"",this.https=o.https||"undefined"!=typeof window&&"https:"===(null===(u=window.location)||void 0===u?void 0:u.protocol),this.version="4.3.0",this.deviceId=o.deviceId||"webim",this.osType=16,this.useOwnUploadFun=o.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unMSyncSendMsgMap=new Map,this.mr_cache={},this.closeInfo=null,this.reconnecting=!1,"string"!=typeof this.appKey||2!==this.appKey.split("#").length)throw Error("Illegal appKey: ".concat(this.appKey));var l=this.appKey.split("#");this.orgName=l[0],this.appName=l[1],this.listen=Mt.bind(this),this.mSync=this.usePlugin(Ct),this.eventHandler=this.usePlugin(At),Object.assign(r.prototype,e),Object.assign(r.prototype,t),Object.assign(r.prototype,n),Object.assign(r.prototype,i),Object.assign(r.prototype,a),Object.assign(r.prototype,s),Object.assign(r.prototype,c),this.dataReport=new qt({appkey:this.appKey,org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport});var d=0,p=this;Object.defineProperty($,"ajaxUnconventionalErrorTimes",{set:function(e){0!==e&&(G.debug("rest api request fail times: ".concat(e)),(d=e)%5==0&&this.isHttpDNS&&(G.debug("refresh dns config when rest request fail."),Ta.call(p,"refresh",{},{})))},get:function(){return d}})}return r.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},r.prototype.listen=function(e){},r.prototype.addEventHandler=function(e,t){},r.prototype.removeEventHandler=function(e){},r.prototype.registerUser=function(e){var t=this;return new Promise((function(r,o){var n=t.dataReport.geOperateFun({uid:e.username,operationName:E.REGISTER});if(t.isHttpDNS){t.dnsIndex=0;var i=ia(ia({},e),{user:e.username,pwd:e.password,promise:{resolve:r,reject:o}});Ta.call(t,"signup",i,{rpt:n})}else i=ia(ia({},e),{promise:{resolve:r,reject:o}}),pa.call(t,i,{rpt:n})}))},r.prototype.open=function(e){var t=this;return G.debug("open"),new Promise((function(r,o){if(Ea.call(t,e)){e.accessToken&&(t.token=e.accessToken);var n=ia(ia({},e),{promise:{resolve:r,reject:o}}),i=t.dataReport.geOperateFun({uid:e.user,operationName:E.LOGIN});t.isHttpDNS?Ta.call(t,"login",n,{rpt:i}):ha.call(t,n,{rpt:i})}}))},r.prototype.isOpened=function(){return this.sock&&this.sock.readyState===la.OPEN||!1},r.prototype.close=function(){var e,t,r;this.logOut=!0,this.reconnecting=!1,this.context.status=d.STATUS_CLOSING,this.sock&&this.sock.close(),null===(e=this.unMSyncSendMsgMap)||void 0===e||e.clear(),this.stopHeartBeat(),this.rejectMessage(),this.context.status=d.STATUS_CLOSED,this._load_msg_cache=[],this._queues=[],this._msgHash={},this.mr_cache={},this.token="",this.context.accessToken="",this.clearTokenTimeout(),null===(r=null===(t=null==this?void 0:this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.close()},r.prototype.downloadAndParseCombineMessage=function(e){var t=this,r=e.url,o=e.secret;return new Promise((function(e,n){var i,a,s=$.getEnvInfo(),c="web"!==s.platform&&"node"!==s.platform&&"quick_app"!==s.platform&&(null===(a=null===(i=s.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager")),u=function(r){var o=function(e){n({type:d.PARSE_FILE_ERROR,message:"Read file failed",data:e})},i=function(r){return o=t,i=void 0,s=function(){var t,o,i,a,s,u,l,p,h,f,m,g,E;return aa(this,(function(y){switch(y.label){case 0:for(t=c?new Uint8Array(r.data):new Uint8Array(r.target.result),o=0,i=0,a=2,s=t.subarray(o,o+a),u=$.Uint8ArrayToString(s),G.debug("file header:",u),i+=a,l=0,p=2;p<t.length-1;p++)p%2==1&&(l^=t[p]);if(h=t.subarray(t.length-1,t.length),G.debug("checkResult:",l,h[0]===l),h[0]!==l)return[2,n({type:d.PARSE_FILE_ERROR,message:"File verification failed"})];if("cm"!==u)return[3,7];y.label=1;case 1:y.trys.push([1,5,,6]),f=[],m=function(){var e,r,n,s;return aa(this,(function(c){switch(c.label){case 0:return o+=a,i+=a=4,e=t.subarray(o,o+a),o+=a,a=e.reduce((function(t,r,o){return t+(r<<8*(e.length-o-1))}),0),i+=a,r=t.subarray(o,o+a),n=(n=g.root.lookup("easemob.pb.Meta")).decode(r),[4,Ae.call(g,n,0,!0,!0)];case 1:return s=c.sent(),f.push(s),[2]}}))},g=this,y.label=2;case 2:return i<t.length-1?[5,m()]:[3,4];case 3:return y.sent(),[3,2];case 4:return[2,e(f)];case 5:return E=y.sent(),n({type:d.PARSE_FILE_ERROR,message:"Parse file failed",data:E}),[3,6];case 6:return[3,8];case 7:return[2,n({type:d.PARSE_FILE_ERROR,message:"File verification failed"})];case 8:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{c(s.next(e))}catch(e){t(e)}}function n(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof a?o:new a((function(e){e(o)}))).then(r,n)}c((s=s.apply(o,i||[])).next())}));var o,i,a,s};if(c){var a=s.global.getFileSystemManager(),u=r.tempFilePath;a.readFile({filePath:u,success:i,fail:o})}else if(r instanceof Blob){var l=new FileReader;l.readAsArrayBuffer(r),l.onerror=o,l.onload=i}},l=function(e){n({type:d.WEBIM_DOWNLOADFILE_ERROR,message:"Download failed, please try again",data:e})};c?s.global.downloadFile({url:r,success:u,fail:l}):$.download.call(t,{url:r,headers:{Accept:"application/json"},onFileDownloadComplete:u,onFileDownloadError:l,secret:o,accessToken:t.context.accessToken})}))},r.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},r.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},r.prototype.heartBeat=function(){},r.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getTokenExpireTimestamp(e).then((function(r){var o=r.expire_timestamp,n=Date.now();return t.expirationTime=o,t.expiresIn=o-n,t.token=e,t.context.accessToken=e,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e,expire:o}})):Promise.reject({status:!1})},r.prototype.clearTokenTimeout=function(){G.info("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer),this.tokenWillExpireTimer=null,this.tokenExpiredTimer=null},r.prototype.tokenExpireTimeCountDown=function(e){var t=this;G.info("tokenExpireTimeCountDown",e),e>Math.pow(2,31)-1&&(e=Math.pow(2,31)-1),this.tokenWillExpireTimer=setTimeout((function(){var r;t.onTokenWillExpire&&t.onTokenWillExpire(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),G.info("onTokenWillExpire",Math.floor(e/2))}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;G.info("onTokenExpired",0),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},r.prototype.compareTokenExpireTime=function(e,t){var r,o=Number(t)-Number(e);G.debug("compareTokenExpireTime",o),o<=this.expiresIn/2&&o>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),G.info("onTokenWillExpire",o)):o<=0&&(this.closeByTokenExpired(),G.info("closeByTokenExpired",o))},r.prototype.closeByTokenExpired=function(){var e;G.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},r.prototype.rejectMessage=function(){var e=this,t=Object.keys(this._msgHash);if(t.length>0){var r=m.create({type:d.MESSAGE_WEBSOCKET_DISCONNECTED,message:"websocket disconnected"});t.forEach((function(t){var o,n,i;(null===(o=e.unMSyncSendMsgMap)||void 0===o?void 0:o.has(t))||(e._msgHash[t].reject instanceof Function&&e._msgHash[t].reject(r),null===(i=null===(n=e._localCache)||void 0===n?void 0:n.getInstance())||void 0===i||i.updateLocalMessage(t,{serverMsgId:t,status:oe.FAIL}),e._msgHash[t].fail instanceof Function&&e._msgHash[t].fail(r),delete e._msgHash[t])}))}},r.prototype.resetConnState=function(){this.mSync.stopHeartBeat(),this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0},r.prototype.reconnect=function(){var e,t=this;this.sock.readyState!==la.CONNECTING&&this.sock.readyState!==la.OPEN&&(G.info("reconnect: time",this.times),G.info("reconnect sock.readyState: ",this.sock.readyState),!1===this.reconnecting&&(this.reconnecting=!0),null===(e=this.eventHandler)||void 0===e||e.dispatch("onReconnecting"),this.rejectMessage(),this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1),setTimeout((function(){t.sock.readyState!==la.OPEN&&(G.info("login sock.readyState: ",t.sock.readyState),t.sock.close(),ga.call(t,{access_token:t.context.accessToken}),t.times++)}),500*this.times),this.autoReconnectNumTotal++)},r.prototype.send=function(e){return Promise.resolve(null)},r._getSock=function(){},r}();function pa(e,t){var r=this,o=t.rpt,n=t.isRetry,i=e.promise,a=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",s={requestName:y.RESISTER,requestUrl:a},c=e.error||ua;if(!this.orgName&&!this.appName){var u=m.create({type:d.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"signup error"});c(u)}var l={headers:{"Content-type":"application/json"},url:a,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""}),success:function(t){e.success&&e.success(t);var r=ia(ia({},t),{type:d.REQUEST_SUCCESS});i.resolve&&i.resolve(r);var a=t.extraInfo,c=a.httpCode,u=a.elapse;o({isEndApi:!0,isRetry:n,data:ia(ia({},{requestElapse:u,isSuccess:1,code:c}),s)})},error:function(t){var a=t.extraInfo,u=a.elapse,l=a.httpCode,d=a.errDesc;return o({isRetry:n,data:ia(ia({},{requestElapse:u,isSuccess:0,code:l,codeDesc:d}),s)}),r.isHttpDNS&&r.restIndex+1<r.restTotal?(r.restIndex++,va.call(r),pa.call(r,e,{rpt:o,isRetry:n}),Promise.reject(t)):(o({data:{isLastApi:1,isSuccess:0}}),r.clear(),i.reject&&i.reject(t),c(t))}};return $.ajax(l).catch((function(e){i.reject&&i.reject(e)}))}function ha(e,t){var r=this;if(Ea.call(this,e)&&!this.isOpened()){var o=t.rpt,n=t.isRetry;ya.call(this,e),this.user=e.user;var i=e.promise,a=this.context.appName,s=this.context.orgName,c=this.apiUrl+"/"+s+"/"+a+"/token";if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,i.resolve({accessToken:e.accessToken}),ga.call(this,e,o);else if(e.agoraToken)this.grantType="agoraToken",this.token=e.agoraToken,this.context.accessToken=e.agoraToken,this.context.restTokenData=e.agoraToken,i.resolve({accessToken:e.agoraToken}),ga.call(this,e,o);else{this.grantType="password";var u={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},l=JSON.stringify(u),p={headers:{"Content-type":"application/json"},url:c,dataType:"json",data:l,success:function(t){"function"==typeof e.success&&e.success(t),r.token=t.access_token,r.context.restTokenData=t.access_token,r.context.accessToken=t.access_token,r.expiresIn=t.expires_in,i.resolve({accessToken:t.access_token,duration:t.expires_in});var a=t.extraInfo,s=a.httpCode,u=a.elapse,l={requestName:y.LOGIN_BY_PWD,requestElapse:u,requestUrl:c,isSuccess:1,code:s};o({isRetry:n,data:l}),ga.call(r,t,o)}||ua,error:function(t){var a,s=t.extraInfo,u=s.elapse,l=s.httpCode,p=s.errDesc,h={requestName:y.LOGIN_BY_PWD,requestElapse:u,requestUrl:c,isSuccess:0,code:l,codeDesc:p};if(o({isRetry:n,data:h}),r.isHttpDNS&&r.restIndex+1<r.restTotal)return r.restIndex++,va.call(r),void ha.call(r,e,{rpt:o,isRetry:!0});o({data:{isLastApi:1,isSuccess:0}}),r.clear(),t.error&&t.error_description?(a=m.create({type:d.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:t.error_description,data:t}),r.onError&&r.onError(a)):(a=m.create({type:d.WEBIM_CONNCTION_OPEN_ERROR,message:t.error_description,data:t}),r.onError&&r.onError(a)),"function"==typeof e.error&&e.error(a),i.reject(a)}||ua,version:"4.3.0"};$.ajax(p).catch((function(e){console.warn(e)}))}$.listenNetwork(fa.bind(this),ma.bind(this))}}function fa(){var e;G.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(G.debug("sock.readyState:",this.sock.readyState),this.logOut||this.reconnecting||this.reconnect())}function ma(){var e;G.debug("offline"),this.onOffline&&this.onOffline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOffline")}function ga(e,t){var r=this,o=this._getSock();this.sock=o;var n=function(){var e;G.debug("websocket onOpen"),t&&t({data:{isLastApi:1,isSuccess:1,accessChannel:null===(e=r.socketHost[r.hostIndex])||void 0===e?void 0:e.channel}});var n=$.flow([r.mSync.generateProvision,r.mSync.base64transform])();try{o.send(n)}catch(e){var i=m.create({type:d.SDK_RUNTIME_ERROR,message:"send message error",data:e});r.onError&&r.onError(i)}},i=function(e){setTimeout((function(){var t,o,n,i,a,s,c,u,l,p,h,f;G.debug("websocket onClose"),"zfb"!==sa.platform&&"dd"!==sa.platform||(r.sock.readyState=la.CLOSED);var m=401===(null==e?void 0:e.code)||401===(null===(t=r.closeInfo)||void 0===t?void 0:t.code);if(r.logOut)r.clear(),r.resetConnState(),m&&(G.debug("websocket provision error"),r.closeInfo=null),null===(n=null===(o=null==r?void 0:r._localCache)||void 0===o?void 0:o.getInstance())||void 0===n||n.close(),r.onClosed&&r.onClosed(),null===(i=r.eventHandler)||void 0===i||i.dispatch("onDisconnected");else if(m){G.debug("websocket provision error");var g={type:d.WEBIM_CONNECTION_ERROR,message:"provision error",data:e};r.closeInfo=null,r.onError&&r.onError(g),null===(a=r.eventHandler)||void 0===a||a.dispatch("onError",g),null===(c=null===(s=null==r?void 0:r._localCache)||void 0===s?void 0:s.getInstance())||void 0===c||c.close(),r.onClosed&&r.onClosed(),null===(u=r.eventHandler)||void 0===u||u.dispatch("onDisconnected"),r.resetConnState()}else if(r.autoReconnectNumTotal<r.autoReconnectNumMax){r.reconnect();var E={type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};r.onError&&r.onError(E),r.autoReconnectNumTotal%r.refreshDNSIntervals==0&&"web"===sa.platform&&r.isHttpDNS&&(G.debug("refresh dns config when websocket close"),Ta.call(r,"refresh",{},{}))}else null===(l=r.unMSyncSendMsgMap)||void 0===l||l.clear(),r.rejectMessage(),E={type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},r.onError&&r.onError(E),null===(h=null===(p=null==r?void 0:r._localCache)||void 0===p?void 0:p.getInstance())||void 0===h||h.close(),r.onClosed&&r.onClosed(),null===(f=r.eventHandler)||void 0===f||f.dispatch("onDisconnected"),r.resetConnState(),r.reconnecting=!1,G.debug("reconnect fail")}),0)},a=function(e){var t=r.mSync,o=t.decodeMSync,n=t.distributeMSync;$.flow([o,n])(e)};"web"===sa.platform?(o.onopen=n,o.onclose=i,o.onmessage=a):(o.onOpen(n),o.onMessage(a),o.onClose(i),"undefined"!=typeof window&&window.WebSocket||o.onError((function(e){var o,n,i,a,s;if(G.debug("mini program sock on error",e),r.onError&&r.onError({type:d.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),!r.logOut)if(r.autoReconnectNumTotal<r.autoReconnectNumMax)G.debug("sock.onError reconnect",r.autoReconnectNumTotal,r.autoReconnectNumMax),r.reconnect(),r.autoReconnectNumTotal%r.refreshDNSIntervals==0&&"web"===sa.platform&&r.isHttpDNS&&(G.debug("refresh dns config when websocket error"),Ta.call(r,"refresh",{},{}));else{var c={type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};null===(o=r.unMSyncSendMsgMap)||void 0===o||o.clear(),r.rejectMessage(),r.onError&&r.onError(c),null===(i=null===(n=null==r?void 0:r._localCache)||void 0===n?void 0:n.getInstance())||void 0===i||i.close(),r.onClosed&&r.onClosed(),null===(a=r.eventHandler)||void 0===a||a.dispatch("onDisconnected"),r.resetConnState(),r.reconnecting=!1,G.debug("reconnect fail")}t&&t({data:{isLastApi:1,isSuccess:0,accessChannel:null===(s=r.socketHost[r.hostIndex])||void 0===s?void 0:s.channel}})})))}function Ea(e){if(""===e.user){var t=m.create({type:d.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user cannot be empty"});return G.debug("open params error",t),this.onError&&this.onError(t),!1}var r=this.appKey.split("#");return!(2!==r.length||!r[0]||!r[1])||(t=m.create({type:d.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),G.debug("open params error",t),this.onError&&this.onError(t),!1)}function ya(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource};var t=this.appKey.split("#"),r=t[0],o=t[1];this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=o,this.context.orgName=r}function Ta(e,t,r){var o=this,n=r.rpt,i=r.isRetry,a=this.dnsArr[this.dnsIndex]+"/easemob/server.json",s={url:a,dataType:"json",type:"GET",data:{app_key:encodeURIComponent(this.appKey)},success:function(r){var s=r.extraInfo,c=s.elapse,u=s.httpCode,l={requestUrl:a,requestName:y.GET_DNS,requestElapse:c,isSuccess:1,code:u};"true"===(null==r?void 0:r.enableDataReport)?(o.dataReport.setIsCollectDt(!0),o.dataReport.setIsReportDt(!0)):(o.dataReport.setIsReportDt(!1),o.dataReport.setIsCollectDt(!1)),n&&n({isRetry:i,data:l});var d=r.rest.hosts,p=o.https?"https":"http";if(G.info("httpType: "+p),!d)return Promise.reject(!1);for(var h=d.filter((function(e){if(e.protocol===p)return e})),f=0;f<h.length;f++)if(h[f].protocol===p){var m=h[f];h.splice(f,1),h.unshift(m)}o.restHosts=h,o.restTotal=h.length;var g=r["msync-ws"].hosts;if(!g)return Promise.reject(!1);var E=g.filter((function(e){return e.protocol===p&&e}));o.socketHost=E,o.hostTotal=E.length,va.call(o),"refresh"!==e&&("login"===e?ha.call(o,t,{rpt:n}):pa.call(o,t,{rpt:n}))}||ua,error:function(r){var s=r.extraInfo,c=s.elapse,u=s.httpCode,l=s.errDesc,d={requestUrl:a,requestName:y.GET_DNS,isSuccess:0,code:u,codeDesc:l,requestElapse:c};n&&n({isRetry:i,data:d}),G.debug("getHttpDNS fail: "+o.dnsIndex),o.dnsIndex++,o.dnsIndex<o.dnsTotal&&Ta.call(o,e,t,{rpt:n,isRetry:!0})}||ua};return $.ajax(s).catch((function(e){console.warn(e)}))}function va(){var e,t;if(this.restIndex>this.restTotal)return G.debug("restIndex > restTotal"),"";var r="",o=this.restHosts[this.restIndex],n=o.domain,i=o.ip,a=o.port,s=this.https?"https:":"http:";return i&&"undefined"!=typeof window&&"http:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)?r=s+"//"+i+":"+a:(r=s+"//"+n,a&&"80"!==a&&"443"!==a&&(r+=":".concat(a)),"undefined"==typeof window||window.location||(r="https://"+n),"undefined"!=typeof window&&window.location&&"file:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)&&(r="https://"+n)),"undefined"==typeof window&&(r=s+"//"+n),this.apiUrl=r,r}var _a=$.getEnvInfo(),Ra=_a.global;p.util.Long=f(),p.configure();var Oa=p.Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8},meta:{type:"string",id:9},editMessageId:{type:"uint64",id:11}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18},customEvent:{type:"string",id:19},customExts:{rule:"repeated",type:"KeyValue",id:20},buildingName:{type:"string",id:21},subType:{type:"SubType",id:22},title:{type:"string",id:23},summary:{type:"string",id:24},combineLevel:{type:"int32",id:25}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7,COMBINE:8}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}},SubType:{values:{COMBINE:0}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7,EDIT:8}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}}}},KeyValue:{oneofs:{value:{oneof:["varintValue","floatValue","doubleValue","stringValue"]}},fields:{key:{type:"string",id:1},type:{type:"ValueType",id:2},varintValue:{type:"int64",id:3},floatValue:{type:"float",id:4},doubleValue:{type:"double",id:5},stringValue:{type:"string",id:6}},nested:{ValueType:{values:{BOOL:1,INT:2,UINT:3,LLINT:4,FLOAT:5,DOUBLE:6,STRING:7,JSON_STRING:8}}}},JID:{fields:{appKey:{type:"string",id:1},name:{type:"string",id:2},domain:{type:"string",id:3},clientResource:{type:"string",id:4}}},ConferenceBody:{fields:{sessionId:{type:"string",id:1},operation:{type:"Operation",id:2},conferenceId:{type:"string",id:3},type:{type:"Type",id:4},content:{type:"string",id:5},network:{type:"string",id:6},version:{type:"string",id:7},identity:{type:"Identity",id:8},duration:{type:"string",id:9},peerName:{type:"string",id:10},endReason:{type:"EndReason",id:11},status:{type:"Status",id:12},isDirect:{type:"bool",id:13},controlType:{type:"StreamControlType",id:14},routeFlag:{type:"int32",id:15},routeKey:{type:"string",id:16}},nested:{Status:{fields:{errorCode:{type:"int32",id:1}}},Operation:{values:{JOIN:0,INITIATE:1,ACCEPT_INITIATE:2,ANSWER:3,TERMINATE:4,REMOVE:5,STREAM_CONTROL:6,MEDIA_REQUEST:7}},Type:{values:{VOICE:0,VIDEO:1}},Identity:{values:{CALLER:0,CALLEE:1}},EndReason:{values:{HANGUP:0,NORESPONSE:1,REJECT:2,BUSY:3,FAIL:4,UNSUPPORTED:5,OFFLINE:6}},StreamControlType:{values:{PAUSE_VOICE:0,RESUME_VOICE:1,PAUSE_VIDEO:2,RESUME_VIDEO:3}}}},MSync:{fields:{version:{type:"Version",id:1,options:{default:"MSYNC_V1"}},guid:{type:"JID",id:2},auth:{type:"string",id:3},compressAlgorimth:{type:"uint32",id:4},crypto:{type:"uint32",id:5},userAgent:{type:"string",id:6},pov:{type:"uint64",id:7},command:{type:"Command",id:8},deviceId:{type:"uint32",id:10},encryptType:{rule:"repeated",type:"EncryptType",id:11,options:{packed:!1}},encryptKey:{type:"string",id:12},payload:{type:"bytes",id:9}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3}}}},EncryptType:{values:{ENCRYPT_NONE:0,ENCRYPT_AES_128_CBC:1,ENCRYPT_AES_256_CBC:2}},CommSyncUL:{fields:{meta:{type:"Meta",id:1},key:{type:"uint64",id:2},queue:{type:"JID",id:3},isRoam:{type:"bool",id:4},lastFullRoamKey:{type:"uint64",id:5}}},CommSyncDL:{fields:{status:{type:"Status",id:1},metaId:{type:"uint64",id:2},serverId:{type:"uint64",id:3},metas:{rule:"repeated",type:"Meta",id:4},nextKey:{type:"uint64",id:5},queue:{type:"JID",id:6},isLast:{type:"bool",id:7},timestamp:{type:"uint64",id:8},isRoam:{type:"bool",id:9}}},CommNotice:{fields:{queue:{type:"JID",id:1}}},CommUnreadUL:{fields:{}},CommUnreadDL:{fields:{status:{type:"Status",id:1},unread:{rule:"repeated",type:"MetaQueue",id:2},timestamp:{type:"uint64",id:3}}},MetaQueue:{fields:{queue:{type:"JID",id:1},n:{type:"uint32",id:2}}},Meta:{fields:{id:{type:"uint64",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},timestamp:{type:"uint64",id:4},ns:{type:"NameSpace",id:5},payload:{type:"bytes",id:6},routetype:{type:"RouteType",id:7},ext:{rule:"repeated",type:"KeyValue",id:8},meta:{type:"bytes",id:9},directedUsers:{rule:"repeated",type:"string",id:10}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4,NOTIFY:5,QUERY:6}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1,ROUTE_DIRECT:2}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},reason:{type:"string",id:2},redirectInfo:{rule:"repeated",type:"RedirectInfo",id:3}},nested:{ErrorCode:{values:{OK:0,FAIL:1,UNAUTHORIZED:2,MISSING_PARAMETER:3,WRONG_PARAMETER:4,REDIRECT:5,TOKEN_EXPIRED:6,PERMISSION_DENIED:7,NO_ROUTE:8,UNKNOWN_COMMAND:9,PB_PARSER_ERROR:10,BIND_ANOTHER_DEVICE:11,IM_FORBIDDEN:12,TOO_MANY_DEVICES:13,PLATFORM_LIMIT:14,USER_MUTED:15,ENCRYPT_DISABLE:16,ENCRYPT_ENABLE:17,DECRYPT_FAILURE:18,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14},serviceId:{type:"string",id:16},actionVersion:{type:"string",id:17},authToken:{type:"string",id:18}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}},CompressType:{values:{COMPRESS_NONE:0,COMPRESS_ZLIB:1}}}},MUCBody:{fields:{mucId:{type:"JID",id:1},operation:{type:"Operation",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},setting:{type:"Setting",id:5},reason:{type:"string",id:6},isChatroom:{type:"bool",id:7},status:{type:"Status",id:8},isThread:{type:"bool",id:9},mucParentId:{type:"JID",id:10},mucName:{type:"string",id:11},eventInfo:{type:"EventInfo",id:12}},nested:{Operation:{values:{CREATE:0,DESTROY:1,JOIN:2,LEAVE:3,APPLY:4,APPLY_ACCEPT:5,APPLY_DECLINE:6,INVITE:7,INVITE_ACCEPT:8,INVITE_DECLINE:9,KICK:10,GET_BLACKLIST:11,BAN:12,ALLOW:13,UPDATE:14,BLOCK:15,UNBLOCK:16,PRESENCE:17,ABSENCE:18,DIRECT_JOINED:19,ASSIGN_OWNER:20,ADD_ADMIN:21,REMOVE_ADMIN:22,ADD_MUTE:23,REMOVE_MUTE:24,UPDATE_ANNOUNCEMENT:25,DELETE_ANNOUNCEMENT:26,UPLOAD_FILE:27,DELETE_FILE:28,ADD_USER_WHITE_LIST:29,REMOVE_USER_WHITE_LIST:30,BAN_GROUP:31,REMOVE_BAN_GROUP:32,THREAD_CREATE:33,THREAD_DESTROY:34,THREAD_JOIN:35,THREAD_LEAVE:36,THREAD_KICK:37,THREAD_UPDATE:38,THREAD_PRESENCE:39,THREAD_ABSENCE:40,DISABLE_GROUP:41,ABLE_GROUP:42,SET_METADATA:43,DELETE_METADATA:44,GROUP_MEMBER_METADATA_UPDATE:45}},Setting:{fields:{name:{type:"string",id:1},desc:{type:"string",id:2},type:{type:"Type",id:3},maxUsers:{type:"int32",id:4},owner:{type:"string",id:5}},nested:{Type:{values:{PRIVATE_OWNER_INVITE:0,PRIVATE_MEMBER_INVITE:1,PUBLIC_JOIN_APPROVAL:2,PUBLIC_JOIN_OPEN:3,PUBLIC_ANONYMOUS:4}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}},EventInfo:{fields:{eventType:{type:"EventType",id:1,options:{default:"EVENT_NONE"}},ext:{type:"string",id:2}},nested:{EventType:{values:{EVENT_NONE:0,CIRCLE_CHANNEL:1}}}}}},RosterBody:{fields:{operation:{type:"Operation",id:1},status:{type:"Status",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},reason:{type:"string",id:5},rosterVer:{type:"string",id:6},biDirection:{type:"bool",id:7}},nested:{Operation:{values:{GET_ROSTER:0,GET_BLACKLIST:1,ADD:2,REMOVE:3,ACCEPT:4,DECLINE:5,BAN:6,ALLOW:7,REMOTE_ACCEPT:8,REMOTE_DECLINE:9}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,USER_NOT_EXIST:1,USER_ALREADY_FRIEND:2,USER_ALREADY_BLACKLIST:3}}}}}},StatisticsBody:{fields:{operation:{type:"Operation",id:1},os:{type:"OsType",id:2},version:{type:"string",id:3},network:{type:"NetworkType",id:4},imTime:{type:"uint32",id:5},chatTime:{type:"uint32",id:6},location:{type:"string",id:7}},nested:{Operation:{values:{INFORMATION:0,USER_REMOVED:1,USER_LOGIN_ANOTHER_DEVICE:2,USER_KICKED_BY_CHANGE_PASSWORD:3,USER_KICKED_BY_OTHER_DEVICE:4}},OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});da.prototype.root=Oa;var Ia=function(e){this.onOpen=Ra.onSocketOpen,this.onClose=Ra.onSocketClose,this.onMessage=Ra.onSocketMessage,this.onError=Ra.onSocketError,this.close=Ra.closeSocket,this.send=Ra.sendSocketMessage,this.connectSocket=Ra.connectSocket,this.readyState=3,this.offSocketOpen=Ra.offSocketOpen,this.offSocketMessage=Ra.offSocketMessage,this.offSocketError=Ra.offSocketError,this.offSocketClose=Ra.offSocketClose,this.connect=function(){this.offSocketOpen(),this.offSocketMessage(),this.offSocketClose(),this.offSocketError(),Ra.connectSocket({url:e.url,header:{"content-type":"application/json"},success:function(e){},fail:function(){}})}};da.prototype._getSock=function(){var e;return this.sock&&this.sock.close&&this.sock.close(),(e="zfb"===_a.platform||"dd"===_a.platform?new Ia(this):Ra.connectSocket({url:this.url,header:{"content-type":"application/json"},success:function(e){},fail:function(e){e.errMsg.indexOf("suspend")},complete:function(){}})).connect&&e.connect(),e},da.prototype.getUniqueId=$.getUniqueId,da.prototype.deviceId="miniProgram_"+_a.platform,da.prototype._localCache=void 0;var Sa=G.getLogger("defaultLogger");Sa.setConfig({useCache:!1,maxCache:3145728}),Sa.enableAll(),$.ajax=$.wxRequest;var Ca={connection:da,message:Te,utils:$,logger:Sa,statusCode:d}}(),o}()}));