diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..ed27925d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# 版本更新说明: +## v3.2.2 @ 2020-8-25 +[IM SDK] 创建群组时增加被邀请人是否需要同意的参数 +[IM SDK] 修复头条小程序消息延迟 +[IM SDK] onError回调增加 error message +[IM SDK] 修改附件消息重定向 +[IM SDK] 支持vue-ssr-renderer服务端渲染 diff --git a/newSDK/webimSDK3.1.3.js b/newSDK/webimSDK3.1.3.js deleted file mode 100644 index bb8c8713..00000000 --- a/newSDK/webimSDK3.1.3.js +++ /dev/null @@ -1,111 +0,0 @@ -var parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c=this._array_h.length()&&(this._array_h.slice(this._index),this._index=0)),t},head:function(){var t=null,r=this._array_h.length();return r&&(t=this._array_h.at(r-1)),t},tail:function(){var t=null;return this._array_h.length()&&(t=this._array_h.at(this._index)),t},length:function(){return this._array_h.length()-this._index},empty:function(){return 0===this._array_h.length()},clear:function(){this._array_h.clear()}};var n=r;exports.default=n; -},{}],"LNzP":[function(require,module,exports) { -function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(t)}function t(n){return"function"==typeof Symbol&&"symbol"===o(Symbol.iterator)?module.exports=t=function(t){return o(t)}:module.exports=t=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":o(t)},t(n)}module.exports=t; -},{}],"Aofe":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e,o=t(require("@babel/runtime/helpers/typeof"));function t(e){return e&&e.__esModule?e:{default:e}}function a(e){if(e&&"object"==(0,o.default)(e)){var t=[],a=this.context.root.lookup("easemob.pb.KeyValue"),n=[];for(var i in e){var s=a.decode(t);s.key=i,"object"==(0,o.default)(e[i])?(s.type=8,s.stringValue=JSON.stringify(e[i])):"string"==typeof e[i]?(s.type=7,s.stringValue=e[i]):"boolean"==typeof e[i]?(s.type=1,s.varintValue=e[i]):Number.isInteger(e[i])?(s.type=2,s.varintValue=e[i]):(s.type=6,s.doubleValue=e[i]),n.push(s)}return n}}var n=function(e,t){t.isDebug&&console.log("上行消息:",e);var n=[],i=t.context.root.lookup("easemob.pb.MessageBody.Content").decode(n);t.isDebug&&console.log("上行contentMessage:",i);var s=t.context.root.lookup("easemob.pb.KeyValue"),m=[];switch(e.type){case"txt":i.type=0,i.text=e.msg;break;case"img":i.type=1,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename;break;case"video":i.type=2,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.thumbnailDisplayName=e.body.filename;break;case"loc":i.type=3,i.latitude=e.lat,i.longitude=e.lng,i.address=e.addr,i.latitude=e.lat;break;case"audio":i.type=4,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename;break;case"file":i.type=5,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename;break;case"cmd":i.type=6,i.action=e.action;break;case"custom":i.type=7,i.params=a.call(t,e.params),i.customEvent=e.customEvent,i.customExts=a.call(t,e.customExts)}if(e.ext)for(var r in e.ext){var p=s.decode(n);p.key=r,"object"==(0,o.default)(e.ext[r])?(p.type=8,p.stringValue=JSON.stringify(e.ext[r])):"string"==typeof e.ext[r]?(p.type=7,p.stringValue=e.ext[r]):"boolean"==typeof e.ext[r]?(p.type=1,p.varintValue=e.ext[r]):Number.isInteger(e.ext[r])?(p.type=2,p.varintValue=e.ext[r]):(p.type=6,p.doubleValue=e.ext[r]),m.push(p)}var l=t.context.root.lookup("easemob.pb.MessageBody"),c=l.decode(n);t.isDebug&&console.log("上行messageBody:",c),"recall"===e.type?(c.type=6,c.from={name:t.context.jid.name},c.to={name:e.to},c.ackMessageId=e.ackId):"delivery"===e.type?(c.type=5,c.from={name:t.context.jid.name},c.to={name:e.to},c.ackMessageId=e.ackId):"read"===e.type?(c.type=4,c.from={name:t.context.jid.name},c.to={name:e.to},c.ackMessageId=e.ackId,e.msgConfig&&"groupchat"===e.group&&!e.roomType&&(c.msgConfig=e.msgConfig,c.ackContent=e.ackContent)):e.group||e.roomType?"groupchat"!==e.group||e.roomType?"groupchat"===e.group&&e.roomType&&(c.type=3,c.from={name:t.context.jid.name},c.to={name:e.to}):(c.type=2,c.from={name:t.context.jid.name},c.to={name:e.to},e.msgConfig&&(c.msgConfig=e.msgConfig)):(c.type=1,c.from={name:t.context.jid.name},c.to={name:e.to}),c.contents=[i],c.ext=m,c=l.encode(c).finish();var y=t.context.root.lookup("easemob.pb.Meta").decode(n);if(y.id=e.id,"recall"===e.type){y.from=t.context.jid;var d="easemob.com";"groupchat"!==e.group&&"chatroom"!==e.group||(d="conference.easemob.com"),y.to={appKey:t.appKey,name:e.to,domain:d}}else if("delivery"===e.type)y.from=t.context.jid,y.to={appKey:t.appKey,name:e.to,domain:"easemob.com"};else if("read"===e.type){y.from=t.context.jid;d="easemob.com";"groupchat"===e.group&&(d="conference.easemob.com"),y.to={appKey:t.appKey,name:e.to,domain:d}}else e.group||e.roomType?"groupchat"!==e.group||e.roomType?"groupchat"===e.group&&e.roomType&&(y.from={appKey:t.appKey,name:t.user,domain:"conference.easemob.com"},y.to={appKey:t.appKey,name:e.to,domain:"conference.easemob.com"}):(y.from={appKey:t.appKey,name:t.user,domain:"conference.easemob.com"},y.to={appKey:t.appKey,name:e.to,domain:"conference.easemob.com"}):(y.from=t.context.jid,y.to={appKey:t.appKey,name:e.to,domain:"easemob.com"});y.ns=1,y.payload=c,t.isDebug&&console.log("上行MetaMessage:",y);var g=t.context.root.lookup("easemob.pb.CommSyncUL"),u=g.decode(n);u.meta=y,t.isDebug&&console.log("上行commSyncULMessage:",u),u=g.encode(u).finish();var f=t.context.root.lookup("easemob.pb.MSync"),b=f.decode(n);b.version=t.version,b.encryptType=t.encryptType,b.command=0,b.guid=t.context.jid,b.payload=u,t.isDebug&&console.log("上行MSync:",b),b=f.encode(b).finish(),t.sendMSync(b)},i=function(o,t,a){e=a;var i=t||this;if(i.msg=o,!o.file)return n(i.msg,t);if(i.msg.body&&i.msg.body.url)return n(i.msg,t);var s=i.msg.onFileUploadComplete;i.msg.onFileUploadComplete=function(e){if(e.entities[0]["file-metadata"]){var o=e.entities[0]["file-metadata"]["content-length"];i.msg.filetype=e.entities[0]["file-metadata"]["content-type"],o>204800&&(i.msg.thumbnail=!0)}i.msg.body={type:i.msg.type||"file",url:(t.isHttpDNS?t.apiUrl+e.uri.substr(e.uri.indexOf("/",9)):e.uri)+"/"+e.entities[0].uuid+"?em-redirect=true",secret:e.entities[0]["share-secret"],filename:i.msg.file.filename||i.msg.filename,size:{width:i.msg.width||0,height:i.msg.height||0},length:i.msg.length||0,file_length:i.msg.ext.file_length||0,filetype:i.msg.filetype||i.msg.file.filetype},n(i.msg,t),s instanceof Function&&s(e,i.msg.id)},e.uploadFile.call(t,i.msg)},s=i;exports.default=s; -},{"@babel/runtime/helpers/typeof":"LNzP"}],"YA3p":[function(require,module,exports) { -module.exports=t;var i=null;try{i=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(L){}function t(i,t,n){this.low=0|i,this.high=0|t,this.unsigned=!!n}function n(i){return!0===(i&&i.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0}),t.isLong=n;var h={},s={};function e(i,t){var n,e,r;return t?(r=0<=(i>>>=0)&&i<256)&&(e=s[i])?e:(n=u(i,(0|i)<0?-1:0,!0),r&&(s[i]=n),n):(r=-128<=(i|=0)&&i<128)&&(e=h[i])?e:(n=u(i,i<0?-1:0,!1),r&&(h[i]=n),n)}function r(i,t){if(isNaN(i))return t?N:m;if(t){if(i<0)return N;if(i>=c)return p}else{if(i<=-w)return _;if(i+1>=w)return q}return i<0?r(-i,t).neg():u(i%d|0,i/d|0,t)}function u(i,n,h){return new t(i,n,h)}t.fromInt=e,t.fromNumber=r,t.fromBits=u;var o=Math.pow;function g(i,t,n){if(0===i.length)throw Error("empty string");if("NaN"===i||"Infinity"===i||"+Infinity"===i||"-Infinity"===i)return m;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||360)throw Error("interior hyphen");if(0===h)return g(i.substring(1),t,n).neg();for(var s=r(o(n,8)),e=m,u=0;u>>0:this.low},B.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},B.toString=function(i){if((i=i||10)<2||36>>0).toString(i);if((e=g).isZero())return f+u;for(;f.length<6;)f="0"+f;u=""+f+u}},B.getHighBits=function(){return this.high},B.getHighBitsUnsigned=function(){return this.high>>>0},B.getLowBits=function(){return this.low},B.getLowBitsUnsigned=function(){return this.low>>>0},B.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var i=0!=this.high?this.high:this.low,t=31;t>0&&0==(i&1<=0},B.isOdd=function(){return 1==(1&this.low)},B.isEven=function(){return 0==(1&this.low)},B.equals=function(i){return n(i)||(i=f(i)),(this.unsigned===i.unsigned||this.high>>>31!=1||i.high>>>31!=1)&&(this.high===i.high&&this.low===i.low)},B.eq=B.equals,B.notEquals=function(i){return!this.eq(i)},B.neq=B.notEquals,B.ne=B.notEquals,B.lessThan=function(i){return this.comp(i)<0},B.lt=B.lessThan,B.lessThanOrEqual=function(i){return this.comp(i)<=0},B.lte=B.lessThanOrEqual,B.le=B.lessThanOrEqual,B.greaterThan=function(i){return this.comp(i)>0},B.gt=B.greaterThan,B.greaterThanOrEqual=function(i){return this.comp(i)>=0},B.gte=B.greaterThanOrEqual,B.ge=B.greaterThanOrEqual,B.compare=function(i){if(n(i)||(i=f(i)),this.eq(i))return 0;var t=this.isNegative(),h=i.isNegative();return t&&!h?-1:!t&&h?1:this.unsigned?i.high>>>0>this.high>>>0||i.high===this.high&&i.low>>>0>this.low>>>0?-1:1:this.sub(i).isNegative()?-1:1},B.comp=B.compare,B.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add(E)},B.neg=B.negate,B.add=function(i){n(i)||(i=f(i));var t=this.high>>>16,h=65535&this.high,s=this.low>>>16,e=65535&this.low,r=i.high>>>16,o=65535&i.high,g=i.low>>>16,l=0,a=0,d=0,c=0;return d+=(c+=e+(65535&i.low))>>>16,a+=(d+=s+g)>>>16,l+=(a+=h+o)>>>16,l+=t+r,u((d&=65535)<<16|(c&=65535),(l&=65535)<<16|(a&=65535),this.unsigned)},B.subtract=function(i){return n(i)||(i=f(i)),this.add(i.neg())},B.sub=B.subtract,B.multiply=function(t){if(this.isZero())return m;if(n(t)||(t=f(t)),i)return u(i.mul(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned);if(t.isZero())return m;if(this.eq(_))return t.isOdd()?_:m;if(t.eq(_))return this.isOdd()?_:m;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(v)&&t.lt(v))return r(this.toNumber()*t.toNumber(),this.unsigned);var h=this.high>>>16,s=65535&this.high,e=this.low>>>16,o=65535&this.low,g=t.high>>>16,l=65535&t.high,a=t.low>>>16,d=65535&t.low,c=0,w=0,N=0,E=0;return N+=(E+=o*d)>>>16,w+=(N+=e*d)>>>16,N&=65535,w+=(N+=o*a)>>>16,c+=(w+=s*d)>>>16,w&=65535,c+=(w+=e*a)>>>16,w&=65535,c+=(w+=o*l)>>>16,c+=h*d+s*a+e*l+o*g,u((N&=65535)<<16|(E&=65535),(c&=65535)<<16|(w&=65535),this.unsigned)},B.mul=B.multiply,B.divide=function(t){if(n(t)||(t=f(t)),t.isZero())throw Error("division by zero");var h,s,e;if(i)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?i.div_u:i.div_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?N:m;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return N;if(t.gt(this.shru(1)))return y;e=N}else{if(this.eq(_))return t.eq(E)||t.eq(b)?_:t.eq(_)?E:(h=this.shr(1).div(t).shl(1)).eq(m)?t.isNegative()?E:b:(s=this.sub(t.mul(h)),e=h.add(s.div(t)));if(t.eq(_))return this.unsigned?N:m;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();e=m}for(s=this;s.gte(t);){h=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var g=Math.ceil(Math.log(h)/Math.LN2),l=g<=48?1:o(2,g-48),a=r(h),d=a.mul(t);d.isNegative()||d.gt(s);)d=(a=r(h-=l,this.unsigned)).mul(t);a.isZero()&&(a=E),e=e.add(a),s=s.sub(d)}return e},B.div=B.divide,B.modulo=function(t){return n(t)||(t=f(t)),i?u((this.unsigned?i.rem_u:i.rem_s)(this.low,this.high,t.low,t.high),i.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},B.mod=B.modulo,B.rem=B.modulo,B.not=function(){return u(~this.low,~this.high,this.unsigned)},B.and=function(i){return n(i)||(i=f(i)),u(this.low&i.low,this.high&i.high,this.unsigned)},B.or=function(i){return n(i)||(i=f(i)),u(this.low|i.low,this.high|i.high,this.unsigned)},B.xor=function(i){return n(i)||(i=f(i)),u(this.low^i.low,this.high^i.high,this.unsigned)},B.shiftLeft=function(i){return n(i)&&(i=i.toInt()),0==(i&=63)?this:i<32?u(this.low<>>32-i,this.unsigned):u(0,this.low<>>i|this.high<<32-i,this.high>>i,this.unsigned):u(this.high>>i-32,this.high>=0?0:-1,this.unsigned)},B.shr=B.shiftRight,B.shiftRightUnsigned=function(i){if(n(i)&&(i=i.toInt()),0===(i&=63))return this;var t=this.high;return i<32?u(this.low>>>i|t<<32-i,t>>>i,this.unsigned):u(32===i?t:t>>>i-32,0,this.unsigned)},B.shru=B.shiftRightUnsigned,B.shr_u=B.shiftRightUnsigned,B.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},B.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},B.toBytes=function(i){return i?this.toBytesLE():this.toBytesBE()},B.toBytesLE=function(){var i=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&i,i>>>8&255,i>>>16&255,i>>>24]},B.toBytesBE=function(){var i=this.high,t=this.low;return[i>>>24,i>>>16&255,i>>>8&255,255&i,t>>>24,t>>>16&255,t>>>8&255,255&t]},t.fromBytes=function(i,n,h){return h?t.fromBytesLE(i,n):t.fromBytesBE(i,n)},t.fromBytesLE=function(i,n){return new t(i[0]|i[1]<<8|i[2]<<16|i[3]<<24,i[4]|i[5]<<8|i[6]<<16|i[7]<<24,n)},t.fromBytesBE=function(i,n){return new t(i[4]<<24|i[5]<<16|i[6]<<8|i[7],i[0]<<24|i[1]<<16|i[2]<<8|i[3],n)}; -},{}],"Wui4":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("@babel/runtime/helpers/typeof"));function e(t){return t&&t.__esModule?t:{default:t}}var r=function(){};Object.keys||(Object.keys=function(){var e=Object.prototype.hasOwnProperty,r=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=n.length;return function(i){if("object"!==(0,t.default)(i)&&("function"!=typeof i||null===i))throw new TypeError("Object.keys called on non-object");var a,u,f=[];for(a in i)e.call(i,a)&&f.push(a);if(r)for(u=0;u1e7)return!1;var r=Math.round(e/1e3);if(r<1e3)e=r+" KB";else if(r>=1e3){var n=r/1e3;if(n<1e3)e=n.toFixed(1)+" MB";else e=(n/1e3).toFixed(1)+" GB"}return e},trim:function(t){return(t="string"==typeof t?t:"").trim?t.trim():t.replace(/^\s|\s$/g,"")},parseTextMessage:function(t,e){if("string"==typeof t){if("[object Object]"!==Object.prototype.toString.call(e))return{isemoji:!1,body:[{type:"txt",data:t}]};var r=t,n=[],o=r.match(/\[[^[\]]{2,3}\]/gm);if(!o||o.length<1)return{isemoji:!1,body:[{type:"txt",data:t}]};for(var i=!1,a=0;a0,x=o.errorCode,k=o.reason,v=f.contents[p],M=f.from.name,T=f.to.name,b={};f.ext&&(b=d(f.ext));try{switch(v.type){case 0:var E=f.contents[p].text;if(!O)var O={};var _=s.default.parseTextMessage(E,O&&O.Emoji);_.isemoji?(!(C={id:y,type:u,contentsType:"EMOJI",from:M,to:T,data:_.body,ext:b,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&l.onEmojiMessage(C)):(!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,data:v.text,ext:b,sourceMsg:v.text,time:m,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onTextMessage(C));break;case 1:if(v.size)var I=v.size.width||0,P=v.size.height||0;!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,url:v.remotePath&&l.apiUrl+v.remotePath.substr(v.remotePath.indexOf("/",9)),secret:v.secretKey,filename:v.displayName,thumb:v.thumbnailRemotePath,thumb_secret:v.thumbnailSecretKey,file_length:v.fileLength||"",width:I,height:P,filetype:v.filetype||"",accessToken:r.token||"",ext:b,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onPictureMessage(C);break;case 2:!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,url:v.remotePath&&l.apiUrl+v.remotePath.substr(v.remotePath.indexOf("/",9)),secret:v.secretKey,filename:v.displayName,length:v.duration||"",file_length:v.fileLength||"",filetype:v.filetype||"",accessToken:r.token||"",ext:b,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onVideoMessage(C);break;case 3:!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,addr:v.address,lat:v.latitude,lng:v.longitude,ext:b,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onLocationMessage(C);break;case 4:!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,url:v.remotePath&&l.apiUrl+v.remotePath.substr(v.remotePath.indexOf("/",9)),secret:v.secretKey,filename:v.displayName,file_length:v.fileLength||"",accessToken:r.token||"",ext:b,length:v.duration,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onAudioMessage(C);break;case 5:!(C={id:y,type:u,contentsType:n[v.type],from:M,to:T,url:v.remotePath&&l.apiUrl+v.remotePath.substr(v.remotePath.indexOf("/",9)),secret:v.secretKey,filename:v.displayName,file_length:v.fileLength,accessToken:r.token||"",ext:b,time:m,msgConfig:f.msgConfig}).delay&&delete C.delay,!C.msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onFileMessage(C);break;case 6:!(C={id:y,contentsType:n[v.type],from:M,to:T,action:v.action,ext:b,time:m,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,C.error=h,C.errorText=k,C.errorCode=x,!i&&r.onCmdMessage(C);break;case 7:var N="",w="";f.contents[0].customExts&&(N=d(f.contents[0].customExts)),f.contents[0].params&&(w=d(f.contents[0].params)),C={id:y,contentsType:n[v.type],from:M,to:T,customEvent:v.customEvent,params:w,customExts:N,ext:b,time:m},!i&&r.onCustomMessage(C)}}catch(V){r.onError({type:a.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:V})}if(!i&&1===f.type&&r.delivery&&g(r,C,y),i||r.delivery)return C.message_type=u,C}},m=l;exports.default=m; -},{"long":"YA3p","./sendChatMessage":"Aofe","../status":"KLYY","../message":"KTph","../utils/commonUtil":"Wui4"}],"wnFo":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("long"));function n(e){return e&&e.__esModule?e:{default:e}}var o=function(n,o,t){var c=t.context.root.lookup("easemob.pb.MUCBody").decode(n.payload);new e.default(n.id.low,n.id.high,n.id.unsigned).toString();!function(e){var n={type:"",owner:c.from.name,gid:c.mucId.name,from:c.from.name,fromJid:c.from,to:c.to.length?c.to[0].name:"",toJid:c.to,chatroom:c.isChatroom,status:c.status};({32:function(){n.type=c.isChatroom?"rmChatRoomMute":"rmGroupMute",t.onPresence(n)},31:function(){n.type=c.isChatroom?"muteChatRoom":"muteGroup",t.onPresence(n)},30:function(){n.type=c.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",t.onPresence(n)},29:function(){n.type=c.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",t.onPresence(n)},28:function(){n.type="deleteFile",t.onPresence(n)},27:function(){n.type="uploadFile",t.onPresence(n)},26:function(){n.type="deleteAnnouncement",t.onPresence(n)},25:function(){n.type="updateAnnouncement",t.onPresence(n)},24:function(){n.type="removeMute",t.onPresence(n)},23:function(){n.type="addMute",t.onPresence(n)},22:function(){n.type="removeAdmin",t.onPresence(n)},21:function(){n.type="addAdmin",t.onPresence(n)},20:function(){n.type="changeOwner",t.onPresence(n)},19:function(){n.type="direct_joined",t.onPresence(n)},18:function(){n.type=c.isChatroom?"leaveChatRoom":"leaveGroup",t.onPresence(n)},17:function(){n.type=c.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",t.onPresence(n)},16:function(){n.type="unblock",t.onPresence(n)},15:function(){n.type="block",t.onPresence(n)},14:function(){n.type="update",t.onPresence(n)},13:function(){n.type="allow",n.reason=c.reason,t.onPresence(n)},12:function(){n.type="ban",t.onPresence(n)},11:function(){n.type="getBlackList",t.onPresence(n)},10:function(){n.type="removedFromGroup",n.kicked=n.to,t.onPresence(n)},9:function(){n.type="invite_decline",n.kicked=n.to,t.onPresence(n)},8:function(){n.type="invite_accept",n.kicked=n.to,t.onPresence(n)},7:function(){n.type="invite",n.kicked=n.to,t.onPresence(n)},6:function(){n.type="joinPublicGroupDeclined",t.onPresence(n)},5:function(){n.type="joinPublicGroupSuccess",t.onPresence(n)},4:function(){n.type="joinGroupNotifications",n.reason=c.reason,t.onPresence(n)},3:function(){n.type="leave",t.onPresence(n)},2:function(){n.type="join",t.onPresence(n)},1:function(){n.type="deleteGroupChat",t.onPresence(n)}}[e]||function(){console.log("%c没有匹配".concat(e,"类型"),"background: green")})()}(c.operation)},t=o;exports.default=t; -},{"long":"YA3p"}],"UOYe":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("long"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e,o,a){var t=[],n=a.context.root.lookup("easemob.pb.RosterBody"),r=n.decode(t);"add"===o?r.operation=2:"remove"===o?r.operation=3:"accept"===o?r.operation=4:"decline"===o?r.operation=5:"ban"===o?r.operation=6:"allow"===o&&(r.operation=7),r.from=a.context.jid;var s=[];if("string"==typeof e.to)s.push({appKey:a.appKey||a.context.appKey,name:e.to,domain:"easemob.com"});else if(e.to instanceof Array)for(var c=0;c>8-i%1*8)){if((n=a.charCodeAt(i+=.75))>255)throw new r("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return f}),e.atob||(e.atob=function(e){var o=String(e).replace(/[=]+$/,"");if(o.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,f="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?f+=String.fromCharCode(255&n>>(-2*i&6)):0)a=t.indexOf(a);return f})}(); -},{}],"np0Q":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t,e=i(require("@babel/runtime/helpers/defineProperty")),s=i(require("./chat/handleChatMessage")),r=i(require("./status")),a=i(require("Base64"));function i(t){return t&&t.__esModule?t:{default:t}}var o=(0,r.default)(),n=(t={mr_cache:[],_fetchMessages:function(t,e){var r=t.accessToken||e.context.accessToken;if(e._utils.isCanSetRequestHeader)if(r){var i=e.apiUrl,n=e.context.appName,u=e.context.orgName;if(!n||!u)return void e.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});if(!t.queue)return void e.onError({type:"",msg:"queue is not specified"});var p=t.queue,c=this.mr_cache[p]||(this.mr_cache[p]={msgs:[]}),h=e.context.userId,l=-1;if(c.msgs.length>=t.count||c.is_last)return void("function"==typeof t.success&&t.success(c));c&&c.next_key&&(l=c.next_key);var m={queue:p+(t.isGroup?"@conference.easemob.com":"@easemob.com"),start:l,end:-1},d={url:i+"/"+u+"/"+n+"/users/"+h+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+r},data:JSON.stringify(m),success:function(r,i){if(r&&r.data){var o=r.data;if(!r.data.msgs)return"function"==typeof t.success&&t.success(c),c.is_last=!0,void(c.next_key="");var n=o.msgs,u=n.length;c.is_last=o.is_last,c.next_key=o.next_key;var p=function(t){for(var r=[],i=0,o=(t=a.default.atob(t)).length;i=s||a.is_last?t.success&&t.success(e._utils.reverse(a.msgs.splice(0,s))):r()},fail:function(){}},e)}()}else e.onError({type:"",msg:"queue is not specified"})},getChatRooms:function(t){var e=this,s=t.accessToken||this.context.accessToken;if(e._utils.isCanSetRequestHeader)if(s){var r=t.apiUrl,a=this.context.appName,i=this.context.orgName;if(!a||!i)return void e.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var n={url:r+"/"+i+"/"+a+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},data:{pagenum:parseInt(t.pagenum)||1,pagesize:parseInt(t.pagesize)||20},success:function(e,s){"function"==typeof t.success&&t.success(e)}||e._utils.emptyfn,error:function(t,s,r){t.error&&t.error_description&&e.onError({type:o.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,msg:t.error_description,data:t,xhr:s})}||e._utils.emptyfn};e._utils.ajax(n)}else e.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR});else e.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},joinChatRoom:function(t){t=t||{};if(this._utils.isCanSetRequestHeader){var e=this,s=t.accessToken||this.token;if(s){var r=t.apiUrl||this.apiUrl,a=this.context.appName,i=this.context.orgName,n=t.roomId,u=t.message||"";if(!a||!i)return void e.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var p={url:r+"/"+i+"/"+a+"/chatrooms/"+n+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:u}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:function(e,s){"function"==typeof t.success&&t.success(e)}||e._utils.emptyfn,error:function(e,s,r){"function"==typeof t.error&&t.error(e)}||e._utils.emptyfn};e._utils.ajax(p)}else e.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else e.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},quitChatRoom:function(t){t=t||{};if(this._utils.isCanSetRequestHeader){var e=this,s=t.accessToken||this.token;if(s){var r=t.apiUrl||this.apiUrl,a=this.context.appName,i=this.context.orgName,n=t.roomId;if(!a||!i)return void e.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var u={url:r+"/"+i+"/"+a+"/chatrooms/"+n+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+s},success:function(e,s){"function"==typeof t.success&&t.success(e)}||e._utils.emptyfn,error:function(e,s,r){"function"==typeof t.error&&t.error(e)}||e._utils.emptyfn};e._utils.ajax(u)}else e.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else e.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})},createGroupNew:function(t){t.data.owner=this.user,t.data.invite_need_confirm=!1;var e={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify(t.data),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};e.success=function(e){t.success(e),this.onCreateGroup(e)}.bind(this),e.error=t.error||this._utils.emptyfn,this._utils.ajax(e)},blockGroup:function(t){var e=t.groupId;e="notification_ignore_"+e;var s={entities:[]};s.entities[0]={},s.entities[0][e]=!0;var r={type:"PUT",url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user,data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)},listGroups:function(t){var e=[];if(e.limit=t.limit,e.cursor=t.cursor,e.cursor||delete e.cursor,isNaN(t.limit))throw'The parameter "limit" should be a number';var s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/publicchatgroups",type:"GET",dataType:"json",data:e,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)},getGroup:function(t){var e={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};e.success=t.success||this._utils.emptyfn,e.error=t.error||this._utils.emptyfn,this._utils.ajax(e)},changeOwner:function(t){var e={newowner:t.newOwner},s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(e)};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)},getGroupInfo:function(t){var e={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};e.success=t.success||this._utils.emptyfn,e.error=t.error||this._utils.emptyfn,this._utils.ajax(e)},modifyGroup:function(t){var e=t.groupId,s={groupname:t.groupName,description:t.description},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e,type:"PUT",data:JSON.stringify(s),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)},listGroupMember:function(t){if(isNaN(t.pageNum)||t.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(t.pageSize)||t.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===t.groupId&&void 0===t.groupId)throw'The parameter "groupId" should be added';var e=[],s=t.groupId;e.pagenum=t.pageNum,e.pagesize=t.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+s+"/users",dataType:"json",type:"GET",data:e,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}},(0,e.default)(t,"listGroupMember",function(t){if(isNaN(t.pageNum)||t.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(t.pageSize)||t.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===t.groupId&&void 0===t.groupId)throw'The parameter "groupId" should be added';var e=[],s=t.groupId;e.pagenum=t.pageNum,e.pagesize=t.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+s+"/users",dataType:"json",type:"GET",data:e,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"listChatRoomMember",function(t){if(isNaN(t.pageNum)||t.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(t.pageSize)||t.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===t.chatRoomId&&void 0===t.chatRoomId)throw'The parameter "chatRoomId" should be added';var e=[],s=t.chatRoomId;e.pagenum=t.pageNum,e.pagesize=t.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+s+"/users",dataType:"json",type:"GET",data:e,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"getGroupAdmin",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"setAdmin",function(t){var e=t.groupId,s={newadmin:t.username},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/admin",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeAdmin",function(t){var e=t.groupId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/admin/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"dissolveGroup",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"quitGroup",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"inviteToGroup",function(t){var e=t.groupId,s={usernames:t.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/invite",type:"POST",data:JSON.stringify(s),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"joinGroup",function(t){var e={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:"join group"}),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};e.success=t.success||this._utils.emptyfn,e.error=t.error||this._utils.emptyfn,this._utils.ajax(e)}),(0,e.default)(t,"agreeJoinGroup",function(t){var e=t.groupId,s={applicant:t.applicant,verifyResult:!0,reason:"no clue"},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"rejectJoinGroup",function(t){var e=t.groupId,s={applicant:t.applicant,verifyResult:!1,reason:"no clue"},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"agreeInviteIntoGroup",function(t){var e=t.groupId,s={invitee:t.invitee,verifyResult:!0},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"rejectInviteIntoGroup",function(t){var e=t.groupId,s={invitee:t.invitee,verifyResult:!1},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeSingleGroupMember",function(t){var e=t.groupId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeMultiGroupMember",function(t){var e=t.groupId,s=t.users.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"mute",function(t){var e=t.groupId,s={usernames:[t.username],mute_duration:t.muteDuration},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(s)};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"muteChatRoomMember",function(t){var e=t.chatRoomId,s={usernames:[t.username],mute_duration:t.muteDuration},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(s)};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeMute",function(t){var e=t.groupId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/mute/"+s,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeMuteChatRoomMember",function(t){var e=t.chatRoomId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/mute/"+s,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"getMuted",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"getChatRoomMuted",function(t){var e=t.chatRoomId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"groupBlockSingle",function(t){var e=t.groupId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/blocks/users/"+s,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"chatRoomBlockSingle",function(t){var e=t.chatRoomId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/blocks/users/"+s,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"groupBlockMulti",function(t){var e=t.groupId,s={usernames:t.usernames},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/blocks/users",data:JSON.stringify(s),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"chatRoomBlockMulti",function(t){var e=t.chatRoomId,s={usernames:t.usernames},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/blocks/users",data:JSON.stringify(s),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeGroupBlockSingle",function(t){var e=t.groupId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/blocks/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeChatRoomBlockSingle",function(t){var e=t.chatRoomId,s=t.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/blocks/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeGroupBlockMulti",function(t){var e=t.groupId,s=t.usernames.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/blocks/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"removeChatRoomBlockMulti",function(t){var e=t.chatRoomId,s=t.usernames.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/blocks/users/"+s,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"getGroupBlacklistNew",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"getChatRoomBlacklistNew",function(t){var e=t.chatRoomId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"disableSendGroupMsg",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"disableSendChatRoomMsg",function(t){var e=t.chatRoomId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"enableSendGroupMsg",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"enableSendChatRoomMsg",function(t){var e=t.chatRoomId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"addUsersToGroupWhitelist",function(t){var e=t.groupId,s={usernames:t.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/white/users",type:"POST",data:JSON.stringify(s),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"addUsersToChatRoomWhitelist",function(t){var e=t.chatRoomId,s={usernames:t.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/white/users",type:"POST",data:JSON.stringify(s),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=t.success||this._utils.emptyfn,r.error=t.error||this._utils.emptyfn,this._utils.ajax(r)}),(0,e.default)(t,"rmUsersFromGroupWhitelist",function(t){var e=t.groupId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/white/users/"+t.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"rmUsersFromChatRoomWhitelist",function(t){var e=t.chatRoomId,s={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/white/users/"+t.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"getGroupWhitelist",function(t){var e=t.groupId,s=(t.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"getChatRoomWhitelist",function(t){var e=t.chatRoomId,s=(t.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"isGroupWhiteUser",function(t){var e=t.groupId,s=(t.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e+"/white/users/"+t.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"isChatRoomWhiteUser",function(t){var e=t.chatRoomId,s=(t.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+e+"/white/users/"+t.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});s.success=t.success||this._utils.emptyfn,s.error=t.error||this._utils.emptyfn,this._utils.ajax(s)}),(0,e.default)(t,"getGroupMsgReadUser",function(t){var e=this;t=t||{};if(this._utils.isCanSetRequestHeader){var s=t.accessToken||this.token;if(s){var r=e.apiUrl,a=e.context.appName,i=e.context.orgName;if(!a||!i)return void e.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var n={url:r+"/"+i+"/"+a+"/chatgroups/"+t.groupId+"/acks/"+t.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+s},success:function(e){"function"==typeof t.success&&t.success(e)}||this._utils.emptyfn,error:function(e){"function"==typeof t.error&&t.error(e)}||this._utils.emptyfn};this._utils.ajax(n)}else e.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else conn.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})}),(0,e.default)(t,"getBlacklist",function(t){var e=this;t=t||{};if(this._utils.isCanSetRequestHeader){var s=this,r=t.accessToken||this.token;if(r){var a=t.apiUrl||this.apiUrl,i=this.context.appName,n=this.context.orgName;if(!i||!n)return void s.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var u={url:a+"/"+n+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+r},success:function(s,r){var a={};s.data.forEach(function(t,e){a[t]={name:t}}),e.onBlacklistUpdate(a),"function"==typeof t.success&&t.success(s)}||this._utils.emptyfn,error:function(s,r,a){e.onBlacklistUpdate([]),"function"==typeof t.error&&t.error(s)}||this._utils.emptyfn};this._utils.ajax(u)}else s.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else s.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})}),(0,e.default)(t,"getRoster",function(t){t=t||{};var e=this;if(this._utils.isCanSetRequestHeader){var s=this,r=t.accessToken||this.token;if(r){var a=t.apiUrl||this.apiUrl,i=this.context.appName,n=this.context.orgName;if(!i||!n)return void s.onError({type:o.WEBIM_CONNCTION_AUTH_ERROR});var u={url:a+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+r},success:function(s,r){var a=[];s.data.forEach(function(t,s){a.push({name:t,subscription:"both",jid:e.context.jid})}),"function"==typeof t.success&&t.success(a),e.onRoster&&e.onRoster(a)}||this._utils.emptyfn,error:function(e,s,r){"function"==typeof t.error&&t.error(e)}||this._utils.emptyfn};this._utils.ajax(u)}else s.onError({type:o.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR})}else s.onError({type:o.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR})}),(0,e.default)(t,"fetchGroupAnnouncement",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId,i={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};i.success=t.success||this._utils.emptyfn,i.error=t.error||this._utils.emptyfn,this._utils.ajax(i)}),(0,e.default)(t,"fetchChatRoomAnnouncement",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId,i={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};i.success=t.success||this._utils.emptyfn,i.error=t.error||this._utils.emptyfn,this._utils.ajax(i)}),(0,e.default)(t,"updateGroupAnnouncement",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId,i={announcement:t.announcement},o={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/announcement"),type:"POST",dataType:"json",data:JSON.stringify(i),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=t.success||this._utils.emptyfn,o.error=t.error||this._utils.emptyfn,this._utils.ajax(o)}),(0,e.default)(t,"updateChatRoomAnnouncement",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId,i={announcement:t.announcement},o={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/announcement"),type:"POST",dataType:"json",data:JSON.stringify(i),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=t.success||this._utils.emptyfn,o.error=t.error||this._utils.emptyfn,this._utils.ajax(o)}),(0,e.default)(t,"uploadGroupSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId;this._utils.uploadFile({uploadUrl:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/share_files"),onFileUploadProgress:t.onFileUploadProgress,onFileUploadComplete:t.onFileUploadComplete,onFileUploadError:t.onFileUploadError,onFileUploadCanceled:t.onFileUploadCanceled,accessToken:this.token,apiUrl:e,file:t.file,appKey:this.context.appKey})}),(0,e.default)(t,"uploadChatRoomSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId;this._utils.uploadFile({uploadUrl:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/share_files"),onFileUploadProgress:t.onFileUploadProgress,onFileUploadComplete:t.onFileUploadComplete,onFileUploadError:t.onFileUploadError,onFileUploadCanceled:t.onFileUploadCanceled,accessToken:this.token,apiUrl:e,file:t.file,appKey:this.context.appKey})}),(0,e.default)(t,"deleteGroupSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId,i=t.fileId,o={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/share_files/").concat(i),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=t.success||this._utils.emptyfn,o.error=t.error||this._utils.emptyfn,this._utils.ajax(o)}),(0,e.default)(t,"deleteChatRoomSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId,i=t.fileId,o={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/share_files/").concat(i),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=t.success||this._utils.emptyfn,o.error=t.error||this._utils.emptyfn,this._utils.ajax(o)}),(0,e.default)(t,"downloadGroupSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId,i=t.fileId;this._utils.download.call(this,{url:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/share_files/").concat(i),onFileDownloadComplete:t.onFileDownloadComplete,onFileDownloadError:t.onFileDownloadError,accessToken:this.token,id:i,secret:""})}),(0,e.default)(t,"downloadChatRoomSharedFile",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId,i=t.fileId;this._utils.download.call(this,{url:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/share_files/").concat(i),onFileDownloadComplete:t.onFileDownloadComplete,onFileDownloadError:t.onFileDownloadError,accessToken:this.token,id:i,secret:""})}),(0,e.default)(t,"fetchGroupSharedFileList",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.groupId,i={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatgroups/").concat(a,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};i.success=t.success||this._utils.emptyfn,i.error=t.error||this._utils.emptyfn,this._utils.ajax(i)}),(0,e.default)(t,"fetchChatRoomSharedFileList",function(t){var e=t.apiUrl||this.apiUrl,s=this.context.appName,r=this.context.orgName,a=t.roomId,i={url:"".concat(e,"/").concat(r,"/").concat(s,"/chatrooms/").concat(a,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};i.success=t.success||this._utils.emptyfn,i.error=t.error||this._utils.emptyfn,this._utils.ajax(i)}),t),u=n;exports.default=u; -},{"@babel/runtime/helpers/defineProperty":"xwXl","./chat/handleChatMessage":"TvlR","./status":"KLYY","Base64":"wTgU"}],"h12o":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=h(require("./status")),t=h(require("./message")),s=h(require("./queue")),o=h(require("./chat/sendChatMessage")),n=h(require("./chat/handleChatMessage")),i=h(require("./muc/HandleMucMessage")),r=h(require("./roster/HandleRosterMessage")),a=h(require("./statistics/HandleStatisticsMessage")),p=h(require("long")),c=h(require("./restApis"));function h(e){return e&&e.__esModule?e:{default:e}}var u,l,d={},y=(0,e.default)(),m=100,g=[],f={CLOSED:3,CLOSING:2,CONNECTING:0,OPEN:1},N=function(){},I=function(e,t){if(""==(e=e||{}).user)return t.onError({type:y.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR}),!1;var s=e.user+""||"",o=e.appKey||"",n=o.split("#");if(2!==n.length)return t.onError({type:y.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR}),!1;var i=n[0],r=n[1];return i&&r?(t.context.jid={appKey:o,name:s,domain:t.domain,clientResource:t.clientResource},t.context.root=u,t.context.userId=s,t.context.appKey=o,t.context.appName=r,t.context.orgName=i,!0):(t.onError({type:y.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR}),!1)},v=function e(t){if(!this instanceof e)return new e(t);t=t||{};this.isDebug=t.isDebug||!1,this.isHttpDNS=t.isHttpDNS||!1,this.isMultiLoginSessions=t.isMultiLoginSessions||!1,this.wait=t.wait||30,this.retry=t.retry||!1,this.https=t.https&&"https:"===location.protocol,this.url=t.url,this.hold=t.hold||1,this.route=t.route||null,this.inactivity=t.inactivity||30,this.heartBeatWait=t.heartBeatWait||4500,this.maxRetries=t.maxRetries||5,this.isAutoLogin=!1!==t.isAutoLogin,this.pollingTime=t.pollingTime||800,this.stropheConn=!1,this.autoReconnectNumMax=t.autoReconnectNumMax||0,this.autoReconnectNumTotal=0,this.autoReconnectInterval=t.autoReconnectInterval||0,this.context={status:y.STATUS_INIT},this.sendQueue=new s.default,this.intervalId=null,this.apiUrl=t.apiUrl||"",this.isWindowSDK=t.isWindowSDK||!1,this.encrypt=t.encrypt||{encrypt:{type:"none"}},this.delivery=t.delivery||!1,this.appKey=t.appKey||"",this.domain=t.domain||"easemob.com",this.clientResource="84ff3eba1",this.user="",this.orgName="",this.appName="",this.token="",this.unSendMsgArr=[],this.dnsArr=["https://rs.easemob.com","http://182.92.174.78","http://112.126.66.111"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restIndex=0,this.restTotal=0,this.xmppHosts=[],this.xmppIndex=0,this.xmppTotal=0,this.groupOption={},this.version=t.version||"3.0.0",this.compressAlgorimth=t.compressAlgorimth||0,this.userAgent=t.userAgent||0,this.pov=t.pov||0,this.command=t.command||3,this.deviceId=t.deviceId||"webim",this.encryptKey=t.encryptKey||"",this.firstPayload=t.firstPayload||[],this.compressType=t.compressType||[0],this.encryptType=t.encryptType||[0],this.osType=16};v.prototype.registerUser=function(e){this.isHttpDNS?(this.dnsIndex=0,this.getHttpDNS(e,"signup")):this.signup(e)},v.prototype.listen=function(e){this.onOpened=e.onOpened||N,this.onClosed=e.onClosed||N,this.onTextMessage=e.onTextMessage||N,this.onEmojiMessage=e.onEmojiMessage||N,this.onPictureMessage=e.onPictureMessage||N,this.onAudioMessage=e.onAudioMessage||N,this.onVideoMessage=e.onVideoMessage||N,this.onFileMessage=e.onFileMessage||N,this.onLocationMessage=e.onLocationMessage||N,this.onCustomMessage=e.onCustomMessage||N,this.onCmdMessage=e.onCmdMessage||N,this.onStatisticMessage=e.onStatisticMessage||N,this.onPresence=e.onPresence||N,this.onRoster=e.onRoster||N,this.onError=e.onError||N,this.onReceivedMessage=e.onReceivedMessage||N,this.onInviteMessage=e.onInviteMessage||N,this.onDeliverdMessage=e.onDeliveredMessage||N,this.onReadMessage=e.onReadMessage||N,this.onRecallMessage=e.onRecallMessage||N,this.onMutedMessage=e.onMutedMessage||N,this.onOffline=e.onOffline||N,this.onOnline=e.onOnline||N,this.onConfirmPop=e.onConfirmPop||N,this.onCreateGroup=e.onCreateGroup||N,this.onUpdateMyGroupList=e.onUpdateMyGroupList||N,this.onUpdateMyRoster=e.onUpdateMyRoster||N,this.onBlacklistUpdate=e.onBlacklistUpdate||N,l._listenNetwork(this.onOnline,this.onOffline)},v.prototype.getParams=function(e){u=e.root,l=e.utils,v.prototype._utils=l,d.utils=l,d.statusCode=y,d.message=t.default,d.message.prototype._utils=l},v.prototype._msgHash={},v.prototype._queues=[],v.prototype._lastsession=function(e,t,s){var o=[],n=u.lookup("easemob.pb.CommSyncUL"),i=n.decode(o);i.queue=t,i.key=new p.default(e.low,e.high,e.unsigned).toString(),s.isDebug&&console.log("上行_lastsession: ",i),i=n.encode(i).finish();var r=u.lookup("easemob.pb.MSync"),a=r.decode(o);if(a.version=s.version,a.encryptType=s.encryptType,a.command=0,a.payload=i,a=r.encode(a).finish(),s.sock.readyState!==f.OPEN){var c={type:y.WEBIM_CONNCTION_DISCONNECTED};s.onError(c)}else s._base64transform(a,s)},v.prototype._metapayload=function(e,t,s){for(var o=0;othis.restTotal)){var s="",o=this.restHosts[this.restIndex],n=o.domain,i=o.ip;if(i&&"http:"==location.protocol){var r=o.port;s=("https:"===location.protocol?"https:":"http:")+"//"+i+":"+r}else s=("https:"===location.protocol?"https:":"http:")+"//"+n;""!=s&&(this.apiUrl=s,e.apiUrl=s),"login"==t?this.login(e):this.signup(e)}},v.prototype.getHttpDNS=function(e,t){var s=this,o={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(e.appKey||this.appKey)},success:function(o,n){var i=o.rest.hosts;if(i){for(var r=s.https?"https":"http",a=i.filter(function(e,t){if(e.protocol==r)return e}),p=0;p>>0,this.hi=i>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var r=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(t){if(0===t)return o;var r=t<0;r&&(t=-t);var h=t>>>0,n=(t-h)/4294967296>>>0;return r&&(n=~n>>>0,h=~h>>>0,++h>4294967295&&(h=0,++n>4294967295&&(n=0))),new i(h,n)},i.from=function(r){if("number"==typeof r)return i.fromNumber(r);if("string"==typeof r||r instanceof String){if(!t.Long)return i.fromNumber(parseInt(r,10));r=t.Long.fromString(r)}return r.low||r.high?new i(r.low>>>0,r.high>>>0):o},i.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var i=1+~this.lo>>>0,o=~this.hi>>>0;return i||(o=o+1>>>0),-(i+4294967296*o)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(i){return t.Long?new t.Long(0|this.lo,0|this.hi,Boolean(i)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(i)}};var h=String.prototype.charCodeAt;i.fromHash=function(t){return t===r?o:new i((h.call(t,0)|h.call(t,1)<<8|h.call(t,2)<<16|h.call(t,3)<<24)>>>0,(h.call(t,4)|h.call(t,5)<<8|h.call(t,6)<<16|h.call(t,7)<<24)>>>0)},i.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)},i.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},i.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},i.prototype.length=function(){var t=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return 0===o?0===i?t<16384?t<128?1:2:t<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:o<128?9:10}; -},{"./util":"HQWY"}],"8kOt":[function(require,module,exports) { -function r(r,n,u){var t=u||8192,e=t>>>1,l=null,o=t;return function(u){if(u<1||u>e)return r(u);o+u>t&&(l=r(t),o=0);var a=n.call(l,o,o+=u);return 7&o&&(o=1+(7|o)),a}}module.exports=r; -},{}],"Hofe":[function(require,module,exports) { -function n(n){return"undefined"!=typeof Float32Array?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),r=128===t[3];function o(n,r,o){e[0]=n,r[o]=t[0],r[o+1]=t[1],r[o+2]=t[2],r[o+3]=t[3]}function u(n,r,o){e[0]=n,r[o]=t[3],r[o+1]=t[2],r[o+2]=t[1],r[o+3]=t[0]}function a(n,r){return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],e[0]}function i(n,r){return t[3]=n[r],t[2]=n[r+1],t[1]=n[r+2],t[0]=n[r+3],e[0]}n.writeFloatLE=r?o:u,n.writeFloatBE=r?u:o,n.readFloatLE=r?a:i,n.readFloatBE=r?i:a}():function(){function u(n,e,t,r){var o=e<0?1:0;if(o&&(e=-e),0===e)n(1/e>0?0:2147483648,t,r);else if(isNaN(e))n(2143289344,t,r);else if(e>3.4028234663852886e38)n((o<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)n((o<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var u=Math.floor(Math.log(e)/Math.LN2);n((o<<31|u+127<<23|8388607&Math.round(e*Math.pow(2,-u)*8388608))>>>0,t,r)}}function a(n,e,t){var r=n(e,t),o=2*(r>>31)+1,u=r>>>23&255,a=8388607&r;return 255===u?a?NaN:o*(1/0):0===u?1.401298464324817e-45*o*a:o*Math.pow(2,u-150)*(a+8388608)}n.writeFloatLE=u.bind(null,e),n.writeFloatBE=u.bind(null,t),n.readFloatLE=a.bind(null,r),n.readFloatBE=a.bind(null,o)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),r=128===t[7];function o(n,r,o){e[0]=n,r[o]=t[0],r[o+1]=t[1],r[o+2]=t[2],r[o+3]=t[3],r[o+4]=t[4],r[o+5]=t[5],r[o+6]=t[6],r[o+7]=t[7]}function u(n,r,o){e[0]=n,r[o]=t[7],r[o+1]=t[6],r[o+2]=t[5],r[o+3]=t[4],r[o+4]=t[3],r[o+5]=t[2],r[o+6]=t[1],r[o+7]=t[0]}function a(n,r){return t[0]=n[r],t[1]=n[r+1],t[2]=n[r+2],t[3]=n[r+3],t[4]=n[r+4],t[5]=n[r+5],t[6]=n[r+6],t[7]=n[r+7],e[0]}function i(n,r){return t[7]=n[r],t[6]=n[r+1],t[5]=n[r+2],t[4]=n[r+3],t[3]=n[r+4],t[2]=n[r+5],t[1]=n[r+6],t[0]=n[r+7],e[0]}n.writeDoubleLE=r?o:u,n.writeDoubleBE=r?u:o,n.readDoubleLE=r?a:i,n.readDoubleBE=r?i:a}():function(){function u(n,e,t,r,o,u){var a=r<0?1:0;if(a&&(r=-r),0===r)n(0,o,u+e),n(1/r>0?0:2147483648,o,u+t);else if(isNaN(r))n(0,o,u+e),n(2146959360,o,u+t);else if(r>1.7976931348623157e308)n(0,o,u+e),n((a<<31|2146435072)>>>0,o,u+t);else{var i;if(r<2.2250738585072014e-308)n((i=r/5e-324)>>>0,o,u+e),n((a<<31|i/4294967296)>>>0,o,u+t);else{var l=Math.floor(Math.log(r)/Math.LN2);1024===l&&(l=1023),n(4503599627370496*(i=r*Math.pow(2,-l))>>>0,o,u+e),n((a<<31|l+1023<<20|1048576*i&1048575)>>>0,o,u+t)}}}function a(n,e,t,r,o){var u=n(r,o+e),a=n(r,o+t),i=2*(a>>31)+1,l=a>>>20&2047,f=4294967296*(1048575&a)+u;return 2047===l?f?NaN:i*(1/0):0===l?5e-324*i*f:i*Math.pow(2,l-1075)*(f+4503599627370496)}n.writeDoubleLE=u.bind(null,e,0,4),n.writeDoubleBE=u.bind(null,t,4,0),n.readDoubleLE=a.bind(null,r,0,4),n.readDoubleBE=a.bind(null,o,4,0)}(),n}function e(n,e,t){e[t]=255&n,e[t+1]=n>>>8&255,e[t+2]=n>>>16&255,e[t+3]=n>>>24}function t(n,e,t){e[t]=n>>>24,e[t+1]=n>>>16&255,e[t+2]=n>>>8&255,e[t+3]=255&n}function r(n,e){return(n[e]|n[e+1]<<8|n[e+2]<<16|n[e+3]<<24)>>>0}function o(n,e){return(n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3])>>>0}module.exports=n(n); -},{}],"Gmhw":[function(require,module,exports) { -"use strict";function n(n,e){for(var r=new Array(arguments.length-1),t=0,l=2,o=!0;l0&&".."!==t[i-1]?t.splice(--i,2):l?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};e.resolve=function(e,l,n){return n||(l=t(l)),r(l)?l:(n||(e=t(e)),(e=e.replace(/(?:\/|^)[^\/]+$/,"")).length?t(e+"/"+l):l)}; -},{}],"lxH0":[function(require,module,exports) { -"use strict";var r=module.exports;r.length=function(r){var e=r.length;if(!e)return 0;for(var a=0;--e%4>1&&"="===r.charAt(e);)++a;return Math.ceil(3*r.length)/4-a};for(var e=new Array(64),a=new Array(123),t=0;t<64;)a[e[t]=t<26?t+65:t<52?t+71:t<62?t-4:t-59|43]=t++;r.encode=function(r,a,t){for(var n,o=null,i=[],c=0,s=0;a>2],n=(3&h)<<4,s=1;break;case 1:i[c++]=e[n|h>>4],n=(15&h)<<2,s=2;break;case 2:i[c++]=e[n|h>>6],i[c++]=e[63&h],s=0}c>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),c=0)}return s&&(i[c++]=e[n],i[c++]=61,1===s&&(i[c++]=61)),o?(c&&o.push(String.fromCharCode.apply(String,i.slice(0,c))),o.join("")):String.fromCharCode.apply(String,i.slice(0,c))};var n="invalid encoding";r.decode=function(r,e,t){for(var o,i=t,c=0,s=0;s1)break;if(void 0===(h=a[h]))throw Error(n);switch(c){case 0:o=h,c=1;break;case 1:e[t++]=o<<2|(48&h)>>4,o=h,c=2;break;case 2:e[t++]=(15&o)<<4|(60&h)>>2,o=h,c=3;break;case 3:e[t++]=(3&o)<<6|h,c=0}}if(1===c)throw Error(n);return t-i},r.test=function(r){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(r)}; -},{}],"DDeL":[function(require,module,exports) { -"use strict";var r=module.exports;r.length=function(r){for(var t=0,e=0,n=0;n191&&n<224?a[i++]=(31&n)<<6|63&r[t++]:n>239&&n<365?(n=((7&n)<<18|(63&r[t++])<<12|(63&r[t++])<<6|63&r[t++])-65536,a[i++]=55296+(n>>10),a[i++]=56320+(1023&n)):a[i++]=(15&n)<<12|(63&r[t++])<<6|63&r[t++],i>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),i=0);return o?(i&&o.push(String.fromCharCode.apply(String,a.slice(0,i))),o.join("")):String.fromCharCode.apply(String,a.slice(0,i))},r.write=function(r,t,e){for(var n,o,a=e,i=0;i>6|192,t[e++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=r.charCodeAt(i+1)))?(n=65536+((1023&n)<<10)+(1023&o),++i,t[e++]=n>>18|240,t[e++]=n>>12&63|128,t[e++]=n>>6&63|128,t[e++]=63&n|128):(t[e++]=n>>12|224,t[e++]=n>>6&63|128,t[e++]=63&n|128);return e-a}; -},{}],"IUvN":[function(require,module,exports) { -"use strict";var e=t(require("@babel/runtime/helpers/typeof"));function t(e){return e&&e.__esModule?e:{default:e}}module.exports=i;var r=require("./object");((i.prototype=Object.create(r.prototype)).constructor=i).className="Enum";var s=require("./namespace");function i(t,s,i,o,n){if(r.call(this,t,i),s&&"object"!==(0,e.default)(s))throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=o,this.comments=n||{},this.reserved=void 0,s)for(var u=Object.keys(s),a=0;a-1&&this.oneof.splice(r,1),t.partOf=null,this},o.prototype.onAdd=function(e){r.prototype.onAdd.call(this,e);for(var t=0;t]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,t=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,e=/^ *[*\/]+ */,i=/^\s*\*?\/*/,u=/\n/g,l=/\s/,f=/\\(.?)/g,o={0:"\0",r:"\r",n:"\n",t:"\t"};function s(n){return n.replace(f,function(n,r){switch(r){case"\\":case"":return r;default:return o[r]||""}})}function a(f,o){f=f.toString();var a=0,c=f.length,h=1,g=null,v=null,d=0,p=!1,m=[],w=null;function x(n){return Error("illegal "+n+" (line "+h+")")}function b(n){return f.charAt(n)}function k(n,r){g=f.charAt(n++),d=h,p=!1;var t,l=n-(o?2:3);do{if(--l<0||"\n"===(t=f.charAt(l))){p=!0;break}}while(" "===t||"\t"===t);for(var s=f.substring(n,r).split(u),a=0;a0)return m.shift();if(w)return function(){var n="'"===w?t:r;n.lastIndex=a-1;var e=n.exec(f);if(!e)throw x("string");return a=n.lastIndex,y(w),w=null,s(e[1])}();var e,i,u,g,v;do{if(a===c)return null;for(e=!1;l.test(u=b(a));)if("\n"===u&&++h,++a===c)return null;if("/"===b(a)){if(++a===c)throw x("comment");if("/"===b(a))if(o){if(g=a,v=!1,A(a)){v=!0;do{if((a=I(a))===c)break;a++}while(A(a))}else a=Math.min(c,I(a)+1);v&&k(g,a),h++,e=!0}else{for(v="/"===b(g=a+1);"\n"!==b(++a);)if(a===c)return null;++a,v&&k(g,a-1),++h,e=!0}else{if("*"!==(u=b(a)))return"/";g=a+1,v=o||"*"===b(g);do{if("\n"===u&&++h,++a===c)throw x("comment");i=u,u=b(a)}while("*"!==i||"/"!==u);++a,v&&k(g,a-2),e=!0}}}while(e);var d=a;if(n.lastIndex=0,!n.test(b(d++)))for(;d");var n=_();if(!k.test(n))throw S(n,"name");M("=");var i=new a(R(n),B(_()),t,r);P(i,function(e){if("option"!==e)throw S(e);V(i,e),M(";")},function(){ee(i)}),e.add(i)}(n);break;case"required":case"optional":case"repeated":Q(n,e);break;case"oneof":!function(e,t){if(!k.test(t=_()))throw S(t,"name");var r=new i(R(t));P(r,function(e){"option"===e?(V(r,e),M(";")):(E(e),Q(r,"optional"))}),e.add(r)}(n,e);break;case"extensions":X(n.extensions||(n.extensions=[]));break;case"reserved":X(n.reserved||(n.reserved=[]),!0);break;default:if(!K||!b.test(e))throw S(e);E(e),Q(n,"optional")}}),e.add(n)}(e,t),!0;case"enum":return function(e,t){if(!k.test(t=_()))throw S(t,"name");var r=new o(t);P(r,function(e){switch(e){case"option":V(r,e),M(";");break;case"reserved":X(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!k.test(t))throw S(t,"name");M("=");var r=B(_(),!0),n={};P(n,function(e){if("option"!==e)throw S(e);V(n,e),M(";")},function(){ee(n)}),e.add(t,r,n.comment)}(r,e)}}),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!k.test(t=_()))throw S(t,"service name");var r=new s(t);P(r,function(e){if(!J(r,e)){if("rpc"!==e)throw S(e);!function(e,t){var r=t;if(!k.test(t=_()))throw S(t,"name");var n,a,i,o,s=t;M("("),M("stream",!0)&&(a=!0);if(!b.test(t=_()))throw S(t);n=t,M(")"),M("returns"),M("("),M("stream",!0)&&(o=!0);if(!b.test(t=_()))throw S(t);i=t,M(")");var f=new c(s,r,n,i,a,o);P(f,function(e){if("option"!==e)throw S(e);V(f,e),M(";")}),e.add(f)}(r,e)}}),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!b.test(t=_()))throw S(t,"reference");var r=t;P(null,function(t){switch(t){case"required":case"repeated":case"optional":Q(e,t,r);break;default:if(!K||!b.test(t))throw S(t);E(t),Q(e,"optional",r)}})}(e,t),!0}return!1}function P(e,t,r){var n=Z.line;if(e&&(e.comment=O(),e.filename=x.filename),M("{",!0)){for(var a;"}"!==(a=_());)t(a);M(";",!0)}else r&&r(),M(";"),e&&"string"!=typeof e.comment&&(e.comment=O(n))}function Q(e,t,a){var i=_();if("group"!==i){if(!b.test(i))throw S(i,"type");var o=_();if(!k.test(o))throw S(o,"name");o=R(o),M("=");var s=new n(o,B(_()),i,t,a);P(s,function(e){if("option"!==e)throw S(e);V(s,e),M(";")},function(){ee(s)}),e.add(s),K||!s.repeated||void 0===f.packed[i]&&void 0!==f.basic[i]||s.setOption("packed",!1,!0)}else!function(e,t){var a=_();if(!k.test(a))throw S(a,"name");var i=u.lcFirst(a);a===i&&(a=u.ucFirst(a));M("=");var o=B(_()),s=new r(a);s.group=!0;var c=new n(i,o,a,t);c.filename=x.filename,P(s,function(e){switch(e){case"option":V(s,e),M(";");break;case"required":case"optional":case"repeated":Q(s,e);break;default:throw S(e)}}),e.add(s).add(c)}(e,t)}function V(e,t){var r=M("(",!0);if(!b.test(t=_()))throw S(t,"name");var n=t;r&&(M(")"),n="("+n+")",t=C(),q.test(t)&&(n+=t,_())),M("="),W(e,n)}function W(e,t){if(M("{",!0))do{if(!k.test(z=_()))throw S(z,"name");"{"===C()?W(e,t+"."+z):(M(":"),"{"===C()?W(e,t+"."+z):Y(e,t+"."+z,U(!0)))}while(!M("}",!0));else Y(e,t,U(!0))}function Y(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(M("[",!0)){do{V(e,"option")}while(M(",",!0));M("]")}return e}for(;null!==(z=_());)switch(z){case"package":if(!j)throw S(z);D();break;case"import":if(!j)throw S(z);G();break;case"syntax":if(!j)throw S(z);H();break;case"option":if(!j)throw S(z);V(L,z),M(";");break;default:if(J(L,z)){j=!1;continue}throw S(z)}return x.filename=null,{package:$,imports:I,weakImports:F,syntax:N,root:y}}x._configure=function(){e=require("./tokenize"),t=require("./root"),r=require("./type"),n=require("./field"),a=require("./mapField"),i=require("./oneof"),o=require("./enum"),s=require("./service"),c=require("./method"),f=require("./types"),u=require("./util")}; -},{"./tokenize":"5oGY","./root":"W2Lj","./type":"EOlb","./field":"ixQC","./mapField":"J/IO","./oneof":"ZsNy","./enum":"IUvN","./service":"irfy","./method":"Dw/M","./types":"K1j0","./util":"HQWY"}],"RclE":[function(require,module,exports) { -module.exports=t;var e,l=/\/|\./;function t(e,u){l.test(e)||(e="google/protobuf/"+e+".proto",u={nested:{google:{nested:{protobuf:{nested:u}}}}}),t[e]=u}t("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),t("duration",{Duration:e={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),t("timestamp",{Timestamp:e}),t("empty",{Empty:{fields:{}}}),t("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}}}}),t("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}}}}),t("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),t.get=function(e){return t[e]||null}; -},{}],"g5I+":[function(require,module,exports) { - -var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a1)for(var n=1;n-1||(i.names.push(e),e in s&&l(e,s[e]))}l(a.name,a.pbJsonStr)}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=u.path.resolve,d.prototype.parseFromPbString=c,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return u.asPromise(e,i,t,r);var a=n===p;function f(e,t){if(n){var r=n;if(n=null,a)throw e;r(e,t)}}function l(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){o.filename=e;var n,s=o(t,i,r),l=0;if(s.imports)for(;l-1){var o=e.substring(r);o in s&&(e=o)}if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in s)a?l(e,s[e]):(++c,setTimeout(function(){--c,l(e,s[e])}));else if(a){var d;try{d=u.fs.readFileSync(e).toString("utf8")}catch(p){return void(t||f(p))}l(e,d)}else++c,u.fetch(e,function(r,o){--c,n&&(r?t?c||f(null,i):f(r):l(e,o))})}var c=0;u.isString(t)&&(t=[t]);for(var h,m=0;m-1&&this.deferred.splice(t,1)}}else if(e instanceof f)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r=t)return!0;return!1},u.isReservedName=function(e,t){if(e)for(var r=0;r0;){var o=e.shift();if(n.nested&&n.nested[o]){if(!((n=n.nested[o])instanceof u))throw Error("path conflicts with non-namespace objects")}else n.add(n=new u(o))}return t&&n.addJSON(t),n},u.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return o}else if(o instanceof u&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var i=0;i "+t.len)}function e(t){this.buf=t,this.pos=0,this.len=t.length}var n="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new e(t);if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return new e(new Uint8Array(t));throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new e(t);throw Error("illegal buffer")};function h(){var i=new t(0,0),s=0;if(!(this.len-this.pos>4)){for(;s<3;++s){if(this.pos>=this.len)throw o(this);if(i.lo=(i.lo|(127&this.buf[this.pos])<<7*s)>>>0,this.buf[this.pos++]<128)return i}return i.lo=(i.lo|(127&this.buf[this.pos++])<<7*s)>>>0,i}for(;s<4;++s)if(i.lo=(i.lo|(127&this.buf[this.pos])<<7*s)>>>0,this.buf[this.pos++]<128)return i;if(i.lo=(i.lo|(127&this.buf[this.pos])<<28)>>>0,i.hi=(i.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return i;if(s=0,this.len-this.pos>4){for(;s<5;++s)if(i.hi=(i.hi|(127&this.buf[this.pos])<<7*s+3)>>>0,this.buf[this.pos++]<128)return i}else for(;s<5;++s){if(this.pos>=this.len)throw o(this);if(i.hi=(i.hi|(127&this.buf[this.pos])<<7*s+3)>>>0,this.buf[this.pos++]<128)return i}throw Error("invalid varint encoding")}function u(t,i){return(t[i-4]|t[i-3]<<8|t[i-2]<<16|t[i-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw o(this,8);return new t(u(this.buf,this.pos+=4),u(this.buf,this.pos+=4))}e.create=r.Buffer?function(t){return(e.create=function(t){return r.Buffer.isBuffer(t)?new s(t):n(t)})(t)}:n,e.prototype._slice=r.Array.prototype.subarray||r.Array.prototype.slice,e.prototype.uint32=function(){var t=4294967295;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return t;if(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return t;if((this.pos+=5)>this.len)throw this.pos=this.len,o(this,10);return t}}(),e.prototype.int32=function(){return 0|this.uint32()},e.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},e.prototype.bool=function(){return 0!==this.uint32()},e.prototype.fixed32=function(){if(this.pos+4>this.len)throw o(this,4);return u(this.buf,this.pos+=4)},e.prototype.sfixed32=function(){if(this.pos+4>this.len)throw o(this,4);return 0|u(this.buf,this.pos+=4)},e.prototype.float=function(){if(this.pos+4>this.len)throw o(this,4);var t=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},e.prototype.double=function(){if(this.pos+8>this.len)throw o(this,4);var t=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},e.prototype.bytes=function(){var t=this.uint32(),i=this.pos,s=this.pos+t;if(s>this.len)throw o(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(i,s):i===s?new this.buf.constructor(0):this._slice.call(this.buf,i,s)},e.prototype.string=function(){var t=this.bytes();return i.read(t,0,t.length)},e.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw o(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw o(this)}while(128&this.buf[this.pos++]);return this},e.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){if(4==(t=7&this.uint32()))break;this.skipType(t)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},e._configure=function(){t=require("./longBits"),i=require("./utf8");var s=r.Long?"toLong":"toNumber";r.merge(e.prototype,{int64:function(){return h.call(this)[s](!1)},uint64:function(){return h.call(this)[s](!0)},sint64:function(){return h.call(this).zzDecode()[s](!1)},fixed64:function(){return f.call(this)[s](!0)},sfixed64:function(){return f.call(this)[s](!1)}})}; -},{"./util":"HQWY","./longBits":"n7JO","./utf8":"DDeL"}],"rxi2":[function(require,module,exports) { -"use strict";var e,r,t=n(require("@babel/runtime/helpers/typeof"));function n(e){return e&&e.__esModule?e:{default:e}}function i(e,r){return e.name+": "+r+(e.repeated&&"array"!==r?"[]":e.map&&"object"!==r?"{k:"+e.keyType+"}":"")+" expected"}function a(t,n,a,s){var f=s.types;if(t.resolvedType)if(t.resolvedType instanceof e){if(Object.keys(t.resolvedType.values).indexOf(a)<0)return i(t,"enum value")}else{var u=f[n].verify(a);if(u)return t.name+"."+u}else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!r.isInteger(a))return i(t,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(r.isInteger(a)||a&&r.isInteger(a.low)&&r.isInteger(a.high)))return i(t,"integer|Long");break;case"float":case"double":if("number"!=typeof a)return i(t,"number");break;case"bool":if("boolean"!=typeof a)return i(t,"boolean");break;case"string":if(!r.isString(a))return i(t,"string");break;case"bytes":if(!(a&&"number"==typeof a.length||r.isString(a)))return i(t,"buffer")}}function s(e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!r.key32Re.test(t))return i(e,"integer key");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!r.key64Re.test(t))return i(e,"integer|Long key");break;case"bool":if(!r.key2Re.test(t))return i(e,"boolean key")}}function f(e){return function(n){return function(f){var u;if("object"!==(0,t.default)(f)||null===f)return"object expected";var c,o={};e.oneofsArray.length&&(c={});for(var l=0;l>>0).fork().uint32(8|i.mapKey[p.keyType])[p.keyType](m[v]),void 0===y?o[f].encode(c[m[v]],d.uint32(18).fork()).ldelim().ldelim():d.uint32(16|y)[s](c[m[v]]).ldelim()}else if(p.repeated){if(c&&c.length)if(p.packed&&void 0!==i.packed[s]){d.uint32((p.id<<3|2)>>>0).fork();for(var k=0;k>>0)).uint32((p.id<<3|4)>>>0):o[f].encode(c[g],d.uint32((p.id<<3|2)>>>0).fork()).ldelim():d.uint32((p.id<<3|y)>>>0)[s](c[g])}else(!p.optional||null!=c&&r.hasOwnProperty(p.name))&&(p.optional||null!=c&&r.hasOwnProperty(p.name)||console.warn("注意啦!!!很大概率会报错 类型:",r.$type?r.$type.name:"不晓得","没有设置对应的属性:",p.name,"检查是不是proto文件属性设置为了required"),void 0===y?p.resolvedType.group?o[f].encode(c,d.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):o[f].encode(c,d.uint32((p.id<<3|2)>>>0).fork()).ldelim():d.uint32((p.id<<3|y)>>>0)[s](c))}return d}}}module.exports=n,n._configure=function(){e=require("./enum"),i=require("./types")}; -},{"./enum":"IUvN","./types":"K1j0"}],"vfqs":[function(require,module,exports) { -"use strict";var e,r,o,n=t(require("@babel/runtime/helpers/typeof"));function t(e){return e&&e.__esModule?e:{default:e}}function i(e){return"missing required '"+e.name+"'"}function u(t){return function(u){var s=u.Reader,l=u.types,a=u.util;return function(u,p){u instanceof s||(u=s.create(u));for(var d,c=void 0===p?u.len:u.pos+p,f=new this.ctor;u.pos>>3,v=0,g=!1;v>>0:i[s]=l[s]>>>0;break;case"int32":case"sint32":case"sfixed32":g?i[s][u]=0|l[s][u]:i[s]=0|l[s];break;case"uint64":b=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":n.Long?g?i[s][u]=n.Long.fromValue(l[s][u]).unsigned=b:i[s]=n.Long.fromValue(l[s]).unsigned=b:"string"==typeof(g?l[s][u]:l[s])?g?i[s][u]=parseInt(l[s][u],10):i[s]=parseInt(l[s],10):"number"==typeof(g?l[s][u]:l[s])?g?i[s][u]=l[s][u]:i[s]=l[s]:"object"===(0,e.default)(g?l[s][u]:l[s])&&(g?i[s][u]=new n.LongBits(l[s][u].low>>>0,l[s][u].high>>>0).toNumber(b):i[s]=new n.LongBits(l[s].low>>>0,l[s].high>>>0).toNumber(b));break;case"bytes":"string"==typeof(g?l[s][u]:l[s])?g?n.base64.decode(l[s][u],i[s][u]=n.newBuffer(n.base64.length(l[s][u])),0):n.base64.decode(l[s],i[s]=n.newBuffer(n.base64.length(l[s])),0):(g?l[s][u]:l[s]).length&&(g?i[s][u]=l[s][u]:i[s]=l[s]);break;case"string":g?i[s][u]=String(l[s][u]):i[s]=String(l[s]);break;case"bool":g?i[s][u]=Boolean(l[s][u]):i[s]=Boolean(l[s])}}}function a(e,t,o,s){var a=s.m,i=s.d,l=s.types,f=s.ksi,u=s.o,g=void 0!==f;if(e.resolvedType)e.resolvedType instanceof r?g?i[o][f]=u.enums===String?l[t].values[a[o][f]]:a[o][f]:i[o]=u.enums===String?l[t].values[a[o]]:a[o]:g?i[o][f]=l[t].toObject(a[o][f],u):i[o]=l[t].toObject(a[o],u);else{var c=!1;switch(e.type){case"double":case"float":g?i[o][f]=u.json&&!isFinite(a[o][f])?String(a[o][f]):a[o][f]:i[o]=u.json&&!isFinite(a[o])?String(a[o]):a[o];break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":"number"==typeof a[o][f]?g?i[o][f]=u.longs===String?String(a[o][f]):a[o][f]:i[o]=u.longs===String?String(a[o]):a[o]:g?i[o][f]=u.longs===String?n.Long.prototype.toString.call(a[o][f]):u.longs===Number?new n.LongBits(a[o][f].low>>>0,a[o][f].high>>>0).toNumber(c):a[o][f]:i[o]=u.longs===String?n.Long.prototype.toString.call(a[o]):u.longs===Number?new n.LongBits(a[o].low>>>0,a[o].high>>>0).toNumber(c):a[o];break;case"bytes":g?i[o][f]=u.bytes===String?n.base64.encode(a[o][f],0,a[o][f].length):u.bytes===Array?Array.prototype.slice.call(a[o][f]):a[o][f]:i[o]=u.bytes===String?n.base64.encode(a[o],0,a[o].length):u.bytes===Array?Array.prototype.slice.call(a[o]):a[o];break;default:g?i[o][f]=a[o][f]:i[o]=a[o]}}}o._configure=function(){r=require("./enum"),n=require("./util")},o.fromObject=function(t){var o=t.fieldsArray;return function(t){return function(a){if(a instanceof this.ctor)return a;if(!o.length)return new this.ctor;for(var i=new this.ctor,l=0;l-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}}}(this._oneofsArray[i].oneof);o[s]={get:d.getter,set:d.setter}}i&&Object.defineProperties(e.prototype,o)}}}),y.generateConstructor=function(e){return function(t){for(var r,i=0;i-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},r.oneOfSetter=function(e){return function(t){for(var r=0;r=65536&&r<=1114111?(n.push(r>>18&7|240),n.push(r>>12&63|128),n.push(r>>6&63|128),n.push(63&r|128)):r>=2048&&r<=65535?(n.push(r>>12&15|224),n.push(r>>6&63|128),n.push(63&r|128)):r>=128&&r<=2047?(n.push(r>>6&31|192),n.push(63&r|128)):n.push(255&r);return n},r.byteToString=function(e){if("string"==typeof e)return e;for(var t="",r=e,n=0;n127;)i[e++]=127&t|128,t>>>=7;i[e]=t}function a(t,i){this.len=t,this.next=void 0,this.val=i}function f(t,i,e){for(;t.hi;)i[e++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)i[e++]=127&t.lo|128,t.lo=t.lo>>>7;i[e++]=t.lo}function c(t,i,e){i[e]=255&t,i[e+1]=t>>>8&255,i[e+2]=t>>>16&255,i[e+3]=t>>>24}u.create=n.Buffer?function(){return(u.create=function(){return new i})()}:function(){return new u},u.alloc=function(t){return new n.Array(t)},n.Array!==Array&&(u.alloc=n.pool(u.alloc,n.Array.prototype.subarray)),u.prototype._push=function(t,i,e){return this.tail=this.tail.next=new r(t,i,e),this.len+=i,this},a.prototype=Object.create(r.prototype),a.prototype.fn=p,u.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new a((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},u.prototype.int32=function(i){return i<0?this._push(f,10,t.fromNumber(i)):this.uint32(i)},u.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},u.prototype.uint64=function(i){var e=t.from(i);return this._push(f,e.length(),e)},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(i){var e=t.from(i).zzEncode();return this._push(f,e.length(),e)},u.prototype.bool=function(t){return this._push(l,1,t?1:0)},u.prototype.fixed32=function(t){return this._push(c,4,t>>>0)},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(i){var e=t.from(i);return this._push(c,4,e.lo)._push(c,4,e.hi)},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(t){return this._push(n.float.writeFloatLE,4,t)},u.prototype.double=function(t){return this._push(n.float.writeDoubleLE,8,t)};var y=n.Array.prototype.set?function(t,i,e){i.set(t,e)}:function(t,i,e){for(var n=0;n>>0;if(!i)return this._push(l,1,0);if(n.isString(t)){var e=u.alloc(i=o.length(t));o.write(t,e,0),t=e}return this.uint32(i)._push(y,i,t)},u.prototype.string=function(t){var i=o.length(t);return i?this.uint32(i)._push(o.write,i,t):this._push(l,1,0)},u.prototype.fork=function(){return this.states=new h(this),this.head=this.tail=new r(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 r(s,0,0),this.len=0),this},u.prototype.ldelim=function(){var t=this.head,i=this.tail,e=this.len;return this.reset().uint32(e),e&&(this.tail.next=t.next,this.tail=i,this.len+=e),this},u.prototype.finish=function(){for(var t=this.head.next,i=this.constructor.alloc(this.len),e=0;t;)t.fn(t.val,i,e),e+=t.len,t=t.next;return i},u._configure=function(){t=require("./longBits"),e=require("./base64"),o=require("./utf8")}; -},{"./util":"HQWY","./utf8":"DDeL","./longBits":"n7JO","./base64":"lxH0"}],"z2Zv":[function(require,module,exports) { -module.exports=function(){var e={};function r(){e.converter._configure(),e.decoder._configure(),e.encoder._configure(),e.Field._configure(),e.MapField._configure(),e.Message._configure(),e.Namespace._configure(),e.Method._configure(),e.ReflectionObject._configure(),e.OneOf._configure(),e.parse._configure(),e.Reader._configure(),e.Root._configure(),e.Service._configure(),e.verifier._configure(),e.Type._configure(),e.types._configure(),e.wrappers._configure(),e.Writer._configure()}if(e.build="minimal",e.Writer=require("./src/writer"),e.encoder=require("./src/encoder"),e.Reader=require("./src/reader"),e.util=require("./src/util"),e.rpc=require("./src/rpc/service"),e.roots=require("./src/roots"),e.verifier=require("./src/verifier"),e.tokenize=require("./src/tokenize"),e.parse=require("./src/parse"),e.common=require("./src/common"),e.ReflectionObject=require("./src/object"),e.Namespace=require("./src/namespace"),e.Root=require("./src/root"),e.Enum=require("./src/enum"),e.Type=require("./src/type"),e.Field=require("./src/field"),e.OneOf=require("./src/oneof"),e.MapField=require("./src/mapField"),e.Service=require("./src/service"),e.Method=require("./src/method"),e.converter=require("./src/converter"),e.decoder=require("./src/decoder"),e.Message=require("./src/message"),e.wrappers=require("./src/wrappers"),e.types=require("./src/types"),e.util=require("./src/util"),e.configure=r,e.load=function(r,i,o){return"function"==typeof i?(o=i,i=new e.Root):i||(i=new e.Root),i.load(r,o)},e.loadSync=function(r,i){return i||(i=new e.Root),i.loadSync(r)},e.parseFromPbString=function(r,i,o){return"function"==typeof i?(o=i,i=new e.Root):i||(i=new e.Root),i.parseFromPbString(r,o)},r(),arguments&&arguments.length)for(var i=0;i0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=o.name||""}}else{o=document.getElementById(e).value;t.url=o;var a=o.lastIndexOf("/"),i=o.lastIndexOf("\\"),l=Math.max(a,i);t.filename=l<0?o:o.substring(l+1)}var s=t.filename.lastIndexOf(".");return-1!=s&&(t.filetype=t.filename.substring(s+1).toLowerCase()),t}catch(d){throw d}},getFileSize:function(e){var t=document.getElementById(e),r=0;return t&&t.files&&t.files.length>0&&(r=t.files[0].size),r},trim:function(e){return(e="string"==typeof e?e:"").trim?e.trim():e.replace(/^\s|\s$/g,"")},parseLink:function(e){return e=e.replace(/(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-\/=]*/gm,function(e){return""+e+""})},parseJSON:function(e){if(window.JSON&&window.JSON.parse)return window.JSON.parse(e+"");var t,r=null,n=f.trim(e+"");return n&&!f.trim(n.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,function(e,n,o,a){return t&&n&&(r=0),0===r?e:(t=o||n,r+=!a-!o,"")}))?Function("return "+n)():Function("Invalid JSON: "+e)()},parseUploadResponse:function(e){return e.indexOf("callback")>-1?e.slice(9,-1):e},parseDownloadResponse:function(e){return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},uploadFile:function(e){(e=e||{}).onFileUploadProgress=e.onFileUploadProgress||c,e.onFileUploadComplete=e.onFileUploadComplete||c,e.onFileUploadError=e.onFileUploadError||c,e.onFileUploadCanceled=e.onFileUploadCanceled||c;var t=e.accessToken||this.context.accessToken;if(t){var r,o,a,i=e.appKey||this.context.appKey||"";if(i&&(r=(a=i.split("#"))[0],o=a[1]),r||o){var l=e.apiUrl;this.isHttpDNS&&(l=this.apiUrl);var s=e.uploadUrl||l+"/"+r+"/"+o+"/chatfiles";if(f.isCanUploadFileAsync)if((e.file.data?e.file.data.size:void 0)<=0)e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,id:e.id});else{var d=f.xmlrequest();d.upload&&d.upload.addEventListener("progress",e.onFileUploadProgress,!1),d.addEventListener?(d.addEventListener("abort",e.onFileUploadCanceled,!1),d.addEventListener("load",function(t){try{var r=f.parseJSON(d.responseText);try{e.onFileUploadComplete(r)}catch(t){e.onFileUploadError({type:n.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,data:d.responseText,id:e.id,xhr:d})}},!1),d.addEventListener("error",function(t){e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,id:e.id,xhr:d})},!1)):d.onreadystatechange&&(d.onreadystatechange=function(){if(4===d.readyState)if(200===ajax.status)try{var t=f.parseJSON(d.responseText);e.onFileUploadComplete(t)}catch(r){e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,data:d.responseText,id:e.id,xhr:d})}else e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,data:d.responseText,id:e.id,xhr:d});else d.abort(),e.onFileUploadCanceled()}),d.open("POST",s),d.setRequestHeader("restrict-access","true"),d.setRequestHeader("Accept","*/*"),d.setRequestHeader("Authorization","Bearer "+t);var p=new FormData;p.append("file",e.file.data),window.XDomainRequest&&(d.readyState=2),d.send(p)}else f.hasFlash&&"function"==typeof e.flashUpload?e.flashUpload&&e.flashUpload(s,e):e.onFileUploadError({type:n.WEBIM_UPLOADFILE_BROWSER_ERROR,id:e.id})}else e.onFileUploadError({type:n.WEBIM_UPLOADFILE_ERROR,id:e.id})}else e.onFileUploadError({type:n.WEBIM_UPLOADFILE_NO_LOGIN,id:e.id})},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||c,e.onFileDownloadError=e.onFileDownloadError||c;var t=e.accessToken||this.context.accessToken,r=f.xmlrequest();if(t){if(f.isCanDownLoadFile){"addEventListener"in r?(r.addEventListener("load",function(t){e.onFileDownloadComplete(r.response,r)},!1),r.addEventListener("error",function(t){e.onFileDownloadError({type:n.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r})},!1)):"onreadystatechange"in r&&(r.onreadystatechange=function(){4===r.readyState?200===ajax.status?e.onFileDownloadComplete(r.response,r):e.onFileDownloadError({type:n.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r}):(r.abort(),e.onFileDownloadError({type:n.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:r}))});var o=e.method||"GET",a=e.responseType||"blob",i=e.mimeType||"text/plain; charset=x-user-defined";r.open(o,e.url),"undefined"!=typeof Blob?r.responseType=a:r.overrideMimeType(i);var l={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+t},s=e.headers||{};for(var d in s)l[d]=s[d];for(var d in l)l[d]&&r.setRequestHeader(d,l[d]);window.XDomainRequest&&(r.readyState=2),r.send(null)}else e.onFileDownloadComplete()}else e.onFileDownloadError({type:n.WEBIM_DOWNLOADFILE_NO_LOGIN,id:e.id})},parseTextMessage:function(e,t){if("string"==typeof e){if("[object Object]"!==Object.prototype.toString.call(t))return{isemoji:!1,body:[{type:"txt",data:e}]};var r=e,n=[],o=r.match(/\[[^[\]]{2,3}\]/gm);if(!o||o.length<1)return{isemoji:!1,body:[{type:"txt",data:e}]};for(var a=!1,i=0;i0?"&":"?")+(a?a+"&":a)+"_v="+(new Date).getTime(),o=null,a=null}wx.request({url:e.url,data:e.data,header:e.headers,method:n,success:function(e){"200"==e.statusCode?t(e.data):r(e)},complete:function(){},fail:function(e){r(e)}})},ts:function(){var e=new Date,t=e.getHours(),r=e.getMinutes(),n=e.getSeconds();return(t<10?"0"+t:t)+":"+(r<10?"0"+r:r)+":"+(n<10?"0"+n:n)+":"+e.getMilliseconds()+" "},getObjectKey:function(e,t){for(var r in e)if(e[r]==t)return r;return""},sprintf:function(){var e,t,r=arguments,n=r[0]||"";for(e=1,t=r.length;e0)for(var c in s.unSendMsgArr){var i=s.unSendMsgArr[c];s.sendMSync(i),delete s.unSendMsgArr[c]}s.onOpened()}),u.onClose(function(e){if(console.log("onClose",e),!s.logOut&&s.autoReconnectNumTotal0&&(s._backqueue(s._queues[0],s),this.qTimer&&clearTimeout(this.qTimer))}else if(r.status&&0===r.status.errorCode){if(s._msgHash[u]){try{s._msgHash[u].success instanceof Function&&s._msgHash[u].success(u,n)}catch(e){s.onError({type:c.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete s._msgHash[u]}s.onReceivedMessage({id:u,mid:n}),s.heartBeat(s)}else if(r.status&&15===r.status.errorCode)s.onMutedMessage({mid:n});else if(r.status&&1===r.status.errorCode){var l="";switch(r.status.reason){case"blocked":l=c.PERMISSION_DENIED;break;case"group not found":l=c.GROUP_NOT_EXIST;break;case"not in group or chatroom":l=c.GROUP_NOT_JOINED;break;case"exceed recall time limit":l=c.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":l=c.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":l=c.SERVICE_NOT_ALLOW_MESSAGING;break;default:l=c.SERVER_UNKNOWN_ERROR}s.onError({type:l,reason:r.status.reason?r.status.reason:"",data:{id:u,mid:n}})}else if(r.status&&7===r.status.errorCode&&"sensitive words"===r.status.reason)s.onError({type:c.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:u,mid:n}});else{if(s._msgHash[u]){try{s._msgHash[u].fail instanceof Function&&s._msgHash[u].fail(u,n)}catch(e){s.onError({type:c.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e})}delete s._msgHash[u]}s.onError({type:c.WEBIM_LOAD_MSG_ERROR,data:{errorCode:r.status&&r.status.errorCode,reason:r.status&&r.status.reason}})}break;case 1:var _=d.lookup("easemob.pb.CommUnreadDL");if(0===(_=_.decode(o.payload)).unread.length);else for(var p=0;p<_.unread.length;p++)s._backqueue(_.unread[p].queue,s);s._rebuild();break;case 2:var f=d.lookup("easemob.pb.CommNotice").decode(o.payload);if(!1!==a.default.checkArray(s._queues,f.queue))return;s._queues.push(f.queue),this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout(function(){var e=f.queue;!1!==a.default.checkArray(s._queues,e)&&s._backqueue(e,s)},2e4),1==s._queues.length&&s._backqueue(f.queue,s);break;case 3:s._receiveProvision(o,s)}}),""==(o.access_token||""))return void s.onError({type:c.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,data:o});s.context.accessToken=o.access_token}catch(r){}};e.default.connection.prototype._base64transform=l,e.default.connection.prototype._getSock=p,e.default.connection.prototype._login=f,e.default.version="_version";var m=e.default;exports.default=m; -},{"./connection":"h12o","long":"YA3p","./allnode":"G7Dp","./weichatPb/protobuf":"z2Zv","./status":"KLYY","./utils/wxUtils":"j93T"}],"Focm":[function(require,module,exports) { -"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./src/wxEntry"));function r(e){return e&&e.__esModule?e:{default:e}}var t=e.default;exports.default=t; -},{"./src/wxEntry":"rhvL"}]},{},["Focm"], "WebIM") \ No newline at end of file diff --git a/newSDK/wxsdk3.2.2.js b/newSDK/wxsdk3.2.2.js new file mode 100644 index 00000000..64fc1f15 --- /dev/null +++ b/newSDK/wxsdk3.2.2.js @@ -0,0 +1 @@ +!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()}(window,(function(){return function(e){var t={};function o(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(r,i,function(t){return e[t]}.bind(null,i));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/Users/zhangdong/code/kefu-fe/websdk/packages/sdk",o(o.s=156)}([function(e,t,o){"use strict";e.exports=function(e){return e&&e.__esModule?e:{default:e}}},,,function(e,t,o){"use strict";var r=o(0)(o(5)),i=e.exports,n=o(94);i.LongBits=o(65),i.Long=o(158),i.pool=o(159),i.float=o(160),i.asPromise=o(161),i.EventEmitter=o(162),i.path=o(163),i.base64=o(95),i.utf8=o(38),i.compareFieldsById=function(e,t){return e.id-t.id},i.toArray=function(e){if(e){for(var t=Object.keys(e),o=new Array(t.length),r=0;r-1;--o)if(1===t[e[o]]&&void 0!==this[e[o]]&&null!==this[e[o]])return e[o]}},i.oneOfSetter=function(e){return function(t){for(var o=0;o=65536&&o<=1114111?(r.push(o>>18&7|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)):o>=2048&&o<=65535?(r.push(o>>12&15|224),r.push(o>>6&63|128),r.push(63&o|128)):o>=128&&o<=2047?(r.push(o>>6&31|192),r.push(63&o|128)):r.push(255&o);return r},i.byteToString=function(e){if("string"==typeof e)return e;for(var t="",o=e,r=0;r>>=0)&&e<256)&&(r=a[e])?r:(o=p(e,(0|e)<0?-1:0,!0),i&&(a[e]=o),o):(i=-128<=(e|=0)&&e<128)&&(r=s[e])?r:(o=p(e,e<0?-1:0,!1),i&&(s[e]=o),o)}function l(e,t){if(isNaN(e))return t?_:v;if(t){if(e<0)return _;if(e>=y)return T}else{if(e<=-m)return I;if(e+1>=m)return b}return e<0?l(-e,t).neg():p(e%f|0,e/f|0,t)}function p(e,t,o){return new i(e,t,o)}i.fromInt=u,i.fromNumber=l,i.fromBits=p;var c=Math.pow;function h(e,t,o){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(o=t,t=!1):t=!!t,(o=o||10)<2||360)throw Error("interior hyphen");if(0===r)return h(e.substring(1),t,o).neg();for(var i=l(c(o,8)),n=v,s=0;s>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((n=a).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),o=e.isNegative();return t&&!o?-1:!t&&o?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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(E)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,o=65535&this.high,r=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,l=0,c=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,c+=(h+=r+u)>>>16,l+=(c+=o+a)>>>16,l+=t+s,p((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=d(e)),r)return p(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(I))return e.isOdd()?I:v;if(e.eq(I))return this.isOdd()?I:v;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(g)&&e.lt(g))return l(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,h=65535&e.low,f=0,y=0,m=0,_=0;return m+=(_+=s*h)>>>16,y+=(m+=i*h)>>>16,m&=65535,y+=(m+=s*c)>>>16,f+=(y+=o*h)>>>16,y&=65535,f+=(y+=i*c)>>>16,y&=65535,f+=(y+=s*u)>>>16,f+=t*h+o*c+i*u+s*a,p((m&=65535)<<16|(_&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var t,o,i;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?p((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?_:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return N;i=_}else{if(this.eq(I))return e.eq(E)||e.eq(O)?I:e.eq(I)?E:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?E:O:(o=this.sub(e.mul(t)),i=t.add(o.div(e)));if(e.eq(I))return this.unsigned?_:v;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=v}for(o=this;o.gte(e);){t=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),a=s<=48?1:c(2,s-48),u=l(t),h=u.mul(e);h.isNegative()||h.gt(o);)h=(u=l(t-=a,this.unsigned)).mul(e);u.isZero()&&(u=E),i=i.add(u),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),r?p((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return p(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),p(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),p(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),p(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?p(this.low<>>32-e,this.unsigned):p(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):p(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?p(this.low>>>e|t<<32-e,t>>>e,this.unsigned):p(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.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]},R.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]},i.fromBytes=function(e,t,o){return o?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},,function(e,t,o){"use strict";var r=o(0)(o(5));e.exports=s;var i=o(23);((s.prototype=Object.create(i.prototype)).constructor=s).className="Enum";var n=o(32);function s(e,t,o,n,s){if(i.call(this,e,o),t&&"object"!==(0,r.default)(t))throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=s||{},this.reserved=void 0,t)for(var a=Object.keys(t),u=0;u0&&void 0!==arguments[0]?arguments[0]:{};this.config=e}},{key:"getLevel",value:function(){return this.currentLevel}},{key:"setLevel",value:function(e,t,o){if("string"==typeof e&&"undefined"!==this.levels[e.toUpperCase()]&&(e=this.levels[e.toUpperCase()]),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw"log.setLevel() called with invalid level: "+e;if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,o),"undefined"==typeof console&&e=r)){if(o255&&t++;return t}var h=new p;h.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=l[e];return t||(t=l[e]=new p(e,h.getLevel(),h.methodFactory)),t};var d="undefined"!=typeof window?window.log:void 0;h.noConflict=function(){return"undefined"!=typeof window&&window.log===h&&(window.log=d),h},h.getLoggers=function(){return l};var f=h;t.default=f},,function(e,t,o){"use strict";var r=o(0)(o(5));e.exports=p;var i,n,s,a,u=o(23);((p.prototype=Object.create(u.prototype)).constructor=p).className="Field";var l=/^required|optional|repeated$/;function p(e,t,o,r,i,a,p){if(s.isObject(r)?(p=i,a=r,r=i=void 0):s.isObject(i)&&(p=a,a=i,i=void 0),u.call(this,e,a),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(o))throw TypeError("type must be a string");if(void 0!==r&&!l.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!s.isString(i))throw TypeError("extend must be a string");this.rule=r&&"optional"!==r?r:void 0,this.type=o,this.id=t,this.extend=i||void 0,this.required="required"===r,this.optional=!this.required,this.repeated="repeated"===r,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==n.long[o],this.bytes="bytes"===o,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}p.fromJSON=function(e,t){return new p(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(p.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),p.prototype.setOption=function(e,t,o){return"packed"===e&&(this._packed=null),u.prototype.setOption.call(this,e,t,o)},p.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.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])},p.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 i&&"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 i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.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;s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof a&&(this.parent.ctor.prototype[this.name]=this.defaultValue),u.prototype.resolve.call(this)},p.d=function(e,t,o,i){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"===(0,r.default)(t)&&(t=s.decorateEnum(t).name),function(r,n){s.decorateType(r.constructor).add(new p(n,e,t,o,{default:i}))}},p._configure=function(){a=o(22),i=o(10),n=o(24),s=o(3)}},,,,,,function(e,t,o){"use strict";e.exports=v;var r,i,n,s,a,u,l,p,c,h,d,f,y,m,g=o(32);function v(e,t){g.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 _(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}((v.prototype=Object.create(g.prototype)).constructor=v).className="Type",Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t-1;--o)if(1===t[e[o]]&&void 0!==this[e[o]]&&null!==this[e[o]])return e[o]}}}(this._oneofsArray[o].oneof);r[i]={get:s.getter,set:s.setter}}o&&Object.defineProperties(e.prototype,r)}}}),v.generateConstructor=function(e){return function(t){for(var o,r=0;r204800&&(r.msg.thumbnail=!0)}r.msg.body={type:r.msg.type||"file",url:(t.isHttpDNS?t.apiUrl+e.uri.substr(e.uri.indexOf("/",9)):e.uri)+"/"+e.entities[0].uuid,secret:e.entities[0]["share-secret"],filename:r.msg.file.filename||r.msg.filename,size:{width:r.msg.width||0,height:r.msg.height||0},length:r.msg.length||0,file_length:r.msg.ext.file_length||0,filetype:r.msg.filetype||r.msg.file.filetype},u(r.msg,t),n instanceof Function&&n(e,r.msg.id)},i.uploadFile.call(t,r.msg)};t.default=l},function(e,t,o){"use strict";var r=o(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(o(8)),n=(r(o(30)),r(o(7))),s=(r(o(29)),r(o(58))),a=r(o(14)).default.getLogger("IM-SDK-LOG"),u=(0,n.default)(),l={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"},p=function(e){if(e){for(var t=e,o={},r=0;r0,_=t.errorCode,E=t.reason,N=h.contents[m],O=h.from.name,b=h.to.name,T={};h.ext&&(T=p(h.ext));try{switch(N.type){case 0:var I=h.contents[m].text;if(!R)var R={};var C=s.default.parseTextMessage(I,R&&R.Emoji);C.isemoji?(!(g={id:d,type:y,contentsType:"EMOJI",from:O,to:b,data:C.body,ext:T,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&n.onEmojiMessage(g)):(!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,data:N.text,ext:T,sourceMsg:N.text,time:c,msgConfig:h.msgConfig}).msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onTextMessage(g));break;case 1:if(N.size)var S=N.size.width||0,w=N.size.height||0;var A=o.useOwnUploadFun?N.remotePath:(N.remotePath&&n.apiUrl+N.remotePath.substr(N.remotePath.indexOf("/",9)))+"?em-redirect=true";!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,url:A,secret:N.secretKey,filename:N.displayName,thumb:N.thumbnailRemotePath,thumb_secret:N.thumbnailSecretKey,file_length:N.fileLength||"",width:S,height:w,filetype:N.filetype||"",accessToken:o.token||"",ext:T,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onPictureMessage(g);break;case 2:A=o.useOwnUploadFun?N.remotePath:(N.remotePath&&n.apiUrl+N.remotePath.substr(N.remotePath.indexOf("/",9)))+"?em-redirect=true";!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,url:A,secret:N.secretKey,filename:N.displayName,length:N.duration||"",file_length:N.fileLength||"",filetype:N.filetype||"",accessToken:o.token||"",ext:T,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onVideoMessage(g);break;case 3:!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,addr:N.address,lat:N.latitude,lng:N.longitude,ext:T,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onLocationMessage(g);break;case 4:A=o.useOwnUploadFun?N.remotePath:(N.remotePath&&n.apiUrl+N.remotePath.substr(N.remotePath.indexOf("/",9)))+"?em-redirect=true";!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,url:A,secret:N.secretKey,filename:N.displayName,file_length:N.fileLength||"",accessToken:o.token||"",ext:T,length:N.duration,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onAudioMessage(g);break;case 5:A=o.useOwnUploadFun?N.remotePath:(N.remotePath&&n.apiUrl+N.remotePath.substr(N.remotePath.indexOf("/",9)))+"?em-redirect=true";!(g={id:d,type:y,contentsType:l[N.type],from:O,to:b,url:A,secret:N.secretKey,filename:N.displayName,file_length:N.fileLength,accessToken:o.token||"",ext:T,time:c,msgConfig:h.msgConfig}).delay&&delete g.delay,!g.msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onFileMessage(g);break;case 6:!(g={id:d,contentsType:l[N.type],from:O,to:b,action:N.action,ext:T,time:c,msgConfig:h.msgConfig}).msgConfig&&delete h.msgConfig,g.error=v,g.errorText=E,g.errorCode=_,!r&&o.onCmdMessage(g);break;case 7:var k="",x="";h.contents[0].customExts&&(k=p(h.contents[0].customExts)),h.contents[0].params&&(x=p(h.contents[0].params)),g={id:d,contentsType:l[N.type],from:O,to:b,customEvent:N.customEvent,params:x,customExts:k,ext:T,time:c},!r&&o.onCustomMessage(g)}}catch(e){o.onError({type:u.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"parsing message error",data:e})}if(r||o.delivery)return g.message_type=y,g}};t.default=c},function(e,t,o){"use strict";e.exports=p;var r,i,n,s,a,u=o(23);function l(e,t){if(e&&e.length){for(var o={},r=0;r=t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var o=0;o0;){var r=e.shift();if(o.nested&&o.nested[r]){if(!((o=o.nested[r])instanceof p))throw Error("path conflicts with non-namespace objects")}else o.add(o=new p(r))}return t&&o.addJSON(t),o},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return r}else if(r instanceof p&&(r=r.lookup(e.slice(1),t,!0)))return r}else for(var i=0;i-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t>8-s%1*8)){if((r=n.charCodeAt(s+=3/4))>255)throw new i("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");t=t<<8|r}return u}),e.atob||(e.atob=function(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4==1)throw new i("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,a=0,u="";n=t.charAt(a++);~n&&(r=s%4?64*r+n:n,s++%4)?u+=String.fromCharCode(255&r>>(-2*s&6)):0)n=o.indexOf(n);return u})}()},,function(e,t,o){"use strict";var r=e.exports;r.length=function(e){for(var t=0,o=0,r=0;r191&&r<224?n[s++]=(31&r)<<6|63&e[t++]:r>239&&r<365?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,n[s++]=55296+(r>>10),n[s++]=56320+(1023&r)):n[s++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,n)),s=0);return i?(s&&i.push(String.fromCharCode.apply(String,n.slice(0,s))),i.join("")):String.fromCharCode.apply(String,n.slice(0,s))},r.write=function(e,t,o){for(var r,i,n=o,s=0;s>6|192,t[o++]=63&r|128):55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(s+1)))?(r=65536+((1023&r)<<10)+(1023&i),++s,t[o++]=r>>18|240,t[o++]=r>>12&63|128,t[o++]=r>>6&63|128,t[o++]=63&r|128):(t[o++]=r>>12|224,t[o++]=r>>6&63|128,t[o++]=63&r|128);return o-n}},function(e,t,o){"use strict";var r=o(0)(o(5));e.exports=h;var i=o(32);((h.prototype=Object.create(i.prototype)).constructor=h).className="Root";var n,s,a,u=o(16),l=o(10),p=o(33),c=o(3);function h(e){i.call(this,"",e),this.deferred=[],this.files=[],this.names=[]}function d(){}h.fromJSON=function(e,t){return e="string"==typeof e?JSON.parse(e):e,t||(t=new h),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},h.prototype.resolvePath=c.path.resolve,h.prototype.parseFromPbString=function e(t,o,i){"function"==typeof o&&(i=o,o=void 0);var n=this;if(!i)return c.asPromise(e,n,t,o);var u=null;if("string"==typeof t)u=JSON.parse(t);else{if("object"!==(0,r.default)(t))return void console.log("pb格式转化失败");u=t}function l(e,t){if(i){var o=i;i=null,o(e,t)}}function p(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){s.filename=e;var r,i=s(t,n,o),a=0;if(i.imports)for(;a-1||(n.names.push(e),e in a&&p(e,a[e]))}p(u.name,u.pbJsonStr)},h.prototype.load=function e(t,o,r){"function"==typeof o&&(r=o,o=void 0);var i=this;if(!r)return c.asPromise(e,i,t,o);var n=r===d;function u(e,t){if(r){var o=r;if(r=null,n)throw e;o(e,t)}}function l(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){s.filename=e;var r,a=s(t,i,o),l=0;if(a.imports)for(;l-1){var s=e.substring(o);s in a&&(e=s)}if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)n?l(e,a[e]):(++h,setTimeout((function(){--h,l(e,a[e])})));else if(n){var p;try{p=c.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}l(e,p)}else++h,c.fetch(e,(function(o,n){--h,r&&(o?t?h||u(null,i):u(o):l(e,n))}))}var h=0;c.isString(t)&&(t=[t]);for(var f,y=0;y-1&&this.deferred.splice(t,1)}}else if(e instanceof l)f.test(e.name)&&delete e.parent[e.name];else if(e instanceof i){for(var o=0;othis.restTotal)){var o="",r=this.restHosts[this.restIndex],i=r.domain,n=r.ip;if(n&&"http:"==location.protocol){var s=r.port;o=("https:"===location.protocol?"https:":"http:")+"//"+n+":"+s}else o=("https:"===location.protocol?"https:":"http:")+"//"+i;""!=o&&(this.apiUrl=o,e.apiUrl=o),"login"==t?this.login(e):this.signup(e)}},O.prototype.getHttpDNS=function(e,t){var o=this,r={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(e.appKey||this.appKey)},success:function(r,i){var n=r.rest.hosts;if(n){for(var s=o.https?"https":"http",a=n.filter((function(e,t){if(e.protocol==s)return e})),u=0;u1&&void 0!==arguments[1]?arguments[1]:"",o={to:e,message:t};h.default.operatRoster(o,"add",this)},O.prototype.deleteContact=function(e){var t={to:e};h.default.operatRoster(t,"remove",this)},O.prototype.acceptInvitation=function(e){var t={to:e};h.default.operatRoster(t,"accept",this)},O.prototype.declineInvitation=function(e){var t={to:e};h.default.operatRoster(t,"decline",this)},O.prototype.isOpened=function(){return this.sock&&this.sock.readyState===E},O.prototype.clear=function(){var e=this.context.appKey;if(this.errorType!=v.WEBIM_CONNCTION_DISCONNECTED&&this.logOut&&(this.unSendMsgArr=[],this.offLineSendConnecting=!1,this.context={status:v.STATUS_INIT,appKey:e}),this.intervalId&&clearInterval(this.intervalId),this.restIndex=0,this.hostIndex=0,this.errorType==v.WEBIM_CONNCTION_CLIENT_LOGOUT||-1==this.errorType){var t={type:v.WEBIM_CONNCTION_CLIENT_LOGOUT,message:"when login or sinup error",data:{data:"logout"}};this.onError(t)}},O.prototype.autoReconnectInterval=0,O.prototype.times=1,O.prototype.reconnect=function(e){m.debug("reconnect: time",this.hostIndex);var t=this;t.hostIndex=this._array_h.length()&&(this._array_h.slice(this._index),this._index=0)),e},head:function(){var e=null,t=this._array_h.length();return t&&(e=this._array_h.at(t-1)),e},tail:function(){var e=null;return this._array_h.length()&&(e=this._array_h.at(this._index)),e},length:function(){return this._array_h.length()-this._index},empty:function(){return 0===this._array_h.length()},clear:function(){this._array_h.clear()}};var n=i;t.default=n},function(e,t,o){"use strict";e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,o){"use strict";function r(e,t){for(var o=0;o1e7)return!1;var o=Math.round(t/1e3);if(o<1e3)t=o+" KB";else if(o>=1e3){var r=o/1e3;if(r<1e3)t=r.toFixed(1)+" MB";else t=(r/1e3).toFixed(1)+" GB"}return t},trim:function(e){return(e="string"==typeof e?e:"").trim?e.trim():e.replace(/^\s|\s$/g,"")},parseTextMessage:function(e,t){if("string"==typeof e){if("[object Object]"!==Object.prototype.toString.call(t))return{isemoji:!1,body:[{type:"txt",data:e}]};var o=e,r=[],i=o.match(/\[[^[\]]{2,3}\]/gm);if(!i||i.length<1)return{isemoji:!1,body:[{type:"txt",data:e}]};for(var n=!1,s=0;s=e.count||p.is_last)return void("function"==typeof e.success&&e.success(p));p&&p.next_key&&(h=p.next_key);var d={queue:a+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:h,end:-1},f={url:r+"/"+n+"/"+i+"/users/"+c+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+o},data:JSON.stringify(d),success:function(o,r){if(o&&o.data){var i=o.data;if(!o.data.msgs)return"function"==typeof e.success&&e.success(p),p.is_last=!0,void(p.next_key="");var n=i.msgs,a=n.length;p.is_last=i.is_last,p.next_key=i.next_key;var l=function(e){for(var o=[],r=0,i=(e=u.default.atob(e)).length;r=o||i.is_last?e.success&&e.success(t._utils.reverse(i.msgs.splice(0,o))):r()},fail:function(){}},t)}()}else t.onError({type:l.SDK_RUNTIME_ERROR,message:"queue is not specified"})},getChatRooms:function(e){var t=this,o=e.accessToken||this.context.accessToken;if(t._utils.isCanSetRequestHeader)if(o){var r=e.apiUrl,i=this.context.appName,n=this.context.orgName;if(!i||!n)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var s={url:r+"/"+n+"/"+i+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o},data:{pagenum:parseInt(e.pagenum)||1,pagesize:parseInt(e.pagesize)||20},success:function(t,o){"function"==typeof e.success&&e.success(t)}||t._utils.emptyfn,error:function(e,o,r){e.error&&e.error_description&&t.onError({type:l.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:e.error_description,data:e,xhr:o})}||t._utils.emptyfn};t._utils.ajax(s)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});else t.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})},createChatRoom:function(e){e=e||{};if(this._utils.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token,r=t.user;if(o){var i=e.apiUrl||this.apiUrl,n=this.context.appName,s=this.context.orgName;if(!n||!s)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var a={name:e.name,description:e.description,maxusers:e.maxusers,owner:r,members:e.members},u={url:i+"/"+s+"/"+n+"/chatrooms",dataType:"json",type:"POST",data:JSON.stringify(a),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:function(t,o){"function"==typeof e.success&&e.success(t)}||t._utils.emptyfn,error:function(t,o,r){"function"==typeof e.error&&e.error(t)}||t._utils.emptyfn};t._utils.ajax(u)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else t.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})},destroyChatRoom:function(e){e=e||{};if(this._utils.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token;if(o){var r=e.apiUrl||this.apiUrl,i=this.context.appName,n=this.context.orgName,s=e.chatRoomId;if(!i||!n)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var a={url:r+"/"+n+"/"+i+"/chatrooms/"+s,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+o},success:function(t,o){"function"==typeof e.success&&e.success(t)}||t._utils.emptyfn,error:function(t,o,r){"function"==typeof e.error&&e.error(t)}||t._utils.emptyfn};t._utils.ajax(a)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else t.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})},getChatRoomDetails:function(e){var t=e.chatRoomId,o=this.context.appName,r=this.context.orgName;if(o&&r){var i={url:(e.apiUrl||this.apiUrl)+"/"+r+"/"+o+"/chatrooms/"+t,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};i.success=e.success||this._utils.emptyfn,i.error=e.error||this._utils.emptyfn,this._utils.ajax(i)}else conn.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"})},modifyChatRoom:function(e){var t=e.chatRoomId,o={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t,type:"PUT",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},removeSingleChatRoomMember:function(e){var t=e.chatRoomId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},removeMultiChatRoomMember:function(e){var t=e.chatRoomId,o=e.users.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},addUsersToChatRoom:function(e){var t=e.chatRoomId,o={usernames:e.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},joinChatRoom:function(e){e=e||{};if(this._utils.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token;if(o){var r=e.apiUrl||this.apiUrl,i=this.context.appName,n=this.context.orgName,s=e.roomId,a=e.message||"";if(!i||!n)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var u={url:r+"/"+n+"/"+i+"/chatrooms/"+s+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:a}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:function(t,o){"function"==typeof e.success&&e.success(t)}||t._utils.emptyfn,error:function(t,o,r){"function"==typeof e.error&&e.error(t)}||t._utils.emptyfn};t._utils.ajax(u)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else t.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})},quitChatRoom:function(e){e=e||{};if(this._utils.isCanSetRequestHeader){var t=this,o=e.accessToken||this.token;if(o){var r=e.apiUrl||this.apiUrl,i=this.context.appName,n=this.context.orgName,s=e.roomId;if(!i||!n)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var a={url:r+"/"+n+"/"+i+"/chatrooms/"+s+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+o},success:function(t,o){"function"==typeof e.success&&e.success(t)}||t._utils.emptyfn,error:function(t,o,r){"function"==typeof e.error&&e.error(t)}||t._utils.emptyfn};t._utils.ajax(a)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else t.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})},createGroupNew:function(e){if(e&&e.data){e.data.owner=this.user,e.data.hasOwnProperty("inviteNeedConfirm")&&(e.data.invite_need_confirm=e.data.inviteNeedConfirm,delete e.data.inviteNeedConfirm);var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify(e.data),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=function(t){e.success(t),this.onCreateGroup(t)}.bind(this),t.error=e.error||this._utils.emptyfn,this._utils.ajax(t)}},blockGroup:function(e){var t=e.groupId;t="notification_ignore_"+t;var o={entities:[]};o.entities[0]={},o.entities[0][t]=!0;var r={type:"PUT",url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user,data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},listGroups:function(e){var t=[];if(t.limit=e.limit,t.cursor=e.cursor,t.cursor||delete t.cursor,isNaN(e.limit))throw'The parameter "limit" should be a number';var o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/publicchatgroups",type:"GET",dataType:"json",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)},getGroup:function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||this._utils.emptyfn,t.error=e.error||this._utils.emptyfn,this._utils.ajax(t)},changeOwner:function(e){var t={newowner:e.newOwner},o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(t)};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)},getGroupInfo:function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||this._utils.emptyfn,t.error=e.error||this._utils.emptyfn,this._utils.ajax(t)},modifyGroup:function(e){var t=e.groupId,o={groupname:e.groupName,description:e.description},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t,type:"PUT",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)},listGroupMember:function(e){if(isNaN(e.pageNum)||e.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(e.pageSize)||e.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===e.groupId&&void 0===e.groupId)throw'The parameter "groupId" should be added';var t=[],o=e.groupId;t.pagenum=e.pageNum,t.pagesize=e.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+o+"/users",dataType:"json",type:"GET",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)}},(0,n.default)(i,"listGroupMember",(function(e){if(isNaN(e.pageNum)||e.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(e.pageSize)||e.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===e.groupId&&void 0===e.groupId)throw'The parameter "groupId" should be added';var t=[],o=e.groupId;t.pagenum=e.pageNum,t.pagesize=e.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+o+"/users",dataType:"json",type:"GET",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"listChatRoomMember",(function(e){if(isNaN(e.pageNum)||e.pageNum<=0)throw'The parameter "pageNum" should be a positive number';if(isNaN(e.pageSize)||e.pageSize<=0)throw'The parameter "pageSize" should be a positive number';if(null===e.chatRoomId&&void 0===e.chatRoomId)throw'The parameter "chatRoomId" should be added';var t=[],o=e.chatRoomId;t.pagenum=e.pageNum,t.pagesize=e.pageSize;var r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+o+"/users",dataType:"json",type:"GET",data:t,headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"getGroupAdmin",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getChatRoomAdmin",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"setAdmin",(function(e){var t=e.groupId,o={newadmin:e.username},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"setChatRoomAdmin",(function(e){var t=e.chatRoomId,o={newadmin:e.username},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/admin",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeAdmin",(function(e){var t=e.groupId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/admin/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeChatRoomAdmin",(function(e){var t=e.chatRoomId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/admin/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"dissolveGroup",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"quitGroup",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"inviteToGroup",(function(e){var t=e.groupId,o={usernames:e.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"joinGroup",(function(e){var t={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:"join group"}),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};t.success=e.success||this._utils.emptyfn,t.error=e.error||this._utils.emptyfn,this._utils.ajax(t)})),(0,n.default)(i,"agreeJoinGroup",(function(e){var t=e.groupId,o={applicant:e.applicant,verifyResult:!0,reason:"no clue"},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"rejectJoinGroup",(function(e){var t=e.groupId,o={applicant:e.applicant,verifyResult:!1,reason:"no clue"},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"agreeInviteIntoGroup",(function(e){var t=e.groupId,o={invitee:e.invitee,verifyResult:!0},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"rejectInviteIntoGroup",(function(e){var t=e.groupId,o={invitee:e.invitee,verifyResult:!1},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(o),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeSingleGroupMember",(function(e){var t=e.groupId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeMultiGroupMember",(function(e){var t=e.groupId,o=e.users.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"mute",(function(e){var t=e.groupId,o={usernames:[e.username],mute_duration:e.muteDuration},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(o)};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"muteChatRoomMember",(function(e){var t=e.chatRoomId,o={usernames:[e.username],mute_duration:e.muteDuration},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(o)};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeMute",(function(e){var t=e.groupId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute/"+o,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeMuteChatRoomMember",(function(e){var t=e.chatRoomId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/mute/"+o,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"getMuted",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getChatRoomMuted",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"groupBlockSingle",(function(e){var t=e.groupId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"chatRoomBlockSingle",(function(e){var t=e.chatRoomId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/blocks/users/"+o,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"groupBlockMulti",(function(e){var t=e.groupId,o={usernames:e.usernames},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users",data:JSON.stringify(o),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"chatRoomBlockMulti",(function(e){var t=e.chatRoomId,o={usernames:e.usernames},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/blocks/users",data:JSON.stringify(o),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeGroupBlockSingle",(function(e){var t=e.groupId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeChatRoomBlockSingle",(function(e){var t=e.chatRoomId,o=e.username,r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeGroupBlockMulti",(function(e){var t=e.groupId,o=e.usernames.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"removeChatRoomBlockMulti",(function(e){var t=e.chatRoomId,o=e.usernames.join(","),r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/blocks/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"getGroupBlacklistNew",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getChatRoomBlacklistNew",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"disableSendGroupMsg",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"disableSendChatRoomMsg",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"enableSendGroupMsg",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"enableSendChatRoomMsg",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"addUsersToGroupWhitelist",(function(e){var t=e.groupId,o={usernames:e.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/white/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"addUsersToChatRoomWhitelist",(function(e){var t=e.chatRoomId,o={usernames:e.users},r={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/white/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};r.success=e.success||this._utils.emptyfn,r.error=e.error||this._utils.emptyfn,this._utils.ajax(r)})),(0,n.default)(i,"rmUsersFromGroupWhitelist",(function(e){var t=e.groupId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"rmUsersFromChatRoomWhitelist",(function(e){var t=e.chatRoomId,o={url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getGroupWhitelist",(function(e){var t=e.groupId,o=(e.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getChatRoomWhitelist",(function(e){var t=e.chatRoomId,o=(e.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"isGroupWhiteUser",(function(e){var t=e.groupId,o=(e.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatgroups/"+t+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"isChatRoomWhiteUser",(function(e){var t=e.chatRoomId,o=(e.users,{url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/chatrooms/"+t+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}});o.success=e.success||this._utils.emptyfn,o.error=e.error||this._utils.emptyfn,this._utils.ajax(o)})),(0,n.default)(i,"getGroupMsgReadUser",(function(e){var t=this;e=e||{};if(this._utils.isCanSetRequestHeader){var o=e.accessToken||this.token;if(o){var r=t.apiUrl,i=t.context.appName,n=t.context.orgName;if(!i||!n)return void t.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var s={url:r+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+o},success:function(t){"function"==typeof e.success&&e.success(t)}||this._utils.emptyfn,error:function(t){"function"==typeof e.error&&e.error(t)}||this._utils.emptyfn};this._utils.ajax(s)}else t.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else conn.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})})),(0,n.default)(i,"getBlacklist",(function(e){var t=this;e=e||{};if(this._utils.isCanSetRequestHeader){var o=this,r=e.accessToken||this.token;if(r){var i=e.apiUrl||this.apiUrl,n=this.context.appName,s=this.context.orgName;if(!n||!s)return void o.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var a={url:i+"/"+s+"/"+n+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+r},success:function(o,r){var i={};o.data.forEach((function(e,t){i[e]={name:e}})),t.onBlacklistUpdate(i),"function"==typeof e.success&&e.success(o)}||this._utils.emptyfn,error:function(o,r,i){t.onBlacklistUpdate([]),"function"==typeof e.error&&e.error(o)}||this._utils.emptyfn};this._utils.ajax(a)}else o.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else o.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})})),(0,n.default)(i,"getRoster",(function(e){e=e||{};var t=this;if(this._utils.isCanSetRequestHeader){var o=this,r=e.accessToken||this.token;if(r){var i=e.apiUrl||this.apiUrl,n=this.context.appName,s=this.context.orgName;if(!n||!s)return void o.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"});var a={url:i+"/"+s+"/"+n+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+r},success:function(o,r){var i=[];o.data.forEach((function(e,o){i.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof e.success&&e.success(i),t.onRoster&&t.onRoster(i)}||this._utils.emptyfn,error:function(t,o,r){"function"==typeof e.error&&e.error(t)}||this._utils.emptyfn};this._utils.ajax(a)}else o.onError({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}else o.onError({type:l.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR,message:"current environment can not set request header"})})),(0,n.default)(i,"fetchGroupAnnouncement",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId,n={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||this._utils.emptyfn,n.error=e.error||this._utils.emptyfn,this._utils.ajax(n)})),(0,n.default)(i,"fetchChatRoomAnnouncement",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId,n={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/announcement"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||this._utils.emptyfn,n.error=e.error||this._utils.emptyfn,this._utils.ajax(n)})),(0,n.default)(i,"updateGroupAnnouncement",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId,n={announcement:e.announcement},s={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/announcement"),type:"POST",dataType:"json",data:JSON.stringify(n),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=e.success||this._utils.emptyfn,s.error=e.error||this._utils.emptyfn,this._utils.ajax(s)})),(0,n.default)(i,"updateChatRoomAnnouncement",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId,n={announcement:e.announcement},s={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/announcement"),type:"POST",dataType:"json",data:JSON.stringify(n),headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=e.success||this._utils.emptyfn,s.error=e.error||this._utils.emptyfn,this._utils.ajax(s)})),(0,n.default)(i,"uploadGroupSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId;this._utils.uploadFile({uploadUrl:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/share_files"),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:this.token,apiUrl:t,file:e.file,appKey:this.context.appKey})})),(0,n.default)(i,"uploadChatRoomSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId;this._utils.uploadFile({uploadUrl:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/share_files"),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:this.token,apiUrl:t,file:e.file,appKey:this.context.appKey})})),(0,n.default)(i,"deleteGroupSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId,n=e.fileId,s={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/share_files/").concat(n),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=e.success||this._utils.emptyfn,s.error=e.error||this._utils.emptyfn,this._utils.ajax(s)})),(0,n.default)(i,"deleteChatRoomSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId,n=e.fileId,s={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/share_files/").concat(n),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};s.success=e.success||this._utils.emptyfn,s.error=e.error||this._utils.emptyfn,this._utils.ajax(s)})),(0,n.default)(i,"downloadGroupSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId,n=e.fileId;this._utils.download.call(this,{url:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/share_files/").concat(n),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:this.token,id:n,secret:""})})),(0,n.default)(i,"downloadChatRoomSharedFile",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId,n=e.fileId;this._utils.download.call(this,{url:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/share_files/").concat(n),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:this.token,id:n,secret:""})})),(0,n.default)(i,"fetchGroupSharedFileList",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.groupId,n={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatgroups/").concat(i,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||this._utils.emptyfn,n.error=e.error||this._utils.emptyfn,this._utils.ajax(n)})),(0,n.default)(i,"fetchChatRoomSharedFileList",(function(e){var t=e.apiUrl||this.apiUrl,o=this.context.appName,r=this.context.orgName,i=e.roomId,n={url:"".concat(t,"/").concat(r,"/").concat(o,"/chatrooms/").concat(i,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}};n.success=e.success||this._utils.emptyfn,n.error=e.error||this._utils.emptyfn,this._utils.ajax(n)})),i);t.default=p},function(e,t,o){"use strict";e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=function(){return{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}},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}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6}},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}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1}}}},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}}}},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}},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}},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}},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}}}}}},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}}}}}}}}}}};t.default=r},function(e,t,o){"use strict";e.exports=i;var r=o(3);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var n=i.zero=new i(0,0);n.toNumber=function(){return 0},n.zzEncode=n.zzDecode=function(){return this},n.length=function(){return 1};var s=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return n;var t=e<0;t&&(e=-e);var o=e>>>0,r=(e-o)/4294967296>>>0;return t&&(r=~r>>>0,o=~o>>>0,++o>4294967295&&(o=0,++r>4294967295&&(r=0))),new i(o,r)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if("string"==typeof e||e instanceof String){if(!r.Long)return i.fromNumber(parseInt(e,10));e=r.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):n},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,o=~this.hi>>>0;return t||(o=o+1>>>0),-(t+4294967296*o)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;i.fromHash=function(e){return e===s?n:new i((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},i.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)},i.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},i.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},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,o=this.hi>>>24;return 0===o?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:o<128?9:10}},function(e,t,o){"use strict";var r=o(0)(o(5));e.exports=a;var i,n,s=o(16);function a(e,t,o,r,i,a){if(s.call(this,e,t,r,void 0,void 0,i,a),!n.isString(o))throw TypeError("keyType must be a string");this.keyType=o,this.resolvedKeyType=null,this.map=!0}((a.prototype=Object.create(s.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===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return s.prototype.resolve.call(this)},a.d=function(e,t,o){return"function"==typeof o?o=n.decorateType(o).name:o&&"object"===(0,r.default)(o)&&(o=n.decorateEnum(o).name),function(r,i){n.decorateType(r.constructor).add(new a(i,e,t,o))}},a._configure=function(){i=o(24),n=o(3)}},function(e,t,o){"use strict";e.exports=n;var r,i=o(23);function n(e,t,o,n,s,a,u,l){if(r.isObject(s)?(u=s,s=a=void 0):r.isObject(a)&&(u=a,a=void 0),void 0!==t&&!r.isString(t))throw TypeError("type must be a string");if(!r.isString(o))throw TypeError("requestType must be a string");if(!r.isString(n))throw TypeError("responseType must be a string");i.call(this,e,u),this.type=t||"rpc",this.requestType=o,this.requestStream=!!s||void 0,this.responseType=n,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l}((n.prototype=Object.create(i.prototype)).constructor=n).className="Method",n.fromJSON=function(e,t){return new n(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},n.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return r.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])},n.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),i.prototype.resolve.call(this))},n._configure=function(){r=o(3)}},function(e,t,o){"use strict";var r;function i(e){if(e)for(var t=Object.keys(e),o=0;o>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[o++]=127&e.lo|128,e.lo=e.lo>>>7;t[o++]=e.lo}function d(e,t,o){t[o]=255&e,t[o+1]=e>>>8&255,t[o+2]=e>>>16&255,t[o+3]=e>>>24}l.create=i.Buffer?function(){return(l.create=function(){return new(void 0)})()}:function(){return new l},l.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(l.alloc=i.pool(l.alloc,i.Array.prototype.subarray)),l.prototype._push=function(e,t,o){return this.tail=this.tail.next=new s(e,t,o),this.len+=t,this},c.prototype=Object.create(s.prototype),c.prototype.fn=function(e,t,o){for(;e>127;)t[o++]=127&e|128,e>>>=7;t[o]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new c((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},l.prototype.int32=function(e){return e<0?this._push(h,10,r.fromNumber(e)):this.uint32(e)},l.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},l.prototype.uint64=function(e){var t=r.from(e);return this._push(h,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=r.from(e).zzEncode();return this._push(h,t.length(),t)},l.prototype.bool=function(e){return this._push(p,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(d,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=r.from(e);return this._push(d,4,t.lo)._push(d,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var f=i.Array.prototype.set?function(e,t,o){t.set(e,o)}:function(e,t,o){for(var r=0;r>>0;if(!t)return this._push(p,1,0);if(i.isString(e)){var o=l.alloc(t=n.length(e));n.write(e,o,0),e=o}return this.uint32(t)._push(f,t,e)},l.prototype.string=function(e){var t=n.length(e);return t?this.uint32(t)._push(n.write,t,e):this._push(p,1,0)},l.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new s(a,0,0),this.len=0,this},l.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 s(a,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,o=this.len;return this.reset().uint32(o),o&&(this.tail.next=e.next,this.tail=t,this.len+=o),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),o=0;e;)e.fn(e.val,t,o),o+=e.len,e=e.next;return t},l._configure=function(){r=o(65),o(95),n=o(38)}},function(e,t,o){"use strict";e.exports={}},function(e,t,o){"use strict";var r=e.exports;r.length=function(e){var t=e.length;if(!t)return 0;for(var o=0;--t%4>1&&"="===e.charAt(t);)++o;return Math.ceil(3*e.length)/4-o};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,o){for(var r,n=null,s=[],a=0,u=0;t>2],r=(3&l)<<4,u=1;break;case 1:s[a++]=i[r|l>>4],r=(15&l)<<2,u=2;break;case 2:s[a++]=i[r|l>>6],s[a++]=i[63&l],u=0}a>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=i[r],s[a++]=61,1===u&&(s[a++]=61)),n?(a&&n.push(String.fromCharCode.apply(String,s.slice(0,a))),n.join("")):String.fromCharCode.apply(String,s.slice(0,a))};r.decode=function(e,t,o){for(var r,i=o,s=0,a=0;a1)break;if(void 0===(u=n[u]))throw Error("invalid encoding");switch(s){case 0:r=u,s=1;break;case 1:t[o++]=r<<2|(48&u)>>4,r=u,s=2;break;case 2:t[o++]=(15&r)<<4|(60&u)>>2,r=u,s=3;break;case 3:t[o++]=(3&r)<<6|u,s=0}}if(1===s)throw Error("invalid encoding");return o-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,o){"use strict";var r,i,n,s,a,u,l,p,c,h,d;e.exports=T,T.filename=null,T.defaults={keepCase:!1};var f=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,_=/^-?0[0-7]+$/,E=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,N=/^[a-zA-Z_][a-zA-Z_0-9]*$/,O=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,b=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;function T(e,t,o){t instanceof i||(o=t,t=new i),o||(o=T.defaults);var I,R,C,S,w,A=r(e,o.alternateCommentMode||!1),k=A.next,x=A.push,j=A.peek,M=A.skip,U=A.cmnt,B=!0,L=!1,D=t,P=o.keepCase?function(e){return e}:d.camelCase;function F(e,t,o){var r=T.filename;return o||(T.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(r?r+", ":"")+"line "+A.line+")")}function W(){var e,t=[];do{if('"'!==(e=k())&&"'"!==e)throw F(e);t.push(k()),M(e),e=j()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=k();switch(t){case"'":case'"':return x(t),W();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var o=1;"-"===e.charAt(0)&&(o=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return o*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return o*parseInt(e,10);if(m.test(e))return o*parseInt(e,16);if(v.test(e))return o*parseInt(e,8);if(E.test(e))return o*parseFloat(e);throw F(e,"number",t)}(t,!0)}catch(o){if(e&&O.test(t))return t;throw F(t,"value")}}function q(e,t){var o,r;do{!t||'"'!==(o=j())&&"'"!==o?e.push([r=z(k()),M("to",!0)?z(k()):r]):e.push(W())}while(M(",",!0));M(";")}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw F(e,"id");if(y.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(_.test(e))return parseInt(e,8);throw F(e,"id")}function K(){if(void 0!==I)throw F("package");if(I=k(),!O.test(I))throw F(I,"name");D=D.define(I),M(";")}function V(){var e,t=j();switch(t){case"weak":e=C||(C=[]),k();break;case"public":k();default:e=R||(R=[])}t=W(),M(";"),e.push(t)}function J(){if(M("="),S=W(),!(L="proto3"===S)&&"proto2"!==S)throw F(S,"syntax");M(";")}function H(e,t){switch(t){case"option":return Y(e,t),M(";"),!0;case"message":return function(e,t){if(!N.test(t=k()))throw F(t,"type name");var o=new n(t);$(o,(function(e){if(!H(o,e))switch(e){case"map":!function(e){M("<");var t=k();if(void 0===h.mapKey[t])throw F(t,"type");M(",");var o=k();if(!O.test(o))throw F(o,"type");M(">");var r=k();if(!N.test(r))throw F(r,"name");M("=");var i=new a(P(r),z(k()),t,o);$(i,(function(e){if("option"!==e)throw F(e);Y(i,e),M(";")}),(function(){ee(i)})),e.add(i)}(o);break;case"required":case"optional":case"repeated":Z(o,e);break;case"oneof":!function(e,t){if(!N.test(t=k()))throw F(t,"name");var o=new u(P(t));$(o,(function(e){"option"===e?(Y(o,e),M(";")):(x(e),Z(o,"optional"))})),e.add(o)}(o,e);break;case"extensions":q(o.extensions||(o.extensions=[]));break;case"reserved":q(o.reserved||(o.reserved=[]),!0);break;default:if(!L||!O.test(e))throw F(e);x(e),Z(o,"optional")}})),e.add(o)}(e,t),!0;case"enum":return function(e,t){if(!N.test(t=k()))throw F(t,"name");var o=new l(t);$(o,(function(e){switch(e){case"option":Y(o,e),M(";");break;case"reserved":q(o.reserved||(o.reserved=[]),!0);break;default:!function(e,t){if(!N.test(t))throw F(t,"name");M("=");var o=z(k(),!0),r={};$(r,(function(e){if("option"!==e)throw F(e);Y(r,e),M(";")}),(function(){ee(r)})),e.add(t,o,r.comment)}(o,e)}})),e.add(o)}(e,t),!0;case"service":return function(e,t){if(!N.test(t=k()))throw F(t,"service name");var o=new p(t);$(o,(function(e){if(!H(o,e)){if("rpc"!==e)throw F(e);!function(e,t){var o=t;if(!N.test(t=k()))throw F(t,"name");var r,i,n,s,a=t;M("("),M("stream",!0)&&(i=!0);if(!O.test(t=k()))throw F(t);r=t,M(")"),M("returns"),M("("),M("stream",!0)&&(s=!0);if(!O.test(t=k()))throw F(t);n=t,M(")");var u=new c(a,o,r,n,i,s);$(u,(function(e){if("option"!==e)throw F(e);Y(u,e),M(";")})),e.add(u)}(o,e)}})),e.add(o)}(e,t),!0;case"extend":return function(e,t){if(!O.test(t=k()))throw F(t,"reference");var o=t;$(null,(function(t){switch(t){case"required":case"repeated":case"optional":Z(e,t,o);break;default:if(!L||!O.test(t))throw F(t);x(t),Z(e,"optional",o)}}))}(e,t),!0}return!1}function $(e,t,o){var r=A.line;if(e&&(e.comment=U(),e.filename=T.filename),M("{",!0)){for(var i;"}"!==(i=k());)t(i);M(";",!0)}else o&&o(),M(";"),e&&"string"!=typeof e.comment&&(e.comment=U(r))}function Z(e,t,o){var r=k();if("group"!==r){if(!O.test(r))throw F(r,"type");var i=k();if(!N.test(i))throw F(i,"name");i=P(i),M("=");var a=new s(i,z(k()),r,t,o);$(a,(function(e){if("option"!==e)throw F(e);Y(a,e),M(";")}),(function(){ee(a)})),e.add(a),L||!a.repeated||void 0===h.packed[r]&&void 0!==h.basic[r]||a.setOption("packed",!1,!0)}else!function(e,t){var o=k();if(!N.test(o))throw F(o,"name");var r=d.lcFirst(o);o===r&&(o=d.ucFirst(o));M("=");var i=z(k()),a=new n(o);a.group=!0;var u=new s(r,i,o,t);u.filename=T.filename,$(a,(function(e){switch(e){case"option":Y(a,e),M(";");break;case"required":case"optional":case"repeated":Z(a,e);break;default:throw F(e)}})),e.add(a).add(u)}(e,t)}function Y(e,t){var o=M("(",!0);if(!O.test(t=k()))throw F(t,"name");var r=t;o&&(M(")"),r="("+r+")",t=j(),b.test(t)&&(r+=t,k())),M("="),X(e,r)}function X(e,t){if(M("{",!0))do{if(!N.test(w=k()))throw F(w,"name");"{"===j()?X(e,t+"."+w):(M(":"),"{"===j()?X(e,t+"."+w):Q(e,t+"."+w,G(!0)))}while(!M("}",!0));else Q(e,t,G(!0))}function Q(e,t,o){e.setOption&&e.setOption(t,o)}function ee(e){if(M("[",!0)){do{Y(e,"option")}while(M(",",!0));M("]")}return e}for(;null!==(w=k());)switch(w){case"package":if(!B)throw F(w);K();break;case"import":if(!B)throw F(w);V();break;case"syntax":if(!B)throw F(w);J();break;case"option":if(!B)throw F(w);Y(D,w),M(";");break;default:if(H(D,w)){B=!1;continue}throw F(w)}return T.filename=null,{package:I,imports:R,weakImports:C,syntax:S,root:t}}T._configure=function(){r=o(97),i=o(39),n=o(22),s=o(16),a=o(66),u=o(33),l=o(10),p=o(40),c=o(67),h=o(24),d=o(3)}},function(e,t,o){"use strict";e.exports=d;var r=/[\s{}=;:[\],'"()<>]/g,i=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,s=/^ *[*/]+ */,a=/^\s*\*?\/*/,u=/\n/g,l=/\s/,p=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function h(e){return e.replace(p,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function d(e,t){e=e.toString();var o=0,p=e.length,c=1,d=null,f=null,y=0,m=!1,g=[],v=null;function _(e){return Error("illegal "+e+" (line "+c+")")}function E(t){return e.charAt(t)}function N(o,r){d=e.charAt(o++),y=c,m=!1;var i,n=o-(t?2:3);do{if(--n<0||"\n"===(i=e.charAt(n))){m=!0;break}}while(" "===i||"\t"===i);for(var l=e.substring(o,r).split(u),p=0;p0)return g.shift();if(v)return function(){var t="'"===v?n:i;t.lastIndex=o-1;var r=t.exec(e);if(!r)throw _("string");return o=t.lastIndex,I(v),v=null,h(r[1])}();var s,a,u,d,f;do{if(o===p)return null;for(s=!1;l.test(u=E(o));)if("\n"===u&&++c,++o===p)return null;if("/"===E(o)){if(++o===p)throw _("comment");if("/"===E(o))if(t){if(d=o,f=!1,O(o)){f=!0;do{if((o=b(o))===p)break;o++}while(O(o))}else o=Math.min(p,b(o)+1);f&&N(d,o),c++,s=!0}else{for(f="/"===E(d=o+1);"\n"!==E(++o);)if(o===p)return null;++o,f&&N(d,o-1),++c,s=!0}else{if("*"!==(u=E(o)))return"/";d=o+1,f=t||"*"===E(d);do{if("\n"===u&&++c,++o===p)throw _("comment");a=u,u=E(o)}while("*"!==a||"/"!==u);++o,f&&N(d,o-2),s=!0}}}while(s);var y=o;if(r.lastIndex=0,!r.test(E(y++)))for(;y "+e.len)}function a(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array||Array.isArray(e)?new a(e):"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?new a(new Uint8Array(e)):void console.warn('"illegal buffer"')}:function(e){if(Array.isArray(e))return new a(e);console.warn('"illegal buffer"')};function p(){var e=new r(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(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 s(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 c(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new r(c(this.buf,this.pos+=4),c(this.buf,this.pos+=4))}a.create=n.Buffer?function(e){return(a.create=function(e){return n.Buffer.isBuffer(e)?new(void 0)(e):l(e)})(e)}:l,a.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,a.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),a.prototype.int32=function(){return 0|this.uint32()},a.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},a.prototype.bool=function(){return 0!==this.uint32()},a.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return c(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|c(this.buf,this.pos+=4)},a.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},a.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},a.prototype.bytes=function(){var e=this.uint32(),t=this.pos,o=this.pos+e;if(o>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,o):t===o?new this.buf.constructor(0):this._slice.call(this.buf,t,o)},a.prototype.string=function(){var e=this.bytes();return i.read(e,0,e.length)},a.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},a.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(;;){if(4==(e=7&this.uint32()))break;this.skipType(e)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},a._configure=function(){r=o(65),i=o(38);var e=n.Long?"toLong":"toNumber";n.merge(a.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},function(e,t,o){"use strict";var r,i,n=o(0)(o(5));function s(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,o,n){var a=n.types;if(e.resolvedType)if(e.resolvedType instanceof r){if(Object.keys(e.resolvedType.values).indexOf(o)<0)return s(e,"enum value")}else{var u=a[t].verify(o);if(u)return e.name+"."+u}else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!i.isInteger(o))return s(e,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(i.isInteger(o)||o&&i.isInteger(o.low)&&i.isInteger(o.high)))return s(e,"integer|Long");break;case"float":case"double":if("number"!=typeof o)return s(e,"number");break;case"bool":if("boolean"!=typeof o)return s(e,"boolean");break;case"string":if(!i.isString(o))return s(e,"string");break;case"bytes":if(!(o&&"number"==typeof o.length||i.isString(o)))return s(e,"buffer")}}function u(e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!i.key32Re.test(t))return s(e,"integer key");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!i.key64Re.test(t))return s(e,"integer|Long key");break;case"bool":if(!i.key2Re.test(t))return s(e,"boolean key")}}function l(e){return function(t){return function(o){var r;if("object"!==(0,n.default)(o)||null===o)return"object expected";var l,p={};e.oneofsArray.length&&(l={});for(var c=0;c>>0).fork().uint32(8|i.mapKey[p.keyType])[p.keyType](y[m]),void 0===d?n[c].encode(f[y[m]],a.uint32(18).fork()).ldelim().ldelim():a.uint32(16|d)[h](f[y[m]]).ldelim()}else if(p.repeated){if(f&&f.length)if(p.packed&&void 0!==i.packed[h]){a.uint32((p.id<<3|2)>>>0).fork();for(var g=0;g>>0)).uint32((p.id<<3|4)>>>0):n[c].encode(f[v],a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|d)>>>0)[h](f[v])}else(!p.optional||null!=f&&t.hasOwnProperty(p.name))&&(p.optional||null!=f&&t.hasOwnProperty(p.name)||console.warn("注意啦!!!很大概率会报错 类型:",t.$type?t.$type.name:"不晓得","没有设置对应的属性:",p.name,"检查是不是proto文件属性设置为了required"),void 0===d?p.resolvedType.group?n[c].encode(f,a.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):n[c].encode(f,a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|d)>>>0)[h](f))}return a}}}e.exports=n,n._configure=function(){r=o(10),i=o(24)}},function(e,t,o){"use strict";var r,i,n,s=o(0)(o(5));function a(e){return"missing required '"+e.name+"'"}function u(e){return function(t){var o=t.Reader,u=t.types,l=t.util;return function(t,p){t instanceof o||(t=o.create(t));for(var c,h=void 0===p?t.len:t.pos+p,d=new this.ctor;t.pos>>3,m=0,g=!1;m>>0:a[o]=u[o]>>>0;break;case"int32":case"sint32":case"sfixed32":c?a[o][p]=0|u[o][p]:a[o]=0|u[o];break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":i.Long?c?a[o][p]=i.Long.fromValue(u[o][p]).unsigned=m:a[o]=i.Long.fromValue(u[o]).unsigned=m:"string"==typeof(c?u[o][p]:u[o])?c?a[o][p]=parseInt(u[o][p],10):a[o]=parseInt(u[o],10):"number"==typeof(c?u[o][p]:u[o])?c?a[o][p]=u[o][p]:a[o]=u[o]:"object"===(0,n.default)(c?u[o][p]:u[o])&&(c?a[o][p]=new i.LongBits(u[o][p].low>>>0,u[o][p].high>>>0).toNumber(m):a[o]=new i.LongBits(u[o].low>>>0,u[o].high>>>0).toNumber(m));break;case"bytes":"string"==typeof(c?u[o][p]:u[o])?c?i.base64.decode(u[o][p],a[o][p]=i.newBuffer(i.base64.length(u[o][p])),0):i.base64.decode(u[o],a[o]=i.newBuffer(i.base64.length(u[o])),0):(c?u[o][p]:u[o]).length&&(c?a[o][p]=u[o][p]:a[o]=u[o]);break;case"string":c?a[o][p]=String(u[o][p]):a[o]=String(u[o]);break;case"bool":c?a[o][p]=Boolean(u[o][p]):a[o]=Boolean(u[o])}}}function u(e,t,o,n){var s=n.m,a=n.d,u=n.types,l=n.ksi,p=n.o,c=void 0!==l;if(e.resolvedType)e.resolvedType instanceof r?c?a[o][l]=p.enums===String?u[t].values[s[o][l]]:s[o][l]:a[o]=p.enums===String?u[t].values[s[o]]:s[o]:c?a[o][l]=u[t].toObject(s[o][l],p):a[o]=u[t].toObject(s[o],p);else{var h=!1;switch(e.type){case"double":case"float":c?a[o][l]=p.json&&!isFinite(s[o][l])?String(s[o][l]):s[o][l]:a[o]=p.json&&!isFinite(s[o])?String(s[o]):s[o];break;case"uint64":h=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":"number"==typeof s[o][l]?c?a[o][l]=p.longs===String?String(s[o][l]):s[o][l]:a[o]=p.longs===String?String(s[o]):s[o]:c?a[o][l]=p.longs===String?i.Long.prototype.toString.call(s[o][l]):p.longs===Number?new i.LongBits(s[o][l].low>>>0,s[o][l].high>>>0).toNumber(h):s[o][l]:a[o]=p.longs===String?i.Long.prototype.toString.call(s[o]):p.longs===Number?new i.LongBits(s[o].low>>>0,s[o].high>>>0).toNumber(h):s[o];break;case"bytes":c?a[o][l]=p.bytes===String?i.base64.encode(s[o][l],0,s[o][l].length):p.bytes===Array?Array.prototype.slice.call(s[o][l]):s[o][l]:a[o]=p.bytes===String?i.base64.encode(s[o],0,s[o].length):p.bytes===Array?Array.prototype.slice.call(s[o]):s[o];break;default:c?a[o][l]=s[o][l]:a[o]=s[o]}}}s._configure=function(){r=o(10),i=o(3)},s.fromObject=function(e){var t=e.fieldsArray;return function(e){return function(o){if(o instanceof this.ctor)return o;if(!t.length)return new this.ctor;for(var s=new this.ctor,u=0;u0)for(var u in t.unSendMsgArr){var l=t.unSendMsgArr[u];t.sendMSync(l),delete t.unSendMsgArr[u]}})),i.onClose((function(e){if(console.log("onClose",e),!t.logOut&&t.autoReconnectNumTotal0&&(t._backqueue(t._queues[0],t),this.qTimer&&clearTimeout(this.qTimer))}else if(r.status&&0===r.status.errorCode){if(t._msgHash[n]){try{t._msgHash[n].success instanceof Function&&t._msgHash[n].success(n,i)}catch(e){t.onError({type:h.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}delete t._msgHash[n]}t.onReceivedMessage({id:n,mid:i})}else if(r.status&&15===r.status.errorCode)t.onMutedMessage({mid:i});else if(r.status&&1===r.status.errorCode){var u="";switch(r.status.reason){case"blocked":u=h.PERMISSION_DENIED;break;case"group not found":u=h.GROUP_NOT_EXIST;break;case"not in group or chatroom":u=h.GROUP_NOT_JOINED;break;case"exceed recall time limit":u=h.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":u=h.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":u=h.SERVICE_NOT_ALLOW_MESSAGING;break;default:u=h.SERVER_UNKNOWN_ERROR}t._msgHash[n].fail instanceof Function&&t._msgHash[n].fail({type:u,reason:r.status.reason?r.status.reason:"",data:{id:n,mid:i}})}else if(r.status&&7===r.status.errorCode&&"sensitive words"===r.status.reason)t._msgHash[n].fail instanceof Function&&t._msgHash[n].fail({type:h.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:n,mid:i}});else if(t._msgHash[n]){try{t._msgHash[n].fail instanceof Function&&t._msgHash[n].fail({type:h.WEBIM_LOAD_MSG_ERROR,data:{errorCode:r.status&&r.status.errorCode,reason:r.status&&r.status.reason}})}catch(e){t.onError({type:h.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete t._msgHash[n]}else t.onError({type:h.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"});break;case 1:var l=f.lookup("easemob.pb.CommUnreadDL");if(l=l.decode(o.payload),t.isDebug&&console.log("下行CommUnreadDLMessage:",l),console.log("CommUnreadDLMessage",l),0===l.unread.length);else for(var c=0;c>>=0)&&e<256)&&(r=a[e])?r:(o=p(e,(0|e)<0?-1:0,!0),i&&(a[e]=o),o):(i=-128<=(e|=0)&&e<128)&&(r=s[e])?r:(o=p(e,e<0?-1:0,!1),i&&(s[e]=o),o)}function l(e,t){if(isNaN(e))return t?_:v;if(t){if(e<0)return _;if(e>=y)return T}else{if(e<=-m)return I;if(e+1>=m)return b}return e<0?l(-e,t).neg():p(e%f|0,e/f|0,t)}function p(e,t,o){return new i(e,t,o)}i.fromInt=u,i.fromNumber=l,i.fromBits=p;var c=Math.pow;function h(e,t,o){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(o=t,t=!1):t=!!t,(o=o||10)<2||360)throw Error("interior hyphen");if(0===r)return h(e.substring(1),t,o).neg();for(var i=l(c(o,8)),n=v,s=0;s>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((n=a).isZero())return u+s;for(;u.length<6;)u="0"+u;s=""+u+s}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(e)),this.eq(e))return 0;var t=this.isNegative(),o=e.isNegative();return t&&!o?-1:!t&&o?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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(E)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,o=65535&this.high,r=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,l=0,c=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,c+=(h+=r+u)>>>16,l+=(c+=o+a)>>>16,l+=t+s,p((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(c&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=d(e)),r)return p(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(I))return e.isOdd()?I:v;if(e.eq(I))return this.isOdd()?I:v;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(g)&&e.lt(g))return l(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,o=65535&this.high,i=this.low>>>16,s=65535&this.low,a=e.high>>>16,u=65535&e.high,c=e.low>>>16,h=65535&e.low,f=0,y=0,m=0,_=0;return m+=(_+=s*h)>>>16,y+=(m+=i*h)>>>16,m&=65535,y+=(m+=s*c)>>>16,f+=(y+=o*h)>>>16,y&=65535,f+=(y+=i*c)>>>16,y&=65535,f+=(y+=s*u)>>>16,f+=t*h+o*c+i*u+s*a,p((m&=65535)<<16|(_&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var t,o,i;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?p((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?_:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return N;i=_}else{if(this.eq(I))return e.eq(E)||e.eq(O)?I:e.eq(I)?E:(t=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?E:O:(o=this.sub(e.mul(t)),i=t.add(o.div(e)));if(e.eq(I))return this.unsigned?_:v;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=v}for(o=this;o.gte(e);){t=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),a=s<=48?1:c(2,s-48),u=l(t),h=u.mul(e);h.isNegative()||h.gt(o);)h=(u=l(t-=a,this.unsigned)).mul(e);u.isZero()&&(u=E),i=i.add(u),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),r?p((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return p(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),p(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),p(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),p(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?p(this.low<>>32-e,this.unsigned):p(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):p(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?p(this.low>>>e|t<<32-e,t>>>e,this.unsigned):p(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.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]},R.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]},i.fromBytes=function(e,t,o){return o?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,o){"use strict";e.exports=function(e,t,o){var r=o||8192,i=r>>>1,n=null,s=r;return function(o){if(o<1||o>i)return e(o);s+o>r&&(n=e(r),s=0);var a=t.call(n,s,s+=o);return 7&s&&(s=1+(7|s)),a}}},function(e,t,o){"use strict";function r(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),o=new Uint8Array(t.buffer),r=128===o[3];function i(e,r,i){t[0]=e,r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=o[3]}function n(e,r,i){t[0]=e,r[i]=o[3],r[i+1]=o[2],r[i+2]=o[1],r[i+3]=o[0]}function s(e,r){return o[0]=e[r],o[1]=e[r+1],o[2]=e[r+2],o[3]=e[r+3],t[0]}function a(e,r){return o[3]=e[r],o[2]=e[r+1],o[1]=e[r+2],o[0]=e[r+3],t[0]}e.writeFloatLE=r?i:n,e.writeFloatBE=r?n:i,e.readFloatLE=r?s:a,e.readFloatBE=r?a:s}():function(){function t(e,t,o,r){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,o,r);else if(isNaN(t))e(2143289344,o,r);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,o,r);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,o,r);else{var n=Math.floor(Math.log(t)/Math.LN2);e((i<<31|n+127<<23|8388607&Math.round(t*Math.pow(2,-n)*8388608))>>>0,o,r)}}function o(e,t,o){var r=e(t,o),i=2*(r>>31)+1,n=r>>>23&255,s=8388607&r;return 255===n?s?NaN:i*(1/0):0===n?1401298464324817e-60*i*s:i*Math.pow(2,n-150)*(s+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,s),e.readFloatBE=o.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),o=new Uint8Array(t.buffer),r=128===o[7];function i(e,r,i){t[0]=e,r[i]=o[0],r[i+1]=o[1],r[i+2]=o[2],r[i+3]=o[3],r[i+4]=o[4],r[i+5]=o[5],r[i+6]=o[6],r[i+7]=o[7]}function n(e,r,i){t[0]=e,r[i]=o[7],r[i+1]=o[6],r[i+2]=o[5],r[i+3]=o[4],r[i+4]=o[3],r[i+5]=o[2],r[i+6]=o[1],r[i+7]=o[0]}function s(e,r){return o[0]=e[r],o[1]=e[r+1],o[2]=e[r+2],o[3]=e[r+3],o[4]=e[r+4],o[5]=e[r+5],o[6]=e[r+6],o[7]=e[r+7],t[0]}function a(e,r){return o[7]=e[r],o[6]=e[r+1],o[5]=e[r+2],o[4]=e[r+3],o[3]=e[r+4],o[2]=e[r+5],o[1]=e[r+6],o[0]=e[r+7],t[0]}e.writeDoubleLE=r?i:n,e.writeDoubleBE=r?n:i,e.readDoubleLE=r?s:a,e.readDoubleBE=r?a:s}():function(){function t(e,t,o,r,i,n){var s=r<0?1:0;if(s&&(r=-r),0===r)e(0,i,n+t),e(1/r>0?0:2147483648,i,n+o);else if(isNaN(r))e(0,i,n+t),e(2146959360,i,n+o);else if(r>17976931348623157e292)e(0,i,n+t),e((s<<31|2146435072)>>>0,i,n+o);else{var a;if(r<22250738585072014e-324)e((a=r/5e-324)>>>0,i,n+t),e((s<<31|a/4294967296)>>>0,i,n+o);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=r*Math.pow(2,-u))>>>0,i,n+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,i,n+o)}}}function o(e,t,o,r,i){var n=e(r,i+t),s=e(r,i+o),a=2*(s>>31)+1,u=s>>>20&2047,l=4294967296*(1048575&s)+n;return 2047===u?l?NaN:a*(1/0):0===u?5e-324*a*l:a*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,s,0,4),e.readDoubleBE=o.bind(null,a,4,0)}(),e}function i(e,t,o){t[o]=255&e,t[o+1]=e>>>8&255,t[o+2]=e>>>16&255,t[o+3]=e>>>24}function n(e,t,o){t[o]=e>>>24,t[o+1]=e>>>16&255,t[o+2]=e>>>8&255,t[o+3]=255&e}function s(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=r(r)},function(e,t,o){"use strict";e.exports=function(e,t){var o=new Array(arguments.length-1),r=0,i=2,n=!0;for(;i0&&".."!==t[n-1]?t.splice(--n,2):o?t.splice(n,1):++n:"."===t[n]?t.splice(n,1):++n;return r+t.join("/")};r.resolve=function(e,t,o){return o||(t=n(t)),i(t)?t:(o||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},function(e,t,o){"use strict";var r=o(0);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i,n,s,a,u=r(o(5)),l=(0,r(o(7)).default)(),p="undefined"!=typeof FormData,c="undefined"!=typeof Blob,h=(!1).overrideMimeType||!1,d=p,f=d||!1,y=c||h,m=function(){};Object.keys||(Object.keys=(i=Object.prototype.hasOwnProperty,n=!{toString:null}.propertyIsEnumerable("toString"),a=(s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("object"!==(0,u.default)(e)&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var t,o,r=[];for(t in e)i.call(e,t)&&r.push(t);if(n)for(o=0;o0){var i=r.item(0);t.data=i,t.url=window.URL.createObjectURL(i),t.filename=i.name||""}}else{i=document.getElementById(e).value;t.url=i;var n=i.lastIndexOf("/"),s=i.lastIndexOf("\\"),a=Math.max(n,s);t.filename=a<0?i:i.substring(a+1)}var u=t.filename.lastIndexOf(".");return-1!=u&&(t.filetype=t.filename.substring(u+1).toLowerCase()),t}catch(e){throw e}},getFileSize:function(e){var t=document.getElementById(e),o=0;return t&&t.files&&t.files.length>0&&(o=t.files[0].size),o},trim:function(e){return(e="string"==typeof e?e:"").trim?e.trim():e.replace(/^\s|\s$/g,"")},parseLink:function(e){return e=e.replace(/(https?\:\/\/|www\.)([a-zA-Z0-9-]+(\.[a-zA-Z0-9]+)+)(\:[0-9]{2,4})?\/?((\.[:_0-9a-zA-Z-]+)|[:_0-9a-zA-Z-]*\/?)*\??[:_#@*&%0-9a-zA-Z-/=]*/gm,(function(e){return""+e+""}))},parseJSON:function(e){if(window.JSON&&window.JSON.parse)return window.JSON.parse(e+"");var t,o=null,r=g.trim(e+"");return r&&!g.trim(r.replace(/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g,(function(e,r,i,n){return t&&r&&(o=0),0===o?e:(t=i||r,o+=!n-!i,"")})))?Function("return "+r)():Function("Invalid JSON: "+e)()},parseUploadResponse:function(e){return e.indexOf("callback")>-1?e.slice(9,-1):e},parseDownloadResponse:function(e){return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},uploadFile:function(e){(e=e||{}).onFileUploadProgress=e.onFileUploadProgress||m,e.onFileUploadComplete=e.onFileUploadComplete||m,e.onFileUploadError=e.onFileUploadError||m,e.onFileUploadCanceled=e.onFileUploadCanceled||m;var t=e.accessToken||this.context.accessToken;if(t){var o,r,i,n=e.appKey||this.context.appKey||"";if(n&&(o=(i=n.split("#"))[0],r=i[1]),o||r){var s=e.apiUrl;this.isHttpDNS&&(s=this.apiUrl);var a=e.uploadUrl||s+"/"+o+"/"+r+"/chatfiles";if(g.isCanUploadFileAsync)if((e.file.data?e.file.data.size:void 0)<=0)e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,id:e.id});else{var u=g.xmlrequest();u.upload&&u.upload.addEventListener("progress",e.onFileUploadProgress,!1),u.addEventListener?(u.addEventListener("abort",e.onFileUploadCanceled,!1),u.addEventListener("load",(function(t){try{var o=g.parseJSON(u.responseText);try{e.onFileUploadComplete(o)}catch(t){e.onFileUploadError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:u.responseText,id:e.id,xhr:u})}}),!1),u.addEventListener("error",(function(t){e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,id:e.id,xhr:u})}),!1)):u.onreadystatechange&&(u.onreadystatechange=function(){if(4===u.readyState)if(200===ajax.status)try{var t=g.parseJSON(u.responseText);e.onFileUploadComplete(t)}catch(t){e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:u.responseText,id:e.id,xhr:u})}else e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:u.responseText,id:e.id,xhr:u});else u.abort(),e.onFileUploadCanceled()}),u.open("POST",a),u.setRequestHeader("restrict-access","true"),u.setRequestHeader("Accept","*/*"),u.setRequestHeader("Authorization","Bearer "+t);var p=new FormData;p.append("file",e.file.data),window.XDomainRequest&&(u.readyState=2),u.send(p)}else g.hasFlash&&"function"==typeof e.flashUpload?e.flashUpload&&e.flashUpload(a,e):e.onFileUploadError({type:l.WEBIM_UPLOADFILE_BROWSER_ERROR,id:e.id})}else e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,id:e.id})}else e.onFileUploadError({type:l.WEBIM_UPLOADFILE_NO_LOGIN,id:e.id})},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||m,e.onFileDownloadError=e.onFileDownloadError||m;var t=e.accessToken||this.context.accessToken,o=g.xmlrequest();if(t){if(g.isCanDownLoadFile){"addEventListener"in o?(o.addEventListener("load",(function(t){e.onFileDownloadComplete(o.response,o)}),!1),o.addEventListener("error",(function(t){e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}),!1)):"onreadystatechange"in o&&(o.onreadystatechange=function(){4===o.readyState?200===ajax.status?e.onFileDownloadComplete(o.response,o):e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}):(o.abort(),e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}))});var r=e.method||"GET",i=e.responseType||"blob",n=e.mimeType||"text/plain; charset=x-user-defined";o.open(r,e.url),"undefined"!=typeof Blob?o.responseType=i:o.overrideMimeType(n);var s={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+t},a=e.headers||{};for(var u in a)s[u]=a[u];for(var u in s)s[u]&&o.setRequestHeader(u,s[u]);window.XDomainRequest&&(o.readyState=2),o.send(null)}else e.onFileDownloadComplete()}else e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_NO_LOGIN,id:e.id})},parseTextMessage:function(e,t){if("string"==typeof e){if("[object Object]"!==Object.prototype.toString.call(t))return{isemoji:!1,body:[{type:"txt",data:e}]};var o=e,r=[],i=o.match(/\[[^[\]]{2,3}\]/gm);if(!i||i.length<1)return{isemoji:!1,body:[{type:"txt",data:e}]};for(var n=!1,s=0;s0?"&":"?")+(n?n+"&":n)+"_v="+(new Date).getTime(),i=null,n=null}wx.request({url:e.url,data:e.data,header:e.headers,method:r,success:function(e){"200"==e.statusCode?t(e.data):o(e)},complete:function(){},fail:function(e){o(e)}})},ts:function(){var e=new Date,t=e.getHours(),o=e.getMinutes(),r=e.getSeconds();return(t<10?"0"+t:t)+":"+(o<10?"0"+o:o)+":"+(r<10?"0"+r:r)+":"+e.getMilliseconds()+" "},getObjectKey:function(e,t){for(var o in e)if(e[o]==t)return o;return""},sprintf:function(){var e,t,o=arguments,r=o[0]||"";for(e=1,t=o.length;e