easemob-websdk 4.0.3 → 4.0.4-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.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 l=new Array(arguments.length-1),p=0;p<l.length;)l[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[p++];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"%"})),p!==l.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,l=e.TypeError||a.TypeError,p=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 l,p=t.parse;"function"==typeof p&&g((function(){0!==p("0")||p(!1)||(a=p(c),(l=5==a.a.length&&1===a.a[0])&&(g((function(){l=!p('"\t"')})),l&&g((function(){l=1!==p("01")})),l&&g((function(){l=1!==p("1.")}))))}),(function(){l=!1})),n=l}}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 l=p.floor,h=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return h[t]+365*(e-1970)+l((e-1969+(t=+(t>1)))/4)-l((e-1901+t)/100)+l((e-1601+t)/400)};t=function(e){for(n=l(e/864e5),r=l(n/365.2425)+1970-1;d(r+1,0)<=n;r++);for(o=l((n-d(r,0))/30.42);d(r,o+1)<=n;o++);n=1+n-d(r,o),s=l((i=(e%864e5+864e5)%864e5)/36e5)%24,a=l(i/6e4)%60,c=l(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,p,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)&&(p=m.call(c)),p||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 l();if(a.push(c),h=[],E=i,i+=n,p==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,l=t.length;u<l;)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=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+=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("@"==(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 l=a.JSON,p=a.JSON3,h=!1,d=u(a,a.JSON3={noConflict:function(){return h||(h=!0,a.JSON=l,a.JSON3=p,l=p=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 l(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 l(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),p=parseInt(e.substring(s,s+c),r);if(c<8){var h=a(u(r,c));i=i.mul(h).add(a(p))}else i=(i=i.mul(n)).add(a(p))}return i.unsigned=t,i}function p(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=p;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),l=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+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=p(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=p(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=p(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,l=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+u)>>>16,l+=(h+=r+a)>>>16,l+=t+s,c((d&=65535)<<16|(f&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},N.subtract=function(e){return o(e)||(e=p(e)),this.add(e.neg())},N.sub=N.subtract,N.multiply=function(e){if(this.isZero())return y;if(o(e)||(e=p(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,l=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*l)>>>16,f+=r*d+n*h+i*l+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=p(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),l=s<=48?1:u(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=l,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=p(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=p(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},N.or=function(e){return o(e)||(e=p(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},N.xor=function(e){return o(e)||(e=p(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 l=c[u],p=i.safeProp(l.name);if(l.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",p,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var h="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",p,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,l.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);p=i.safeProp(l.name),l.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(r,l,f,p+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(r,l,f,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,l.name),a(r,l,f,p),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.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 l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",s(l))}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(),l=e._fieldsArray.indexOf(u),p=u.resolvedType instanceof o?"int32":u.type,h=n.basic[p];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()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,p,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[p]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,p,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,p,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,l){if(a.isObject(n)?(l=i,u=n,n=i=void 0):a.isObject(i)&&(l=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=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),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,l){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=l}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=p;var o=r(3243);((p.prototype=Object.create(o.prototype)).constructor=p).className="Namespace";var n,i,s,a=r(3548),c=r(7598),u=r(9935);function l(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 p(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=l,p.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},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),p.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},p.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:p.fromJSON)(r[o],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof s||e instanceof i||e instanceof p||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 p&&e instanceof p)||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)},p.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)},p.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 p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(o))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.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 p&&(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 p&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.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},p.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._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),l=r(7513),p=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,B=!0,L=!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(),!(L="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,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));$(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);$(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 l(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 p(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,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 $(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);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=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,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(),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(!B)throw W(w);z();break;case"import":if(!B)throw W(w);V();break;case"syntax":if(!B)throw W(w);K();break;case"option":Z(D,w),U(";");break;default:if(X(D,w)){B=!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,l="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")},p=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new o(e):l(e)})(e)}:l};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=p(),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=p(),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=p;var o=r(9313);((p.prototype=Object.create(o.prototype)).constructor=p).className="Root";var n,i,s,a=r(3548),c=r(7025),u=r(7598),l=r(9935);function p(e){o.call(this,"",e),this.deferred=[],this.files=[]}function h(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=l.path.resolve,p.prototype.fetch=l.fetch,p.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return l.asPromise(e,n,t,r);var 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 p(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var o,s=i(t,n,r),p=0;if(s.imports)for(;p<s.imports.length;++p)(o=u(s.imports[p])||n.resolvePath(e,s.imports[p]))&&d(o);if(s.weakImports)for(p=0;p<s.weakImports.length;++p)(o=u(s.weakImports[p])||n.resolvePath(e,s.weakImports[p]))&&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?p(e,s[e]):(++f,setTimeout((function(){--f,p(e,s[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}p(e,r)}else++f,n.fetch(e,(function(r,i){--f,o&&(r?t?f||c(null,n):c(r):p(e,i))}))}var f=0;l.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)},p.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,h)},p.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}p.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)}},p.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]}},p._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=p;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 l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function p(e,c){e=e.toString();var u=0,p=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 l=e.substring(t,r).split(s),p=0;p<l.length;++p)l[p]=l[p].replace(c?i:n,"").trim();f=l.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<p&&"\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,l(n[1])}();var n,i,s,d,f,m=0===u;do{if(u===p)return null;for(n=!1;a.test(s=T(u));)if("\n"===s&&(m=!0,++h),++u===p)return null;if("/"===T(u)){if(++u===p)throw _("comment");if("/"===T(u))if(c){if(d=u,f=!1,O(u)){f=!0;do{if((u=N(u))===p)break;u++}while(O(u))}else u=Math.min(p,N(u)+1);f&&I(d,u,m),h++,n=!0}else{for(f="/"===T(d=u+1);"\n"!==T(++u);)if(u===p)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===p)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<p&&!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}})}p.unescape=l},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),l=r(1408),p=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),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?a.fromJSON:s.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var p=t.nested[u[l]];r.add((void 0!==p.id?s.fromJSON:void 0!==p.fields?v.fromJSON:void 0!==p.values?n.fromJSON:void 0!==p.methods?c.fromJSON:o.fromJSON)(u[l],p))}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:p,types:t,util:h}),this.decode=f(this)({Reader:l,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 l||(e=l.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 l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(7025));var t=new n("Enum"+l++,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 l=n.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}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=p;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 l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){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(p.create=function(){return new o})()}:function(){return new p}};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}p.create=h(),p.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(p.alloc=n.pool(p.alloc,n.Array.prototype.subarray)),p.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},p.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},p.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},p.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]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(n.isString(e)){var r=p.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},p.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},p.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},p.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},p._configure=function(e){o=e,p.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,l={};t.forEach((function(e){e.facadeTransport&&(l[e.facadeTransport.transportName]=e.facadeTransport)})),l[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 p;try{p=i.parse(a.data)}catch(e){a.data;break}var h=p[0],d=p[1],f=p[2],m=p[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 l[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),l=r(3616),p=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 p(t,c):a.enabled?new p(t,a):s.enabled&&r.sameScheme?new p(t,s):l.enabled()?new l(e,t):new p(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),l=r(7705),p=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 l=u.getOrigin(g.href);this._origin=l?l.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 l.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=p(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 l=function(t,o,n){for(var i in o)r.hasOwnProperty.call(o,i)&&e(t,i,o[i],n)},p=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(){}l(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}}),l(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var f,m,y,g=Object("a"),v="a"!==g[0]||!(0 in g);l(t,{forEach:function(e){var t=p(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);l(t,{indexOf:function(e){var t=v&&c(this)?this.split(""):p(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=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),p=0;for(e=new RegExp(e.source,l+"g"),o+="",_||(n=new RegExp("^"+e.source+"$(?!\\s)",l)),r=void 0===r?-1>>>0:r>>>0;(i=e.exec(o))&&!((a=i.index+i[0].length)>p&&(u.push(o.slice(p,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,p=a,u.length>=r));)e.lastIndex===i.index&&e.lastIndex++;return p===o.length?!c&&e.test("")||u.push(""):u.push(o.slice(p)),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;l(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 l=!1;try{l="withCredentials"in new a}catch(e){}c.supportsCORS=l,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),l=r(8915);function p(e,t,r){if(!p.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=l.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(p,i),p.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}},p.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()}},p.prototype.postMessage=function(e,t){this.iframeObj.post(n.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},p.prototype.send=function(e){this.postMessage("m",e)},p.enabled=function(){return c.iframeEnabled},p.transportName="iframe",p.roundTrips=2,e.exports=p},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 l=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(){l()},u.onload=function(){l()},u.onreadystatechange=function(e){u.readyState,"complete"===u.readyState&&l()},function(){l(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"),l=function(){clearTimeout(i),a.onerror=null},p=function(){u&&(l(),o.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())},h=function(e){u&&(p(),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(p),{post:function(e,t){try{setTimeout((function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)}),0)}catch(e){}},cleanup:p,loaded:l}}},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 l=[["#","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]],p={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,{}),p)delete n[t];else if("object"===s){for(t in e)t in p||(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,p,y,g,v=l.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(p=v[T])?(c=p[0],g=p[1],c!=c?_[g]=e:"string"==typeof c?~(y=e.indexOf(c))&&("number"==typeof p[2]?(_[g]=e.slice(0,y),e=e.slice(y+p[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&&p[3]&&t[g]||"",p[4]&&(_[g]=_[g].toLowerCase())):e=p(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&&(p=_.auth.split(":"),_.username=p[0]||"",_.password=p[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<l.length;a++){var c=l[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:()=>Co});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptContactInvite:()=>Ye,acceptInvitation:()=>$e,addContact:()=>Ke,addToBlackList:()=>et,addUsersToBlacklist:()=>rt,declineContactInvite:()=>Qe,declineInvitation:()=>Ze,deleteContact:()=>Xe,deleteSession:()=>We,fetchHistoryMessages:()=>ze,fetchUserInfoById:()=>He,getBlacklist:()=>Ue,getChatToken:()=>Je,getContacts:()=>Be,getRoster:()=>Pe,getSessionList:()=>Ge,recallMessage:()=>ut,removeFromBlackList:()=>ot,removeRoster:()=>ct,removeUserFromBlackList:()=>nt,subscribe:()=>it,subscribed:()=>st,unsubscribed:()=>at,updateCurrentUserNick:()=>qe,updateOwnUserInfo:()=>Fe,uploadPushToken:()=>De,uploadToken:()=>Le});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{acceptGroupInvite:()=>Bt,acceptGroupJoinRequest:()=>Mt,addUsersToGroupWhitelist:()=>cr,agreeInviteIntoGroup:()=>Pt,agreeJoinGroup:()=>xt,blockGroup:()=>ht,blockGroupMember:()=>Yt,blockGroupMembers:()=>Qt,blockGroupMessages:()=>dt,changeGroupOwner:()=>gt,changeOwner:()=>yt,createGroup:()=>pt,createGroupNew:()=>lt,deleteGroupSharedFile:()=>vr,destroyGroup:()=>Rt,disableSendGroupMsg:()=>sr,dissolveGroup:()=>St,downloadGroupSharedFile:()=>_r,enableSendGroupMsg:()=>ar,fetchGroupAnnouncement:()=>mr,fetchGroupSharedFileList:()=>Er,getGroup:()=>mt,getGroupAdmin:()=>It,getGroupBlacklist:()=>ir,getGroupBlacklistNew:()=>nr,getGroupInfo:()=>vt,getGroupMsgReadUser:()=>fr,getGroupMuteList:()=>Xt,getGroupWhitelist:()=>pr,getMuted:()=>Kt,groupBlockMulti:()=>Zt,groupBlockSingle:()=>$t,inviteToGroup:()=>wt,inviteUsersToGroup:()=>At,isGroupWhiteUser:()=>hr,isInGroupWhiteList:()=>dr,joinGroup:()=>kt,listGroupMember:()=>_t,listGroupMembers:()=>Tt,listGroups:()=>ft,modifyGroup:()=>Et,mute:()=>qt,muteGroupMember:()=>Jt,quitGroup:()=>Ct,rejectGroupInvite:()=>Dt,rejectGroupJoinRequest:()=>Ut,rejectInviteIntoGroup:()=>Lt,rejectJoinGroup:()=>jt,removeAdmin:()=>bt,removeGroupBlockMulti:()=>rr,removeGroupBlockSingle:()=>er,removeGroupMember:()=>Wt,removeGroupMembers:()=>Ht,removeGroupWhitelistMember:()=>lr,removeMultiGroupMember:()=>Ft,removeMute:()=>zt,removeSingleGroupMember:()=>Gt,rmUsersFromGroupWhitelist:()=>ur,setAdmin:()=>Ot,setGroupAdmin:()=>Nt,unblockGroupMember:()=>tr,unblockGroupMembers:()=>or,unmuteGroupMember:()=>Vt,updateGroupAnnouncement:()=>yr,uploadGroupSharedFile:()=>gr});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:()=>Ar,addUsersToChatRoomWhitelist:()=>to,blockChatRoomMember:()=>qr,blockChatRoomMembers:()=>zr,chatRoomBlockMulti:()=>Jr,chatRoomBlockSingle:()=>Hr,createChatRoom:()=>Ir,deleteChatRoomSharedFile:()=>uo,destroyChatRoom:()=>Or,disableSendChatRoomMsg:()=>Qr,enableSendChatRoomMsg:()=>eo,fetchChatRoomAnnouncement:()=>so,fetchChatRoomSharedFileList:()=>lo,getChatRoomAdmin:()=>Ur,getChatRoomBlacklist:()=>Zr,getChatRoomBlacklistNew:()=>Yr,getChatRoomDetails:()=>Nr,getChatRoomMuteList:()=>Fr,getChatRoomMuted:()=>Wr,getChatRoomWhitelist:()=>no,getChatRooms:()=>Tr,isChatRoomWhiteUser:()=>io,joinChatRoom:()=>kr,listChatRoomMember:()=>Mr,listChatRoomMembers:()=>jr,modifyChatRoom:()=>br,muteChatRoomMember:()=>Lr,quitChatRoom:()=>xr,removeChatRoomAdmin:()=>Br,removeChatRoomBlockMulti:()=>Xr,removeChatRoomBlockSingle:()=>Vr,removeChatRoomMember:()=>Rr,removeChatRoomMembers:()=>wr,removeChatRoomWhitelistMember:()=>oo,removeMultiChatRoomMember:()=>Cr,removeMuteChatRoomMember:()=>Dr,removeSingleChatRoomMember:()=>Sr,rmUsersFromChatRoomWhitelist:()=>ro,setChatRoomAdmin:()=>Pr,unblockChatRoomMember:()=>Kr,unblockChatRoomMembers:()=>$r,unmuteChatRoomMember:()=>Gr,updateChatRoomAnnouncement:()=>ao,uploadChatRoomSharedFile:()=>co});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 l;!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.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.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"}(l||(l={}));const p=l;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 window&&window.WebSocket?{platform:h.WEB,global:window}:"undefined"!=typeof swan&&y(swan)?{platform:h.BAIDU,global:swan}:"undefined"!=typeof tt&&y(tt)?{platform:h.TT,global:tt}:"undefined"!=typeof dd&&y(dd)?{platform:h.DD,global:dd}:"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.DD="dd",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,l,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:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void r({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}));default:i({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:p.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:p.GROUP_MEMBERS_FULL,data:s.response||s.responseText,message:v.error_description}):r({type:p.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:p.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:p.GROUP_NOT_JOINED,data:s.response||s.responseText,message:v.error_description}):r({type:p.PERMISSION_DENIED,data:s.response||s.responseText,message:"permission denied"}),i({type:p.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===(l=v.error_description)||void 0===l?void 0:l.includes("does not exist"))?(null===(h=s.responseURL)||void 0===h?void 0:h.includes("chatgroups"))?r({type:p.GROUP_NOT_EXIST,data:s.response||s.responseText,message:"The chat room dose not exist."}):r({type:p.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:p.USER_NOT_FOUND,data:s.response||s.responseText,message:v.error_description}):r({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),i({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}else{if(429!==y&&503!==y)return r({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void i({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText});r({type:p.SERVER_BUSY,data:s.response||s.responseText,message:"Server is busy."}),i({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}}0===s.readyState&&(i({type:p.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:p.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 l in c)c.hasOwnProperty(l)&&(u+=l+"="+c[l]+"&");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["Content-Type"]||(h["Content-Type"]="application/json"),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:p.REQUEST_SUCCESS}):{data:e,type:p.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:p.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var l=new XMLHttpRequest;l.upload&&l.upload.addEventListener("progress",e.onFileUploadProgress||function(){},!1),l.addEventListener("abort",e.onFileUploadCanceled||function(){},!1),l.addEventListener("error",(function(t){e.onFileUploadError&&e.onFileUploadError({type:p.WEBIM_UPLOADFILE_ERROR,data:l})}),!1),l.addEventListener("load",(function(t){try{var r=JSON.parse(l.responseText);if(400===l.status&&"content improper"===r.error)return e.onFileUploadError&&e.onFileUploadError({type:p.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(t){e.onFileUploadError&&e.onFileUploadError({type:p.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError&&e.onFileUploadError({type:p.WEBIM_UPLOADFILE_ERROR,data:l.responseText})}}),!1),l.open("POST",u),l.setRequestHeader("restrict-access","true"),l.setRequestHeader("Accept","*/*"),l.setRequestHeader("Authorization","Bearer "+o);var h=new FormData;h.append("file",e.file.data),l.send(h)}}else e.onFileUploadError&&e.onFileUploadError({type:p.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:p.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 l={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)}};if("zfb"===c.platform||"dd"===c.platform?l.headers=e.headers:l.header=e.headers,"dd"===c.platform)return dd.httpRequest(l);c.global.request(l)}))},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&&e.onFileDownloadComplete(t.response)}),!1),t.addEventListener("error",(function(r){e.onFileDownloadError&&e.onFileDownloadError({type:p.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||"",chatType:e.chatType}},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent}},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(),msgConfig:e.msgConfig}},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(),msgConfig:e.msgConfig}},e}(),B=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(),msgConfig:e.msgConfig}},e}(),L=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,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:v.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},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(),msgConfig:e.msgConfig,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,msgConfig:e.msgConfig}},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(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig}},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(),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,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig}},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 B({type:"custom",id:e.id});case"loc":return new L({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)?B.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?L.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,o){var n,i,s,a,u,l,p,h,d=new(c())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),f=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),m=new(c())(e.id.low,e.id.high,e.id.unsigned).toString(),y=f.ackMessageId?new(c())(f.ackMessageId.low,f.ackMessageId.high,f.ackMessageId.unsigned).toString():"",g="",v=f.from&&f.from.name,E=f.to&&f.to.name;switch(k.debug("thirdMessage:",f),f.type){case 1:g="chat","agoraToken"===this.grantType&&(g="singleChat"),this.delivery&&z.call(this,v,E,m);break;case 2:g="groupchat","agoraToken"===this.grantType&&(g="groupChat");break;case 3:g="chatroom","agoraToken"===this.grantType&&(g="chatRoom");break;case 4:g="read_ack";var _=void 0,T=f.ext[0]&&JSON.parse(f.ext[0].stringValue);return console.log("read_ack",f),T?(_={id:m,type:"read",from:v,to:E,mid:y,groupReadCount:f.ext[0]&&JSON.parse(f.ext[0].stringValue),ackContent:f.ackContent},this.onReadMessage&&this.onReadMessage(_),void(null===(n=this.eventHandler)||void 0===n||n.dispatch("onReadMessage",_))):(_={id:m,type:"read",from:v,to:E,mid:y},this.onReadMessage&&this.onReadMessage(_),void(null===(i=this.eventHandler)||void 0===i||i.dispatch("onReadMessage",_)));case 5:g="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:m,type:"delivery",from:v,to:E,mid:y});var I={id:m,type:"delivery",from:v,to:E,mid:y};return void(null===(s=this.eventHandler)||void 0===s||s.dispatch("onDeliveredMessage",I));case 6:g="recall",this.onRecallMessage&&this.onRecallMessage({id:m,from:v,to:E,mid:y});var O={id:m,from:v,to:E,mid:y};return void(null===(a=this.eventHandler)||void 0===a||a.dispatch("onRecallMessage",O));case 7:this.onChannelMessage&&this.onChannelMessage({id:m,type:"channel",chatType:"singleChat",from:v,to:E,time:Number(d)});var N={id:m,type:"channel",chatType:"singleChat",from:v,to:E,time:Number(d)};return void(null===(u=this.eventHandler)||void 0===u||u.dispatch("onChannelMessage",N))}h="chat"===g.toLowerCase()||"singleChat"===g?"singleChat":"groupchat"===g.toLowerCase()||"groupChat"===g?"groupChat":"chatRoom";for(var b=0;b<f.contents.length;b++){var S={},R={},C=t.errorCode>0,w=t.errorCode,A=t.reason,x=f.contents[b],M={},j=void 0;switch(f.ext&&(M=J(f.ext)),x.type){case 0:!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,data:x.text,ext:M,sourceMsg:x.text,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onTextMessage&&this.onTextMessage(S);var U={id:m,type:"txt",chatType:h,msg:x.text,to:E,from:v,ext:M,time:Number(d)};S.msgConfig&&(U.msgConfig=S.msgConfig),R=U,!r&&this.eventHandler&&this.eventHandler.dispatch("onTextMessage",U);break;case 1:var P=(null===(l=null==x?void 0:x.size)||void 0===l?void 0:l.width)||0,B=(null===(p=null==x?void 0:x.size)||void 0===p?void 0:p.height)||0;j=this.useOwnUploadFun?x.remotePath:(x.remotePath&&this.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)))+"?em-redirect=true",x.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+x.secretKey),!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,url:j,secret:x.secretKey,filename:x.displayName,thumb:x.thumbnailRemotePath,thumb_secret:x.thumbnailSecretKey,file_length:x.fileLength||"",width:P,height:B,filetype:x.filetype||"",accessToken:this.token,ext:M,time:d,msgConfig:f.msgConfig}).delay&&delete S.delay,!S.msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onPictureMessage&&this.onPictureMessage(S);var L={id:m,type:"img",chatType:h,from:v,to:E,url:j||"",width:P,height:B,secret:x.secretKey||"",thumb:x.thumbnailRemotePath||"",thumb_secret:x.thumbnailSecretKey||"",ext:M,time:Number(d)};S.msgConfig&&(L.msgConfig=S.msgConfig),R=L,!r&&this.eventHandler&&this.eventHandler.dispatch("onImageMessage",L);break;case 2:j=this.useOwnUploadFun?x.remotePath:(x.remotePath&&this.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)))+"?em-redirect=true",x.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+x.secretKey),!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,url:j,secret:x.secretKey,filename:x.displayName,length:x.duration||"",file_length:x.fileLength||"",filetype:x.filetype||"",accessToken:this.token||"",ext:M,time:d,msgConfig:f.msgConfig}).delay&&delete S.delay,!S.msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onVideoMessage&&this.onVideoMessage(S);var D={id:m,type:"video",chatType:h,from:v,to:E,url:j,secret:x.secretKey,filename:x.displayName,length:x.duration||0,file:{},file_length:x.fileLength||0,filetype:x.filetype||"",accessToken:this.token||"",ext:M,time:Number(d)};S.msgConfig&&(D.msgConfig=S.msgConfig),R=D,!r&&this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",D);break;case 3:!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,addr:x.address,buildingName:x.buildingName,lat:x.latitude,lng:x.longitude,ext:M,time:d,msgConfig:f.msgConfig}).delay&&delete S.delay,!S.msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onLocationMessage&&this.onLocationMessage(S);var G={id:m,type:"loc",chatType:h,from:v,to:E,buildingName:x.buildingName,addr:x.address,lat:x.latitude,lng:x.longitude,ext:M,time:Number(d)};S.msgConfig&&(G.msgConfig=S.msgConfig),R=G,!r&&this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",G);break;case 4:j=this.useOwnUploadFun?x.remotePath:(x.remotePath&&this.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)))+"?em-redirect=true",x.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+x.secretKey),!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,url:j,secret:x.secretKey,filename:x.displayName,file_length:x.fileLength||"",accessToken:this.token||"",ext:M,length:x.duration,time:d,msgConfig:f.msgConfig}).delay&&delete S.delay,!S.msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onAudioMessage&&this.onAudioMessage(S);var W={id:m,type:"audio",chatType:h,from:v,to:E,url:j,secret:x.secretKey,file:{},filename:x.displayName,length:x.duration||0,file_length:x.fileLength||0,filetype:x.filetype||"",accessToken:this.token||"",ext:M,time:Number(d)};S.msgConfig&&(W.msgConfig=S.msgConfig),R=W,!r&&this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",W);break;case 5:j=this.useOwnUploadFun?x.remotePath:(x.remotePath&&this.apiUrl+x.remotePath.substr(x.remotePath.indexOf("/",9)))+"?em-redirect=true",x.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+x.secretKey),!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,url:j,secret:x.secretKey,filename:x.displayName,file_length:x.fileLength,accessToken:this.token||"",ext:M,time:d,msgConfig:f.msgConfig}).delay&&delete S.delay,!S.msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onFileMessage&&this.onFileMessage(S);var F={id:m,type:"file",chatType:h,from:v,to:E,url:j,secret:x.secretKey,file:{},filename:x.displayName,length:x.duration||0,file_length:x.fileLength||0,filetype:x.filetype||"",accessToken:this.token||"",ext:M,time:Number(d)};S.msgConfig&&(F.msgConfig=S.msgConfig),R=F,!r&&this.eventHandler&&this.eventHandler.dispatch("onFileMessage",F);break;case 6:!(S={id:m,type:g,contentsType:q[x.type],from:v,to:E,action:x.action,ext:M,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,S.error=C,S.errorText=A,S.errorCode=w,!r&&this.onCmdMessage&&this.onCmdMessage(S);var H={id:m,type:"cmd",chatType:h,from:v,to:E,action:x.action,ext:M,time:Number(d)};S.msgConfig&&(H.msgConfig=S.msgConfig),R=H,!r&&this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",H);break;case 7:var V={},K={};f.contents[0].customExts&&(V=J(f.contents[0].customExts)),f.contents[0].params&&(K=J(f.contents[0].params)),S={id:m,type:g,contentsType:q[x.type],from:v,to:E,customEvent:x.customEvent,params:K,customExts:V,ext:M,time:d},!r&&this.onCustomMessage&&this.onCustomMessage(S);var X={id:m,type:"custom",chatType:h,from:v,to:E,customEvent:x.customEvent,params:K,customExts:V,ext:M,time:Number(d)};S.msgConfig&&(X.msgConfig=S.msgConfig),R=X,!r&&this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",X)}return o?R:S}},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 l=this.root.lookup("easemob.pb.MSync"),p=l.decode(r);p.version=this.version,p.encryptType=[0],p.command=0,p.guid=this.jid,p.payload=u,p=l.encode(p).finish();var h=this.mSync.base64transform(p);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:p.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:p.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:p.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:p.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||"dd"===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<=No.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)pe.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)}le.call(this),de.call(this),he.call(this),pe.call(this)}else this.onError&&this.onError({type:p.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function le(){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 pe(){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||"dd"===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,i=this.root.lookup("easemob.pb.CommSyncDL");i=i.decode(e.payload);var s=new(c())(i.serverId.low,i.serverId.high,i.serverId.unsigned).toString(),a=new(c())(i.metaId.low,i.metaId.high,i.metaId.unsigned).toString();if(0!==i.metas.length)try{re.call(this,i.metas,i.status)}catch(e){this.onError&&this.onError({type:p.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(i.isLast){var l=-1;return this._queues.some((function(e,t){return e.name===i.name&&(l=t,!0)}))&&l>0&&this._queues.splice(l,1),void(this._queues.length>0&&(se.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer)))}ce.call(this,i.nextKey,i.queue)}else if(i.isLast){var h=-1;this._queues.some((function(e,t){return e.name===i.queue.name&&(h=t,!0)}))&&this._queues.splice(h,1),this._queues.length>0&&(se.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(i.status&&0===i.status.errorCode){if(this._msgHash[a]){try{(null===(t=this._msgHash[a])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[a].resolve({localMsgId:a,serverMsgId:s}),(null===(r=this._msgHash[a])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[a].success(a,s)}catch(e){this.onError&&this.onError({type:p.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:a,mid:s,to:this._msgHash[a].to,time:0}),null===(o=this.eventHandler)||void 0===o||o.dispatch("onReceivedMessage",{id:a,mid:s,to:this._msgHash[a].to}),delete this._msgHash[a]}}else if(i.status&&15===i.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:s}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject({type:p.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(i.status&&1===i.status.errorCode){var d=void 0;switch(i.status.reason){case"blocked":d=p.PERMISSION_DENIED;break;case"group not found":d=p.GROUP_NOT_EXIST;break;case"not in group or chatroom":d=p.GROUP_NOT_JOINED;break;case"exceed recall time limit":d=p.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":d=p.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":d=p.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":d=p.USER_NOT_FRIEND,i.status.reason="not contact";break;default:d=p.SERVER_UNKNOWN_ERROR}if(this._msgHash[a]){var f=u.create({type:d,message:i.status.reason||"",data:{id:a,mid:s}});this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:d,reason:i.status.reason?i.status.reason:"",data:{id:a,mid:s}})}}else if(i.status&&7===i.status.errorCode)"sensitive words"===i.status.reason&&this._msgHash[a]?(f=u.create({type:p.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:p.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"sensitive words"}})):"blocked by mod_antispam"===i.status.reason&&this._msgHash[a]?(f=u.create({type:p.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:p.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"blocked by mod_antispam"}})):"user is mute"===i.status.reason&&this._msgHash[a]&&(f=u.create({type:p.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail(f));else if(i.status&&19===i.status.errorCode)this._msgHash[a]&&(f=u.create({type:p.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:i.status.reason||"",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:p.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:a,mid:s,reason:i.status.reason}}));else if(this._msgHash[a]){try{f=u.create({type:p.WEBIM_LOAD_MSG_ERROR,message:(null===(n=i.status)||void 0===n?void 0:n.reason)||"",data:{id:a,mid:s,reason:i.status&&i.status.reason}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:p.WEBIM_LOAD_MSG_ERROR,data:{errorCode:i.status&&i.status.errorCode,reason:i.status&&i.status.reason}})}catch(e){this.onError&&this.onError({type:p.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[a]}else this.onError&&this.onError({type:p.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):e.file?(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):(i.displayName=e.filename,i.remotePath=e.url,i.secretKey=e.secret,i.fileLength=e.file_length,i.size=e.size,i.thumbnailDisplayName=e.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.buildingName=e.buildingName,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,"groupChat"===n&&(c.msgConfig={allowGroupAck:!0},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 l="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(l="conference.easemob.com"),u.from=this.context.jid,u.to={appKey:this.appKey,name:e.to,domain:l},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:p.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Oe(e){var t=this;if(!e.file)return e;var r=Z({},e);return r.accessToken=this.token,r.appKey=this.appKey,r.apiUrl=this.apiUrl,r.body&&r.body.url?Ie.call(this,r):new Promise((function(o,n){var i=r.onFileUploadComplete;r.onFileUploadComplete=function(o){var n;if(o.entities[0]["file-metadata"]){var s=o.entities[0]["file-metadata"]["content-length"];r.file_length=s,r.filetype=o.entities[0]["file-metadata"]["content-type"],s>204800&&(r.thumbnail=!0)}r.body={type:r.type||"file",secret:o.entities[0]["share-secret"],filename:r.file.filename||r.filename,url:(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,length:r.length||0,filetype:r.filetype||r.file.filetype,file_length:(null===(n=null==r?void 0:r.ext)||void 0===n?void 0:n.file_length)||0,size:{width:r.width||0,height:r.height||0}},r.file.url=o.uri,e.secret=o.entities[0]["share-secret"],e.url=(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,i instanceof Function&&i(o,r.id);var a=Ie.call(t,r);be.call(t,a)},v.uploadFile.call(t,r)}))}function Ne(e){var t=this;return new Promise((function(r,o){if(t.logOut)return o({type:p.WEBIM_CONNECTION_CLOSED,message:"not login"});if(e.id&&(t._msgHash[e.id]=Z(Z({},e),{resolve:r,reject:o})),("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)}))}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:p.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.onChannelMessage=e.onChannelMessage||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.onContactInvited=e.onContactInvited||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:p.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function xe(){var e;if(!this.context.accessToken){var t=u.create({type:p.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:p.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:p.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 Be=Pe;function Le(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:p.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=Le;function Ge(e){if(!Me.call(this)){var t=u.create({type:p.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){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: "+e.channel);if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: "+e.deleteRoam);if(!Me.call(this)){var t=u.create({type:p.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r,o=this.context,n=o.orgName,i=o.appName,s=o.accessToken;r="singleChat"===e.chatType?"chat":"groupChat";var a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/user_channel",dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(a)}function Fe(e,t){if(!Me.call(this)){var r=u.create({type:p.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 l=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);l.push(r+"="+o)}})),c=l.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 He(e,t){if(!Me.call(this)){var r=u.create({type:p.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 l={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(l)}function qe(e){if(!Me.call(this)){var t=u.create({type:p.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 Je(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 ze(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:p.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=t.count||20,i=this;Ve.call(this,{count:n,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,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 Ve(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,l=c.orgName,h=c.appName,d=function(r){if(r.error&&r.error_description){var o=u.create({type:p.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+"/"+l+"/"+h+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},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(r){for(var o=[],n=0,i=(r=_().atob(r)).length;n<i;++n)o.push(r.charCodeAt(n));var s=t.context.root.lookup("easemob.pb.Meta");if(1==(s=s.decode(o)).ns)return V.call(t,s,{errorCode:0,reason:""},!0,e.format)},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 Ke(e,t){var r={id:this.getUniqueId(),to:e,message:t};$.operatRoster.call(this,r,"add")}function Xe(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"remove")}function $e(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"accept")}var Ye=$e;function Ze(e){var t={id:this.getUniqueId(),to:e};$.operatRoster.call(this,t,"decline")}var Qe=Ze;function et(e){$.operatRoster.call(this,{to:e.name},"ban")}var rt=et;function ot(e){$.operatRoster.call(this,{to:e.name},"allow")}var nt=ot;function it(e){$.operatRoster.call(this,e,"add")}function st(e){$.operatRoster.call(this,e,"accept")}function at(e){$.operatRoster.call(this,e,"decline")}function ct(e){$.operatRoster.call(this,e,"remove")}function ut(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 lt(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:p.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=lt;function ht(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:p.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 dt=ht;function ft(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 mt(e){if(!Me.call(this)){var t=u.create({type:p.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 yt(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 gt=yt;function vt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 Et(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 _t(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:p.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 Tt=_t;function It(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 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(!Me.call(this)){var t=u.create({type:p.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 Nt=Ot;function bt(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:p.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 St(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 Rt=St;function Ct(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 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:p.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 At=wt;function kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 xt(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:p.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 Mt=xt;function jt(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:p.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 Ut=jt;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(!Me.call(this)){var t=u.create({type:p.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 Bt=Pt;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:p.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 Dt=Lt;function Gt(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:p.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 Wt=Gt;function Ft(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:p.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 Ht=Ft;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("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!Me.call(this)){var t=u.create({type:p.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 Jt=qt;function zt(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:p.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 Vt=zt;function Kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 Xt=Kt;function $t(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:p.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 Yt=$t;function Zt(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:p.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 Qt=Zt;function er(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:p.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 tr=er;function rr(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:p.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 or=rr;function nr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 ir=nr;function sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 ar(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 cr(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:p.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 ur(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:p.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 lr=ur;function pr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 hr(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:p.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 dr=hr;function fr(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:p.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 mr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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 yr(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:p.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 gr(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 vr(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:p.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 Er(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Me.call(this)){var t=u.create({type:p.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.pageNum||1,a=e.pageSize||10,c=e.groupId,l={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+c+"/share_files?pagenum="+s+"&pagesize="+a,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return v.ajax(l)}function _r(e){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=this.apiUrl,s=e.groupId,a=e.fileId;v.download.call(this,{url:i+"/"+r+"/"+o+"/chatgroups/"+s+"/share_files/"+a,onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:n,id:a,secret:e.secret})}function Tr(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:p.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:p.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return v.ajax(c)}function Ir(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 Or(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 Nr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 br(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 Sr(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:p.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 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:p.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 wr=Cr;function Ar(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:p.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 kr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Me.call(this)){var t=u.create({type:p.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 xr(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Me.call(this)){var r=u.create({type:p.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 Mr(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:p.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 jr=Mr;function Ur(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:p.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 Pr(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:p.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 Br(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:p.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 Lr(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:p.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 Dr(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:p.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 Gr=Dr;function Wr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:p.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 Fr=Wr;function Hr(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:p.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 qr=Hr;function Jr(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:p.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 zr=Jr;function Vr(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:p.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 Kr=Vr;function Xr(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:p.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 $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:p.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 Zr=Yr;function Qr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:p.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 eo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:p.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 to(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:p.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 ro(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:p.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 oo=ro;function no(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Me.call(this)){var t=u.create({type:p.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 io(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:p.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 so(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Me.call(this)){var t=u.create({type:p.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 ao(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:p.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 co(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 uo(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:p.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 lo(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Me.call(this)){var t=u.create({type:p.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 po=function(){return po=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},po.apply(this,arguments)},ho=v.getEnvInfo(),fo=function(){};function mo(e){var t=this,r=e.promise,o=e.error||fo;if(!this.orgName&&!this.appName){var n=u.create({type:p.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:function(t){e.success&&e.success(t);var o=po(po({},t),{type:p.REQUEST_SUCCESS});r.resolve&&r.resolve(o)},error:function(n){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,Oo.call(t,"signup"),mo.call(t,e),Promise.reject(n)):(t.clear(),r.reject&&r.reject(n),o(n))}};return v.ajax(i)}function yo(e){var t=this;if(_o.call(this,e)&&!this.isOpened()){To.call(this,e),this.user=e.user;var r=e.promise;if(e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(o){k.info("getChatToken result:",o),Date.now(),t.expirationTime=o.expire_timestamp,t.token=o.access_token,t.context.accessToken=o.access_token,t.context.restTokenData=o.access_token,r.resolve({accessToken:o.access_token,expireTimestamp:o.expire_timestamp}),Eo.call(t,po(po({},e),{access_token:o.access_token}))})).catch((function(e){var o,n=u.create({type:p.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e});r.reject(n),t.onError&&t.onError(n),null===(o=t.eventHandler)||void 0===o||o.dispatch("onError",n)}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,r.resolve({accessToken:e.accessToken}),Eo.call(this,e);else{this.grantType="password";var o={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},n=JSON.stringify(o),i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:n,success:function(o){"function"==typeof e.success&&e.success(o),t.token=o.access_token,t.context.restTokenData=o.access_token,t.context.accessToken=o.access_token,r.resolve({accessToken:o.access_token,duration:o.expires_in}),Eo.call(t,o)}||fo,error:function(o){if(t.isHttpDNS&&t.restIndex+1<t.restTotal)return t.restIndex++,Oo.call(t,"login"),void yo.call(t,e);var n;t.clear(),o.error&&o.error_description?(n=u.create({type:p.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),t.onError&&t.onError(n)):(n=u.create({type:p.WEBIM_CONNCTION_OPEN_ERROR,message:"login failed",data:o}),t.onError&&t.onError(n)),"function"==typeof e.error&&e.error(n),r.reject(n)}||fo,version:"4.0.0"};v.ajax(i).catch((function(e){console.warn(e)}))}v.listenNetwork(go.bind(this),vo.bind(this))}}function go(){var e;k.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(k.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function vo(){var e;k.debug("offline"),this.onOffline&&this.onOffline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOffline")}function Eo(e){var t=this,r=this._getSock();this.sock=r;var o=function(){t.logOut=!1,"zfb"!==ho.platform&&"dd"!==ho.platform||(t.sock.readyState=1);var e=v.flow([t.mSync.generateProvision,t.mSync.base64transform])();try{r.send(e)}catch(e){var o=u.create({type:p.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(o)}},n=function(){var e,r;if("zfb"!==ho.platform&&"dd"!==ho.platform||(t.sock.readyState=3),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var o={type:p.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:p.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"===ho.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:p.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 _o(e){if(""===e.user){var t=u.create({type:p.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:p.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function To(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 Io(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 l=u.filter((function(e){return e.protocol===i&&e}));r.socketHost=l,r.hostTotal=l.length,Oo.call(r,e),"login"===e?yo.call(r,t):mo.call(r,t)}||fo,error:function(t){k.debug("getHttpDNS fail: "+r.dnsIndex),r.dnsIndex++,r.dnsIndex<r.dnsTotal&&Io.call(r,e)}||fo};return v.ajax(o).catch((function(e){console.warn(e)}))}function Oo(e){var t,r;if(this.restIndex>this.restTotal)return"";var o="",n=this.restHosts[this.restIndex],i=n.domain,s=n.ip,a=n.port,c=this.https?"https:":"http:";return s&&"undefined"!=typeof window&&"http:"===(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)?o=c+"//"+s+":"+a:(o=c+"//"+i,a&&"80"!==a&&"443"!==a&&(o+=":"+a),"undefined"==typeof window||window.location||(o="https://"+i),"undefined"!=typeof window&&window.location&&"file:"===(null===(r=window.location)||void 0===r?void 0:r.protocol)&&(o="https://"+i)),"undefined"==typeof window&&(o=c+"//"+i),this.apiUrl=o,o}const No=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.2",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){var t=this;return new Promise((function(r,o){if(t.isHttpDNS){t.dnsIndex=0;var n=po(po({},e),{user:e.username,pwd:e.password,promise:{resolve:r,reject:o}});Io.call(t,"signup",n)}else n=po(po({},e),{promise:{resolve:r,reject:o}}),mo.call(t,n)}))},o.prototype.open=function(e){var t=this;return k.debug("open"),new Promise((function(r,o){e.accessToken&&(t.token=e.accessToken);var n=po(po({},e),{promise:{resolve:r,reject:o}});t.isHttpDNS?Io.call(t,"login",n):yo.call(t,n)}))},o.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},o.prototype.close=function(){this.logOut=!0,this.context.status=p.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=p.STATUS_CLOSED},o.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},o.prototype._checkOpenParams=function(e){return _o.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.context.accessToken=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&&(Eo.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 bo=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},buildingName:{type:"string",id:21}},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}}}}}}}}}});No.prototype.root=bo;var So=k.getLogger("IM-SDK-LOG");So.setConfig({useCache:!1,maxCache:3145728}),So.enableAll(),No.prototype._getSock=function(){if(this.isHttpDNS){var e=this.socketHost[this.hostIndex];if(!e)throw this.autoReconnectInterval=0,this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0,this.onClosed&&this.onClosed(),new Error("No connected domain name when get websocket.");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)},No.prototype.getUniqueId=v.getUniqueId;var Ro={connection:No,message:H,utils:v,logger:k,statusCode:p};"undefined"!=typeof window&&(window.WebIM=Ro);const Co=Ro})(),__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()}(this,(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 l=new Array(arguments.length-1),p=0;p<l.length;)l[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[p++];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"%"})),p!==l.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,l=e.TypeError||a.TypeError,p=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){if(null!=_[e])return _[e];var n;if("bug-string-char-index"==e)n="a"!="a"[0];else if("json"==e)n=_("json-stringify")&&_("date-serialization")&&_("json-parse");else if("date-serialization"==e){if(n=_("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 l,p=t.parse;"function"==typeof p&&g((function(){0!==p("0")||p(!1)||(a=p(c),(l=5==a.a.length&&1===a.a[0])&&(g((function(){l=!p('"\t"')})),l&&g((function(){l=1!==p("01")})),l&&g((function(){l=1!==p("1.")}))))}),(function(){l=!1})),n=l}}return _[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()})),_["bug-string-char-index"]=_["date-serialization"]=_.json=_["json-stringify"]=_["json-parse"]=null,!_("json")){var E="[object Function]",T="[object Number]",b="[object String]",I="[object Array]",O=_("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)==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)==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(!_("json-stringify")&&!_("date-serialization")){var C={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},S=function(e,t){return("000000"+(t||0)).slice(-e)},R=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 l=p.floor,h=[0,31,59,90,120,151,181,212,243,273,304,334],d=function(e,t){return h[t]+365*(e-1970)+l((e-1969+(t=+(t>1)))/4)-l((e-1901+t)/100)+l((e-1601+t)/400)};t=function(e){for(n=l(e/864e5),r=l(n/365.2425)+1970-1;d(r+1,0)<=n;r++);for(o=l((n-d(r,0))/30.42);d(r,o+1)<=n;o++);n=1+n-d(r,o),s=l((i=(e%864e5+864e5)%864e5)/36e5)%24,a=l(i/6e4)%60,c=l(i/1e3)%60,u=i%1e3}}return R=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+S(6,r<0?-r:r):S(4,r))+"-"+S(2,o+1)+"-"+S(2,n)+"T"+S(2,s)+":"+S(2,a)+":"+S(2,c)+"."+S(3,u)+"Z",r=o=n=s=a=c=u=null):e=null,e},R(e)};if(_("json-stringify")&&!_("date-serialization")){function A(e){return R(this)}var w=t.stringify;t.stringify=function(e,t,r){var o=s.prototype.toJSON;s.prototype.toJSON=A;var n=w(e,t,r);return s.prototype.toJSON=o,n}}else{var k=function(e){var t=e.charCodeAt(0);return C[t]||"\\u00"+S(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,p,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=R(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)&&(p=m.call(c)),p||u){case"boolean":case"[object Boolean]":return""+c;case"number":case T:return c>-1/0&&c<1/0?""+c:"null";case"string":case b:return M(""+c)}if("object"==typeof c){for(v=a.length;v--;)if(a[v]===c)throw l();if(a.push(c),h=[],_=i,i+=n,p==I){for(y=0,v=c.length;y<v;y++)f=j(y,c,r,o,n,i,a),h.push(f===d?"null":f);E=h.length?n?"[\n"+i+h.join(",\n"+i)+"\n"+_+"]":"["+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)})),E=h.length?n?"{\n"+i+h.join(",\n"+i)+"\n"+_+"}":"{"+h.join(",")+"}":"{}";return a.pop(),E}};t.stringify=function(e,t,r){var o,n,s,a;if(i[typeof t]&&t)if((a=m.call(t))==E)n=t;else if(a==I){s={};for(var c,u=0,l=t.length;u<l;)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==b&&(o=r.length<=10?r:r.slice(0,10));return j("",((c={})[""]=e,c),n,s,o,"",[])}}}if(!_("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=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+=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("@"==(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)==I)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)==E?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 l=a.JSON,p=a.JSON3,h=!1,d=u(a,a.JSON3={noConflict:function(){return h||(h=!0,a.JSON=l,a.JSON3=p,l=p=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 b}else{if(e<=-f)return I;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 l(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 l(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),p=parseInt(e.substring(s,s+c),r);if(c<8){var h=a(u(r,c));i=i.mul(h).add(a(p))}else i=(i=i.mul(n)).add(a(p))}return i.unsigned=t,i}function p(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=p;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 _=s(1,!0);r.UONE=_;var E=s(-1);r.NEG_ONE=E;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var b=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=b;var I=c(0,-2147483648,!1);r.MIN_VALUE=I;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(I)){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),l=(i.sub(c.mul(n)).toInt()>>>0).toString(e);if((i=c).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+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(I)?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=p(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=p(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(I)?I:this.not().add(v)},O.neg=O.negate,O.add=function(e){o(e)||(e=p(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,l=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+u)>>>16,l+=(h+=r+a)>>>16,l+=t+s,c((d&=65535)<<16|(f&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},O.subtract=function(e){return o(e)||(e=p(e)),this.add(e.neg())},O.sub=O.subtract,O.multiply=function(e){if(this.isZero())return y;if(o(e)||(e=p(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(I))return e.isOdd()?I:y;if(e.eq(I))return this.isOdd()?I: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,l=65535&e.high,h=e.low>>>16,d=65535&e.low,f=0,g=0,v=0,_=0;return v+=(_+=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*l)>>>16,f+=r*d+n*h+i*l+s*u,c((v&=65535)<<16|(_&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(e){if(o(e)||(e=p(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 _;i=g}else{if(this.eq(I))return e.eq(v)||e.eq(E)?I:e.eq(I)?v:(r=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?v:E:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(I))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),l=s<=48?1:u(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=l,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=p(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=p(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},O.or=function(e){return o(e)||(e=p(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},O.xor=function(e){return o(e)||(e=p(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 l=c[u],p=i.safeProp(l.name);if(l.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",p,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var h="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",p,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,l.typeDefault)}r("}")}var d=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);p=i.safeProp(l.name),l.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),a(r,l,f,p+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),a(r,l,f,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,l.name),a(r,l,f,p),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.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 l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",s(l))}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(),l=e._fieldsArray.indexOf(u),p=u.resolvedType instanceof o?"int32":u.type,h=n.basic[p];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()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,p,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[p]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?s(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,p,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?s(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,p,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,l){if(a.isObject(n)?(l=i,u=n,n=i=void 0):a.isObject(i)&&(l=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=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),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,l){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=l}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=p;var o=r(3243);((p.prototype=Object.create(o.prototype)).constructor=p).className="Namespace";var n,i,s,a=r(3548),c=r(7598),u=r(9935);function l(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 p(e,t){o.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=l,p.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},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),p.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},p.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:p.fromJSON)(r[o],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof s)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof s||e instanceof i||e instanceof p||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 p&&e instanceof p)||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)},p.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)},p.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 p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(o))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.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 p&&(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 p&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.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},p.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._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),l=r(7513),p=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]+$/,_=/^-?0[0-7]+$/,E=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,b=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,I=/^(?:\.[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,C,S,R,A,w=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=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(E.test(e))return r*parseFloat(e);throw W(e,"number",!0)}(t)}catch(r){if(e&&b.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(_.test(e))return parseInt(e,8);throw W(e,"id")}function J(){if(void 0!==N)throw W("package");if(N=x(),!b.test(N))throw W(N,"name");D=D.define(N),U(";")}function V(){var e,t=j();switch(t){case"weak":e=S||(S=[]),x();break;case"public":x();default:e=C||(C=[])}t=F(),U(";"),e.push(t)}function K(){if(U("="),R=F(),!(B="proto3"===R)&&"proto2"!==R)throw W(R,"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(!b.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);$(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||!b.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=z(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 l(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),!b.test(t=x()))throw W(t);if(n=t,U(")"),U("returns"),U("("),U("stream",!0)&&(a=!0),!b.test(t=x()))throw W(t);s=t,U(")");var u=new p(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(!b.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||!b.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=O.filename),U("{",!0)){for(var n;"}"!==(n=x());)t(n);U(";",!0)}else r&&r(),U(";"),e&&("string"!=typeof e.comment||w)&&(e.comment=P(o)||e.comment)}function Y(e,t,r){var o=x();if("group"!==o){if(!b.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($(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=z(x()),a=new i(r);a.group=!0;var c=new s(o,n,r,t);c.filename=O.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(!b.test(t=x()))throw W(t,"name");var o,n=t,i=n;r&&(U(")"),i=n="("+n+")",t=j(),I.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(A=x()))throw W(A,"name");var o,n=A;"{"===j()?o=Q(e,t+"."+A):(U(":"),"{"===j()?o=Q(e,t+"."+A):(o=H(!0),ee(e,t+"."+A,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!==(A=x());)switch(A){case"package":if(!L)throw W(A);J();break;case"import":if(!L)throw W(A);V();break;case"syntax":if(!L)throw W(A);K();break;case"option":Z(D,A),U(";");break;default:if(X(D,A)){L=!1;continue}throw W(A)}return O.filename=null,{package:N,imports:C,weakImports:S,syntax:R,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,l="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")},p=function(){return n.Buffer?function(e){return(c.create=function(e){return n.Buffer.isBuffer(e)?new o(e):l(e)})(e)}:l};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=p(),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=p(),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=p;var o=r(9313);((p.prototype=Object.create(o.prototype)).constructor=p).className="Root";var n,i,s,a=r(3548),c=r(7025),u=r(7598),l=r(9935);function p(e){o.call(this,"",e),this.deferred=[],this.files=[]}function h(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=l.path.resolve,p.prototype.fetch=l.fetch,p.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return l.asPromise(e,n,t,r);var 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 p(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var o,s=i(t,n,r),p=0;if(s.imports)for(;p<s.imports.length;++p)(o=u(s.imports[p])||n.resolvePath(e,s.imports[p]))&&d(o);if(s.weakImports)for(p=0;p<s.weakImports.length;++p)(o=u(s.weakImports[p])||n.resolvePath(e,s.weakImports[p]))&&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?p(e,s[e]):(++f,setTimeout((function(){--f,p(e,s[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}p(e,r)}else++f,n.fetch(e,(function(r,i){--f,o&&(r?t?f||c(null,n):c(r):p(e,i))}))}var f=0;l.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)},p.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,h)},p.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}p.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)}},p.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]}},p._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=p;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 l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function p(e,c){e=e.toString();var u=0,p=e.length,h=1,d=null,f=null,m=0,y=!1,g=!1,v=[],_=null;function E(e){return Error("illegal "+e+" (line "+h+")")}function T(t){return e.charAt(t)}function b(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 l=e.substring(t,r).split(s),p=0;p<l.length;++p)l[p]=l[p].replace(c?i:n,"").trim();f=l.join("\n").trim()}function I(t){var r=O(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function O(e){for(var t=e;t<p&&"\n"!==T(t);)t++;return t}function N(){if(v.length>0)return v.shift();if(_)return function(){var t="'"===_?o:r;t.lastIndex=u-1;var n=t.exec(e);if(!n)throw E("string");return u=t.lastIndex,C(_),_=null,l(n[1])}();var n,i,s,d,f,m=0===u;do{if(u===p)return null;for(n=!1;a.test(s=T(u));)if("\n"===s&&(m=!0,++h),++u===p)return null;if("/"===T(u)){if(++u===p)throw E("comment");if("/"===T(u))if(c){if(d=u,f=!1,I(u)){f=!0;do{if((u=O(u))===p)break;u++}while(I(u))}else u=Math.min(p,O(u)+1);f&&b(d,u,m),h++,n=!0}else{for(f="/"===T(d=u+1);"\n"!==T(++u);)if(u===p)return null;++u,f&&b(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===p)throw E("comment");i=s,s=T(u)}while("*"!==i||"/"!==s);++u,f&&b(d,u-2,m),n=!0}}}while(n);var y=u;if(t.lastIndex=0,!t.test(T(y++)))for(;y<p&&!t.test(T(y));)++y;var g=e.substring(u,u=y);return'"'!==g&&"'"!==g||(_=g),g}function C(e){v.push(e)}function S(){if(!v.length){var e=N();if(null===e)return null;C(e)}return v[0]}return Object.defineProperty({next:N,peek:S,push:C,skip:function(e,t){var r=S();if(r===e)return N(),!0;if(!t)throw E("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&&S(),m!==e||y||!c&&"/"!==d||(t=g?null:f)),t}},"line",{get:function(){return h}})}p.unescape=l},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),l=r(1408),p=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){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),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?a.fromJSON:s.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var p=t.nested[u[l]];r.add((void 0!==p.id?s.fromJSON:void 0!==p.fields?v.fromJSON:void 0!==p.values?n.fromJSON:void 0!==p.methods?c.fromJSON:o.fromJSON)(u[l],p))}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),_(this)}return e instanceof i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),_(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),_(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),_(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:p,types:t,util:h}),this.decode=f(this)({Reader:l,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 l||(e=l.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 l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(7025));var t=new n("Enum"+l++,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 l=n.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}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=p;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 l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){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(p.create=function(){return new o})()}:function(){return new p}};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}p.create=h(),p.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(p.alloc=n.pool(p.alloc,n.Array.prototype.subarray)),p.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},p.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},p.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=i.from(e);return this._push(y,4,t.lo)._push(y,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},p.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]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(n.isString(e)){var r=p.alloc(t=s.length(e));s.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},p.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},p.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},p.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},p._configure=function(e){o=e,p.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,l={};t.forEach((function(e){e.facadeTransport&&(l[e.facadeTransport.transportName]=e.facadeTransport)})),l[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 p;try{p=i.parse(a.data)}catch(e){a.data;break}var h=p[0],d=p[1],f=p[2],m=p[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 l[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),l=r(3616),p=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 p(t,c):a.enabled?new p(t,a):s.enabled&&r.sameScheme?new p(t,s):l.enabled()?new l(e,t):new p(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),l=r(7705),p=r(5581),h=r(2217),d=r(8510),f=r(4886),m=r(685),y=r(3184),g=r(7486),v=r(2530),_=r(3326),E=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 l=u.getOrigin(g.href);this._origin=l?l.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 E(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function b(e){return 1e3===e||e>=3e3&&e<=4999}i(T,y),T.prototype.close=function(e,t){if(e&&!b(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 l.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))}));break;case"m":this.transport,this.dispatchEvent(new _(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),b(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=p(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 l=function(t,o,n){for(var i in o)r.hasOwnProperty.call(o,i)&&e(t,i,o[i],n)},p=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(){}l(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}}),l(Array,{isArray:function(e){return"[object Array]"===s.call(e)}});var f,m,y,g=Object("a"),v="a"!==g[0]||!(0 in g);l(t,{forEach:function(e){var t=p(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 _=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);l(t,{indexOf:function(e){var t=v&&c(this)?this.split(""):p(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}},_);var E,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?(E=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=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),p=0;for(e=new RegExp(e.source,l+"g"),o+="",E||(n=new RegExp("^"+e.source+"$(?!\\s)",l)),r=void 0===r?-1>>>0:r>>>0;(i=e.exec(o))&&!((a=i.index+i[0].length)>p&&(u.push(o.slice(p,i.index)),!E&&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,p=a,u.length>=r));)e.lastIndex===i.index&&e.lastIndex++;return p===o.length?!c&&e.test("")||u.push(""):u.push(o.slice(p)),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 b=n.substr;l(n,{substr:function(e,t){return b.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 l=!1;try{l="withCredentials"in new a}catch(e){}c.supportsCORS=l,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),l=r(8915);function p(e,t,r){if(!p.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=l.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(p,i),p.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}},p.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()}},p.prototype.postMessage=function(e,t){this.iframeObj.post(n.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},p.prototype.send=function(e){this.postMessage("m",e)},p.enabled=function(){return c.iframeEnabled},p.transportName="iframe",p.roundTrips=2,e.exports=p},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 l=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(){l()},u.onload=function(){l()},u.onreadystatechange=function(e){u.readyState,"complete"===u.readyState&&l()},function(){l(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"),l=function(){clearTimeout(i),a.onerror=null},p=function(){u&&(l(),o.unloadDel(s),a.parentNode.removeChild(a),a=u=null,CollectGarbage())},h=function(e){u&&(p(),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(p),{post:function(e,t){try{setTimeout((function(){a&&a.contentWindow&&a.contentWindow.postMessage(e,t)}),0)}catch(e){}},cleanup:p,loaded:l}}},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 l=[["#","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]],p={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,{}),p)delete n[t];else if("object"===s){for(t in e)t in p||(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,p,y,g,v=l.slice(),_=typeof t,E=this,T=0;for("object"!==_&&"string"!==_&&(r=t,t=null),r&&"function"!=typeof r&&(r=n.parse),i=!(s=f(e||"",t=h(t))).protocol&&!s.slashes,E.slashes=s.slashes||i&&t.slashes,E.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(E.protocol)))&&(v[3]=[/(.*)/,"pathname"]);T<v.length;T++)"function"!=typeof(p=v[T])?(c=p[0],g=p[1],c!=c?E[g]=e:"string"==typeof c?~(y=e.indexOf(c))&&("number"==typeof p[2]?(E[g]=e.slice(0,y),e=e.slice(y+p[2])):(E[g]=e.slice(y),e=e.slice(0,y))):(y=c.exec(e))&&(E[g]=y[1],e=e.slice(0,y.index)),E[g]=E[g]||i&&p[3]&&t[g]||"",p[4]&&(E[g]=E[g].toLowerCase())):e=p(e,E);r&&(E.query=r(E.query)),i&&t.slashes&&"/"!==E.pathname.charAt(0)&&(""!==E.pathname||""!==t.pathname)&&(E.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("/")}(E.pathname,t.pathname)),"/"!==E.pathname.charAt(0)&&d(E.protocol)&&(E.pathname="/"+E.pathname),o(E.port,E.protocol)||(E.host=E.hostname,E.port=""),E.username=E.password="",E.auth&&(p=E.auth.split(":"),E.username=p[0]||"",E.password=p[1]||""),E.origin="file:"!==E.protocol&&d(E.protocol)&&E.host?E.protocol+"//"+E.host:"null",E.href=E.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<l.length;a++){var c=l[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:()=>Vo});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptContactInvite:()=>it,acceptInvitation:()=>nt,addContact:()=>rt,addReaction:()=>gt,addToBlackList:()=>ct,addUsersToBlacklist:()=>ut,declineContactInvite:()=>at,declineInvitation:()=>st,deleteContact:()=>ot,deleteReaction:()=>vt,deleteSession:()=>Ke,fetchHistoryMessages:()=>Qe,fetchUserInfoById:()=>$e,getBlacklist:()=>Fe,getChatToken:()=>Ze,getContacts:()=>qe,getReactionDetail:()=>Et,getReactionList:()=>_t,getRoster:()=>He,getSessionList:()=>Ve,recallMessage:()=>yt,removeFromBlackList:()=>lt,removeRoster:()=>mt,removeUserFromBlackList:()=>pt,subscribe:()=>ht,subscribed:()=>dt,unsubscribed:()=>ft,updateCurrentUserNick:()=>Ye,updateOwnUserInfo:()=>Xe,uploadPushToken:()=>Je,uploadToken:()=>ze});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{acceptGroupInvite:()=>Kt,acceptGroupJoinRequest:()=>qt,addUsersToGroupWhitelist:()=>_r,agreeInviteIntoGroup:()=>Vt,agreeJoinGroup:()=>Ht,blockGroup:()=>It,blockGroupMember:()=>cr,blockGroupMembers:()=>lr,blockGroupMessages:()=>Ot,changeGroupOwner:()=>Rt,changeOwner:()=>St,createGroup:()=>bt,createGroupNew:()=>Tt,deleteGroupSharedFile:()=>Ar,destroyGroup:()=>Bt,disableSendGroupMsg:()=>gr,dissolveGroup:()=>Lt,downloadGroupSharedFile:()=>kr,enableSendGroupMsg:()=>vr,fetchGroupAnnouncement:()=>Cr,fetchGroupSharedFileList:()=>wr,getGroup:()=>Ct,getGroupAdmin:()=>Mt,getGroupBlacklist:()=>yr,getGroupBlacklistNew:()=>mr,getGroupInfo:()=>At,getGroupMsgReadUser:()=>Nr,getGroupMuteList:()=>sr,getGroupWhitelist:()=>br,getMuted:()=>ir,groupBlockMulti:()=>ur,groupBlockSingle:()=>ar,inviteToGroup:()=>Gt,inviteUsersToGroup:()=>Wt,isGroupWhiteUser:()=>Ir,isInGroupWhiteList:()=>Or,joinGroup:()=>Ft,listGroupMember:()=>kt,listGroupMembers:()=>xt,listGroups:()=>Nt,modifyGroup:()=>wt,mute:()=>tr,muteGroupMember:()=>rr,quitGroup:()=>Dt,rejectGroupInvite:()=>$t,rejectGroupJoinRequest:()=>Jt,rejectInviteIntoGroup:()=>Xt,rejectJoinGroup:()=>zt,removeAdmin:()=>Pt,removeGroupBlockMulti:()=>dr,removeGroupBlockSingle:()=>pr,removeGroupMember:()=>Zt,removeGroupMembers:()=>er,removeGroupWhitelistMember:()=>Tr,removeMultiGroupMember:()=>Qt,removeMute:()=>or,removeSingleGroupMember:()=>Yt,rmUsersFromGroupWhitelist:()=>Er,setAdmin:()=>jt,setGroupAdmin:()=>Ut,unblockGroupMember:()=>hr,unblockGroupMembers:()=>fr,unmuteGroupMember:()=>nr,updateGroupAnnouncement:()=>Sr,uploadGroupSharedFile:()=>Rr});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:()=>Wr,addUsersToChatRoomWhitelist:()=>ho,blockChatRoomMember:()=>to,blockChatRoomMembers:()=>oo,chatRoomBlockMulti:()=>ro,chatRoomBlockSingle:()=>eo,createChatRoom:()=>Mr,deleteChatRoomSharedFile:()=>To,destroyChatRoom:()=>jr,disableSendChatRoomMsg:()=>lo,enableSendChatRoomMsg:()=>po,fetchChatRoomAnnouncement:()=>vo,fetchChatRoomSharedFileList:()=>bo,getChatRoomAdmin:()=>Jr,getChatRoomBlacklist:()=>uo,getChatRoomBlacklistNew:()=>co,getChatRoomDetails:()=>Ur,getChatRoomMuteList:()=>Qr,getChatRoomMuted:()=>Zr,getChatRoomWhitelist:()=>yo,getChatRooms:()=>xr,isChatRoomWhiteUser:()=>go,joinChatRoom:()=>Fr,listChatRoomMember:()=>qr,listChatRoomMembers:()=>zr,modifyChatRoom:()=>Pr,muteChatRoomMember:()=>Xr,quitChatRoom:()=>Hr,removeChatRoomAdmin:()=>Kr,removeChatRoomBlockMulti:()=>so,removeChatRoomBlockSingle:()=>no,removeChatRoomMember:()=>Br,removeChatRoomMembers:()=>Gr,removeChatRoomWhitelistMember:()=>mo,removeMultiChatRoomMember:()=>Dr,removeMuteChatRoomMember:()=>$r,removeSingleChatRoomMember:()=>Lr,rmUsersFromChatRoomWhitelist:()=>fo,setChatRoomAdmin:()=>Vr,unblockChatRoomMember:()=>io,unblockChatRoomMembers:()=>ao,unmuteChatRoomMember:()=>Yr,updateChatRoomAnnouncement:()=>_o,uploadChatRoomSharedFile:()=>Eo});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{getPresenceStatus:()=>So,getSubscribedPresenceList:()=>Co,publishPresence:()=>Io,subscribePresence:()=>Oo,unsubscribePresence:()=>No});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{getSupportedLanguages:()=>Ro,translateMessage:()=>Ao});var i=__webpack_require__(8e3),s=__webpack_require__.n(i),a=__webpack_require__(3281),c=__webpack_require__.n(a),u=__webpack_require__(3720),l=__webpack_require__.n(u);const p=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 h;!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.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.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",e[e.REACTION_REACH_LIMIT=1100]="REACTION_REACH_LIMIT",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_NOT_IN_GROUP=1102]="REACTION_NOT_IN_GROUP",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.REACTION_APPKEY_NOT_OPEN_SERVICE=1104]="REACTION_APPKEY_NOT_OPEN_SERVICE",e[e.REACTION_GROUP_ID_CAN_NOT_BE_NULL=1105]="REACTION_GROUP_ID_CAN_NOT_BE_NULL"}(h||(h={}));const d=h;var f,m=function(){return m=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},m.apply(this,arguments)},y=function(){};function g(){return"undefined"!=typeof swan&&v(swan)?{platform:f.BAIDU,global:swan}:"undefined"!=typeof tt&&v(tt)?{platform:f.TT,global:tt}:"undefined"!=typeof dd&&v(dd)?{platform:f.DD,global:dd}:"undefined"!=typeof my&&v(my)?{platform:f.ZFB,global:my}:"undefined"!=typeof wx&&v(wx)?{platform:f.WX,global:wx}:"undefined"!=typeof uni&&v(uni)?{platform:f.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:f.WEB,global:window}:{platform:f.NODE,global:__webpack_require__.g||{}}}function v(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.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(f||(f={}));var _={autoIncrement:0,ajax:function(e){return new Promise((function(t,r){var o=e.dataType||"text",n=e.success||y,i=e.error||y,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:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}));default:i({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:d.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}!function(e,t,r){var o,n,i,s,a,c,u,l,p,h=e.response;h&&"string"==typeof h&&(h=JSON.parse(h));var f=e.status;if(400===f)switch(null==h?void 0:h.error_description){case"the user is already operation this message":t({type:d.REACTION_ALREADY_ADDED,message:null==h?void 0:h.error_description});break;case"The quantity has exceeded the limit!":t({type:d.REACTION_REACH_LIMIT,message:null==h?void 0:h.error_description});break;case"The user not in this group!":t({type:d.REACTION_NOT_IN_GROUP,message:null==h?void 0:h.error_description});break;case"the user operation is illegal!":t({type:d.REACTION_OPERATION_IS_ILLEGAL,message:null==h?void 0:h.error_description});break;case"this appKey is not open reaction service!":t({type:d.REACTION_APPKEY_NOT_OPEN_SERVICE,message:null==h?void 0:h.error_description});break;case"groupId can not be null!":t({type:d.REACTION_GROUP_ID_CAN_NOT_BE_NULL,message:null==h?void 0:h.error_description});break;default:t({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:e.responseText}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,message:e.responseText})}else 403===f?("group member list is full!"===h.error_description?(null===(o=e.responseURL)||void 0===o?void 0:o.includes("chatgroups"))?t({type:d.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:h.error_description}):t({type:d.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:h.error_description}):h.error_description.includes(h.error_description.includes("already in group"))?(null===(n=e.responseURL)||void 0===n?void 0:n.includes("chatgroups"))&&t({type:d.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:h.error_description}):h.error_description.includes("are not members of this group")?(null===(i=e.responseURL)||void 0===i?void 0:i.includes("chatgroups"))&&t({type:d.GROUP_NOT_JOINED,data:e.response||e.responseText,message:h.error_description}):t({type:d.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied"}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText})):404===f?((null===(s=h.error_description)||void 0===s?void 0:s.includes("do not find this group"))||(null===(a=h.error_description)||void 0===a?void 0:a.includes("does not exist"))?(null===(c=e.responseURL)||void 0===c?void 0:c.includes("chatgroups"))?t({type:d.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist."}):t({type:d.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist."}):(null===(u=h.error_description)||void 0===u?void 0:u.includes("username"))&&(null===(l=h.error_description)||void 0===l?void 0:l.includes("doesn't exist!'"))||(null===(p=h.error_description)||void 0===p?void 0:p.includes("user not found"))?t({type:d.USER_NOT_FOUND,data:e.response||e.responseText,message:h.error_description}):t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText})):429===f||503===f?(t({type:d.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy."}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy."})):(t({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:""}),r({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:""}))}(s,r,i)}0===s.readyState&&(i({type:d.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:d.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 l in c)c.hasOwnProperty(l)&&(u+=l+"="+c[l]+"&");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 p=e.headers||{};for(var h in p["Content-Type"]||(p["Content-Type"]="application/json"),p)p.hasOwnProperty(h)&&s.setRequestHeader(h,p[h]);s.send(c)})).then((function(e){return"Object"===(t=e,Object.prototype.toString.call(t).slice(8,-1))?m(m({},e),{type:d.REQUEST_SUCCESS}):{data:e,type:d.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;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},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:d.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var l=new XMLHttpRequest;l.upload&&l.upload.addEventListener("progress",e.onFileUploadProgress||y,!1),l.addEventListener("abort",e.onFileUploadCanceled||y,!1),l.addEventListener("error",(function(t){e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,data:l})}),!1),l.addEventListener("load",(function(t){try{var r=JSON.parse(l.responseText);if(400===l.status&&"content improper"===r.error)return e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(t){e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,data:l.responseText})}}),!1),l.open("POST",u),l.setRequestHeader("restrict-access","true"),l.setRequestHeader("Accept","*/*"),l.setRequestHeader("Authorization","Bearer "+o);var p=new FormData;p.append("file",e.file.data),l.send(p)}}else e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:d.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})},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=g();if(r.platform!==f.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:g,wxRequest:function(e){return new Promise((function(t,r){var o=e.success||y,n=e.error||y,i=e.type||"POST",s=e.data||null,a="",c=_.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 l={url:e.url,data:e.data,method:i,headers:{},success:function(e){var i,s;"200"===(null===(i=e.statusCode)||void 0===i?void 0:i.toString())||"200"===(null===(s=e.status)||void 0===s?void 0:s.toString())?(o(e.data),t(e.data)):(n(e),r(e))},complete:function(){},fail:function(e){n(e),r(e)}};if("zfb"===c.platform||"dd"===c.platform?l.headers=e.headers:l.header=e.headers,"dd"===c.platform)return dd.httpRequest(l);c.global.request(l)}))},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||y,e.onFileDownloadError=e.onFileDownloadError||y;var t=new XMLHttpRequest;t.addEventListener("load",(function(r){e.onFileDownloadComplete&&e.onFileDownloadComplete(t.response)}),!1),t.addEventListener("error",(function(r){e.onFileDownloadError&&e.onFileDownloadError({type:d.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)},parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))}};const E=_;var T=__webpack_require__(4188),b=__webpack_require__.n(T);function I(){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 O,N="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),C=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))},S=function(){},R={};!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"}(O||(O={}));var A=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=O,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=O[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<O.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,C([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?S: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&&N?I:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):S)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){return function(){"undefined"!=typeof console&&(this.replaceLoggingMethods.call(this,t,r),this[e].apply(this,arguments))}.bind(this)},e}();function w(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var k=new A;k.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=R[e];return t||(t=R[e]=new A(e,k.getLevel(),k.methodFactory)),t};var x="undefined"!=typeof window?window.log:void 0;k.noConflict=function(){return"undefined"!=typeof window&&window.log===k&&(window.log=x),k},k.getLoggers=function(){return R};const M=k,j=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||"",chatType:e.chatType}},e.create=function(e){return{id:E.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent}},e}(),U=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:E.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e}(),P=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:E.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now()}},e}(),L=function(){function e(e){var t=e.type,r=e.id||E.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){var t,r;return(null===(t=e.msgConfig)||void 0===t?void 0:t.languages)&&Array.isArray(null===(r=e.msgConfig)||void 0===r?void 0:r.languages),{type:"txt",id:E.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),B=function(){function e(e){var t=e.type,r=e.id;this.id=r||E.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:E.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),msgConfig:e.msgConfig}},e}(),D=function(){function e(e){var t=e.type,r=e.id||E.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:E.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),G=function(){function e(e){var t=e.type,r=e.id;this.id=r||E.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:E.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),W=function(){function e(e){var t=e.type,r=e.id||E.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&E.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:E.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress}},e}(),F=function(){function e(e){var t=e.type,r=e.id||E.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&E.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:E.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length,msgConfig:e.msgConfig}},e}(),H=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&&E.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:E.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig}},e}(),q=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&&E.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},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.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,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig}},e}();var z=function(){function e(t,r){return this.type=t,this.id=r||E.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new j({type:"read",id:e.id});case"delivery":return new U({type:"delivery",id:e.id});case"channel":return new P({type:"channel",id:e.id});case"txt":return new L({type:"txt",id:e.id});case"cmd":return new B({type:"cmd",id:e.id});case"custom":return new D({type:"custom",id:e.id});case"loc":return new G({type:"loc",id:e.id});case"img":return new W({type:"img",id:e.id});case"audio":return new F({type:"audio",id:e.id});case"video":return new H({type:"video",id:e.id});case"file":return new q({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)?W.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?B.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?q.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?F.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?H.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?D.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?G.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?P.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?U.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?j.create(e):{}:L.create(e);var t},e.prototype.set=function(e){},e}(),J={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"};function V(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(l())(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(l())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}function K(e,t,r){if(this.delivery&&e!==t){var o=this.getUniqueId(),n=new z("delivery",o);n.set({ackId:r,to:e}),M.debug("send delivery ack"),this.send(n.body)}}const X=function(e,t,r,o){var n,i,s,a,c,u,p,h,d=new(l())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),f=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),m=new(l())(e.id.low,e.id.high,e.id.unsigned).toString(),y=f.ackMessageId?new(l())(f.ackMessageId.low,f.ackMessageId.high,f.ackMessageId.unsigned).toString():"",g="",v=f.from&&f.from.name,_=f.to&&f.to.name;switch(M.debug("thirdMessage:",f),f.type){case 1:g="chat","agoraToken"===this.grantType&&(g="singleChat"),this.delivery&&K.call(this,v,_,m);break;case 2:g="groupchat","agoraToken"===this.grantType&&(g="groupChat");break;case 3:g="chatroom","agoraToken"===this.grantType&&(g="chatRoom");break;case 4:g="read_ack";var E=void 0;return f.ext[0]&&JSON.parse(f.ext[0].stringValue)?(E={id:m,type:"read",from:v,to:_,mid:y,groupReadCount:f.ext[0]&&JSON.parse(f.ext[0].stringValue),ackContent:f.ackContent},this.onReadMessage&&this.onReadMessage(E),void(null===(n=this.eventHandler)||void 0===n||n.dispatch("onReadMessage",E))):(E={id:m,type:"read",from:v,to:_,mid:y},this.onReadMessage&&this.onReadMessage(E),void(null===(i=this.eventHandler)||void 0===i||i.dispatch("onReadMessage",E)));case 5:g="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:m,type:"delivery",from:v,to:_,mid:y});var T={id:m,type:"delivery",from:v,to:_,mid:y};return void(null===(s=this.eventHandler)||void 0===s||s.dispatch("onDeliveredMessage",T));case 6:g="recall";var b={id:m,from:v||"admin",to:_,mid:y};return this.onRecallMessage&&this.onRecallMessage(b),void(null===(a=this.eventHandler)||void 0===a||a.dispatch("onRecallMessage",b));case 7:this.onChannelMessage&&this.onChannelMessage({id:m,type:"channel",chatType:"singleChat",from:v,to:_,time:Number(d)});var I={id:m,type:"channel",chatType:"singleChat",from:v,to:_,time:Number(d)};return void(null===(c=this.eventHandler)||void 0===c||c.dispatch("onChannelMessage",I));default:return void M.error("unexpected message type: "+f.type)}h="chat"===g.toLowerCase()||"singleChat"===g?"singleChat":"groupchat"===g.toLowerCase()||"groupChat"===g?"groupChat":"chatRoom";for(var O=0;O<f.contents.length;O++){var N={},C={},S=t.errorCode>0,R=t.errorCode,A=t.reason,w=f.contents[O],k={},x=[],j=[],U=void 0;if(f.ext&&(k=V(f.ext)),f.meta&&"string"==typeof f.meta){var P=JSON.parse(f.meta);P.reaction&&(x=P.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),P.translations&&(j=P.translations)}switch(w.type){case 0:!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,data:w.text,ext:k,sourceMsg:w.text,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onTextMessage&&this.onTextMessage(N);var L={id:m,type:"txt",chatType:h,msg:w.text,to:_,from:v,ext:k,time:Number(d)};N.msgConfig&&(L.msgConfig=N.msgConfig),x.length>0&&(L.reactions=x),j.length>0&&(L.translations=j),C=L,!r&&this.eventHandler&&this.eventHandler.dispatch("onTextMessage",L);break;case 1:var B=(null===(u=null==w?void 0:w.size)||void 0===u?void 0:u.width)||0,D=(null===(p=null==w?void 0:w.size)||void 0===p?void 0:p.height)||0;U=this.useOwnUploadFun?w.remotePath:(w.remotePath&&this.apiUrl+w.remotePath.substr(w.remotePath.indexOf("/",9)))+"?em-redirect=true",w.secretKey&&!this.useOwnUploadFun&&(U=U+"&share-secret="+w.secretKey),!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,url:U,secret:w.secretKey,filename:w.displayName,thumb:w.thumbnailRemotePath,thumb_secret:w.thumbnailSecretKey,file_length:w.fileLength||"",width:B,height:D,filetype:w.filetype||"",accessToken:this.token,ext:k,time:d,msgConfig:f.msgConfig}).delay&&delete N.delay,!N.msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onPictureMessage&&this.onPictureMessage(N);var G={id:m,type:"img",chatType:h,from:v,to:_,url:U||"",file:{},width:B,height:D,secret:w.secretKey||"",thumb:w.thumbnailRemotePath||"",thumb_secret:w.thumbnailSecretKey||"",ext:k,time:Number(d)};N.msgConfig&&(G.msgConfig=N.msgConfig),x.length>0&&(G.reactions=x),C=G,!r&&this.eventHandler&&this.eventHandler.dispatch("onImageMessage",G);break;case 2:U=this.useOwnUploadFun?w.remotePath:(w.remotePath&&this.apiUrl+w.remotePath.substr(w.remotePath.indexOf("/",9)))+"?em-redirect=true",w.secretKey&&!this.useOwnUploadFun&&(U=U+"&share-secret="+w.secretKey),!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,url:U,secret:w.secretKey,filename:w.displayName,length:w.duration||"",file_length:w.fileLength||"",filetype:w.filetype||"",accessToken:this.token||"",ext:k,time:d,msgConfig:f.msgConfig}).delay&&delete N.delay,!N.msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onVideoMessage&&this.onVideoMessage(N);var W={id:m,type:"video",chatType:h,from:v,to:_,url:U,secret:w.secretKey,filename:w.displayName,length:w.duration||0,file:{},file_length:w.fileLength||0,filetype:w.filetype||"",accessToken:this.token||"",ext:k,time:Number(d)};N.msgConfig&&(W.msgConfig=N.msgConfig),x.length>0&&(W.reactions=x),C=W,!r&&this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",W);break;case 3:!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,addr:w.address,buildingName:w.buildingName,lat:w.latitude,lng:w.longitude,ext:k,time:d,msgConfig:f.msgConfig}).delay&&delete N.delay,!N.msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onLocationMessage&&this.onLocationMessage(N);var F={id:m,type:"loc",chatType:h,from:v,to:_,buildingName:w.buildingName,addr:w.address,lat:w.latitude,lng:w.longitude,ext:k,time:Number(d)};N.msgConfig&&(F.msgConfig=N.msgConfig),x.length>0&&(F.reactions=x),C=F,!r&&this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",F);break;case 4:U=this.useOwnUploadFun?w.remotePath:(w.remotePath&&this.apiUrl+w.remotePath.substr(w.remotePath.indexOf("/",9)))+"?em-redirect=true",w.secretKey&&!this.useOwnUploadFun&&(U=U+"&share-secret="+w.secretKey),!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,url:U,secret:w.secretKey,filename:w.displayName,file_length:w.fileLength||"",accessToken:this.token||"",ext:k,length:w.duration,time:d,msgConfig:f.msgConfig}).delay&&delete N.delay,!N.msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onAudioMessage&&this.onAudioMessage(N);var H={id:m,type:"audio",chatType:h,from:v,to:_,url:U,secret:w.secretKey,file:{},filename:w.displayName,length:w.duration||0,file_length:w.fileLength||0,filetype:w.filetype||"",accessToken:this.token||"",ext:k,time:Number(d)};N.msgConfig&&(H.msgConfig=N.msgConfig),x.length>0&&(H.reactions=x),C=H,!r&&this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",H);break;case 5:U=this.useOwnUploadFun?w.remotePath:(w.remotePath&&this.apiUrl+w.remotePath.substr(w.remotePath.indexOf("/",9)))+"?em-redirect=true",w.secretKey&&!this.useOwnUploadFun&&(U=U+"&share-secret="+w.secretKey),!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,url:U,secret:w.secretKey,filename:w.displayName,file_length:w.fileLength,accessToken:this.token||"",ext:k,time:d,msgConfig:f.msgConfig}).delay&&delete N.delay,!N.msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onFileMessage&&this.onFileMessage(N);var q={id:m,type:"file",chatType:h,from:v,to:_,url:U,secret:w.secretKey,file:{},filename:w.displayName,length:w.duration||0,file_length:w.fileLength||0,filetype:w.filetype||"",accessToken:this.token||"",ext:k,time:Number(d)};N.msgConfig&&(q.msgConfig=N.msgConfig),x.length>0&&(q.reactions=x),C=q,!r&&this.eventHandler&&this.eventHandler.dispatch("onFileMessage",q);break;case 6:!(N={id:m,type:g,contentsType:J[w.type],from:v,to:_,action:w.action,ext:k,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,N.error=S,N.errorText=A,N.errorCode=R,!r&&this.onCmdMessage&&this.onCmdMessage(N);var z={id:m,type:"cmd",chatType:h,from:v,to:_,action:w.action,ext:k,time:Number(d)};N.msgConfig&&(z.msgConfig=N.msgConfig),x.length>0&&(z.reactions=x),C=z,!r&&this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",z);break;case 7:var X={},$={};f.contents[0].customExts&&(X=V(f.contents[0].customExts)),f.contents[0].params&&($=V(f.contents[0].params)),N={id:m,type:g,contentsType:J[w.type],from:v,to:_,customEvent:w.customEvent,params:$,customExts:X,ext:k,time:d},!r&&this.onCustomMessage&&this.onCustomMessage(N);var Y={id:m,type:"custom",chatType:h,from:v,to:_,customEvent:w.customEvent,params:$,customExts:X,ext:k,time:Number(d)};N.msgConfig&&(Y.msgConfig=N.msgConfig),x.length>0&&(Y.reactions=x),C=Y,!r&&this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",Y);break;default:M.error("Unknow message type, message:",w)}return o?C:N}},$=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 Y;!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"}(Y||(Y={}));const Z={operatRoster:function(e,t){var r=[],o=this.root.lookup("easemob.pb.RosterBody"),n=o.decode(r);switch(t){case"add":n.operation=Y.Add;break;case"remove":n.operation=Y.Remove;break;case"accept":n.operation=Y.Accept;break;case"decline":n.operation=Y.Decline;break;case"ban":n.operation=Y.Ban;break;case"allow":n.operation=Y.Allow;break;default:M.error("operatRoster:",t)}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 l=this.root.lookup("easemob.pb.MSync"),p=l.decode(r);p.version=this.version,p.encryptType=[0],p.command=0,p.guid=this.jid,p.payload=u,p=l.encode(p).finish();var h=this.mSync.base64transform(p);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);break;default:M.error("handleRosterMsg:",a)}this.onPresence&&c.type&&this.onPresence(c)}},Q=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=p.create({type:d.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=p.create({type:d.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(s),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",s);break;case 3:s=p.create({type:d.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(s),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",s);break;case 4:s=p.create({type:d.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(s),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",s);break;default:M.error("handleStatisticsMsg:",a)}};function ee(e){var t,r=[],o=[];e.data&&e.data.values&&e.data.values.forEach((function(e){Object.entries(e.status).forEach((function(e){o.push({device:e[0],status:Number(e[1])})})),r.push({userId:e.uid,lastTime:Number(e.last_time),expire:Number(e.expiry),ext:e.ext,statusDetails:o})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function te(e,t){var r=this,o=t.from,n=t.to;e.data.forEach((function(e){var t,i={from:o,to:n,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions};null===(t=r.eventHandler)||void 0===t||t.dispatch("onReactionUpdate",i)}))}const re=function(e){var t=E.parseNotify(e.payload),r=e.from.name,o=e.to.name;switch(console.log("handleNotify",t),t.type){case"presence":ee.call(this,t);break;case"reaction":te.call(this,t,{from:r,to:o});break;default:M.error("unexpected notify type: "+t.type)}};var oe=function(){return oe=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},oe.apply(this,arguments)};function ne(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r="random_"+n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),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.actionVersion="v1.0",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 ie(e,t){var r=this,o=E.getEnvInfo();if("web"===o.platform||"zfb"===o.platform||"dd"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=b().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||(M.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 se(e,t){switch(e.ns){case 0:Q.call(this,e);break;case 1:X.call(this,e,t);break;case 2:$.call(this,e);break;case 3:Z.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this);break;case 5:re.call(this,e);break;default:M.error("distributeMeta",e)}}function ae(e,t){for(var r=function(r){var n=new(l())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return"continue";var i=e[r].from.name,s=e[r].to?e[r].to.name:"",a=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=Ho.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:s,isGroup:a}),se.call(o,e[r],t)},o=this,n=0;n<e.length;n++)r(n)}function ce(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");if(t=t.decode(e.payload),"agoraToken"===this.grantType){var r=new(l())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();this.compareTokenExpireTime(Number(r),this.expirationTime)}if(0===t.unread.length)ye.call(this);else for(var o=0;o<t.unread.length;o++)pe.call(this,t.unread[o].queue)}function ue(){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 le(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 pe(e){M.debug("sendBackqueue");var t=le.call(this,e);we.call(this,t)}function he(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(l())(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 de(e,t){M.debug("sendLastSession");var r=he.call(this,e,t);we.call(this,r)}function fe(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)}me.call(this),ve.call(this),ge.call(this),ye.call(this)}else this.onError&&this.onError({type:d.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function me(){if(this.unSendMsgArr.length>0){for(var e=0;e<this.unSendMsgArr.length;e++){var t=this.unSendMsgArr[e];Ae.call(this,t)}this.unSendMsgArr=[]}}function ye(){var e=ue.call(this);we.call(this,e)}function ge(){var e=Ee.call(this);we.call(this,e)}function ve(){var e=this;_e.call(this),this.heartBeatID=setInterval((function(){ge.call(e)}),this.heartBeatWait)}function _e(){clearInterval(this.heartBeatID)}function Ee(){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 Te(e,t){return e.some((function(e){return e.name===t.name}))}function be(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice").decode(e.payload);Te(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;Te(t._queues,e)&&(pe.call(t,r.queue),M.debug("⬇q:",e))}),1e4),1===this._queues.length&&pe.call(this,r.queue))}function Ie(e){var t=E.getEnvInfo();if("web"===t.platform||"zfb"===t.platform||"dd"===t.platform){for(var r=b().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 Oe(e){switch(e.command){case 0:Ne.call(this,e);break;case 1:ce.call(this,e);break;case 2:be.call(this,e);break;case 3:fe.call(this,e)}}function Ne(e){var t,r,o,n,i=this.root.lookup("easemob.pb.CommSyncDL");i=i.decode(e.payload);var s=new(l())(i.serverId.low,i.serverId.high,i.serverId.unsigned).toString(),a=new(l())(i.metaId.low,i.metaId.high,i.metaId.unsigned).toString();if(0!==i.metas.length)try{ae.call(this,i.metas,i.status)}catch(e){this.onError&&this.onError({type:d.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(i.isLast){var c=-1;this._queues.some((function(e,t){return e.name===i.name&&(c=t,!0)}))&&c>0&&this._queues.splice(c,1),this._queues.length>0&&(pe.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else de.call(this,i.nextKey,i.queue)}else if(i.isLast){var u=-1;this._queues.some((function(e,t){return e.name===i.queue.name&&(u=t,!0)}))&&this._queues.splice(u,1),this._queues.length>0&&(pe.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(i.status&&0===i.status.errorCode){if(this._msgHash[a]){try{(null===(t=this._msgHash[a])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[a].resolve({localMsgId:a,serverMsgId:s}),(null===(r=this._msgHash[a])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[a].success(a,s)}catch(e){this.onError&&this.onError({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:a,mid:s,to:this._msgHash[a].to,time:0}),null===(o=this.eventHandler)||void 0===o||o.dispatch("onReceivedMessage",{id:a,mid:s,to:this._msgHash[a].to}),delete this._msgHash[a]}}else if(i.status&&15===i.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:s}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject({type:d.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(i.status&&1===i.status.errorCode){var h=void 0;switch(i.status.reason){case"blocked":h=d.PERMISSION_DENIED;break;case"group not found":h=d.GROUP_NOT_EXIST;break;case"not in group or chatroom":h=d.GROUP_NOT_JOINED;break;case"exceed recall time limit":h=d.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":h=d.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":h=d.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":h=d.USER_NOT_FRIEND,i.status.reason="not contact";break;default:h=d.SERVER_UNKNOWN_ERROR}if(this._msgHash[a]){var f=p.create({type:h,message:i.status.reason||"",data:{id:a,mid:s}});this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:h,reason:i.status.reason?i.status.reason:"",data:{id:a,mid:s}})}}else if(i.status&&7===i.status.errorCode)"sensitive words"===i.status.reason&&this._msgHash[a]?(f=p.create({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"sensitive words"}})):"blocked by mod_antispam"===i.status.reason&&this._msgHash[a]?(f=p.create({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:d.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"blocked by mod_antispam"}})):"user is mute"===i.status.reason&&this._msgHash[a]&&(f=p.create({type:d.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail(f));else if(i.status&&19===i.status.errorCode)this._msgHash[a]&&(f=p.create({type:d.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:i.status.reason||"",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:d.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:a,mid:s,reason:i.status.reason}}));else if(this._msgHash[a]){try{f=p.create({type:d.WEBIM_LOAD_MSG_ERROR,message:(null===(n=i.status)||void 0===n?void 0:n.reason)||"",data:{id:a,mid:s,reason:i.status&&i.status.reason}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(f),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:d.WEBIM_LOAD_MSG_ERROR,data:{errorCode:i.status&&i.status.errorCode,reason:i.status&&i.status.reason}})}catch(e){this.onError&&this.onError({type:d.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[a]}else this.onError&&this.onError({type:d.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 Se(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):e.file?(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):(i.displayName=e.filename,i.remotePath=e.url,i.secretKey=e.secret,i.fileLength=e.file_length,i.size=e.size,i.thumbnailDisplayName=e.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.buildingName=e.buildingName,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,"groupChat"===n&&(c.msgConfig={allowGroupAck:!0},c.ackContent=e.ackContent)):"chatRoom"===n?c.type=3:"groupChat"===n?(c.type=2,e.msgConfig&&(c.msgConfig={allowGroupAck:!0})):"singleChat"===n&&(c.type=1),c.contents=[i],c.ext=s;var u=function(e){var t={};return"translations"in e&&(t.translations=e.translations),Object.keys(t).length>0?JSON.stringify(t):""}(e);u&&(c.meta=u),c=a.encode(c).finish();var l=this.root.lookup("easemob.pb.Meta").decode(o);l.id=e.id;var p="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(p="conference.easemob.com"),l.from=this.context.jid,l.to={appKey:this.appKey,name:e.to,domain:p},l.ns=1,l.payload=c;var h=this.root.lookup("easemob.pb.CommSyncUL"),f=h.decode(o);f.meta=l,f=h.encode(f).finish();var m=this.root.lookup("easemob.pb.MSync"),y=m.decode(o);return y.version=this.version,y.encryptType=this.encryptType,y.command=0,y.guid=this.context.jid,y.payload=f,m.encode(y).finish()}e.fail&&e.fail({type:d.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Re(e){var t=this;if(!e.file)return e;var r=oe({},e);return r.accessToken=this.token,r.appKey=this.appKey,r.apiUrl=this.apiUrl,r.body&&r.body.url?Se.call(this,r):new Promise((function(o,n){var i=r.onFileUploadComplete;r.onFileUploadComplete=function(o){var n;if(o.entities[0]["file-metadata"]){var s=o.entities[0]["file-metadata"]["content-length"];r.file_length=s,r.filetype=o.entities[0]["file-metadata"]["content-type"],s>204800&&(r.thumbnail=!0)}r.body={type:r.type||"file",secret:o.entities[0]["share-secret"],filename:r.file.filename||r.filename,url:(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,length:r.length||0,filetype:r.filetype||r.file.filetype,file_length:(null===(n=null==r?void 0:r.ext)||void 0===n?void 0:n.file_length)||0,size:{width:r.width||0,height:r.height||0}},r.file.url=o.uri,e.secret=o.entities[0]["share-secret"],e.url=(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,i instanceof Function&&i(o,r.id);var a=Se.call(t,r);we.call(t,a)},E.uploadFile.call(t,r)}))}function Ae(e){var t=this;return new Promise((function(r,o){var n,i;if(t.logOut)return o({type:d.WEBIM_CONNECTION_CLOSED,message:"not login"});if(e.id&&(t._msgHash[e.id]=oe(oe({},e),{resolve:r,reject:o})),("file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type)&&e.file)return Re.call(t,e);if("txt"===e.type&&(null===(n=e.msgConfig)||void 0===n?void 0:n.languages)&&Array.isArray(null===(i=e.msgConfig)||void 0===i?void 0:i.languages)&&e.msgConfig.languages.length>0)t.translateMessage({text:e.msg,languages:e.msgConfig.languages}).then((function(r){var o;console.log("res --",r);var n=null===(o=r.data[0])||void 0===o?void 0:o.translations;n=n.map((function(e){return{code:e.to,text:e.text}})),e.translations=n;var i=Se.call(t,e);we.call(t,i,e.id)})).catch((function(e){o(e)}));else{var s=Se.call(t,e);we.call(t,s,e.id)}}))}function we(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)&&(M.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnect()),void(this.onError&&this.onError({type:d.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var r=ie.call(this,e,t);this.sock.send(r)}const ke=function(e,t){return e.send=Ae,e.sendMsg=Ae,{generateProvision:ne.bind(e),base64transform:ie.bind(e),distributeMeta:se.bind(e),decodeMeta:ae.bind(e),decodeUnreadDL:ce.bind(e),_rebuild:ue.bind(e),_lastsession:he.bind(e),receiveProvision:fe.bind(e),isInQueue:Te.bind(e),decodeNotice:be.bind(e),decodeMSync:Ie.bind(e),distributeMSync:Oe.bind(e),encodeChatMsg:Se.bind(e),upLoadFile:Re.bind(e),send:Ae.bind(e),stopHeartBeat:_e.bind(e)}};var xe=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 M.debug("dispatch event: "+e,t||""),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}();const Me=xe;var je=function(){};function Ue(e){this.onOpened=e.onOpened||je,this.onPresence=e.onPresence||je,this.onTextMessage=e.onTextMessage||je,this.onPictureMessage=e.onPictureMessage||je,this.onAudioMessage=e.onAudioMessage||je,this.onVideoMessage=e.onVideoMessage||je,this.onFileMessage=e.onFileMessage||je,this.onLocationMessage=e.onLocationMessage||je,this.onCmdMessage=e.onCmdMessage||je,this.onCustomMessage=e.onCustomMessage||je,this.onReceivedMessage=e.onReceivedMessage||je,this.onDeliveredMessage=e.onDeliveredMessage||je,this.onReadMessage=e.onReadMessage||je,this.onRecallMessage=e.onRecallMessage||je,this.onMutedMessage=e.onMutedMessage||je,this.onChannelMessage=e.onChannelMessage||je,this.onError=e.onError||je,this.onOffline=e.onOffline||je,this.onOnline=e.onOnline||je,this.onRoster=e.onRoster||je,this.onStatisticMessage=e.onStatisticMessage||je,this.onCreateGroup=e.onCreateGroup||je,this.onBlacklistUpdate=e.onBlacklistUpdate||je,this.onContactInvited=e.onContactInvited||je,this.onContactAgreed=e.onContactAgreed||je,this.onContactRefuse=e.onContactRefuse||je,this.onContactDeleted=e.onContactDeleted||je,this.onContactAdded=e.onContactAdded||je,this.onTokenWillExpire=e.onTokenWillExpire||je,this.onTokenExpired=e.onTokenExpired||je,this.onClosed=e.onClosed||je,this.onPresenceStatusChange=e.onPresenceStatusChange||je}function Pe(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:d.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function Le(){var e;if(!this.context.accessToken){var t=p.create({type:d.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function Be(){return Le.call(this)&&Pe.call(this)}var De=function(){return De=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},De.apply(this,arguments)},Ge=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())}))},We=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 Fe(e){var t=this;if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call getBlacklist"),E.ajax(a)}function He(e){var t=this;if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call getContacts"),E.ajax(a)}var qe=He;function ze(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call uploadPushToken",e),E.ajax(s)}var Je=ze;function Ve(e){if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getSessionList"),E.ajax(s)}function Ke(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: "+e.channel);if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: "+e.deleteRoam);if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r,o=this.context,n=o.orgName,i=o.appName,s=o.accessToken;r="singleChat"===e.chatType?"chat":"groupChat";var a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/user_channel",dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call deleteSession",e),E.ajax(a)}function Xe(e,t){if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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 u=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);u.push(r+"="+o)}})),c=u.join("&")}var l={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 M.debug("Call updateOwnUserInfo",e),E.ajax(l)}function $e(e,t){if(!Be.call(this)){var r=p.create({type:d.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 u={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 M.debug("Call fetchUserInfoById",e),E.ajax(u)}function Ye(e){if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call updateCurrentUserNick",e),E.ajax(s)}function Ze(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 M.debug("Call getChatToken",e),E.ajax(n)}function Qe(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!Be.call(t)){var n=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=this,i=t.count||20;et.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(o){if(o.msgs.length>=i||o.is_last){var s=o.msgs.splice(0,i).reverse();t.success&&t.success(s),r(s)}else e.call(n,De(De({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),M.debug("Call fetchHistoryMessages",e)}))}function et(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,u=c.orgName,l=c.appName,h=function(r){if(r.error&&r.error_description){var o=p.create({type:d.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:"fetch history messages error",data:r});t.onError&&t.onError(o)}"function"==typeof e.fail&&e.fail(h)},f={url:this.apiUrl+"/"+u+"/"+l+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},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(r){for(var o=[],n=0,i=(r=b().atob(r)).length;n<i;++n)o.push(r.charCodeAt(n));var s=t.context.root.lookup("easemob.pb.Meta");if(1===(s=s.decode(o)).ns)return X.call(t,s,{errorCode:0,reason:""},!0,e.format)},c=0;c<s;c++){var u=a(i[c].msg);u&&o.msgs.push(u)}"function"==typeof e.success&&e.success(o)},error:h};E.ajax(f)}}function rt(e,t){var r={id:this.getUniqueId(),to:e,message:t};Z.operatRoster.call(this,r,"add"),M.debug("Call addContact",r)}function ot(e){var t={id:this.getUniqueId(),to:e};Z.operatRoster.call(this,t,"remove"),M.debug("Call deleteContact",t)}function nt(e){var t={id:this.getUniqueId(),to:e};Z.operatRoster.call(this,t,"accept"),M.debug("Call acceptInvitation",t)}var it=nt;function st(e){var t={id:this.getUniqueId(),to:e};Z.operatRoster.call(this,t,"decline"),M.debug("Call declineContactInvite",t)}var at=st;function ct(e){Z.operatRoster.call(this,{to:e.name},"ban"),M.debug("Call addUsersToBlacklist",e)}var ut=ct;function lt(e){Z.operatRoster.call(this,{to:e.name},"allow"),M.debug("Call removeFromBlackList",e)}var pt=lt;function ht(e){Z.operatRoster.call(this,e,"add")}function dt(e){Z.operatRoster.call(this,e,"accept")}function ft(e){Z.operatRoster.call(this,e,"decline")}function mt(e){Z.operatRoster.call(this,e,"remove"),M.debug("Call removeRoster",e)}function yt(e){var t=this.getUniqueId(),r={id:t,to:e.to};this._msgHash[t]=De({},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 M.debug("Call recallMessage",e),this.mSync.send(n,this)}function gt(e){return Ge(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,c,u;return We(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);return Be.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.reaction,a=e.messageId,c={msgId:a,message:s},u={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction",type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,E.ajax(u)]):(t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return l.sent(),[2]}}))}))}function vt(e){return Ge(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,c;return We(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: "+e.reaction);return Be.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.messageId,a=e.reaction,c={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction?msgId="+s+"&message="+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,E.ajax(c)]):(t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return u.sent(),[2]}}))}))}function _t(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatType,a=e.messageId,c={msgIdList:"string"==typeof a?[a]:a,msgType:"singleChat"===s?"chat":"groupchat",groupId:e.groupId||null},u={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction",type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return E.ajax(u)}function Et(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.cursor,a=e.pageSize,c={msgId:e.messageId,message:e.reaction,currentPage:s||null,pageSize:a||20},u={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction/detail",type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return E.ajax(u)}function Tt(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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.desc,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 M.debug("Call createGroup:",e),E.ajax(a)}var bt=Tt;function It(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call blockGroupMessages",e),E.ajax(c)}var Ot=It;function Nt(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call listGroups",e),E.ajax(a)}function Ct(e){if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroup",e),E.ajax(s)}function St(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call changeOwner",e),E.ajax(a)}var Rt=St;function At(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupInfo",e),E.ajax(s)}function wt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call modifyGroup",e),E.ajax(c)}function kt(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call listGroupMember",e),E.ajax(a)}var xt=kt;function Mt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupAdmin",e),E.ajax(a)}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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call setGroupAdmin",e),E.ajax(c)}var Ut=jt;function Pt(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeAdmin",e),E.ajax(c)}function Lt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call destroyGroup",e),E.ajax(a)}var Bt=Lt;function Dt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call quitGroup",e),E.ajax(a)}function Gt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,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 M.debug("Call inviteUsersToGroup",e),E.ajax(c)}var Wt=Gt;function Ft(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call joinGroup",e),E.ajax(s)}function Ht(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call agreeJoinGroup",e),E.ajax(c)}var qt=Ht;function zt(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call rejectGroupJoinRequest",e),E.ajax(c)}var Jt=zt;function Vt(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call acceptGroupInvite",e),E.ajax(c)}var Kt=Vt;function Xt(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call rejectGroupInvite",e),E.ajax(c)}var $t=Xt;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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,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 M.debug("Call removeGroupMember",e),E.ajax(c)}var Zt=Yt;function Qt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeGroupMembers",e),E.ajax(c)}var er=Qt;function tr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call muteGroupMember",e),E.ajax(c)}var rr=tr;function or(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unmuteGroupMember",e),E.ajax(c)}var nr=or;function ir(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupMuteList",e),E.ajax(a)}var sr=ir;function ar(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call blockGroupMember",e),E.ajax(c)}var cr=ar;function ur(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call blockGroupMembers",e),E.ajax(c)}var lr=ur;function pr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unblockGroupMember",e),E.ajax(c)}var hr=pr;function dr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unblockGroupMembers",e),E.ajax(c)}var fr=dr;function mr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupBlacklist",e),E.ajax(a)}var yr=mr;function gr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call disableSendGroupMsg",e),E.ajax(a)}function vr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call enableSendGroupMsg",e),E.ajax(a)}function _r(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call addUsersToGroupWhitelist",e),E.ajax(c)}function Er(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeGroupWhitelistMember",e),E.ajax(a)}var Tr=Er;function br(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupWhitelist",e),E.ajax(a)}function Ir(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call isGroupWhiteUser",e),E.ajax(a)}var Or=Ir;function Nr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getGroupMsgReadUser",e),E.ajax(s)}function Cr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call fetchGroupAnnouncement",e),E.ajax(a)}function Sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call updateGroupAnnouncement",e),E.ajax(c)}function Rr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Be.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.groupId;E.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}),M.debug("Call uploadGroupSharedFile",e)}}function Ar(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call deleteGroupSharedFile",e),E.ajax(c)}function wr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.pageNum||1,a=e.pageSize||10,c=e.groupId,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+c+"/share_files?pagenum="+s+"&pagesize="+a,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call fetchGroupSharedFileList",e),E.ajax(u)}function kr(e){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=this.apiUrl,s=e.groupId,a=e.fileId;E.download.call(this,{url:i+"/"+r+"/"+o+"/chatgroups/"+s+"/share_files/"+a,onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:n,id:a,secret:e.secret}),M.debug("Call downloadGroupSharedFile",e)}function xr(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,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:d.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return M.debug("Call getChatRooms",e),E.ajax(c)}function Mr(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call createChatRoom",e),E.ajax(s)}function jr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,{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 M.debug("Call destroyChatRoom",e),E.ajax(i)}function Ur(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getChatRoomDetails",e),E.ajax(s)}function Pr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call modifyChatRoom",e),E.ajax(c)}function Lr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeChatRoomMember",e),E.ajax(c)}var Br=Lr;function Dr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,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 M.debug("Call removeChatRoomMembers",e),E.ajax(c)}var Gr=Dr;function Wr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,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 M.debug("Call addUsersToChatRoom",e),E.ajax(c)}function Fr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call joinChatRoom",e),E.ajax(s)}function Hr(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!Be.call(this)){var r=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call quitChatRoom",e),E.ajax(a)}function qr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,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 M.debug("Call listChatRoomMembers",e),E.ajax(a)}var zr=qr;function Jr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getChatRoomAdmin",e),E.ajax(a)}function Vr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call setChatRoomAdmin",e),E.ajax(c)}function Kr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeChatRoomAdmin",e),E.ajax(c)}function Xr(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call muteChatRoomMember",e),E.ajax(c)}function $r(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unmuteChatRoomMember",e),E.ajax(c)}var Yr=$r;function Zr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getChatRoomMuteList",e),E.ajax(a)}var Qr=Zr;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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call blockChatRoomMember",e),E.ajax(c)}var to=eo;function ro(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Chat RoomBlock Multi Api:",c),E.ajax(c)}var oo=ro;function no(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unblockChatRoomMember",e),E.ajax(c)}var io=no;function so(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call unblockChatRoomMembers",e),E.ajax(c)}var ao=so;function co(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getChatRoomBlacklist",e),E.ajax(a)}var uo=co;function lo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call disableSendChatRoomMsg",e),E.ajax(a)}function po(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call enableSendChatRoomMsg",e),E.ajax(a)}function ho(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call addUsersToChatRoomWhitelist",e),E.ajax(c)}function fo(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call removeChatRoomWhitelistMember",e),E.ajax(a)}var mo=fo;function yo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call getChatRoomWhitelist",e),E.ajax(a)}function go(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call isChatRoomWhiteUser",e),E.ajax(a)}function vo(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call fetchChatRoomAnnouncement",e),E.ajax(a)}function _o(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call updateChatRoomAnnouncement:",e),E.ajax(c)}function Eo(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(Be.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.roomId;E.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}),M.debug("Call uploadChatRoomSharedFile",e)}}function To(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(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call deleteChatRoomSharedFile",e),E.ajax(c)}function bo(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,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 M.debug("Call fetchChatRoomSharedFileList",e),E.ajax(a)}function Io(e){if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a=this.context.jid.clientResource,c={ext:e.description},u={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence/"+a+"/1",type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call publishPresence:",e),E.ajax(u)}function Oo(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={usernames:e.usernames},c={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/"+e.expiry,type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call subscribePresence:",e),E.ajax(c)}function No(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a=(e.usernames,{url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence",type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error});return M.debug("Call unsubscribePresence:",e),E.ajax(a)}function Co(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "page or pagesize"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/sublist?pageNum="+e.pageNum+"&pageSize="+e.pageSize,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call getSubscribedPresenceList:",e),E.ajax(a)}function So(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={usernames:e.usernames},o=this.context,n=o.orgName,i=o.appName,s=o.userId,a=o.accessToken,c={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence",type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return M.debug("Call getPresenceStatus:",e),E.ajax(c)}function Ro(){if(!Be.call(this)){var e=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(e)}var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i={url:this.apiUrl+"/"+r+"/"+o+"/users/"+this.user+"/translate/support/language",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n}};return M.debug("Call getSupportedLanguages"),E.ajax(i)}function Ao(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');if(!Be.call(this)){var t=p.create({type:d.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/translate",a={text:e.text,to:e.languages},c={url:s,dataType:"json",type:"POST",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i}};return M.debug("Call translateMessage"),E.ajax(c)}var wo=function(){return wo=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},wo.apply(this,arguments)},ko=E.getEnvInfo(),xo="web"===ko.platform,Mo=function(){};function jo(e){var t=this,r=e.promise,o=e.error||Mo;if(!this.orgName&&!this.appName){var n=p.create({type:d.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:function(t){e.success&&e.success(t);var o=wo(wo({},t),{type:d.REQUEST_SUCCESS});r.resolve&&r.resolve(o)},error:function(n){return t.isHttpDNS&&t.restIndex+1<t.restTotal?(t.restIndex++,Fo.call(t,"signup"),jo.call(t,e),Promise.reject(n)):(t.clear(),r.reject&&r.reject(n),o(n))}};return E.ajax(i).catch((function(e){r.reject&&r.reject(e)}))}function Uo(e){var t=this;if(Do.call(this,e)&&!this.isOpened()){Go.call(this,e),this.user=e.user;var r=e.promise;if(e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(o){M.info("getChatToken result:",o),Date.now(),t.expirationTime=o.expire_timestamp,t.token=o.access_token,t.context.accessToken=o.access_token,t.context.restTokenData=o.access_token,r.resolve({accessToken:o.access_token,expireTimestamp:o.expire_timestamp}),Bo.call(t,wo(wo({},e),{access_token:o.access_token}))})).catch((function(e){var o,n=p.create({type:d.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e});r.reject(n),t.onError&&t.onError(n),null===(o=t.eventHandler)||void 0===o||o.dispatch("onError",n)}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,r.resolve({accessToken:e.accessToken}),Bo.call(this,e);else{this.grantType="password";var o={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},n=JSON.stringify(o),i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:n,success:function(o){"function"==typeof e.success&&e.success(o),t.token=o.access_token,t.context.restTokenData=o.access_token,t.context.accessToken=o.access_token,r.resolve({accessToken:o.access_token,duration:o.expires_in}),Bo.call(t,o)}||Mo,error:function(o){if(t.isHttpDNS&&t.restIndex+1<t.restTotal)return t.restIndex++,Fo.call(t,"login"),void Uo.call(t,e);var n;t.clear(),o.error&&o.error_description?(n=p.create({type:d.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),t.onError&&t.onError(n)):(n=p.create({type:d.WEBIM_CONNCTION_OPEN_ERROR,message:"login failed",data:o}),t.onError&&t.onError(n)),"function"==typeof e.error&&e.error(n),r.reject(n)}||Mo,version:"4.0.4"};E.ajax(i).catch((function(e){console.warn(e)}))}E.listenNetwork(Po.bind(this),Lo.bind(this))}}function Po(){var e;M.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(M.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function Lo(){var e;M.debug("offline"),this.onOffline&&this.onOffline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOffline")}function Bo(e){var t=this,r=((new Date).getTime(),this._getSock());this.sock=r;var o=function(){M.debug("websockt onOpen"),t.logOut=!1,"zfb"!==ko.platform&&"dd"!==ko.platform||(t.sock.readyState=1);var e=E.flow([t.mSync.generateProvision,t.mSync.base64transform])();try{r.send(e)}catch(e){var o=p.create({type:d.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(o)}},n=function(){var e,r;if(M.debug("websockt onClose"),"zfb"!==ko.platform&&"dd"!==ko.platform||(t.sock.readyState=3),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax){(new Date).getTime(),t.reconnect();var o={type:d.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:d.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(),M.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;E.flow([o,n])(e)};"web"===ko.platform?(r.onopen=o,r.onclose=n,r.onmessage=i):(r.onOpen(o),r.onMessage(i),r.onClose(n),r.onError((function(e){M.debug("小程序 sock on error",e),t.isOnCloseReconnet=!1,t.onError&&t.onError({type:d.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax&&(M.debug("----- sock.onError reconnect -----",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect())})))}function Do(e){if(""===e.user){var t=p.create({type:d.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=p.create({type:d.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function Go(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 Wo(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(M.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 l=u.filter((function(e){return e.protocol===i&&e}));r.socketHost=l,r.hostTotal=l.length;var p=(o["mserver-im"]?o["mserver-im"].hosts:[]).filter((function(e){if(e.protocol===i)return e}));for(a=0;a<p.length;a++){var h=p[a];p.splice(a,1),p.unshift(h)}if(r.mserverHosts=p,r.mserverTotal=p.length,p&&p.length>0){var d=p[r.mserverIndex],f={url:d.protocol+"://"+d.domain+"/api/v1/sdk/config",dataType:"json",type:"GET",data:{appkey:encodeURIComponent(r.appKey),version:encodeURIComponent(r.version)},success:function(e){},error:function(){console.warn("The service configuration request failed")}};E.ajax(f)}Fo.call(r,e),"login"===e?Uo.call(r,t):jo.call(r,t)}||Mo,error:function(t){M.debug("getHttpDNS fail: "+r.dnsIndex),r.dnsIndex++,r.dnsIndex<r.dnsTotal&&Wo.call(r,e)}||Mo};return E.ajax(o).catch((function(e){console.warn(e)}))}function Fo(e){var t,r;if(this.restIndex>this.restTotal)return"";var o="",n=this.restHosts[this.restIndex],i=n.domain,s=n.ip,a=n.port,c=this.https?"https:":"http:";return s&&"undefined"!=typeof window&&"http:"===(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)?o=c+"//"+s+":"+a:(o=c+"//"+i,a&&"80"!==a&&"443"!==a&&(o+=":"+a),"undefined"==typeof window||window.location||(o="https://"+i),"undefined"!=typeof window&&window.location&&"file:"===(null===(r=window.location)||void 0===r?void 0:r.protocol)&&(o="https://"+i)),"undefined"==typeof window&&(o=c+"//"+i),this.apiUrl=o,o}const Ho=function(){function i(s){var a;this.isDebug=s.isDebug||!1,this.isHttpDNS=void 0===s.isHttpDNS?xo:s.isHttpDNS,this.heartBeatWait=s.heartBeatWait||3e4,this.autoReconnectNumMax=s.autoReconnectNumMax||5,this.delivery=s.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=s.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=s.apiUrl||"",this.url=s.url||"",this.https=s.https||"undefined"!=typeof window&&"https:"===(null===(a=window.location)||void 0===a?void 0:a.protocol),this.mserverIndex=0,this.version="4.0.4",this.deviceId=s.deviceId||"webim",this.osType=16,this.useOwnUploadFun=s.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 c=this.appKey.split("#");if(2!==c.length&&c[0]&&c[1])throw Error("Illegal appkey: "+this.appKey);this.orgName=c[0],this.appName=c[1],this.listen=Ue.bind(this),this.mSync=this.usePlugin(ke),this.eventHandler=this.usePlugin(Me),Object.assign(i.prototype,e),Object.assign(i.prototype,t),Object.assign(i.prototype,r),Object.assign(i.prototype,o),Object.assign(i.prototype,n)}return i.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},i.prototype.listen=function(e){},i.prototype.addEventHandler=function(e,t){},i.prototype.removeEventHandler=function(e){},i.prototype.registerUser=function(e){var t=this;return new Promise((function(r,o){if(t.isHttpDNS){t.dnsIndex=0;var n=wo(wo({},e),{user:e.username,pwd:e.password,promise:{resolve:r,reject:o}});Wo.call(t,"signup",n)}else n=wo(wo({},e),{promise:{resolve:r,reject:o}}),jo.call(t,n)}))},i.prototype.open=function(e){var t=this;return M.debug("open"),new Promise((function(r,o){e.accessToken&&(t.token=e.accessToken);var n=wo(wo({},e),{promise:{resolve:r,reject:o}});t.isHttpDNS?Wo.call(t,"login",n):Uo.call(t,n)}))},i.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},i.prototype.close=function(){this.logOut=!0,this.context.status=d.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=d.STATUS_CLOSED},i.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},i.prototype._checkOpenParams=function(e){return Do.call(this,e)},i.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},i.prototype.heartBeat=function(){},i.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 E.ajax(o)},i.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.context.accessToken=e.access_token,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e.access_token,expire:e.expire_timestamp}})):Promise.reject({status:!1})},i.prototype.clearTokenTimeout=function(){M.debug("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer)},i.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"),M.info("onTokenWillExpire")}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;M.info("onTokenExpired"),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},i.prototype.compareTokenExpireTime=function(e,t){var r,o=Number(t)-Number(e);M.debug("compareTokenExpireTime",o),o<=this.expiresIn/2&&o>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),M.info("onTokenWillExpire")):o<=0&&(this.closeByTokenExpired(),M.info("closeByTokenExpired"))},i.prototype.closeByTokenExpired=function(){var e;M.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},i.prototype.reconnect=function(){var e=this;M.info("reconnect: time",this.times),M.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(){M.info("login sock.readyState: ",e.sock.readyState),e.sock.close(),1!==e.sock.readyState&&(Bo.call(e,{access_token:e.context.accessToken}),e.autoReconnectInterval+=e.times*e.times,e.times++)}),500*this.times),this.autoReconnectNumTotal++)},i.prototype.send=function(e){return Promise.resolve(null)},i.max_cache_length=100,i._getSock=function(){},i}();c().util.Long=l(),c().configure();var qo=c().Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8},meta:{type:"string",id:9}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18},customEvent:{type:"string",id:19},customExts:{rule:"repeated",type:"KeyValue",id:20},buildingName:{type:"string",id:21}},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,NOTIFY:5,QUERY:6}},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},actionVersion:{type:"string",id:16}},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}}}}}}}}}});Ho.prototype.root=qo;var zo=M.getLogger("IM-SDK-LOG");zo.setConfig({useCache:!1,maxCache:3145728}),zo.enableAll(),Ho.prototype._getSock=function(){if(this.isHttpDNS){var e=this.socketHost[this.hostIndex];if(!e)throw this.autoReconnectInterval=0,this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0,this.onClosed&&this.onClosed(),new Error("No connected domain name when get websocket.");var t=e.domain,r=e.ip,o="",n=e.port;o=t||r,n&&"80"!==n&&"443"!==n&&(o+=":"+n),o&&(this.url="//"+o+"/ws");var i=this.https?"https:":"http:";this.url=i+this.url}return new(s())(this.url)},Ho.prototype.getUniqueId=E.getUniqueId;var Jo={connection:Ho,message:z,utils:E,logger:M,statusCode:d};"undefined"!=typeof window&&(window.WebIM=Jo);const Vo=Jo})(),__webpack_exports__})()}));
3
3
  //# sourceMappingURL=Easemob-chat.js.map