easemob-websdk 4.0.1 → 4.0.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Easemob-chat.d.ts +317 -285
- package/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/readme.md +1 -2
package/Easemob-chat.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see Easemob-chat.js.LICENSE.txt */
|
|
2
|
-
!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()}(self,(function(){return(()=>{var __webpack_modules__={4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise((function(n,s){r[o]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var o=new Array(64),n=new Array(123),i=0;i<64;)n[o[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var n,i=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=o[u>>2],n=(3&u)<<4,c=1;break;case 1:s[a++]=o[n|u>>4],n=(15&u)<<2,c=2;break;case 2:s[a++]=o[n|u>>6],s[a++]=o[63&u],c=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=o[n],s[a++]=61,1===c&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var o,i=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=n[u]))throw Error(s);switch(a){case 0:o=u,a=1;break;case 1:t[r++]=o<<2|(48&u)>>4,o=u,a=2;break;case 2:t[r++]=(15&o)<<4|(60&u)>>2,o=u,a=3;break;case 3:t[r++]=(3&o)<<6|u,a=0}}if(1===a)throw Error(s);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var o=[];function n(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var p=new Array(arguments.length-1),l=0;l<p.length;)p[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=p[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==p.length)throw Error("parameter count mismatch");return o.push(e),n}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+o.join("\n ")+"\n}"}return n.toString=i,n}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],o=0;o<r.length;)r[o].fn===t?r.splice(o,1):++o;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],o=1;o<arguments.length;)r.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=i;var o=r(4537),n=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&n&&n.readFile?n.readFile(e,(function(o,n){return o&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):o?r(o):r(null,t.binary?n:n.toString("utf8"))})):i.xhr(e,t,r):o(i,this,e,t)}i.xhr=function(e,t,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState){if(0!==o.status&&200!==o.status)return r(Error("status "+o.status));if(t.binary){var e=o.response;if(!e){e=[];for(var n=0;n<o.responseText.length;++n)e.push(255&o.responseText.charCodeAt(n))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,o.responseText)}},t.binary&&("overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.responseType="arraybuffer"),o.open("GET",e),o.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=128===r[3];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3]}function i(e,o,n){t[0]=e,o[n]=r[3],o[n+1]=r[2],o[n+2]=r[1],o[n+3]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],t[0]}function a(e,o){return r[3]=e[o],r[2]=e[o+1],r[1]=e[o+2],r[0]=e[o+3],t[0]}e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n,e.readFloatLE=o?s:a,e.readFloatBE=o?a:s}():function(){function t(e,t,r,o){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,o);else if(isNaN(t))e(2143289344,r,o);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,o);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,o)}}function s(e,t,r){var o=e(t,r),n=2*(o>>31)+1,i=o>>>23&255,s=8388607&o;return 255===i?s?NaN:n*(1/0):0===i?1401298464324817e-60*n*s:n*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o),e.readFloatLE=s.bind(null,n),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=128===r[7];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3],o[n+4]=r[4],o[n+5]=r[5],o[n+6]=r[6],o[n+7]=r[7]}function i(e,o,n){t[0]=e,o[n]=r[7],o[n+1]=r[6],o[n+2]=r[5],o[n+3]=r[4],o[n+4]=r[3],o[n+5]=r[2],o[n+6]=r[1],o[n+7]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],r[4]=e[o+4],r[5]=e[o+5],r[6]=e[o+6],r[7]=e[o+7],t[0]}function a(e,o){return r[7]=e[o],r[6]=e[o+1],r[5]=e[o+2],r[4]=e[o+3],r[3]=e[o+4],r[2]=e[o+5],r[1]=e[o+6],r[0]=e[o+7],t[0]}e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n,e.readDoubleLE=o?s:a,e.readDoubleBE=o?a:s}():function(){function t(e,t,r,o,n,i){var s=o<0?1:0;if(s&&(o=-o),0===o)e(0,n,i+t),e(1/o>0?0:2147483648,n,i+r);else if(isNaN(o))e(0,n,i+t),e(2146959360,n,i+r);else if(o>17976931348623157e292)e(0,n,i+t),e((s<<31|2146435072)>>>0,n,i+r);else{var a;if(o<22250738585072014e-324)e((a=o/5e-324)>>>0,n,i+t),e((s<<31|a/4294967296)>>>0,n,i+r);else{var c=Math.floor(Math.log(o)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=o*Math.pow(2,-c))>>>0,n,i+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,n,i+r)}}}function s(e,t,r,o,n){var i=e(o,n+t),s=e(o,n+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+i;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=s.bind(null,n,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,o=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=o(e),n="";r&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};r.resolve=function(e,t,r){return r||(t=n(t)),o(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var o=r||8192,n=o>>>1,i=null,s=o;return function(r){if(r<1||r>n)return e(r);s+r>o&&(i=e(o),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var o,n=null,i=[],s=0;t<r;)(o=e[t++])<128?i[s++]=o:o>191&&o<224?i[s++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(o>>10),i[s++]=56320+(1023&o)):i[s++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.write=function(e,t,r){for(var o,n,i=r,s=0;s<e.length;++s)(o=e.charCodeAt(s))<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&56320==(64512&(n=e.charCodeAt(s+1)))?(o=65536+((1023&o)<<10)+(1023&n),++s,t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128);return r-i}},4188:(e,t,r)=>{var o,n,i;!function(s){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=s();else if(null!=r.amdO)n=[],void 0===(i="function"==typeof(o=s)?o.apply(t,n):o)||(e.exports=i);else{var a=s(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=a.btoa),"function"!=typeof c.atob&&(c.atob=a.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var o,n,i=String(r),s=0,a=e,c="";i.charAt(0|s)||(a="=",s%1);c+=a.charAt(63&o>>8-s%1*8)){if((n=i.charCodeAt(s+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c},atob:function(r){var o=String(r).replace(/[=]+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,c="";i=o.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?c+=String.fromCharCode(255&n>>(-2*s&6)):0)i=e.indexOf(i);return c}}}))},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7522:function(e,t,r){var o;e=r.nmd(e),function(){var n=r.amdO,i={function:!0,object:!0},s=i[typeof t]&&t&&!t.nodeType&&t,a=i[typeof window]&&window||this,c=s&&i.object&&e&&!e.nodeType&&"object"==typeof r.g&&r.g;function u(e,t){e||(e=a.Object()),t||(t=a.Object());var r=e.Number||a.Number,o=e.String||a.String,n=e.Object||a.Object,s=e.Date||a.Date,c=e.SyntaxError||a.SyntaxError,p=e.TypeError||a.TypeError,l=e.Math||a.Math,h=e.JSON||a.JSON;"object"==typeof h&&h&&(t.stringify=h.stringify,t.parse=h.parse);var d,f=n.prototype,m=f.toString,y=f.hasOwnProperty;function g(e,t){try{e()}catch(e){t&&t()}}var v=new s(-0xc782b5b800cec);function E(e){if(null!=E[e])return E[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=E("json-stringify")&&E("date-serialization")&&E("json-parse");else if("date-serialization"==e){if(n=E("json-stringify")&&v){var i=t.stringify;g((function(){n='"-271821-04-20T00:00:00.000Z"'==i(new s(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==i(new s(864e13))&&'"-000001-01-01T00:00:00.000Z"'==i(new s(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==i(new s(-1))}))}}else{var a,c='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u="function"==typeof(i=t.stringify);u&&((a=function(){return 1}).toJSON=a,g((function(){u="0"===i(0)&&"0"===i(new r)&&'""'==i(new o)&&i(m)===d&&i(d)===d&&i()===d&&"1"===i(a)&&"[1]"==i([a])&&"[null]"==i([d])&&"null"==i(null)&&"[null,null,null]"==i([d,m,null])&&i({a:[a,!0,!1,null,"\0\b\n\f\r\t"]})==c&&"1"===i(null,a)&&"[\n 1,\n 2\n]"==i([1,2],null,1)}),(function(){u=!1}))),n=u}if("json-parse"==e){var p,l=t.parse;"function"==typeof l&&g((function(){0!==l("0")||l(!1)||(a=l(c),(p=5==a.a.length&&1===a.a[0])&&(g((function(){p=!l('"\t"')})),p&&g((function(){p=1!==l("01")})),p&&g((function(){p=1!==l("1.")}))))}),(function(){p=!1})),n=p}}return E[e]=!!n}if(g((function(){v=-109252==v.getUTCFullYear()&&0===v.getUTCMonth()&&1===v.getUTCDate()&&10==v.getUTCHours()&&37==v.getUTCMinutes()&&6==v.getUTCSeconds()&&708==v.getUTCMilliseconds()})),E["bug-string-char-index"]=E["date-serialization"]=E.json=E["json-stringify"]=E["json-parse"]=null,!E("json")){var _="[object Function]",T="[object Number]",I="[object String]",O="[object Array]",N=E("bug-string-char-index"),b=function(e,t){var r,o,n,s=0;for(n in(r=function(){this.valueOf=0}).prototype.valueOf=0,o=new r)y.call(o,n)&&s++;return r=o=null,s?b=function(e,t){var r,o,n=m.call(e)==_;for(r in e)n&&"prototype"==r||!y.call(e,r)||(o="constructor"===r)||t(r);(o||y.call(e,r="constructor"))&&t(r)}:(o=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],b=function(e,t){var r,n,s=m.call(e)==_,a=!s&&"function"!=typeof e.constructor&&i[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(r in e)s&&"prototype"==r||!a.call(e,r)||t(r);for(n=o.length;r=o[--n];)a.call(e,r)&&t(r)}),b(e,t)};if(!E("json-stringify")&&!E("date-serialization")){var S={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},R=function(e,t){return("000000"+(t||0)).slice(-e)},C=function(e){var t,r,o,n,i,s,a,c,u;if(v)t=function(e){r=e.getUTCFullYear(),o=e.getUTCMonth(),n=e.getUTCDate(),s=e.getUTCHours(),a=e.getUTCMinutes(),c=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var p=l.floor,h=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return h[t]+365*(e-1970)+p((e-1969+(t=+(t>1)))/4)-p((e-1901+t)/100)+p((e-1601+t)/400)};t=function(e){for(n=p(e/864e5),r=p(n/365.2425)+1970-1;d(r+1,0)<=n;r++);for(o=p((n-d(r,0))/30.42);d(r,o+1)<=n;o++);n=1+n-d(r,o),s=p((i=(e%864e5+864e5)%864e5)/36e5)%24,a=p(i/6e4)%60,c=p(i/1e3)%60,u=i%1e3}}return C=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+R(6,r<0?-r:r):R(4,r))+"-"+R(2,o+1)+"-"+R(2,n)+"T"+R(2,s)+":"+R(2,a)+":"+R(2,c)+"."+R(3,u)+"Z",r=o=n=s=a=c=u=null):e=null,e},C(e)};if(E("json-stringify")&&!E("date-serialization")){function w(e){return C(this)}var A=t.stringify;t.stringify=function(e,t,r){var o=s.prototype.toJSON;s.prototype.toJSON=w;var n=A(e,t,r);return s.prototype.toJSON=o,n}}else{var k=function(e){var t=e.charCodeAt(0);return S[t]||"\\u00"+R(2,t.toString(16))},x=/[\x00-\x1f\x22\x5c]/g,M=function(e){return x.lastIndex=0,'"'+(x.test(e)?e.replace(x,k):e)+'"'},j=function(e,t,r,o,n,i,a){var c,u,l,h,f,y,v,E,_;if(g((function(){c=t[e]})),"object"==typeof c&&c&&(c.getUTCFullYear&&"[object Date]"==m.call(c)&&c.toJSON===s.prototype.toJSON?c=C(c):"function"==typeof c.toJSON&&(c=c.toJSON(e))),r&&(c=r.call(t,e,c)),c==d)return c===d?c:"null";switch("object"==(u=typeof c)&&(l=m.call(c)),l||u){case"boolean":case"[object Boolean]":return""+c;case"number":case T:return c>-1/0&&c<1/0?""+c:"null";case"string":case I:return M(""+c)}if("object"==typeof c){for(v=a.length;v--;)if(a[v]===c)throw p();if(a.push(c),h=[],E=i,i+=n,l==O){for(y=0,v=c.length;y<v;y++)f=j(y,c,r,o,n,i,a),h.push(f===d?"null":f);_=h.length?n?"[\n"+i+h.join(",\n"+i)+"\n"+E+"]":"["+h.join(",")+"]":"[]"}else b(o||c,(function(e){var t=j(e,c,r,o,n,i,a);t!==d&&h.push(M(e)+":"+(n?" ":"")+t)})),_=h.length?n?"{\n"+i+h.join(",\n"+i)+"\n"+E+"}":"{"+h.join(",")+"}":"{}";return a.pop(),_}};t.stringify=function(e,t,r){var o,n,s,a;if(i[typeof t]&&t)if((a=m.call(t))==_)n=t;else if(a==O){s={};for(var c,u=0,p=t.length;u<p;)c=t[u++],"[object String]"!=(a=m.call(c))&&"[object Number]"!=a||(s[c]=1)}if(r)if((a=m.call(r))==T){if((r-=r%1)>0)for(r>10&&(r=10),o="";o.length<r;)o+=" "}else a==I&&(o=r.length<=10?r:r.slice(0,10));return j("",((c={})[""]=e,c),n,s,o,"",[])}}}if(!E("json-parse")){var U,P,L=o.fromCharCode,B={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},D=function(){throw U=P=null,c()},G=function(){for(var e,t,r,o,n,i=P,s=i.length;U<s;)switch(n=i.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=N?i.charAt(U):i[U],U++,e;case 34:for(e="@",U++;U<s;)if((n=i.charCodeAt(U))<32)D();else if(92==n)switch(n=i.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=B[n],U++;break;case 117:for(t=++U,r=U+4;U<r;U++)(n=i.charCodeAt(U))>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70||D();e+=L("0x"+i.slice(t,U));break;default:D()}else{if(34==n)break;for(n=i.charCodeAt(U),t=U;n>=32&&92!=n&&34!=n;)n=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;D();default:if(t=U,45==n&&(o=!0,n=i.charCodeAt(++U)),n>=48&&n<=57){for(48==n&&(n=i.charCodeAt(U+1))>=48&&n<=57&&D(),o=!1;U<s&&(n=i.charCodeAt(U))>=48&&n<=57;U++);if(46==i.charCodeAt(U)){for(r=++U;r<s&&!((n=i.charCodeAt(r))<48||n>57);r++);r==U&&D(),U=r}if(101==(n=i.charCodeAt(U))||69==n){for(43!=(n=i.charCodeAt(++U))&&45!=n||U++,r=U;r<s&&!((n=i.charCodeAt(r))<48||n>57);r++);r==U&&D(),U=r}return+i.slice(t,U)}o&&D();var a=i.slice(U,U+4);if("true"==a)return U+=4,!0;if("fals"==a&&101==i.charCodeAt(U+4))return U+=5,!1;if("null"==a)return U+=4,null;D()}return"$"},W=function(e){var t,r;if("$"==e&&D(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=G());)r?","==e?"]"==(e=G())&&D():D():r=!0,","==e&&D(),t.push(W(e));return t}if("{"==e){for(t={};"}"!=(e=G());)r?","==e?"}"==(e=G())&&D():D():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==G()||D(),t[e.slice(1)]=W(G());return t}D()}return e},F=function(e,t,r){var o=H(e,t,r);o===d?delete e[t]:e[t]=o},H=function(e,t,r){var o,n=e[t];if("object"==typeof n&&n)if(m.call(n)==O)for(o=n.length;o--;)F(m,b,n);else b(n,(function(e){F(n,e,r)}));return r.call(e,t,n)};t.parse=function(e,t){var r,o;return U=0,P=""+e,r=W(G()),"$"!=G()&&D(),U=P=null,t&&m.call(t)==_?H(((o={})[""]=r,o),"",t):r}}}return t.runInContext=u,t}if(!c||c.global!==c&&c.window!==c&&c.self!==c||(a=c),s&&!n)u(a,s);else{var p=a.JSON,l=a.JSON3,h=!1,d=u(a,a.JSON3={noConflict:function(){return h||(h=!0,a.JSON=p,a.JSON3=l,p=l=null),d}});a.JSON={parse:d.parse,stringify:d.stringify}}n&&(void 0===(o=function(){return d}.call(t,r,t,e))||(e.exports=o))}.call(this)},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=c(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=c(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?g:y;if(t){if(e<0)return g;if(e>=d)return I}else{if(e<=-f)return O;if(e+1>=f)return T}return e<0?a(-e,t).neg():c(e%h|0,e/h|0,t)}function c(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=c;var u=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(u(r,8)),i=y,s=0;s<e.length;s+=8){var c=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+c),r);if(c<8){var h=a(u(r,c));i=i.mul(h).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var h=4294967296,d=h*h,f=d/2,m=s(1<<24),y=s(0);r.ZERO=y;var g=s(0,!0);r.UZERO=g;var v=s(1);r.ONE=v;var E=s(1,!0);r.UONE=E;var _=s(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var N=r.prototype;N.toInt=function(){return this.unsigned?this.low>>>0:this.low},N.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},N.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(u(e,6),this.unsigned),i=this,s="";;){var c=i.div(n),p=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},N.getHighBits=function(){return this.high},N.getHighBitsUnsigned=function(){return this.high>>>0},N.getLowBits=function(){return this.low},N.getLowBitsUnsigned=function(){return this.low>>>0},N.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},N.isZero=function(){return 0===this.high&&0===this.low},N.eqz=N.isZero,N.isNegative=function(){return!this.unsigned&&this.high<0},N.isPositive=function(){return this.unsigned||this.high>=0},N.isOdd=function(){return 1==(1&this.low)},N.isEven=function(){return 0==(1&this.low)},N.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},N.eq=N.equals,N.notEquals=function(e){return!this.eq(e)},N.neq=N.notEquals,N.ne=N.notEquals,N.lessThan=function(e){return this.comp(e)<0},N.lt=N.lessThan,N.lessThanOrEqual=function(e){return this.comp(e)<=0},N.lte=N.lessThanOrEqual,N.le=N.lessThanOrEqual,N.greaterThan=function(e){return this.comp(e)>0},N.gt=N.greaterThan,N.greaterThanOrEqual=function(e){return this.comp(e)>=0},N.gte=N.greaterThanOrEqual,N.ge=N.greaterThanOrEqual,N.compare=function(e){if(o(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},N.comp=N.compare,N.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(v)},N.neg=N.negate,N.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,p=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+u)>>>16,p+=(h+=r+a)>>>16,p+=t+s,c((d&=65535)<<16|(f&=65535),(p&=65535)<<16|(h&=65535),this.unsigned)},N.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},N.sub=N.subtract,N.multiply=function(e){if(this.isZero())return y;if(o(e)||(e=l(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(O))return e.isOdd()?O:y;if(e.eq(O))return this.isOdd()?O:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,p=65535&e.high,h=e.low>>>16,d=65535&e.low,f=0,g=0,v=0,E=0;return v+=(E+=s*d)>>>16,g+=(v+=i*d)>>>16,v&=65535,g+=(v+=s*h)>>>16,f+=(g+=n*d)>>>16,g&=65535,f+=(g+=i*h)>>>16,g&=65535,f+=(g+=s*p)>>>16,f+=r*d+n*h+i*p+s*u,c((v&=65535)<<16|(E&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},N.mul=N.multiply,N.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(O))return e.eq(v)||e.eq(_)?O:e.eq(O)?v:(r=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?v:_:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(O))return this.unsigned?g:y;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=y}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:u(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=p,this.unsigned)).mul(e);h.isZero()&&(h=v),i=i.add(h),n=n.sub(d)}return i},N.div=N.divide,N.modulo=function(e){return o(e)||(e=l(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},N.mod=N.modulo,N.rem=N.modulo,N.not=function(){return c(~this.low,~this.high,this.unsigned)},N.and=function(e){return o(e)||(e=l(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},N.or=function(e){return o(e)||(e=l(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},N.xor=function(e){return o(e)||(e=l(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},N.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},N.shl=N.shiftLeft,N.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},N.shr=N.shiftRight,N.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},N.shru=N.shiftRightUnsigned,N.shr_u=N.shiftRightUnsigned,N.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},N.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},N.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},N.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]},N.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3281:(e,t,r)=>{"use strict";e.exports=r(9050)},2967:e=>{"use strict";e.exports=o;var t,r=/\/|\./;function o(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:t}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},3996:(e,t,r)=>{"use strict";var o=t,n=r(7025),i=r(9935);function s(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",o);for(var i=t.resolvedType.values,s=Object.keys(i),a=0;a<s.length;++a)t.repeated&&i[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",i[s[a]])("m%s=%j",o,i[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,r,o);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,c)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function a(e,t,r,o){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",o,r,o,o):e("d%s=types[%i].toObject(m%s,o)",o,r,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}o.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var o=0;o<t.length;++o){var a=t[o].resolve(),c=i.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,o,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,o,c+"[i]")("}")("}")):(a.resolvedType instanceof n||r("if(d%s!=null){",c),s(r,a,o,c),a.resolvedType instanceof n||r("}"))}return r("return m")},o.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),o=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?o:t[u].map?s:c).push(t[u]);if(o.length){for(r("if(o.arrays||o.defaults){"),u=0;u<o.length;++u)r("d%s=[]",i.safeProp(o[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",i.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var p=c[u],l=i.safeProp(p.name);if(p.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",l,p.resolvedType.valuesById[p.typeDefault],p.typeDefault);else if(p.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",p.typeDefault.low,p.typeDefault.high,p.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,p.typeDefault.toString(),p.typeDefault.toNumber());else if(p.bytes){var h="["+Array.prototype.slice.call(p.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,p.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,p.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){p=t[u];var f=e._fieldsArray.indexOf(p);l=i.safeProp(p.name),p.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(r,p,f,l+"[ks2[j]]")("}")):p.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,p,f,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,p.name),a(r,p,f,l),p.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(p.partOf.name),p.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof o?"int32":a.type,u="m"+i.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[c]?t("value=%j",n.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==n.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===n.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===n.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var p=e._fieldsArray[r];p.required&&t("if(!m.hasOwnProperty(%j))",p.name)("throw util.ProtocolError(%j,{instance:m})",s(p))}return t("return m")};var o=r(7025),n=r(7063),i=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),p=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof o?"int32":u.type,h=n.basic[l];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|n.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",p,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,p,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,p,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return r("return w")};var o=r(7025),n=r(7063),i=r(9935);function s(e,t,r,o){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,o,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,o,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var o=r(3243);((s.prototype=Object.create(o.prototype)).constructor=s).className="Enum";var n=r(9313),i=r(9935);function s(e,t,r,n,i){if(o.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var o=r(3243);((u.prototype=Object.create(o.prototype)).constructor=u).className="Field";var n,i=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,n,i,u,p){if(a.isObject(n)?(p=i,u=n,n=i=void 0):a.isObject(i)&&(p=u,u=i,i=void 0),o.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==n&&!c.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),o.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?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=a.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;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),o.prototype.resolve.call(this)},u.d=function(e,t,r,o){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,i){a.decorateType(n.constructor).add(new u(i,e,t,r,{default:o}))}},u._configure=function(e){n=e}},8836:(e,t,r)=>{"use strict";var o=e.exports=r(9482);o.build="light",o.load=function(e,t,r){return"function"==typeof t?(r=t,t=new o.Root):t||(t=new o.Root),t.load(e,r)},o.loadSync=function(e,t){return t||(t=new o.Root),t.loadSync(e)},o.encoder=r(4928),o.decoder=r(5305),o.verifier=r(4497),o.converter=r(3996),o.ReflectionObject=r(3243),o.Namespace=r(9313),o.Root=r(9424),o.Enum=r(7025),o.Type=r(7645),o.Field=r(3548),o.OneOf=r(7598),o.MapField=r(6039),o.Service=r(7513),o.Method=r(4429),o.Message=r(8368),o.wrappers=r(1667),o.types=r(7063),o.util=r(9935),o.ReflectionObject._configure(o.Root),o.Namespace._configure(o.Type,o.Service,o.Enum),o.Root._configure(o.Type),o.Field._configure(o.Type)},9482:(e,t,r)=>{"use strict";var o=t;function n(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}o.build="minimal",o.Writer=r(1173),o.BufferWriter=r(3155),o.Reader=r(1408),o.BufferReader=r(593),o.util=r(9693),o.rpc=r(5994),o.roots=r(5054),o.configure=n,n()},9050:(e,t,r)=>{"use strict";var o=e.exports=r(8836);o.build="full",o.tokenize=r(626),o.parse=r(2228),o.common=r(2967),o.Root._configure(o.Type,o.parse,o.common)},6039:(e,t,r)=>{"use strict";e.exports=s;var o=r(3548);((s.prototype=Object.create(o.prototype)).constructor=s).className="MapField";var n=r(7063),i=r(9935);function s(e,t,r,n,s,a){if(o.call(this,e,t,n,void 0,void 0,s,a),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return o.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(o,n){i.decorateType(o.constructor).add(new s(n,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=i;var o=r(3243);((i.prototype=Object.create(o.prototype)).constructor=i).className="Method";var n=r(9935);function i(e,t,r,i,s,a,c,u,p){if(n.isObject(s)?(c=s,s=a=void 0):n.isObject(a)&&(c=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(r))throw TypeError("requestType must be a string");if(!n.isString(i))throw TypeError("responseType must be a string");o.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=p}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.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,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),o.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var o=r(3243);((l.prototype=Object.create(o.prototype)).constructor=l).className="Namespace";var n,i,s,a=r(3548),c=r(7598),u=r(9935);function p(e,t){if(e&&e.length){for(var r={},o=0;o<e.length;++o)r[e[o].name]=e[o].toJSON(t);return r}}function l(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=p,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",p(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),o=0;o<r.length;++o)t=e[r[o]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[o],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof s||e instanceof i||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof n||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,o=0;o<r.length;++o)e.add(r[o]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var o=e.shift();if(r.nested&&r.nested[o]){if(!((r=r.nested[o])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(o))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof l&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof l&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){n=e,i=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=i,i.className="ReflectionObject";var o,n=r(9935);function i(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof o&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof o&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof o&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var o=this.parsedOptions;if(r){var i=o.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var s=i[e];n.setProperty(s,r,t)}else(i={})[e]=n.setProperty({},r,t),o.push(i)}else{var a={};a[e]=t,o.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)this.setOption(r[o],e[r[o]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){o=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var o=r(3243);((s.prototype=Object.create(o.prototype)).constructor=s).className="OneOf";var n=r(3548),i=r(9935);function s(e,t,r,n){if(Array.isArray(t)||(r=t,t=void 0),o.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){o.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);o.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},2228:(e,t,r)=>{"use strict";e.exports=N,N.filename=null,N.defaults={keepCase:!1};var o=r(626),n=r(9424),i=r(7645),s=r(3548),a=r(6039),c=r(7598),u=r(7025),p=r(7513),l=r(4429),h=r(7063),d=r(9935),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,y=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,E=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,O=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function N(e,t,r){t instanceof n||(r=t,t=new n),r||(r=N.defaults);var b,S,R,C,w,A=r.preferTrailingComment||!1,k=o(e,r.alternateCommentMode||!1),x=k.next,M=k.push,j=k.peek,U=k.skip,P=k.cmnt,L=!0,B=!1,D=t,G=r.keepCase?function(e){return e}:d.camelCase;function W(e,t,r){var o=N.filename;return r||(N.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+k.line+")")}function F(){var e,t=[];do{if('"'!==(e=x())&&"'"!==e)throw W(e);t.push(x()),U(e),e=j()}while('"'===e||"'"===e);return t.join("")}function H(e){var t=x();switch(t){case"'":case'"':return M(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return r*parseInt(e,10);if(y.test(e))return r*parseInt(e,16);if(v.test(e))return r*parseInt(e,8);if(_.test(e))return r*parseFloat(e);throw W(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw W(t,"value")}}function q(e,t){var r,o;do{!t||'"'!==(r=j())&&"'"!==r?e.push([o=J(x()),U("to",!0)?J(x()):o]):e.push(F())}while(U(",",!0));U(";")}function J(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw W(e,"id");if(m.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(E.test(e))return parseInt(e,8);throw W(e,"id")}function z(){if(void 0!==b)throw W("package");if(b=x(),!I.test(b))throw W(b,"name");D=D.define(b),U(";")}function V(){var e,t=j();switch(t){case"weak":e=R||(R=[]),x();break;case"public":x();default:e=S||(S=[])}t=F(),U(";"),e.push(t)}function K(){if(U("="),C=F(),!(B="proto3"===C)&&"proto2"!==C)throw W(C,"syntax");U(";")}function X(e,t){switch(t){case"option":return Z(e,t),U(";"),!0;case"message":return function(e,t){if(!T.test(t=x()))throw W(t,"type name");var r=new i(t);$(r,(function(e){if(!X(r,e))switch(e){case"map":!function(e){U("<");var t=x();if(void 0===h.mapKey[t])throw W(t,"type");U(",");var r=x();if(!I.test(r))throw W(r,"type");U(">");var o=x();if(!T.test(o))throw W(o,"name");U("=");var n=new a(G(o),J(x()),t,r);$(n,(function(e){if("option"!==e)throw W(e);Z(n,e),U(";")}),(function(){te(n)})),e.add(n)}(r);break;case"required":case"repeated":Y(r,e);break;case"optional":Y(r,B?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=x()))throw W(t,"name");var r=new c(G(t));$(r,(function(e){"option"===e?(Z(r,e),U(";")):(M(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":q(r.extensions||(r.extensions=[]));break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!I.test(e))throw W(e);M(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=x()))throw W(t,"name");var r=new u(t);$(r,(function(e){switch(e){case"option":Z(r,e),U(";");break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw W(t,"name");U("=");var r=J(x(),!0),o={};$(o,(function(e){if("option"!==e)throw W(e);Z(o,e),U(";")}),(function(){te(o)})),e.add(t,r,o.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=x()))throw W(t,"service name");var r=new p(t);$(r,(function(e){if(!X(r,e)){if("rpc"!==e)throw W(e);!function(e,t){var r=P(),o=t;if(!T.test(t=x()))throw W(t,"name");var n,i,s,a,c=t;if(U("("),U("stream",!0)&&(i=!0),!I.test(t=x()))throw W(t);if(n=t,U(")"),U("returns"),U("("),U("stream",!0)&&(a=!0),!I.test(t=x()))throw W(t);s=t,U(")");var u=new l(c,o,n,s,i,a);u.comment=r,$(u,(function(e){if("option"!==e)throw W(e);Z(u,e),U(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=x()))throw W(t,"reference");var r=t;$(null,(function(t){switch(t){case"required":case"repeated":Y(e,t,r);break;case"optional":Y(e,B?"proto3_optional":"optional",r);break;default:if(!B||!I.test(t))throw W(t);M(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function $(e,t,r){var o=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=P()),e.filename=N.filename),U("{",!0)){for(var n;"}"!==(n=x());)t(n);U(";",!0)}else r&&r(),U(";"),e&&("string"!=typeof e.comment||A)&&(e.comment=P(o)||e.comment)}function Y(e,t,r){var o=x();if("group"!==o){if(!I.test(o))throw W(o,"type");var n=x();if(!T.test(n))throw W(n,"name");n=G(n),U("=");var a=new s(n,J(x()),o,t,r);if($(a,(function(e){if("option"!==e)throw W(e);Z(a,e),U(";")}),(function(){te(a)})),"proto3_optional"===t){var u=new c("_"+n);a.setOption("proto3_optional",!0),u.add(a),e.add(u)}else e.add(a);B||!a.repeated||void 0===h.packed[o]&&void 0!==h.basic[o]||a.setOption("packed",!1,!0)}else!function(e,t){var r=x();if(!T.test(r))throw W(r,"name");var o=d.lcFirst(r);r===o&&(r=d.ucFirst(r)),U("=");var n=J(x()),a=new i(r);a.group=!0;var c=new s(o,n,r,t);c.filename=N.filename,$(a,(function(e){switch(e){case"option":Z(a,e),U(";");break;case"required":case"repeated":Y(a,e);break;case"optional":Y(a,B?"proto3_optional":"optional");break;default:throw W(e)}})),e.add(a).add(c)}(e,t)}function Z(e,t){var r=U("(",!0);if(!I.test(t=x()))throw W(t,"name");var o,n=t,i=n;r&&(U(")"),i=n="("+n+")",t=j(),O.test(t)&&(o=t.substr(1),n+=t,x())),U("="),function(e,t,r,o){e.setParsedOption&&e.setParsedOption(t,r,o)}(e,i,Q(e,n),o)}function Q(e,t){if(U("{",!0)){for(var r={};!U("}",!0);){if(!T.test(w=x()))throw W(w,"name");var o,n=w;"{"===j()?o=Q(e,t+"."+w):(U(":"),"{"===j()?o=Q(e,t+"."+w):(o=H(!0),ee(e,t+"."+w,o)));var i=r[n];i&&(o=[].concat(i).concat(o)),r[n]=o,U(",",!0)}return r}var s=H(!0);return ee(e,t,s),s}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(U("[",!0)){do{Z(e,"option")}while(U(",",!0));U("]")}return e}for(;null!==(w=x());)switch(w){case"package":if(!L)throw W(w);z();break;case"import":if(!L)throw W(w);V();break;case"syntax":if(!L)throw W(w);K();break;case"option":Z(D,w),U(";");break;default:if(X(D,w)){L=!1;continue}throw W(w)}return N.filename=null,{package:b,imports:S,weakImports:R,syntax:C,root:t}}},1408:(e,t,r)=>{"use strict";e.exports=c;var o,n=r(9693),i=n.LongBits,s=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,p="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new o(e):p(e)})(e)}:p};function h(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,c.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,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){o=e,c.create=l(),o._configure();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=i;var o=r(1408);(i.prototype=Object.create(o.prototype)).constructor=i;var n=r(9693);function i(e){o.call(this,e)}i._configure=function(){n.Buffer&&(i.prototype._slice=n.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var o=r(9313);((l.prototype=Object.create(o.prototype)).constructor=l).className="Root";var n,i,s,a=r(3548),c=r(7025),u=r(7598),p=r(9935);function l(e){o.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=p.path.resolve,l.prototype.fetch=p.fetch,l.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=o===h;function c(e,t){if(o){var r=o;if(o=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(o=u(s.imports[l])||n.resolvePath(e,s.imports[l]))&&d(o);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(o=u(s.weakImports[l])||n.resolvePath(e,s.weakImports[l]))&&d(o,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||f||c(null,n)}function d(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in s)a?l(e,s[e]):(++f,setTimeout((function(){--f,l(e,s[e])})));else if(a){var r;try{r=p.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++f,n.fetch(e,(function(r,i){--f,o&&(r?t?f||c(null,n):c(r):l(e,i))}))}var f=0;p.isString(t)&&(t=[t]);for(var m,y=0;y<t.length;++y)(m=n.resolvePath("",t[y]))&&d(m);if(a)return n;f||c(null,n)},l.prototype.loadSync=function(e,t){if(!p.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return o.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var o=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,r.add(o),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){n=e,i=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(o.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return o.asPromise(e,a,t,r,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var o=r(9313);((a.prototype=Object.create(o.prototype)).constructor=a).className="Service";var n=r(4429),i=r(9935),s=r(5994);function a(e,t){o.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var o=Object.keys(t.methods),i=0;i<o.length;++i)r.add(n.fromJSON(o[i],t.methods[o[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",o.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||o.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return o.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,c(this)):o.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return o.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var o,n=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return n}},626:e=>{"use strict";e.exports=l;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function l(e,c){e=e.toString();var u=0,l=e.length,h=1,d=null,f=null,m=0,y=!1,g=!1,v=[],E=null;function _(e){return Error("illegal "+e+" (line "+h+")")}function T(t){return e.charAt(t)}function I(t,r,o){d=e.charAt(t++),m=h,y=!1,g=o;var a,u=t-(c?2:3);do{if(--u<0||"\n"===(a=e.charAt(u))){y=!0;break}}while(" "===a||"\t"===a);for(var p=e.substring(t,r).split(s),l=0;l<p.length;++l)p[l]=p[l].replace(c?i:n,"").trim();f=p.join("\n").trim()}function O(t){var r=N(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function N(e){for(var t=e;t<l&&"\n"!==T(t);)t++;return t}function b(){if(v.length>0)return v.shift();if(E)return function(){var t="'"===E?o:r;t.lastIndex=u-1;var n=t.exec(e);if(!n)throw _("string");return u=t.lastIndex,S(E),E=null,p(n[1])}();var n,i,s,d,f,m=0===u;do{if(u===l)return null;for(n=!1;a.test(s=T(u));)if("\n"===s&&(m=!0,++h),++u===l)return null;if("/"===T(u)){if(++u===l)throw _("comment");if("/"===T(u))if(c){if(d=u,f=!1,O(u)){f=!0;do{if((u=N(u))===l)break;u++}while(O(u))}else u=Math.min(l,N(u)+1);f&&I(d,u,m),h++,n=!0}else{for(f="/"===T(d=u+1);"\n"!==T(++u);)if(u===l)return null;++u,f&&I(d,u-1,m),++h,n=!0}else{if("*"!==(s=T(u)))return"/";d=u+1,f=c||"*"===T(d);do{if("\n"===s&&++h,++u===l)throw _("comment");i=s,s=T(u)}while("*"!==i||"/"!==s);++u,f&&I(d,u-2,m),n=!0}}}while(n);var y=u;if(t.lastIndex=0,!t.test(T(y++)))for(;y<l&&!t.test(T(y));)++y;var g=e.substring(u,u=y);return'"'!==g&&"'"!==g||(E=g),g}function S(e){v.push(e)}function R(){if(!v.length){var e=b();if(null===e)return null;S(e)}return v[0]}return Object.defineProperty({next:b,peek:R,push:S,skip:function(e,t){var r=R();if(r===e)return b(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===h-1&&(c||"*"===d||y)&&(t=g?f:null):(m<e&&R(),m!==e||y||!c&&"/"!==d||(t=g?null:f)),t}},"line",{get:function(){return h}})}l.unescape=p},7645:(e,t,r)=>{"use strict";e.exports=v;var o=r(9313);((v.prototype=Object.create(o.prototype)).constructor=v).className="Type";var n=r(7025),i=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),p=r(1408),l=r(1173),h=r(9935),d=r(4928),f=r(5305),m=r(4497),y=r(3996),g=r(1667);function v(e,t){o.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(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}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<e.length;++t){var r=this.fields[e[t]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r)o[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,o)}}}),v.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),o=0;o<e.fieldsArray.length;++o)(t=e._fieldsArray[o]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),p=0;p<u.length;++p)r.add((void 0!==t.fields[u[p]].keyType?a.fromJSON:s.fromJSON)(u[p],t.fields[u[p]]));if(t.oneofs)for(u=Object.keys(t.oneofs),p=0;p<u.length;++p)r.add(i.fromJSON(u[p],t.oneofs[u[p]]));if(t.nested)for(u=Object.keys(t.nested),p=0;p<u.length;++p){var l=t.nested[u[p]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?v.fromJSON:void 0!==l.values?n.fromJSON:void 0!==l.methods?c.fromJSON:o.fromJSON)(u[p],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",o.arrayToJSON(this.oneofsArray,e),"fields",o.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return o.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),E(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),E(this)):o.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),E(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),E(this)}return o.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:h}),this.decode=f(this)({Reader:p,types:t,util:h}),this.verify=m(this)({types:t,util:h}),this.fromObject=y.fromObject(this)({types:t,util:h}),this.toObject=y.toObject(this)({types:t,util:h});var o=g[e];if(o){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(n),n.toObject=this.toObject,this.toObject=o.toObject.bind(n)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof p||(e=p.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){h.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var o=t,n=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,o={};for(t|=0;r<e.length;)o[i[r+t]]=e[r++];return o}o.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),o.long=s([0,0,0,1,1],7),o.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var o,n,i=e.exports=r(9693),s=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),o=0;o<t.length;)r[o]=e[t[o++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var o=e[r++],n=e[r++];void 0!==n&&(t[o]=n)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;o||(o=r(7645));var n=new o(t||e.name);return i.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var p=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(7025));var t=new n("Enum"+p++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,o){var n=r.shift();if(r.length>0)t[n]=e(t[n]||{},r,o);else{var i=t[n];i&&(o=[].concat(i).concat(o)),t[n]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new n(r,o)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(o.isString(e)){if(!o.Long)return n.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===s?i:new n((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)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var o=t;function n(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)void 0!==e[o[n]]&&r||(e[o[n]]=t[o[n]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}o.asPromise=r(4537),o.base64=r(7419),o.EventEmitter=r(9211),o.float=r(945),o.inquire=r(7199),o.utf8=r(4997),o.pool=r(6662),o.LongBits=r(1945),o.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),o.global=o.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.isset=o.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=n,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=i,o.ProtocolError=i("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var e=o.Buffer;e?(o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):o._Buffer_from=o._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var o=0;o<e.fieldsArray.length;++o){var c=e._fieldsArray[o].resolve(),u="m"+n.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,o,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,o,u+"[i]")("}");else{if(c.partOf){var p=n.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",p)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",p)}s(t,c,o,u)}c.optional&&t("}")}return t("return null")};var o=r(7025),n=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(%s){",n)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",i(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var o=t,n=r(8368);o[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var o="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===o.indexOf("/")&&(o="/"+o),this.create({type_url:o,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",o="";if(t&&t.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),o=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=o,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var o,n=r(9693),i=n.LongBits,s=n.base64,a=n.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function p(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(l.create=function(){return new o})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(l.alloc=n.pool(l.alloc,n.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((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(m,10,i.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=i.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var g=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var o=0;o<e.length;++o)t[r+o]=e[o]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(n.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new p(this),this.head=this.tail=new c(u,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 c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){o=e,l.create=h(),o._configure()}},3155:(e,t,r)=>{"use strict";e.exports=i;var o=r(1173);(i.prototype=Object.create(o.prototype)).constructor=i;var n=r(9693);function i(){o.call(this)}function s(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=n._Buffer_allocUnsafe,i.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var o=0;o<e.length;)t[r++]=e[o++]}},i.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},7129:(e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function n(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(r.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=n(i),o=n(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in n||(n[i]=s)}return n}},7418:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},8e3:(e,t,r)=>{"use strict";var o=r(7581);e.exports=r(3626)(o),"_sockjs_onload"in r.g&&setTimeout(r.g._sockjs_onload,1)},2530:(e,t,r)=>{"use strict";var o=r(5717),n=r(685);function i(){n.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}o(i,n),e.exports=i},3212:(e,t,r)=>{"use strict";var o=r(5717),n=r(3184);function i(){n.call(this)}o(i,n),i.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},i.prototype.once=function(e,t){var r=this,o=!1;this.on(e,(function n(){r.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}))},i.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var r=arguments.length,o=new Array(r-1),n=1;n<r;n++)o[n-1]=arguments[n];for(var i=0;i<t.length;i++)t[i].apply(this,o)}},i.prototype.on=i.prototype.addListener=n.prototype.addEventListener,i.prototype.removeListener=n.prototype.removeEventListener,e.exports.v=i},685:e=>{"use strict";function t(e){this.type=e}t.prototype.initEvent=function(e,t,r){return this.type=e,this.bubbles=t,this.cancelable=r,this.timeStamp=+new Date,this},t.prototype.stopPropagation=function(){},t.prototype.preventDefault=function(){},t.CAPTURING_PHASE=1,t.AT_TARGET=2,t.BUBBLING_PHASE=3,e.exports=t},3184:e=>{"use strict";function t(){this._listeners={}}t.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var r=this._listeners[e];-1===r.indexOf(t)&&(r=r.concat([t])),this._listeners[e]=r},t.prototype.removeEventListener=function(e,t){var r=this._listeners[e];if(r){var o=r.indexOf(t);-1===o||(r.length>1?this._listeners[e]=r.slice(0,o).concat(r.slice(o+1)):delete this._listeners[e])}},t.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,r=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,r),t in this._listeners)for(var o=this._listeners[t],n=0;n<o.length;n++)o[n].apply(this,r)},e.exports=t},3326:(e,t,r)=>{"use strict";var o=r(5717),n=r(685);function i(e){n.call(this),this.initEvent("message",!1,!1),this.data=e}o(i,n),e.exports=i},691:(e,t,r)=>{"use strict";var o=r(7522),n=r(3683);function i(e){this._transport=e,e.on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}i.prototype._transportClose=function(e,t){n.postMessage("c",o.stringify([e,t]))},i.prototype._transportMessage=function(e){n.postMessage("t",e)},i.prototype._send=function(e){this._transport.send(e)},i.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},e.exports=i},551:(e,t,r)=>{"use strict";var o=r(273),n=r(7705),i=r(7522),s=r(691),a=r(6311),c=r(3683),u=r(7486);e.exports=function(e,t){var r,p={};t.forEach((function(e){e.facadeTransport&&(p[e.facadeTransport.transportName]=e.facadeTransport)})),p[a.transportName]=a,e.bootstrap_iframe=function(){var t;c.currentWindowId=u.hash.slice(1),n.attachEvent("message",(function(n){if(n.source===parent&&(void 0===r&&(r=n.origin),n.origin===r)){var a;try{a=i.parse(n.data)}catch(e){return void n.data}if(a.windowId===c.currentWindowId)switch(a.type){case"s":var l;try{l=i.parse(a.data)}catch(e){a.data;break}var h=l[0],d=l[1],f=l[2],m=l[3];if(h!==e.version)throw new Error('Incompatible SockJS! Main site uses: "'+h+'", the iframe: "'+e.version+'".');if(!o.isOriginEqual(f,u.href)||!o.isOriginEqual(m,u.href))throw new Error("Can't connect to different domain from within an iframe. ("+u.href+", "+f+", "+m+")");t=new s(new p[d](f,m));break;case"m":t._send(a.data);break;case"c":t&&t._close(),t=null}}})),c.postMessage("s")}}},2550:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7522),s=r(2217);function a(e,t){o.call(this);var r=this,n=+new Date;this.xo=new t("GET",e),this.xo.once("finish",(function(e,t){var o,a;if(200===e){if(a=+new Date-n,t)try{o=i.parse(t)}catch(e){}s.isObject(o)||(o={})}r.emit("finish",o,a),r.removeAllListeners()}))}n(a,o),a.prototype.close=function(){this.removeAllListeners(),this.xo.close()},e.exports=a},6311:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v,i=r(7522),s=r(3515),a=r(2550);function c(e){var t=this;n.call(this),this.ir=new a(e,s),this.ir.once("finish",(function(e,r){t.ir=null,t.emit("message",i.stringify([e,r]))}))}o(c,n),c.transportName="iframe-info-receiver",c.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},e.exports=c},3616:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7522),s=r(7705),a=r(5088),c=r(6311);function u(e,t){var n=this;o.call(this);var u=function(){var r=n.ifr=new a(c.transportName,t,e);r.once("message",(function(e){if(e){var t;try{t=i.parse(e)}catch(e){return n.emit("finish"),void n.close()}var r=t[0],o=t[1];n.emit("finish",r,o)}n.close()})),r.once("close",(function(){n.emit("finish"),n.close()}))};r.g.document.body?u():s.attachEvent("load",u)}n(u,o),u.enabled=function(){return a.enabled()},u.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},e.exports=u},5172:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(273),s=r(6073),a=r(9033),c=r(3515),u=r(7103),p=r(3616),l=r(2550);function h(e,t){var r=this;o.call(this),setTimeout((function(){r.doXhr(e,t)}),0)}n(h,o),h._getReceiver=function(e,t,r){return r.sameOrigin?new l(t,c):a.enabled?new l(t,a):s.enabled&&r.sameScheme?new l(t,s):p.enabled()?new p(e,t):new l(t,u)},h.prototype.doXhr=function(e,t){var r=this,o=i.addPath(e,"/info");this.xo=h._getReceiver(e,o,t),this.timeoutRef=setTimeout((function(){r._cleanup(!1),r.emit("finish")}),h.timeout),this.xo.once("finish",(function(e,t){r._cleanup(!0),r.emit("finish",e,t)}))},h.prototype._cleanup=function(e){clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},h.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},h.timeout=8e3,e.exports=h},7486:(e,t,r)=>{"use strict";e.exports=r.g.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}},3626:(e,t,r)=>{"use strict";r(1247);var o,n=r(4564),i=r(5717),s=r(7522),a=r(8915),c=r(8028),u=r(273),p=r(7705),l=r(5581),h=r(2217),d=r(8510),f=r(4886),m=r(685),y=r(3184),g=r(7486),v=r(2530),E=r(3326),_=r(5172);function T(e,t,r){if(!(this instanceof T))return new T(e,t,r);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");y.call(this),this.readyState=T.CONNECTING,this.extensions="",this.protocol="",(r=r||{}).protocols_whitelist&&f.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=r.transports,this._transportOptions=r.transportOptions||{},this._timeout=r.timeout||0;var o=r.sessionId||8;if("function"==typeof o)this._generateSessionId=o;else{if("number"!=typeof o)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return a.string(o)}}this._server=r.server||a.numberString(1e3);var i=new n(e);if(!i.host||!i.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(i.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==i.protocol&&"https:"!==i.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+i.protocol+"' is not allowed.");var s="https:"===i.protocol;if("https:"===g.protocol&&!s&&!u.isLoopbackAddr(i.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var c=t.sort();c.forEach((function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<c.length-1&&e===c[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")}));var p=u.getOrigin(g.href);this._origin=p?p.toLowerCase():null,i.set("pathname",i.pathname.replace(/\/+$/,"")),this.url=i.href,this.url,this._urlInfo={nullOrigin:!d.hasDomain(),sameOrigin:u.isOriginEqual(this.url,g.href),sameScheme:u.isSchemeEqual(this.url,g.href)},this._ir=new _(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function I(e){return 1e3===e||e>=3e3&&e<=4999}i(T,y),T.prototype.close=function(e,t){if(e&&!I(e))throw new Error("InvalidAccessError: Invalid code");if(t&&t.length>123)throw new SyntaxError("reason argument has an invalid length");this.readyState!==T.CLOSING&&this.readyState!==T.CLOSED&&this._close(e||1e3,t||"Normal closure",!0)},T.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===T.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===T.OPEN&&this._transport.send(c.quote(e))},T.version=r(2828),T.CONNECTING=0,T.OPEN=1,T.CLOSING=2,T.CLOSED=3,T.prototype._receiveInfo=function(e,t){if(this._ir=null,e){this._rto=this.countRTO(t),this._transUrl=e.base_url?e.base_url:this.url,e=h.extend(e,this._urlInfo);var r=o.filterToEnabled(this._transportsWhitelist,e);this._transports=r.main,this._transports.length,this._connect()}else this._close(1002,"Cannot connect to server")},T.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(e.transportName,e.needBody&&(!r.g.document.body||void 0!==r.g.document.readyState&&"complete"!==r.g.document.readyState&&"interactive"!==r.g.document.readyState))return this._transports.unshift(e),void p.attachEvent("load",this._connect.bind(this));var t=Math.max(this._timeout,this._rto*e.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),t);var o=u.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),n=this._transportOptions[e.transportName],i=new e(o,this._transUrl,n);return i.on("message",this._transportMessage.bind(this)),i.once("close",this._transportClose.bind(this)),i.transportName=e.transportName,void(this._transport=i)}this._close(2e3,"All transports failed",!1)},T.prototype._transportTimeout=function(){this.readyState===T.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},T.prototype._transportMessage=function(e){var t,r=this,o=e.slice(0,1),n=e.slice(1);switch(o){case"o":return void this._open();case"h":return this.dispatchEvent(new m("heartbeat")),void this.transport}if(n)try{t=s.parse(n)}catch(e){}if(void 0!==t)switch(o){case"a":Array.isArray(t)&&t.forEach((function(e){r.transport,r.dispatchEvent(new E(e))}));break;case"m":this.transport,this.dispatchEvent(new E(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}},T.prototype._transportClose=function(e,t){this.transport,this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),I(e)||2e3===e||this.readyState!==T.CONNECTING?this._close(e,t):this._connect()},T.prototype._open=function(){this._transport&&this._transport.transportName,this.readyState,this.readyState===T.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=T.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new m("open")),this.transport):this._close(1006,"Server lost session")},T.prototype._close=function(e,t,r){this.transport,this.readyState;var o=!1;if(this._ir&&(o=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===T.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=T.CLOSING,setTimeout(function(){this.readyState=T.CLOSED,o&&this.dispatchEvent(new m("error"));var n=new v("close");n.wasClean=r||!1,n.code=e||1e3,n.reason=t,this.dispatchEvent(n),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},T.prototype.countRTO=function(e){return e>100?4*e:300+e},e.exports=function(e){return o=l(e),r(551)(T,e),T}},1247:()=>{"use strict";var e,t=Array.prototype,r=Object.prototype,o=Function.prototype,n=String.prototype,i=t.slice,s=r.toString,a=function(e){return"[object Function]"===r.toString.call(e)},c=function(e){return"[object String]"===s.call(e)},u=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();e=u?function(e,t,r,o){!o&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r})}:function(e,t,r,o){!o&&t in e||(e[t]=r)};var p=function(t,o,n){for(var i in o)r.hasOwnProperty.call(o,i)&&e(t,i,o[i],n)},l=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)};function h(e){var t=+e;return t!=t?t=0:0!==t&&t!==1/0&&t!==-1/0&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t}function d(){}p(o,{bind:function(e){var t=this;if(!a(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r=i.call(arguments,1),o=function(){if(this instanceof u){var o=t.apply(this,r.concat(i.call(arguments)));return Object(o)===o?o:this}return t.apply(e,r.concat(i.call(arguments)))},n=Math.max(0,t.length-r.length),s=[],c=0;c<n;c++)s.push("$"+c);var u=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this, arguments); }")(o);return t.prototype&&(d.prototype=t.prototype,u.prototype=new d,d.prototype=null),u}}),p(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var f,m,y,g=Object("a"),v="a"!==g[0]||!(0 in g);p(t,{forEach:function(e){var t=l(this),r=v&&c(this)?this.split(""):t,o=arguments[1],n=-1,i=r.length>>>0;if(!a(e))throw new TypeError;for(;++n<i;)n in r&&e.call(o,r[n],n,t)}},(f=t.forEach,m=!0,y=!0,f&&(f.call("foo",(function(e,t,r){"object"!=typeof r&&(m=!1)})),f.call([1],(function(){y="string"==typeof this}),"x")),!(f&&m&&y)));var E=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);p(t,{indexOf:function(e){var t=v&&c(this)?this.split(""):l(this),r=t.length>>>0;if(!r)return-1;var o=0;for(arguments.length>1&&(o=h(arguments[1])),o=o>=0?o:Math.max(0,r+o);o<r;o++)if(o in t&&t[o]===e)return o;return-1}},E);var _,T=n.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(_=void 0===/()??/.exec("")[1],n.split=function(e,r){var o=this;if(void 0===e&&0===r)return[];if("[object RegExp]"!==s.call(e))return T.call(this,e,r);var n,i,a,c,u=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),l=0;for(e=new RegExp(e.source,p+"g"),o+="",_||(n=new RegExp("^"+e.source+"$(?!\\s)",p)),r=void 0===r?-1>>>0:r>>>0;(i=e.exec(o))&&!((a=i.index+i[0].length)>l&&(u.push(o.slice(l,i.index)),!_&&i.length>1&&i[0].replace(n,(function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(i[e]=void 0)})),i.length>1&&i.index<o.length&&t.push.apply(u,i.slice(1)),c=i[0].length,l=a,u.length>=r));)e.lastIndex===i.index&&e.lastIndex++;return l===o.length?!c&&e.test("")||u.push(""):u.push(o.slice(l)),u.length>r?u.slice(0,r):u}):"0".split(void 0,0).length&&(n.split=function(e,t){return void 0===e&&0===t?[]:T.call(this,e,t)});var I=n.substr;p(n,{substr:function(e,t){return I.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},"".substr&&"b"!=="0b".substr(-1))},7581:(e,t,r)=>{"use strict";e.exports=[r(2412),r(9842),r(4620),r(3004),r(882)(r(3004)),r(5616),r(882)(r(5616)),r(2387),r(9998),r(882)(r(2387)),r(5375)]},2940:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7705),s=r(273),a=r.g.XMLHttpRequest;function c(e,t,r,n){var i=this;o.call(this),setTimeout((function(){i._start(e,t,r,n)}),0)}n(c,o),c.prototype._start=function(e,t,r,o){var n=this;try{this.xhr=new a}catch(e){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();t=s.addQuery(t,"t="+ +new Date),this.unloadRef=i.unloadAdd((function(){n._cleanup(!0)}));try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){n.emit("finish",0,""),n._cleanup(!1)})}catch(e){return this.emit("finish",0,""),void this._cleanup(!1)}if(o&&o.noCredentials||!c.supportsCORS||(this.xhr.withCredentials=!0),o&&o.headers)for(var u in o.headers)this.xhr.setRequestHeader(u,o.headers[u]);this.xhr.onreadystatechange=function(){if(n.xhr){var e,t,r=n.xhr;switch(r.readyState,r.readyState){case 3:try{t=r.status,e=r.responseText}catch(e){}1223===t&&(t=204),200===t&&e&&e.length>0&&n.emit("chunk",t,e);break;case 4:1223===(t=r.status)&&(t=204),12005!==t&&12029!==t||(t=0),r.responseText,n.emit("finish",t,r.responseText),n._cleanup(!1)}}};try{n.xhr.send(r)}catch(e){n.emit("finish",0,""),n._cleanup(!1)}},c.prototype._cleanup=function(e){if(this.xhr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},c.prototype.close=function(){this._cleanup(!0)},c.enabled=!!a;var u=["Active"].concat("Object").join("X");!c.enabled&&u in r.g&&(a=function(){try{return new r.g[u]("Microsoft.XMLHTTP")}catch(e){return null}},c.enabled=!!new a);var p=!1;try{p="withCredentials"in new a}catch(e){}c.supportsCORS=p,e.exports=c},3759:(e,t,r)=>{e.exports=r.g.EventSource},9334:(e,t,r)=>{"use strict";var o=r.g.WebSocket||r.g.MozWebSocket;e.exports=o?function(e){return new o(e)}:void 0},3004:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(6709),s=r(9033),a=r(3759);function c(e){if(!c.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/eventsource",i,s)}o(c,n),c.enabled=function(){return!!a},c.transportName="eventsource",c.roundTrips=2,e.exports=c},5616:(e,t,r)=>{"use strict";var o=r(5717),n=r(3608),i=r(3515),s=r(9395);function a(e){if(!n.enabled)throw new Error("Transport created when disabled");s.call(this,e,"/htmlfile",n,i)}o(a,s),a.enabled=function(e){return n.enabled&&e.sameOrigin},a.transportName="htmlfile",a.roundTrips=2,e.exports=a},5088:(e,t,r)=>{"use strict";var o=r(5717),n=r(7522),i=r(3212).v,s=r(2828),a=r(273),c=r(3683),u=r(7705),p=r(8915);function l(e,t,r){if(!l.enabled())throw new Error("Transport created when disabled");i.call(this);var o=this;this.origin=a.getOrigin(r),this.baseUrl=r,this.transUrl=t,this.transport=e,this.windowId=p.string(8);var n=a.addPath(r,"/iframe.html")+"#"+this.windowId;this.iframeObj=c.createIframe(n,(function(e){o.emit("close",1006,"Unable to load an iframe ("+e+")"),o.close()})),this.onmessageCallback=this._message.bind(this),u.attachEvent("message",this.onmessageCallback)}o(l,i),l.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){u.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},l.prototype._message=function(e){if(e.data,!a.isOriginEqual(e.origin,this.origin))return e.origin,void this.origin;var t;try{t=n.parse(e.data)}catch(t){return void e.data}if(t.windowId!==this.windowId)return t.windowId,void this.windowId;switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",n.stringify([s,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var r;try{r=n.parse(t.data)}catch(e){return void t.data}this.emit("close",r[0],r[1]),this.close()}},l.prototype.postMessage=function(e,t){this.iframeObj.post(n.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},l.prototype.send=function(e){this.postMessage("m",e)},l.enabled=function(){return c.iframeEnabled},l.transportName="iframe",l.roundTrips=2,e.exports=l},5375:(e,t,r)=>{"use strict";var o=r(5717),n=r(8347),i=r(514),s=r(771);function a(e){if(!a.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/jsonp",s,i)}o(a,n),a.enabled=function(){return!!r.g.document},a.transportName="jsonp-polling",a.roundTrips=1,a.needBody=!0,e.exports=a},9395:(e,t,r)=>{"use strict";var o=r(5717),n=r(273),i=r(8347);function s(e,t,r,o){i.call(this,e,t,function(e){return function(t,r,o){var i={};"string"==typeof r&&(i.headers={"Content-type":"text/plain"});var s=n.addPath(t,"/xhr_send"),a=new e("POST",s,r,i);return a.once("finish",(function(e){if(a=null,200!==e&&204!==e)return o(new Error("http status "+e));o()})),function(){a.close(),a=null;var e=new Error("Aborted");e.code=1e3,o(e)}}}(o),r,o)}o(s,i),e.exports=s},1851:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t){n.call(this),this.sendBuffer=[],this.sender=t,this.url=e}o(i,n),i.prototype.send=function(e){this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},i.prototype.sendScheduleWait=function(){var e,t=this;this.sendStop=function(){t.sendStop=null,clearTimeout(e)},e=setTimeout((function(){t.sendStop=null,t.sendSchedule()}),25)},i.prototype.sendSchedule=function(){this.sendBuffer.length;var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,(function(t){e.sendStop=null,t?(e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()})),this.sendBuffer=[]}},i.prototype._cleanup=function(){this.removeAllListeners()},i.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},e.exports=i},882:(e,t,r)=>{"use strict";var o=r(5717),n=r(5088),i=r(2217);e.exports=function(e){function t(t,r){n.call(this,e.transportName,t,r)}return o(t,n),t.enabled=function(t,o){if(!r.g.document)return!1;var s=i.extend({},o);return s.sameOrigin=!0,e.enabled(s)&&n.enabled()},t.transportName="iframe-"+e.transportName,t.needBody=!0,t.roundTrips=n.roundTrips+e.roundTrips-1,t.facadeTransport=e,t}},1265:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t,r){n.call(this),this.Receiver=e,this.receiveUrl=t,this.AjaxObject=r,this._scheduleReceiver()}o(i,n),i.prototype._scheduleReceiver=function(){var e=this,t=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);t.on("message",(function(t){e.emit("message",t)})),t.once("close",(function(r,o){e.pollIsClosing,e.poll=t=null,e.pollIsClosing||("network"===o?e._scheduleReceiver():(e.emit("close",r||1006,o),e.removeAllListeners()))}))},i.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},e.exports=i},8347:(e,t,r)=>{"use strict";var o=r(5717),n=r(273),i=r(1851),s=r(1265);function a(e,t,r,o,a){var c=n.addPath(e,t),u=this;i.call(this,e,r),this.poll=new s(o,c,a),this.poll.on("message",(function(e){u.emit("message",e)})),this.poll.once("close",(function(e,t){u.poll=null,u.emit("close",e,t),u.close()}))}o(a,i),a.prototype.close=function(){i.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},e.exports=a},6709:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v,i=r(3759);function s(e){n.call(this);var t=this,r=this.es=new i(e);r.onmessage=function(e){e.data,t.emit("message",decodeURI(e.data))},r.onerror=function(e){r.readyState;var o=2!==r.readyState?"network":"permanent";t._cleanup(),t._close(o)}}o(s,n),s.prototype.abort=function(){this._cleanup(),this._close("user")},s.prototype._cleanup=function(){var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},s.prototype._close=function(e){var t=this;setTimeout((function(){t.emit("close",null,e),t.removeAllListeners()}),200)},e.exports=s},3608:(e,t,r)=>{"use strict";var o=r(5717),n=r(3683),i=r(273),s=r(3212).v,a=r(8915);function c(e){s.call(this);var t=this;n.polluteGlobalNamespace(),this.id="a"+a.string(6),e=i.addQuery(e,"c="+decodeURIComponent(n.WPrefix+"."+this.id)),c.htmlfileEnabled;var o=c.htmlfileEnabled?n.createHtmlfile:n.createIframe;r.g[n.WPrefix][this.id]={start:function(){t.iframeObj.loaded()},message:function(e){t.emit("message",e)},stop:function(){t._cleanup(),t._close("network")}},this.iframeObj=o(e,(function(){t._cleanup(),t._close("permanent")}))}o(c,s),c.prototype.abort=function(){this._cleanup(),this._close("user")},c.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete r.g[n.WPrefix][this.id]},c.prototype._close=function(e){this.emit("close",null,e),this.removeAllListeners()},c.htmlfileEnabled=!1;var u=["Active"].concat("Object").join("X");if(u in r.g)try{c.htmlfileEnabled=!!new r.g[u]("htmlfile")}catch(e){}c.enabled=c.htmlfileEnabled||n.iframeEnabled,e.exports=c},514:(e,t,r)=>{"use strict";var o=r(3683),n=r(8915),i=r(8510),s=r(273),a=r(5717),c=r(3212).v;function u(e){var t=this;c.call(this),o.polluteGlobalNamespace(),this.id="a"+n.string(6);var i=s.addQuery(e,"c="+encodeURIComponent(o.WPrefix+"."+this.id));r.g[o.WPrefix][this.id]=this._callback.bind(this),this._createScript(i),this.timeoutId=setTimeout((function(){t._abort(new Error("JSONP script loaded abnormally (timeout)"))}),u.timeout)}a(u,c),u.prototype.abort=function(){if(r.g[o.WPrefix][this.id]){var e=new Error("JSONP user aborted read");e.code=1e3,this._abort(e)}},u.timeout=35e3,u.scriptErrorTimeout=1e3,u.prototype._callback=function(e){this._cleanup(),this.aborting||(e&&this.emit("message",e),this.emit("close",null,"network"),this.removeAllListeners())},u.prototype._abort=function(e){this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},u.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var e=this.script;e.parentNode.removeChild(e),e.onreadystatechange=e.onerror=e.onload=e.onclick=null,this.script=null}delete r.g[o.WPrefix][this.id]},u.prototype._scriptError=function(){var e=this;this.errorTimer||(this.errorTimer=setTimeout((function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))}),u.scriptErrorTimeout))},u.prototype._createScript=function(e){var t,o=this,s=this.script=r.g.document.createElement("script");if(s.id="a"+n.string(8),s.src=e,s.type="text/javascript",s.charset="UTF-8",s.onerror=this._scriptError.bind(this),s.onload=function(){o._abort(new Error("JSONP script loaded abnormally (onload)"))},s.onreadystatechange=function(){if(s.readyState,/loaded|closed/.test(s.readyState)){if(s&&s.htmlFor&&s.onclick){o.loadedOkay=!0;try{s.onclick()}catch(e){}}s&&o._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===s.async&&r.g.document.attachEvent)if(i.isOpera())(t=this.script2=r.g.document.createElement("script")).text="try{var a = document.getElementById('"+s.id+"'); if(a)a.onerror();}catch(x){};",s.async=t.async=!1;else{try{s.htmlFor=s.id,s.event="onclick"}catch(e){}s.async=!0}void 0!==s.async&&(s.async=!0);var a=r.g.document.getElementsByTagName("head")[0];a.insertBefore(s,a.firstChild),t&&a.insertBefore(t,a.firstChild)},e.exports=u},1044:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t){n.call(this);var r=this;this.bufferPosition=0,this.xo=new t("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",(function(e,t){r._chunkHandler(e,t),r.xo=null;var o=200===e?"network":"permanent";r.emit("close",null,o),r._cleanup()}))}o(i,n),i.prototype._chunkHandler=function(e,t){if(200===e&&t)for(var r=-1;;this.bufferPosition+=r+1){var o=t.slice(this.bufferPosition);if(-1===(r=o.indexOf("\n")))break;var n=o.slice(0,r);n&&this.emit("message",n)}},i.prototype._cleanup=function(){this.removeAllListeners()},i.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},e.exports=i},771:(e,t,r)=>{"use strict";var o,n,i=r(8915),s=r(273);e.exports=function(e,t,a){o||((o=r.g.document.createElement("form")).style.display="none",o.style.position="absolute",o.method="POST",o.enctype="application/x-www-form-urlencoded",o.acceptCharset="UTF-8",(n=r.g.document.createElement("textarea")).name="d",o.appendChild(n),r.g.document.body.appendChild(o));var c="a"+i.string(8);o.target=c,o.action=s.addQuery(s.addPath(e,"/jsonp_send"),"i="+c);var u=function(e){try{return r.g.document.createElement('<iframe name="'+e+'">')}catch(o){var t=r.g.document.createElement("iframe");return t.name=e,t}}(c);u.id=c,u.style.display="none",o.appendChild(u);try{n.value=t}catch(e){}o.submit();var p=function(e){u.onerror&&(u.onreadystatechange=u.onerror=u.onload=null,setTimeout((function(){u.parentNode.removeChild(u),u=null}),500),n.value="",a(e))};return u.onerror=function(){p()},u.onload=function(){p()},u.onreadystatechange=function(e){u.readyState,"complete"===u.readyState&&p()},function(){p(new Error("Aborted"))}}},6073:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7705),s=r(8510),a=r(273);function c(e,t,r){var n=this;o.call(this),setTimeout((function(){n._start(e,t,r)}),0)}n(c,o),c.prototype._start=function(e,t,o){var n=this,s=new r.g.XDomainRequest;t=a.addQuery(t,"t="+ +new Date),s.onerror=function(){n._error()},s.ontimeout=function(){n._error()},s.onprogress=function(){s.responseText,n.emit("chunk",200,s.responseText)},s.onload=function(){n.emit("finish",200,s.responseText),n._cleanup(!1)},this.xdr=s,this.unloadRef=i.unloadAdd((function(){n._cleanup(!0)}));try{this.xdr.open(e,t),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(o)}catch(e){this._error()}},c.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},c.prototype._cleanup=function(e){if(this.xdr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},c.prototype.close=function(){this._cleanup(!0)},c.enabled=!(!r.g.XDomainRequest||!s.hasDomain()),e.exports=c},9033:(e,t,r)=>{"use strict";var o=r(5717),n=r(2940);function i(e,t,r,o){n.call(this,e,t,r,o)}o(i,n),i.enabled=n.enabled&&n.supportsCORS,e.exports=i},7103:(e,t,r)=>{"use strict";var o=r(3212).v;function n(){var e=this;o.call(this),this.to=setTimeout((function(){e.emit("finish",200,"{}")}),n.timeout)}r(5717)(n,o),n.prototype.close=function(){clearTimeout(this.to)},n.timeout=2e3,e.exports=n},3515:(e,t,r)=>{"use strict";var o=r(5717),n=r(2940);function i(e,t,r){n.call(this,e,t,r,{noCredentials:!0})}o(i,n),i.enabled=n.enabled,e.exports=i},2412:(e,t,r)=>{"use strict";var o=r(7705),n=r(273),i=r(5717),s=r(3212).v,a=r(9334);function c(e,t,r){if(!c.enabled())throw new Error("Transport created when disabled");s.call(this);var i=this,u=n.addPath(e,"/websocket");u="https"===u.slice(0,5)?"wss"+u.slice(5):"ws"+u.slice(4),this.url=u,this.ws=new a(this.url,[],r),this.ws.onmessage=function(e){e.data,i.emit("message",e.data)},this.unloadRef=o.unloadAdd((function(){i.ws.close()})),this.ws.onclose=function(e){e.code,e.reason,i.emit("close",e.code,e.reason),i._cleanup()},this.ws.onerror=function(e){i.emit("close",1006,"WebSocket connection broken"),i._cleanup()}}i(c,s),c.prototype.send=function(e){var t="["+e+"]";this.ws.send(t)},c.prototype.close=function(){var e=this.ws;this._cleanup(),e&&e.close()},c.prototype._cleanup=function(){var e=this.ws;e&&(e.onmessage=e.onclose=e.onerror=null),o.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},c.enabled=function(){return!!a},c.transportName="websocket",c.roundTrips=2,e.exports=c},9998:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(4620),s=r(1044),a=r(6073);function c(e){if(!a.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr",s,a)}o(c,n),c.enabled=i.enabled,c.transportName="xdr-polling",c.roundTrips=2,e.exports=c},4620:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(6073);function a(e){if(!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",i,s)}o(a,n),a.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&s.enabled&&e.sameScheme},a.transportName="xdr-streaming",a.roundTrips=2,e.exports=a},2387:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(9033),a=r(3515);function c(e){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr",i,s)}o(c,n),c.enabled=function(e){return!e.nullOrigin&&(!(!a.enabled||!e.sameOrigin)||s.enabled)},c.transportName="xhr-polling",c.roundTrips=2,e.exports=c},9842:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(9033),a=r(3515),c=r(8510);function u(e){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",i,s)}o(u,n),u.enabled=function(e){return!e.nullOrigin&&!c.isOpera()&&s.enabled},u.transportName="xhr-streaming",u.roundTrips=2,u.needBody=!!r.g.document,e.exports=u},2017:(e,t,r)=>{"use strict";r.g.crypto&&r.g.crypto.getRandomValues?e.exports.randomBytes=function(e){var t=new Uint8Array(e);return r.g.crypto.getRandomValues(t),t}:e.exports.randomBytes=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=Math.floor(256*Math.random());return t}},8510:(e,t,r)=>{"use strict";e.exports={isOpera:function(){return r.g.navigator&&/opera/i.test(r.g.navigator.userAgent)},isKonqueror:function(){return r.g.navigator&&/konqueror/i.test(r.g.navigator.userAgent)},hasDomain:function(){if(!r.g.document)return!0;try{return!!r.g.document.domain}catch(e){return!1}}}},8028:(e,t,r)=>{"use strict";var o,n=r(7522),i=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;e.exports={quote:function(e){var t=n.stringify(e);return i.lastIndex=0,i.test(t)?(o||(o=function(e){var t,r={},o=[];for(t=0;t<65536;t++)o.push(String.fromCharCode(t));return e.lastIndex=0,o.join("").replace(e,(function(e){return r[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""})),e.lastIndex=0,r}(i)),t.replace(i,(function(e){return o[e]}))):t}}},7705:(e,t,r)=>{"use strict";var o=r(8915),n={},i=!1,s=r.g.chrome&&r.g.chrome.app&&r.g.chrome.app.runtime;e.exports={attachEvent:function(e,t){void 0!==r.g.addEventListener?r.g.addEventListener(e,t,!1):r.g.document&&r.g.attachEvent&&(r.g.document.attachEvent("on"+e,t),r.g.attachEvent("on"+e,t))},detachEvent:function(e,t){void 0!==r.g.addEventListener?r.g.removeEventListener(e,t,!1):r.g.document&&r.g.detachEvent&&(r.g.document.detachEvent("on"+e,t),r.g.detachEvent("on"+e,t))},unloadAdd:function(e){if(s)return null;var t=o.string(8);return n[t]=e,i&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in n&&delete n[e]},triggerUnloadCallbacks:function(){for(var e in n)n[e](),delete n[e]}},s||e.exports.attachEvent("unload",(function(){i||(i=!0,e.exports.triggerUnloadCallbacks())}))},3683:(e,t,r)=>{"use strict";var o=r(7705),n=r(7522),i=r(8510);e.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){e.exports.WPrefix in r.g||(r.g[e.exports.WPrefix]={})},postMessage:function(t,o){r.g.parent!==r.g&&r.g.parent.postMessage(n.stringify({windowId:e.exports.currentWindowId,type:t,data:o||""}),"*")},createIframe:function(e,t){var n,i,s=r.g.document.createElement("iframe"),a=function(){clearTimeout(n);try{s.onload=null}catch(e){}s.onerror=null},c=function(){s&&(a(),setTimeout((function(){s&&s.parentNode.removeChild(s),s=null}),0),o.unloadDel(i))},u=function(e){s&&(c(),t(e))};return s.src=e,s.style.display="none",s.style.position="absolute",s.onerror=function(){u("onerror")},s.onload=function(){clearTimeout(n),n=setTimeout((function(){u("onload timeout")}),2e3)},r.g.document.body.appendChild(s),n=setTimeout((function(){u("timeout")}),15e3),i=o.unloadAdd(c),{post:function(e,t){setTimeout((function(){try{s&&s.contentWindow&&s.contentWindow.postMessage(e,t)}catch(e){}}),0)},cleanup:c,loaded:a}},createHtmlfile:function(t,n){var i,s,a,c=["Active"].concat("Object").join("X"),u=new r.g[c]("htmlfile"),p=function(){clearTimeout(i),a.onerror=null},l=function(){u&&(p(),o.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())},h=function(e){u&&(l(),n(e))};u.open(),u.write('<html><script>document.domain="'+r.g.document.domain+'";<\/script></html>'),u.close(),u.parentWindow[e.exports.WPrefix]=r.g[e.exports.WPrefix];var d=u.createElement("div");return u.body.appendChild(d),a=u.createElement("iframe"),d.appendChild(a),a.src=t,a.onerror=function(){h("onerror")},i=setTimeout((function(){h("timeout")}),15e3),s=o.unloadAdd(l),{post:function(e,t){try{setTimeout((function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)}),0)}catch(e){}},cleanup:l,loaded:p}}},e.exports.iframeEnabled=!1,r.g.document&&(e.exports.iframeEnabled=("function"==typeof r.g.postMessage||"object"==typeof r.g.postMessage)&&!i.isKonqueror())},4886:(e,t,r)=>{"use strict";var o={};["log","debug","warn"].forEach((function(e){var t;try{t=r.g.console&&r.g.console[e]&&r.g.console[e].apply}catch(e){}o[e]=t?function(){return r.g.console[e].apply(r.g.console,arguments)}:"log"===e?function(){}:o.log})),e.exports=o},2217:e=>{"use strict";e.exports={isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,r,o=1,n=arguments.length;o<n;o++)for(r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}}},8915:(e,t,r)=>{"use strict";var o=r(2017),n="abcdefghijklmnopqrstuvwxyz012345";e.exports={string:function(e){for(var t=n.length,r=o.randomBytes(e),i=[],s=0;s<e;s++)i.push(n.substr(r[s]%t,1));return i.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}},5581:e=>{"use strict";e.exports=function(e){return{filterToEnabled:function(t,r){var o={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach((function(e){e&&("websocket"===e.transportName&&!1===r.websocket||(t.length&&-1===t.indexOf(e.transportName)?e.transportName:e.enabled(r)?(e.transportName,o.main.push(e),e.facadeTransport&&o.facade.push(e.facadeTransport)):e.transportName))})),o}}}},273:(e,t,r)=>{"use strict";var o=r(4564);e.exports={getOrigin:function(e){if(!e)return null;var t=new o(e);if("file:"===t.protocol)return null;var r=t.port;return r||(r="https:"===t.protocol?"443":"80"),t.protocol+"//"+t.hostname+":"+r},isOriginEqual:function(e,t){return this.getOrigin(e)===this.getOrigin(t)},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var r=e.split("?");return r[0]+t+(r[1]?"?"+r[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}}},2828:e=>{e.exports="1.5.2"},4564:(e,t,r)=>{"use strict";var o=r(7418),n=r(7129),i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/,c=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(c,"")}var p=[["#","hash"],["?","query"],function(e,t){return d(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function h(e){var t,o=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},n={},s=typeof(e=e||o);if("blob:"===e.protocol)n=new m(unescape(e.pathname),{});else if("string"===s)for(t in n=new m(e,{}),l)delete n[t];else if("object"===s){for(t in e)t in l||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=i.test(e.href))}return n}function d(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function f(e,t){e=u(e),t=t||{};var r,o=s.exec(e),n=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(r=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(r=o[2]+o[4],c=o[2].length):a?(r=o[3]+o[4],c=o[3].length):r=o[4],"file:"===n?c>=2&&(r=r.slice(2)):d(n)?r=o[4]:n?i&&(r=r.slice(2)):c>=2&&d(t.protocol)&&(r=o[4]),{protocol:n,slashes:i||d(n),slashesCount:c,rest:r}}function m(e,t,r){if(e=u(e),!(this instanceof m))return new m(e,t,r);var i,s,c,l,y,g,v=p.slice(),E=typeof t,_=this,T=0;for("object"!==E&&"string"!==E&&(r=t,t=null),r&&"function"!=typeof r&&(r=n.parse),i=!(s=f(e||"",t=h(t))).protocol&&!s.slashes,_.slashes=s.slashes||i&&t.slashes,_.protocol=s.protocol||t.protocol||"",e=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||a.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!d(_.protocol)))&&(v[3]=[/(.*)/,"pathname"]);T<v.length;T++)"function"!=typeof(l=v[T])?(c=l[0],g=l[1],c!=c?_[g]=e:"string"==typeof c?~(y=e.indexOf(c))&&("number"==typeof l[2]?(_[g]=e.slice(0,y),e=e.slice(y+l[2])):(_[g]=e.slice(y),e=e.slice(0,y))):(y=c.exec(e))&&(_[g]=y[1],e=e.slice(0,y.index)),_[g]=_[g]||i&&l[3]&&t[g]||"",l[4]&&(_[g]=_[g].toLowerCase())):e=l(e,_);r&&(_.query=r(_.query)),i&&t.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==t.pathname)&&(_.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],i=!1,s=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),s++):s&&(0===o&&(i=!0),r.splice(o,1),s--);return i&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}(_.pathname,t.pathname)),"/"!==_.pathname.charAt(0)&&d(_.protocol)&&(_.pathname="/"+_.pathname),o(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(l=_.auth.split(":"),_.username=l[0]||"",_.password=l[1]||""),_.origin="file:"!==_.protocol&&d(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}m.prototype={set:function(e,t,r){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||n.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;default:i[e]=t}for(var a=0;a<p.length;a++){var c=p[a];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.origin="file:"!==i.protocol&&d(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=n.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(r.slashes||d(r.protocol)?"//":"");return r.username&&(i+=r.username,r.password&&(i+=":"+r.password),i+="@"),i+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(i+=r.hash),i}},m.extractProtocol=f,m.location=h,m.trimLeft=u,m.qs=n,e.exports=m}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>So});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptContactInvite:()=>$e,acceptInvitation:()=>Xe,addContact:()=>Ve,addToBlackList:()=>Qe,addUsersToBlacklist:()=>et,declineContactInvite:()=>Ze,declineInvitation:()=>Ye,deleteContact:()=>Ke,fetchHistoryMessages:()=>Je,fetchUserInfoById:()=>Fe,getBlacklist:()=>Ue,getChatToken:()=>qe,getContacts:()=>Le,getRoster:()=>Pe,getSessionList:()=>Ge,recallMessage:()=>ct,removeFromBlackList:()=>rt,removeRoster:()=>at,removeUserFromBlackList:()=>ot,subscribe:()=>nt,subscribed:()=>it,unsubscribed:()=>st,updateCurrentUserNick:()=>He,updateOwnUserInfo:()=>We,uploadPushToken:()=>De,uploadToken:()=>Be});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{acceptGroupInvite:()=>Pt,acceptGroupJoinRequest:()=>xt,addUsersToGroupWhitelist:()=>ar,agreeInviteIntoGroup:()=>Ut,agreeJoinGroup:()=>kt,blockGroup:()=>lt,blockGroupMember:()=>$t,blockGroupMembers:()=>Zt,blockGroupMessages:()=>ht,changeGroupOwner:()=>yt,changeOwner:()=>mt,createGroup:()=>pt,createGroupNew:()=>ut,deleteGroupSharedFile:()=>gr,destroyGroup:()=>St,disableSendGroupMsg:()=>ir,dissolveGroup:()=>bt,enableSendGroupMsg:()=>sr,fetchGroupAnnouncement:()=>fr,fetchGroupSharedFileList:()=>vr,getGroup:()=>ft,getGroupAdmin:()=>Tt,getGroupBlacklist:()=>nr,getGroupBlacklistNew:()=>or,getGroupInfo:()=>gt,getGroupMsgReadUser:()=>dr,getGroupMuteList:()=>Kt,getGroupWhitelist:()=>pr,getMuted:()=>Vt,groupBlockMulti:()=>Yt,groupBlockSingle:()=>Xt,inviteToGroup:()=>Ct,inviteUsersToGroup:()=>wt,isGroupWhiteUser:()=>lr,isInGroupWhiteList:()=>hr,joinGroup:()=>At,listGroupMember:()=>Et,listGroupMembers:()=>_t,listGroups:()=>dt,modifyGroup:()=>vt,mute:()=>Ht,muteGroupMember:()=>qt,quitGroup:()=>Rt,rejectGroupInvite:()=>Bt,rejectGroupJoinRequest:()=>jt,rejectInviteIntoGroup:()=>Lt,rejectJoinGroup:()=>Mt,removeAdmin:()=>Nt,removeGroupBlockMulti:()=>tr,removeGroupBlockSingle:()=>Qt,removeGroupMember:()=>Gt,removeGroupMembers:()=>Ft,removeGroupWhitelistMember:()=>ur,removeMultiGroupMember:()=>Wt,removeMute:()=>Jt,removeSingleGroupMember:()=>Dt,rmUsersFromGroupWhitelist:()=>cr,setAdmin:()=>It,setGroupAdmin:()=>Ot,unblockGroupMember:()=>er,unblockGroupMembers:()=>rr,unmuteGroupMember:()=>zt,updateGroupAnnouncement:()=>mr,uploadGroupSharedFile:()=>yr});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:()=>Cr,addUsersToChatRoomWhitelist:()=>Qr,blockChatRoomMember:()=>Fr,blockChatRoomMembers:()=>qr,chatRoomBlockMulti:()=>Hr,chatRoomBlockSingle:()=>Wr,createChatRoom:()=>_r,deleteChatRoomSharedFile:()=>ao,destroyChatRoom:()=>Tr,disableSendChatRoomMsg:()=>Yr,enableSendChatRoomMsg:()=>Zr,fetchChatRoomAnnouncement:()=>no,fetchChatRoomSharedFileList:()=>co,getChatRoomAdmin:()=>Mr,getChatRoomBlacklist:()=>$r,getChatRoomBlacklistNew:()=>Xr,getChatRoomDetails:()=>Ir,getChatRoomMuteList:()=>Gr,getChatRoomMuted:()=>Dr,getChatRoomWhitelist:()=>ro,getChatRooms:()=>Er,isChatRoomWhiteUser:()=>oo,joinChatRoom:()=>wr,listChatRoomMember:()=>kr,listChatRoomMembers:()=>xr,modifyChatRoom:()=>Or,muteChatRoomMember:()=>Pr,quitChatRoom:()=>Ar,removeChatRoomAdmin:()=>Ur,removeChatRoomBlockMulti:()=>Vr,removeChatRoomBlockSingle:()=>Jr,removeChatRoomMember:()=>br,removeChatRoomMembers:()=>Rr,removeChatRoomWhitelistMember:()=>to,removeMultiChatRoomMember:()=>Sr,removeMuteChatRoomMember:()=>Lr,removeSingleChatRoomMember:()=>Nr,rmUsersFromChatRoomWhitelist:()=>eo,setChatRoomAdmin:()=>jr,unblockChatRoomMember:()=>zr,unblockChatRoomMembers:()=>Kr,unmuteChatRoomMember:()=>Br,updateChatRoomAnnouncement:()=>io,uploadChatRoomSharedFile:()=>so});var o=__webpack_require__(8e3),n=__webpack_require__.n(o),i=__webpack_require__(3281),s=__webpack_require__.n(i),a=__webpack_require__(3720),c=__webpack_require__.n(a);const u=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();var p;!function(e){e[e.REQUEST_SUCCESS=0]="REQUEST_SUCCESS",e[e.REQUEST_TIMEOUT=-1]="REQUEST_TIMEOUT",e[e.REQUEST_UNKNOWN=-2]="REQUEST_UNKNOWN",e[e.REQUEST_PARAMETER_ERROR=-3]="REQUEST_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.GROUP_MEMBERS_FULL=606]="GROUP_MEMBERS_FULL",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.GROUP_ALREADY_JOINED=601]="GROUP_ALREADY_JOINED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR"}(p||(p={}));const l=p;var h,d=function(){return d=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},d.apply(this,arguments)},f=function(){};function m(){return"undefined"!=typeof swan&&y(swan)?{platform:h.BAIDU,global:swan}:"undefined"!=typeof tt&&y(tt)?{platform:h.TT,global:tt}:"undefined"!=typeof my&&y(my)?{platform:h.ZFB,global:my}:"undefined"!=typeof wx&&y(wx)?{platform:h.WX,global:wx}:"undefined"!=typeof uni&&y(uni)?{platform:h.UNI,global:uni}:{platform:h.WEB,global:window}}function y(e){for(var t=["canIUse","getSystemInfo"],r=0,o=t.length;r<o;r++)if(!e[t[r]])return!1;return!0}!function(e){e.WEB="web",e.WX="wx",e.ZFB="zfb",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni"}(h||(h={}));var g={autoIncrement:0,ajax:function(e){return new Promise((function(t,r){var o=e.dataType||"text",n=e.success||f,i=e.error||f,s=new XMLHttpRequest;s.ontimeout=function(){r({errorType:"timeout_error",xhr:s})},s.onerror=function(){r({errorType:"onerror",xhr:s})},s.onabort=function(){r({errorType:"onabort",xhr:s})},s.onreadystatechange=function(){var e,a,c,u,p,h,d,f,m;if(4===s.readyState){var y=s.status||0;if(200===y){try{switch(o){case"text":return n(s.responseText),void t(s.responseText);case"json":var g=JSON.parse(s.responseText);return n(g),void t(g);case"xml":return s.responseXML&&s.responseXML.documentElement?(n(s.responseXML.documentElement),void t(s.responseXML.documentElement)):(i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}));default:i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}return t(s.response||s.responseText),void n(s.response||s.responseText,s)}catch(e){r(e)}return}if(403===y)"string"==typeof(v=s.response)&&(v=JSON.parse(v)),"group member list is full!"===v.error_description?(null===(e=s.responseURL)||void 0===e?void 0:e.includes("chatgroups"))?r({type:l.GROUP_MEMBERS_FULL,data:s.response||s.responseText,message:v.error_description}):r({type:l.CHATROOM_MEMBERS_FULL,data:s.response||s.responseText,message:v.error_description}):v.error_description.includes(v.error_description.includes("already in group"))?(null===(a=s.responseURL)||void 0===a?void 0:a.includes("chatgroups"))&&r({type:l.GROUP_ALREADY_JOINED,data:s.response||s.responseText,message:v.error_description}):v.error_description.includes("are not members of this group")?(null===(c=s.responseURL)||void 0===c?void 0:c.includes("chatgroups"))&&r({type:l.GROUP_NOT_JOINED,data:s.response||s.responseText,message:v.error_description}):r({type:l.PERMISSION_DENIED,data:s.response||s.responseText,message:"permission denied"}),i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText});else if(404===y){var v;"string"==typeof(v=s.response)&&(v=JSON.parse(v)),(null===(u=v.error_description)||void 0===u?void 0:u.includes("do not find this group"))||(null===(p=v.error_description)||void 0===p?void 0:p.includes("does not exist"))?(null===(h=s.responseURL)||void 0===h?void 0:h.includes("chatgroups"))?r({type:l.GROUP_NOT_EXIST,data:s.response||s.responseText,message:"The chat room dose not exist."}):r({type:l.CHATROOM_NOT_EXIST,data:s.response||s.responseText,message:"The chat room dose not exist."}):(null===(d=v.error_description)||void 0===d?void 0:d.includes("username"))&&(null===(f=v.error_description)||void 0===f?void 0:f.includes("doesn't exist!'"))||(null===(m=v.error_description)||void 0===m?void 0:m.includes("user not found"))?r({type:l.USER_NOT_FOUND,data:s.response||s.responseText,message:v.error_description}):r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}else{if(429!==y&&503!==y)return r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText});r({type:l.SERVER_BUSY,data:s.response||s.responseText,message:"Server is busy."}),i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}}0===s.readyState&&(i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}))},e.responseType&&s.responseType&&(s.responseType=e.responseType),e.mimeType&&s.overrideMimeType(e.mimeType);var a=e.type||"POST",c=e.data||null,u="";if("get"===a.toLowerCase()&&c){for(var p in c)c.hasOwnProperty(p)&&(u+=p+"="+c[p]+"&");u=u?u.slice(0,-1):u,e.url+=(e.url.indexOf("?")>0?"&":"?")+(u?u+"&":u)+"_v="+(new Date).getTime(),c=null,u=""}s.open(a,e.url);var h=e.headers||{};for(var d in h)h.hasOwnProperty(d)&&s.setRequestHeader(d,h[d]);s.send(c)})).then((function(e){return"Object"===(t=e,Object.prototype.toString.call(t).slice(8,-1))?d(d({},e),{type:l.REQUEST_SUCCESS}):{data:e,type:l.REQUEST_SUCCESS};var t}))},getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:null},r="string"==typeof e?document.getElementById(e):e;try{if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var o=r.files;if(o.length>0){var n=o.item(0);t.data=n,t.url=window.URL.createObjectURL(n),t.filename=(null==n?void 0:n.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");n=document.getElementById(e).value,t.url=n;var i=n.lastIndexOf("/"),s=n.lastIndexOf("\\"),a=Math.max(i,s);t.filename=a<0?n:n.substring(a+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t}catch(e){throw e}},uploadFile:function(e){var t,r,o=e.accessToken;if(o){var n=e.appKey,i=[],s="",a="";if(n&&(s=(i=n.split("#"))[0],a=i[1]),s||a){var c=e.apiUrl,u=e.uploadUrl||c+"/"+s+"/"+a+"/chatfiles";if((null===(r=null===(t=null==e?void 0:e.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.size)<=0)e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var p=new XMLHttpRequest;p.upload&&p.upload.addEventListener("progress",e.onFileUploadProgress||function(){},!1),p.addEventListener("abort",e.onFileUploadCanceled||function(){},!1),p.addEventListener("error",(function(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:p})}),!1),p.addEventListener("load",(function(t){try{var r=JSON.parse(p.responseText);if(400===p.status&&"content improper"===r.error)return e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:p.responseText})}}),!1),p.open("POST",u),p.setRequestHeader("restrict-access","true"),p.setRequestHeader("Accept","*/*"),p.setRequestHeader("Authorization","Bearer "+o);var h=new FormData;h.append("file",e.file.data),p.send(h)}}else e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})},flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];for(var n=0,i=t?e[n].apply(this,r):r[0];++n<t;)i=e[n].call(this,i);return i}},listenNetwork:function(e,t){var r=m();if(r.platform!==h.WEB){var o=r.global,n=function(r){r.isConnected?e():t()};o.offNetworkStatusChange&&o.offNetworkStatusChange(n),o.onNetworkStatusChange&&o.onNetworkStatusChange(n)}else window.addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))},getEnvInfo:m,wxRequest:function(e){return new Promise((function(t,r){var o=e.success||f,n=e.error||f,i=e.type||"POST",s=e.data||null,a="",c=g.getEnvInfo();if("get"===i.toLowerCase()&&s){for(var u in s)s.hasOwnProperty(u)&&(a+=u+"="+s[u]+"&");a=a?a.slice(0,-1):a,e.url+=(e.url.indexOf("?")>0?"&":"?")+(a?a+"&":a)+"_v="+(new Date).getTime(),s=null,a=""}var p={url:e.url,data:e.data,method:i,headers:{},success:function(e){"200"==e.StatusCode||"200"==e.status?(o(e.data),t(e.data)):(n(e),r(e))},complete:function(){},fail:function(e){n(e),r(e)}};"zfb"===c.platform?p.headers=e.headers:p.header=e.headers,c.global.request(p)}))},parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||f,e.onFileDownloadError=e.onFileDownloadError||f;var t=new XMLHttpRequest;t.addEventListener("load",(function(r){e.onFileDownloadComplete(t.response)}),!1),t.addEventListener("error",(function(r){e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:t})}),!1);var r=e.method||"GET",o=e.responseType||"blob",n=e.mimeType||"text/plain; charset=x-user-defined";t.open(r,e.url),"undefined"!=typeof Blob?t.responseType=o:t.overrideMimeType(n);var i={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+this.context.accessToken},s=e.headers||{};for(var a in s)i[a]=s[a];for(var a in i)i[a]&&t.setRequestHeader(a,i[a]);t.send(null)}};const v=g;var E=__webpack_require__(4188),_=__webpack_require__.n(E);function T(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}var I,O="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),N=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},b=function(){},S={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(I||(I={}));var R=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=I,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory;var o=this._getPersistedLevel();null!=o&&null!=o||(o=null==t?"WARN":t),this.logs=[],this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(o,!1,"")}return e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=I[e]),void 0===e&&(e=0),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw Error("log.setLevel() called with invalid level: "+e);if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r),"undefined"==typeof console&&e<I.SILENT)return"No console available for logging"},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),o=document.createElement("a");o.style.display="none",o.href=r,o.setAttribute("download","sdklog"),document.body.appendChild(o),o.click()}},e.prototype._bindMethod=function(e,t,r){var o=this,n=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof n.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=o.getTime();n.call.apply(n,N([e,s+" IM SDK ["+("log"===t?"debug":t)+"]: "],r,!1))};try{return Function.prototype.bind.call(n,e,i+" IM SDK ["+("log"===t?"debug":t)+"]: ")}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",o="";e.forEach((function(e){o+="object"==typeof e?JSON.stringify(e)+" ":e+" "})),this._cacheLogCall(r+o)},e.prototype._cacheLogCall=function(e){var t=C(e),r=this.logBytes+t,o=this.config.maxCache;if(!(t>=o)){if(r<o)this.logBytes+=t;else for(var n=r-o,i=0;i<n;){var s=this.logs.shift();void 0!==s&&(i+=C(s))}this.logs.push(e)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";"undefined"!=typeof window&&(window.localStorage&&(window.localStorage[this.storageLogLevelKey]=t),this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";"))},e.prototype.replaceLoggingMethods=function(e,t){for(var r=0;r<this.logMethods.length;r++){var o=this.logMethods[r];this[o]=r<e?b:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&O?T:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):b)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){var o=this;return function(){"undefined"!=typeof console&&(o.replaceLoggingMethods.call(o,t,r),o[e].apply(o,arguments))}},e}();function C(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var w=new R;w.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=S[e];return t||(t=S[e]=new R(e,w.getLevel(),w.methodFactory)),t};var A="undefined"!=typeof window?window.log:void 0;w.noConflict=function(){return"undefined"!=typeof window&&window.log===w&&(window.log=A),w},w.getLoggers=function(){return S};const k=w,x=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||""}},e.create=function(e){return{id:v.getUniqueId(),ackId:e.id,type:"read",to:e.to,from:e.from||""}},e}(),M=function(){function e(e){this.id=e.id,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e.create=function(e){return{id:v.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e}(),j=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from||"",time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now()}},e}(),U=function(){function e(e){var t=e.type,r=e.id||v.getUniqueId();this.id=r,this.type=t,this.value=""}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{type:"txt",id:v.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now()}},e}(),P=function(){function e(e){var t=e.type,r=e.id;this.id=r||v.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now()}},e}(),L=function(){function e(e){var t=e.type,r=e.id||v.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now()}},e}(),B=function(){function e(e){var t=e.type,r=e.id;this.id=r||v.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now()}},e}(),D=function(){function e(e){var t=e.type,r=e.id||v.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress}},e}(),G=function(){function e(e){var t=e.type,r=e.id||v.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length}},e}(),W=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e}(),F=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,apiUrl:e.apiUrl,onFileUploadComplete:e.onFileUploadComplete,body:e.body,time:Date.now()}},e}();var H=function(){function e(t,r){return this.type=t,this.id=r||v.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new x({type:"read",id:e.id});case"delivery":return new M({type:"delivery",id:e.id});case"channel":return new j({type:"channel",id:e.id});case"txt":return new U({type:"txt",id:e.id});case"cmd":return new P({type:"cmd",id:e.id});case"custom":return new L({type:"custom",id:e.id});case"loc":return new B({type:"loc",id:e.id});case"img":return new D({type:"img",id:e.id});case"audio":return new G({type:"audio",id:e.id});case"video":return new W({type:"video",id:e.id});case"file":return new F({type:"file",id:e.id})}},e.create=function(e){return"txt"!==(t=e).type||"version"in t?function(e){return"img"===e.type&&!("version"in e)}(e)?D.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?P.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?F.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?G.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?W.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?L.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?B.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?j.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?M.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?x.create(e):{}:U.create(e);var t},e.prototype.set=function(e){},e}(),q={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"};function J(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var o=e[r].varintValue,n=new(c())(o.low,o.high,o.unsigned).toString();t[e[r].key]=0!==Number(n)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(o=e[r].varintValue,n=new(c())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}function z(e,t,r){if(this.delivery&&e!==t){var o=this.getUniqueId(),n=new H("delivery",o);n.set({ackId:r,to:e}),k.debug("send delivery ack"),this.send(n.body)}}const V=function(e,t,r){var o,n,i,s=new(c())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),a=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),u=new(c())(e.id.low,e.id.high,e.id.unsigned).toString(),p=a.ackMessageId?new(c())(a.ackMessageId.low,a.ackMessageId.high,a.ackMessageId.unsigned).toString():"",l="",h=a.from&&a.from.name,d=a.to&&a.to.name;switch(k.debug("thirdMessage:",a),a.type){case 1:l="chat","agoraToken"===this.grantType&&(l="singleChat"),this.delivery&&z.call(this,h,d,u);break;case 2:l="groupchat","agoraToken"===this.grantType&&(l="groupChat");break;case 3:l="chatroom","agoraToken"===this.grantType&&(l="chatRoom");break;case 4:if(l="read_ack",a.msgConfig)return void(this.onReadMessage&&this.onReadMessage({id:u,type:"read",from:h,to:d,mid:p,groupReadCount:a.ext[0]&&JSON.parse(a.ext[0].stringValue),ackContent:a.ackContent}));this.onReadMessage&&this.onReadMessage({id:u,type:"read",from:h,to:d,mid:p});var f={id:u,type:"read",from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onReadMessage",f));case 5:l="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:u,type:"delivery",from:h,to:d,mid:p});var m={id:u,type:"delivery",from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onDeliveredMessage",m));case 6:l="recall",this.onRecallMessage&&this.onRecallMessage({id:u,from:h,to:d,mid:p});var y={id:u,from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onRecallMessage",y));case 7:this.onChannelMessage&&this.onChannelMessage({id:u,type:"channel",chatType:"singleChat",from:h,to:d,time:Number(s)});var g={id:u,type:"channel",chatType:"singleChat",from:h,to:d,time:Number(s)};return void(this.eventHandler&&this.eventHandler.dispatch("onChannelMessage",g))}i="chat"===l.toLowerCase()||"singleChat"===l?"singleChat":"groupchat"===l.toLowerCase()||"groupChat"===l?"groupChat":"chatRoom";for(var v=0;v<a.contents.length;v++){var E={},_=t.errorCode>0,T=t.errorCode,I=t.reason,O=a.contents[v],N={},b=void 0;switch(a.ext&&(N=J(a.ext)),O.type){case 0:!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,data:O.text,ext:N,sourceMsg:O.text,time:s,msgConfig:a.msgConfig}).msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onTextMessage&&this.onTextMessage(E);var S={id:u,type:"txt",chatType:i,msg:O.text,to:d,from:h,ext:N,time:Number(s)};E.msgConfig&&(S.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onTextMessage",S);break;case 1:var R=(null===(o=null==O?void 0:O.size)||void 0===o?void 0:o.width)||0,C=(null===(n=null==O?void 0:O.size)||void 0===n?void 0:n.height)||0;b=this.useOwnUploadFun?O.remotePath:(O.remotePath&&this.apiUrl+O.remotePath.substr(O.remotePath.indexOf("/",9)))+"?em-redirect=true",O.secretKey&&!this.useOwnUploadFun&&(b=b+"&share-secret="+O.secretKey),!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,url:b,secret:O.secretKey,filename:O.displayName,thumb:O.thumbnailRemotePath,thumb_secret:O.thumbnailSecretKey,file_length:O.fileLength||"",width:R,height:C,filetype:O.filetype||"",accessToken:this.token,ext:N,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onPictureMessage&&this.onPictureMessage(E);var w={id:u,type:"img",chatType:i,from:h,to:d,url:b||"",width:R,height:C,secret:O.secretKey||"",thumb:O.thumbnailRemotePath||"",thumb_secret:O.thumbnailSecretKey||"",ext:N,time:Number(s)};E.msgConfig&&(w.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onImageMessage",w);break;case 2:b=this.useOwnUploadFun?O.remotePath:(O.remotePath&&this.apiUrl+O.remotePath.substr(O.remotePath.indexOf("/",9)))+"?em-redirect=true",O.secretKey&&!this.useOwnUploadFun&&(b=b+"&share-secret="+O.secretKey),!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,url:b,secret:O.secretKey,filename:O.displayName,length:O.duration||"",file_length:O.fileLength||"",filetype:O.filetype||"",accessToken:this.token||"",ext:N,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onVideoMessage&&this.onVideoMessage(E);var A={id:u,type:"video",chatType:i,from:h,to:d,url:b,secret:O.secretKey,filename:O.displayName,length:O.duration||0,file:{},file_length:O.fileLength||0,filetype:O.filetype||"",accessToken:this.token||"",ext:N,time:Number(s)};E.msgConfig&&(A.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",A);break;case 3:!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,addr:O.address,lat:O.latitude,lng:O.longitude,ext:N,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onLocationMessage&&this.onLocationMessage(E);var x={id:u,type:"loc",chatType:i,from:h,to:d,addr:O.address,lat:O.latitude,lng:O.longitude,ext:N,time:Number(s)};E.msgConfig&&(x.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",x);break;case 4:b=this.useOwnUploadFun?O.remotePath:(O.remotePath&&this.apiUrl+O.remotePath.substr(O.remotePath.indexOf("/",9)))+"?em-redirect=true",O.secretKey&&!this.useOwnUploadFun&&(b=b+"&share-secret="+O.secretKey),!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,url:b,secret:O.secretKey,filename:O.displayName,file_length:O.fileLength||"",accessToken:this.token||"",ext:N,length:O.duration,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onAudioMessage&&this.onAudioMessage(E);var M={id:u,type:"audio",chatType:i,from:h,to:d,url:b,secret:O.secretKey,file:{},filename:O.displayName,length:O.duration||0,file_length:O.fileLength||0,filetype:O.filetype||"",accessToken:this.token||"",ext:N,time:Number(s)};E.msgConfig&&(M.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",M);break;case 5:b=this.useOwnUploadFun?O.remotePath:(O.remotePath&&this.apiUrl+O.remotePath.substr(O.remotePath.indexOf("/",9)))+"?em-redirect=true",O.secretKey&&!this.useOwnUploadFun&&(b=b+"&share-secret="+O.secretKey),!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,url:b,secret:O.secretKey,filename:O.displayName,file_length:O.fileLength,accessToken:this.token||"",ext:N,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onFileMessage&&this.onFileMessage(E);var j={id:u,type:"file",chatType:i,from:h,to:d,url:b,secret:O.secretKey,file:{},filename:O.displayName,length:O.duration||0,file_length:O.fileLength||0,filetype:O.filetype||"",accessToken:this.token||"",ext:N,time:Number(s)};E.msgConfig&&(j.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onFileMessage",j);break;case 6:!(E={id:u,type:l,contentsType:q[O.type],from:h,to:d,action:O.action,ext:N,time:s,msgConfig:a.msgConfig}).msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onCmdMessage&&this.onCmdMessage(E);var U={id:u,type:"cmd",chatType:i,from:h,to:d,action:O.action,ext:N,time:Number(s)};E.msgConfig&&(U.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",U);break;case 7:var P={},L={};a.contents[0].customExts&&(P=J(a.contents[0].customExts)),a.contents[0].params&&(L=J(a.contents[0].params)),E={id:u,type:l,contentsType:q[O.type],from:h,to:d,customEvent:O.customEvent,params:L,customExts:P,ext:N,time:s},!r&&this.onCustomMessage&&this.onCustomMessage(E);var B={id:u,type:"custom",chatType:i,from:h,to:d,customEvent:O.customEvent,params:L,customExts:P,ext:N,time:Number(s)};E.msgConfig&&(B.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",B)}return E}},K=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;(function(e){var r=this,o={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status};return({32:function(){var e,n;o.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},31:function(){var e,n;o.type=t.isChatroom?"muteChatRoom":"muteGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},30:function(){var e,n;o.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},29:function(){var e,n;o.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},28:function(){var e,n;o.type="deleteFile",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},27:function(){var e,n;o.type="uploadFile",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},26:function(){var e,n;o.type="deleteAnnouncement",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},25:function(){var e,n;o.type="updateAnnouncement",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},24:function(){var e,n;o.type="removeMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},23:function(){var e,n;o.type="addMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},22:function(){var e,n;o.type="removeAdmin",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},21:function(){var e,n;o.type="addAdmin",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},20:function(){var e,n;o.type="changeOwner",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},19:function(){var e,n;o.type="direct_joined",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},18:function(){var e,n;o.type=t.isChatroom?"leaveChatRoom":"leaveGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},17:function(){var e,n;o.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},16:function(){var e,n;o.type="unblock",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},15:function(){var e,n;o.type="block",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},14:function(){var e,n;o.type="update",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},13:function(){var e,n;o.type="allow",o.reason=t.reason,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},12:function(){var e,n;o.type="ban",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},11:function(){var e,n;o.type="getBlackList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},10:function(){var e,n;o.type="removedFromGroup",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},9:function(){var e,n;o.type="invite_decline",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},8:function(){var e,n;o.type="invite_accept",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},7:function(){var e,n;o.type="invite",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},6:function(){var e,n;o.type="joinPublicGroupDeclined",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},5:function(){var e,n;o.type="joinPublicGroupSuccess",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},4:function(){var e,n;o.type="joinGroupNotifications",o.reason=t.reason,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},3:function(){var e,n;o.type="leave",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},2:function(){var e,n;o.type="join",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},1:function(){var e,n;o.type="deleteGroupChat",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)}}[e]||function(){console.error("No match operation "+e)})()}).call(this,r)};var X;!function(e){e[e.Add=2]="Add",e[e.Remove=3]="Remove",e[e.Accept=4]="Accept",e[e.Decline=5]="Decline",e[e.Ban=6]="Ban",e[e.Allow=7]="Allow"}(X||(X={}));const $={operatRoster:function(e,t){var r=[],o=this.root.lookup("easemob.pb.RosterBody"),n=o.decode(r);switch(t){case"add":n.operation=X.Add;break;case"remove":n.operation=X.Remove;break;case"accept":n.operation=X.Accept;break;case"decline":n.operation=X.Decline;break;case"ban":n.operation=X.Ban;break;case"allow":n.operation=X.Allow}n.from=this.context.jid;var i=[];if("string"==typeof e.to)i.push({appKey:this.appKey||this.context.appKey,name:e.to,domain:"easemob.com"});else if(e.to instanceof Array)for(var s=0;s<e.to.length;s++)i.push({appKey:this.appKey,name:e.to[s],domain:"easemob.com"});n.to=i,n.reason=e.message||"",n=o.encode(n).finish();var a=this.root.lookup("easemob.pb.Meta").decode(r);a.id=e.id||this.getUniqueId(),a.from=this.context.jid,a.to={domain:"@easemob.com"},a.ns=3,a.payload=n;var c=this.root.lookup("easemob.pb.CommSyncUL"),u=c.decode(r);u.meta=a,u=c.encode(u).finish();var p=this.root.lookup("easemob.pb.MSync"),l=p.decode(r);l.version=this.version,l.encryptType=[0],l.command=0,l.guid=this.jid,l.payload=u,l=p.encode(l).finish();var h=this.mSync.base64transform(l);this.sock.send(h)},handleRosterMsg:function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:a.to[0].name,from:a.from.name,status:a.reason};switch(a.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactRefuse",c);break;case 6:case 7:this.getBlacklist();break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(s=this.eventHandler)||void 0===s||s.dispatch("onContactRefuse",c)}this.onPresence&&c.type&&this.onPresence(c)}},Y=function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);switch(a.operation){case 0:this.onStatisticMessage&&this.onStatisticMessage(a),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",a);break;case 1:s=u.create({type:l.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.logOut=!0,this.onError&&this.onError(s),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",s);break;case 2:s=u.create({type:l.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(s),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",s);break;case 3:s=u.create({type:l.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(s),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",s);break;case 4:s=u.create({type:l.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(s),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",s)}};var Z=function(){return Z=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Z.apply(this,arguments)};function Q(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r=n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),s=i.decode(o);s.compressType=this.compressType,s.encryptType=this.encryptType,s.osType=this.osType,s.version=this.version,s.deviceName=t,s.resource=e,s.deviceUuid=r,s.auth="$t$"+this.token,s=i.encode(s).finish();var a=this.root.lookup("easemob.pb.MSync"),c=a.decode(o);return c.version=this.version,c.guid=this.context.jid,c.auth="$t$"+this.token,c.command=3,c.deviceId=t,c.encryptType=this.encryptType,c.payload=s,a.encode(c).finish()}function ee(e,t){var r=this,o=v.getEnvInfo();if("web"===o.platform||"zfb"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=_().btoa(n),"web"===o.platform?n:{data:n,isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(k.debug("发送失败重联"),r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var s=e;return{data:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!=e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function te(e,t){switch(e.ns){case 0:Y.call(this,e);break;case 1:V.call(this,e,t);break;case 2:K.call(this,e);break;case 3:$.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this)}}function re(e,t){for(var r=function(r){var n=new(c())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return{value:void 0};var i=e[r].from.name,s=e[r].to?e[r].to.name:"",a=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=Io.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:s,isGroup:a}),te.call(o,e[r],t)},o=this,n=0;n<e.length;n++){var i=r(n);if("object"==typeof i)return i.value}}function oe(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");if(t=t.decode(e.payload),"agoraToken"===this.grantType){var r=new(c())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();this.compareTokenExpireTime(Number(r),this.expirationTime)}if(0===t.unread.length)le.call(this);else for(var o=0;o<t.unread.length;o++)se.call(this,t.unread[o].queue)}function ne(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var o=this.root.lookup("easemob.pb.Meta").decode(e);o.id=(new Date).valueOf(),o.ns=0,o.payload=r;var n=this.root.lookup("easemob.pb.CommSyncUL"),i=n.decode(e);i.meta=o,i=n.encode(i).finish();var s=this.root.lookup("easemob.pb.MSync"),a=s.decode(e);return a.version=this.version,a.encryptType=[0],a.command=0,a.payload=i,s.encode(a).finish()}function ie(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),o=r.decode(t);o.queue=e,o=r.encode(o).finish();var n=this.root.lookup("easemob.pb.MSync"),i=n.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=o,n.encode(i).finish()}function se(e){k.debug("sendBackqueue");var t=ie.call(this,e);be.call(this,t)}function ae(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(c())(e.low,e.high,e.unsigned).toString(),n=o.encode(n).finish();var i=this.root.lookup("easemob.pb.MSync"),s=i.decode(r);return s.version=this.version,s.encryptType=this.encryptType,s.command=0,s.payload=n,i.encode(s).finish()}function ce(e,t){k.debug("sendLastSession");var r=ae.call(this,e,t);be.call(this,r)}function ue(e){var t,r=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=r.resource),this.clientResource=r.resource,0===r.status.errorCode){if(this.onOpened&&this.onOpened(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onConnected"),"agoraToken"===this.grantType){var o=Date.now();this.expiresIn=this.expirationTime-o,this.tokenExpireTimeCountDown(this.expiresIn)}pe.call(this),de.call(this),he.call(this),le.call(this)}else this.onError&&this.onError({type:l.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function pe(){if(this.unSendMsgArr.length>0){for(var e=0;e<this.unSendMsgArr.length;e++){var t=this.unSendMsgArr[e];Ne.call(this,t)}this.unSendMsgArr=[]}}function le(){var e=ne.call(this);be.call(this,e)}function he(){var e=me.call(this);be.call(this,e)}function de(){var e=this;fe.call(this),this.heartBeatID=setInterval((function(){he.call(e)}),this.heartBeatWait)}function fe(){clearInterval(this.heartBeatID)}function me(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function ye(e,t){return e.some((function(e){return e.name===t.name}))}function ge(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice").decode(e.payload);ye(this._queues,r.queue)||this.clientResource===r.queue.clientResource&&r.queue.name===this.context.userId||(this._queues.push(r.queue),this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout((function(){var e=r.queue;ye(t._queues,e)&&(se.call(t,r.queue),k.debug("⬇q:",e))}),1e4),1===this._queues.length&&se.call(this,r.queue))}function ve(e){var t=v.getEnvInfo();if("web"===t.platform||"zfb"===t.platform){for(var r=_().atob(e.data),o=[],n=0,i=r.length;n<i;++n)o.push(r.charCodeAt(n));return this.root.lookup("easemob.pb.MSync").decode(o)}return this.root.lookup("easemob.pb.MSync").decode(e.data)}function Ee(e){switch(e.command){case 0:_e.call(this,e);break;case 1:oe.call(this,e);break;case 2:ge.call(this,e);break;case 3:ue.call(this,e)}}function _e(e){var t,r,o,n=this.root.lookup("easemob.pb.CommSyncDL");n=n.decode(e.payload);var i=new(c())(n.serverId.low,n.serverId.high,n.serverId.unsigned).toString(),s=new(c())(n.metaId.low,n.metaId.high,n.metaId.unsigned).toString();if(0!==n.metas.length)try{re.call(this,n.metas,n.status)}catch(e){this.onError&&this.onError({type:l.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(n.isLast){var a=-1;return this._queues.some((function(e,t){return e.name===n.name&&(a=t,!0)}))&&a>0&&this._queues.splice(a,1),void(this._queues.length>0&&(se.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer)))}ce.call(this,n.nextKey,n.queue)}else if(n.isLast){var p=-1;this._queues.some((function(e,t){return e.name===n.queue.name&&(p=t,!0)}))&&this._queues.splice(p,1),this._queues.length>0&&(se.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(n.status&&0===n.status.errorCode){if(this._msgHash[s]){try{(null===(t=this._msgHash[s])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[s].resolve({localMsgId:s,serverMsgId:i}),(null===(r=this._msgHash[s])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[s].success(s,i)}catch(e){this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:s,mid:i,to:this._msgHash[s].to,time:0}),delete this._msgHash[s]}}else if(n.status&&15===n.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:i}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject({type:l.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(n.status&&1===n.status.errorCode){var h=void 0;switch(n.status.reason){case"blocked":h=l.PERMISSION_DENIED;break;case"group not found":h=l.GROUP_NOT_EXIST;break;case"not in group or chatroom":h=l.GROUP_NOT_JOINED;break;case"exceed recall time limit":h=l.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":h=l.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":h=l.SERVICE_NOT_ALLOW_MESSAGING;break;default:h=l.SERVER_UNKNOWN_ERROR}if(this._msgHash[s]){var d=u.create({type:h,message:n.status.reason||"",data:{id:s,mid:i}});this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:h,reason:n.status.reason?n.status.reason:"",data:{id:s,mid:i}})}}else if(n.status&&7===n.status.errorCode)"sensitive words"===n.status.reason&&this._msgHash[s]?(d=u.create({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:s,mid:i,reason:"sensitive words"}})):"blocked by mod_antispam"===n.status.reason&&this._msgHash[s]&&(d=u.create({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:s,mid:i,reason:"blocked by mod_antispam"}}));else if(n.status&&19===n.status.errorCode)this._msgHash[s]&&(d=u.create({type:l.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:n.status.reason||"",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:s,mid:i,reason:n.status.reason}}));else if(this._msgHash[s]){try{d=u.create({type:l.WEBIM_LOAD_MSG_ERROR,message:(null===(o=n.status)||void 0===o?void 0:o.reason)||"",data:{id:s,mid:i,reason:n.status&&n.status.reason}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.WEBIM_LOAD_MSG_ERROR,data:{errorCode:n.status&&n.status.errorCode,reason:n.status&&n.status.reason}})}catch(e){this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[s]}else this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"})}function Te(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),o=[];for(var n in e){var i=r.decode(t);i.key=n,"object"==typeof e[n]?(i.type=8,i.stringValue=JSON.stringify(e[n])):"string"==typeof e[n]?(i.type=7,i.stringValue=e[n]):"boolean"==typeof e[n]?(i.type=1,i.varintValue=!0===e[n]?1:0):Number.isInteger(e[n])?(i.type=2,i.varintValue=e[n]):(i.type=6,i.doubleValue=e[n]),o.push(i)}return o}function Ie(e){var t,r,o=[];if(this.root){var n,i=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(n=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":i.type=0,i.text=e.msg;break;case"img":i.type=1,e.body?(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):(i.displayName=e.file.filename,i.remotePath=e.file.url,i.secretKey=e.file.secret,i.fileLength=e.file.file_length,i.size=e.file.size,i.thumbnailDisplayName=e.file.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.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.customEvent=e.customEvent,i.customExts=Te.call(this,e.customExts)}var s=[];e.ext&&(s=Te.call(this,e.ext));var a=this.root.lookup("easemob.pb.MessageBody"),c=a.decode(o);c.from={name:this.context.jid.name},c.to={name:e.to},"channel"===e.type?c.type=7:"recall"===e.type?(c.type=6,c.ackMessageId=e.ackId):"delivery"===e.type?(c.type=5,c.ackMessageId=e.ackId):"read"===e.type?(c.type=4,c.ackMessageId=e.ackId,e.msgConfig&&"groupChat"===n&&(c.msgConfig=e.msgConfig,c.ackContent=e.ackContent)):"chatRoom"===n?c.type=3:"groupChat"===n?(c.type=2,e.msgConfig&&(c.msgConfig=e.msgConfig)):"singleChat"===n&&(c.type=1),c.contents=[i],c.ext=s,c=a.encode(c).finish();var u=this.root.lookup("easemob.pb.Meta").decode(o);u.id=e.id;var p="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(p="conference.easemob.com"),u.from=this.context.jid,u.to={appKey:this.appKey,name:e.to,domain:p},u.ns=1,u.payload=c;var h=this.root.lookup("easemob.pb.CommSyncUL"),d=h.decode(o);d.meta=u,d=h.encode(d).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(o);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.guid=this.context.jid,m.payload=d,f.encode(m).finish()}e.fail&&e.fail({type:l.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Oe(e){var t=this;return e.file?(e.accessToken=this.token,e.appKey=this.appKey,e.apiUrl=this.apiUrl,e.body&&e.body.url?Ie.call(this,e):new Promise((function(r,o){var n=e.onFileUploadComplete;e.onFileUploadComplete=function(i){var s;if(i.entities[0]["file-metadata"]){var a=i.entities[0]["file-metadata"]["content-length"];e.file_length=a,e.filetype=i.entities[0]["file-metadata"]["content-type"],a>204800&&(e.thumbnail=!0)}e.body={type:e.type||"file",secret:i.entities[0]["share-secret"],filename:e.file.filename||e.filename,url:(t.isHttpDNS?t.apiUrl+i.uri.substr(i.uri.indexOf("/",9)):i.uri)+"/"+i.entities[0].uuid,length:e.length||0,filetype:e.filetype||e.file.filetype,file_length:(null===(s=null==e?void 0:e.ext)||void 0===s?void 0:s.file_length)||0,size:{width:e.width||0,height:e.height||0}},e.file.url=i.uri,n instanceof Function&&n(i,e.id);var c=Ie.call(t,e);be.call(t,c),t._msgHash[e.id]=Z(Z({},e),{resolve:r,reject:o})},v.uploadFile.call(t,e)}))):e}function Ne(e){var t=this;return new Promise((function(r,o){if(t.logOut)return o({type:l.WEBIM_CONNECTION_CLOSED,message:"not login"});if(("file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type)&&e.file)return Oe.call(t,e);var n=Ie.call(t,e);be.call(t,n,e.id),e.id&&(t._msgHash[e.id]=Z(Z({},e),{resolve:r,reject:o}))}))}function be(e,t){if(!this.isOpened())return this.unSendMsgArr.push(e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.socketHost.length&&this.isHttpDNS||!this.isHttpDNS)&&(k.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnect()),void(this.onError&&this.onError({type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var r=ee.call(this,e,t);this.sock.send(r)}const Se=function(e,t){return e.send=Ne,e.sendMsg=Ne,{generateProvision:Q.bind(e),base64transform:ee.bind(e),distributeMeta:te.bind(e),decodeMeta:re.bind(e),decodeUnreadDL:oe.bind(e),_rebuild:ne.bind(e),_lastsession:ae.bind(e),receiveProvision:ue.bind(e),isInQueue:ye.bind(e),decodeNotice:ge.bind(e),decodeMSync:ve.bind(e),distributeMSync:Ee.bind(e),encodeChatMsg:Ie.bind(e),upLoadFile:Oe.bind(e),send:Ne.bind(e),stopHeartBeat:fe.bind(e)}};var Re=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in k.debug("dispatch event: "+e,t),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}();const Ce=Re;var we=function(){};function Ae(e){this.onOpened=e.onOpened||we,this.onPresence=e.onPresence||we,this.onTextMessage=e.onTextMessage||we,this.onPictureMessage=e.onPictureMessage||we,this.onAudioMessage=e.onAudioMessage||we,this.onVideoMessage=e.onVideoMessage||we,this.onFileMessage=e.onFileMessage||we,this.onLocationMessage=e.onLocationMessage||we,this.onCmdMessage=e.onCmdMessage||we,this.onCustomMessage=e.onCustomMessage||we,this.onReceivedMessage=e.onReceivedMessage||we,this.onDeliveredMessage=e.onDeliveredMessage||we,this.onReadMessage=e.onReadMessage||we,this.onRecallMessage=e.onRecallMessage||we,this.onMutedMessage=e.onMutedMessage||we,this.onError=e.onError||we,this.onOffline=e.onOffline||we,this.onOnline=e.onOnline||we,this.onRoster=e.onRoster||we,this.onStatisticMessage=e.onStatisticMessage||we,this.onCreateGroup=e.onCreateGroup||we,this.onBlacklistUpdate=e.onBlacklistUpdate||we,this.onContactAgreed=e.onContactAgreed||we,this.onContactRefuse=e.onContactRefuse||we,this.onContactDeleted=e.onContactDeleted||we,this.onContactAdded=e.onContactAdded||we,this.onTokenWillExpire=e.onTokenWillExpire||we,this.onTokenExpired=e.onTokenExpired||we,this.onClosed=e.onClosed||we}function ke(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function xe(){var e;if(!this.context.accessToken){var t=u.create({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function Me(){return xe.call(this)&&ke.call(this)}var je=function(){return je=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},je.apply(this,arguments)};function Ue(e){var t=this;if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o={};r.data.forEach((function(e){o[e]={name:e}})),t.onBlacklistUpdate&&t.onBlacklistUpdate(o),"function"==typeof(null==e?void 0:e.success)&&e.success(r)},error:function(r){t.onBlacklistUpdate&&t.onBlacklistUpdate({}),"function"==typeof(null==e?void 0:e.error)&&e.error(r)}};return v.ajax(a)}function Pe(e){var t=this;if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o=[];r.data.forEach((function(e){o.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(o),t.onRoster&&t.onRoster(o)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return v.ajax(a)}var Le=Pe;function Be(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');if("string"!=typeof e.deviceToken||""===e.deviceToken)throw Error('Invalid parameter: "deviceToken"');if("string"!=typeof e.notifierName||""===e.notifierName)throw Error('Invalid parameter: "notifierName"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}var De=Be;function Ge(e){if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/user_channels",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return v.ajax(s)}function We(e,t){if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],c={};if("undefined"!=typeof wx||"undefined"!=typeof qq)if("string"==typeof e&&void 0!==t){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");a.forEach((function(t){a.includes(t)&&void 0!==e[t]&&(c[t]=e[t])}))}else if("string"==typeof e){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var p=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);p.push(r+"="+o)}})),c=p.join("&")}var h={url:this.apiUrl+"/"+n+"/"+i+"/metadata/user/"+this.user,type:"PUT",data:c,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/x-www-form-urlencoded"}};return v.ajax(h)}function Fe(e,t){if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c=[];if("string"==typeof e)c=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");c=e}o="string"==typeof t?[t]:"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var p={url:this.apiUrl+"/"+i+"/"+s+"/metadata/user/get",type:"POST",data:JSON.stringify({targets:c,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return v.ajax(p)}function He(e){if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return v.ajax(s)}function qe(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "agoraToken"');var t=this.context,r=t.orgName,o=t.appName,n={url:this.apiUrl+"/"+r+"/"+o+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return v.ajax(n)}function Je(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!Me.call(t)){var n=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=t.count||20,i=this;ze.call(this,{count:n,isGroup:!!t.isGroup,queue:t.queue,start:t.start,success:function(o){if(o.msgs.length>=n||o.is_last){var s=o.msgs.splice(0,n).reverse();t.success&&t.success(s),r(s)}else e.call(i,je(je({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e)}))}function ze(e){var t=this,r=e.queue,o=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),n=this.context.userId,i=e.start||-1,s=e.count||20;if(o.msgs.length>=s||o.is_last)"function"==typeof e.success&&e.success(o);else{o&&o.next_key&&(i=o.next_key),e.start&&(i=e.start);var a={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},c=this.context,p=c.orgName,h=c.appName,d=function(r){if(r.error&&r.error_description){var o=u.create({type:l.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:"fetch history messages error",data:r});t.onError&&t.onError(o)}"function"==typeof e.fail&&e.fail(d)},f={url:this.apiUrl+"/"+p+"/"+h+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token},data:JSON.stringify(a),success:function(r){var n=null==r?void 0:r.data;if(!r.data.msgs)return"function"==typeof e.success&&e.success(o),o.is_last=!0,void(o.next_key="");var i=n.msgs,s=i.length;o.is_last=n.is_last,o.next_key=n.next_key;for(var a=function(e){for(var r=[],o=0,n=(e=_().atob(e)).length;o<n;++o)r.push(e.charCodeAt(o));var i=t.context.root.lookup("easemob.pb.Meta");if(1==(i=i.decode(r)).ns)return V.call(t,i,{errorCode:0,reason:""},!0)},c=0;c<s;c++){var u=a(i[c].msg);u&&o.msgs.push(u)}"function"==typeof e.success&&e.success(o)},error:d};v.ajax(f)}}function Ve(e,t){var r={id:this.getUniqueId(),to:e,message:t};$.operatRoster.call(this,r,"add")}function Ke(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"remove")}function Xe(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"accept")}var $e=Xe;function Ye(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"decline")}var Ze=Ye;function Qe(e){$.operatRoster.call(this,{to:e.name},"ban")}var et=Qe;function rt(e){$.operatRoster.call(this,{to:e.name},"allow")}var ot=rt;function nt(e){$.operatRoster.call(this,e,"add")}function it(e){$.operatRoster.call(this,e,"accept")}function st(e){$.operatRoster.call(this,e,"decline")}function at(e){$.operatRoster.call(this,e,"remove")}function ct(e){var t=this.getUniqueId(),r={id:t,to:e.to};this._msgHash[t]=je({},r);var o="";void 0!==e.chatType?o=e.chatType:void 0!==e.type&&(o="chat"==e.type?"singleChat":e.type);var n={id:t,type:"recall",chatType:o,ackId:e.mid,to:e.to,success:e.success,fail:e.fail};return this.mSync.send(n,this)}function ut(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,desc:e.data.groupname,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:function(r){e.success&&e.success(r),t.onCreateGroup&&t.onCreateGroup(r)},error:e.error};return v.ajax(a)}var pt=ut;function lt(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},c={type:"PUT",url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user,data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var ht=lt;function dt(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.limit,cursor:e.cursor};e.cursor||delete s.cursor;var a={url:this.apiUrl+"/"+o+"/"+n+"/publicchatgroups",type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function ft(e){if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return v.ajax(s)}function mt(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return v.ajax(a)}var yt=mt;function gt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function vt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={groupname:e.groupName,description:e.description},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Et(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var _t=Et;function Tt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function It(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={newadmin:e.username},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Ot=It;function Nt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function bt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var St=bt;function Rt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Ct(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var wt=Ct;function At(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!0,reason:"no clue"},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var xt=kt;function Mt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var jt=Mt;function Ut(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!0},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Pt=Ut;function Lt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!1},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Bt=Lt;function Dt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Gt=Dt;function Wt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.users.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Ft=Wt;function Ht(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:[e.username],mute_duration:e.muteDuration},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return v.ajax(c)}var qt=Ht;function Jt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var zt=Jt;function Vt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var Kt=Vt;function Xt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var $t=Xt;function Yt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.usernames},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Zt=Yt;function Qt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var er=Qt;function tr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.usernames.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var rr=tr;function or(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var nr=or;function ir(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function ar(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.users},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function cr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var ur=cr;function pr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function lr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var hr=lr;function dr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+i},success:e.success,error:e.error};return v.ajax(s)}function fr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function mr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={announcement:e.announcement},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function yr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Me.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.groupId;v.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatgroups/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey})}}function gr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.fileId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function vr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Er(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},data:o,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:l.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return v.ajax(c)}function _r(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,s=(o.accessToken,{url:this.apiUrl+"/"+n+"/"+i+"/chatrooms",dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+e.token||0,"Content-Type":"application/json"},success:e.success,error:e.error});return v.ajax(s)}function Tr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,{url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+e.token||0},success:e.success,error:e.error});return v.ajax(i)}function Ir(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Or(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Nr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var br=Nr;function Sr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Rr=Sr;function Cr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function wr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.roomId+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Ar(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.roomId+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+s},success:function(r){t._load_msg_cache=t._load_msg_cache.filter((function(t){return(!t.isGroup||t.to!==e.roomId)&&t})),"function"==typeof e.success&&e.success(r)},error:e.error};return v.ajax(a)}function kr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var xr=kr;function Mr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function jr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={newadmin:e.username},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Ur(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Pr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:[e.username],mute_duration:e.muteDuration},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return v.ajax(c)}function Lr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Br=Lr;function Dr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var Gr=Dr;function Wr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Fr=Wr;function Hr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.usernames},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var qr=Hr;function Jr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var zr=Jr;function Vr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.usernames.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}var Kr=Vr;function Xr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var $r=Xr;function Yr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Zr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Qr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.users},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function eo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var to=eo;function ro(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function oo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function no(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function io(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={announcement:e.announcement},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function so(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Me.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.roomId;v.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatrooms/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey})}}function ao(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a=e.fileId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function co(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Me.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return v.ajax(a)}var uo=function(){return uo=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},uo.apply(this,arguments)},po=v.getEnvInfo(),lo=function(){};function ho(e){var t=this,r=e.success||lo,o=e.error||lo;if(!this.orgName&&!this.appName){var n=u.create({type:l.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"signup error"});return o(n),Promise.reject(n)}var i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""}),success:r,error:function(r){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,To.call(t,"signup"),ho.call(t,e),Promise.reject(r)):(t.clear(),o(r))}};return v.ajax(i).catch((function(e){console.warn(e)}))}function fo(e){var t=this;if(vo.call(this,e)&&(Eo.call(this,e),!this.isOpened())){if(this.user=e.user,e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(r){k.info("getChatToken result:",r),Date.now(),t.expirationTime=r.expire_timestamp,t.token=r.access_token,t.context.accessToken=r.access_token,t.context.restTokenData=r.access_token,go.call(t,uo(uo({},e),{access_token:r.access_token}))})).catch((function(e){t.onError&&t.onError({type:l.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e})}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,go.call(this,e);else{this.grantType="password";var r={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},o=JSON.stringify(r),n={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:o,success:function(r){"function"==typeof e.success&&e.success(r),t.token=r.access_token,t.context.restTokenData=r.access_token,t.context.accessToken=r.access_token,go.call(t,r)}||lo,error:function(r){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,To.call(t,"login"),void fo.call(t,e)):(t.clear(),r.error&&r.error_description?(o=u.create({type:l.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:r.error_description,data:r}),t.onError&&t.onError(o)):(o=u.create({type:l.WEBIM_CONNCTION_OPEN_ERROR,message:"login failed",data:r}),t.onError&&t.onError(o)),"function"==typeof e.error&&e.error(o),Promise.reject(o));var o}||lo,version:"4.0.0"};v.ajax(n).catch((function(e){console.warn(e)}))}v.listenNetwork(mo.bind(this),yo.bind(this))}}function mo(){k.debug("online"),this.sock&&1!==this.sock.readyState&&(k.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function yo(){k.debug("offline")}function go(e){var t=this,r=this._getSock();this.sock=r;var o=function(){t.logOut=!1;var e=v.flow([t.mSync.generateProvision,t.mSync.base64transform])();try{r.send(e)}catch(e){var o=u.create({type:l.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(o)}},n=function(){var e,r;if(!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var o={type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(o)}else t.logOut?(t.clear(),t.onClosed&&t.onClosed(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onDisconnected"),t.mSync.stopHeartBeat(),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0):(o={type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.onError&&t.onError(o),t.onClosed&&t.onClosed(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onDisconnected"),t.mSync.stopHeartBeat(),k.debug("reconnect fail"),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0)},i=function(e){var r=t.mSync,o=r.decodeMSync,n=r.distributeMSync;v.flow([o,n])(e)};"web"===po.platform?(r.onopen=o,r.onclose=n,r.onmessage=i):(r.onOpen(o),r.onMessage(i),r.onClose(n),r.onError((function(e){k.debug("小程序 sock on error",e),t.isOnCloseReconnet=!1,t.onError&&t.onError({type:l.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax&&(k.debug("----- sock.onError reconnect -----",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect())})))}function vo(e){if(""===e.user){var t=u.create({type:l.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user cannot be empty"});return this.onError&&this.onError(t),!1}var r=this.appKey.split("#");return!(2!==r.length||!r[0]||!r[1])||(t=u.create({type:l.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function Eo(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource};var t=this.appKey.split("#"),r=t[0],o=t[1];this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=o,this.context.orgName=r}function _o(e,t){var r=this,o={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(this.appKey)},success:function(o){var n=o.rest.hosts,i=r.https?"https":"http";if(k.info("httpType: "+i),!n)return Promise.reject(!1);for(var s=n.filter((function(e){if(e.protocol===i)return e})),a=0;a<s.length;a++)if(s[a].protocol===i){var c=s[a];s.splice(a,1),s.unshift(c)}r.restHosts=s,r.restTotal=s.length;var u=o["msync-ws"].hosts;if(!u)return Promise.reject(!1);var p=u.filter((function(e){return e.protocol===i&&e}));r.socketHost=p,r.hostTotal=p.length,To.call(r,e),"login"===e?fo.call(r,t):ho.call(r,t)}||lo,error:function(t){k.debug("getHttpDNS fail: "+r.dnsIndex),r.dnsIndex++,r.dnsIndex<r.dnsTotal&&_o.call(r,e)}||lo};return v.ajax(o).catch((function(e){console.warn(e)}))}function To(e){if(this.restIndex>this.restTotal)return"";var t="",r=this.restHosts[this.restIndex],o=r.domain,n=r.ip,i=r.port,s=this.https?"https:":"http:";return n&&"undefined"!=typeof window&&"http:"===(null===window||void 0===window?void 0:window.location.protocol)?t=s+"//"+n+":"+i:(t=s+"//"+o,i&&"80"!==i&&"443"!==i&&(t+=":"+i),"undefined"==typeof window||window.location||(t="https://"+o),"undefined"!=typeof window&&window.location&&"file:"===window.location.protocol&&(t="https://"+o)),"undefined"==typeof window&&(t=s+"//"+o),this.apiUrl=t,t}const Io=function(){function o(n){var i;this.isHttpDNS=!0,this.isDebug=n.isDebug||!1,this.isHttpDNS=void 0===n.isHttpDNS||n.isHttpDNS,this.heartBeatWait=n.heartBeatWait||3e4,this.autoReconnectNumMax=n.autoReconnectNumMax||5,this.delivery=n.delivery||!1,this.dnsArr=["https://rs.easemob.com","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.appKey=n.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=n.apiUrl||"",this.url=n.url||"",this.https=n.https||"undefined"!=typeof window&&"https:"===(null===(i=window.location)||void 0===i?void 0:i.protocol),this.version="4.0.1",this.deviceId=n.deviceId||"webim",this.osType=16,this.useOwnUploadFun=n.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unSendMsgArr=[],this.mr_cache={};var s=this.appKey.split("#");if(2!==s.length&&s[0]&&s[1])throw Error("Illegal appkey: "+this.appKey);this.orgName=s[0],this.appName=s[1],this.listen=Ae.bind(this),this.mSync=this.usePlugin(Se),this.eventHandler=this.usePlugin(Ce),Object.assign(o.prototype,e),Object.assign(o.prototype,t),Object.assign(o.prototype,r)}return o.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},o.prototype.listen=function(e){},o.prototype.addEventHandler=function(e,t){},o.prototype.removeEventHandler=function(e){},o.prototype.registerUser=function(e){if(this.isHttpDNS){this.dnsIndex=0;var t=uo(uo({},e),{user:e.username,pwd:e.password});return _o.call(this,"signup",t)}return ho.call(this,e)},o.prototype.open=function(e){k.debug("open"),e.accessToken&&(this.token=e.accessToken),this.isHttpDNS?_o.call(this,"login",e):fo.call(this,e)},o.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},o.prototype.close=function(){this.logOut=!0,this.context.status=l.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=l.STATUS_CLOSED},o.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},o.prototype._checkOpenParams=function(e){return vo.call(this,e)},o.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},o.prototype.heartBeat=function(){},o.prototype.getChatToken=function(e){var t=this.context.appName,r=this.context.orgName,o={url:this.apiUrl+"/"+r+"/"+t+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return v.ajax(o)},o.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getChatToken(e).then((function(e){var r=Date.now();return t.expirationTime=e.expire_timestamp,t.expiresIn=e.expire_timestamp-r,t.token=e.access_token,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e.access_token,expire:e.expire_timestamp}})):Promise.reject({status:!1})},o.prototype.clearTokenTimeout=function(){k.debug("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer)},o.prototype.tokenExpireTimeCountDown=function(e){var t=this;this.tokenWillExpireTimer=setTimeout((function(){var e;t.onTokenWillexpire&&t.onTokenWillexpire(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenWillExpire"),k.info("onTokenWillExpire")}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;k.info("onTokenExpired"),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},o.prototype.compareTokenExpireTime=function(e,t){var r,o=Number(t)-Number(e);k.debug("compareTokenExpireTime",o),o<=this.expiresIn/2&&o>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),k.info("onTokenWillExpire")):o<=0&&(this.closeByTokenExpired(),k.info("closeByTokenExpired"))},o.prototype.closeByTokenExpired=function(){var e;k.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},o.prototype.reconnect=function(){var e=this;k.info("reconnect: time",this.times),k.info("reconnect sock.readyState: ",this.sock.readyState),0!==this.sock.readyState&&1!==this.sock.readyState&&(this.isHttpDNS&&(this.hostIndex,this.socketHost.length),this.hostIndex++,this.hostIndex>=this.socketHost.length-1&&(this.hostIndex=this.socketHost.length-1),setTimeout((function(){k.info("login sock.readyState: ",e.sock.readyState),e.sock.close(),1!==e.sock.readyState&&(go.call(e,{access_token:e.context.accessToken}),e.autoReconnectInterval+=e.times*e.times,e.times++)}),500*this.times),this.autoReconnectNumTotal++)},o.prototype.send=function(e){return Promise.resolve(null)},o.max_cache_length=100,o._getSock=function(){},o}();s().util.Long=c(),s().configure();var Oo=s().Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8}},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,CHANNEL_ACK:7}},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,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14}},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}}}}}}}}}});Io.prototype.root=Oo;var No=k.getLogger("IM-SDK-LOG");No.setConfig({useCache:!1,maxCache:3145728}),No.enableAll(),Io.prototype._getSock=function(){if(this.isHttpDNS){var e=this.socketHost[this.hostIndex];if(!e)return this.autoReconnectInterval=0,this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0,this.onClosed&&this.onClosed();var t=e.domain,r=e.ip,o="",i=e.port;o=t||r,i&&"80"!==i&&"443"!==i&&(o+=":"+i),o&&(this.url="//"+o+"/ws");var s=this.https?"https:":"http:";this.url=s+this.url}return new(n())(this.url)},Io.prototype.getUniqueId=v.getUniqueId;var bo={connection:Io,message:H,utils:v,logger:k,statusCode:l};"undefined"!=typeof window&&(window.WebIM=bo);const So=bo})(),__webpack_exports__})()}));
|
|
2
|
+
!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()}(self,(function(){return(()=>{var __webpack_modules__={4537:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise((function(n,s){r[o]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},7419:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var o=new Array(64),n=new Array(123),i=0;i<64;)n[o[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var n,i=null,s=[],a=0,c=0;t<r;){var u=e[t++];switch(c){case 0:s[a++]=o[u>>2],n=(3&u)<<4,c=1;break;case 1:s[a++]=o[n|u>>4],n=(15&u)<<2,c=2;break;case 2:s[a++]=o[n|u>>6],s[a++]=o[63&u],c=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return c&&(s[a++]=o[n],s[a++]=61,1===c&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var s="invalid encoding";r.decode=function(e,t,r){for(var o,i=r,a=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&a>1)break;if(void 0===(u=n[u]))throw Error(s);switch(a){case 0:o=u,a=1;break;case 1:t[r++]=o<<2|(48&u)>>4,o=u,a=2;break;case 2:t[r++]=(15&o)<<4|(60&u)>>2,o=u,a=3;break;case 3:t[r++]=(3&o)<<6|u,a=0}}if(1===a)throw Error(s);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},5124:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var o=[];function n(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var s=Object.keys(e),a=new Array(s.length+1),c=new Array(s.length),u=0;u<s.length;)a[u]=s[u],c[u]=e[s[u++]];return a[u]=r,Function.apply(null,a).apply(null,c)}return Function(r)()}for(var p=new Array(arguments.length-1),l=0;l<p.length;)p[l]=arguments[++l];if(l=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=p[l++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),l!==p.length)throw Error("parameter count mismatch");return o.push(e),n}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+o.join("\n ")+"\n}"}return n.toString=i,n}e.exports=t,t.verbose=!1},9211:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],o=0;o<r.length;)r[o].fn===t?r.splice(o,1):++o;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],o=1;o<arguments.length;)r.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,r)}return this}},9054:(e,t,r)=>{"use strict";e.exports=i;var o=r(4537),n=r(7199)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&n&&n.readFile?n.readFile(e,(function(o,n){return o&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):o?r(o):r(null,t.binary?n:n.toString("utf8"))})):i.xhr(e,t,r):o(i,this,e,t)}i.xhr=function(e,t,r){var o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState){if(0!==o.status&&200!==o.status)return r(Error("status "+o.status));if(t.binary){var e=o.response;if(!e){e=[];for(var n=0;n<o.responseText.length;++n)e.push(255&o.responseText.charCodeAt(n))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,o.responseText)}},t.binary&&("overrideMimeType"in o&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.responseType="arraybuffer"),o.open("GET",e),o.send()}},945:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=128===r[3];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3]}function i(e,o,n){t[0]=e,o[n]=r[3],o[n+1]=r[2],o[n+2]=r[1],o[n+3]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],t[0]}function a(e,o){return r[3]=e[o],r[2]=e[o+1],r[1]=e[o+2],r[0]=e[o+3],t[0]}e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n,e.readFloatLE=o?s:a,e.readFloatBE=o?a:s}():function(){function t(e,t,r,o){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,o);else if(isNaN(t))e(2143289344,r,o);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,o);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,o)}}function s(e,t,r){var o=e(t,r),n=2*(o>>31)+1,i=o>>>23&255,s=8388607&o;return 255===i?s?NaN:n*(1/0):0===i?1401298464324817e-60*n*s:n*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o),e.readFloatLE=s.bind(null,n),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=128===r[7];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3],o[n+4]=r[4],o[n+5]=r[5],o[n+6]=r[6],o[n+7]=r[7]}function i(e,o,n){t[0]=e,o[n]=r[7],o[n+1]=r[6],o[n+2]=r[5],o[n+3]=r[4],o[n+4]=r[3],o[n+5]=r[2],o[n+6]=r[1],o[n+7]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],r[4]=e[o+4],r[5]=e[o+5],r[6]=e[o+6],r[7]=e[o+7],t[0]}function a(e,o){return r[7]=e[o],r[6]=e[o+1],r[5]=e[o+2],r[4]=e[o+3],r[3]=e[o+4],r[2]=e[o+5],r[1]=e[o+6],r[0]=e[o+7],t[0]}e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n,e.readDoubleLE=o?s:a,e.readDoubleBE=o?a:s}():function(){function t(e,t,r,o,n,i){var s=o<0?1:0;if(s&&(o=-o),0===o)e(0,n,i+t),e(1/o>0?0:2147483648,n,i+r);else if(isNaN(o))e(0,n,i+t),e(2146959360,n,i+r);else if(o>17976931348623157e292)e(0,n,i+t),e((s<<31|2146435072)>>>0,n,i+r);else{var a;if(o<22250738585072014e-324)e((a=o/5e-324)>>>0,n,i+t),e((s<<31|a/4294967296)>>>0,n,i+r);else{var c=Math.floor(Math.log(o)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(a=o*Math.pow(2,-c))>>>0,n,i+t),e((s<<31|c+1023<<20|1048576*a&1048575)>>>0,n,i+r)}}}function s(e,t,r,o,n){var i=e(o,n+t),s=e(o,n+r),a=2*(s>>31)+1,c=s>>>20&2047,u=4294967296*(1048575&s)+i;return 2047===c?u?NaN:a*(1/0):0===c?5e-324*a*u:a*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=s.bind(null,n,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},7199:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},8626:(e,t)=>{"use strict";var r=t,o=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=o(e),n="";r&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};r.resolve=function(e,t,r){return r||(t=n(t)),o(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},6662:e=>{"use strict";e.exports=function(e,t,r){var o=r||8192,n=o>>>1,i=null,s=o;return function(r){if(r<1||r>n)return e(r);s+r>o&&(i=e(o),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},4997:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var o,n=null,i=[],s=0;t<r;)(o=e[t++])<128?i[s++]=o:o>191&&o<224?i[s++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(o>>10),i[s++]=56320+(1023&o)):i[s++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))},r.write=function(e,t,r){for(var o,n,i=r,s=0;s<e.length;++s)(o=e.charCodeAt(s))<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&56320==(64512&(n=e.charCodeAt(s+1)))?(o=65536+((1023&o)<<10)+(1023&n),++s,t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128);return r-i}},4188:(e,t,r)=>{var o,n,i;!function(s){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=s();else if(null!=r.amdO)n=[],void 0===(i="function"==typeof(o=s)?o.apply(t,n):o)||(e.exports=i);else{var a=s(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=a.btoa),"function"!=typeof c.atob&&(c.atob=a.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var o,n,i=String(r),s=0,a=e,c="";i.charAt(0|s)||(a="=",s%1);c+=a.charAt(63&o>>8-s%1*8)){if((n=i.charCodeAt(s+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c},atob:function(r){var o=String(r).replace(/[=]+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,c="";i=o.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?c+=String.fromCharCode(255&n>>(-2*s&6)):0)i=e.indexOf(i);return c}}}))},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7522:function(e,t,r){var o;e=r.nmd(e),function(){var n=r.amdO,i={function:!0,object:!0},s=i[typeof t]&&t&&!t.nodeType&&t,a=i[typeof window]&&window||this,c=s&&i.object&&e&&!e.nodeType&&"object"==typeof r.g&&r.g;function u(e,t){e||(e=a.Object()),t||(t=a.Object());var r=e.Number||a.Number,o=e.String||a.String,n=e.Object||a.Object,s=e.Date||a.Date,c=e.SyntaxError||a.SyntaxError,p=e.TypeError||a.TypeError,l=e.Math||a.Math,h=e.JSON||a.JSON;"object"==typeof h&&h&&(t.stringify=h.stringify,t.parse=h.parse);var d,f=n.prototype,m=f.toString,y=f.hasOwnProperty;function g(e,t){try{e()}catch(e){t&&t()}}var v=new s(-0xc782b5b800cec);function E(e){if(null!=E[e])return E[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=E("json-stringify")&&E("date-serialization")&&E("json-parse");else if("date-serialization"==e){if(n=E("json-stringify")&&v){var i=t.stringify;g((function(){n='"-271821-04-20T00:00:00.000Z"'==i(new s(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==i(new s(864e13))&&'"-000001-01-01T00:00:00.000Z"'==i(new s(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==i(new s(-1))}))}}else{var a,c='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u="function"==typeof(i=t.stringify);u&&((a=function(){return 1}).toJSON=a,g((function(){u="0"===i(0)&&"0"===i(new r)&&'""'==i(new o)&&i(m)===d&&i(d)===d&&i()===d&&"1"===i(a)&&"[1]"==i([a])&&"[null]"==i([d])&&"null"==i(null)&&"[null,null,null]"==i([d,m,null])&&i({a:[a,!0,!1,null,"\0\b\n\f\r\t"]})==c&&"1"===i(null,a)&&"[\n 1,\n 2\n]"==i([1,2],null,1)}),(function(){u=!1}))),n=u}if("json-parse"==e){var p,l=t.parse;"function"==typeof l&&g((function(){0!==l("0")||l(!1)||(a=l(c),(p=5==a.a.length&&1===a.a[0])&&(g((function(){p=!l('"\t"')})),p&&g((function(){p=1!==l("01")})),p&&g((function(){p=1!==l("1.")}))))}),(function(){p=!1})),n=p}}return E[e]=!!n}if(g((function(){v=-109252==v.getUTCFullYear()&&0===v.getUTCMonth()&&1===v.getUTCDate()&&10==v.getUTCHours()&&37==v.getUTCMinutes()&&6==v.getUTCSeconds()&&708==v.getUTCMilliseconds()})),E["bug-string-char-index"]=E["date-serialization"]=E.json=E["json-stringify"]=E["json-parse"]=null,!E("json")){var _="[object Function]",T="[object Number]",I="[object String]",b="[object Array]",O=E("bug-string-char-index"),N=function(e,t){var r,o,n,s=0;for(n in(r=function(){this.valueOf=0}).prototype.valueOf=0,o=new r)y.call(o,n)&&s++;return r=o=null,s?N=function(e,t){var r,o,n=m.call(e)==_;for(r in e)n&&"prototype"==r||!y.call(e,r)||(o="constructor"===r)||t(r);(o||y.call(e,r="constructor"))&&t(r)}:(o=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],N=function(e,t){var r,n,s=m.call(e)==_,a=!s&&"function"!=typeof e.constructor&&i[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(r in e)s&&"prototype"==r||!a.call(e,r)||t(r);for(n=o.length;r=o[--n];)a.call(e,r)&&t(r)}),N(e,t)};if(!E("json-stringify")&&!E("date-serialization")){var S={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},R=function(e,t){return("000000"+(t||0)).slice(-e)},w=function(e){var t,r,o,n,i,s,a,c,u;if(v)t=function(e){r=e.getUTCFullYear(),o=e.getUTCMonth(),n=e.getUTCDate(),s=e.getUTCHours(),a=e.getUTCMinutes(),c=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var p=l.floor,h=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return h[t]+365*(e-1970)+p((e-1969+(t=+(t>1)))/4)-p((e-1901+t)/100)+p((e-1601+t)/400)};t=function(e){for(n=p(e/864e5),r=p(n/365.2425)+1970-1;d(r+1,0)<=n;r++);for(o=p((n-d(r,0))/30.42);d(r,o+1)<=n;o++);n=1+n-d(r,o),s=p((i=(e%864e5+864e5)%864e5)/36e5)%24,a=p(i/6e4)%60,c=p(i/1e3)%60,u=i%1e3}}return w=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+R(6,r<0?-r:r):R(4,r))+"-"+R(2,o+1)+"-"+R(2,n)+"T"+R(2,s)+":"+R(2,a)+":"+R(2,c)+"."+R(3,u)+"Z",r=o=n=s=a=c=u=null):e=null,e},w(e)};if(E("json-stringify")&&!E("date-serialization")){function C(e){return w(this)}var A=t.stringify;t.stringify=function(e,t,r){var o=s.prototype.toJSON;s.prototype.toJSON=C;var n=A(e,t,r);return s.prototype.toJSON=o,n}}else{var k=function(e){var t=e.charCodeAt(0);return S[t]||"\\u00"+R(2,t.toString(16))},x=/[\x00-\x1f\x22\x5c]/g,M=function(e){return x.lastIndex=0,'"'+(x.test(e)?e.replace(x,k):e)+'"'},j=function(e,t,r,o,n,i,a){var c,u,l,h,f,y,v,E,_;if(g((function(){c=t[e]})),"object"==typeof c&&c&&(c.getUTCFullYear&&"[object Date]"==m.call(c)&&c.toJSON===s.prototype.toJSON?c=w(c):"function"==typeof c.toJSON&&(c=c.toJSON(e))),r&&(c=r.call(t,e,c)),c==d)return c===d?c:"null";switch("object"==(u=typeof c)&&(l=m.call(c)),l||u){case"boolean":case"[object Boolean]":return""+c;case"number":case T:return c>-1/0&&c<1/0?""+c:"null";case"string":case I:return M(""+c)}if("object"==typeof c){for(v=a.length;v--;)if(a[v]===c)throw p();if(a.push(c),h=[],E=i,i+=n,l==b){for(y=0,v=c.length;y<v;y++)f=j(y,c,r,o,n,i,a),h.push(f===d?"null":f);_=h.length?n?"[\n"+i+h.join(",\n"+i)+"\n"+E+"]":"["+h.join(",")+"]":"[]"}else N(o||c,(function(e){var t=j(e,c,r,o,n,i,a);t!==d&&h.push(M(e)+":"+(n?" ":"")+t)})),_=h.length?n?"{\n"+i+h.join(",\n"+i)+"\n"+E+"}":"{"+h.join(",")+"}":"{}";return a.pop(),_}};t.stringify=function(e,t,r){var o,n,s,a;if(i[typeof t]&&t)if((a=m.call(t))==_)n=t;else if(a==b){s={};for(var c,u=0,p=t.length;u<p;)c=t[u++],"[object String]"!=(a=m.call(c))&&"[object Number]"!=a||(s[c]=1)}if(r)if((a=m.call(r))==T){if((r-=r%1)>0)for(r>10&&(r=10),o="";o.length<r;)o+=" "}else a==I&&(o=r.length<=10?r:r.slice(0,10));return j("",((c={})[""]=e,c),n,s,o,"",[])}}}if(!E("json-parse")){var U,P,B=o.fromCharCode,L={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},D=function(){throw U=P=null,c()},G=function(){for(var e,t,r,o,n,i=P,s=i.length;U<s;)switch(n=i.charCodeAt(U)){case 9:case 10:case 13:case 32:U++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=O?i.charAt(U):i[U],U++,e;case 34:for(e="@",U++;U<s;)if((n=i.charCodeAt(U))<32)D();else if(92==n)switch(n=i.charCodeAt(++U)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=L[n],U++;break;case 117:for(t=++U,r=U+4;U<r;U++)(n=i.charCodeAt(U))>=48&&n<=57||n>=97&&n<=102||n>=65&&n<=70||D();e+=B("0x"+i.slice(t,U));break;default:D()}else{if(34==n)break;for(n=i.charCodeAt(U),t=U;n>=32&&92!=n&&34!=n;)n=i.charCodeAt(++U);e+=i.slice(t,U)}if(34==i.charCodeAt(U))return U++,e;D();default:if(t=U,45==n&&(o=!0,n=i.charCodeAt(++U)),n>=48&&n<=57){for(48==n&&(n=i.charCodeAt(U+1))>=48&&n<=57&&D(),o=!1;U<s&&(n=i.charCodeAt(U))>=48&&n<=57;U++);if(46==i.charCodeAt(U)){for(r=++U;r<s&&!((n=i.charCodeAt(r))<48||n>57);r++);r==U&&D(),U=r}if(101==(n=i.charCodeAt(U))||69==n){for(43!=(n=i.charCodeAt(++U))&&45!=n||U++,r=U;r<s&&!((n=i.charCodeAt(r))<48||n>57);r++);r==U&&D(),U=r}return+i.slice(t,U)}o&&D();var a=i.slice(U,U+4);if("true"==a)return U+=4,!0;if("fals"==a&&101==i.charCodeAt(U+4))return U+=5,!1;if("null"==a)return U+=4,null;D()}return"$"},W=function(e){var t,r;if("$"==e&&D(),"string"==typeof e){if("@"==(O?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=G());)r?","==e?"]"==(e=G())&&D():D():r=!0,","==e&&D(),t.push(W(e));return t}if("{"==e){for(t={};"}"!=(e=G());)r?","==e?"}"==(e=G())&&D():D():r=!0,","!=e&&"string"==typeof e&&"@"==(O?e.charAt(0):e[0])&&":"==G()||D(),t[e.slice(1)]=W(G());return t}D()}return e},F=function(e,t,r){var o=H(e,t,r);o===d?delete e[t]:e[t]=o},H=function(e,t,r){var o,n=e[t];if("object"==typeof n&&n)if(m.call(n)==b)for(o=n.length;o--;)F(m,N,n);else N(n,(function(e){F(n,e,r)}));return r.call(e,t,n)};t.parse=function(e,t){var r,o;return U=0,P=""+e,r=W(G()),"$"!=G()&&D(),U=P=null,t&&m.call(t)==_?H(((o={})[""]=r,o),"",t):r}}}return t.runInContext=u,t}if(!c||c.global!==c&&c.window!==c&&c.self!==c||(a=c),s&&!n)u(a,s);else{var p=a.JSON,l=a.JSON3,h=!1,d=u(a,a.JSON3={noConflict:function(){return h||(h=!0,a.JSON=p,a.JSON3=l,p=l=null),d}});a.JSON={parse:d.parse,stringify:d.stringify}}n&&(void 0===(o=function(){return d}.call(t,r,t,e))||(e.exports=o))}.call(this)},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=c(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=c(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?g:y;if(t){if(e<0)return g;if(e>=d)return I}else{if(e<=-f)return b;if(e+1>=f)return T}return e<0?a(-e,t).neg():c(e%h|0,e/h|0,t)}function c(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=c;var u=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(u(r,8)),i=y,s=0;s<e.length;s+=8){var c=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+c),r);if(c<8){var h=a(u(r,c));i=i.mul(h).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var h=4294967296,d=h*h,f=d/2,m=s(1<<24),y=s(0);r.ZERO=y;var g=s(0,!0);r.UZERO=g;var v=s(1);r.ONE=v;var E=s(1,!0);r.UONE=E;var _=s(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var b=c(0,-2147483648,!1);r.MIN_VALUE=b;var O=r.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},O.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(b)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(u(e,6),this.unsigned),i=this,s="";;){var c=i.div(n),p=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(b)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},O.isZero=function(){return 0===this.high&&0===this.low},O.eqz=O.isZero,O.isNegative=function(){return!this.unsigned&&this.high<0},O.isPositive=function(){return this.unsigned||this.high>=0},O.isOdd=function(){return 1==(1&this.low)},O.isEven=function(){return 0==(1&this.low)},O.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},O.eq=O.equals,O.notEquals=function(e){return!this.eq(e)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(e){return this.comp(e)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(e){return this.comp(e)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(e){return this.comp(e)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(e){return this.comp(e)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(e){if(o(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(b)?b:this.not().add(v)},O.neg=O.negate,O.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,u=e.low>>>16,p=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+u)>>>16,p+=(h+=r+a)>>>16,p+=t+s,c((d&=65535)<<16|(f&=65535),(p&=65535)<<16|(h&=65535),this.unsigned)},O.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},O.sub=O.subtract,O.multiply=function(e){if(this.isZero())return y;if(o(e)||(e=l(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(b))return e.isOdd()?b:y;if(e.eq(b))return this.isOdd()?b:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,u=e.high>>>16,p=65535&e.high,h=e.low>>>16,d=65535&e.low,f=0,g=0,v=0,E=0;return v+=(E+=s*d)>>>16,g+=(v+=i*d)>>>16,v&=65535,g+=(v+=s*h)>>>16,f+=(g+=n*d)>>>16,g&=65535,f+=(g+=i*h)>>>16,g&=65535,f+=(g+=s*p)>>>16,f+=r*d+n*h+i*p+s*u,c((v&=65535)<<16|(E&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(b))return e.eq(v)||e.eq(_)?b:e.eq(b)?v:(r=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?v:_:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(b))return this.unsigned?g:y;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=y}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:u(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=p,this.unsigned)).mul(e);h.isZero()&&(h=v),i=i.add(h),n=n.sub(d)}return i},O.div=O.divide,O.modulo=function(e){return o(e)||(e=l(e)),t?c((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return c(~this.low,~this.high,this.unsigned)},O.and=function(e){return o(e)||(e=l(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},O.or=function(e){return o(e)||(e=l(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},O.xor=function(e){return o(e)||(e=l(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},O.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},O.shl=O.shiftLeft,O.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},O.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]},O.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},3281:(e,t,r)=>{"use strict";e.exports=r(9050)},2967:e=>{"use strict";e.exports=o;var t,r=/\/|\./;function o(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:t}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},3996:(e,t,r)=>{"use strict";var o=t,n=r(7025),i=r(9935);function s(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",o);for(var i=t.resolvedType.values,s=Object.keys(i),a=0;a<s.length;++a)t.repeated&&i[s[a]]===t.typeDefault&&e("default:"),e("case%j:",s[a])("case %i:",i[s[a]])("m%s=%j",o,i[s[a]])("break");e("}")}else e('if(typeof d%s!=="object")',o)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",o,r,o);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",o,o);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",o,o);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",o,o);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",o,o,c)('else if(typeof d%s==="string")',o)("m%s=parseInt(d%s,10)",o,o)('else if(typeof d%s==="number")',o)("m%s=d%s",o,o)('else if(typeof d%s==="object")',o)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",o,o,o,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',o)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",o,o,o)("else if(d%s.length)",o)("m%s=d%s",o,o);break;case"string":e("m%s=String(d%s)",o,o);break;case"bool":e("m%s=Boolean(d%s)",o,o)}}return e}function a(e,t,r,o){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",o,r,o,o):e("d%s=types[%i].toObject(m%s,o)",o,r,o);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",o,o,o,o);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',o)("d%s=o.longs===String?String(m%s):m%s",o,o,o)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",o,o,o,o,i?"true":"",o);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",o,o,o,o,o);break;default:e("d%s=m%s",o,o)}}return e}o.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var o=0;o<t.length;++o){var a=t[o].resolve(),c=i.safeProp(a.name);a.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),s(r,a,o,c+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),s(r,a,o,c+"[i]")("}")("}")):(a.resolvedType instanceof n||r("if(d%s!=null){",c),s(r,a,o,c),a.resolvedType instanceof n||r("}"))}return r("return m")},o.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),o=[],s=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?o:t[u].map?s:c).push(t[u]);if(o.length){for(r("if(o.arrays||o.defaults){"),u=0;u<o.length;++u)r("d%s=[]",i.safeProp(o[u].name));r("}")}if(s.length){for(r("if(o.objects||o.defaults){"),u=0;u<s.length;++u)r("d%s={}",i.safeProp(s[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var p=c[u],l=i.safeProp(p.name);if(p.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",l,p.resolvedType.valuesById[p.typeDefault],p.typeDefault);else if(p.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",p.typeDefault.low,p.typeDefault.high,p.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",l)("}else")("d%s=o.longs===String?%j:%i",l,p.typeDefault.toString(),p.typeDefault.toNumber());else if(p.bytes){var h="["+Array.prototype.slice.call(p.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",l,String.fromCharCode.apply(String,p.typeDefault))("else{")("d%s=%s",l,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",l,l)("}")}else r("d%s=%j",l,p.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){p=t[u];var f=e._fieldsArray.indexOf(p);l=i.safeProp(p.name),p.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",l,l)("d%s={}",l)("for(var j=0;j<ks2.length;++j){"),a(r,p,f,l+"[ks2[j]]")("}")):p.repeated?(r("if(m%s&&m%s.length){",l,l)("d%s=[]",l)("for(var j=0;j<m%s.length;++j){",l),a(r,p,f,l+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",l,p.name),a(r,p,f,l),p.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(p.partOf.name),p.name)),r("}")}return r("return d")}},5305:(e,t,r)=>{"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),c=a.resolvedType instanceof o?"int32":a.type,u="m"+i.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[c]?t("value=%j",n.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==n.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===n.basic[c]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===n.basic[c]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var p=e._fieldsArray[r];p.required&&t("if(!m.hasOwnProperty(%j))",p.name)("throw util.ProtocolError(%j,{instance:m})",s(p))}return t("return m")};var o=r(7025),n=r(7063),i=r(9935);function s(e){return"missing required '"+e.name+"'"}},4928:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<a.length;++c){var u=a[c].resolve(),p=e._fieldsArray.indexOf(u),l=u.resolvedType instanceof o?"int32":u.type,h=n.basic[l];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|n.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",p,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,l,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[l]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",l,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,p,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,l,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,p,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,l,t))}return r("return w")};var o=r(7025),n=r(7063),i=r(9935);function s(e,t,r,o){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,o,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,o,(t.id<<3|2)>>>0)}},7025:(e,t,r)=>{"use strict";e.exports=s;var o=r(3243);((s.prototype=Object.create(o.prototype)).constructor=s).className="Enum";var n=r(9313),i=r(9935);function s(e,t,r,n,i){if(o.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}s.fromJSON=function(e,t){var r=new s(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},s.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},s.prototype.remove=function(e){if(!i.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},s.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},s.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},3548:(e,t,r)=>{"use strict";e.exports=u;var o=r(3243);((u.prototype=Object.create(o.prototype)).constructor=u).className="Field";var n,i=r(7025),s=r(7063),a=r(9935),c=/^required|optional|repeated$/;function u(e,t,r,n,i,u,p){if(a.isObject(n)?(p=i,u=n,n=i=void 0):a.isObject(i)&&(p=u,u=i,i=void 0),o.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==n&&!c.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!a.isString(i))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=r,this.id=t,this.extend=i||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==s.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),o.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=s.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?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=a.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;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),o.prototype.resolve.call(this)},u.d=function(e,t,r,o){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,i){a.decorateType(n.constructor).add(new u(i,e,t,r,{default:o}))}},u._configure=function(e){n=e}},8836:(e,t,r)=>{"use strict";var o=e.exports=r(9482);o.build="light",o.load=function(e,t,r){return"function"==typeof t?(r=t,t=new o.Root):t||(t=new o.Root),t.load(e,r)},o.loadSync=function(e,t){return t||(t=new o.Root),t.loadSync(e)},o.encoder=r(4928),o.decoder=r(5305),o.verifier=r(4497),o.converter=r(3996),o.ReflectionObject=r(3243),o.Namespace=r(9313),o.Root=r(9424),o.Enum=r(7025),o.Type=r(7645),o.Field=r(3548),o.OneOf=r(7598),o.MapField=r(6039),o.Service=r(7513),o.Method=r(4429),o.Message=r(8368),o.wrappers=r(1667),o.types=r(7063),o.util=r(9935),o.ReflectionObject._configure(o.Root),o.Namespace._configure(o.Type,o.Service,o.Enum),o.Root._configure(o.Type),o.Field._configure(o.Type)},9482:(e,t,r)=>{"use strict";var o=t;function n(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}o.build="minimal",o.Writer=r(1173),o.BufferWriter=r(3155),o.Reader=r(1408),o.BufferReader=r(593),o.util=r(9693),o.rpc=r(5994),o.roots=r(5054),o.configure=n,n()},9050:(e,t,r)=>{"use strict";var o=e.exports=r(8836);o.build="full",o.tokenize=r(626),o.parse=r(2228),o.common=r(2967),o.Root._configure(o.Type,o.parse,o.common)},6039:(e,t,r)=>{"use strict";e.exports=s;var o=r(3548);((s.prototype=Object.create(o.prototype)).constructor=s).className="MapField";var n=r(7063),i=r(9935);function s(e,t,r,n,s,a){if(o.call(this,e,t,n,void 0,void 0,s,a),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return o.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(o,n){i.decorateType(o.constructor).add(new s(n,e,t,r))}}},8368:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)}},4429:(e,t,r)=>{"use strict";e.exports=i;var o=r(3243);((i.prototype=Object.create(o.prototype)).constructor=i).className="Method";var n=r(9935);function i(e,t,r,i,s,a,c,u,p){if(n.isObject(s)?(c=s,s=a=void 0):n.isObject(a)&&(c=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(r))throw TypeError("requestType must be a string");if(!n.isString(i))throw TypeError("responseType must be a string");o.call(this,e,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=p}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.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,"parsedOptions",this.parsedOptions])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),o.prototype.resolve.call(this))}},9313:(e,t,r)=>{"use strict";e.exports=l;var o=r(3243);((l.prototype=Object.create(o.prototype)).constructor=l).className="Namespace";var n,i,s,a=r(3548),c=r(7598),u=r(9935);function p(e,t){if(e&&e.length){for(var r={},o=0;o<e.length;++o)r[e[o].name]=e[o].toJSON(t);return r}}function l(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}l.fromJSON=function(e,t){return new l(e,t.options).addJSON(t.nested)},l.arrayToJSON=p,l.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},l.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(l.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),l.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",p(this.nestedArray,e)])},l.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),o=0;o<r.length;++o)t=e[r[o]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?s.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?a.fromJSON:l.fromJSON)(r[o],t));return this},l.prototype.get=function(e){return this.nested&&this.nested[e]||null},l.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},l.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof s||e instanceof i||e instanceof l||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof l&&e instanceof l)||t instanceof n||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,o=0;o<r.length;++o)e.add(r[o]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},l.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},l.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var o=e.shift();if(r.nested&&r.nested[o]){if(!((r=r.nested[o])instanceof l))throw Error("path conflicts with non-namespace objects")}else r.add(r=new l(o))}return t&&r.addJSON(t),r},l.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof l?e[t++].resolveAll():e[t++].resolve();return this.resolve()},l.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof l&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof l&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},l.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},l.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},l.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,s]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},l.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},l._configure=function(e,t,r){n=e,i=t,s=r}},3243:(e,t,r)=>{"use strict";e.exports=i,i.className="ReflectionObject";var o,n=r(9935);function i(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof o&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof o&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof o&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var o=this.parsedOptions;if(r){var i=o.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var s=i[e];n.setProperty(s,r,t)}else(i={})[e]=n.setProperty({},r,t),o.push(i)}else{var a={};a[e]=t,o.push(a)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)this.setOption(r[o],e[r[o]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){o=e}},7598:(e,t,r)=>{"use strict";e.exports=s;var o=r(3243);((s.prototype=Object.create(o.prototype)).constructor=s).className="OneOf";var n=r(3548),i=r(9935);function s(e,t,r,n){if(Array.isArray(t)||(r=t,t=void 0),o.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){o.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);o.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},2228:(e,t,r)=>{"use strict";e.exports=O,O.filename=null,O.defaults={keepCase:!1};var o=r(626),n=r(9424),i=r(7645),s=r(3548),a=r(6039),c=r(7598),u=r(7025),p=r(7513),l=r(4429),h=r(7063),d=r(9935),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,y=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,E=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,b=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function O(e,t,r){t instanceof n||(r=t,t=new n),r||(r=O.defaults);var N,S,R,w,C,A=r.preferTrailingComment||!1,k=o(e,r.alternateCommentMode||!1),x=k.next,M=k.push,j=k.peek,U=k.skip,P=k.cmnt,B=!0,L=!1,D=t,G=r.keepCase?function(e){return e}:d.camelCase;function W(e,t,r){var o=O.filename;return r||(O.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+k.line+")")}function F(){var e,t=[];do{if('"'!==(e=x())&&"'"!==e)throw W(e);t.push(x()),U(e),e=j()}while('"'===e||"'"===e);return t.join("")}function H(e){var t=x();switch(t){case"'":case'"':return M(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return r*parseInt(e,10);if(y.test(e))return r*parseInt(e,16);if(v.test(e))return r*parseInt(e,8);if(_.test(e))return r*parseFloat(e);throw W(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw W(t,"value")}}function q(e,t){var r,o;do{!t||'"'!==(r=j())&&"'"!==r?e.push([o=z(x()),U("to",!0)?z(x()):o]):e.push(F())}while(U(",",!0));U(";")}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw W(e,"id");if(m.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(E.test(e))return parseInt(e,8);throw W(e,"id")}function J(){if(void 0!==N)throw W("package");if(N=x(),!I.test(N))throw W(N,"name");D=D.define(N),U(";")}function V(){var e,t=j();switch(t){case"weak":e=R||(R=[]),x();break;case"public":x();default:e=S||(S=[])}t=F(),U(";"),e.push(t)}function K(){if(U("="),w=F(),!(L="proto3"===w)&&"proto2"!==w)throw W(w,"syntax");U(";")}function $(e,t){switch(t){case"option":return Z(e,t),U(";"),!0;case"message":return function(e,t){if(!T.test(t=x()))throw W(t,"type name");var r=new i(t);X(r,(function(e){if(!$(r,e))switch(e){case"map":!function(e){U("<");var t=x();if(void 0===h.mapKey[t])throw W(t,"type");U(",");var r=x();if(!I.test(r))throw W(r,"type");U(">");var o=x();if(!T.test(o))throw W(o,"name");U("=");var n=new a(G(o),z(x()),t,r);X(n,(function(e){if("option"!==e)throw W(e);Z(n,e),U(";")}),(function(){te(n)})),e.add(n)}(r);break;case"required":case"repeated":Y(r,e);break;case"optional":Y(r,L?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=x()))throw W(t,"name");var r=new c(G(t));X(r,(function(e){"option"===e?(Z(r,e),U(";")):(M(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":q(r.extensions||(r.extensions=[]));break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:if(!L||!I.test(e))throw W(e);M(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=x()))throw W(t,"name");var r=new u(t);X(r,(function(e){switch(e){case"option":Z(r,e),U(";");break;case"reserved":q(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw W(t,"name");U("=");var r=z(x(),!0),o={};X(o,(function(e){if("option"!==e)throw W(e);Z(o,e),U(";")}),(function(){te(o)})),e.add(t,r,o.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=x()))throw W(t,"service name");var r=new p(t);X(r,(function(e){if(!$(r,e)){if("rpc"!==e)throw W(e);!function(e,t){var r=P(),o=t;if(!T.test(t=x()))throw W(t,"name");var n,i,s,a,c=t;if(U("("),U("stream",!0)&&(i=!0),!I.test(t=x()))throw W(t);if(n=t,U(")"),U("returns"),U("("),U("stream",!0)&&(a=!0),!I.test(t=x()))throw W(t);s=t,U(")");var u=new l(c,o,n,s,i,a);u.comment=r,X(u,(function(e){if("option"!==e)throw W(e);Z(u,e),U(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=x()))throw W(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":Y(e,t,r);break;case"optional":Y(e,L?"proto3_optional":"optional",r);break;default:if(!L||!I.test(t))throw W(t);M(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var o=k.line;if(e&&("string"!=typeof e.comment&&(e.comment=P()),e.filename=O.filename),U("{",!0)){for(var n;"}"!==(n=x());)t(n);U(";",!0)}else r&&r(),U(";"),e&&("string"!=typeof e.comment||A)&&(e.comment=P(o)||e.comment)}function Y(e,t,r){var o=x();if("group"!==o){if(!I.test(o))throw W(o,"type");var n=x();if(!T.test(n))throw W(n,"name");n=G(n),U("=");var a=new s(n,z(x()),o,t,r);if(X(a,(function(e){if("option"!==e)throw W(e);Z(a,e),U(";")}),(function(){te(a)})),"proto3_optional"===t){var u=new c("_"+n);a.setOption("proto3_optional",!0),u.add(a),e.add(u)}else e.add(a);L||!a.repeated||void 0===h.packed[o]&&void 0!==h.basic[o]||a.setOption("packed",!1,!0)}else!function(e,t){var r=x();if(!T.test(r))throw W(r,"name");var o=d.lcFirst(r);r===o&&(r=d.ucFirst(r)),U("=");var n=z(x()),a=new i(r);a.group=!0;var c=new s(o,n,r,t);c.filename=O.filename,X(a,(function(e){switch(e){case"option":Z(a,e),U(";");break;case"required":case"repeated":Y(a,e);break;case"optional":Y(a,L?"proto3_optional":"optional");break;default:throw W(e)}})),e.add(a).add(c)}(e,t)}function Z(e,t){var r=U("(",!0);if(!I.test(t=x()))throw W(t,"name");var o,n=t,i=n;r&&(U(")"),i=n="("+n+")",t=j(),b.test(t)&&(o=t.substr(1),n+=t,x())),U("="),function(e,t,r,o){e.setParsedOption&&e.setParsedOption(t,r,o)}(e,i,Q(e,n),o)}function Q(e,t){if(U("{",!0)){for(var r={};!U("}",!0);){if(!T.test(C=x()))throw W(C,"name");var o,n=C;"{"===j()?o=Q(e,t+"."+C):(U(":"),"{"===j()?o=Q(e,t+"."+C):(o=H(!0),ee(e,t+"."+C,o)));var i=r[n];i&&(o=[].concat(i).concat(o)),r[n]=o,U(",",!0)}return r}var s=H(!0);return ee(e,t,s),s}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(U("[",!0)){do{Z(e,"option")}while(U(",",!0));U("]")}return e}for(;null!==(C=x());)switch(C){case"package":if(!B)throw W(C);J();break;case"import":if(!B)throw W(C);V();break;case"syntax":if(!B)throw W(C);K();break;case"option":Z(D,C),U(";");break;default:if($(D,C)){B=!1;continue}throw W(C)}return O.filename=null,{package:N,imports:S,weakImports:R,syntax:w,root:t}}},1408:(e,t,r)=>{"use strict";e.exports=c;var o,n=r(9693),i=n.LongBits,s=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,p="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},l=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new o(e):p(e)})(e)}:p};function h(){var e=new i(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw a(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw a(this,8);return new i(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}c.create=l(),c.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,c.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,a(this,10);return u}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return d(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|d(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},c.prototype.string=function(){var e=this.bytes();return s.read(e,0,e.length)},c.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},c.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},c._configure=function(e){o=e,c.create=l(),o._configure();var t=n.Long?"toLong":"toNumber";n.merge(c.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},593:(e,t,r)=>{"use strict";e.exports=i;var o=r(1408);(i.prototype=Object.create(o.prototype)).constructor=i;var n=r(9693);function i(e){o.call(this,e)}i._configure=function(){n.Buffer&&(i.prototype._slice=n.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},9424:(e,t,r)=>{"use strict";e.exports=l;var o=r(9313);((l.prototype=Object.create(o.prototype)).constructor=l).className="Root";var n,i,s,a=r(3548),c=r(7025),u=r(7598),p=r(9935);function l(e){o.call(this,"",e),this.deferred=[],this.files=[]}function h(){}l.fromJSON=function(e,t){return t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=p.path.resolve,l.prototype.fetch=p.fetch,l.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=o===h;function c(e,t){if(o){var r=o;if(o=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in s)return r}return null}function l(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),l=0;if(s.imports)for(;l<s.imports.length;++l)(o=u(s.imports[l])||n.resolvePath(e,s.imports[l]))&&d(o);if(s.weakImports)for(l=0;l<s.weakImports.length;++l)(o=u(s.weakImports[l])||n.resolvePath(e,s.weakImports[l]))&&d(o,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}a||f||c(null,n)}function d(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in s)a?l(e,s[e]):(++f,setTimeout((function(){--f,l(e,s[e])})));else if(a){var r;try{r=p.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}l(e,r)}else++f,n.fetch(e,(function(r,i){--f,o&&(r?t?f||c(null,n):c(r):l(e,i))}))}var f=0;p.isString(t)&&(t=[t]);for(var m,y=0;y<t.length;++y)(m=n.resolvePath("",t[y]))&&d(m);if(a)return n;f||c(null,n)},l.prototype.loadSync=function(e,t){if(!p.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return o.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var o=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,r.add(o),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof c)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},l._configure=function(e,t,r){n=e,i=t,s=r}},5054:e=>{"use strict";e.exports={}},5994:(e,t,r)=>{"use strict";t.Service=r(7948)},7948:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(o.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return o.asPromise(e,a,t,r,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7513:(e,t,r)=>{"use strict";e.exports=a;var o=r(9313);((a.prototype=Object.create(o.prototype)).constructor=a).className="Service";var n=r(4429),i=r(9935),s=r(5994);function a(e,t){o.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var o=Object.keys(t.methods),i=0;i<o.length;++i)r.add(n.fromJSON(o[i],t.methods[o[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",o.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||o.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return o.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,c(this)):o.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,c(this)}return o.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var o,n=new s.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var c=i.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return n}},626:e=>{"use strict";e.exports=l;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function l(e,c){e=e.toString();var u=0,l=e.length,h=1,d=null,f=null,m=0,y=!1,g=!1,v=[],E=null;function _(e){return Error("illegal "+e+" (line "+h+")")}function T(t){return e.charAt(t)}function I(t,r,o){d=e.charAt(t++),m=h,y=!1,g=o;var a,u=t-(c?2:3);do{if(--u<0||"\n"===(a=e.charAt(u))){y=!0;break}}while(" "===a||"\t"===a);for(var p=e.substring(t,r).split(s),l=0;l<p.length;++l)p[l]=p[l].replace(c?i:n,"").trim();f=p.join("\n").trim()}function b(t){var r=O(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function O(e){for(var t=e;t<l&&"\n"!==T(t);)t++;return t}function N(){if(v.length>0)return v.shift();if(E)return function(){var t="'"===E?o:r;t.lastIndex=u-1;var n=t.exec(e);if(!n)throw _("string");return u=t.lastIndex,S(E),E=null,p(n[1])}();var n,i,s,d,f,m=0===u;do{if(u===l)return null;for(n=!1;a.test(s=T(u));)if("\n"===s&&(m=!0,++h),++u===l)return null;if("/"===T(u)){if(++u===l)throw _("comment");if("/"===T(u))if(c){if(d=u,f=!1,b(u)){f=!0;do{if((u=O(u))===l)break;u++}while(b(u))}else u=Math.min(l,O(u)+1);f&&I(d,u,m),h++,n=!0}else{for(f="/"===T(d=u+1);"\n"!==T(++u);)if(u===l)return null;++u,f&&I(d,u-1,m),++h,n=!0}else{if("*"!==(s=T(u)))return"/";d=u+1,f=c||"*"===T(d);do{if("\n"===s&&++h,++u===l)throw _("comment");i=s,s=T(u)}while("*"!==i||"/"!==s);++u,f&&I(d,u-2,m),n=!0}}}while(n);var y=u;if(t.lastIndex=0,!t.test(T(y++)))for(;y<l&&!t.test(T(y));)++y;var g=e.substring(u,u=y);return'"'!==g&&"'"!==g||(E=g),g}function S(e){v.push(e)}function R(){if(!v.length){var e=N();if(null===e)return null;S(e)}return v[0]}return Object.defineProperty({next:N,peek:R,push:S,skip:function(e,t){var r=R();if(r===e)return N(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===h-1&&(c||"*"===d||y)&&(t=g?f:null):(m<e&&R(),m!==e||y||!c&&"/"!==d||(t=g?null:f)),t}},"line",{get:function(){return h}})}l.unescape=p},7645:(e,t,r)=>{"use strict";e.exports=v;var o=r(9313);((v.prototype=Object.create(o.prototype)).constructor=v).className="Type";var n=r(7025),i=r(7598),s=r(3548),a=r(6039),c=r(7513),u=r(8368),p=r(1408),l=r(1173),h=r(9935),d=r(4928),f=r(5305),m=r(4497),y=r(3996),g=r(1667);function v(e,t){o.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(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}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<e.length;++t){var r=this.fields[e[t]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r)o[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,o)}}}),v.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),o=0;o<e.fieldsArray.length;++o)(t=e._fieldsArray[o]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),p=0;p<u.length;++p)r.add((void 0!==t.fields[u[p]].keyType?a.fromJSON:s.fromJSON)(u[p],t.fields[u[p]]));if(t.oneofs)for(u=Object.keys(t.oneofs),p=0;p<u.length;++p)r.add(i.fromJSON(u[p],t.oneofs[u[p]]));if(t.nested)for(u=Object.keys(t.nested),p=0;p<u.length;++p){var l=t.nested[u[p]];r.add((void 0!==l.id?s.fromJSON:void 0!==l.fields?v.fromJSON:void 0!==l.values?n.fromJSON:void 0!==l.methods?c.fromJSON:o.fromJSON)(u[p],l))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=o.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",o.arrayToJSON(this.oneofsArray,e),"fields",o.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return o.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof s&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),E(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),E(this)):o.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof s&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),E(this)}if(e instanceof i){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),E(this)}return o.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:l,types:t,util:h}),this.decode=f(this)({Reader:p,types:t,util:h}),this.verify=m(this)({types:t,util:h}),this.fromObject=y.fromObject(this)({types:t,util:h}),this.toObject=y.toObject(this)({types:t,util:h});var o=g[e];if(o){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(n),n.toObject=this.toObject,this.toObject=o.toObject.bind(n)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof p||(e=p.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){h.decorateType(t,e)}}},7063:(e,t,r)=>{"use strict";var o=t,n=r(9935),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,o={};for(t|=0;r<e.length;)o[i[r+t]]=e[r++];return o}o.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),o.long=s([0,0,0,1,1],7),o.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0])},9935:(e,t,r)=>{"use strict";var o,n,i=e.exports=r(9693),s=r(5054);i.codegen=r(5124),i.fetch=r(9054),i.path=r(8626),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),o=0;o<t.length;)r[o]=e[t[o++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var o=e[r++],n=e[r++];void 0!==n&&(t[o]=n)}return t};var a=/\\/g,c=/"/g;i.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(a,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;o||(o=r(7645));var n=new o(t||e.name);return i.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var p=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(7025));var t=new n("Enum"+p++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,o){var n=r.shift();if(r.length>0)t[n]=e(t[n]||{},r,o);else{var i=t[n];i&&(o=[].concat(i).concat(o)),t[n]=o}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return s.decorated||(s.decorated=new(r(9424)))}})},1945:(e,t,r)=>{"use strict";e.exports=n;var o=r(9693);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new n(r,o)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(o.isString(e)){if(!o.Long)return n.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===s?i:new n((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)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},9693:function(e,t,r){"use strict";var o=t;function n(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)void 0!==e[o[n]]&&r||(e[o[n]]=t[o[n]]);return e}function i(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}o.asPromise=r(4537),o.base64=r(7419),o.EventEmitter=r(9211),o.float=r(945),o.inquire=r(7199),o.utf8=r(4997),o.pool=r(6662),o.LongBits=r(1945),o.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),o.global=o.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.isset=o.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=n,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=i,o.ProtocolError=i("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o._configure=function(){var e=o.Buffer;e?(o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):o._Buffer_from=o._Buffer_allocUnsafe=null}},4497:(e,t,r)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var o=0;o<e.fieldsArray.length;++o){var c=e._fieldsArray[o].resolve(),u="m"+n.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),a(t,c,"k[i]"),s(t,c,o,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),s(t,c,o,u+"[i]")("}");else{if(c.partOf){var p=n.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",p)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",p)}s(t,c,o,u)}c.optional&&t("}")}return t("return null")};var o=r(7025),n=r(9935);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(%s){",n)("default:")("return%j",i(t,"enum value"));for(var s=Object.keys(t.resolvedType.values),a=0;a<s.length;++a)e("case %i:",t.resolvedType.values[s[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",i(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},1667:(e,t,r)=>{"use strict";var o=t,n=r(8368);o[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var o="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===o.indexOf("/")&&(o="/"+o),this.create({type_url:o,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",o="";if(t&&t.json&&e.type_url&&e.value){o=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(o);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var s=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),o=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),s["@type"]=o,s}return this.toObject(e,t)}}},1173:(e,t,r)=>{"use strict";e.exports=l;var o,n=r(9693),i=n.LongBits,s=n.base64,a=n.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function p(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function l(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var h=function(){return n.Buffer?function(){return(l.create=function(){return new o})()}:function(){return new l}};function d(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function y(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}l.create=h(),l.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(l.alloc=n.pool(l.alloc,n.Array.prototype.subarray)),l.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},l.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((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(m,10,i.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=i.from(e);return this._push(m,t.length(),t)},l.prototype.int64=l.prototype.uint64,l.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},l.prototype.bool=function(e){return this._push(d,1,e?1:0)},l.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},l.prototype.sfixed32=l.prototype.fixed32,l.prototype.fixed64=function(e){var t=i.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},l.prototype.sfixed64=l.prototype.fixed64,l.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},l.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var g=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var o=0;o<e.length;++o)t[r+o]=e[o]};l.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(n.isString(e)){var r=l.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},l.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},l.prototype.fork=function(){return this.states=new p(this),this.head=this.tail=new c(u,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 c(u,0,0),this.len=0),this},l.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},l.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},l._configure=function(e){o=e,l.create=h(),o._configure()}},3155:(e,t,r)=>{"use strict";e.exports=i;var o=r(1173);(i.prototype=Object.create(o.prototype)).constructor=i;var n=r(9693);function i(){o.call(this)}function s(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=n._Buffer_allocUnsafe,i.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var o=0;o<e.length;)t[r++]=e[o++]}},i.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(s,t,e),this},i._configure()},7129:(e,t)=>{"use strict";var r=Object.prototype.hasOwnProperty;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(e){return null}}function n(e){try{return encodeURIComponent(e)}catch(e){return null}}t.stringify=function(e,t){t=t||"";var o,i,s=[];for(i in"string"!=typeof t&&(t="?"),e)if(r.call(e,i)){if((o=e[i])||null!=o&&!isNaN(o)||(o=""),i=n(i),o=n(o),null===i||null===o)continue;s.push(i+"="+o)}return s.length?t+s.join("&"):""},t.parse=function(e){for(var t,r=/([^=?#&]+)=?([^&]*)/g,n={};t=r.exec(e);){var i=o(t[1]),s=o(t[2]);null===i||null===s||i in n||(n[i]=s)}return n}},7418:e=>{"use strict";e.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},8e3:(e,t,r)=>{"use strict";var o=r(7581);e.exports=r(3626)(o),"_sockjs_onload"in r.g&&setTimeout(r.g._sockjs_onload,1)},2530:(e,t,r)=>{"use strict";var o=r(5717),n=r(685);function i(){n.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}o(i,n),e.exports=i},3212:(e,t,r)=>{"use strict";var o=r(5717),n=r(3184);function i(){n.call(this)}o(i,n),i.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},i.prototype.once=function(e,t){var r=this,o=!1;this.on(e,(function n(){r.removeListener(e,n),o||(o=!0,t.apply(this,arguments))}))},i.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var r=arguments.length,o=new Array(r-1),n=1;n<r;n++)o[n-1]=arguments[n];for(var i=0;i<t.length;i++)t[i].apply(this,o)}},i.prototype.on=i.prototype.addListener=n.prototype.addEventListener,i.prototype.removeListener=n.prototype.removeEventListener,e.exports.v=i},685:e=>{"use strict";function t(e){this.type=e}t.prototype.initEvent=function(e,t,r){return this.type=e,this.bubbles=t,this.cancelable=r,this.timeStamp=+new Date,this},t.prototype.stopPropagation=function(){},t.prototype.preventDefault=function(){},t.CAPTURING_PHASE=1,t.AT_TARGET=2,t.BUBBLING_PHASE=3,e.exports=t},3184:e=>{"use strict";function t(){this._listeners={}}t.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var r=this._listeners[e];-1===r.indexOf(t)&&(r=r.concat([t])),this._listeners[e]=r},t.prototype.removeEventListener=function(e,t){var r=this._listeners[e];if(r){var o=r.indexOf(t);-1===o||(r.length>1?this._listeners[e]=r.slice(0,o).concat(r.slice(o+1)):delete this._listeners[e])}},t.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,r=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,r),t in this._listeners)for(var o=this._listeners[t],n=0;n<o.length;n++)o[n].apply(this,r)},e.exports=t},3326:(e,t,r)=>{"use strict";var o=r(5717),n=r(685);function i(e){n.call(this),this.initEvent("message",!1,!1),this.data=e}o(i,n),e.exports=i},691:(e,t,r)=>{"use strict";var o=r(7522),n=r(3683);function i(e){this._transport=e,e.on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}i.prototype._transportClose=function(e,t){n.postMessage("c",o.stringify([e,t]))},i.prototype._transportMessage=function(e){n.postMessage("t",e)},i.prototype._send=function(e){this._transport.send(e)},i.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},e.exports=i},551:(e,t,r)=>{"use strict";var o=r(273),n=r(7705),i=r(7522),s=r(691),a=r(6311),c=r(3683),u=r(7486);e.exports=function(e,t){var r,p={};t.forEach((function(e){e.facadeTransport&&(p[e.facadeTransport.transportName]=e.facadeTransport)})),p[a.transportName]=a,e.bootstrap_iframe=function(){var t;c.currentWindowId=u.hash.slice(1),n.attachEvent("message",(function(n){if(n.source===parent&&(void 0===r&&(r=n.origin),n.origin===r)){var a;try{a=i.parse(n.data)}catch(e){return void n.data}if(a.windowId===c.currentWindowId)switch(a.type){case"s":var l;try{l=i.parse(a.data)}catch(e){a.data;break}var h=l[0],d=l[1],f=l[2],m=l[3];if(h!==e.version)throw new Error('Incompatible SockJS! Main site uses: "'+h+'", the iframe: "'+e.version+'".');if(!o.isOriginEqual(f,u.href)||!o.isOriginEqual(m,u.href))throw new Error("Can't connect to different domain from within an iframe. ("+u.href+", "+f+", "+m+")");t=new s(new p[d](f,m));break;case"m":t._send(a.data);break;case"c":t&&t._close(),t=null}}})),c.postMessage("s")}}},2550:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7522),s=r(2217);function a(e,t){o.call(this);var r=this,n=+new Date;this.xo=new t("GET",e),this.xo.once("finish",(function(e,t){var o,a;if(200===e){if(a=+new Date-n,t)try{o=i.parse(t)}catch(e){}s.isObject(o)||(o={})}r.emit("finish",o,a),r.removeAllListeners()}))}n(a,o),a.prototype.close=function(){this.removeAllListeners(),this.xo.close()},e.exports=a},6311:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v,i=r(7522),s=r(3515),a=r(2550);function c(e){var t=this;n.call(this),this.ir=new a(e,s),this.ir.once("finish",(function(e,r){t.ir=null,t.emit("message",i.stringify([e,r]))}))}o(c,n),c.transportName="iframe-info-receiver",c.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},e.exports=c},3616:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7522),s=r(7705),a=r(5088),c=r(6311);function u(e,t){var n=this;o.call(this);var u=function(){var r=n.ifr=new a(c.transportName,t,e);r.once("message",(function(e){if(e){var t;try{t=i.parse(e)}catch(e){return n.emit("finish"),void n.close()}var r=t[0],o=t[1];n.emit("finish",r,o)}n.close()})),r.once("close",(function(){n.emit("finish"),n.close()}))};r.g.document.body?u():s.attachEvent("load",u)}n(u,o),u.enabled=function(){return a.enabled()},u.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},e.exports=u},5172:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(273),s=r(6073),a=r(9033),c=r(3515),u=r(7103),p=r(3616),l=r(2550);function h(e,t){var r=this;o.call(this),setTimeout((function(){r.doXhr(e,t)}),0)}n(h,o),h._getReceiver=function(e,t,r){return r.sameOrigin?new l(t,c):a.enabled?new l(t,a):s.enabled&&r.sameScheme?new l(t,s):p.enabled()?new p(e,t):new l(t,u)},h.prototype.doXhr=function(e,t){var r=this,o=i.addPath(e,"/info");this.xo=h._getReceiver(e,o,t),this.timeoutRef=setTimeout((function(){r._cleanup(!1),r.emit("finish")}),h.timeout),this.xo.once("finish",(function(e,t){r._cleanup(!0),r.emit("finish",e,t)}))},h.prototype._cleanup=function(e){clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},h.prototype.close=function(){this.removeAllListeners(),this._cleanup(!1)},h.timeout=8e3,e.exports=h},7486:(e,t,r)=>{"use strict";e.exports=r.g.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}},3626:(e,t,r)=>{"use strict";r(1247);var o,n=r(4564),i=r(5717),s=r(7522),a=r(8915),c=r(8028),u=r(273),p=r(7705),l=r(5581),h=r(2217),d=r(8510),f=r(4886),m=r(685),y=r(3184),g=r(7486),v=r(2530),E=r(3326),_=r(5172);function T(e,t,r){if(!(this instanceof T))return new T(e,t,r);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");y.call(this),this.readyState=T.CONNECTING,this.extensions="",this.protocol="",(r=r||{}).protocols_whitelist&&f.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=r.transports,this._transportOptions=r.transportOptions||{},this._timeout=r.timeout||0;var o=r.sessionId||8;if("function"==typeof o)this._generateSessionId=o;else{if("number"!=typeof o)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return a.string(o)}}this._server=r.server||a.numberString(1e3);var i=new n(e);if(!i.host||!i.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(i.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==i.protocol&&"https:"!==i.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+i.protocol+"' is not allowed.");var s="https:"===i.protocol;if("https:"===g.protocol&&!s&&!u.isLoopbackAddr(i.hostname))throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var c=t.sort();c.forEach((function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<c.length-1&&e===c[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")}));var p=u.getOrigin(g.href);this._origin=p?p.toLowerCase():null,i.set("pathname",i.pathname.replace(/\/+$/,"")),this.url=i.href,this.url,this._urlInfo={nullOrigin:!d.hasDomain(),sameOrigin:u.isOriginEqual(this.url,g.href),sameScheme:u.isSchemeEqual(this.url,g.href)},this._ir=new _(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function I(e){return 1e3===e||e>=3e3&&e<=4999}i(T,y),T.prototype.close=function(e,t){if(e&&!I(e))throw new Error("InvalidAccessError: Invalid code");if(t&&t.length>123)throw new SyntaxError("reason argument has an invalid length");this.readyState!==T.CLOSING&&this.readyState!==T.CLOSED&&this._close(e||1e3,t||"Normal closure",!0)},T.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===T.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===T.OPEN&&this._transport.send(c.quote(e))},T.version=r(2828),T.CONNECTING=0,T.OPEN=1,T.CLOSING=2,T.CLOSED=3,T.prototype._receiveInfo=function(e,t){if(this._ir=null,e){this._rto=this.countRTO(t),this._transUrl=e.base_url?e.base_url:this.url,e=h.extend(e,this._urlInfo);var r=o.filterToEnabled(this._transportsWhitelist,e);this._transports=r.main,this._transports.length,this._connect()}else this._close(1002,"Cannot connect to server")},T.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(e.transportName,e.needBody&&(!r.g.document.body||void 0!==r.g.document.readyState&&"complete"!==r.g.document.readyState&&"interactive"!==r.g.document.readyState))return this._transports.unshift(e),void p.attachEvent("load",this._connect.bind(this));var t=Math.max(this._timeout,this._rto*e.roundTrips||5e3);this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),t);var o=u.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),n=this._transportOptions[e.transportName],i=new e(o,this._transUrl,n);return i.on("message",this._transportMessage.bind(this)),i.once("close",this._transportClose.bind(this)),i.transportName=e.transportName,void(this._transport=i)}this._close(2e3,"All transports failed",!1)},T.prototype._transportTimeout=function(){this.readyState===T.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},T.prototype._transportMessage=function(e){var t,r=this,o=e.slice(0,1),n=e.slice(1);switch(o){case"o":return void this._open();case"h":return this.dispatchEvent(new m("heartbeat")),void this.transport}if(n)try{t=s.parse(n)}catch(e){}if(void 0!==t)switch(o){case"a":Array.isArray(t)&&t.forEach((function(e){r.transport,r.dispatchEvent(new E(e))}));break;case"m":this.transport,this.dispatchEvent(new E(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}},T.prototype._transportClose=function(e,t){this.transport,this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),I(e)||2e3===e||this.readyState!==T.CONNECTING?this._close(e,t):this._connect()},T.prototype._open=function(){this._transport&&this._transport.transportName,this.readyState,this.readyState===T.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=T.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new m("open")),this.transport):this._close(1006,"Server lost session")},T.prototype._close=function(e,t,r){this.transport,this.readyState;var o=!1;if(this._ir&&(o=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===T.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=T.CLOSING,setTimeout(function(){this.readyState=T.CLOSED,o&&this.dispatchEvent(new m("error"));var n=new v("close");n.wasClean=r||!1,n.code=e||1e3,n.reason=t,this.dispatchEvent(n),this.onmessage=this.onclose=this.onerror=null}.bind(this),0)},T.prototype.countRTO=function(e){return e>100?4*e:300+e},e.exports=function(e){return o=l(e),r(551)(T,e),T}},1247:()=>{"use strict";var e,t=Array.prototype,r=Object.prototype,o=Function.prototype,n=String.prototype,i=t.slice,s=r.toString,a=function(e){return"[object Function]"===r.toString.call(e)},c=function(e){return"[object String]"===s.call(e)},u=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();e=u?function(e,t,r,o){!o&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r})}:function(e,t,r,o){!o&&t in e||(e[t]=r)};var p=function(t,o,n){for(var i in o)r.hasOwnProperty.call(o,i)&&e(t,i,o[i],n)},l=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)};function h(e){var t=+e;return t!=t?t=0:0!==t&&t!==1/0&&t!==-1/0&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t}function d(){}p(o,{bind:function(e){var t=this;if(!a(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r=i.call(arguments,1),o=function(){if(this instanceof u){var o=t.apply(this,r.concat(i.call(arguments)));return Object(o)===o?o:this}return t.apply(e,r.concat(i.call(arguments)))},n=Math.max(0,t.length-r.length),s=[],c=0;c<n;c++)s.push("$"+c);var u=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this, arguments); }")(o);return t.prototype&&(d.prototype=t.prototype,u.prototype=new d,d.prototype=null),u}}),p(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var f,m,y,g=Object("a"),v="a"!==g[0]||!(0 in g);p(t,{forEach:function(e){var t=l(this),r=v&&c(this)?this.split(""):t,o=arguments[1],n=-1,i=r.length>>>0;if(!a(e))throw new TypeError;for(;++n<i;)n in r&&e.call(o,r[n],n,t)}},(f=t.forEach,m=!0,y=!0,f&&(f.call("foo",(function(e,t,r){"object"!=typeof r&&(m=!1)})),f.call([1],(function(){y="string"==typeof this}),"x")),!(f&&m&&y)));var E=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);p(t,{indexOf:function(e){var t=v&&c(this)?this.split(""):l(this),r=t.length>>>0;if(!r)return-1;var o=0;for(arguments.length>1&&(o=h(arguments[1])),o=o>=0?o:Math.max(0,r+o);o<r;o++)if(o in t&&t[o]===e)return o;return-1}},E);var _,T=n.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?(_=void 0===/()??/.exec("")[1],n.split=function(e,r){var o=this;if(void 0===e&&0===r)return[];if("[object RegExp]"!==s.call(e))return T.call(this,e,r);var n,i,a,c,u=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),l=0;for(e=new RegExp(e.source,p+"g"),o+="",_||(n=new RegExp("^"+e.source+"$(?!\\s)",p)),r=void 0===r?-1>>>0:r>>>0;(i=e.exec(o))&&!((a=i.index+i[0].length)>l&&(u.push(o.slice(l,i.index)),!_&&i.length>1&&i[0].replace(n,(function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(i[e]=void 0)})),i.length>1&&i.index<o.length&&t.push.apply(u,i.slice(1)),c=i[0].length,l=a,u.length>=r));)e.lastIndex===i.index&&e.lastIndex++;return l===o.length?!c&&e.test("")||u.push(""):u.push(o.slice(l)),u.length>r?u.slice(0,r):u}):"0".split(void 0,0).length&&(n.split=function(e,t){return void 0===e&&0===t?[]:T.call(this,e,t)});var I=n.substr;p(n,{substr:function(e,t){return I.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},"".substr&&"b"!=="0b".substr(-1))},7581:(e,t,r)=>{"use strict";e.exports=[r(2412),r(9842),r(4620),r(3004),r(882)(r(3004)),r(5616),r(882)(r(5616)),r(2387),r(9998),r(882)(r(2387)),r(5375)]},2940:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7705),s=r(273),a=r.g.XMLHttpRequest;function c(e,t,r,n){var i=this;o.call(this),setTimeout((function(){i._start(e,t,r,n)}),0)}n(c,o),c.prototype._start=function(e,t,r,o){var n=this;try{this.xhr=new a}catch(e){}if(!this.xhr)return this.emit("finish",0,"no xhr support"),void this._cleanup();t=s.addQuery(t,"t="+ +new Date),this.unloadRef=i.unloadAdd((function(){n._cleanup(!0)}));try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){n.emit("finish",0,""),n._cleanup(!1)})}catch(e){return this.emit("finish",0,""),void this._cleanup(!1)}if(o&&o.noCredentials||!c.supportsCORS||(this.xhr.withCredentials=!0),o&&o.headers)for(var u in o.headers)this.xhr.setRequestHeader(u,o.headers[u]);this.xhr.onreadystatechange=function(){if(n.xhr){var e,t,r=n.xhr;switch(r.readyState,r.readyState){case 3:try{t=r.status,e=r.responseText}catch(e){}1223===t&&(t=204),200===t&&e&&e.length>0&&n.emit("chunk",t,e);break;case 4:1223===(t=r.status)&&(t=204),12005!==t&&12029!==t||(t=0),r.responseText,n.emit("finish",t,r.responseText),n._cleanup(!1)}}};try{n.xhr.send(r)}catch(e){n.emit("finish",0,""),n._cleanup(!1)}},c.prototype._cleanup=function(e){if(this.xhr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},c.prototype.close=function(){this._cleanup(!0)},c.enabled=!!a;var u=["Active"].concat("Object").join("X");!c.enabled&&u in r.g&&(a=function(){try{return new r.g[u]("Microsoft.XMLHTTP")}catch(e){return null}},c.enabled=!!new a);var p=!1;try{p="withCredentials"in new a}catch(e){}c.supportsCORS=p,e.exports=c},3759:(e,t,r)=>{e.exports=r.g.EventSource},9334:(e,t,r)=>{"use strict";var o=r.g.WebSocket||r.g.MozWebSocket;e.exports=o?function(e){return new o(e)}:void 0},3004:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(6709),s=r(9033),a=r(3759);function c(e){if(!c.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/eventsource",i,s)}o(c,n),c.enabled=function(){return!!a},c.transportName="eventsource",c.roundTrips=2,e.exports=c},5616:(e,t,r)=>{"use strict";var o=r(5717),n=r(3608),i=r(3515),s=r(9395);function a(e){if(!n.enabled)throw new Error("Transport created when disabled");s.call(this,e,"/htmlfile",n,i)}o(a,s),a.enabled=function(e){return n.enabled&&e.sameOrigin},a.transportName="htmlfile",a.roundTrips=2,e.exports=a},5088:(e,t,r)=>{"use strict";var o=r(5717),n=r(7522),i=r(3212).v,s=r(2828),a=r(273),c=r(3683),u=r(7705),p=r(8915);function l(e,t,r){if(!l.enabled())throw new Error("Transport created when disabled");i.call(this);var o=this;this.origin=a.getOrigin(r),this.baseUrl=r,this.transUrl=t,this.transport=e,this.windowId=p.string(8);var n=a.addPath(r,"/iframe.html")+"#"+this.windowId;this.iframeObj=c.createIframe(n,(function(e){o.emit("close",1006,"Unable to load an iframe ("+e+")"),o.close()})),this.onmessageCallback=this._message.bind(this),u.attachEvent("message",this.onmessageCallback)}o(l,i),l.prototype.close=function(){if(this.removeAllListeners(),this.iframeObj){u.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},l.prototype._message=function(e){if(e.data,!a.isOriginEqual(e.origin,this.origin))return e.origin,void this.origin;var t;try{t=n.parse(e.data)}catch(t){return void e.data}if(t.windowId!==this.windowId)return t.windowId,void this.windowId;switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",n.stringify([s,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var r;try{r=n.parse(t.data)}catch(e){return void t.data}this.emit("close",r[0],r[1]),this.close()}},l.prototype.postMessage=function(e,t){this.iframeObj.post(n.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},l.prototype.send=function(e){this.postMessage("m",e)},l.enabled=function(){return c.iframeEnabled},l.transportName="iframe",l.roundTrips=2,e.exports=l},5375:(e,t,r)=>{"use strict";var o=r(5717),n=r(8347),i=r(514),s=r(771);function a(e){if(!a.enabled())throw new Error("Transport created when disabled");n.call(this,e,"/jsonp",s,i)}o(a,n),a.enabled=function(){return!!r.g.document},a.transportName="jsonp-polling",a.roundTrips=1,a.needBody=!0,e.exports=a},9395:(e,t,r)=>{"use strict";var o=r(5717),n=r(273),i=r(8347);function s(e,t,r,o){i.call(this,e,t,function(e){return function(t,r,o){var i={};"string"==typeof r&&(i.headers={"Content-type":"text/plain"});var s=n.addPath(t,"/xhr_send"),a=new e("POST",s,r,i);return a.once("finish",(function(e){if(a=null,200!==e&&204!==e)return o(new Error("http status "+e));o()})),function(){a.close(),a=null;var e=new Error("Aborted");e.code=1e3,o(e)}}}(o),r,o)}o(s,i),e.exports=s},1851:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t){n.call(this),this.sendBuffer=[],this.sender=t,this.url=e}o(i,n),i.prototype.send=function(e){this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},i.prototype.sendScheduleWait=function(){var e,t=this;this.sendStop=function(){t.sendStop=null,clearTimeout(e)},e=setTimeout((function(){t.sendStop=null,t.sendSchedule()}),25)},i.prototype.sendSchedule=function(){this.sendBuffer.length;var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,(function(t){e.sendStop=null,t?(e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()})),this.sendBuffer=[]}},i.prototype._cleanup=function(){this.removeAllListeners()},i.prototype.close=function(){this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},e.exports=i},882:(e,t,r)=>{"use strict";var o=r(5717),n=r(5088),i=r(2217);e.exports=function(e){function t(t,r){n.call(this,e.transportName,t,r)}return o(t,n),t.enabled=function(t,o){if(!r.g.document)return!1;var s=i.extend({},o);return s.sameOrigin=!0,e.enabled(s)&&n.enabled()},t.transportName="iframe-"+e.transportName,t.needBody=!0,t.roundTrips=n.roundTrips+e.roundTrips-1,t.facadeTransport=e,t}},1265:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t,r){n.call(this),this.Receiver=e,this.receiveUrl=t,this.AjaxObject=r,this._scheduleReceiver()}o(i,n),i.prototype._scheduleReceiver=function(){var e=this,t=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);t.on("message",(function(t){e.emit("message",t)})),t.once("close",(function(r,o){e.pollIsClosing,e.poll=t=null,e.pollIsClosing||("network"===o?e._scheduleReceiver():(e.emit("close",r||1006,o),e.removeAllListeners()))}))},i.prototype.abort=function(){this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},e.exports=i},8347:(e,t,r)=>{"use strict";var o=r(5717),n=r(273),i=r(1851),s=r(1265);function a(e,t,r,o,a){var c=n.addPath(e,t),u=this;i.call(this,e,r),this.poll=new s(o,c,a),this.poll.on("message",(function(e){u.emit("message",e)})),this.poll.once("close",(function(e,t){u.poll=null,u.emit("close",e,t),u.close()}))}o(a,i),a.prototype.close=function(){i.prototype.close.call(this),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},e.exports=a},6709:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v,i=r(3759);function s(e){n.call(this);var t=this,r=this.es=new i(e);r.onmessage=function(e){e.data,t.emit("message",decodeURI(e.data))},r.onerror=function(e){r.readyState;var o=2!==r.readyState?"network":"permanent";t._cleanup(),t._close(o)}}o(s,n),s.prototype.abort=function(){this._cleanup(),this._close("user")},s.prototype._cleanup=function(){var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},s.prototype._close=function(e){var t=this;setTimeout((function(){t.emit("close",null,e),t.removeAllListeners()}),200)},e.exports=s},3608:(e,t,r)=>{"use strict";var o=r(5717),n=r(3683),i=r(273),s=r(3212).v,a=r(8915);function c(e){s.call(this);var t=this;n.polluteGlobalNamespace(),this.id="a"+a.string(6),e=i.addQuery(e,"c="+decodeURIComponent(n.WPrefix+"."+this.id)),c.htmlfileEnabled;var o=c.htmlfileEnabled?n.createHtmlfile:n.createIframe;r.g[n.WPrefix][this.id]={start:function(){t.iframeObj.loaded()},message:function(e){t.emit("message",e)},stop:function(){t._cleanup(),t._close("network")}},this.iframeObj=o(e,(function(){t._cleanup(),t._close("permanent")}))}o(c,s),c.prototype.abort=function(){this._cleanup(),this._close("user")},c.prototype._cleanup=function(){this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete r.g[n.WPrefix][this.id]},c.prototype._close=function(e){this.emit("close",null,e),this.removeAllListeners()},c.htmlfileEnabled=!1;var u=["Active"].concat("Object").join("X");if(u in r.g)try{c.htmlfileEnabled=!!new r.g[u]("htmlfile")}catch(e){}c.enabled=c.htmlfileEnabled||n.iframeEnabled,e.exports=c},514:(e,t,r)=>{"use strict";var o=r(3683),n=r(8915),i=r(8510),s=r(273),a=r(5717),c=r(3212).v;function u(e){var t=this;c.call(this),o.polluteGlobalNamespace(),this.id="a"+n.string(6);var i=s.addQuery(e,"c="+encodeURIComponent(o.WPrefix+"."+this.id));r.g[o.WPrefix][this.id]=this._callback.bind(this),this._createScript(i),this.timeoutId=setTimeout((function(){t._abort(new Error("JSONP script loaded abnormally (timeout)"))}),u.timeout)}a(u,c),u.prototype.abort=function(){if(r.g[o.WPrefix][this.id]){var e=new Error("JSONP user aborted read");e.code=1e3,this._abort(e)}},u.timeout=35e3,u.scriptErrorTimeout=1e3,u.prototype._callback=function(e){this._cleanup(),this.aborting||(e&&this.emit("message",e),this.emit("close",null,"network"),this.removeAllListeners())},u.prototype._abort=function(e){this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},u.prototype._cleanup=function(){if(clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var e=this.script;e.parentNode.removeChild(e),e.onreadystatechange=e.onerror=e.onload=e.onclick=null,this.script=null}delete r.g[o.WPrefix][this.id]},u.prototype._scriptError=function(){var e=this;this.errorTimer||(this.errorTimer=setTimeout((function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))}),u.scriptErrorTimeout))},u.prototype._createScript=function(e){var t,o=this,s=this.script=r.g.document.createElement("script");if(s.id="a"+n.string(8),s.src=e,s.type="text/javascript",s.charset="UTF-8",s.onerror=this._scriptError.bind(this),s.onload=function(){o._abort(new Error("JSONP script loaded abnormally (onload)"))},s.onreadystatechange=function(){if(s.readyState,/loaded|closed/.test(s.readyState)){if(s&&s.htmlFor&&s.onclick){o.loadedOkay=!0;try{s.onclick()}catch(e){}}s&&o._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===s.async&&r.g.document.attachEvent)if(i.isOpera())(t=this.script2=r.g.document.createElement("script")).text="try{var a = document.getElementById('"+s.id+"'); if(a)a.onerror();}catch(x){};",s.async=t.async=!1;else{try{s.htmlFor=s.id,s.event="onclick"}catch(e){}s.async=!0}void 0!==s.async&&(s.async=!0);var a=r.g.document.getElementsByTagName("head")[0];a.insertBefore(s,a.firstChild),t&&a.insertBefore(t,a.firstChild)},e.exports=u},1044:(e,t,r)=>{"use strict";var o=r(5717),n=r(3212).v;function i(e,t){n.call(this);var r=this;this.bufferPosition=0,this.xo=new t("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",(function(e,t){r._chunkHandler(e,t),r.xo=null;var o=200===e?"network":"permanent";r.emit("close",null,o),r._cleanup()}))}o(i,n),i.prototype._chunkHandler=function(e,t){if(200===e&&t)for(var r=-1;;this.bufferPosition+=r+1){var o=t.slice(this.bufferPosition);if(-1===(r=o.indexOf("\n")))break;var n=o.slice(0,r);n&&this.emit("message",n)}},i.prototype._cleanup=function(){this.removeAllListeners()},i.prototype.abort=function(){this.xo&&(this.xo.close(),this.emit("close",null,"user"),this.xo=null),this._cleanup()},e.exports=i},771:(e,t,r)=>{"use strict";var o,n,i=r(8915),s=r(273);e.exports=function(e,t,a){o||((o=r.g.document.createElement("form")).style.display="none",o.style.position="absolute",o.method="POST",o.enctype="application/x-www-form-urlencoded",o.acceptCharset="UTF-8",(n=r.g.document.createElement("textarea")).name="d",o.appendChild(n),r.g.document.body.appendChild(o));var c="a"+i.string(8);o.target=c,o.action=s.addQuery(s.addPath(e,"/jsonp_send"),"i="+c);var u=function(e){try{return r.g.document.createElement('<iframe name="'+e+'">')}catch(o){var t=r.g.document.createElement("iframe");return t.name=e,t}}(c);u.id=c,u.style.display="none",o.appendChild(u);try{n.value=t}catch(e){}o.submit();var p=function(e){u.onerror&&(u.onreadystatechange=u.onerror=u.onload=null,setTimeout((function(){u.parentNode.removeChild(u),u=null}),500),n.value="",a(e))};return u.onerror=function(){p()},u.onload=function(){p()},u.onreadystatechange=function(e){u.readyState,"complete"===u.readyState&&p()},function(){p(new Error("Aborted"))}}},6073:(e,t,r)=>{"use strict";var o=r(3212).v,n=r(5717),i=r(7705),s=r(8510),a=r(273);function c(e,t,r){var n=this;o.call(this),setTimeout((function(){n._start(e,t,r)}),0)}n(c,o),c.prototype._start=function(e,t,o){var n=this,s=new r.g.XDomainRequest;t=a.addQuery(t,"t="+ +new Date),s.onerror=function(){n._error()},s.ontimeout=function(){n._error()},s.onprogress=function(){s.responseText,n.emit("chunk",200,s.responseText)},s.onload=function(){n.emit("finish",200,s.responseText),n._cleanup(!1)},this.xdr=s,this.unloadRef=i.unloadAdd((function(){n._cleanup(!0)}));try{this.xdr.open(e,t),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(o)}catch(e){this._error()}},c.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},c.prototype._cleanup=function(e){if(this.xdr){if(this.removeAllListeners(),i.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},c.prototype.close=function(){this._cleanup(!0)},c.enabled=!(!r.g.XDomainRequest||!s.hasDomain()),e.exports=c},9033:(e,t,r)=>{"use strict";var o=r(5717),n=r(2940);function i(e,t,r,o){n.call(this,e,t,r,o)}o(i,n),i.enabled=n.enabled&&n.supportsCORS,e.exports=i},7103:(e,t,r)=>{"use strict";var o=r(3212).v;function n(){var e=this;o.call(this),this.to=setTimeout((function(){e.emit("finish",200,"{}")}),n.timeout)}r(5717)(n,o),n.prototype.close=function(){clearTimeout(this.to)},n.timeout=2e3,e.exports=n},3515:(e,t,r)=>{"use strict";var o=r(5717),n=r(2940);function i(e,t,r){n.call(this,e,t,r,{noCredentials:!0})}o(i,n),i.enabled=n.enabled,e.exports=i},2412:(e,t,r)=>{"use strict";var o=r(7705),n=r(273),i=r(5717),s=r(3212).v,a=r(9334);function c(e,t,r){if(!c.enabled())throw new Error("Transport created when disabled");s.call(this);var i=this,u=n.addPath(e,"/websocket");u="https"===u.slice(0,5)?"wss"+u.slice(5):"ws"+u.slice(4),this.url=u,this.ws=new a(this.url,[],r),this.ws.onmessage=function(e){e.data,i.emit("message",e.data)},this.unloadRef=o.unloadAdd((function(){i.ws.close()})),this.ws.onclose=function(e){e.code,e.reason,i.emit("close",e.code,e.reason),i._cleanup()},this.ws.onerror=function(e){i.emit("close",1006,"WebSocket connection broken"),i._cleanup()}}i(c,s),c.prototype.send=function(e){var t="["+e+"]";this.ws.send(t)},c.prototype.close=function(){var e=this.ws;this._cleanup(),e&&e.close()},c.prototype._cleanup=function(){var e=this.ws;e&&(e.onmessage=e.onclose=e.onerror=null),o.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},c.enabled=function(){return!!a},c.transportName="websocket",c.roundTrips=2,e.exports=c},9998:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(4620),s=r(1044),a=r(6073);function c(e){if(!a.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr",s,a)}o(c,n),c.enabled=i.enabled,c.transportName="xdr-polling",c.roundTrips=2,e.exports=c},4620:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(6073);function a(e){if(!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",i,s)}o(a,n),a.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&s.enabled&&e.sameScheme},a.transportName="xdr-streaming",a.roundTrips=2,e.exports=a},2387:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(9033),a=r(3515);function c(e){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr",i,s)}o(c,n),c.enabled=function(e){return!e.nullOrigin&&(!(!a.enabled||!e.sameOrigin)||s.enabled)},c.transportName="xhr-polling",c.roundTrips=2,e.exports=c},9842:(e,t,r)=>{"use strict";var o=r(5717),n=r(9395),i=r(1044),s=r(9033),a=r(3515),c=r(8510);function u(e){if(!a.enabled&&!s.enabled)throw new Error("Transport created when disabled");n.call(this,e,"/xhr_streaming",i,s)}o(u,n),u.enabled=function(e){return!e.nullOrigin&&!c.isOpera()&&s.enabled},u.transportName="xhr-streaming",u.roundTrips=2,u.needBody=!!r.g.document,e.exports=u},2017:(e,t,r)=>{"use strict";r.g.crypto&&r.g.crypto.getRandomValues?e.exports.randomBytes=function(e){var t=new Uint8Array(e);return r.g.crypto.getRandomValues(t),t}:e.exports.randomBytes=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=Math.floor(256*Math.random());return t}},8510:(e,t,r)=>{"use strict";e.exports={isOpera:function(){return r.g.navigator&&/opera/i.test(r.g.navigator.userAgent)},isKonqueror:function(){return r.g.navigator&&/konqueror/i.test(r.g.navigator.userAgent)},hasDomain:function(){if(!r.g.document)return!0;try{return!!r.g.document.domain}catch(e){return!1}}}},8028:(e,t,r)=>{"use strict";var o,n=r(7522),i=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g;e.exports={quote:function(e){var t=n.stringify(e);return i.lastIndex=0,i.test(t)?(o||(o=function(e){var t,r={},o=[];for(t=0;t<65536;t++)o.push(String.fromCharCode(t));return e.lastIndex=0,o.join("").replace(e,(function(e){return r[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""})),e.lastIndex=0,r}(i)),t.replace(i,(function(e){return o[e]}))):t}}},7705:(e,t,r)=>{"use strict";var o=r(8915),n={},i=!1,s=r.g.chrome&&r.g.chrome.app&&r.g.chrome.app.runtime;e.exports={attachEvent:function(e,t){void 0!==r.g.addEventListener?r.g.addEventListener(e,t,!1):r.g.document&&r.g.attachEvent&&(r.g.document.attachEvent("on"+e,t),r.g.attachEvent("on"+e,t))},detachEvent:function(e,t){void 0!==r.g.addEventListener?r.g.removeEventListener(e,t,!1):r.g.document&&r.g.detachEvent&&(r.g.document.detachEvent("on"+e,t),r.g.detachEvent("on"+e,t))},unloadAdd:function(e){if(s)return null;var t=o.string(8);return n[t]=e,i&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in n&&delete n[e]},triggerUnloadCallbacks:function(){for(var e in n)n[e](),delete n[e]}},s||e.exports.attachEvent("unload",(function(){i||(i=!0,e.exports.triggerUnloadCallbacks())}))},3683:(e,t,r)=>{"use strict";var o=r(7705),n=r(7522),i=r(8510);e.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){e.exports.WPrefix in r.g||(r.g[e.exports.WPrefix]={})},postMessage:function(t,o){r.g.parent!==r.g&&r.g.parent.postMessage(n.stringify({windowId:e.exports.currentWindowId,type:t,data:o||""}),"*")},createIframe:function(e,t){var n,i,s=r.g.document.createElement("iframe"),a=function(){clearTimeout(n);try{s.onload=null}catch(e){}s.onerror=null},c=function(){s&&(a(),setTimeout((function(){s&&s.parentNode.removeChild(s),s=null}),0),o.unloadDel(i))},u=function(e){s&&(c(),t(e))};return s.src=e,s.style.display="none",s.style.position="absolute",s.onerror=function(){u("onerror")},s.onload=function(){clearTimeout(n),n=setTimeout((function(){u("onload timeout")}),2e3)},r.g.document.body.appendChild(s),n=setTimeout((function(){u("timeout")}),15e3),i=o.unloadAdd(c),{post:function(e,t){setTimeout((function(){try{s&&s.contentWindow&&s.contentWindow.postMessage(e,t)}catch(e){}}),0)},cleanup:c,loaded:a}},createHtmlfile:function(t,n){var i,s,a,c=["Active"].concat("Object").join("X"),u=new r.g[c]("htmlfile"),p=function(){clearTimeout(i),a.onerror=null},l=function(){u&&(p(),o.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())},h=function(e){u&&(l(),n(e))};u.open(),u.write('<html><script>document.domain="'+r.g.document.domain+'";<\/script></html>'),u.close(),u.parentWindow[e.exports.WPrefix]=r.g[e.exports.WPrefix];var d=u.createElement("div");return u.body.appendChild(d),a=u.createElement("iframe"),d.appendChild(a),a.src=t,a.onerror=function(){h("onerror")},i=setTimeout((function(){h("timeout")}),15e3),s=o.unloadAdd(l),{post:function(e,t){try{setTimeout((function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)}),0)}catch(e){}},cleanup:l,loaded:p}}},e.exports.iframeEnabled=!1,r.g.document&&(e.exports.iframeEnabled=("function"==typeof r.g.postMessage||"object"==typeof r.g.postMessage)&&!i.isKonqueror())},4886:(e,t,r)=>{"use strict";var o={};["log","debug","warn"].forEach((function(e){var t;try{t=r.g.console&&r.g.console[e]&&r.g.console[e].apply}catch(e){}o[e]=t?function(){return r.g.console[e].apply(r.g.console,arguments)}:"log"===e?function(){}:o.log})),e.exports=o},2217:e=>{"use strict";e.exports={isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,r,o=1,n=arguments.length;o<n;o++)for(r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}}},8915:(e,t,r)=>{"use strict";var o=r(2017),n="abcdefghijklmnopqrstuvwxyz012345";e.exports={string:function(e){for(var t=n.length,r=o.randomBytes(e),i=[],s=0;s<e;s++)i.push(n.substr(r[s]%t,1));return i.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}},5581:e=>{"use strict";e.exports=function(e){return{filterToEnabled:function(t,r){var o={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach((function(e){e&&("websocket"===e.transportName&&!1===r.websocket||(t.length&&-1===t.indexOf(e.transportName)?e.transportName:e.enabled(r)?(e.transportName,o.main.push(e),e.facadeTransport&&o.facade.push(e.facadeTransport)):e.transportName))})),o}}}},273:(e,t,r)=>{"use strict";var o=r(4564);e.exports={getOrigin:function(e){if(!e)return null;var t=new o(e);if("file:"===t.protocol)return null;var r=t.port;return r||(r="https:"===t.protocol?"443":"80"),t.protocol+"//"+t.hostname+":"+r},isOriginEqual:function(e,t){return this.getOrigin(e)===this.getOrigin(t)},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var r=e.split("?");return r[0]+t+(r[1]?"?"+r[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)},isLoopbackAddr:function(e){return/^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(e)||/^\[::1\]$/.test(e)}}},2828:e=>{e.exports="1.5.2"},4564:(e,t,r)=>{"use strict";var o=r(7418),n=r(7129),i=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/,c=new RegExp("^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+");function u(e){return(e||"").toString().replace(c,"")}var p=[["#","hash"],["?","query"],function(e,t){return d(t.protocol)?e.replace(/\\/g,"/"):e},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],l={hash:1,query:1};function h(e){var t,o=("undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{}).location||{},n={},s=typeof(e=e||o);if("blob:"===e.protocol)n=new m(unescape(e.pathname),{});else if("string"===s)for(t in n=new m(e,{}),l)delete n[t];else if("object"===s){for(t in e)t in l||(n[t]=e[t]);void 0===n.slashes&&(n.slashes=i.test(e.href))}return n}function d(e){return"file:"===e||"ftp:"===e||"http:"===e||"https:"===e||"ws:"===e||"wss:"===e}function f(e,t){e=u(e),t=t||{};var r,o=s.exec(e),n=o[1]?o[1].toLowerCase():"",i=!!o[2],a=!!o[3],c=0;return i?a?(r=o[2]+o[3]+o[4],c=o[2].length+o[3].length):(r=o[2]+o[4],c=o[2].length):a?(r=o[3]+o[4],c=o[3].length):r=o[4],"file:"===n?c>=2&&(r=r.slice(2)):d(n)?r=o[4]:n?i&&(r=r.slice(2)):c>=2&&d(t.protocol)&&(r=o[4]),{protocol:n,slashes:i||d(n),slashesCount:c,rest:r}}function m(e,t,r){if(e=u(e),!(this instanceof m))return new m(e,t,r);var i,s,c,l,y,g,v=p.slice(),E=typeof t,_=this,T=0;for("object"!==E&&"string"!==E&&(r=t,t=null),r&&"function"!=typeof r&&(r=n.parse),i=!(s=f(e||"",t=h(t))).protocol&&!s.slashes,_.slashes=s.slashes||i&&t.slashes,_.protocol=s.protocol||t.protocol||"",e=s.rest,("file:"===s.protocol&&(2!==s.slashesCount||a.test(e))||!s.slashes&&(s.protocol||s.slashesCount<2||!d(_.protocol)))&&(v[3]=[/(.*)/,"pathname"]);T<v.length;T++)"function"!=typeof(l=v[T])?(c=l[0],g=l[1],c!=c?_[g]=e:"string"==typeof c?~(y=e.indexOf(c))&&("number"==typeof l[2]?(_[g]=e.slice(0,y),e=e.slice(y+l[2])):(_[g]=e.slice(y),e=e.slice(0,y))):(y=c.exec(e))&&(_[g]=y[1],e=e.slice(0,y.index)),_[g]=_[g]||i&&l[3]&&t[g]||"",l[4]&&(_[g]=_[g].toLowerCase())):e=l(e,_);r&&(_.query=r(_.query)),i&&t.slashes&&"/"!==_.pathname.charAt(0)&&(""!==_.pathname||""!==t.pathname)&&(_.pathname=function(e,t){if(""===e)return t;for(var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,n=r[o-1],i=!1,s=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),s++):s&&(0===o&&(i=!0),r.splice(o,1),s--);return i&&r.unshift(""),"."!==n&&".."!==n||r.push(""),r.join("/")}(_.pathname,t.pathname)),"/"!==_.pathname.charAt(0)&&d(_.protocol)&&(_.pathname="/"+_.pathname),o(_.port,_.protocol)||(_.host=_.hostname,_.port=""),_.username=_.password="",_.auth&&(l=_.auth.split(":"),_.username=l[0]||"",_.password=l[1]||""),_.origin="file:"!==_.protocol&&d(_.protocol)&&_.host?_.protocol+"//"+_.host:"null",_.href=_.toString()}m.prototype={set:function(e,t,r){var i=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(r||n.parse)(t)),i[e]=t;break;case"port":i[e]=t,o(t,i.protocol)?t&&(i.host=i.hostname+":"+t):(i.host=i.hostname,i[e]="");break;case"hostname":i[e]=t,i.port&&(t+=":"+i.port),i.host=t;break;case"host":i[e]=t,/:\d+$/.test(t)?(t=t.split(":"),i.port=t.pop(),i.hostname=t.join(":")):(i.hostname=t,i.port="");break;case"protocol":i.protocol=t.toLowerCase(),i.slashes=!r;break;case"pathname":case"hash":if(t){var s="pathname"===e?"/":"#";i[e]=t.charAt(0)!==s?s+t:t}else i[e]=t;break;default:i[e]=t}for(var a=0;a<p.length;a++){var c=p[a];c[4]&&(i[c[1]]=i[c[1]].toLowerCase())}return i.origin="file:"!==i.protocol&&d(i.protocol)&&i.host?i.protocol+"//"+i.host:"null",i.href=i.toString(),i},toString:function(e){e&&"function"==typeof e||(e=n.stringify);var t,r=this,o=r.protocol;o&&":"!==o.charAt(o.length-1)&&(o+=":");var i=o+(r.slashes||d(r.protocol)?"//":"");return r.username&&(i+=r.username,r.password&&(i+=":"+r.password),i+="@"),i+=r.host+r.pathname,(t="object"==typeof r.query?e(r.query):r.query)&&(i+="?"!==t.charAt(0)?"?"+t:t),r.hash&&(i+=r.hash),i}},m.extractProtocol=f,m.location=h,m.trimLeft=u,m.qs=n,e.exports=m}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>Wr});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptInvitation:()=>Pe,addContact:()=>je,addToBlackList:()=>Le,declineInvitation:()=>Be,deleteContact:()=>Ue,fetchHistoryMessages:()=>xe,fetchUserInfoById:()=>Ce,getBlacklist:()=>Oe,getChatToken:()=>ke,getRoster:()=>Ne,getSessionList:()=>Re,recallMessage:()=>qe,removeFromBlackList:()=>De,removeRoster:()=>He,subscribe:()=>Ge,subscribed:()=>We,unsubscribed:()=>Fe,updateCurrentUserNick:()=>Ae,updateOwnUserInfo:()=>we,uploadToken:()=>Se});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{addUsersToGroupWhitelist:()=>bt,agreeInviteIntoGroup:()=>ut,agreeJoinGroup:()=>at,blockGroup:()=>Je,changeOwner:()=>$e,createGroupNew:()=>ze,deleteGroupSharedFile:()=>kt,disableSendGroupMsg:()=>Tt,dissolveGroup:()=>ot,enableSendGroupMsg:()=>It,fetchGroupAnnouncement:()=>wt,fetchGroupSharedFileList:()=>xt,getGroup:()=>Ke,getGroupAdmin:()=>Qe,getGroupBlacklistNew:()=>_t,getGroupInfo:()=>Xe,getGroupMsgReadUser:()=>Rt,getGroupWhitelist:()=>Nt,getMuted:()=>mt,groupBlockMulti:()=>gt,groupBlockSingle:()=>yt,inviteToGroup:()=>it,isGroupWhiteUser:()=>St,joinGroup:()=>st,listGroupMember:()=>Ze,listGroups:()=>Ve,modifyGroup:()=>Ye,mute:()=>dt,quitGroup:()=>nt,rejectInviteIntoGroup:()=>pt,rejectJoinGroup:()=>ct,removeAdmin:()=>rt,removeGroupBlockMulti:()=>Et,removeGroupBlockSingle:()=>vt,removeMultiGroupMember:()=>ht,removeMute:()=>ft,removeSingleGroupMember:()=>lt,rmUsersFromGroupWhitelist:()=>Ot,setAdmin:()=>et,updateGroupAnnouncement:()=>Ct,uploadGroupSharedFile:()=>At});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:()=>Gt,addUsersToChatRoomWhitelist:()=>or,chatRoomBlockMulti:()=>Yt,chatRoomBlockSingle:()=>Xt,createChatRoom:()=>jt,deleteChatRoomSharedFile:()=>pr,destroyChatRoom:()=>Ut,disableSendChatRoomMsg:()=>tr,enableSendChatRoomMsg:()=>rr,fetchChatRoomAnnouncement:()=>ar,fetchChatRoomSharedFileList:()=>lr,getChatRoomAdmin:()=>qt,getChatRoomBlacklistNew:()=>er,getChatRoomDetails:()=>Pt,getChatRoomMuted:()=>$t,getChatRoomWhitelist:()=>ir,getChatRooms:()=>Mt,isChatRoomWhiteUser:()=>sr,joinChatRoom:()=>Wt,listChatRoomMember:()=>Ht,modifyChatRoom:()=>Bt,muteChatRoomMember:()=>Vt,quitChatRoom:()=>Ft,removeChatRoomAdmin:()=>Jt,removeChatRoomBlockMulti:()=>Qt,removeChatRoomBlockSingle:()=>Zt,removeMultiChatRoomMember:()=>Dt,removeMuteChatRoomMember:()=>Kt,removeSingleChatRoomMember:()=>Lt,rmUsersFromChatRoomWhitelist:()=>nr,setChatRoomAdmin:()=>zt,updateChatRoomAnnouncement:()=>cr,uploadChatRoomSharedFile:()=>ur});var o=__webpack_require__(8e3),n=__webpack_require__.n(o),i=__webpack_require__(3281),s=__webpack_require__.n(i),a=__webpack_require__(3720),c=__webpack_require__.n(a);const u=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();var p;!function(e){e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR"}(p||(p={}));const l=p;var h,d,f=function(){};function m(){return"undefined"!=typeof swan&&y(swan)?{platform:d.BAIDU,global:swan}:"undefined"!=typeof tt&&y(tt)?{platform:d.TT,global:tt}:"undefined"!=typeof my&&y(my)?{platform:d.ZFB,global:my}:"undefined"!=typeof wx&&y(wx)?{platform:d.WX,global:wx}:"undefined"!=typeof uni&&y(uni)?{platform:d.UNI,global:uni}:{platform:d.WEB,global:window}}function y(e){for(var t=["canIUse","getSystemInfo"],r=0,o=t.length;r<o;r++)if(!e[t[r]])return!1;return!0}!function(e){e[e.SUCCESS=0]="SUCCESS",e[e.TIMEOUT=-1]="TIMEOUT",e[e.UNKNOWN=-2]="UNKNOWN",e[e.PARAMETER_ERROR=-3]="PARAMETER_ERROR"}(h||(h={})),function(e){e.WEB="web",e.WX="wx",e.ZFB="zfb",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni"}(d||(d={}));var g={autoIncrement:0,ajax:function(e){return new Promise((function(t,r){var o=e.dataType||"text",n=e.success||f,i=e.error||f,s=new XMLHttpRequest;s.ontimeout=function(){r({errorType:"timeout_error",xhr:s})},s.onerror=function(){r({errorType:"onerror",xhr:s})},s.onabort=function(){r({errorType:"onabort",xhr:s})},s.onreadystatechange=function(){if(4===s.readyState){if(200===(s.status||0)){try{switch(o){case"text":return n(s.responseText),void t(s.responseText);case"json":var e=JSON.parse(s.responseText);return n(e),void t(e);case"xml":return s.responseXML&&s.responseXML.documentElement?(n(s.responseXML.documentElement),void t(s.responseXML.documentElement)):(i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}));default:i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}return t(s.response||s.responseText),void n(s.response||s.responseText,s)}catch(e){r(e)}return}return r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}0===s.readyState&&(i({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:l.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}))},e.responseType&&s.responseType&&(s.responseType=e.responseType),e.mimeType&&s.overrideMimeType(e.mimeType);var a=e.type||"POST",c=e.data||null,u="";if("get"===a.toLowerCase()&&c){for(var p in c)c.hasOwnProperty(p)&&(u+=p+"="+c[p]+"&");u=u?u.slice(0,-1):u,e.url+=(e.url.indexOf("?")>0?"&":"?")+(u?u+"&":u)+"_v="+(new Date).getTime(),c=null,u=""}s.open(a,e.url);var h=e.headers||{};for(var d in h)h.hasOwnProperty(d)&&s.setRequestHeader(d,h[d]);s.send(c)}))},getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:null},r="string"==typeof e?document.getElementById(e):e;try{if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var o=r.files;if(o.length>0){var n=o.item(0);t.data=n,t.url=window.URL.createObjectURL(n),t.filename=(null==n?void 0:n.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");n=document.getElementById(e).value,t.url=n;var i=n.lastIndexOf("/"),s=n.lastIndexOf("\\"),a=Math.max(i,s);t.filename=a<0?n:n.substring(a+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t}catch(e){throw e}},uploadFile:function(e){var t,r,o=e.accessToken;if(o){var n=e.appKey,i=[],s="",a="";if(n&&(s=(i=n.split("#"))[0],a=i[1]),s||a){var c=e.apiUrl,u=e.uploadUrl||c+"/"+s+"/"+a+"/chatfiles";if((null===(r=null===(t=null==e?void 0:e.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.size)<=0)e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var p=new XMLHttpRequest;p.upload&&p.upload.addEventListener("progress",e.onFileUploadProgress||function(){},!1),p.addEventListener("abort",e.onFileUploadCanceled||function(){},!1),p.addEventListener("error",(function(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:p})}),!1),p.addEventListener("load",(function(t){try{var r=JSON.parse(p.responseText);if(400===p.status&&"content improper"===r.error)return e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,data:p.responseText})}}),!1),p.open("POST",u),p.setRequestHeader("restrict-access","true"),p.setRequestHeader("Accept","*/*"),p.setRequestHeader("Authorization","Bearer "+o);var h=new FormData;h.append("file",e.file.data),p.send(h)}}else e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:l.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})},flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];for(var n=0,i=t?e[n].apply(this,r):r[0];++n<t;)i=e[n].call(this,i);return i}},listenNetwork:function(e,t){var r=m();if(r.platform!==d.WEB){var o=r.global,n=function(r){r.isConnected?e():t()};o.offNetworkStatusChange&&o.offNetworkStatusChange(n),o.onNetworkStatusChange&&o.onNetworkStatusChange(n)}else window.addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))},getEnvInfo:m,wxRequest:function(e){return new Promise((function(t,r){var o=e.success||f,n=e.error||f,i=e.type||"POST",s=e.data||null,a="",c=g.getEnvInfo();if("get"===i.toLowerCase()&&s){for(var u in s)s.hasOwnProperty(u)&&(a+=u+"="+s[u]+"&");a=a?a.slice(0,-1):a,e.url+=(e.url.indexOf("?")>0?"&":"?")+(a?a+"&":a)+"_v="+(new Date).getTime(),s=null,a=""}var p={url:e.url,data:e.data,method:i,headers:{},success:function(e){"200"==e.statusCode||"200"==e.status?(o(e.data),t(e.data)):(n(e),r(e))},complete:function(){},fail:function(e){n(e),r(e)}};"zfb"===c.platform?p.headers=e.headers:p.header=e.headers,c.global.request(p)}))},parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||f,e.onFileDownloadError=e.onFileDownloadError||f;var t=new XMLHttpRequest;t.addEventListener("load",(function(r){e.onFileDownloadComplete(t.response)}),!1),t.addEventListener("error",(function(r){e.onFileDownloadError({type:l.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:t})}),!1);var r=e.method||"GET",o=e.responseType||"blob",n=e.mimeType||"text/plain; charset=x-user-defined";t.open(r,e.url),"undefined"!=typeof Blob?t.responseType=o:t.overrideMimeType(n);var i={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+this.context.accessToken},s=e.headers||{};for(var a in s)i[a]=s[a];for(var a in i)i[a]&&t.setRequestHeader(a,i[a]);t.send(null)}};const v=g;var E=__webpack_require__(4188),_=__webpack_require__.n(E);function T(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}var I,b="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),O=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},N=function(){},S={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(I||(I={}));var R=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=5,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=I,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory;var o=this._getPersistedLevel();null==o&&(o=null==t?"WARN":t),this.logs=[],this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(o,!1,"")}return e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=I[e]),"number"==typeof e&&e>=0&&e<=this.levels.SILENT&&(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r),"undefined"==typeof console&&e<I.SILENT))return"No console available for logging"},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),o=document.createElement("a");o.style.display="none",o.href=r,o.setAttribute("download","sdklog"),document.body.appendChild(o),o.click()}},e.prototype._bindMethod=function(e,t,r){var o=this,n=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof n.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=o.getTime();n.call.apply(n,O([e,s+" IM SDK ["+("log"===t?"debug":t)+"]: "],r,!1))};try{return Function.prototype.bind.call(n,e,i+" IM SDK ["+("log"===t?"debug":t)+"]: ")}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",o="";e.forEach((function(e){o+="object"==typeof e?JSON.stringify(e)+" ":e+" "})),this._cacheLogCall(r+o)},e.prototype._cacheLogCall=function(e){var t=w(e),r=this.logBytes+t,o=this.config.maxCache;if(!(t>=o)){if(r<o)this.logBytes+=t;else for(var n=r-o,i=0;i<n;){var s=this.logs.shift();void 0!==s&&(i+=w(s))}this.logs.push(e)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";"undefined"!=typeof window&&(window.localStorage&&(window.localStorage[this.storageLogLevelKey]=t),this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";"))},e.prototype.replaceLoggingMethods=function(e,t){for(var r=0;r<this.logMethods.length;r++){var o=this.logMethods[r];this[o]=r<e?N:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&b?T:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):N)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){var o=this;return function(){"undefined"!=typeof console&&(o.replaceLoggingMethods.call(o,t,r),o[e].apply(o,arguments))}},e}();function w(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var C=new R("defaultLogger","SILENT");C.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=S[e];return t||(t=S[e]=new R(e,C.getLevel(),C.methodFactory)),t};var A="undefined"!=typeof window?window.log:void 0;C.noConflict=function(){return"undefined"!=typeof window&&window.log===C&&(window.log=A),C},C.getLoggers=function(){return S};const k=C;var x={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"};function M(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var o=e[r].varintValue,n=new(c())(o.low,o.high,o.unsigned).toString();t[e[r].key]=0!==Number(n)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(o=e[r].varintValue,n=new(c())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}const j=function(e,t,r){var o,n,i,s=new(c())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),a=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),u=new(c())(e.id.low,e.id.high,e.id.unsigned).toString(),p=a.ackMessageId?new(c())(a.ackMessageId.low,a.ackMessageId.high,a.ackMessageId.unsigned).toString():"",l="",h=a.from&&a.from.name,d=a.to&&a.to.name;switch(k.debug("thirdMessage:",a),a.type){case 1:l="chat","agoraToken"===this.grantType&&(l="singleChat");break;case 2:l="groupchat","agoraToken"===this.grantType&&(l="groupChat");break;case 3:l="chatroom","agoraToken"===this.grantType&&(l="chatRoom");break;case 4:if(l="read_ack",a.msgConfig)return void(this.onReadMessage&&this.onReadMessage({id:u,type:"read",from:h,to:d,mid:p,groupReadCount:a.ext[0]&&JSON.parse(a.ext[0].stringValue),ackContent:a.ackContent}));this.onReadMessage&&this.onReadMessage({id:u,type:"read",from:h,to:d,mid:p});var f={id:u,type:"read",from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onReadMessage",f));case 5:l="deliver_ack",this.onDeliverdMessage&&this.onDeliverdMessage({id:u,type:"delivery",from:h,to:d,mid:p});var m={id:u,type:"delivery",from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onDeliverdMessage",m));case 6:l="recall",this.onRecallMessage&&this.onRecallMessage({id:u,from:h,to:d,mid:p});var y={id:u,from:h,to:d,mid:p};return void(this.eventHandler&&this.eventHandler.dispatch("onRecallMessage",y));case 7:this.onChannelMessage&&this.onChannelMessage({id:u,type:"channel",chatType:"singleChat",from:h,to:d});var g={id:u,type:"channel",chatType:"singleChat",from:h,to:d};return void(this.eventHandler&&this.eventHandler.dispatch("onChannelMessage",g))}i="chat"===l?"singleChat":"groupchat"===l?"groupChat":"chatRoom";for(var v=0;v<a.contents.length;v++){var E={},_=t.errorCode>0,T=t.errorCode,I=t.reason,b=a.contents[v],O={},N=void 0;switch(a.ext&&(O=M(a.ext)),b.type){case 0:!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,data:b.text,ext:O,sourceMsg:b.text,time:s,msgConfig:a.msgConfig}).msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onTextMessage&&this.onTextMessage(E);var S={id:u,type:"txt",chatType:i,msg:b.text,to:d,from:h,ext:O,time:Number(s)};E.msgConfig&&(S.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onTextMessage",S);break;case 1:var R=(null===(o=null==b?void 0:b.size)||void 0===o?void 0:o.width)||0,w=(null===(n=null==b?void 0:b.size)||void 0===n?void 0:n.height)||0;N=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(N=N+"&share-secret="+b.secretKey),!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,url:N,secret:b.secretKey,filename:b.displayName,thumb:b.thumbnailRemotePath,thumb_secret:b.thumbnailSecretKey,file_length:b.fileLength||"",width:R,height:w,filetype:b.filetype||"",accessToken:this.token,ext:O,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onPictureMessage&&this.onPictureMessage(E);var C={id:u,type:"img",chatType:i,from:h,to:d,url:N||"",width:R,height:w,secret:b.secretKey||"",thumb:b.thumbnailRemotePath||"",thumb_secret:b.thumbnailSecretKey||"",ext:O,time:Number(s)};E.msgConfig&&(C.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onImageMessage",C);break;case 2:N=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(N=N+"&share-secret="+b.secretKey),!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,url:N,secret:b.secretKey,filename:b.displayName,length:b.duration||"",file_length:b.fileLength||"",filetype:b.filetype||"",accessToken:this.token||"",ext:O,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onVideoMessage&&this.onVideoMessage(E);var A={id:u,type:"video",chatType:i,from:h,to:d,url:N,secret:b.secretKey,filename:b.displayName,length:b.duration||0,file:"",file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:O,time:Number(s)};E.msgConfig&&(A.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",A);break;case 3:!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,addr:b.address,lat:b.latitude,lng:b.longitude,ext:O,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onLocationMessage&&this.onLocationMessage(E);var j={id:u,type:"loc",chatType:i,from:h,to:d,addr:b.address,lat:b.latitude,lng:b.longitude,ext:O,time:Number(s)};E.msgConfig&&(j.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",j);break;case 4:N=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(N=N+"&share-secret="+b.secretKey),!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,url:N,secret:b.secretKey,filename:b.displayName,file_length:b.fileLength||"",accessToken:this.token||"",ext:O,length:b.duration,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onAudioMessage&&this.onAudioMessage(E);var U={id:u,type:"audio",chatType:i,from:h,to:d,url:N,secret:b.secretKey,file:b.fileLength,filename:b.displayName,length:b.duration||0,file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:O,time:Number(s)};E.msgConfig&&(U.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",U);break;case 5:N=this.useOwnUploadFun?b.remotePath:(b.remotePath&&this.apiUrl+b.remotePath.substr(b.remotePath.indexOf("/",9)))+"?em-redirect=true",b.secretKey&&!this.useOwnUploadFun&&(N=N+"&share-secret="+b.secretKey),!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,url:N,secret:b.secretKey,filename:b.displayName,file_length:b.fileLength,accessToken:this.token||"",ext:O,time:s,msgConfig:a.msgConfig}).delay&&delete E.delay,!E.msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onFileMessage&&this.onFileMessage(E);var P={id:u,type:"file",chatType:i,from:h,to:d,url:N,secret:b.secretKey,file:"",filename:b.displayName,length:b.duration||0,file_length:b.fileLength||0,filetype:b.filetype||"",accessToken:this.token||"",ext:O,time:Number(s)};E.msgConfig&&(P.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onFileMessage",P);break;case 6:!(E={id:u,type:l,contentsType:x[b.type],from:h,to:d,action:b.action,ext:O,time:s,msgConfig:a.msgConfig}).msgConfig&&delete a.msgConfig,E.error=_,E.errorText=I,E.errorCode=T,!r&&this.onCmdMessage&&this.onCmdMessage(E);var B={id:u,type:"cmd",chatType:i,from:h,to:d,action:b.action,ext:O,time:Number(s)};E.msgConfig&&(B.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",B);break;case 7:var L={},D={};a.contents[0].customExts&&(L=M(a.contents[0].customExts)),a.contents[0].params&&(D=M(a.contents[0].params)),E={id:u,type:l,contentsType:x[b.type],from:h,to:d,customEvent:b.customEvent,params:D,customExts:L,ext:O,time:s},!r&&this.onCustomMessage&&this.onCustomMessage(E);var G={id:u,type:"custom",chatType:i,from:h,to:d,customEvent:b.customEvent,params:D,customExts:L,ext:O,time:Number(s)};E.msgConfig&&(G.msgConfig=E.msgConfig),this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",G)}return E}},U=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;(function(e){var r=this,o={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status};return({32:function(){var e,n;o.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},31:function(){var e,n;o.type=t.isChatroom?"muteChatRoom":"muteGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},30:function(){var e,n;o.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},29:function(){var e,n;o.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},28:function(){var e;o.type="deleteFile",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},27:function(){var e;o.type="uploadFile",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},26:function(){var e;o.type="deleteAnnouncement",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},25:function(){var e;o.type="updateAnnouncement",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},24:function(){var e;o.type="removeMute",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},23:function(){var e;o.type="addMute",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},22:function(){var e;o.type="removeAdmin",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},21:function(){var e;o.type="addAdmin",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},20:function(){var e;o.type="changeOwner",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},19:function(){var e;o.type="direct_joined",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},18:function(){var e,n;o.type=t.isChatroom?"leaveChatRoom":"leaveGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},17:function(){var e,n;o.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},16:function(){var e;o.type="unblock",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},15:function(){var e;o.type="block",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},14:function(){var e;o.type="update",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},13:function(){var e;o.type="allow",o.reason=t.reason,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},12:function(){var e;o.type="ban",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},11:function(){var e;o.type="getBlackList",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},10:function(){var e;o.type="removedFromGroup",o.kicked=o.to,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},9:function(){var e;o.type="invite_decline",o.kicked=o.to,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},8:function(){var e;o.type="invite_accept",o.kicked=o.to,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},7:function(){var e;o.type="invite",o.kicked=o.to,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},6:function(){var e;o.type="joinPublicGroupDeclined",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},5:function(){var e;o.type="joinPublicGroupSuccess",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},4:function(){var e;o.type="joinGroupNotifications",o.reason=t.reason,r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},3:function(){var e;o.type="leave",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},2:function(){var e;o.type="join",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)},1:function(){var e;o.type="deleteGroupChat",r.onPresence&&r.onPresence(o),null===(e=r.eventHandler)||void 0===e||e.dispatch("onGroupChange",o)}}[e]||function(){console.error("No match operation "+e)})()}).call(this,r)};var P;!function(e){e[e.Add=2]="Add",e[e.Remove=3]="Remove",e[e.Accept=4]="Accept",e[e.Decline=5]="Decline",e[e.Ban=6]="Ban",e[e.Allow=7]="Allow"}(P||(P={}));const B={operatRoster:function(e,t){var r=[],o=this.root.lookup("easemob.pb.RosterBody"),n=o.decode(r);switch(t){case"add":n.operation=P.Add;break;case"remove":n.operation=P.Remove;break;case"accept":n.operation=P.Accept;break;case"decline":n.operation=P.Decline;break;case"ban":n.operation=P.Ban;break;case"allow":n.operation=P.Allow}n.from=this.context.jid;var i=[];if("string"==typeof e.to)i.push({appKey:this.appKey||this.context.appKey,name:e.to,domain:"easemob.com"});else if(e.to instanceof Array)for(var s=0;s<e.to.length;s++)i.push({appKey:this.appKey,name:e.to[s],domain:"easemob.com"});n.to=i,n.reason=e.message,n=o.encode(n).finish();var a=this.root.lookup("easemob.pb.Meta").decode(r);a.id=e.id||this.getUniqueId(),a.from=this.context.jid,a.to={domain:"@easemob.com"},a.ns=3,a.payload=n;var c=this.root.lookup("easemob.pb.CommSyncUL"),u=c.decode(r);u.meta=a,u=c.encode(u).finish();var p=this.root.lookup("easemob.pb.MSync"),l=p.decode(r);l.version=this.version,l.encryptType=[0],l.command=0,l.guid=this.jid,l.payload=u,l=p.encode(l).finish();var h=this.mSync.base64transform(l);this.sock.send(h)},handleRosterMsg:function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:a.to[0].name,from:a.from.name,status:a.reason};switch(a.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactRefuse",c);break;case 6:case 7:this.getBlacklist();break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(s=this.eventHandler)||void 0===s||s.dispatch("onContactRefuse",c)}this.onPresence&&this.onPresence(c)}},L=function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);switch(a.operation){case 0:this.onStatisticMessage&&this.onStatisticMessage(a),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",a);break;case 1:s=u.create({type:l.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.logOut=!0,this.onError&&this.onError(s),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",s);break;case 2:s=u.create({type:l.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(s),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",s);break;case 3:s=u.create({type:l.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(s),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",s);break;case 4:s=u.create({type:l.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(s),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",s)}};var D=function(){return D=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},D.apply(this,arguments)};function G(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r=n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),s=i.decode(o);s.compressType=this.compressType,s.encryptType=this.encryptType,s.osType=this.osType,s.version=this.version,s.deviceName=t,s.resource=e,s.deviceUuid=r,s.auth="$t$"+this.token,s=i.encode(s).finish();var a=this.root.lookup("easemob.pb.MSync"),c=a.decode(o);return c.version=this.version,c.guid=this.context.jid,c.auth="$t$"+this.token,c.command=3,c.deviceId=t,c.encryptType=this.encryptType,c.payload=s,a.encode(c).finish()}function W(e,t){var r=this,o=v.getEnvInfo();if("web"===o.platform||"zfb"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=_().btoa(n),"web"===o.platform?n:{data:n,isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(k.debug("发送失败重联"),r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var s=e;return{data:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!=e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function F(e,t){switch(e.ns){case 0:L.call(this,e);break;case 1:j.call(this,e,t);break;case 2:U.call(this,e);break;case 3:B.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this)}}function H(e,t){for(var r=function(r){var n=new(c())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return{value:void 0};var i=e[r].from.name,s=e[r].to?e[r].to.name:"",a=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=Nr.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:s,isGroup:a}),F.call(o,e[r],t)},o=this,n=0;n<e.length;n++){var i=r(n);if("object"==typeof i)return i.value}}function q(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");if(t=t.decode(e.payload),"agoraToken"===this.grantType){var r=new(c())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();this.compareTokenExpireTime(Number(r),this.expirationTime)}if(0===t.unread.length)Z.call(this);else for(var o=0;o<t.unread.length;o++)V.call(this,t.unread[o].queue)}function z(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var o=this.root.lookup("easemob.pb.Meta").decode(e);o.id=(new Date).valueOf(),o.ns=0,o.payload=r;var n=this.root.lookup("easemob.pb.CommSyncUL"),i=n.decode(e);i.meta=o,i=n.encode(i).finish();var s=this.root.lookup("easemob.pb.MSync"),a=s.decode(e);return a.version=this.version,a.encryptType=[0],a.command=0,a.payload=i,s.encode(a).finish()}function J(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),o=r.decode(t);o.queue=e,o=r.encode(o).finish();var n=this.root.lookup("easemob.pb.MSync"),i=n.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=o,n.encode(i).finish()}function V(e){k.debug("sendBackqueue");var t=J.call(this,e);he.call(this,t)}function K(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(c())(e.low,e.high,e.unsigned).toString(),n=o.encode(n).finish();var i=this.root.lookup("easemob.pb.MSync"),s=i.decode(r);return s.version=this.version,s.encryptType=this.encryptType,s.command=0,s.payload=n,i.encode(s).finish()}function $(e,t){k.debug("sendLastSession");var r=K.call(this,e,t);he.call(this,r)}function X(e){var t,r=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=r.resource),this.clientResource=r.resource,0===r.status.errorCode){if(this.onOpened&&this.onOpened(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onConnected"),"agoraToken"===this.grantType){var o=Date.now();this.expiresIn=this.expirationTime-o,this.tokenExpireTimeCountDown(this.expiresIn)}Y.call(this),ee.call(this),Q.call(this),Z.call(this)}else this.onError&&this.onError({type:l.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function Y(){if(this.unSendMsgArr.length>0){for(var e=0;e<this.unSendMsgArr.length;e++){var t=this.unSendMsgArr[e];le.call(this,t)}this.unSendMsgArr=[]}}function Z(){var e=z.call(this);he.call(this,e)}function Q(){var e=re.call(this);he.call(this,e)}function ee(){var e=this;te.call(this),this.heartBeatID=setInterval((function(){Q.call(e)}),this.heartBeatWait)}function te(){clearInterval(this.heartBeatID)}function re(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function oe(e,t){return e.some((function(e){return e.name===t.name}))}function ne(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice").decode(e.payload);oe(this._queues,r.queue)||this.clientResource===r.queue.clientResource&&r.queue.name===this.context.userId||(this._queues.push(r.queue),this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout((function(){var e=r.queue;oe(t._queues,e)&&(V.call(t,r.queue),k.debug("⬇q:",e))}),1e4),1===this._queues.length&&V.call(this,r.queue))}function ie(e){var t=v.getEnvInfo();if("web"===t.platform||"zfb"===t.platform){for(var r=_().atob(e.data),o=[],n=0,i=r.length;n<i;++n)o.push(r.charCodeAt(n));return this.root.lookup("easemob.pb.MSync").decode(o)}return this.root.lookup("easemob.pb.MSync").decode(e.data)}function se(e){switch(e.command){case 0:ae.call(this,e);break;case 1:q.call(this,e);break;case 2:ne.call(this,e);break;case 3:X.call(this,e)}}function ae(e){var t,r,o,n=this.root.lookup("easemob.pb.CommSyncDL");n=n.decode(e.payload);var i=new(c())(n.serverId.low,n.serverId.high,n.serverId.unsigned).toString(),s=new(c())(n.metaId.low,n.metaId.high,n.metaId.unsigned).toString();if(0!==n.metas.length)try{H.call(this,n.metas,n.status)}catch(e){this.onError&&this.onError({type:l.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(n.isLast){var a=-1;return this._queues.some((function(e,t){return e.name===n.name&&(a=t,!0)}))&&a>0&&this._queues.splice(a,1),void(this._queues.length>0&&(V.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer)))}$.call(this,n.nextKey,n.queue)}else if(n.isLast){var p=-1;this._queues.some((function(e,t){return e.name===n.queue.name&&(p=t,!0)}))&&this._queues.splice(p,1),this._queues.length>0&&(V.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(n.status&&0===n.status.errorCode){if(this._msgHash[s]){try{(null===(t=this._msgHash[s])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[s].resolve({localMsgId:s,serverMsgId:i}),(null===(r=this._msgHash[s])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[s].success(s,i)}catch(e){this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:s,mid:i,to:this._msgHash[s].to,time:0}),delete this._msgHash[s]}}else if(n.status&&15===n.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:i}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject({type:l.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(n.status&&1===n.status.errorCode){var h=void 0;switch(n.status.reason){case"blocked":h=l.PERMISSION_DENIED;break;case"group not found":h=l.GROUP_NOT_EXIST;break;case"not in group or chatroom":h=l.GROUP_NOT_JOINED;break;case"exceed recall time limit":h=l.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":h=l.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":h=l.SERVICE_NOT_ALLOW_MESSAGING;break;default:h=l.SERVER_UNKNOWN_ERROR}if(this._msgHash[s]){var d=u.create({type:h,message:n.status.reason||"",data:{id:s,mid:i}});this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:h,reason:n.status.reason?n.status.reason:"",data:{id:s,mid:i}})}}else if(n.status&&7===n.status.errorCode)"sensitive words"===n.status.reason&&this._msgHash[s]?(d=u.create({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:s,mid:i,reason:"sensitive words"}})):"blocked by mod_antispam"===n.status.reason&&this._msgHash[s]&&(d=u.create({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:s,mid:i,reason:"blocked by mod_antispam"}}));else if(n.status&&19===n.status.errorCode)this._msgHash[s]&&(d=u.create({type:l.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:n.status.reason||"",data:{id:s,mid:i}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:s,mid:i,reason:n.status.reason}}));else if(this._msgHash[s]){try{d=u.create({type:l.WEBIM_LOAD_MSG_ERROR,message:(null===(o=n.status)||void 0===o?void 0:o.reason)||"",data:{id:s,mid:i,reason:n.status&&n.status.reason}}),this._msgHash[s].reject instanceof Function&&this._msgHash[s].reject(d),this._msgHash[s].fail instanceof Function&&this._msgHash[s].fail({type:l.WEBIM_LOAD_MSG_ERROR,data:{errorCode:n.status&&n.status.errorCode,reason:n.status&&n.status.reason}})}catch(e){this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[s]}else this.onError&&this.onError({type:l.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"})}function ce(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),o=[];for(var n in e){var i=r.decode(t);i.key=n,"object"==typeof e[n]?(i.type=8,i.stringValue=JSON.stringify(e[n])):"string"==typeof e[n]?(i.type=7,i.stringValue=e[n]):"boolean"==typeof e[n]?(i.type=1,i.varintValue=!0===e[n]?1:0):Number.isInteger(e[n])?(i.type=2,i.varintValue=e[n]):(i.type=6,i.doubleValue=e[n]),o.push(i)}return o}function ue(e){var t,r,o=[];if(this.root){var n,i=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(n=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":i.type=0,i.text=e.msg;break;case"img":i.type=1,e.body?(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):(i.displayName=e.file.filename,i.remotePath=e.file.url,i.secretKey=e.file.secret,i.fileLength=e.file.file_length,i.size=e.file.size,i.thumbnailDisplayName=e.file.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.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.customEvent=e.customEvent,i.customExts=ce.call(this,e.customExts)}var s=[];e.ext&&(s=ce.call(this,e.ext));var a=this.root.lookup("easemob.pb.MessageBody"),c=a.decode(o);c.from={name:this.context.jid.name},c.to={name:e.to},"channel"===e.type?c.type=7:"recall"===e.type?(c.type=6,c.ackMessageId=e.ackId):"delivery"===e.type?(c.type=5,c.ackMessageId=e.ackId):"read"===e.type?(c.type=4,c.ackMessageId=e.ackId,e.msgConfig&&"groupChat"===n&&(c.msgConfig=e.msgConfig,c.ackContent=e.ackContent)):"chatRoom"===n?c.type=3:"groupChat"===n?(c.type=2,e.msgConfig&&(c.msgConfig=e.msgConfig)):"singleChat"===n&&(c.type=1),c.contents=[i],c.ext=s,c=a.encode(c).finish();var u=this.root.lookup("easemob.pb.Meta").decode(o);u.id=e.id;var p="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(p="conference.easemob.com"),u.from=this.context.jid,u.to={appKey:this.appKey,name:e.to,domain:p},u.ns=1,u.payload=c;var h=this.root.lookup("easemob.pb.CommSyncUL"),d=h.decode(o);d.meta=u,d=h.encode(d).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(o);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.guid=this.context.jid,m.payload=d,f.encode(m).finish()}e.fail&&e.fail({type:l.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function pe(e){var t=this;return e.file?(e.accessToken=this.token,e.appKey=this.appKey,e.apiUrl=this.apiUrl,e.body&&e.body.url?ue.call(this,e):new Promise((function(r,o){var n=e.onFileUploadComplete;e.onFileUploadComplete=function(i){var s;if(i.entities[0]["file-metadata"]){var a=i.entities[0]["file-metadata"]["content-length"];e.file_length=a,e.filetype=i.entities[0]["file-metadata"]["content-type"],a>204800&&(e.thumbnail=!0)}e.body={type:e.type||"file",secret:i.entities[0]["share-secret"],filename:e.file.filename||e.filename,url:(t.isHttpDNS?t.apiUrl+i.uri.substr(i.uri.indexOf("/",9)):i.uri)+"/"+i.entities[0].uuid,length:e.length||0,filetype:e.filetype||e.file.filetype,file_length:(null===(s=null==e?void 0:e.ext)||void 0===s?void 0:s.file_length)||0,size:{width:e.width||0,height:e.height||0}},e.file.url=i.uri,n instanceof Function&&n(i,e.id);var c=ue.call(t,e);he.call(t,c),t._msgHash[e.id]=D(D({},e),{resolve:r,reject:o})},v.uploadFile.call(t,e)}))):e}function le(e){var t=this;return new Promise((function(r,o){if(("file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type)&&e.file)return pe.call(t,e);var n=ue.call(t,e);he.call(t,n,e.id),e.id&&(t._msgHash[e.id]=D(D({},e),{resolve:r,reject:o}))}))}function he(e,t){if(!this.isOpened())return this.unSendMsgArr.push(e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.socketHost.length&&this.isHttpDNS||!this.isHttpDNS)&&(k.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnect()),void(this.onError&&this.onError({type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var r=W.call(this,e,t);this.sock.send(r)}const de=function(e,t){return e.send=le,e.sendMsg=le,{generateProvision:G.bind(e),base64transform:W.bind(e),distributeMeta:F.bind(e),decodeMeta:H.bind(e),decodeUnreadDL:q.bind(e),_rebuild:z.bind(e),_lastsession:K.bind(e),receiveProvision:X.bind(e),isInQueue:oe.bind(e),decodeNotice:ne.bind(e),decodeMSync:ie.bind(e),distributeMSync:se.bind(e),encodeChatMsg:ue.bind(e),upLoadFile:pe.bind(e),send:le.bind(e),stopHeartBeat:te.bind(e)}};var fe=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in k.debug("dispatch event: "+e,t),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}();const me=fe;var ye=function(){};function ge(e){this.onOpened=e.onOpened||ye,this.onPresence=e.onPresence||ye,this.onTextMessage=e.onTextMessage||ye,this.onPictureMessage=e.onPictureMessage||ye,this.onAudioMessage=e.onAudioMessage||ye,this.onVideoMessage=e.onVideoMessage||ye,this.onFileMessage=e.onFileMessage||ye,this.onLocationMessage=e.onLocationMessage||ye,this.onCmdMessage=e.onCmdMessage||ye,this.onCustomMessage=e.onCustomMessage||ye,this.onReceivedMessage=e.onReceivedMessage||ye,this.onDeliverdMessage=e.onDeliverdMessage||ye,this.onReadMessage=e.onReadMessage||ye,this.onRecallMessage=e.onRecallMessage||ye,this.onMutedMessage=e.onMutedMessage||ye,this.onError=e.onError||ye,this.onOffline=e.onOffline||ye,this.onOnline=e.onOnline||ye,this.onRoster=e.onRoster||ye,this.onStatisticMessage=e.onStatisticMessage||ye,this.onCreateGroup=e.onCreateGroup||ye,this.onBlacklistUpdate=e.onBlacklistUpdate||ye,this.onContactAgreed=e.onContactAgreed||ye,this.onContactRefuse=e.onContactRefuse||ye,this.onContactDeleted=e.onContactDeleted||ye,this.onContactAdded=e.onContactAdded||ye,this.onTokenWillExpire=e.onTokenWillExpire||ye,this.onTokenExpired=e.onTokenExpired||ye}function ve(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:l.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function Ee(){var e;if(!this.context.accessToken){var t=u.create({type:l.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function _e(){return Ee.call(this)&&ve.call(this)}var Te=function(){return Te=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Te.apply(this,arguments)},Ie=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))},be=function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function Oe(e){var t=this;if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o={};r.data.forEach((function(e){o[e]={name:e}})),t.onBlacklistUpdate&&t.onBlacklistUpdate(o),"function"==typeof(null==e?void 0:e.success)&&e.success(r)},error:function(r){t.onBlacklistUpdate&&t.onBlacklistUpdate({}),"function"==typeof e.error&&e.error(r)}};return v.ajax(a)}function Ne(e){var t=this;if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o=[];r.data.forEach((function(e){o.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(o),t.onRoster&&t.onRoster(o)},error:function(t){"function"==typeof e.error&&e.error(t)}};return v.ajax(a)}function Se(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');if("string"!=typeof e.deviceToken||""===e.deviceToken)throw Error('Invalid parameter: "deviceToken"');if("string"!=typeof e.notifierName||""===e.notifierName)throw Error('Invalid parameter: "notifierName"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Re(e){if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/user_channels",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function we(e,t){if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],c={};if("undefined"!=typeof wx||"undefined"!=typeof qq)if("string"==typeof e){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");a.forEach((function(t){a.includes(t)&&void 0!==e[t]&&(c[t]=e[t])}))}else if("string"==typeof e){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var p=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);p.push(r+"="+o)}})),c=p.join("&")}var h={url:this.apiUrl+"/"+n+"/"+i+"/metadata/user/"+this.user,type:"PUT",data:c,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/x-www-form-urlencoded"}};return v.ajax(h)}function Ce(e,t){if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c=[];if("string"==typeof e)c=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");c=e}o="string"==typeof t?[t]:"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var p={url:this.apiUrl+"/"+i+"/"+s+"/metadata/user/get",type:"POST",data:JSON.stringify({targets:c,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return v.ajax(p)}function Ae(e){if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return v.ajax(s)}function ke(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "agoraToken"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i={url:this.apiUrl+"/"+o+"/"+n+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return v.ajax(i)}function xe(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!_e.call(t)){var n=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=t.count||20,i=this;Me.call(this,{count:n,isGroup:!!t.isGroup,queue:t.queue,start:t.start,success:function(o){if(o.msgs.length>=n||o.is_last){var s=o.msgs.splice(0,n).reverse();t.success&&t.success(s),r(s)}else e.call(i,Te(Te({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e)}))}function Me(e){var t=this,r=e.queue,o=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),n=this.context.userId,i=e.start||-1,s=e.count||20;if(o.msgs.length>=s||o.is_last)"function"==typeof e.success&&e.success(o);else{o&&o.next_key&&(i=o.next_key),e.start&&(i=e.start);var a={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},c=this.context,p=c.orgName,h=c.appName,d=function(r){if(r.error&&r.error_description){var o=u.create({type:l.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:"fetch history messages error",data:r});t.onError&&t.onError(o)}"function"==typeof e.fail&&e.fail(d)},f={url:this.apiUrl+"/"+p+"/"+h+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token},data:JSON.stringify(a),success:function(r){var n=null==r?void 0:r.data;if(!r.data.msgs)return"function"==typeof e.success&&e.success(o),o.is_last=!0,void(o.next_key="");var i=n.msgs,s=i.length;o.is_last=n.is_last,o.next_key=n.next_key;for(var a=function(e){var r,o=t.mSync.decodeMSync(e);return 1==o.ns&&(r=j.call(t,o,{errorCode:0,reason:""})),r},c=0;c<s;c++){var u=a(i[c].msg);u&&o.msgs.push(u)}"function"==typeof e.success&&e.success(o)},error:d};v.ajax(f)}}function je(e,t){var r=this;return void 0===t&&(t=""),new Promise((function(o,n){return Ie(r,void 0,void 0,(function(){var r,i;return be(this,(function(s){return r=this.getUniqueId(),i={id:r,to:e,message:t},this._msgHash[r]=Te(Te({},i),{resolve:o,reject:n}),B.operatRoster.call(this,i,"add"),[2]}))}))}))}function Ue(e){var t=this;return new Promise((function(r,o){return Ie(t,void 0,void 0,(function(){var t,n;return be(this,(function(i){return t=this.getUniqueId(),n={id:t,to:e},this._msgHash[t]=Te(Te({},n),{resolve:r,reject:o}),B.operatRoster.call(this,n,"remove"),[2]}))}))}))}function Pe(e){var t=this;return new Promise((function(r,o){return Ie(t,void 0,void 0,(function(){var t,n;return be(this,(function(i){return t=this.getUniqueId(),n={id:t,to:e},this._msgHash[t]=Te(Te({},n),{resolve:r,reject:o}),B.operatRoster.call(this,n,"accept"),[2]}))}))}))}function Be(e){var t=this;return new Promise((function(r,o){return Ie(t,void 0,void 0,(function(){var t,n;return be(this,(function(i){return t=this.getUniqueId(),n={id:t,to:e},this._msgHash[t]=Te(Te({},n),{resolve:r,reject:o}),B.operatRoster.call(this,n,"decline"),[2]}))}))}))}function Le(e){var t=this;return new Promise((function(r,o){return Ie(t,void 0,void 0,(function(){var t,n;return be(this,(function(i){return t=this.getUniqueId(),n={id:t,to:e.name},this._msgHash[t]=Te(Te({},n),{resolve:r,reject:o}),B.operatRoster.call(this,{to:e.name},"ban"),[2]}))}))}))}function De(e){var t=this;return new Promise((function(r,o){return Ie(t,void 0,void 0,(function(){var t,n;return be(this,(function(i){return t=this.getUniqueId(),n={id:t,to:e.name},this._msgHash[t]=Te(Te({},n),{resolve:r,reject:o}),B.operatRoster.call(this,{to:e.name},"allow"),[2]}))}))}))}function Ge(e){B.operatRoster.call(this,e,"add")}function We(e){B.operatRoster.call(this,e,"accept")}function Fe(e){B.operatRoster.call(this,e,"decline")}function He(e){B.operatRoster.call(this,e,"remove")}function qe(e){var t="";void 0!==e.chatType?t=e.chatType:void 0!==e.type&&(t="chat"==e.type?"singleChat":e.type);var r={id:this.getUniqueId(),type:"recall",chatType:t,ackId:e.mid,to:e.to,success:e.success,fail:e.fail};this.mSync.send(r,this)}function ze(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,desc:e.data.groupname,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:function(r){e.success&&e.success(r),t.onCreateGroup&&t.onCreateGroup(r)},error:e.error};return v.ajax(a)}function Je(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},c={type:"PUT",url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user,data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Ve(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.limit,cursor:e.cursor};e.cursor||delete s.cursor;var a={url:this.apiUrl+"/"+o+"/"+n+"/publicchatgroups",type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Ke(e){if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return v.ajax(s)}function $e(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return v.ajax(a)}function Xe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Ye(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={groupname:e.groupName,description:e.description},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Ze(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Qe(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function et(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={newadmin:e.username},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function rt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function ot(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function nt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function it(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function st(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function at(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!0,reason:"no clue"},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function ct(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function ut(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!0},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function pt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!1},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function lt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function ht(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.users.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function dt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration||e.muteDuration<0)throw Error('Invalid parameter: "muteDuration"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:[e.username],mute_duration:e.muteDuration},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return v.ajax(c)}function ft(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function mt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function yt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function gt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.usernames},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function vt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Et(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.usernames.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function _t(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Tt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function It(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function bt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.users},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Ot(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Nt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function St(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Rt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+i},success:e.success,error:e.error};return v.ajax(s)}function wt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Ct(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement||""===e.announcement)throw Error('Invalid parameter: "announcement"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={announcement:e.announcement},c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function At(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(_e.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.groupId;v.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatgroups/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey})}}function kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.fileId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function xt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Mt(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},data:o,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:l.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return v.ajax(c)}function jt(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,s=(o.accessToken,{url:this.apiUrl+"/"+n+"/"+i+"/chatrooms",dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+e.token||0,"Content-Type":"application/json"},success:e.success,error:e.error});return v.ajax(s)}function Ut(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,{url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+e.token||0},success:e.success,error:e.error});return v.ajax(i)}function Pt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Bt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Lt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Dt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Gt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Wt(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.roomId+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(s)}function Ft(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!_e.call(this)){var r=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.roomId+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+s},success:function(r){t._load_msg_cache=t._load_msg_cache.filter((function(t){return(!t.isGroup||t.to!==e.roomId)&&t})),"function"==typeof e.success&&e.success(r)},error:e.error};return v.ajax(a)}function Ht(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function qt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function zt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={newadmin:e.username},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Jt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Vt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration||e.muteDuration<0)throw Error('Invalid parameter: "muteDuration"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:[e.username],mute_duration:e.muteDuration},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return v.ajax(c)}function Kt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function $t(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Xt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Yt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.usernames},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Zt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function Qt(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.usernames.join(","),c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function er(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function tr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function rr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function or(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.users},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function nr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function ir(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function sr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function ar(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function cr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement||""===e.announcement)throw Error('Invalid parameter: "announcement"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={announcement:e.announcement},c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function ur(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(_e.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.roomId;v.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatrooms/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey})}}function pr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a=e.fileId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(c)}function lr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!_e.call(this)){var t=u.create({type:l.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}var hr=function(){return hr=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},hr.apply(this,arguments)},dr=v.getEnvInfo(),fr=function(){},mr=function(){function o(n){this.isHttpDNS=!0,this.isDebug=n.isDebug||!1,this.isHttpDNS=void 0===n.isHttpDNS||n.isHttpDNS,this.heartBeatWait=n.heartBeatWait||3e4,this.autoReconnectNumMax=n.autoReconnectNumMax||5,this.dnsArr=["https://rs.easemob.com","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.appKey=n.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=n.apiUrl||"",this.url=n.url||"",this.https=window&&"https:"===window.location.protocol,this.version="4.0.0",this.deviceId=n.deviceId||"webim",this.osType=16,this.useOwnUploadFun=n.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unSendMsgArr=[],this.mr_cache={};var i=this.appKey.split("#");if(2!==i.length&&i[0]&&i[1])throw Error("Illegal appkey: "+this.appKey);this.orgName=i[0],this.appName=i[1],this.listen=ge.bind(this),this.mSync=this.usePlugin(de),this.eventHandler=this.usePlugin(me),Object.assign(o.prototype,e),Object.assign(o.prototype,t),Object.assign(o.prototype,r)}return o.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},o.prototype.listen=function(e){},o.prototype.addEventHandler=function(e,t){},o.prototype.removeEventHandler=function(e){},o.prototype.registerUser=function(e){if(this.isHttpDNS){this.dnsIndex=0;var t=hr(hr({},e),{user:e.username,pwd:e.password,nickname:e.nickname,success:e.success,error:e.error});return br.call(this,"signup",t)}return yr.call(this,e)},o.prototype.open=function(e){k.debug("open"),e.accessToken&&(this.token=e.accessToken),this.isHttpDNS?br.call(this,"login",e):gr.call(this,e)},o.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},o.prototype.close=function(){this.logOut=!0,this.context.status=l.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=l.STATUS_CLOSED},o.prototype.stopHeartBeat=function(){k.debug("stopHeartBeat"),clearInterval(this.heartBeatID)},o.prototype._checkOpenParams=function(e){return Tr.call(this,e)},o.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},o.prototype.heartBeat=function(){},o.prototype.getChatToken=function(e){var t=this.context.appName,r=this.context.orgName,o={url:this.apiUrl+"/"+r+"/"+t+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return v.ajax(o)},o.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getChatToken(e).then((function(e){var r=Date.now();return t.expirationTime=e.expire_timestamp,t.expiresIn=e.expire_timestamp-r,t.token=e.access_token,t.clearTokenTimeout(t),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e.access_token,expire:e.expire_timestamp}})):Promise.reject({status:!1})},o.prototype.tokenExpireTimeCountDown=function(e){var t=this;this.tokenWillExpireTimer=setTimeout((function(){t.onTokenExpired&&t.onTokenExpired(),k.info("onTokenWillExpire")}),e/2),this.tokenExpiredTimer=setTimeout((function(){k.info("onTokenExpired"),t.onTokenExpired&&t.onTokenExpired(),t.close()}),e)},o.prototype.compareTokenExpireTime=function(e,t){var r=Number(t)-Number(e);k.debug("compareTokenExpireTime",r),r<=this.expiresIn/2&&r>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),k.info("onTokenWillExpire")):r<=0&&(this.closeByTokenExpired(),k.info("closeByTokenExpired"))},o.prototype.closeByTokenExpired=function(){k.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),this.close()},o.prototype.reconnect=function(){var e=this;k.info("reconnect: time",this.times),k.info("reconnect sock.readyState: ",this.sock.readyState),0!==this.sock.readyState&&1!==this.sock.readyState&&(this.isHttpDNS&&(this.hostIndex,this.socketHost.length),this.hostIndex++,this.hostIndex>=this.socketHost.length-1&&(this.hostIndex=this.socketHost.length-1),setTimeout((function(){k.info("login sock.readyState: ",e.sock.readyState),e.sock.close(),1!==e.sock.readyState&&(_r.call(e,{access_token:e.context.accessToken}),e.autoReconnectInterval+=e.times*e.times,e.times++)}),500*this.times),this.autoReconnectNumTotal++)},o.prototype.send=function(e){return Promise.resolve(null)},o.max_cache_length=100,o._getSock=function(){},o}();function yr(e){var t=this,r=e.success||fr,o=e.error||fr;if(!this.orgName&&!this.appName){var n=u.create({type:l.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"signup error"});return o(n),Promise.reject(n)}var i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""}),success:r,error:function(r){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,Or.call(t,"signup"),yr.call(t,e),Promise.reject(r)):(t.clear(),o(r))}};return v.ajax(i).catch((function(e){console.warn(e)}))}function gr(e){var t=this;if(Tr.call(this,e)&&(Ir.call(this,e),!this.isOpened())){if(this.user=e.user,e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(r){k.info("getChatToken result:",r),Date.now(),t.expirationTime=r.expire_timestamp,t.token=r.access_token,t._login(hr(hr({},e),{access_token:r.access_token}),t)})).catch((function(e){t.onError&&t.onError({type:l.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e})}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,_r.call(this,e);else{this.grantType="password";var r={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},o=JSON.stringify(r),n={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:o,success:function(r){"function"==typeof e.success&&e.success(r),t.token=r.access_token,t.context.restTokenData=r.access_token,t.context.accessToken=r.access_token,_r.call(t,r)}||fr,error:function(r){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,Or.call(t,"login"),void gr.call(t,e)):(t.clear(),r.error&&r.error_description?(o=u.create({type:l.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:r.error_description,data:r}),t.onError&&t.onError(o)):(o=u.create({type:l.WEBIM_CONNCTION_OPEN_ERROR,message:"login failed",data:r}),t.onError&&t.onError(o)),"function"==typeof e.error&&e.error(o),Promise.reject(o));var o}||fr,version:"4.0.0"};v.ajax(n).catch((function(e){console.warn(e)}))}v.listenNetwork(vr.bind(this),Er.bind(this))}}function vr(){k.debug("online"),this.sock&&1!==this.sock.readyState&&(k.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function Er(){k.debug("offline")}function _r(e){var t=this,r=this._getSock();this.sock=r;var o=function(){t.logOut=!1;var e=v.flow([t.mSync.generateProvision,t.mSync.base64transform])();try{r.send(e)}catch(e){var o=u.create({type:l.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(o)}},n=function(){if(!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var e={type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(e)}else t.logOut?(t.clear(),t.onClosed&&t.onClosed(),t.mSync.stopHeartBeat(),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0):(e={type:l.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.onError&&t.onError(e),t.onClosed&&t.onClosed(),t.mSync.stopHeartBeat(),k.debug("reconnect fail"),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0)},i=function(e){var r=t.mSync,o=r.decodeMSync,n=r.distributeMSync;v.flow([o,n])(e)};"web"===dr.platform?(r.onopen=o,r.onclose=n,r.onmessage=i):(r.onOpen(o),r.onMessage(i),r.onClose(n),r.onError((function(e){k.debug("小程序 sock on error",e),t.isOnCloseReconnet=!1,t.onError&&t.onError({type:l.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),t.autoReconnectNumTotal<t.autoReconnectNumMax&&(k.debug("----- sock.onError reconnect -----"),t.reconnect())})))}function Tr(e){if(""===e.user){var t=u.create({type:l.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user cannot be empty"});return this.onError&&this.onError(t),!1}var r=this.appKey.split("#");return!(2!==r.length||!r[0]||!r[1])||(t=u.create({type:l.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function Ir(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource};var t=this.appKey.split("#"),r=t[0],o=t[1];this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=o,this.context.orgName=r}function br(e,t){var r=this,o={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(this.appKey)},success:function(o){var n=o.rest.hosts,i=r.https?"https":"http";if(k.info("httpType: "+i),!n)return Promise.reject(!1);for(var s=n.filter((function(e){return e.protocol===i?e:Promise.reject(!1)})),a=0;a<s.length;a++)if(s[a].protocol===i){var c=s[a];s.splice(a,1),s.unshift(c)}r.restHosts=s,r.restTotal=s.length;var u=o["msync-ws"].hosts;if(!u)return Promise.reject(!1);var p=u.filter((function(e){return e.protocol===i&&e}));r.socketHost=p,r.hostTotal=p.length,Or.call(r,e),"login"===e?gr.call(r,t):yr.call(r,t)}||fr,error:function(t){k.debug("getHttpDNS fail: "+r.dnsIndex),r.dnsIndex++,r.dnsIndex<r.dnsTotal&&br.call(r,e)}||fr};return v.ajax(o).catch((function(e){console.warn(e)}))}function Or(e){if(this.restIndex>this.restTotal)return"";var t="",r=this.restHosts[this.restIndex],o=r.domain,n=r.ip,i=r.port,s=this.https?"https:":"http:";return n&&window&&"http:"===window.location.protocol?t=s+"//"+n+":"+i:(t=s+"//"+o,i&&"80"!==i&&"443"!==i&&(t+=":"+i),window.location||(t="https://"+o),window.location&&"file:"===window.location.protocol&&(t="https://"+o)),this.apiUrl=t,t}mr.prototype.isDebug=!1;const Nr=mr,Sr=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:e.id,ackId:e.id,type:"read",to:e.to,from:e.from}},e.create=function(e){return{id:e.id,ackId:e.id,type:"read",to:e.to,from:""}},e}(),Rr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,mid:e.ackId,type:"delivery",to:e.to,from:e.from}},e.create=function(e){return{id:v.getUniqueId(),mid:e.mid,type:"delivery",to:e.to,from:e.from}},e}(),wr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:e.id,type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:"",time:Date.now()}},e}(),Cr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.value="",this.body=o}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now()},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{type:"txt",id:e.id,msg:e.msg,to:e.to,from:e.from,chatType:e.chatType,ext:e.ext,time:e.time||Date.now()}},e}(),Ar=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r||v.getUniqueId(),this.type=t,this.body=o}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:e.id||v.getUniqueId(),type:"cmd",to:e.to,chatType:e.chatType||"singleChat",action:e.action,time:e.time||Date.now()}},e}(),kr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:e.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,ext:e.ext}},e}(),xr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,lat:e.lat,lng:e.lng,from:e.from,ext:e.ext,time:e.time||Date.now()}},e}(),Mr=function(){function e(e){var t=e.type,r=e.id||v.getUniqueId(),o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:"",ext:e.ext,time:e.time||Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress}},e}(),jr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:e.id||v.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:"",ext:e.ext,time:e.time||Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length}},e}(),Ur=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,ext:e.ext,time:e.time||Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e}(),Pr=function(){function e(e){var t=e.type,r=e.id,o=e.body;this.id=r,this.type=t,this.body=o}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&v.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:e.time||Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,ext:e.ext,apiUrl:e.apiUrl,onFileUploadComplete:e.onFileUploadComplete,body:e.body}},e}();var Br=function(){function e(t,r){return this.id=r||v.getUniqueId(),e.create({type:t,id:this.id,version:"3.0"})}return e.createOldMsg=function(e){},e.create=function(e){if("txt"===(t=e).type&&!("version"in t))return Cr.create(e);if(function(e){return"img"===e.type&&!("version"in e)}(e))return Mr.create(e);if(function(e){return"cmd"===e.type&&!("version"in e)}(e))return e.id=v.getUniqueId(),Ar.create(e);if(function(e){return"file"===e.type&&!("version"in e)}(e))return Pr.create(e);if(function(e){return"video"===e.type&&!("version"in e)}(e))return Ur.create(e);if(function(e){return"custom"===e.type&&!("version"in e)}(e))return kr.create(e);if(function(e){return"loc"===e.type&&!("version"in e)}(e))return xr.create(e);if(function(e){return"channel"===e.type&&!("version"in e)}(e))return wr.create(e);if(function(e){return"delivery"===e.type&&!("version"in e)}(e))return Rr.create(e);if(function(e){return"read"===e.type&&!("version"in e)}(e))return Sr.create(e);if(function(e){return"version"in e}(e))switch(e.type){case"read":return new Sr({type:"read",id:e.id});case"delivery":return new Rr({type:"delivery",id:e.id});case"channel":return new wr({type:"channel",id:e.id});case"txt":return new Cr({type:"txt",id:e.id});case"cmd":return new Ar({type:"cmd",id:e.id});case"custom":return new kr({type:"custom",id:e.id});case"loc":return new xr({type:"loc",id:e.id});case"img":return new Mr({type:"img",id:e.id});case"audio":return new jr({type:"audio",id:e.id});case"video":return new Ur({type:"video",id:e.id});case"file":return new Pr({type:"file",id:e.id})}var t},e.prototype.set=function(e){},e}();s().util.Long=c(),s().configure();var Lr=s().Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8}},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,CHANNEL_ACK:7}},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,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14}},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}}}}}}}}}});Nr.prototype.root=Lr;var Dr=k.getLogger("IM-SDK-LOG");Dr.setConfig({useCache:!1,maxCache:3145728}),Dr.enableAll(),Nr.prototype._getSock=function(){if(this.isHttpDNS){var e=this.socketHost[this.hostIndex];if(!e)return this.autoReconnectInterval=0,this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0,this.onClosed();var t=e.domain,r=e.ip,o="",i=e.port;o=t||r,i&&"80"!==i&&"443"!==i&&(o+=":"+i),o&&(this.url="//"+o+"/ws");var s=this.https?"https:":"http:";this.url=s+this.url}return new(n())(this.url)},Nr.prototype.getUniqueId=v.getUniqueId;var Gr={connection:Nr,message:Br,utils:v,logger:k,statusCode:l};window.WebIM=Gr;const Wr=Gr})(),__webpack_exports__})()}));
|
|
3
3
|
//# sourceMappingURL=Easemob-chat.js.map
|