nim-web-sdk-ng 10.2.3 → 10.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/v1/CHATROOM_BROWSER_SDK.js +4 -4
- package/dist/v1/CHATROOM_MINIAPP_SDK.js +4 -4
- package/dist/v1/CHATROOM_UNIAPP_SDK.js +4 -4
- package/dist/v1/QCHAT_BROWSER_SDK.js +4 -4
- package/dist/v1/QCHAT_UNIAPP_SDK.js +4 -4
- package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMChatroomMessageService.d.ts +1 -14
- package/dist/v2/CHATROOM_BROWSER_SDK/V2NIMChatroomQueueService.d.ts +0 -120
- package/dist/v2/CHATROOM_BROWSER_SDK/index.d.ts +0 -2
- package/dist/v2/CHATROOM_BROWSER_SDK.js +4 -4
- package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMChatroomMessageService.d.ts +1 -14
- package/dist/v2/CHATROOM_MINIAPP_SDK/V2NIMChatroomQueueService.d.ts +0 -120
- package/dist/v2/CHATROOM_MINIAPP_SDK/index.d.ts +0 -2
- package/dist/v2/CHATROOM_MINIAPP_SDK.js +4 -4
- package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMChatroomMessageService.d.ts +1 -14
- package/dist/v2/CHATROOM_UNIAPP_SDK/V2NIMChatroomQueueService.d.ts +0 -120
- package/dist/v2/CHATROOM_UNIAPP_SDK/index.d.ts +0 -2
- package/dist/v2/CHATROOM_UNIAPP_SDK.js +4 -4
- package/dist/v2/NIM_BROWSER_SDK/V2NIMConversationService.d.ts +2 -2
- package/dist/v2/NIM_BROWSER_SDK.js +4 -4
- package/dist/v2/NIM_MINIAPP_SDK/V2NIMConversationService.d.ts +2 -2
- package/dist/v2/NIM_MINIAPP_SDK.js +4 -4
- package/dist/v2/NIM_UNIAPP_SDK/V2NIMConversationService.d.ts +2 -2
- package/dist/v2/NIM_UNIAPP_SDK.js +4 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* Version: 10.2.
|
|
3
|
+
* Version: 10.2.4
|
|
4
4
|
*
|
|
5
|
-
* Git Hash:
|
|
5
|
+
* Git Hash: f9d6d8fc6f03a608fb106ecae8840c9fb518458b
|
|
6
6
|
*
|
|
7
|
-
* Created At: 2024/
|
|
7
|
+
* Created At: 2024/4/8 下午4:53:40
|
|
8
8
|
*
|
|
9
9
|
* Target: CHATROOM_BROWSER_SDK.js
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=a()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var a={exports:{}};return t(a,a.exports),a.exports}var a,c,h=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},m=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},g=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),_=Function.prototype,E=_.apply,b=_.call,O="object"==typeof Reflect&&Reflect.apply||(g?b.bind(E):function(){return b.apply(E,arguments)}),T=Function.prototype,S=T.bind,C=T.call,I=g&&S.bind(C,C),R=g?function(t){return t&&I(t)}:function(t){return t&&function(){return C.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},M=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),k=Function.prototype.call,w=g?k.bind(k):function(){return k.apply(k,arguments)},N={}.propertyIsEnumerable,x=Object.getOwnPropertyDescriptor,A={f:x&&!N.call({1:2},1)?function propertyIsEnumerable(t){var a=x(this,t);return!!a&&a.enumerable}:N},createPropertyDescriptor=function(t,a){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:a}},P=R({}.toString),L=R("".slice),classofRaw=function(t){return L(P(t),8,-1)},D=Object,V=R("".split),j=fails((function(){return!D("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?V(t,""):D(t)}:D,isNullOrUndefined=function(t){return null==t},U=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw U("Can't call method on "+t);return t},toIndexedObject=function(t){return j(requireObjectCoercible(t))},B="object"==typeof document&&document.all,H=void 0===B&&void 0!==B?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===B}:function(t){return"object"==typeof t?null!==t:isCallable(t)},G={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,a){return arguments.length<2?aFunction(G[t])||aFunction(m[t]):G[t]&&G[t][a]||m[t]&&m[t][a]},K=R({}.isPrototypeOf),q=getBuiltIn("navigator","userAgent")||"",W=m.process,z=m.Deno,$=W&&W.versions||z&&z.version,Y=$&&$.v8;Y&&(c=(a=Y.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!c&&q&&(!(a=q.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=q.match(/Chrome\/(\d+)/))&&(c=+a[1]);var X,Q=c,J=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Q&&Q<41})),Z=J&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ee=Object,te=Z?function(t){return"symbol"==typeof t}:function(t){var a=getBuiltIn("Symbol");return isCallable(a)&&K(a.prototype,ee(t))},re=String,tryToString=function(t){try{return re(t)}catch(t){return"Object"}},oe=TypeError,aCallable=function(t){if(isCallable(t))return t;throw oe(tryToString(t)+" is not a function")},getMethod=function(t,a){var c=t[a];return isNullOrUndefined(c)?void 0:aCallable(c)},ne=TypeError,ie=Object.defineProperty,ae="__core-js_shared__",se=m[ae]||function(t,a){try{ie(m,t,{value:a,configurable:!0,writable:!0})}catch(c){m[t]=a}return a}(ae,{}),ce=createCommonjsModule((function(t){(t.exports=function(t,a){return se[t]||(se[t]=void 0!==a?a:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ue=Object,toObject=function(t){return ue(requireObjectCoercible(t))},le=R({}.hasOwnProperty),de=Object.hasOwn||function hasOwn(t,a){return le(toObject(t),a)},fe=0,pe=Math.random(),he=R(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+he(++fe+pe,36)},me=ce("wks"),ge=m.Symbol,ve=ge&&ge.for,ye=Z?ge:ge&&ge.withoutSetter||uid,wellKnownSymbol=function(t){if(!de(me,t)||!J&&"string"!=typeof me[t]){var a="Symbol."+t;J&&de(ge,t)?me[t]=ge[t]:me[t]=Z&&ve?ve(a):ye(a)}return me[t]},_e=TypeError,Ee=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,a){if(!H(t)||te(t))return t;var c,h=getMethod(t,Ee);if(h){if(void 0===a&&(a="default"),c=w(h,t,a),!H(c)||te(c))return c;throw _e("Can't convert object to primitive value")}return void 0===a&&(a="number"),function(t,a){var c,h;if("string"===a&&isCallable(c=t.toString)&&!H(h=w(c,t)))return h;if(isCallable(c=t.valueOf)&&!H(h=w(c,t)))return h;if("string"!==a&&isCallable(c=t.toString)&&!H(h=w(c,t)))return h;throw ne("Can't convert object to primitive value")}(t,a)},toPropertyKey=function(t){var a=toPrimitive(t,"string");return te(a)?a:a+""},be=m.document,Oe=H(be)&&H(be.createElement),documentCreateElement=function(t){return Oe?be.createElement(t):{}},Te=!M&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),Se=Object.getOwnPropertyDescriptor,Ce={f:M?Se:function getOwnPropertyDescriptor(t,a){if(t=toIndexedObject(t),a=toPropertyKey(a),Te)try{return Se(t,a)}catch(t){}if(de(t,a))return createPropertyDescriptor(!w(A.f,t,a),t[a])}},Ie=/#|\.prototype\./,isForced=function(t,a){var c=Me[Re(t)];return c==we||c!=ke&&(isCallable(a)?fails(a):!!a)},Re=isForced.normalize=function(t){return String(t).replace(Ie,".").toLowerCase()},Me=isForced.data={},ke=isForced.NATIVE="N",we=isForced.POLYFILL="P",Ne=isForced,xe=R(R.bind),functionBindContext=function(t,a){return aCallable(t),void 0===a?t:g?xe(t,a):function(){return t.apply(a,arguments)}},Ae=M&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Pe=String,Le=TypeError,anObject=function(t){if(H(t))return t;throw Le(Pe(t)+" is not an object")},De=TypeError,Ve=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,je="enumerable",Ue="configurable",Be="writable",He={f:M?Ae?function defineProperty(t,a,c){if(anObject(t),a=toPropertyKey(a),anObject(c),"function"==typeof t&&"prototype"===a&&"value"in c&&Be in c&&!c.writable){var h=Fe(t,a);h&&h.writable&&(t[a]=c.value,c={configurable:Ue in c?c.configurable:h.configurable,enumerable:je in c?c.enumerable:h.enumerable,writable:!1})}return Ve(t,a,c)}:Ve:function defineProperty(t,a,c){if(anObject(t),a=toPropertyKey(a),anObject(c),Te)try{return Ve(t,a,c)}catch(t){}if("get"in c||"set"in c)throw De("Accessors not supported");return"value"in c&&(t[a]=c.value),t}},Ge=M?function(t,a,c){return He.f(t,a,createPropertyDescriptor(1,c))}:function(t,a,c){return t[a]=c,t},Ke=Ce.f,wrapConstructor=function(t){var Wrapper=function(a,c,h){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(a);case 2:return new t(a,c)}return new t(a,c,h)}return O(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,a){var c,h,g,_,E,b,O,T,S=t.target,C=t.global,I=t.stat,M=t.proto,k=C?m:I?m[S]:(m[S]||{}).prototype,w=C?G:G[S]||Ge(G,S,{})[S],N=w.prototype;for(g in a)c=!Ne(C?g:S+(I?".":"#")+g,t.forced)&&k&&de(k,g),E=w[g],c&&(b=t.dontCallGetSet?(T=Ke(k,g))&&T.value:k[g]),_=c&&b?b:a[g],c&&typeof E==typeof _||(O=t.bind&&c?functionBindContext(_,m):t.wrap&&c?wrapConstructor(_):M&&isCallable(_)?R(_):_,(t.sham||_&&_.sham||E&&E.sham)&&Ge(O,"sham",!0),Ge(w,g,O),M&&(de(G,h=S+"Prototype")||Ge(G,h,{}),Ge(G[h],g,_),t.real&&N&&!N[g]&&Ge(N,g,_)))},qe=Math.ceil,We=Math.floor,ze=Math.trunc||function trunc(t){var a=+t;return(a>0?We:qe)(a)},toIntegerOrInfinity=function(t){var a=+t;return a!=a||0===a?0:ze(a)},$e=Math.max,Ye=Math.min,toAbsoluteIndex=function(t,a){var c=toIntegerOrInfinity(t);return c<0?$e(c+a,0):Ye(c,a)},Xe=Math.min,lengthOfArrayLike=function(t){return(a=t.length)>0?Xe(toIntegerOrInfinity(a),9007199254740991):0;var a},createMethod$4=function(t){return function(a,c,h){var m,g=toIndexedObject(a),_=lengthOfArrayLike(g),E=toAbsoluteIndex(h,_);if(t&&c!=c){for(;_>E;)if((m=g[E++])!=m)return!0}else for(;_>E;E++)if((t||E in g)&&g[E]===c)return t||E||0;return!t&&-1}},Qe={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Je={},Ze=Qe.indexOf,et=R([].push),objectKeysInternal=function(t,a){var c,h=toIndexedObject(t),m=0,g=[];for(c in h)!de(Je,c)&&de(h,c)&&et(g,c);for(;a.length>m;)de(h,c=a[m++])&&(~Ze(g,c)||et(g,c));return g},tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=Object.keys||function keys(t){return objectKeysInternal(t,tt)},ot=M&&!Ae?Object.defineProperties:function defineProperties(t,a){anObject(t);for(var c,h=toIndexedObject(a),m=rt(a),g=m.length,_=0;g>_;)He.f(t,c=m[_++],h[c]);return t},nt={f:ot},it=getBuiltIn("document","documentElement"),at=ce("keys"),sharedKey=function(t){return at[t]||(at[t]=uid(t))},st=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var a=t.parentWindow.Object;return t=null,a},NullProtoObject=function(){try{X=new ActiveXObject("htmlfile")}catch(t){}var t,a;NullProtoObject="undefined"!=typeof document?document.domain&&X?NullProtoObjectViaActiveX(X):((a=documentCreateElement("iframe")).style.display="none",it.appendChild(a),a.src=String("javascript:"),(t=a.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(X);for(var c=tt.length;c--;)delete NullProtoObject.prototype[tt[c]];return NullProtoObject()};Je[st]=!0;var ct=Object.create||function create(t,a){var c;return null!==t?(EmptyConstructor.prototype=anObject(t),c=new EmptyConstructor,EmptyConstructor.prototype=null,c[st]=t):c=NullProtoObject(),void 0===a?c:nt.f(c,a)};_export({target:"Object",stat:!0,sham:!M},{create:ct});var ut=G.Object,lt=function create(t,a){return ut.create(t,a)},dt=String,ft=TypeError,pt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,a=!1,c={};try{(t=R(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(c,[]),a=c instanceof Array}catch(t){}return function setPrototypeOf(c,h){return anObject(c),function(t){if("object"==typeof t||isCallable(t))return t;throw ft("Can't set "+dt(t)+" as a prototype")}(h),a?t(c,h):c.__proto__=h,c}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:pt});var ht=G.Object.setPrototypeOf,mt=R([].slice),gt=Function,vt=R([].concat),yt=R([].join),_t={},construct$8=function(t,a,c){if(!de(_t,a)){for(var h=[],m=0;m<a;m++)h[m]="a["+m+"]";_t[a]=gt("C,a","return new C("+yt(h,",")+")")}return _t[a](t,c)},Et=g?gt.bind:function bind(t){var a=aCallable(this),c=a.prototype,h=mt(arguments,1),m=function bound(){var c=vt(h,mt(arguments));return this instanceof m?construct$8(a,c.length,c):a.apply(t,c)};return H(c)&&(m.prototype=c),m};_export({target:"Function",proto:!0,forced:Function.bind!==Et},{bind:Et});var entryVirtual=function(t){return G[t+"Prototype"]},bt=entryVirtual("Function").bind,Ot=Function.prototype,bind$1=function(t){var a=t.bind;return t===Ot||K(Ot,t)&&a===Ot.bind?bt:a},Tt=createCommonjsModule((function(t){function _setPrototypeOf(a,c){var h;return t.exports=_setPrototypeOf=ht?bind$1(h=ht).call(h):function _setPrototypeOf(t,a){return t.__proto__=a,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(a,c)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),St=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,a){t.prototype=lt(a.prototype),t.prototype.constructor=t,Tt(t,a)},t.exports.__esModule=!0,t.exports.default=t.exports})));_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Ct={f:Object.getOwnPropertySymbols},It=Object.assign,Rt=Object.defineProperty,Mt=R([].concat),kt=!It||fails((function(){if(M&&1!==It({b:1},It(Rt({},"a",{enumerable:!0,get:function(){Rt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},a={},c=Symbol(),h="abcdefghijklmnopqrst";return t[c]=7,h.split("").forEach((function(t){a[t]=t})),7!=It({},t)[c]||rt(It({},a)).join("")!=h}))?function assign(t,a){for(var c=toObject(t),h=arguments.length,m=1,g=Ct.f,_=A.f;h>m;)for(var E,b=j(arguments[m++]),O=g?Mt(rt(b),g(b)):rt(b),T=O.length,S=0;T>S;)E=O[S++],M&&!w(_,b,E)||(c[E]=b[E]);return c}:It;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==kt},{assign:kt});var wt=G.Object.assign,Nt=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),xt=sharedKey("IE_PROTO"),At=Object,Pt=At.prototype,Lt=Nt?At.getPrototypeOf:function(t){var a=toObject(t);if(de(a,xt))return a[xt];var c=a.constructor;return isCallable(c)&&a instanceof c?c.prototype:a instanceof At?Pt:null},Dt=tt.concat("length","prototype"),Vt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Dt)}},Ft=R([].concat),jt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var a=Vt.f(anObject(t)),c=Ct.f;return c?Ft(a,c(t)):a},Ut=Error,Bt=R("".replace),Ht=String(Ut("zxcasd").stack),Gt=/\n\s*at [^:]*:[^\n]*/,Kt=Gt.test(Ht),errorStackClear=function(t,a){if(Kt&&"string"==typeof t&&!Ut.prepareStackTrace)for(;a--;)t=Bt(t,Gt,"");return t},installErrorCause=function(t,a){H(a)&&"cause"in a&&Ge(t,"cause",a.cause)},qt={},Wt=wellKnownSymbol("iterator"),zt=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(qt.Array===t||zt[Wt]===t)},$t={};$t[wellKnownSymbol("toStringTag")]="z";var Yt="[object z]"===String($t),Xt=wellKnownSymbol("toStringTag"),Qt=Object,Jt="Arguments"==classofRaw(function(){return arguments}()),Zt=Yt?classofRaw:function(t){var a,c,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,a){try{return t[a]}catch(t){}}(a=Qt(t),Xt))?c:Jt?classofRaw(a):"Object"==(h=classofRaw(a))&&isCallable(a.callee)?"Arguments":h},er=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,er)||getMethod(t,"@@iterator")||qt[Zt(t)]},tr=TypeError,getIterator=function(t,a){var c=arguments.length<2?getIteratorMethod$5(t):a;if(aCallable(c))return anObject(w(c,t));throw tr(tryToString(t)+" is not iterable")},iteratorClose=function(t,a,c){var h,m;anObject(t);try{if(!(h=getMethod(t,"return"))){if("throw"===a)throw c;return c}h=w(h,t)}catch(t){m=!0,h=t}if("throw"===a)throw c;if(m)throw h;return anObject(h),c},rr=TypeError,Result=function(t,a){this.stopped=t,this.result=a},or=Result.prototype,iterate=function(t,a,c){var h,m,g,_,E,b,O,T=c&&c.that,S=!(!c||!c.AS_ENTRIES),C=!(!c||!c.IS_RECORD),I=!(!c||!c.IS_ITERATOR),R=!(!c||!c.INTERRUPTED),M=functionBindContext(a,T),stop=function(t){return h&&iteratorClose(h,"normal",t),new Result(!0,t)},callFn=function(t){return S?(anObject(t),R?M(t[0],t[1],stop):M(t[0],t[1])):R?M(t,stop):M(t)};if(C)h=t.iterator;else if(I)h=t;else{if(!(m=getIteratorMethod$5(t)))throw rr(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(m)){for(g=0,_=lengthOfArrayLike(t);_>g;g++)if((E=callFn(t[g]))&&K(or,E))return E;return new Result(!1)}h=getIterator(t,m)}for(b=C?t.next:h.next;!(O=w(b,h)).done;){try{E=callFn(O.value)}catch(t){iteratorClose(h,"throw",t)}if("object"==typeof E&&E&&K(or,E))return E}return new Result(!1)},nr=String,toString$1=function(t){if("Symbol"===Zt(t))throw TypeError("Cannot convert a Symbol value to a string");return nr(t)},normalizeStringArgument=function(t,a){return void 0===t?arguments.length<2?"":a:toString$1(t)},ir=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),ar=wellKnownSymbol("toStringTag"),sr=Error,cr=[].push,ur=function AggregateError(t,a){var c,h=arguments.length>2?arguments[2]:void 0,m=K(lr,this);pt?c=pt(sr(),m?Lt(this):lr):(c=m?this:ct(lr),Ge(c,ar,"Error")),void 0!==a&&Ge(c,"message",normalizeStringArgument(a)),ir&&Ge(c,"stack",errorStackClear(c.stack,1)),installErrorCause(c,h);var g=[];return iterate(t,cr,{that:g}),Ge(c,"errors",g),c};pt?pt(ur,sr):function(t,a,c){for(var h=jt(a),m=He.f,g=Ce.f,_=0;_<h.length;_++){var E=h[_];de(t,E)||c&&de(c,E)||m(t,E,g(a,E))}}(ur,sr,{name:!0});var lr=ur.prototype=ct(sr.prototype,{constructor:createPropertyDescriptor(1,ur),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:ur});var dr,fr,pr,hr=m.WeakMap,mr=isCallable(hr)&&/native code/.test(String(hr)),gr="Object already initialized",vr=m.TypeError,yr=m.WeakMap;if(mr||se.state){var _r=se.state||(se.state=new yr),Er=R(_r.get),br=R(_r.has),Or=R(_r.set);dr=function(t,a){if(br(_r,t))throw vr(gr);return a.facade=t,Or(_r,t,a),a},fr=function(t){return Er(_r,t)||{}},pr=function(t){return br(_r,t)}}else{var Tr=sharedKey("state");Je[Tr]=!0,dr=function(t,a){if(de(t,Tr))throw vr(gr);return a.facade=t,Ge(t,Tr,a),a},fr=function(t){return de(t,Tr)?t[Tr]:{}},pr=function(t){return de(t,Tr)}}var Sr,Cr,Ir,Rr={set:dr,get:fr,has:pr,enforce:function(t){return pr(t)?fr(t):dr(t,{})},getterFor:function(t){return function(a){var c;if(!H(a)||(c=fr(a)).type!==t)throw vr("Incompatible receiver, "+t+" required");return c}}},Mr=Function.prototype,kr=M&&Object.getOwnPropertyDescriptor,wr=de(Mr,"name"),Nr={EXISTS:wr,PROPER:wr&&"something"===function something(){}.name,CONFIGURABLE:wr&&(!M||M&&kr(Mr,"name").configurable)},defineBuiltIn=function(t,a,c,h){return h&&h.enumerable?t[a]=c:Ge(t,a,c),t},xr=wellKnownSymbol("iterator"),Ar=!1;[].keys&&("next"in(Ir=[].keys())?(Cr=Lt(Lt(Ir)))!==Object.prototype&&(Sr=Cr):Ar=!0);var Pr=!H(Sr)||fails((function(){var t={};return Sr[xr].call(t)!==t}));Sr=Pr?{}:ct(Sr),isCallable(Sr[xr])||defineBuiltIn(Sr,xr,(function(){return this}));var Lr={IteratorPrototype:Sr,BUGGY_SAFARI_ITERATORS:Ar},Dr=Yt?{}.toString:function toString(){return"[object "+Zt(this)+"]"},Vr=He.f,Fr=wellKnownSymbol("toStringTag"),setToStringTag=function(t,a,c,h){if(t){var m=c?t:t.prototype;de(m,Fr)||Vr(m,Fr,{configurable:!0,value:a}),h&&!Yt&&Ge(m,"toString",Dr)}},jr=Lr.IteratorPrototype,returnThis$1=function(){return this},Ur=Nr.PROPER,Br=Lr.BUGGY_SAFARI_ITERATORS,Hr=wellKnownSymbol("iterator"),Gr="keys",Kr="values",qr="entries",returnThis=function(){return this},iteratorDefine=function(t,a,c,h,m,g,_){!function(t,a,c,h){var m=a+" Iterator";t.prototype=ct(jr,{next:createPropertyDescriptor(+!h,c)}),setToStringTag(t,m,!1,!0),qt[m]=returnThis$1}(c,a,h);var E,b,O,getIterationMethod=function(t){if(t===m&&R)return R;if(!Br&&t in C)return C[t];switch(t){case Gr:return function keys(){return new c(this,t)};case Kr:return function values(){return new c(this,t)};case qr:return function entries(){return new c(this,t)}}return function(){return new c(this)}},T=a+" Iterator",S=!1,C=t.prototype,I=C[Hr]||C["@@iterator"]||m&&C[m],R=!Br&&I||getIterationMethod(m),M="Array"==a&&C.entries||I;if(M&&(E=Lt(M.call(new t)))!==Object.prototype&&E.next&&(setToStringTag(E,T,!0,!0),qt[T]=returnThis),Ur&&m==Kr&&I&&I.name!==Kr&&(S=!0,R=function values(){return w(I,this)}),m)if(b={values:getIterationMethod(Kr),keys:g?R:getIterationMethod(Gr),entries:getIterationMethod(qr)},_)for(O in b)(Br||S||!(O in C))&&defineBuiltIn(C,O,b[O]);else _export({target:a,proto:!0,forced:Br||S},b);return _&&C[Hr]!==R&&defineBuiltIn(C,Hr,R,{name:m}),qt[a]=R,b};He.f;var Wr="Array Iterator",zr=Rr.set,$r=Rr.getterFor(Wr);iteratorDefine(Array,"Array",(function(t,a){zr(this,{type:Wr,target:toIndexedObject(t),index:0,kind:a})}),(function(){var t=$r(this),a=t.target,c=t.kind,h=t.index++;return!a||h>=a.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==c?{value:h,done:!1}:"values"==c?{value:a[h],done:!1}:{value:[h,a[h]],done:!1}}),"values"),qt.Arguments=qt.Array;var Yr="process"==classofRaw(m.process),Xr=wellKnownSymbol("species"),setSpecies=function(t){var a=getBuiltIn(t),c=He.f;M&&a&&!a[Xr]&&c(a,Xr,{configurable:!0,get:function(){return this}})},Qr=TypeError,anInstance=function(t,a){if(K(a,t))return t;throw Qr("Incorrect invocation")},Jr=R(Function.toString);isCallable(se.inspectSource)||(se.inspectSource=function(t){return Jr(t)});var Zr=se.inspectSource,noop$1=function(){},eo=[],to=getBuiltIn("Reflect","construct"),ro=/^\s*(?:class|function)\b/,oo=R(ro.exec),no=!ro.exec(noop$1),io=function isConstructor(t){if(!isCallable(t))return!1;try{return to(noop$1,eo,t),!0}catch(t){return!1}},ao=function isConstructor(t){if(!isCallable(t))return!1;switch(Zt(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return no||!!oo(ro,Zr(t))}catch(t){return!0}};ao.sham=!0;var so,co,uo,lo,fo=!to||fails((function(){var t;return io(io.call)||!io(Object)||!io((function(){t=!0}))||t}))?ao:io,po=TypeError,aConstructor=function(t){if(fo(t))return t;throw po(tryToString(t)+" is not a constructor")},ho=wellKnownSymbol("species"),speciesConstructor=function(t,a){var c,h=anObject(t).constructor;return void 0===h||isNullOrUndefined(c=anObject(h)[ho])?a:aConstructor(c)},mo=TypeError,validateArgumentsLength=function(t,a){if(t<a)throw mo("Not enough arguments");return t},go=/(?:ipad|iphone|ipod).*applewebkit/i.test(q),vo=m.setImmediate,yo=m.clearImmediate,_o=m.process,Eo=m.Dispatch,bo=m.Function,Oo=m.MessageChannel,To=m.String,So=0,Co={},Io="onreadystatechange";try{so=m.location}catch(t){}var run=function(t){if(de(Co,t)){var a=Co[t];delete Co[t],a()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){m.postMessage(To(t),so.protocol+"//"+so.host)};vo&&yo||(vo=function setImmediate(t){validateArgumentsLength(arguments.length,1);var a=isCallable(t)?t:bo(t),c=mt(arguments,1);return Co[++So]=function(){O(a,void 0,c)},co(So),So},yo=function clearImmediate(t){delete Co[t]},Yr?co=function(t){_o.nextTick(runner(t))}:Eo&&Eo.now?co=function(t){Eo.now(runner(t))}:Oo&&!go?(lo=(uo=new Oo).port2,uo.port1.onmessage=listener,co=functionBindContext(lo.postMessage,lo)):m.addEventListener&&isCallable(m.postMessage)&&!m.importScripts&&so&&"file:"!==so.protocol&&!fails(post)?(co=post,m.addEventListener("message",listener,!1)):co=Io in documentCreateElement("script")?function(t){it.appendChild(documentCreateElement("script")).onreadystatechange=function(){it.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var Ro,Mo,ko,wo,No,xo,Ao,Po,Lo={set:vo,clear:yo},Do=/ipad|iphone|ipod/i.test(q)&&void 0!==m.Pebble,Vo=/web0s(?!.*chrome)/i.test(q),Fo=Ce.f,jo=Lo.set,Uo=m.MutationObserver||m.WebKitMutationObserver,Bo=m.document,Ho=m.process,Go=m.Promise,Ko=Fo(m,"queueMicrotask"),qo=Ko&&Ko.value;qo||(Ro=function(){var t,a;for(Yr&&(t=Ho.domain)&&t.exit();Mo;){a=Mo.fn,Mo=Mo.next;try{a()}catch(t){throw Mo?wo():ko=void 0,t}}ko=void 0,t&&t.enter()},go||Yr||Vo||!Uo||!Bo?!Do&&Go&&Go.resolve?((Ao=Go.resolve(void 0)).constructor=Go,Po=functionBindContext(Ao.then,Ao),wo=function(){Po(Ro)}):Yr?wo=function(){Ho.nextTick(Ro)}:(jo=functionBindContext(jo,m),wo=function(){jo(Ro)}):(No=!0,xo=Bo.createTextNode(""),new Uo(Ro).observe(xo,{characterData:!0}),wo=function(){xo.data=No=!No}));var Wo=qo||function(t){var a={fn:t,next:void 0};ko&&(ko.next=a),Mo||(Mo=a,wo()),ko=a},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var a={item:t,next:null};this.head?this.tail.next=a:this.head=a,this.tail=a},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var zo,$o,Yo=Queue,Xo=m.Promise,Qo="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Jo=!Qo&&!Yr&&"object"==typeof window&&"object"==typeof document,Zo=Xo&&Xo.prototype,en=wellKnownSymbol("species"),tn=!1,rn=isCallable(m.PromiseRejectionEvent),nn=Ne("Promise",(function(){var t=Zr(Xo),a=t!==String(Xo);if(!a&&66===Q)return!0;if(!Zo.catch||!Zo.finally)return!0;if(!Q||Q<51||!/native code/.test(t)){var c=new Xo((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((c.constructor={})[en]=FakePromise,!(tn=c.then((function(){}))instanceof FakePromise))return!0}return!a&&(Jo||Qo)&&!rn})),an={CONSTRUCTOR:nn,REJECTION_EVENT:rn,SUBCLASSING:tn},sn=TypeError,PromiseCapability=function(t){var a,c;this.promise=new t((function(t,h){if(void 0!==a||void 0!==c)throw sn("Bad Promise constructor");a=t,c=h})),this.resolve=aCallable(a),this.reject=aCallable(c)},cn={f:function(t){return new PromiseCapability(t)}},un=Lo.set,ln="Promise",dn=an.CONSTRUCTOR,fn=an.REJECTION_EVENT,pn=Rr.getterFor(ln),hn=Rr.set,mn=Xo&&Xo.prototype,gn=Xo,vn=mn,yn=m.TypeError,_n=m.document,En=m.process,bn=cn.f,On=bn,Tn=!!(_n&&_n.createEvent&&m.dispatchEvent),Sn="unhandledrejection",isThenable=function(t){var a;return!(!H(t)||!isCallable(a=t.then))&&a},callReaction=function(t,a){var c,h,m,g=a.value,_=1==a.state,E=_?t.ok:t.fail,b=t.resolve,O=t.reject,T=t.domain;try{E?(_||(2===a.rejection&&onHandleUnhandled(a),a.rejection=1),!0===E?c=g:(T&&T.enter(),c=E(g),T&&(T.exit(),m=!0)),c===t.promise?O(yn("Promise-chain cycle")):(h=isThenable(c))?w(h,c,b,O):b(c)):O(g)}catch(t){T&&!m&&T.exit(),O(t)}},notify=function(t,a){t.notified||(t.notified=!0,Wo((function(){for(var c,h=t.reactions;c=h.get();)callReaction(c,t);t.notified=!1,a&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,a,c){var h,g;Tn?((h=_n.createEvent("Event")).promise=a,h.reason=c,h.initEvent(t,!1,!0),m.dispatchEvent(h)):h={promise:a,reason:c},!fn&&(g=m["on"+t])?g(h):t===Sn&&function(t,a){var c=m.console;c&&c.error&&(1==arguments.length?c.error(t):c.error(t,a))}("Unhandled promise rejection",c)},onUnhandled=function(t){w(un,m,(function(){var a,c=t.facade,h=t.value;if(isUnhandled(t)&&(a=perform((function(){Yr?En.emit("unhandledRejection",h,c):dispatchEvent(Sn,c,h)})),t.rejection=Yr||isUnhandled(t)?2:1,a.error))throw a.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){w(un,m,(function(){var a=t.facade;Yr?En.emit("rejectionHandled",a):dispatchEvent("rejectionhandled",a,t.value)}))},bind=function(t,a,c){return function(h){t(a,h,c)}},internalReject=function(t,a,c){t.done||(t.done=!0,c&&(t=c),t.value=a,t.state=2,notify(t,!0))},internalResolve=function(t,a,c){if(!t.done){t.done=!0,c&&(t=c);try{if(t.facade===a)throw yn("Promise can't be resolved itself");var h=isThenable(a);h?Wo((function(){var c={done:!1};try{w(h,a,bind(internalResolve,c,t),bind(internalReject,c,t))}catch(a){internalReject(c,a,t)}})):(t.value=a,t.state=1,notify(t,!1))}catch(a){internalReject({done:!1},a,t)}}};dn&&(vn=(gn=function Promise(t){anInstance(this,vn),aCallable(t),w(zo,this);var a=pn(this);try{t(bind(internalResolve,a),bind(internalReject,a))}catch(t){internalReject(a,t)}}).prototype,(zo=function Promise(t){hn(this,{type:ln,done:!1,notified:!1,parent:!1,reactions:new Yo,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(vn,"then",(function then(t,a){var c=pn(this),h=bn(speciesConstructor(this,gn));return c.parent=!0,h.ok=!isCallable(t)||t,h.fail=isCallable(a)&&a,h.domain=Yr?En.domain:void 0,0==c.state?c.reactions.add(h):Wo((function(){callReaction(h,c)})),h.promise})),$o=function(){var t=new zo,a=pn(t);this.promise=t,this.resolve=bind(internalResolve,a),this.reject=bind(internalReject,a)},cn.f=bn=function(t){return t===gn||undefined===t?new $o(t):On(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:dn},{Promise:gn}),setToStringTag(gn,ln,!1,!0),setSpecies(ln);var Cn=wellKnownSymbol("iterator"),In=!1;try{var Rn=0,Mn={next:function(){return{done:!!Rn++}},return:function(){In=!0}};Mn[Cn]=function(){return this},Array.from(Mn,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,a){if(!a&&!In)return!1;var c=!1;try{var h={};h[Cn]=function(){return{next:function(){return{done:c=!0}}}},t(h)}catch(t){}return c},kn=an.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Xo.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:kn},{all:function all(t){var a=this,c=cn.f(a),h=c.resolve,m=c.reject,g=perform((function(){var c=aCallable(a.resolve),g=[],_=0,E=1;iterate(t,(function(t){var b=_++,O=!1;E++,w(c,a,t).then((function(t){O||(O=!0,g[b]=t,--E||h(g))}),m)})),--E||h(g)}));return g.error&&m(g.value),c.promise}});var wn=an.CONSTRUCTOR;Xo&&Xo.prototype,_export({target:"Promise",proto:!0,forced:wn,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:kn},{race:function race(t){var a=this,c=cn.f(a),h=c.reject,m=perform((function(){var m=aCallable(a.resolve);iterate(t,(function(t){w(m,a,t).then(c.resolve,h)}))}));return m.error&&h(m.value),c.promise}}),_export({target:"Promise",stat:!0,forced:an.CONSTRUCTOR},{reject:function reject(t){var a=cn.f(this);return w(a.reject,void 0,t),a.promise}});var promiseResolve=function(t,a){if(anObject(t),H(a)&&a.constructor===t)return a;var c=cn.f(t);return(0,c.resolve)(a),c.promise},Nn=an.CONSTRUCTOR,xn=getBuiltIn("Promise"),An=!Nn;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(An&&this===xn?Xo:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var a=this,c=cn.f(a),h=c.resolve,m=c.reject,g=perform((function(){var c=aCallable(a.resolve),m=[],g=0,_=1;iterate(t,(function(t){var E=g++,b=!1;_++,w(c,a,t).then((function(t){b||(b=!0,m[E]={status:"fulfilled",value:t},--_||h(m))}),(function(t){b||(b=!0,m[E]={status:"rejected",reason:t},--_||h(m))}))})),--_||h(m)}));return g.error&&m(g.value),c.promise}});var Pn="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var a=this,c=getBuiltIn("AggregateError"),h=cn.f(a),m=h.resolve,g=h.reject,_=perform((function(){var h=aCallable(a.resolve),_=[],E=0,b=1,O=!1;iterate(t,(function(t){var T=E++,S=!1;b++,w(h,a,t).then((function(t){S||O||(O=!0,m(t))}),(function(t){S||O||(S=!0,_[T]=t,--b||g(new c(_,Pn)))}))})),--b||g(new c(_,Pn))}));return _.error&&g(_.value),h.promise}});var Ln=Xo&&Xo.prototype,Dn=!!Xo&&fails((function(){Ln.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:Dn},{finally:function(t){var a=speciesConstructor(this,getBuiltIn("Promise")),c=isCallable(t);return this.then(c?function(c){return promiseResolve(a,t()).then((function(){return c}))}:t,c?function(c){return promiseResolve(a,t()).then((function(){throw c}))}:t)}});var Vn=R("".charAt),Fn=R("".charCodeAt),jn=R("".slice),createMethod$3=function(t){return function(a,c){var h,m,g=toString$1(requireObjectCoercible(a)),_=toIntegerOrInfinity(c),E=g.length;return _<0||_>=E?t?"":void 0:(h=Fn(g,_))<55296||h>56319||_+1===E||(m=Fn(g,_+1))<56320||m>57343?t?Vn(g,_):h:t?jn(g,_,_+2):m-56320+(h-55296<<10)+65536}},Un={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)}.charAt,Bn="String Iterator",Hn=Rr.set,Gn=Rr.getterFor(Bn);iteratorDefine(String,"String",(function(t){Hn(this,{type:Bn,string:toString$1(t),index:0})}),(function next(){var t,a=Gn(this),c=a.string,h=a.index;return h>=c.length?{value:void 0,done:!0}:(t=Un(c,h),a.index+=t.length,{value:t,done:!1})}));var Kn=G.Promise,qn=wellKnownSymbol("toStringTag");for(var Wn in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var zn=m[Wn],$n=zn&&zn.prototype;$n&&Zt($n)!==qn&&Ge($n,qn,Wn),qt[Wn]=qt.Array}var Yn=Kn;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var a=cn.f(this),c=perform(t);return(c.error?a.reject:a.resolve)(c.value),a.promise}});var Xn=Yn,Qn=Date,Jn=R(Qn.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Jn(new Qn)}});var Zn=G.Date.now,ei=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},ti=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw ti("Maximum allowed index exceeded");return t},createProperty=function(t,a,c){var h=toPropertyKey(a);h in t?He.f(t,h,createPropertyDescriptor(0,c)):t[h]=c},ri=wellKnownSymbol("species"),oi=Array,arraySpeciesCreate=function(t,a){return new(function(t){var a;return ei(t)&&(a=t.constructor,(fo(a)&&(a===oi||ei(a.prototype))||H(a)&&null===(a=a[ri]))&&(a=void 0)),void 0===a?oi:a}(t))(0===a?0:a)},ni=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Q>=51||!fails((function(){var a=[];return(a.constructor={})[ni]=function(){return{foo:1}},1!==a[t](Boolean).foo}))},ii=wellKnownSymbol("isConcatSpreadable"),ai=Q>=51||!fails((function(){var t=[];return t[ii]=!1,t.concat()[0]!==t})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!H(t))return!1;var a=t[ii];return void 0!==a?!!a:ei(t)};_export({target:"Array",proto:!0,arity:1,forced:!ai||!si},{concat:function concat(t){var a,c,h,m,g,_=toObject(this),E=arraySpeciesCreate(_,0),b=0;for(a=-1,h=arguments.length;a<h;a++)if(isConcatSpreadable(g=-1===a?_:arguments[a]))for(m=lengthOfArrayLike(g),doesNotExceedSafeInteger(b+m),c=0;c<m;c++,b++)c in g&&createProperty(E,b,g[c]);else doesNotExceedSafeInteger(b+1),createProperty(E,b++,g);return E.length=b,E}});var ci=entryVirtual("Array").concat,ui=Array.prototype,concat=function(t){var a=t.concat;return t===ui||K(ui,t)&&a===ui.concat?ci:a},li=/MSIE .\./.test(q),di=m.Function,wrap$1=function(t){return li?function(a,c){var h=validateArgumentsLength(arguments.length,1)>2,m=isCallable(a)?a:di(a),g=h?mt(arguments,2):void 0;return t(h?function(){O(m,this,g)}:m,c)}:t},fi={setTimeout:wrap$1(m.setTimeout),setInterval:wrap$1(m.setInterval)},pi=fi.setInterval;_export({global:!0,bind:!0,forced:m.setInterval!==pi},{setInterval:pi});var hi=fi.setTimeout;_export({global:!0,bind:!0,forced:m.setTimeout!==hi},{setTimeout:hi});var mi=G.setTimeout,gi=createCommonjsModule((function(t){var a=Object.prototype.hasOwnProperty,c="~";function Events(){}function EE(t,a,c){this.fn=t,this.context=a,this.once=c||!1}function addListener(t,a,h,m,g){if("function"!=typeof h)throw new TypeError("The listener must be a function");var _=new EE(h,m||t,g),E=c?c+a:a;return t._events[E]?t._events[E].fn?t._events[E]=[t._events[E],_]:t._events[E].push(_):(t._events[E]=_,t._eventsCount++),t}function clearEvent(t,a){0==--t._eventsCount?t._events=new Events:delete t._events[a]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(c=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,h,m=[];if(0===this._eventsCount)return m;for(h in t=this._events)a.call(t,h)&&m.push(c?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(t)):m},EventEmitter.prototype.listeners=function listeners(t){var a=c?c+t:t,h=this._events[a];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,_=new Array(g);m<g;m++)_[m]=h[m].fn;return _},EventEmitter.prototype.listenerCount=function listenerCount(t){var a=c?c+t:t,h=this._events[a];return h?h.fn?1:h.length:0},EventEmitter.prototype.emit=function emit(t,a,h,m,g,_){var E=c?c+t:t;if(!this._events[E])return!1;var b,O,T=this._events[E],S=arguments.length;if(T.fn){switch(T.once&&this.removeListener(t,T.fn,void 0,!0),S){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,a),!0;case 3:return T.fn.call(T.context,a,h),!0;case 4:return T.fn.call(T.context,a,h,m),!0;case 5:return T.fn.call(T.context,a,h,m,g),!0;case 6:return T.fn.call(T.context,a,h,m,g,_),!0}for(O=1,b=new Array(S-1);O<S;O++)b[O-1]=arguments[O];T.fn.apply(T.context,b)}else{var C,I=T.length;for(O=0;O<I;O++)switch(T[O].once&&this.removeListener(t,T[O].fn,void 0,!0),S){case 1:T[O].fn.call(T[O].context);break;case 2:T[O].fn.call(T[O].context,a);break;case 3:T[O].fn.call(T[O].context,a,h);break;case 4:T[O].fn.call(T[O].context,a,h,m);break;default:if(!b)for(C=1,b=new Array(S-1);C<S;C++)b[C-1]=arguments[C];T[O].fn.apply(T[O].context,b)}}return!0},EventEmitter.prototype.on=function on(t,a,c){return addListener(this,t,a,c,!1)},EventEmitter.prototype.once=function once(t,a,c){return addListener(this,t,a,c,!0)},EventEmitter.prototype.removeListener=function removeListener(t,a,h,m){var g=c?c+t:t;if(!this._events[g])return this;if(!a)return clearEvent(this,g),this;var _=this._events[g];if(_.fn)_.fn!==a||m&&!_.once||h&&_.context!==h||clearEvent(this,g);else{for(var E=0,b=[],O=_.length;E<O;E++)(_[E].fn!==a||m&&!_[E].once||h&&_[E].context!==h)&&b.push(_[E]);b.length?this._events[g]=1===b.length?b[0]:b:clearEvent(this,g)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var a;return t?(a=c?c+t:t,this._events[a]&&clearEvent(this,a)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=c,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter}));_export({global:!0},{globalThis:m});var vi=He.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==vi,sham:!M},{defineProperty:vi});var yi=createCommonjsModule((function(t){var a=G.Object,c=t.exports=function defineProperty(t,c,h){return a.defineProperty(t,c,h)};a.defineProperty.sham&&(c.sham=!0)})),_i=yi,Ei=R([].push),createMethod$2=function(t){var a=1==t,c=2==t,h=3==t,m=4==t,g=6==t,_=7==t,E=5==t||g;return function(b,O,T,S){for(var C,I,R=toObject(b),M=j(R),k=functionBindContext(O,T),w=lengthOfArrayLike(M),N=0,x=S||arraySpeciesCreate,A=a?x(b,w):c||_?x(b,0):void 0;w>N;N++)if((E||N in M)&&(I=k(C=M[N],N,R),t))if(a)A[N]=I;else if(I)switch(t){case 3:return!0;case 5:return C;case 6:return N;case 2:Ei(A,C)}else switch(t){case 4:return!1;case 7:Ei(A,C)}return g?-1:h||m?m:A}},bi={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},arrayMethodIsStrict=function(t,a){var c=[][t];return!!c&&fails((function(){c.call(null,a||function(){return 1},1)}))},Oi=bi.forEach,Ti=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return Oi(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=Ti},{forEach:Ti});var Si=entryVirtual("Array").forEach,Ci=Array.prototype,Ii={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var a=t.forEach;return t===Ci||K(Ci,t)&&a===Ci.forEach||de(Ii,Zt(t))?Si:a},Ri=Qe.includes,Mi=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Mi},{includes:function includes(t){return Ri(this,t,arguments.length>1?arguments[1]:void 0)}});var ki=entryVirtual("Array").includes,wi=wellKnownSymbol("match"),Ni=TypeError,notARegexp=function(t){if(function(t){var a;return H(t)&&(void 0!==(a=t[wi])?!!a:"RegExp"==classofRaw(t))}(t))throw Ni("The method doesn't accept regular expressions");return t},xi=wellKnownSymbol("match"),Ai=R("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var a=/./;try{"/./"[t](a)}catch(c){try{return a[xi]=!1,"/./"[t](a)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~Ai(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Pi=entryVirtual("String").includes,Li=Array.prototype,Di=String.prototype,includes=function(t){var a=t.includes;return t===Li||K(Li,t)&&a===Li.includes?ki:"string"==typeof t||t===Di||K(Di,t)&&a===Di.includes?Pi:a},Vi=fails((function(){rt(1)}));_export({target:"Object",stat:!0,forced:Vi},{keys:function keys(t){return rt(toObject(t))}});var Fi=G.Object.keys,ji=bi.filter,Ui=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!Ui},{filter:function filter(t){return ji(this,t,arguments.length>1?arguments[1]:void 0)}});var Bi=entryVirtual("Array").filter,Hi=Array.prototype,filter=function(t){var a=t.filter;return t===Hi||K(Hi,t)&&a===Hi.filter?Bi:a},Gi=arrayMethodHasSpeciesSupport("slice"),Ki=wellKnownSymbol("species"),qi=Array,Wi=Math.max;_export({target:"Array",proto:!0,forced:!Gi},{slice:function slice(t,a){var c,h,m,g=toIndexedObject(this),_=lengthOfArrayLike(g),E=toAbsoluteIndex(t,_),b=toAbsoluteIndex(void 0===a?_:a,_);if(ei(g)&&(c=g.constructor,(fo(c)&&(c===qi||ei(c.prototype))||H(c)&&null===(c=c[Ki]))&&(c=void 0),c===qi||void 0===c))return mt(g,E,b);for(h=new(void 0===c?qi:c)(Wi(b-E,0)),m=0;E<b;E++,m++)E in g&&createProperty(h,m,g[E]);return h.length=m,h}});var zi=entryVirtual("Array").slice,$i=Array.prototype,slice=function(t){var a=t.slice;return t===$i||K($i,t)&&a===$i.slice?zi:a},Yi=createCommonjsModule((function(t,a){t.exports=function(){function _classCallCheck(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}function _createClass(t,a,c){return a&&_defineProperties(t.prototype,a),c&&_defineProperties(t,c),_i(t,"prototype",{writable:!1}),t}var t={isDataReportEnable:!0,maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0},a=function emptyFn(){},c=function(){function Reporter(a){_classCallCheck(this,Reporter),this.isUploadEnable=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.traceMsgCache={},this.highPriorityMsgList=[],this.msgList=[],this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Zn(),this.timer=null,this.endedAsyncMsgByModule={},this.setConfig(a),this.reportConfig.isDataReportEnable&&this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){var a=wt({},this.reportConfig.common,t.common);this.reportConfig=wt({},this.reportConfig,t),this.reportConfig.common=a,this.reportConfig.common.sdk_type||(this.reportConfig.common.sdk_type="im")}},{key:"reportImmediately",value:function reportImmediately(t,a){var c=this;this.reportConfig.isDataReportEnable&&this.reportConfig.request(t,wt({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},a)).catch((function(t){var a,h;null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(t,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(c.priority||(c.priority=this.getEventPriority(t,a)),this.reportConfig.isDataReportEnable&&t){var h=Zn();"HIGH"===c.priority?this.highPriorityMsgList.push({module:t,msg:a,createTime:h}):"NORMAL"===c.priority?this.msgList.push({module:t,msg:a,createTime:h}):"LOW"===c.priority&&this.lowPriorityMsgList.push({module:t,msg:a,createTime:h}),this.highPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.highPriorityMsgList.shift(),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,a){if(this.reportConfig.isDataReportEnable&&t&&!this.traceMsgCache[t]){var c=wt(wt({start_time:Zn()},a),{extension:[]});this.traceMsgCache[t]=c}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,a,c){var h,m=this;if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t]){var g=this.traceMsgCache[t].extension,_=g.length,E=(new Date).getTime();0===_?a.duration=E-this.traceMsgCache[t].start_time:g[_-1].end_time?a.duration=E-g[_-1].end_time:a.duration=E-this.traceMsgCache[t].start_time,g.push(wt({end_time:E},a));var b=g.length-1;(null==c?void 0:c.asyncParams)&&((h=this.traceMsgCache[t]).asyncPromiseArray||(h.asyncPromiseArray=[]),this.traceMsgCache[t].asyncPromiseArray.push(c.asyncParams.then((function(a){m.traceMsgCache[t]&&m.traceMsgCache[t].extension[b]&&wt(m.traceMsgCache[t].extension[b],a)}))))}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var a,c,h=this,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t])if("nos"!==t||!1===m){"boolean"==typeof m?this.traceMsgCache[t].succeed=!!m:this.traceMsgCache[t].state=m,this.traceMsgCache[t].duration=Zn()-this.traceMsgCache[t].start_time,forEach$1(a=this.traceMsgCache[t].extension).call(a,(function(t){delete t.end_time}));var g=this.traceMsgCache[t];if(this.traceMsgCache[t]=null,g.asyncPromiseArray){(c=this.endedAsyncMsgByModule)[t]||(c[t]=[]),this.endedAsyncMsgByModule[t].push(g);var _=function asyncCallback(){var a;h.endedAsyncMsgByModule[t]&&includes(a=h.endedAsyncMsgByModule[t]).call(a,g)&&(delete g.asyncPromiseArray,h.report(t,g,{priority:h.getEventPriority(t,g)}))};Xn.all(g.asyncPromiseArray).then(_).catch(_)}else this.report(t,g,{priority:this.getEventPriority(t,g)})}else this.traceMsgCache[t]=null}},{key:"getEventPriority",value:function getEventPriority(t,a){if("exceptions"===t){if(0===a.action)return"HIGH";if(2===a.action)return"HIGH";if(1===a.action&&0!==a.exception_service)return"HIGH"}else{if("msgReceive"===t)return"LOW";if("nim_api_trace"===t)return"LOW"}return"NORMAL"}},{key:"reportTraceCancel",value:function reportTraceCancel(t){this.reportConfig.isDataReportEnable&&(this.endedAsyncMsgByModule[t]=[],this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!1)}},{key:"restore",value:function restore(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!0,this.initConfigLoaded||this.initUploadConfig())}},{key:"destroy",value:function destroy(){var t,c=this;this.reportConfig.isDataReportEnable&&(forEach$1(t=Fi(this.traceMsgCache)).call(t,(function(t){c.reportTraceEnd(t,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.highPriorityMsgList=[],this.reportConfig={},this.isDestroyed=!0)}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a,c=this;if(!this.loading){this.loading=!0;var h=this.reportConfig.common||{};try{this.reportConfig.request(this.reportConfig.reportConfigUrl,{method:"GET",dataType:"json",params:{deviceId:h.dev_id,sdkVer:h.sdk_ver,platform:h.platform,appkey:h.app_key},timeout:this.reportConfig.timeout}).then((function(t){var a,h;if(!c.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){var m=t.data.data||{};c.reportConfig.maxSize=m.maxSize>1e3?1e3:m.maxSize,c.reportConfig.maxInterval=m.maxInterval>1e4?1e4:m.maxInterval,c.reportConfig.maxInterval=m.maxInterval<10?10:m.maxInterval,c.reportConfig.minInterval=m.minInterval<2?2:m.minInterval,c.reportConfig.maxDelay=m.maxDelay||300,c.reportConfig.maxInterval=1e3*c.reportConfig.maxInterval,c.reportConfig.minInterval=1e3*c.reportConfig.minInterval,c.reportConfig.maxDelay=1e3*c.reportConfig.maxDelay,c.isUploadEnable=!0,c.initConfigLoaded=!0,c.loading=!1,c.reportHeartBeat()}null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.log("Get reporter upload config success")}})).catch((function(t){var a,h;c.loading=!1,null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.error("Get reporter upload config failed",t)}))}catch(c){this.loading=!1,null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",c)}}}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=mi((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.highPriorityMsgList.length+this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Zn()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t,a,c,h,m,g,_=this,E={},b=Zn();this.highPriorityMsgList=filter(t=this.highPriorityMsgList).call(t,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.msgList=filter(a=this.msgList).call(a,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.lowPriorityMsgList=filter(c=this.lowPriorityMsgList).call(c,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.cacheMsgList=filter(h=this.cacheMsgList).call(h,(function(t){return b-t.createTime<_.reportConfig.maxDelay}));var O=slice(m=this.highPriorityMsgList).call(m,0,this.reportConfig.maxSize);if(this.highPriorityMsgList=slice(g=this.highPriorityMsgList).call(g,O.length),O.length<this.reportConfig.maxSize){var T,S,C=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(T=this.msgList).call(T,0,C)),this.msgList=slice(S=this.msgList).call(S,C)}if(O.length<this.reportConfig.maxSize){var I,R,M=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(I=this.lowPriorityMsgList).call(I,0,M)),this.lowPriorityMsgList=slice(R=this.lowPriorityMsgList).call(R,M)}if(O.length<this.reportConfig.maxSize){var k,w,N=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(k=this.cacheMsgList).call(k,0,N)),this.cacheMsgList=slice(w=this.cacheMsgList).call(w,N)}return forEach$1(O).call(O,(function(t){E[t.module]?E[t.module].push(t.msg):E[t.module]=[t.msg]})),{uploadMsgArr:O,uploadMsg:E}}},{key:"upload",value:function upload(){var t,a,c=this;if(this.isUploadEnable&&!(this.lastReportTime&&Zn()-this.lastReportTime<this.reportConfig.minInterval)){var h=this.getUploadMsg(),m=h.uploadMsgArr,g=h.uploadMsg;if(m.length){this.lastReportTime=Zn();try{this.reportConfig.request(this.reportConfig.reportUrl,{dataType:"json",method:"POST",data:{common:this.reportConfig.common,event:g},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var a,h,g,_;c.cacheMsgList=slice(a=concat(h=c.cacheMsgList).call(h,m)).call(a,0,c.reportConfig.cacheMaxSize),null===(_=null===(g=c.reportConfig)||void 0===g?void 0:g.logger)||void 0===_||_.warn("Reporter upload failed",t)}))}catch(c){null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.warn("Exec reporter request failed",c)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return c}()})),Xi=bi.map,Qi=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!Qi},{map:function map(t){return Xi(this,t,arguments.length>1?arguments[1]:void 0)}});var Ji=entryVirtual("Array").map,Zi=Array.prototype,map$6=function(t){var a=t.map;return t===Zi||K(Zi,t)&&a===Zi.map?Ji:a},ea="\t\n\v\f\r \u2028\u2029\ufeff",ta=R("".replace),ra="["+ea+"]",oa=RegExp("^"+ra+ra+"*"),na=RegExp(ra+ra+"*$"),createMethod$1=function(t){return function(a){var c=toString$1(requireObjectCoercible(a));return 1&t&&(c=ta(c,oa,"")),2&t&&(c=ta(c,na,"")),c}},ia={start:createMethod$1(1),end:createMethod$1(2),trim:createMethod$1(3)},aa=ia.trim,sa=m.parseInt,ca=m.Symbol,ua=ca&&ca.iterator,la=/^[+-]?0x/i,da=R(la.exec),fa=8!==sa(ea+"08")||22!==sa(ea+"0x16")||ua&&!fails((function(){sa(Object(ua))}))?function parseInt(t,a){var c=aa(toString$1(t));return sa(c,a>>>0||(da(la,c)?16:10))}:sa;_export({global:!0,forced:parseInt!=fa},{parseInt:fa});var pa=G.parseInt,ha=Qe.indexOf,ma=R([].indexOf),ga=!!ma&&1/ma([1],1,-0)<0,va=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:ga||!va},{indexOf:function indexOf(t){var a=arguments.length>1?arguments[1]:void 0;return ga?ma(this,t,a)||0:ha(this,t,a)}});var ya=entryVirtual("Array").indexOf,_a=Array.prototype,indexOf=function(t){var a=t.indexOf;return t===_a||K(_a,t)&&a===_a.indexOf?ya:a},Ea=Math.min,ba=[].lastIndexOf,Oa=!!ba&&1/[1].lastIndexOf(1,-0)<0,Ta=arrayMethodIsStrict("lastIndexOf"),Sa=Oa||!Ta?function lastIndexOf(t){if(Oa)return O(ba,this,arguments)||0;var a=toIndexedObject(this),c=lengthOfArrayLike(a),h=c-1;for(arguments.length>1&&(h=Ea(h,toIntegerOrInfinity(arguments[1]))),h<0&&(h=c+h);h>=0;h--)if(h in a&&a[h]===t)return h||0;return-1}:ba;_export({target:"Array",proto:!0,forced:Sa!==[].lastIndexOf},{lastIndexOf:Sa});var Ca=entryVirtual("Array").lastIndexOf,Ia=Array.prototype,lastIndexOf=function(t){var a=t.lastIndexOf;return t===Ia||K(Ia,t)&&a===Ia.lastIndexOf?Ca:a},Ra=bi.findIndex,Ma="findIndex",ka=!0;Ma in[]&&Array(1).findIndex((function(){ka=!1})),_export({target:"Array",proto:!0,forced:ka},{findIndex:function findIndex(t){return Ra(this,t,arguments.length>1?arguments[1]:void 0)}});var wa=entryVirtual("Array").findIndex,Na=Array.prototype,findIndex=function(t){var a=t.findIndex;return t===Na||K(Na,t)&&a===Na.findIndex?wa:a},xa=Array,Aa=Math.max,arraySliceSimple=function(t,a,c){for(var h=lengthOfArrayLike(t),m=toAbsoluteIndex(a,h),g=toAbsoluteIndex(void 0===c?h:c,h),_=xa(Aa(g-m,0)),E=0;m<g;m++,E++)createProperty(_,E,t[m]);return _.length=E,_},Pa=Vt.f,La="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Da={f:function getOwnPropertyNames(t){return La&&"Window"==classofRaw(t)?function(t){try{return Pa(t)}catch(t){return arraySliceSimple(La)}}(t):Pa(toIndexedObject(t))}},Va=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Fa=Object.isExtensible,ja=fails((function(){Fa(1)}))||Va?function isExtensible(t){return!!H(t)&&((!Va||"ArrayBuffer"!=classofRaw(t))&&(!Fa||Fa(t)))}:Fa,Ua=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ba=createCommonjsModule((function(t){var a=He.f,c=!1,h=uid("meta"),m=0,setMetadata=function(t){a(t,h,{value:{objectID:"O"+m++,weakData:{}}})},g=t.exports={enable:function(){g.enable=function(){},c=!0;var t=Vt.f,a=R([].splice),m={};m[h]=1,t(m).length&&(Vt.f=function(c){for(var m=t(c),g=0,_=m.length;g<_;g++)if(m[g]===h){a(m,g,1);break}return m},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Da.f}))},fastKey:function(t,a){if(!H(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!de(t,h)){if(!ja(t))return"F";if(!a)return"E";setMetadata(t)}return t[h].objectID},getWeakData:function(t,a){if(!de(t,h)){if(!ja(t))return!0;if(!a)return!1;setMetadata(t)}return t[h].weakData},onFreeze:function(t){return Ua&&c&&ja(t)&&!de(t,h)&&setMetadata(t),t}};Je[h]=!0})),Ha=He.f,Ga=bi.forEach,Ka=Rr.set,qa=Rr.getterFor,defineBuiltIns=function(t,a,c){for(var h in a)c&&c.unsafe&&t[h]?t[h]=a[h]:defineBuiltIn(t,h,a[h],c);return t},Wa=He.f,za=Ba.fastKey,$a=Rr.set,Ya=Rr.getterFor,Xa={getConstructor:function(t,a,c,h){var m=t((function(t,m){anInstance(t,g),$a(t,{type:a,index:ct(null),first:void 0,last:void 0,size:0}),M||(t.size=0),isNullOrUndefined(m)||iterate(m,t[h],{that:t,AS_ENTRIES:c})})),g=m.prototype,_=Ya(a),define=function(t,a,c){var h,m,g=_(t),E=getEntry(t,a);return E?E.value=c:(g.last=E={index:m=za(a,!0),key:a,value:c,previous:h=g.last,next:void 0,removed:!1},g.first||(g.first=E),h&&(h.next=E),M?g.size++:t.size++,"F"!==m&&(g.index[m]=E)),t},getEntry=function(t,a){var c,h=_(t),m=za(a);if("F"!==m)return h.index[m];for(c=h.first;c;c=c.next)if(c.key==a)return c};return defineBuiltIns(g,{clear:function clear(){for(var t=_(this),a=t.index,c=t.first;c;)c.removed=!0,c.previous&&(c.previous=c.previous.next=void 0),delete a[c.index],c=c.next;t.first=t.last=void 0,M?t.size=0:this.size=0},delete:function(t){var a=this,c=_(a),h=getEntry(a,t);if(h){var m=h.next,g=h.previous;delete c.index[h.index],h.removed=!0,g&&(g.next=m),m&&(m.previous=g),c.first==h&&(c.first=m),c.last==h&&(c.last=g),M?c.size--:a.size--}return!!h},forEach:function forEach(t){for(var a,c=_(this),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);a=a?a.next:c.first;)for(h(a.value,a.key,this);a&&a.removed;)a=a.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(g,c?{get:function get(t){var a=getEntry(this,t);return a&&a.value},set:function set(t,a){return define(this,0===t?0:t,a)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),M&&Wa(g,"size",{get:function(){return _(this).size}}),m},setStrong:function(t,a,c){var h=a+" Iterator",m=Ya(a),g=Ya(h);iteratorDefine(t,a,(function(t,a){$a(this,{type:h,target:t,state:m(t),kind:a,last:void 0})}),(function(){for(var t=g(this),a=t.kind,c=t.last;c&&c.removed;)c=c.previous;return t.target&&(t.last=c=c?c.next:t.state.first)?"keys"==a?{value:c.key,done:!1}:"values"==a?{value:c.value,done:!1}:{value:[c.key,c.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),c?"entries":"values",!c,!0),setSpecies(a)}};!function(t,a,c){var h,g=-1!==t.indexOf("Map"),_=-1!==t.indexOf("Weak"),E=g?"set":"add",b=m[t],O=b&&b.prototype,T={};if(M&&isCallable(b)&&(_||O.forEach&&!fails((function(){(new b).entries().next()})))){var S=(h=a((function(a,c){Ka(anInstance(a,S),{type:t,collection:new b}),null!=c&&iterate(c,a[E],{that:a,AS_ENTRIES:g})}))).prototype,C=qa(t);Ga(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var a="add"==t||"set"==t;!(t in O)||_&&"clear"==t||Ge(S,t,(function(c,h){var m=C(this).collection;if(!a&&_&&!H(c))return"get"==t&&void 0;var g=m[t](0===c?0:c,h);return a?this:g}))})),_||Ha(S,"size",{configurable:!0,get:function(){return C(this).collection.size}})}else h=c.getConstructor(a,t,g,E),Ba.enable();setToStringTag(h,t,!1,!0),T[t]=h,_export({global:!0,forced:!0},T),_||c.setStrong(h,t,g)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),Xa);var Qa=G.Map,Ja=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var a,c,h,m,g=arguments.length,_=g>1?arguments[1]:void 0;return aConstructor(this),(a=void 0!==_)&&aCallable(_),isNullOrUndefined(t)?new this:(c=[],a?(h=0,m=functionBindContext(_,g>2?arguments[2]:void 0),iterate(t,(function(t){w(Ja,c,m(t,h++))}))):iterate(t,Ja,{that:c}),new this(c))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(mt(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,a=anObject(this),c=aCallable(a.delete),h=!0,m=0,g=arguments.length;m<g;m++)t=w(c,a,arguments[m]),h=h&&t;return!!h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,a){var c,h,m=anObject(this),g=aCallable(m.get),_=aCallable(m.has),E=aCallable(m.set);return w(_,m,t)?(c=w(g,m,t),"update"in a&&(c=a.update(c,t,m),w(E,m,t,c)),c):(h=a.insert(t,m),w(E,m,t,h),h)}});var Za=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(c,(function(t,c,m){if(!h(c,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){h(c,t,a)&&w(g,m,t,c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m(c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var es=R([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,a){aCallable(a);var c=getIterator(t),h=new this,m=aCallable(h.has),g=aCallable(h.get),_=aCallable(h.set);return iterate(c,(function(t){var c=a(t);w(m,h,c)?es(w(g,h,c),t):w(_,h,c,[t])}),{IS_ITERATOR:!0}),h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Za(anObject(this)),(function(a,c,h){if((m=c)===(g=t)||m!=m&&g!=g)return h();var m,g}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,a){var c=new this;aCallable(a);var h=aCallable(c.set);return iterate(t,(function(t){w(h,c,a(t),t)})),c}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Za(anObject(this)),(function(a,c,h){if(c===t)return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){w(g,m,h(c,t,a),c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){w(g,m,t,h(c,t,a))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var a=anObject(this),c=aCallable(a.set),h=arguments.length,m=0;m<h;)iterate(arguments[m++],c,{that:a,AS_ENTRIES:!0});return a}});var ts=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var a=anObject(this),c=Za(a),h=arguments.length<2,m=h?void 0:arguments[1];if(aCallable(t),iterate(c,(function(c,g){h?(h=!1,m=g):m=t(m,g,c,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h)throw ts("Reduce of empty map with no initial value");return m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var rs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,a){var c=anObject(this),h=aCallable(c.get),m=aCallable(c.has),g=aCallable(c.set),_=arguments.length;aCallable(a);var E=w(m,c,t);if(!E&&_<3)throw rs("Updating absent value");var b=E?w(h,c,t):aCallable(_>2?arguments[2]:void 0)(t,c);return w(g,c,t,a(b,t,c)),c}});var os=TypeError,ns=function upsert(t,a){var c,h=anObject(this),m=aCallable(h.get),g=aCallable(h.has),_=aCallable(h.set),E=arguments.length>2?arguments[2]:void 0;if(!isCallable(a)&&!isCallable(E))throw os("At least one callback required");return w(g,h,t)?(c=w(m,h,t),isCallable(a)&&(c=a(c),w(_,h,t,c))):isCallable(E)&&(c=E(),w(_,h,t,c)),c};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:ns}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:ns});var is=Qa,as=fails((function(){Lt(1)}));_export({target:"Object",stat:!0,forced:as,sham:!Nt},{getPrototypeOf:function getPrototypeOf(t){return Lt(toObject(t))}});var ss=G.Object.getPrototypeOf,cs=createCommonjsModule((function(t){function _getPrototypeOf(a){var c;return t.exports=_getPrototypeOf=ht?bind$1(c=ss).call(c):function _getPrototypeOf(t){return t.__proto__||ss(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(a)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),us=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var a;return-1!==indexOf(a=Function.toString.call(t)).call(a,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),ls=getBuiltIn("Reflect","construct"),ds=Object.prototype,fs=[].push,ps=fails((function(){function F(){}return!(ls((function(){}),[],F)instanceof F)})),hs=!fails((function(){ls((function(){}))})),ms=ps||hs;_export({target:"Reflect",stat:!0,forced:ms,sham:ms},{construct:function construct(t,a){aConstructor(t),anObject(a);var c=arguments.length<3?t:aConstructor(arguments[2]);if(hs&&!ps)return ls(t,a,c);if(t==c){switch(a.length){case 0:return new t;case 1:return new t(a[0]);case 2:return new t(a[0],a[1]);case 3:return new t(a[0],a[1],a[2]);case 4:return new t(a[0],a[1],a[2],a[3])}var h=[null];return O(fs,h,a),new(O(Et,t,h))}var m=c.prototype,g=ct(H(m)?m:ds),_=O(t,g,a);return H(_)?_:g}});var gs=G.Reflect.construct,vs=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!gs)return!1;if(gs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gs(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),ys=createCommonjsModule((function(t){function _construct(a,c,h){var m;vs()?(t.exports=_construct=bind$1(m=gs).call(m),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,a,c){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return c&&Tt(m,c.prototype),m},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),_s=createCommonjsModule((function(t){function _wrapNativeSuper(a){var c="function"==typeof is?new is:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!us(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==c){if(c.has(t))return c.get(t);c.set(t,Wrapper)}function Wrapper(){return ys(t,arguments,cs(this).constructor)}return Wrapper.prototype=lt(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),Tt(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(a)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),Es=getDefaultExportFromCjs(_s),bs=TypeError,createMethod=function(t){return function(a,c,h,m){aCallable(c);var g=toObject(a),_=j(g),E=lengthOfArrayLike(g),b=t?E-1:0,O=t?-1:1;if(h<2)for(;;){if(b in _){m=_[b],b+=O;break}if(b+=O,t?b<0:E<=b)throw bs("Reduce of empty array with no initial value")}for(;t?b>=0:E>b;b+=O)b in _&&(m=c(m,_[b],b,g));return m}},Os={left:createMethod(!1),right:createMethod(!0)}.left,Ts=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Ts||!Yr&&Q>79&&Q<83},{reduce:function reduce(t){var a=arguments.length;return Os(this,t,a,a>1?arguments[1]:void 0)}});var Ss=entryVirtual("Array").reduce,Cs=Array.prototype,reduce=function(t){var a=t.reduce;return t===Cs||K(Cs,t)&&a===Cs.reduce?Ss:a},Is=getBuiltIn("JSON","stringify"),Rs=R(/./.exec),Ms=R("".charAt),ks=R("".charCodeAt),ws=R("".replace),Ns=R(1..toString),xs=/[\uD800-\uDFFF]/g,As=/^[\uD800-\uDBFF]$/,Ps=/^[\uDC00-\uDFFF]$/,Ls=!J||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=Is([t])||"{}"!=Is({a:t})||"{}"!=Is(Object(t))})),Ds=fails((function(){return'"\\udf06\\ud834"'!==Is("\udf06\ud834")||'"\\udead"'!==Is("\udead")})),stringifyWithSymbolsFix=function(t,a){var c=mt(arguments),h=a;if((H(a)||void 0!==t)&&!te(t))return ei(a)||(a=function(t,a){if(isCallable(h)&&(a=w(h,this,t,a)),!te(a))return a}),c[1]=a,O(Is,null,c)},fixIllFormed=function(t,a,c){var h=Ms(c,a-1),m=Ms(c,a+1);return Rs(As,t)&&!Rs(Ps,m)||Rs(Ps,t)&&!Rs(As,h)?"\\u"+Ns(ks(t,0),16):t};Is&&_export({target:"JSON",stat:!0,arity:3,forced:Ls||Ds},{stringify:function stringify(t,a,c){var h=mt(arguments),m=O(Ls?stringifyWithSymbolsFix:Is,null,h);return Ds&&"string"==typeof m?ws(m,xs,fixIllFormed):m}}),G.JSON||(G.JSON={stringify:JSON.stringify});var Vs=function stringify(t,a,c){return O(G.JSON.stringify,null,arguments)},Fs=Vs,js={V2NIM_ERROR_CODE_UNKNOWN:{code:0,message:"unknown error"},V2NIM_ERROR_CODE_SUCCESS:{code:200,message:"success"},V2NIM_ERROR_CODE_HANDSHAKE:{code:201,message:"handshake error"},V2NIM_ERROR_CODE_REQUEST_TEMPERARY_FORBIDDEN:{code:398,message:"request temprary forbidden"},V2NIM_ERROR_CODE_SERVER_UNIT_ERROR:{code:399,message:"server unit error"},V2NIM_ERROR_CODE_FORBIDDEN:{code:403,message:"forbidden"},V2NIM_ERROR_CODE_NOT_FOUND:{code:404,message:"not found"},V2NIM_ERROR_CODE_PARAMETER_ERROR:{code:414,message:"parameter error"},V2NIM_ERROR_CODE_RATE_LIMIT_REACHED:{code:416,message:"rate limit reached"},V2NIM_ERROR_CODE_MULTI_LOGIN_FORBIDDEN:{code:417,message:"multi login forbidden"},V2NIM_ERROR_CODE_SERVER_INTERNAL_ERROR:{code:500,message:"server internal error"},V2NIM_ERROR_CODE_SERVER_BUSY:{code:503,message:"server busy"},V2NIM_ERROR_CODE_APP_UNREACHABLE:{code:511,message:"app server unreachable"},V2NIM_ERROR_CODE_SERVICE_UNAVAILABLE:{code:514,message:"service unavailable"},V2NIM_ERROR_CODE_PROTOCOL_BLACKHOLE_FILTERED:{code:599,message:"protocol filtered by blackhole rule"},V2NIM_ERROR_CODE_NO_PERMISSION:{code:997,message:"appid has no permission to call the protocol"},V2NIM_ERROR_CODE_UNPACK_ERROR:{code:998,message:"unpack error"},V2NIM_ERROR_CODE_PACK_ERROR:{code:999,message:"pack error"},V2NIM_ERROR_CODE_IM_DISABLED:{code:101301,message:"IM disabled"},V2NIM_ERROR_CODE_SERVICE_ADDRESS_INVALID:{code:101302,message:"service address invalid"},V2NIM_ERROR_CODE_APPKEY_NOT_EXIST:{code:101303,message:"appkey not exist"},V2NIM_ERROR_CODE_BUNDLEID_CHECK_FAILED:{code:101304,message:"bundleid check failed"},V2NIM_ERROR_CODE_APPKEY_BLOCKED:{code:101403,message:"appkey blocked"},V2NIM_ERROR_CODE_INVALID_TOKEN:{code:102302,message:"invalid token"},V2NIM_ERROR_CODE_ROBOT_NOT_ALLOWED:{code:102303,message:"robot not allowed"},V2NIM_ERROR_CODE_ACCOUNT_NOT_EXIST:{code:102404,message:"account not exist"},V2NIM_ERROR_CODE_ACCOUNT_CHAT_BANNED:{code:102421,message:"account chat banned"},V2NIM_ERROR_CODE_ACCOUNT_BANNED:{code:102422,message:"account banned"},V2NIM_ERROR_CODE_ACCOUNT_IN_BLOCK_LIST:{code:102426,message:"account in block list"},V2NIM_ERROR_CODE_USER_PROFILE_NOT_EXIST:{code:103404,message:"user profile not exist"},V2NIM_ERROR_CODE_USER_PROFILE_HIT_ANTISPAM:{code:103451,message:"user profile hit antispam"},V2NIM_ERROR_CODE_PEER_FRIEND_LIMIT:{code:104301,message:"peer friend limit"},V2NIM_ERROR_CODE_FRIEND_APPLICATION_NOT_EXIST:{code:104302,message:"friend application not exist"},V2NIM_ERROR_CODE_FRIEND_NOT_EXIST:{code:104404,message:"friend not exist"},V2NIM_ERROR_CODE_FRIEND_ALREADY_EXIST:{code:104405,message:"friend already exist"},V2NIM_ERROR_CODE_SELF_FRIEND_OPERATION_NOT_ALLOWED:{code:104429,message:"self friend operation not allowed"},V2NIM_ERROR_CODE_FRIEND_LIMIT:{code:104435,message:"friend limit"},V2NIM_ERROR_CODE_FRIEND_OPERATION_RATE_LIMIT:{code:104449,message:"friend operation rate limit"},V2NIM_ERROR_CODE_FRIEND_HIT_ANTISPAM:{code:104451,message:"friend hit antispam"},V2NIM_ERROR_CODE_SELF_MUTE_OPERATION_NOT_ALLOWED:{code:105429,message:"self mute operation not allowed"},V2NIM_ERROR_CODE_MUTE_LIST_LIMIT:{code:105435,message:"mute list limit"},V2NIM_ERROR_CODE_SELF_BLOCK_LIST_OPERATION_NOT_ALLOWED:{code:106429,message:"self block list operation not allowed"},V2NIM_ERROR_CODE_BLOCK_LIST_LIMIT:{code:106435,message:"block list limit"},V2NIM_ERROR_CODE_REVOKE_THIRD_PARTY_MESSAGE_NOT_ALLOWED:{code:107301,message:"revoke third party message not allowed"},V2NIM_ERROR_CODE_SHORT_TO_LONG_URL_FAILED:{code:107307,message:"short to long URL failed"},V2NIM_ERROR_CODE_URL_INVALID:{code:107308,message:"URL invalid"},V2NIM_ERROR_CODE_DURATION_OUT_OF_RANGE:{code:107309,message:"duration out of range"},V2NIM_ERROR_CODE_GET_FILE_META_INFO_FAILED:{code:107310,message:"get file meta info failed"},V2NIM_ERROR_CODE_AUDIO_FILE_SIZE_LIMIT:{code:107311,message:"audio file size limit"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_TIMEOUT:{code:107312,message:"voice to text timeout"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_FAILED:{code:107313,message:"voice to text failed"},V2NIM_ERROR_CODE_REVOKE_EXCEED_TIME_LIMIT:{code:107314,message:"revoke message exceed time limit"},V2NIM_ERROR_CODE_REVOKE_MESSAGE_NOT_ALLOWED:{code:107315,message:"revoke specific message not allowed"},V2NIM_ERROR_CODE_FORCE_PUSH_LIST_LIMIT:{code:107316,message:"force push list limit"},V2NIM_ERROR_CODE_TEAM_MESSAGE_RECEIPT_RATE_LIMIT:{code:107317,message:"team message receipt rate limit"},V2NIM_ERROR_CODE_SNAPSHOT_NOT_EXIST:{code:107318,message:"snapshot not exist"},V2NIM_ERROR_CODE_PIN_LIMIT:{code:107319,message:"pin limit"},V2NIM_ERROR_CODE_PIN_NOT_EXIST:{code:107320,message:"pin not exist"},V2NIM_ERROR_CODE_QUICK_COMMENT_LIMIT:{code:107321,message:"quick comment limit"},V2NIM_ERROR_CODE_PIN_ALREADY_EXIST:{code:107322,message:"pin already exist"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_FUNCTION_DISABLED:{code:107333,message:"voice to text function disabled"},V2NIM_ERROR_CODE_CLOUD_SEARCH_FUNCTION_DISABLED:{code:107334,message:"cloud search function disabled"},V2NIM_ERROR_CODE_ONE_WAY_DELETE_FUNCTION_DISABLED:{code:107335,message:"one-way delete function disabled"},V2NIM_ERROR_CODE_REVOKE_MESSAGE_TO_SELF_NOT_ALLOWED:{code:107429,message:"revoke message to self not allowed"},V2NIM_ERROR_CODE_APP_CHAT_BANNED:{code:107410,message:"app chat banned"},V2NIM_ERROR_CODE_QUICK_COMMENT_FUNCTION_DISABLED:{code:107326,message:"quick comment function disabled"},V2NIM_ERROR_CODE_PIN_FUNCTION_DISABLED:{code:107327,message:"PIN function disabled"},V2NIM_ERROR_CODE_TEAM_READ_RECEIPT_FUNCTION_DISABLED:{code:107324,message:"read receipt for team messages function disabled"},V2NIM_ERROR_CODE_P2P_READ_RECEIPT_FUNCTION_DISABLED:{code:107325,message:"read receipt for p2p messages function disabled"},V2NIM_ERROR_CODE_RATE_LIMIT_FOR_MESSAGING_REACHED:{code:107323,message:"rate limit for messaging reached"},V2NIM_ERROR_CODE_MESSAGE_HIT_ANTISPAM:{code:107451,message:"message hit antispam"},V2NIM_ERROR_CODE_MESSAGE_NOT_EXIST:{code:107404,message:"message not exist"},V2NIM_ERROR_CODE_UNSENDING_MESSAGE_EXPIRED:{code:107406,message:"unsending message expired"},V2NIM_ERROR_CODE_TEAM_MARK_READ_FAILED:{code:107302,message:"sending message failed for marking message read failed for too many team members"},V2NIM_ERROR_CODE_SENDER_OR_MANAGER_PERMISSION_ONLY_REVOKE:{code:107303,message:"only sender or manager can revoke message"},V2NIM_ERROR_CODE_DELETE_SELF_MESSAGE_NOT_ALLOWED:{code:107328,message:"delete self message not allowed"},V2NIM_ERROR_CODE_NOT_CHATBOT_ACCOUNT:{code:107329,message:"is not chatbot account"},V2NIM_ERROR_CODE_MESSAGE_SENSE_REQUIRED:{code:107330,message:"sender or receiver must sense message"},V2NIM_ERROR_CODE_HIGH_PRIORITY_MESSAGE_RATE_LIMIT:{code:107304,message:"rate limit of high-priority messages exceeded"},ACK_MESSAGE_BE_HIGH_PRIORITY:{code:107305,message:"ack message should be high-priority"},V2NIM_ERROR_CODE_DUPLICATE_CLIENT_MESSAGE_ID:{code:107306,message:"duplicate client message ID"},V2NIM_ERROR_CODE_INVALID_TIME_RANGE:{code:107439,message:"invalid time range"},V2NIM_ERROR_CODE_MESSAGE_HIT_CLIENT_ANTISPAM:{code:107452,message:"message hit client antispam"},V2NIM_ERROR_CODE_NOT_ADVANCED_TEAM:{code:108302,message:"not advanced team"},V2NIM_ERROR_CODE_TEAM_MANAGER_LIMIT:{code:108303,message:"team manager limit"},V2NIM_ERROR_CODE_JOINED_TEAM_LIMIT:{code:108305,message:"joined team limit"},V2NIM_ERROR_CODE_TEAM_NORMAL_MEMBER_CHAT_BANNED:{code:108306,message:"team normal member chat banned"},V2NIM_ERROR_CODE_INVITED_ACCOUNT_NOT_FRIEND:{code:108307,message:"invited account not friend"},V2NIM_ERROR_CODE_REJECT_ALL_TEAM_APPLICATIONS:{code:108308,message:"reject all team applications"},V2NIM_ERROR_CODE_TEAM_NOT_EXIST:{code:108404,message:"team not exist"},V2NIM_ERROR_CODE_TEAM_ALREADY_CHAT_BANNED:{code:108420,message:"team already chat banned"},V2NIM_ERROR_CODE_ALL_TEAM_MEMBER_CHAT_BANNED:{code:108423,message:"all team member chat banned"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_LIMIT:{code:108434,message:"extended super team limit"},V2NIM_ERROR_CODE_CREATED_TEAM_LIMIT:{code:108435,message:"created team limit"},V2NIM_ERROR_CODE_TEAM_INVITATION_LIMIT:{code:108437,message:"team invitation limit"},V2NIM_ERROR_CODE_TEAM_HIT_ANTISPAM:{code:108451,message:"team hit antispam"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_LIMIT_NOT_CONFIGURED:{code:108304,message:"extended super team limit not configured"},V2NIM_ERROR_CODE_SUPER_TEAM_SERVICE_DISABLED:{code:108311,message:"super team service disabled"},V2NIM_ERROR_CODE_TEAM_READ_RECEIPT_RECORD_NOT_FOUND:{code:108301,message:"read receipt record for the team message not found"},V2NIM_ERROR_CODE_NOT_MANAGER:{code:108430,message:"unable to assign owner manager"},V2NIM_ERROR_CODE_ONLINE_MEMBER_COUNT_DISABLED:{code:108406,message:"number of online users service disabled"},V2NIM_ERROR_CODE_TRANSFER_DISABLED:{code:108310,message:"unable to transfer the ownership to owner"},V2NIM_ERROR_CODE_CREATE_TEAM_DISABLED:{code:108309,message:"unable to create team with more than %s people"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_CREATE_FAILED:{code:108313,message:"/ extended super team creation failed,use open api to create the team"},V2NIM_ERROR_CODE_TEAM_MESSAGE_READ_RECEIPT_DISABLED:{code:108312,message:"read receipt for team messages function disabled"},V2NIM_ERROR_CODE_RETRY:{code:108449,message:"an error occurred, try again"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_NOT_TEAM_MEMBER:{code:109301,message:"list of chat banned users contains non team members"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_OPERATOR:{code:109303,message:"list of chat banned users contains the operator"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_TEAM_OWNER:{code:109304,message:"list of chat banned users contains the team owner"},V2NIM_ERROR_CODE_OPERATION_ON_TEAM_MANAGER_NOT_ALLOWED:{code:109305,message:"operation on team manager not allowed"},V2NIM_ERROR_CODE_NO_TEAM_INVITE_PERMISSION:{code:109306,message:"no team invite permission"},V2NIM_ERROR_CODE_TEAM_OWNER_QUIT_NOT_ALLOWED:{code:109307,message:"team owner quit not allowed"},V2NIM_ERROR_CODE_TEAM_OWNER_IN_KICK_LIST:{code:109308,message:"list of kicked user contains the team owner"},V2NIM_ERROR_CODE_INVITE_ROBOT_ACCOUNT_NOT_ALLOWED:{code:109309,message:"invite robot account not allowed"},V2NIM_ERROR_CODE_KICK_OPERATOR_NOT_ALLOWED:{code:109310,message:"kick operator not allowed"},V2NIM_ERROR_CODE_TEAM_MEMBER_ALREADY_EXIST:{code:109311,message:"team member already exist"},V2NIM_ERROR_CODE_TEAM_INVITATION_OR_APPLICATION_NOT_EXIST:{code:109313,message:"team invitation or application not exist"},V2NIM_ERROR_CODE_OPERATION_ON_TEAM_OWNER_NOT_ALLOWED:{code:109314,message:"operation on team owner not allowed"},V2NIM_ERROR_CODE_TEAM_MEMBER_NOT_EXIST:{code:109404,message:"team member not exist"},V2NIM_ERROR_CODE_TEAM_MEMBER_CHAT_BANNED:{code:109424,message:"team member chat banned"},V2NIM_ERROR_CODE_TEAM_OWNER_OPERATION_PERMISSION_REQUIRED:{code:109427,message:"team owner operation permission required"},V2NIM_ERROR_CODE_TEAM_OWNER_OR_MANAGER_OPERATION_PERMISSION_REQUIRED:{code:109432,message:"team owner or manager operation permission required"},V2NIM_ERROR_CODE_TEAM_MEMBER_CONCURRENT_OPERATION_FAILED:{code:109449,message:"team member concurrent operation failed"},V2NIM_ERROR_CODE_TEAM_MEMBER_HIT_ANTISPAM:{code:109451,message:"team member hit antispam"},V2NIM_ERROR_CODE_CONVERSATION_AND_ACCOUNT_MISMATCH:{code:110302,message:"conversation and account mismatch"},V2NIM_ERROR_CODE_CONVERSATION_STICK_TOP_LIMIT:{code:110303,message:"conversation stick top limit"},V2NIM_ERROR_CODE_CONVERSATION_BELONGED_GROUP_LIMIT:{code:110304,message:"conversation belonged group limit"},V2NIM_ERROR_CODE_CONVERSATION_NOT_EXIST:{code:110404,message:"conversation not exist"},V2NIM_ERROR_CODE_CHATROOM_LINK_UNAVAILABLE:{code:113304,message:"chatroom link unavailable"},V2NIM_ERROR_CODE_IM_CONNECTION_ABNORMAL:{code:113305,message:"IM connection abnormal"},V2NIM_ERROR_CODE_CHATROOM_NOT_EXIST:{code:113404,message:"chatroom not exist"},V2NIM_ERROR_CODE_CHATROOM_CLOSED:{code:113406,message:"chatroom closed"},V2NIM_ERROR_CODE_CHATROOM_REPEATED_OPERATION:{code:113409,message:"chatroom repeated operation"},V2NIM_ERROR_CODE_CHATROOM_DISABLED:{code:113410,message:"chatroom disabled"},V2NIM_ERROR_CODE_ALL_CHATROOM_MEMBER_CHAT_BANNED:{code:113423,message:"all chatroom member chat banned"},V2NIM_ERROR_CODE_CHATROOM_HIT_ANTISPAM:{code:113451,message:"chatroom hit antispam"},V2NIM_ERROR_CODE_ANONYMOUS_MEMBER_FORBIDDEN:{code:114303,message:"anonymous member forbidden"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_NOT_EXIST:{code:114404,message:"chatroom member not exist"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_REPEATED_OPERATION:{code:114405,message:"chatroom member repeated operation"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_CHAT_BANNED:{code:114421,message:"chatroom member chat banned"},V2NIM_ERROR_CODE_ACCOUNT_IN_CHATROOM_BLOCK_LIST:{code:114426,message:"account in chatroom block list"},V2NIM_ERROR_CODE_CHATROOM_OWNER_OPERATION_PERMISSION_REQUIRED:{code:114427,message:"chatroom owner operation permission required"},V2NIM_ERROR_CODE_SELF_IN_CHATROOM_MEMBER_OPERATION_LIST:{code:114429,message:"self in chatroom member operation list"},V2NIM_ERROR_CODE_CHATROOM_OWNER_OR_MANAGER_OPERATION_PERMISSION_REQUIRED:{code:114432,message:"chatroom owner or manager operation permission required"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_LIMIT:{code:114437,message:"chatroom member limit"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_CONCURRENT_OPERATION_FAILED:{code:114449,message:"chatroom member concurrent operation failed"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_HIT_ANTISPAM:{code:114451,message:"chatroom member hit antispam"},V2NIM_ERROR_CODE_CONVERSATION_GROUP_NOT_EXIST:{code:116404,message:"conversation group not exist"},V2NIM_ERROR_CODE_CONVERSATION_GROUP_LIMIT:{code:116435,message:"conversation group limit"},V2NIM_ERROR_CODE_CONVERSATIONS_IN_GROUP_LIMIT:{code:116437,message:"conversations in group limit"},V2NIM_ERROR_CODE_COLLECTION_LIMIT:{code:189301,message:"collection limit"},V2NIM_ERROR_CODE_COLLECTION_NOT_EXIST:{code:189302,message:"collection not exist"},V2NIM_ERROR_CODE_COLLECTION_CONCURRENT_OPERATION_FAILED:{code:189449,message:"collection concurrent operation failed"},V2NIM_ERROR_CODE_INTERNAL:{code:190001,message:"internal error"},V2NIM_ERROR_CODE_ILLEGAL_STATE:{code:190002,message:"illegal state"},V2NIM_ERROR_CODE_MISUSE:{code:191001,message:"misuse"},V2NIM_ERROR_CODE_CANCELLED:{code:191002,message:"operation cancelled"},V2NIM_ERROR_CODE_CALLBACK_FAILED:{code:191003,message:"callback failed"},V2NIM_ERROR_CODE_INVALID_PARAMETER:{code:191004,message:"invalid parameter"},V2NIM_ERROR_CODE_TIMEOUT:{code:191005,message:"timeout"},V2NIM_ERROR_CODE_RESOURCE_NOT_EXIST:{code:191006,message:"resource not exist"},V2NIM_ERROR_CODE_RESOURCE_ALREADY_EXIST:{code:191007,message:"resource already exist"},V2NIM_ERROR_CODE_CONNECT_FAILED:{code:192001,message:"connect failed"},V2NIM_ERROR_CODE_CONNECT_TIMEOUT:{code:192002,message:"connect timeout"},V2NIM_ERROR_CODE_DISCONNECT:{code:192003,message:"disconnect"},V2NIM_ERROR_CODE_PROTOCOL_TIMEOUT:{code:192004,message:"protocol timeout"},V2NIM_ERROR_CODE_PROTOCOL_SEND_FAILED:{code:192005,message:"protocol send failed"},V2NIM_ERROR_CODE_REQUEST_FAILED:{code:192006,message:"request failed"},V2NIM_ERROR_CODE_FILE_NOT_FOUND:{code:194001,message:"file not found"},V2NIM_ERROR_CODE_FILE_CREATE_FAILED:{code:194002,message:"file create failed"},V2NIM_ERROR_CODE_FILE_OPEN_FAILED:{code:194003,message:"file open failed"},V2NIM_ERROR_CODE_FILE_WRITE_FAILED:{code:194004,message:"file write failed"},V2NIM_ERROR_CODE_FILE_READ_FAILED:{code:194005,message:"file read failed"},V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:{code:194006,message:"file upload failed"},V2NIM_ERROR_CODE_FILE_DOWNLOAD_FAILED:{code:194007,message:"file download failed"},V2NIM_ERROR_CODE_CLIENT_ANTISPAM:{code:195001,message:"client anti-spam"},V2NIM_ERROR_CODE_SERVER_ANTISPAM:{code:195002,message:"server anti-spam"}},Us=Fi(js),Bs=reduce(Us).call(Us,(function(t,a){var c=js[a];return t[a]=c.code,t}),{}),Hs=reduce(Us).call(Us,(function(t,a){var c=js[a];return t[c.code]=c.message,t}),{}),Gs=function(t){function V2NIMErrorImpl(a){var c;return(c=t.call(this,a.desc)||this).name="V2NIMError",c.code=a.code||0,c.desc=a.desc||Hs[c.code]||zs[c.code]||"",c.message=c.desc,c.detail=a.detail||{},c}return St(V2NIMErrorImpl,t),V2NIMErrorImpl.prototype.toString=function toString(){var t,a=this.name+"\n code: "+this.code+'\n message: "'+this.message+'"\n detail: '+(this.detail?Fs(this.detail):"");return(null===(t=null==this?void 0:this.detail)||void 0===t?void 0:t.rawError)&&(a+="\n rawError: "+this.detail.rawError.message),a},V2NIMErrorImpl}(Es(Error));var Ks=function(t){function ValidateError(a,c,h){var m;return void 0===c&&(c={}),(m=t.call(this,{code:Bs.V2NIM_ERROR_CODE_PARAMETER_ERROR,detail:{reason:a,rules:h,data:c}})||this).name="validateError",m.message=m.message+"\n"+Fs(m.detail,null,2),m.data=c,m.rules=h,m}return St(ValidateError,t),ValidateError}(Gs),qs=function(t){function ValidateErrorV2(a){var c,h,m,g;return(c=t.call(this,{code:Bs.V2NIM_ERROR_CODE_INVALID_PARAMETER,detail:{reason:null===(h=a.detail)||void 0===h?void 0:h.reason,rules:null===(m=a.detail)||void 0===m?void 0:m.rules,data:null===(g=a.detail)||void 0===g?void 0:g.data}})||this).name="ValidateErrorV2",c}return St(ValidateErrorV2,t),ValidateErrorV2}(Gs),Ws=function(t){function UploadError(a){var c;return(c=t.call(this,wt({code:400},a))||this).desc=c.desc||"upload file error",c.message=c.desc,c.name="uploadError",c}return St(UploadError,t),UploadError}(Gs),zs={200:null,406:null,808:null,810:null,302:"The user name or password is incorrect.",405:"Parameter length too long",408:"Client request timed out",415:"Service unavailable",422:"Account disabled",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},$s="object"==typeof t&&t&&t.Object===Object&&t,Ys="object"==typeof self&&self&&self.Object===Object&&self,Xs=$s||Ys||Function("return this")(),Qs=Xs.Symbol,Js=Object.prototype,Zs=Js.hasOwnProperty,ec=Js.toString,tc=Qs?Qs.toStringTag:void 0;var rc=function getRawTag(t){var a=Zs.call(t,tc),c=t[tc];try{t[tc]=void 0;var h=!0}catch(t){}var m=ec.call(t);return h&&(a?t[tc]=c:delete t[tc]),m},oc=Object.prototype.toString;var nc=function objectToString(t){return oc.call(t)},ic=Qs?Qs.toStringTag:void 0;var ac=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ic&&ic in Object(t)?rc(t):nc(t)};var sc=function isObject(t){var a=typeof t;return null!=t&&("object"==a||"function"==a)};var cc=function isFunction(t){if(!sc(t))return!1;var a=ac(t);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},uc=Xs["__core-js_shared__"],lc=function(){var t=/[^.]+$/.exec(uc&&uc.keys&&uc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var dc=function isMasked(t){return!!lc&&lc in t},fc=Function.prototype.toString;var pc=function toSource(t){if(null!=t){try{return fc.call(t)}catch(t){}try{return t+""}catch(t){}}return""},hc=/^\[object .+?Constructor\]$/,mc=Function.prototype,gc=Object.prototype,vc=mc.toString,yc=gc.hasOwnProperty,_c=RegExp("^"+vc.call(yc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ec=function baseIsNative(t){return!(!sc(t)||dc(t))&&(cc(t)?_c:hc).test(pc(t))};var bc=function getValue(t,a){return null==t?void 0:t[a]};var Oc=function getNative(t,a){var c=bc(t,a);return Ec(c)?c:void 0},Tc=function(){try{var t=Oc(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Sc=function baseAssignValue(t,a,c){"__proto__"==a&&Tc?Tc(t,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):t[a]=c};var Cc=function eq(t,a){return t===a||t!=t&&a!=a},Ic=Object.prototype.hasOwnProperty;var Rc=function assignValue(t,a,c){var h=t[a];Ic.call(t,a)&&Cc(h,c)&&(void 0!==c||a in t)||Sc(t,a,c)};var Mc=function copyObject(t,a,c,h){var m=!c;c||(c={});for(var g=-1,_=a.length;++g<_;){var E=a[g],b=h?h(c[E],t[E],E,c,t):void 0;void 0===b&&(b=t[E]),m?Sc(c,E,b):Rc(c,E,b)}return c};var kc=function identity(t){return t};var wc=function apply(t,a,c){switch(c.length){case 0:return t.call(a);case 1:return t.call(a,c[0]);case 2:return t.call(a,c[0],c[1]);case 3:return t.call(a,c[0],c[1],c[2])}return t.apply(a,c)},Nc=Math.max;var xc=function overRest(t,a,c){return a=Nc(void 0===a?t.length-1:a,0),function(){for(var h=arguments,m=-1,g=Nc(h.length-a,0),_=Array(g);++m<g;)_[m]=h[a+m];m=-1;for(var E=Array(a+1);++m<a;)E[m]=h[m];return E[a]=c(_),wc(t,this,E)}};var Ac=function constant(t){return function(){return t}},Pc=Tc?function(t,a){return Tc(t,"toString",{configurable:!0,enumerable:!1,value:Ac(a),writable:!0})}:kc,Lc=Date.now;var Dc=function shortOut(t){var a=0,c=0;return function(){var h=Lc(),m=16-(h-c);if(c=h,m>0){if(++a>=800)return arguments[0]}else a=0;return t.apply(void 0,arguments)}},Vc=Dc(Pc);var Fc=function baseRest(t,a){return Vc(xc(t,a,kc),t+"")};var jc=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Uc=function isArrayLike(t){return null!=t&&jc(t.length)&&!cc(t)},Bc=/^(?:0|[1-9]\d*)$/;var Hc=function isIndex(t,a){var c=typeof t;return!!(a=null==a?9007199254740991:a)&&("number"==c||"symbol"!=c&&Bc.test(t))&&t>-1&&t%1==0&&t<a};var Gc=function isIterateeCall(t,a,c){if(!sc(c))return!1;var h=typeof a;return!!("number"==h?Uc(c)&&Hc(a,c.length):"string"==h&&a in c)&&Cc(c[a],t)};var Kc=function createAssigner(t){return Fc((function(a,c){var h=-1,m=c.length,g=m>1?c[m-1]:void 0,_=m>2?c[2]:void 0;for(g=t.length>3&&"function"==typeof g?(m--,g):void 0,_&&Gc(c[0],c[1],_)&&(g=m<3?void 0:g,m=1),a=Object(a);++h<m;){var E=c[h];E&&t(a,E,h,g)}return a}))};var qc=function baseTimes(t,a){for(var c=-1,h=Array(t);++c<t;)h[c]=a(c);return h};var Wc=function isObjectLike(t){return null!=t&&"object"==typeof t};var zc=function baseIsArguments(t){return Wc(t)&&"[object Arguments]"==ac(t)},$c=Object.prototype,Yc=$c.hasOwnProperty,Xc=$c.propertyIsEnumerable,Qc=zc(function(){return arguments}())?zc:function(t){return Wc(t)&&Yc.call(t,"callee")&&!Xc.call(t,"callee")},Jc=Qc,Zc=Array.isArray;var eu=function stubFalse(){return!1},tu=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c?Xs.Buffer:void 0,g=(m?m.isBuffer:void 0)||eu;t.exports=g})),ru={};ru["[object Float32Array]"]=ru["[object Float64Array]"]=ru["[object Int8Array]"]=ru["[object Int16Array]"]=ru["[object Int32Array]"]=ru["[object Uint8Array]"]=ru["[object Uint8ClampedArray]"]=ru["[object Uint16Array]"]=ru["[object Uint32Array]"]=!0,ru["[object Arguments]"]=ru["[object Array]"]=ru["[object ArrayBuffer]"]=ru["[object Boolean]"]=ru["[object DataView]"]=ru["[object Date]"]=ru["[object Error]"]=ru["[object Function]"]=ru["[object Map]"]=ru["[object Number]"]=ru["[object Object]"]=ru["[object RegExp]"]=ru["[object Set]"]=ru["[object String]"]=ru["[object WeakMap]"]=!1;var ou=function baseIsTypedArray(t){return Wc(t)&&jc(t.length)&&!!ru[ac(t)]};var nu=function baseUnary(t){return function(a){return t(a)}},iu=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c&&$s.process,g=function(){try{var t=h&&h.require&&h.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}();t.exports=g})),au=iu&&iu.isTypedArray,su=au?nu(au):ou,cu=Object.prototype.hasOwnProperty;var uu=function arrayLikeKeys(t,a){var c=Zc(t),h=!c&&Jc(t),m=!c&&!h&&tu(t),g=!c&&!h&&!m&&su(t),_=c||h||m||g,E=_?qc(t.length,String):[],b=E.length;for(var O in t)!a&&!cu.call(t,O)||_&&("length"==O||m&&("offset"==O||"parent"==O)||g&&("buffer"==O||"byteLength"==O||"byteOffset"==O)||Hc(O,b))||E.push(O);return E},lu=Object.prototype;var du=function isPrototype(t){var a=t&&t.constructor;return t===("function"==typeof a&&a.prototype||lu)};var fu=function overArg(t,a){return function(c){return t(a(c))}},pu=fu(Object.keys,Object),hu=Object.prototype.hasOwnProperty;var mu=function baseKeys(t){if(!du(t))return pu(t);var a=[];for(var c in Object(t))hu.call(t,c)&&"constructor"!=c&&a.push(c);return a};var gu=function keys(t){return Uc(t)?uu(t):mu(t)},vu=Kc((function(t,a,c,h){Mc(a,gu(a),t,h)}));var yu,_u=function isUndefined(t){return void 0===t},Eu=(yu=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return yu()+yu()+yu()+yu()+yu()+yu()+yu()+yu()});function getEnumKeys(t){var a;return filter(a=Fi(t)).call(a,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,a){var c,h=filter(c=Fi(t)).call(c,(function(c){return t[c]==a}));return h.length>0?h[0]:void 0}function assignOptions(t,a){return vu({},t,a,(function(t,a){return _u(a)?t:a}))}function emptyFuncWithPromise(){return Xn.resolve()}_export({target:"Array",stat:!0},{isArray:ei});var bu=G.Array.isArray,callWithSafeIterationClosing=function(t,a,c,h){try{return h?a(anObject(c)[0],c[1]):a(c)}catch(a){iteratorClose(t,"throw",a)}},Ou=Array,Tu=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:Tu},{from:function from(t){var a=toObject(t),c=fo(this),h=arguments.length,m=h>1?arguments[1]:void 0,g=void 0!==m;g&&(m=functionBindContext(m,h>2?arguments[2]:void 0));var _,E,b,O,T,S,C=getIteratorMethod$5(a),I=0;if(!C||this===Ou&&isArrayIteratorMethod(C))for(_=lengthOfArrayLike(a),E=c?new this(_):Ou(_);_>I;I++)S=g?m(a[I],I):a[I],createProperty(E,I,S);else for(T=(O=getIterator(a,C)).next,E=c?new this:[];!(b=w(T,O)).done;I++)S=g?callWithSafeIterationClosing(O,m,[b.value,I],!0):b.value,createProperty(E,I,S);return E.length=I,E}});var Su=G.Array.from,Cu={f:wellKnownSymbol},Iu=He.f,wellKnownSymbolDefine=function(t){var a=G.Symbol||(G.Symbol={});de(a,t)||Iu(a,t,{value:Cu.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),a=t&&t.prototype,c=a&&a.valueOf,h=wellKnownSymbol("toPrimitive");a&&!a[h]&&defineBuiltIn(a,h,(function(t){return w(c,this)}),{arity:1})},Ru=bi.forEach,Mu=sharedKey("hidden"),ku="Symbol",wu=Rr.set,Nu=Rr.getterFor(ku),xu=Object.prototype,Au=m.Symbol,Pu=Au&&Au.prototype,Lu=m.TypeError,Du=m.QObject,Vu=Ce.f,Fu=He.f,ju=Da.f,Uu=A.f,Bu=R([].push),Hu=ce("symbols"),Gu=ce("op-symbols"),Ku=ce("wks"),qu=!Du||!Du.prototype||!Du.prototype.findChild,Wu=M&&fails((function(){return 7!=ct(Fu({},"a",{get:function(){return Fu(this,"a",{value:7}).a}})).a}))?function(t,a,c){var h=Vu(xu,a);h&&delete xu[a],Fu(t,a,c),h&&t!==xu&&Fu(xu,a,h)}:Fu,wrap=function(t,a){var c=Hu[t]=ct(Pu);return wu(c,{type:ku,tag:t,description:a}),M||(c.description=a),c},zu=function defineProperty(t,a,c){t===xu&&zu(Gu,a,c),anObject(t);var h=toPropertyKey(a);return anObject(c),de(Hu,h)?(c.enumerable?(de(t,Mu)&&t[Mu][h]&&(t[Mu][h]=!1),c=ct(c,{enumerable:createPropertyDescriptor(0,!1)})):(de(t,Mu)||Fu(t,Mu,createPropertyDescriptor(1,{})),t[Mu][h]=!0),Wu(t,h,c)):Fu(t,h,c)},$u=function defineProperties(t,a){anObject(t);var c=toIndexedObject(a),h=rt(c).concat($getOwnPropertySymbols(c));return Ru(h,(function(a){M&&!w(Yu,c,a)||zu(t,a,c[a])})),t},Yu=function propertyIsEnumerable(t){var a=toPropertyKey(t),c=w(Uu,this,a);return!(this===xu&&de(Hu,a)&&!de(Gu,a))&&(!(c||!de(this,a)||!de(Hu,a)||de(this,Mu)&&this[Mu][a])||c)},Xu=function getOwnPropertyDescriptor(t,a){var c=toIndexedObject(t),h=toPropertyKey(a);if(c!==xu||!de(Hu,h)||de(Gu,h)){var m=Vu(c,h);return!m||!de(Hu,h)||de(c,Mu)&&c[Mu][h]||(m.enumerable=!0),m}},Qu=function getOwnPropertyNames(t){var a=ju(toIndexedObject(t)),c=[];return Ru(a,(function(t){de(Hu,t)||de(Je,t)||Bu(c,t)})),c},$getOwnPropertySymbols=function(t){var a=t===xu,c=ju(a?Gu:toIndexedObject(t)),h=[];return Ru(c,(function(t){!de(Hu,t)||a&&!de(xu,t)||Bu(h,Hu[t])})),h};J||(Au=function Symbol(){if(K(Pu,this))throw Lu("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,a=uid(t),setter=function(t){this===xu&&w(setter,Gu,t),de(this,Mu)&&de(this[Mu],a)&&(this[Mu][a]=!1),Wu(this,a,createPropertyDescriptor(1,t))};return M&&qu&&Wu(xu,a,{configurable:!0,set:setter}),wrap(a,t)},Pu=Au.prototype,defineBuiltIn(Pu,"toString",(function toString(){return Nu(this).tag})),defineBuiltIn(Au,"withoutSetter",(function(t){return wrap(uid(t),t)})),A.f=Yu,He.f=zu,nt.f=$u,Ce.f=Xu,Vt.f=Da.f=Qu,Ct.f=$getOwnPropertySymbols,Cu.f=function(t){return wrap(wellKnownSymbol(t),t)},M&&Fu(Pu,"description",{configurable:!0,get:function description(){return Nu(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!J,sham:!J},{Symbol:Au}),Ru(rt(Ku),(function(t){wellKnownSymbolDefine(t)})),_export({target:ku,stat:!0,forced:!J},{useSetter:function(){qu=!0},useSimple:function(){qu=!1}}),_export({target:"Object",stat:!0,forced:!J,sham:!M},{create:function create(t,a){return void 0===a?ct(t):$u(ct(t),a)},defineProperty:zu,defineProperties:$u,getOwnPropertyDescriptor:Xu}),_export({target:"Object",stat:!0,forced:!J},{getOwnPropertyNames:Qu}),symbolDefineToPrimitive(),setToStringTag(Au,ku),Je[Mu]=!0;var Ju=J&&!!Symbol.for&&!!Symbol.keyFor,Zu=ce("string-to-symbol-registry"),el=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Ju},{for:function(t){var a=toString$1(t);if(de(Zu,a))return Zu[a];var c=getBuiltIn("Symbol")(a);return Zu[a]=c,el[c]=a,c}});var tl=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Ju},{keyFor:function keyFor(t){if(!te(t))throw TypeError(tryToString(t)+" is not a symbol");if(de(tl,t))return tl[t]}});var rl=!J||fails((function(){Ct.f(1)}));_export({target:"Object",stat:!0,forced:rl},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var a=Ct.f;return a?a(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(m.JSON,"JSON",!0);var ol=G.Symbol;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var nl=ol,il=getIteratorMethod$5;var al=Cu.f("iterator"),sl=createCommonjsModule((function(t){function _typeof(a){return t.exports=_typeof="function"==typeof nl&&"symbol"==typeof al?function(t){return typeof t}:function(t){return t&&"function"==typeof nl&&t.constructor===nl&&t!==nl.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(a)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),cl=R([].reverse),ul=[1,2];_export({target:"Array",proto:!0,forced:String(ul)===String(ul.reverse())},{reverse:function reverse(){return ei(this)&&(this.length=this.length),cl(this)}});var ll=entryVirtual("Array").reverse,dl=Array.prototype,reverse=function(t){var a=t.reverse;return t===dl||K(dl,t)&&a===dl.reverse?ll:a},fl=createCommonjsModule((function(t){var a=sl.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return c},t.exports.__esModule=!0,t.exports.default=t.exports;var c={},h=Object.prototype,m=h.hasOwnProperty,g="function"==typeof nl?nl:{},_=g.iterator||"@@iterator",E=g.asyncIterator||"@@asyncIterator",b=g.toStringTag||"@@toStringTag";function define(t,a,c){return _i(t,a,{value:c,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,c){return t[a]=c}}function wrap(t,a,c,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),_=new Context(h||[]);return g._invoke=function(t,a,c){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(c.method=m,c.arg=g;;){var _=c.delegate;if(_){var E=maybeInvokeDelegate(_,c);if(E){if(E===O)continue;return E}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===h)throw h="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);h="executing";var b=tryCatch(t,a,c);if("normal"===b.type){if(h=c.done?"completed":"suspendedYield",b.arg===O)continue;return{value:b.arg,done:c.done}}"throw"===b.type&&(h="completed",c.method="throw",c.arg=b.arg)}}}(t,c,_),g}function tryCatch(t,a,c){try{return{type:"normal",arg:t.call(a,c)}}catch(t){return{type:"throw",arg:t}}}c.wrap=wrap;var O={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var T={};define(T,_,(function(){return this}));var S=ss&&ss(ss(values([])));S&&S!==h&&m.call(S,_)&&(T=S);var C=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(T);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,c){function invoke(h,g,_,E){var b=tryCatch(t[h],t,g);if("throw"!==b.type){var O=b.arg,T=O.value;return T&&"object"==a(T)&&m.call(T,"__await")?c.resolve(T.__await).then((function(t){invoke("next",t,_,E)}),(function(t){invoke("throw",t,_,E)})):c.resolve(T).then((function(t){O.value=t,_(O)}),(function(t){return invoke("throw",t,_,E)}))}E(b.arg)}var h;this._invoke=function(t,a){function callInvokeWithMethodAndArg(){return new c((function(c,h){invoke(t,a,c,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var c=t.iterator[a.method];if(void 0===c){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return O;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var h=tryCatch(c,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,O;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,O):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,O)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[_];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var c=-1,h=function next(){for(;++c<t.length;)if(m.call(t,c))return next.value=t[c],next.done=!1,next;return next.value=void 0,next.done=!0,next};return h.next=h}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(C,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,b,"GeneratorFunction"),c.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},c.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,b,"GeneratorFunction")),t.prototype=lt(C),t},c.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,E,(function(){return this})),c.AsyncIterator=AsyncIterator,c.async=function(t,a,h,m,g){void 0===g&&(g=Xn);var _=new AsyncIterator(wrap(t,a,h,m),g);return c.isGeneratorFunction(a)?_:_.next().then((function(t){return t.done?t.value:_.next()}))},defineIteratorMethods(C),define(C,b,"Generator"),define(C,_,(function(){return this})),define(C,"toString",(function(){return"[object Generator]"})),c.keys=function(t){var a=[];for(var c in t)a.push(c);return reverse(a).call(a),function next(){for(;a.length;){var c=a.pop();if(c in t)return next.value=c,next.done=!1,next}return next.done=!0,next}},c.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var c in this)"t"===c.charAt(0)&&m.call(this,c)&&!isNaN(+slice(c).call(c,1))&&(this[c]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(c,h){return g.type="throw",g.arg=t,a.next=c,h&&(a.method="next",a.arg=void 0),!!h}for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c],g=h.completion;if("root"===h.tryLoc)return handle("end");if(h.tryLoc<=this.prev){var _=m.call(h,"catchLoc"),E=m.call(h,"finallyLoc");if(_&&E){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0);if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c];if(h.tryLoc<=this.prev&&m.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var g=h;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var _=g?g.completion:{};return _.type=t,_.arg=a,g?(this.method="next",this.next=g.finallyLoc,O):this.complete(_)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),O},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.finallyLoc===t)return this.complete(c.completion,c.afterLoc),resetTryEntry(c),O}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc===t){var h=c.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(c)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,c){return this.delegate={iterator:values(t),resultName:a,nextLoc:c},"next"===this.method&&(this.arg=void 0),O}},c}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),pl=fl(),hl=pl;try{regeneratorRuntime=pl}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=pl:Function("r","regeneratorRuntime = r")(pl)}function __rest(t,a){var c={};for(var h in t)Object.prototype.hasOwnProperty.call(t,h)&&a.indexOf(h)<0&&(c[h]=t[h]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var m=0;for(h=Object.getOwnPropertySymbols(t);m<h.length;m++)a.indexOf(h[m])<0&&Object.prototype.propertyIsEnumerable.call(t,h[m])&&(c[h[m]]=t[h[m]])}return c}function __awaiter(t,a,c,h){return new(c||(c=Promise))((function(m,g){function fulfilled(t){try{step(h.next(t))}catch(t){g(t)}}function rejected(t){try{step(h.throw(t))}catch(t){g(t)}}function step(t){t.done?m(t.value):function adopt(t){return t instanceof c?t:new c((function(a){a(t)}))}(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var ml=function isSymbol(t){return"symbol"==typeof t||Wc(t)&&"[object Symbol]"==ac(t)},gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vl=/^\w*$/;var yl=function isKey(t,a){if(Zc(t))return!1;var c=typeof t;return!("number"!=c&&"symbol"!=c&&"boolean"!=c&&null!=t&&!ml(t))||(vl.test(t)||!gl.test(t)||null!=a&&t in Object(a))},_l=Oc(Object,"create");var El=function hashClear(){this.__data__=_l?_l(null):{},this.size=0};var bl=function hashDelete(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a},Ol=Object.prototype.hasOwnProperty;var Tl=function hashGet(t){var a=this.__data__;if(_l){var c=a[t];return"__lodash_hash_undefined__"===c?void 0:c}return Ol.call(a,t)?a[t]:void 0},Sl=Object.prototype.hasOwnProperty;var Cl=function hashHas(t){var a=this.__data__;return _l?void 0!==a[t]:Sl.call(a,t)};var Il=function hashSet(t,a){var c=this.__data__;return this.size+=this.has(t)?0:1,c[t]=_l&&void 0===a?"__lodash_hash_undefined__":a,this};function Hash(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}Hash.prototype.clear=El,Hash.prototype.delete=bl,Hash.prototype.get=Tl,Hash.prototype.has=Cl,Hash.prototype.set=Il;var Rl=Hash;var Ml=function listCacheClear(){this.__data__=[],this.size=0};var kl=function assocIndexOf(t,a){for(var c=t.length;c--;)if(Cc(t[c][0],a))return c;return-1},wl=Array.prototype.splice;var Nl=function listCacheDelete(t){var a=this.__data__,c=kl(a,t);return!(c<0)&&(c==a.length-1?a.pop():wl.call(a,c,1),--this.size,!0)};var xl=function listCacheGet(t){var a=this.__data__,c=kl(a,t);return c<0?void 0:a[c][1]};var Al=function listCacheHas(t){return kl(this.__data__,t)>-1};var Pl=function listCacheSet(t,a){var c=this.__data__,h=kl(c,t);return h<0?(++this.size,c.push([t,a])):c[h][1]=a,this};function ListCache(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}ListCache.prototype.clear=Ml,ListCache.prototype.delete=Nl,ListCache.prototype.get=xl,ListCache.prototype.has=Al,ListCache.prototype.set=Pl;var Ll=ListCache,Dl=Oc(Xs,"Map");var Vl=function mapCacheClear(){this.size=0,this.__data__={hash:new Rl,map:new(Dl||Ll),string:new Rl}};var Fl=function isKeyable(t){var a=typeof t;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==t:null===t};var jl=function getMapData(t,a){var c=t.__data__;return Fl(a)?c["string"==typeof a?"string":"hash"]:c.map};var Ul=function mapCacheDelete(t){var a=jl(this,t).delete(t);return this.size-=a?1:0,a};var Bl=function mapCacheGet(t){return jl(this,t).get(t)};var Hl=function mapCacheHas(t){return jl(this,t).has(t)};var Gl=function mapCacheSet(t,a){var c=jl(this,t),h=c.size;return c.set(t,a),this.size+=c.size==h?0:1,this};function MapCache(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}MapCache.prototype.clear=Vl,MapCache.prototype.delete=Ul,MapCache.prototype.get=Bl,MapCache.prototype.has=Hl,MapCache.prototype.set=Gl;var Kl=MapCache;function memoize(t,a){if("function"!=typeof t||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var memoized=function(){var c=arguments,h=a?a.apply(this,c):c[0],m=memoized.cache;if(m.has(h))return m.get(h);var g=t.apply(this,c);return memoized.cache=m.set(h,g)||m,g};return memoized.cache=new(memoize.Cache||Kl),memoized}memoize.Cache=Kl;var ql=memoize;var Wl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zl=/\\(\\)?/g,$l=function memoizeCapped(t){var a=ql(t,(function(t){return 500===c.size&&c.clear(),t})),c=a.cache;return a}((function(t){var a=[];return 46===t.charCodeAt(0)&&a.push(""),t.replace(Wl,(function(t,c,h,m){a.push(h?m.replace(zl,"$1"):c||t)})),a})),Yl=$l;var Xl=function arrayMap(t,a){for(var c=-1,h=null==t?0:t.length,m=Array(h);++c<h;)m[c]=a(t[c],c,t);return m},Ql=Qs?Qs.prototype:void 0,Jl=Ql?Ql.toString:void 0;var Zl=function baseToString(t){if("string"==typeof t)return t;if(Zc(t))return Xl(t,baseToString)+"";if(ml(t))return Jl?Jl.call(t):"";var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var ed=function toString(t){return null==t?"":Zl(t)};var td=function castPath(t,a){return Zc(t)?t:yl(t,a)?[t]:Yl(ed(t))};var rd=function toKey(t){if("string"==typeof t||ml(t))return t;var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var od=function baseGet(t,a){for(var c=0,h=(a=td(a,t)).length;null!=t&&c<h;)t=t[rd(a[c++])];return c&&c==h?t:void 0};var nd=function get(t,a,c){var h=null==t?void 0:od(t,a);return void 0===h?c:h};var id=function stackClear(){this.__data__=new Ll,this.size=0};var ad=function stackDelete(t){var a=this.__data__,c=a.delete(t);return this.size=a.size,c};var sd=function stackGet(t){return this.__data__.get(t)};var cd=function stackHas(t){return this.__data__.has(t)};var ud=function stackSet(t,a){var c=this.__data__;if(c instanceof Ll){var h=c.__data__;if(!Dl||h.length<199)return h.push([t,a]),this.size=++c.size,this;c=this.__data__=new Kl(h)}return c.set(t,a),this.size=c.size,this};function Stack(t){var a=this.__data__=new Ll(t);this.size=a.size}Stack.prototype.clear=id,Stack.prototype.delete=ad,Stack.prototype.get=sd,Stack.prototype.has=cd,Stack.prototype.set=ud;var ld=Stack;var dd=function assignMergeValue(t,a,c){(void 0!==c&&!Cc(t[a],c)||void 0===c&&!(a in t))&&Sc(t,a,c)};var fd=function createBaseFor(t){return function(a,c,h){for(var m=-1,g=Object(a),_=h(a),E=_.length;E--;){var b=_[t?E:++m];if(!1===c(g[b],b,g))break}return a}}(),pd=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c?Xs.Buffer:void 0,g=m?m.allocUnsafe:void 0;t.exports=function cloneBuffer(t,a){if(a)return t.slice();var c=t.length,h=g?g(c):new t.constructor(c);return t.copy(h),h}})),hd=Xs.Uint8Array;var md=function cloneArrayBuffer(t){var a=new t.constructor(t.byteLength);return new hd(a).set(new hd(t)),a};var gd=function cloneTypedArray(t,a){var c=a?md(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.length)};var vd=function copyArray(t,a){var c=-1,h=t.length;for(a||(a=Array(h));++c<h;)a[c]=t[c];return a},yd=Object.create,_d=function(){function object(){}return function(t){if(!sc(t))return{};if(yd)return yd(t);object.prototype=t;var a=new object;return object.prototype=void 0,a}}(),Ed=fu(Object.getPrototypeOf,Object);var bd=function initCloneObject(t){return"function"!=typeof t.constructor||du(t)?{}:_d(Ed(t))};var Od=function isArrayLikeObject(t){return Wc(t)&&Uc(t)},Td=Function.prototype,Sd=Object.prototype,Cd=Td.toString,Id=Sd.hasOwnProperty,Rd=Cd.call(Object);var Md=function isPlainObject(t){if(!Wc(t)||"[object Object]"!=ac(t))return!1;var a=Ed(t);if(null===a)return!0;var c=Id.call(a,"constructor")&&a.constructor;return"function"==typeof c&&c instanceof c&&Cd.call(c)==Rd};var kd=function safeGet(t,a){if(("constructor"!==a||"function"!=typeof t[a])&&"__proto__"!=a)return t[a]};var wd=function nativeKeysIn(t){var a=[];if(null!=t)for(var c in Object(t))a.push(c);return a},Nd=Object.prototype.hasOwnProperty;var xd=function baseKeysIn(t){if(!sc(t))return wd(t);var a=du(t),c=[];for(var h in t)("constructor"!=h||!a&&Nd.call(t,h))&&c.push(h);return c};var Ad=function keysIn(t){return Uc(t)?uu(t,!0):xd(t)};var Pd=function toPlainObject(t){return Mc(t,Ad(t))};var Ld=function baseMergeDeep(t,a,c,h,m,g,_){var E=kd(t,c),b=kd(a,c),O=_.get(b);if(O)dd(t,c,O);else{var T=g?g(E,b,c+"",t,a,_):void 0,S=void 0===T;if(S){var C=Zc(b),I=!C&&tu(b),R=!C&&!I&&su(b);T=b,C||I||R?Zc(E)?T=E:Od(E)?T=vd(E):I?(S=!1,T=pd(b,!0)):R?(S=!1,T=gd(b,!0)):T=[]:Md(b)||Jc(b)?(T=E,Jc(E)?T=Pd(E):sc(E)&&!cc(E)||(T=bd(b))):S=!1}S&&(_.set(b,T),m(T,b,h,g,_),_.delete(b)),dd(t,c,T)}};var Dd=function baseMerge(t,a,c,h,m){t!==a&&fd(a,(function(g,_){if(m||(m=new ld),sc(g))Ld(t,a,_,c,baseMerge,h,m);else{var E=h?h(kd(t,_),g,_+"",t,a,m):void 0;void 0===E&&(E=g),dd(t,_,E)}}),Ad)},Vd=Kc((function(t,a,c){Dd(t,a,c)})),Fd=bi.some,jd=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!jd},{some:function some(t){return Fd(this,t,arguments.length>1?arguments[1]:void 0)}});var Ud,Bd,Hd=entryVirtual("Array").some,Gd=Array.prototype,some=function(t){var a=t.some;return t===Gd||K(Gd,t)&&a===Gd.some?Hd:a};!function(t){t[t.Unset=0]="Unset",t[t.RN=2]="RN",t[t.UNIAPP=3]="UNIAPP",t[t.Electron=5]="Electron",t[t.WeiXin=6]="WeiXin",t[t.BROWSER=100]="BROWSER",t[t.H5=101]="H5",t[t.Ali=102]="Ali",t[t.Baidu=103]="Baidu",t[t.Tiktok=104]="Tiktok"}(Ud||(Ud={})),function(t){t[t.kStatNetTypeUnkonw=0]="kStatNetTypeUnkonw",t[t.kStatNetTypeEthernet=1]="kStatNetTypeEthernet",t[t.kStatNetTypeWifi=2]="kStatNetTypeWifi",t[t.kStatNetType2G=3]="kStatNetType2G",t[t.kStatNetType3G=4]="kStatNetType3G",t[t.kStatNetType4G=5]="kStatNetType4G",t[t.kStatNetType5G=6]="kStatNetType5G"}(Bd||(Bd={}));var Kd={wifi:Bd.kStatNetTypeWifi,"2g":Bd.kStatNetType2G,"3g":Bd.kStatNetType3G,"4g":Bd.kStatNetType4G,"5g":Bd.kStatNetType5G,ethernet:Bd.kStatNetTypeEthernet,unknown:Bd.kStatNetTypeUnkonw,none:Bd.kStatNetTypeUnkonw,notreachable:Bd.kStatNetTypeUnkonw,wwan:Bd.kStatNetTypeUnkonw};function isMobile(){if(!navigator||!navigator.userAgent)return!1;var t=[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i];return some(t).call(t,(function(t){return navigator.userAgent.match(t)}))}function isElectron(){var t;return!(!navigator||!navigator.userAgent)&&("object"==typeof navigator&&"string"==typeof navigator.userAgent&&indexOf(t=navigator.userAgent).call(t,"Electron")>=0)}function isBrowser(){return navigator&&navigator.userAgent}var qd,Wd,zd,$d,Yd,Xd,Qd={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,a){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.binaryType="",new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,a){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,a){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")},getFileUploadInformation:function getFileUploadInformation(t){throw new Error("Function not implemented.")},net:{__getEnv:function __getEnv(){return null},__onNetworkStatusChangeFn:null,getNetworkStatus:function getNetworkStatus(){var t=this.__getEnv();return new Xn((function(a,c){t.getNetworkType({success:function success(t){var c=!1;c="boolean"==typeof t.networkAvailable?t.networkAvailable:"none"!==t.networkType.toLowerCase(),a({net_type:Kd[t.networkType.toLowerCase()],net_connect:c})},fail:function fail(){c(new Error("getNetworkType failed"))}})}))},onNetworkStatusChange:function onNetworkStatusChange(t){var a=this.__getEnv();this.offNetworkStatusChange(),a.onNetworkStatusChange&&(this.__onNetworkStatusChangeFn=function(a){var c=a.networkType.toLowerCase();t({isConnected:a.isConnected||"none"!==c,networkType:Kd[c]})},a.onNetworkStatusChange(this.__onNetworkStatusChangeFn))},offNetworkStatusChange:function offNetworkStatusChange(){var t=this.__getEnv();t.offNetworkStatusChange&&(this.__onNetworkStatusChangeFn&&t.offNetworkStatusChange(this.__onNetworkStatusChangeFn),this.__onNetworkStatusChangeFn=null)}}};function getPromiseWithAbort(t){var a={},c=new Xn((function(t,c){a.abort=c}));return a.promise=Xn.race([t,c]),a}!function(t){t[t.V2NIM_LOGIN_AUTH_TYPE_DEFAULT=0]="V2NIM_LOGIN_AUTH_TYPE_DEFAULT",t[t.V2NIM_LOGIN_AUTH_TYPE_DYNAMIC_TOKEN=1]="V2NIM_LOGIN_AUTH_TYPE_DYNAMIC_TOKEN",t[t.V2NIM_LOGIN_AUTH_TYPE_THIRD_PARTY=2]="V2NIM_LOGIN_AUTH_TYPE_THIRD_PARTY"}(qd||(qd={})),function(t){t[t.V2NIM_LOGIN_STATUS_LOGOUT=0]="V2NIM_LOGIN_STATUS_LOGOUT",t[t.V2NIM_LOGIN_STATUS_LOGINED=1]="V2NIM_LOGIN_STATUS_LOGINED",t[t.V2NIM_LOGIN_STATUS_LOGINING=2]="V2NIM_LOGIN_STATUS_LOGINING",t[t.V2NIM_LOGIN_STATUS_UNLOGIN=3]="V2NIM_LOGIN_STATUS_UNLOGIN"}(Wd||(Wd={})),function(t){t[t.V2NIM_LOGIN_CLIENT_TYPE_UNKNOWN=0]="V2NIM_LOGIN_CLIENT_TYPE_UNKNOWN",t[t.V2NIM_LOGIN_CLIENT_TYPE_ANDROID=1]="V2NIM_LOGIN_CLIENT_TYPE_ANDROID",t[t.V2NIM_LOGIN_CLIENT_TYPE_IOS=2]="V2NIM_LOGIN_CLIENT_TYPE_IOS",t[t.V2NIM_LOGIN_CLIENT_TYPE_PC=4]="V2NIM_LOGIN_CLIENT_TYPE_PC",t[t.V2NIM_LOGIN_CLIENT_TYPE_WP=8]="V2NIM_LOGIN_CLIENT_TYPE_WP",t[t.V2NIM_LOGIN_CLIENT_TYPE_WEB=16]="V2NIM_LOGIN_CLIENT_TYPE_WEB",t[t.V2NIM_LOGIN_CLIENT_TYPE_RESTFUL=32]="V2NIM_LOGIN_CLIENT_TYPE_RESTFUL",t[t.V2NIM_LOGIN_CLIENT_TYPE_MAC_OS=64]="V2NIM_LOGIN_CLIENT_TYPE_MAC_OS",t[t.V2NIM_LOGIN_CLIENT_TYPE_HARMONY_OS=65]="V2NIM_LOGIN_CLIENT_TYPE_HARMONY_OS"}(zd||(zd={})),function(t){t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT_EXCLUSIVE=1]="V2NIM_KICKED_OFFLINE_REASON_CLIENT_EXCLUSIVE",t[t.V2NIM_KICKED_OFFLINE_REASON_SERVER=2]="V2NIM_KICKED_OFFLINE_REASON_SERVER",t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT=3]="V2NIM_KICKED_OFFLINE_REASON_CLIENT",t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT_QUIETLY=4]="V2NIM_KICKED_OFFLINE_REASON_CLIENT_QUIETLY"}($d||($d={})),function(t){t[t.V2NIM_LOGIN_CLIENT_CHANGE_LIST=1]="V2NIM_LOGIN_CLIENT_CHANGE_LIST",t[t.V2NIM_LOGIN_CLIENT_CHANGE_LOGIN=2]="V2NIM_LOGIN_CLIENT_CHANGE_LOGIN",t[t.V2NIM_LOGIN_CLIENT_CHANGE_LOGOUT=3]="V2NIM_LOGIN_CLIENT_CHANGE_LOGOUT"}(Yd||(Yd={})),function(t){t[t.V2NIM_CONNECT_STATUS_DISCONNECTED=0]="V2NIM_CONNECT_STATUS_DISCONNECTED",t[t.V2NIM_CONNECT_STATUS_CONNECTED=1]="V2NIM_CONNECT_STATUS_CONNECTED",t[t.V2NIM_CONNECT_STATUS_CONNECTING=2]="V2NIM_CONNECT_STATUS_CONNECTING",t[t.V2NIM_CONNECT_STATUS_WAITING=3]="V2NIM_CONNECT_STATUS_WAITING"}(Xd||(Xd={})),Xn.reject;var Jd=function(){function PromiseManager(){this.abortFns=[]}var t=PromiseManager.prototype;return t.add=function add(t){var a=getPromiseWithAbort(t);return this.abortFns.push(a.abort),a.promise},t.clear=function clear(t){var a;forEach$1(a=this.abortFns).call(a,(function(a){return a(t||new Gs({code:Bs.V2NIM_ERROR_CODE_CANCELLED,detail:{reason:"Aborted"}}))})),this.abortFns=[]},t.destroy=function destroy(){this.clear()},PromiseManager}(),Zd={tolerantRTT:3e3,bestRTT:100,maxChances:5,enable:!0},ef={timestamp:0,rtt:0,baseClock:0,baseTime:0},tf=function(){function TimeOrigin(t,a,c){void 0===c&&(c="getServerTime"),this.serverOrigin=ef,this.config=Zd,this.isSettingNTP=!1,this.currentChance=0,this.failedDelay=2e3,this.successDelay=3e5,this.timer=0,this.cmdName="getServerTime",this.core=t,this.logger=t.logger,this.promiseManager=new Jd,this.cmdName=c,a&&this.setOptions(a)}var t=TimeOrigin.prototype;return t.setOptions=function setOptions(t){this.config=wt({},Zd,this.config,t)},t.reset=function reset(){this.timer&&clearTimeout(this.timer),this.promiseManager.clear(),this.serverOrigin=ef,this.currentChance=0},t.setOriginTimetick=function setOriginTimetick(){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var t,a,c,h,m,g,_,E,b,O;return hl.wrap((function _callee$(T){for(;;)switch(T.prev=T.next){case 0:if(this.config.enable){T.next=2;break}return T.abrupt("return");case 2:if(!this.isSettingNTP){T.next=4;break}return T.abrupt("return");case 4:if(!(this.currentChance>=this.config.maxChances)){T.next=6;break}return T.abrupt("return");case 6:if(t=nd(this.core,"auth.status"),a=nd(this.core,"status"),c=nd(this.core,"V2NIMLoginService.lifeCycle.loginStatus"),"logined"===t||"logined"===a||c===Wd.V2NIM_LOGIN_STATUS_LOGINED){T.next=11;break}return T.abrupt("return");case 11:return this.isSettingNTP=!0,this.currentChance++,this.timer&&clearTimeout(this.timer),this.timer=0,h="TimeOrigin::setOriginTimetick:",m=Zn(),this.core.logger.log(h+" getServerTime start, times "+this.currentChance),T.prev=18,T.next=21,this.promiseManager.add(this.core.sendCmd(this.cmdName));case 21:_=T.sent,g=nd(_,"content.time"),this.isSettingNTP=!1,T.next=33;break;case 26:return T.prev=26,T.t0=T.catch(18),E=T.t0,this.isSettingNTP=!1,this.logger.warn(h+" Calculate Delay time, getServerTime error",E),E.code!==Bs.V2NIM_ERROR_CODE_CANCELLED&&(this.timer=mi(bind$1(b=this.setOriginTimetick).call(b,this),this.failedDelay)),T.abrupt("return");case 33:if(g){T.next=37;break}return this.core.logger.warn(h+" Calculate Delay time incorrect format"),this.config.enable=!1,T.abrupt("return");case 37:O=Zn()-m,this.doSet(g,O);case 39:case"end":return T.stop()}}),_callee,this,[[18,26]])})))},t.doSet=function doSet(t,a){var c,h="TimeOrigin::setOriginTimetick:";if(a>this.config.tolerantRTT)this.logger.warn(h+" Denied, cause of exceeding the maximum tolerance range of RTT: "+a),this.timer=mi(bind$1(c=this.setOriginTimetick).call(c,this),this.failedDelay);else if(a>this.config.bestRTT){var m;this.serverOrigin.rtt&&a>=this.serverOrigin.rtt?this.logger.log(h+" Denied, cause of current.RTT >= serverOrigin.RTT: "+a):(this.setServerOrigin(a,t),this.logger.log(h+" Accept within maximum tolerance range of RTT: "+a+", ntpTimestamp: "+this.serverOrigin.timestamp+", localClock: "+this.serverOrigin.baseClock+", localTime: "+this.serverOrigin.baseTime)),this.timer=mi(bind$1(m=this.setOriginTimetick).call(m,this),this.failedDelay)}else{var g;this.setServerOrigin(a,t),this.logger.log(h+" Accept within best RTT: "+a+", ntpTimestamp: "+this.serverOrigin.timestamp+", localClock: "+this.serverOrigin.baseClock+", localTime: "+this.serverOrigin.baseTime),this.currentChance=0,this.timer=mi(bind$1(g=this.setOriginTimetick).call(g,this),this.successDelay)}},t.getNTPTime=function getNTPTime(t){if(void 0===t&&(t=this.getTimeNode()),this.checkNodeReliable(t)){var a=Math.floor(t.time-this.serverOrigin.baseTime);return this.serverOrigin.timestamp+a}return Zn()},t.checkNodeReliable=function checkNodeReliable(t){if(this.serverOrigin.timestamp){if(0===this.serverOrigin.baseClock)return!0;var a=t.clock-this.serverOrigin.baseClock,c=t.time-this.serverOrigin.baseTime;return Math.abs(c-a)<500}return!1},t.checkPerformance=function checkPerformance(){return"BROWSER"===Qd.platform&&!("undefined"==typeof performance||!performance.now)},TimeOrigin.checkPerformance=function checkPerformance(){return"BROWSER"===Qd.platform&&!("undefined"==typeof performance||!performance.now)},t.getTimeNode=function getTimeNode(){return{clock:this.checkPerformance()?performance.now():0,time:Zn()}},TimeOrigin.getTimeNode=function getTimeNode(){return{clock:TimeOrigin.checkPerformance()?performance.now():0,time:Zn()}},t.setServerOrigin=function setServerOrigin(t,a){this.serverOrigin={timestamp:a+Math.floor(t/2),rtt:t,baseClock:this.checkPerformance()?performance.now():0,baseTime:Zn()}},TimeOrigin}();function _createForOfIteratorHelperLoose$2(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray$2(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$2(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$2(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$2(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var rf={},nf={};function parseEachCmd(t,a,c,h,m){var g,_={cmd:c,raw:t,error:null,service:null==a?void 0:a.service,content:{},__receiveTimeNode:tf.getTimeNode()};if(!c||!a)return _.notFound=!0,_;a.sid>=26&&a.sid<100&&(t.code=function toReadableCode(t){if("number"!=typeof t)throw new Gs({code:Bs.V2NIM_ERROR_CODE_INTERNAL,detail:{reason:"Read code failed",rawData:t}});if(t>=0&&t<1e3)return t;if(t>=2e4&&t<=20099)return t;var a=(65535&t)>>9;a-=a<=38?1:2;return 1e5+1e3*a+(511&t)}(t.code));var E,b=function genCmdError(t,a){var c=Hs[t],h=zs[t];return null===h?null:new Gs({code:t,desc:c||h||t,detail:{cmd:a,timetag:Zn()}})}(t.code,c);if(_.error=b,_.error){if(_.error.detail.cmd=c,!(null===(g=null==a?void 0:a.ignoreErrCodes)||void 0===g?void 0:includes(g).call(g,t.code)))return _;m.warn("parseCmd:: ignore error ",_.error),_.error.detail.ignore=!0}a.response&&forEach$1(E=a.response).call(E,(function(t,a){var c=h[a],m=t.type,g=t.name,E=t.reflectMapper;if(!_u(c))switch(m){case"Property":_.content[g]=E?deserialize(c,E):c;break;case"PropertyArray":_.content[g]=map$6(c).call(c,(function(t){return E?deserialize(t,E):t}));break;case"Int":case"Long":case"Byte":_.content[g]=+c;break;case"Bool":_.content[g]="true"===c||!0===c||1===c;break;default:_.content[g]=c}}));return _}function serialize(t,a,c){var h={};for(var m in t=function flattenObjByMapper(t,a){var c={};for(var h in a){for(var m,g=a[h],_="number"==typeof g?h:g.access?g.access:h,E=t,b=_createForOfIteratorHelperLoose$2(_.split("."));!(m=b()).done;){var O=m.value;if(void 0===E[O]||null===E[O]){E=void 0;break}E=E[O]}void 0!==E&&(c[_]=E)}return c}(t,a),a){var g=a[m],_="number"==typeof g?m:g.access?g.access:m;c&&!includes(c).call(c,m)||(_ in t?"number"==typeof g?h[g]=t[_]:"object"==typeof g&&(g.converter?h[g.id]=g.converter(t[_],t):h[g.id]=t[_]):"object"==typeof g&&g.def&&("function"==typeof g.def?h[g.id]=g.def(t):h[g.id]=g.def))}return h}function deserialize(t,a){var c={};for(var h in t){var m=a[h];if("string"==typeof m)c[m]=t[h];else if("object"==typeof m&&"prop"in m){var g=m.access?m.access:m.prop;m.converter?c[g]=m.converter(t[h],t):m.type&&"number"===m.type?c[g]=+t[h]:m.type&&"boolean"===m.type?c[g]=!("0"===t[h]||!t[h]):c[g]=t[h]}}for(var _ in a){var E=a[_];if(E&&void 0!==E.def){var b=E.access?E.access:E.prop;b in c||("function"==typeof E.def?c[b]=E.def(t):c[b]=E.def)}}return c=function unflattenObj(t){var a={},c=function _loop(c){var h=c.split(".");reduce(h).call(h,(function(a,m,g){return a[m]||(a[m]=isNaN(Number(h[g+1]))?h.length-1==g?t[c]:{}:[])}),a)};for(var h in t)c(h);return a}(c),c}function registerParser(t){for(var a in wt(rf,t.cmdConfig),t.cmdMap){var c=t.cmdMap[a],h=t.cmdConfig[c];if(h)if(bu(nf[a])){for(var m,g=!1,_=_createForOfIteratorHelperLoose$2(nf[a]);!(m=_()).done;){var E=m.value;if(E.cmd===c&&E.config.service===h.service){g=!0;break}}g||nf[a].push({config:h,cmd:c})}else nf[a]=[{config:h,cmd:c}]}}var af=entryVirtual("Array").values,sf=Array.prototype,cf={DOMTokenList:!0,NodeList:!0},values=function(t){var a=t.values;return t===sf||K(sf,t)&&a===sf.values||de(cf,Zt(t))?af:a},uf=bi.every,lf=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!lf},{every:function every(t){return uf(this,t,arguments.length>1?arguments[1]:void 0)}});var df=entryVirtual("Array").every,ff=Array.prototype,every=function(t){var a=t.every;return t===ff||K(ff,t)&&a===ff.every?df:a};var pf=function baseIsRegExp(t){return Wc(t)&&"[object RegExp]"==ac(t)},hf=iu&&iu.isRegExp,mf=hf?nu(hf):pf;var gf=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var vf=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var a=-1,c=null==t?0:t.length;for(this.__data__=new Kl;++a<c;)this.add(t[a])}SetCache.prototype.add=SetCache.prototype.push=gf,SetCache.prototype.has=vf;var yf=SetCache;var _f=function baseFindIndex(t,a,c,h){for(var m=t.length,g=c+(h?1:-1);h?g--:++g<m;)if(a(t[g],g,t))return g;return-1};var Ef=function baseIsNaN(t){return t!=t};var bf=function strictIndexOf(t,a,c){for(var h=c-1,m=t.length;++h<m;)if(t[h]===a)return h;return-1};var Of=function baseIndexOf(t,a,c){return a==a?bf(t,a,c):_f(t,Ef,c)};var Tf=function arrayIncludes(t,a){return!!(null==t?0:t.length)&&Of(t,a,0)>-1};var Sf=function arrayIncludesWith(t,a,c){for(var h=-1,m=null==t?0:t.length;++h<m;)if(c(a,t[h]))return!0;return!1};var Cf=function cacheHas(t,a){return t.has(a)};var If=function baseDifference(t,a,c,h){var m=-1,g=Tf,_=!0,E=t.length,b=[],O=a.length;if(!E)return b;c&&(a=Xl(a,nu(c))),h?(g=Sf,_=!1):a.length>=200&&(g=Cf,_=!1,a=new yf(a));e:for(;++m<E;){var T=t[m],S=null==c?T:c(T);if(T=h||0!==T?T:0,_&&S==S){for(var C=O;C--;)if(a[C]===S)continue e;b.push(T)}else g(a,S,h)||b.push(T)}return b},Rf=Fc((function(t,a){return Od(t)?If(t,a):[]})),Mf=Rf;function replacer(t,a){return a instanceof RegExp?"__REGEXP "+a.toString():a}function validate(t,a,c,h){var m;void 0===a&&(a={}),void 0===h&&(h=!1);var g={};return forEach$1(m=Fi(t)).call(m,(function(m){var _=t[m].type,E=c?"In "+c+", ":"";if(null==a){var b=E+"param is null or undefined";throw h?new qs({detail:{reason:b,data:{key:m},rules:"required"}}):new Ks(b,{key:m},"required")}if(void 0===a[m]){if(!1===t[m].required)return void(g[m]=a[m]);var O=E+"param '"+m+"' is required";throw h?new qs({detail:{reason:O,data:{key:m},rules:"required"}}):new Ks(O,{key:m},"required")}var T=kf[_];if(T&&!T(a,m,t[m],h)){var S=E+"param '"+m+"' unexpected",C={key:m,value:a[m]};throw h?new qs({detail:{reason:S,data:C,rules:Fs(t[m],replacer)}}):new Ks(S,C,Fs(t[m],replacer))}g[m]=a[m]})),g}var kf={string:function string(t,a,c){var h=c.allowEmpty,m=c.max,g=c.min,_=c.regExp,E=t[a];return"string"==typeof E&&((!1!==h||""!==E)&&(!("number"==typeof m&&E.length>m)&&(!("number"==typeof g&&E.length<g)&&!(mf(_)&&!_.test(E)))))},number:function number(t,a,c){var h=c.min,m=c.max,g=t[a];return"number"==typeof g&&(!("number"==typeof h&&g<h)&&!("number"==typeof m&&g>m))},boolean:function boolean(t,a){return"boolean"==typeof t[a]},file:function file(t,a){return!0},enum:function _enum(t,a,c){var h=values(c),m=t[a];return!h||indexOf(h).call(h,m)>-1},func:function func(t,a){return"function"==typeof t[a]},array:function array(t,a,c,h){var m;void 0===h&&(h=!1);var g=c.itemType,_=c.rules,E=c.min,b=c.max,O=values(c),T=t[a];return!!bu(T)&&(!("number"==typeof b&&T.length>b)&&(!("number"==typeof E&&T.length<E)&&(!(g&&"enum"!==g&&!every(T).call(T,(function(t){return typeof t===g})))&&(("enum"!==g||!O||!Mf.apply(void 0,concat(m=[T]).call(m,O)).length)&&(_&&forEach$1(T).call(T,(function(t,c){return validate(_,t,a+"["+c+"]",h)})),!0)))))},object:function object(t,a,c,h){void 0===h&&(h=!1);var m=c.rules,g=c.allowEmpty,_=t[a];if("object"!=typeof _||null===_)return!1;if(m){var E=Fi(m),b=Fi(_),O=filter(b).call(b,(function(t){return indexOf(E).call(E,t)>-1}));if(!1===g&&0===O.length)return!1;validate(m,_,a,h)}return!0}},wf=["error","warn","log","debug"],Nf=function emptyFunc(){},xf=["off","error","warn","log","debug"],Af=function(){function Logger(t){this.strategies={debug:{name:"debug",func:console.log},log:{name:" log",func:console.log},warn:{name:" warn",func:console.warn},error:{name:"error",func:console.error}},this.debug=Nf,this.log=Nf,this.warn=Nf,this.error=Nf,includes(xf).call(xf,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var a=this,c=findIndex(wf).call(wf,(function(a){return a===t}));forEach$1(wf).call(wf,(function(t,h){h<=c&&(a[t]=function(){var a=slice(Array.prototype).call(arguments),c=this.strategies[t],h=this.formatArgs(a,c.name);c.func(h)})}))},t.formatArgs=function formatArgs(t,a){var c=new Date;return"[NIM "+a+" "+(c.getMonth()+1+"-"+c.getDate()+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+":"+c.getMilliseconds())+"] "+map$6(t).call(t,(function(t){return t instanceof Gs?t.toString():t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Fs(t):t})).join(" ")},t.destroy=function destroy(){this.debug=Nf,this.log=Nf,this.warn=Nf,this.error=Nf},Logger}(),Pf=function(){function CoreAdapters(t){this.core=t}var t=CoreAdapters.prototype;return t.getFileUploadInformation=function getFileUploadInformation(t){return Qd.getFileUploadInformation(t)},t.request=function request(t,a,c){var h=this,m=(new Date).getTime(),g=(null==c?void 0:c.exception_service)||0;return Qd.request(t,a).catch((function(c){var _,E,b,O,T=c;throw h.core.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account||(null===(E=null===(_=h.core)||void 0===_?void 0:_.auth)||void 0===E?void 0:E.account),trace_id:null===(O=null===(b=h.core.clientSocket)||void 0===b?void 0:b.socket)||void 0===O?void 0:O.sessionId,start_time:m,action:1,exception_service:g}),h.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof T.code?T.code:0,description:T.message||""+T.code,operation_type:0,target:t,context:a?Fs(a):""},{asyncParams:Qd.net.getNetworkStatus()}),h.core.reporter.reportTraceEnd("exceptions",1),c}))},t.uploadFile=function uploadFile(t){var a=this,c=(new Date).getTime();return Qd.uploadFile(t).catch((function(h){var m,g,_,E,b=h;a.core.reporter.reportTraceStart("exceptions",{user_id:a.core.options.account||(null===(g=null===(m=a.core)||void 0===m?void 0:m.auth)||void 0===g?void 0:g.account),trace_id:null===(E=null===(_=a.core.clientSocket)||void 0===_?void 0:_.socket)||void 0===E?void 0:E.sessionId,start_time:c,action:1,exception_service:3});var O="BROWSER"===Qd.platform?t.chunkUploadHost:t.commonUploadHost?t.commonUploadHost+"/"+(t.nosToken&&t.nosToken.bucket):"https://nos.netease.com/nim";throw a.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof b.code?b.code:0,description:b.message||""+b.code,operation_type:1,target:O},{asyncParams:Qd.net.getNetworkStatus()}),a.core.reporter.reportTraceEnd("exceptions",1),h}))},CoreAdapters}(),Lf="https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",Df="imElite_sdk_abtest_web",Vf=function(){function ABTest(t,a){this.abtInfo={},this.core=t,this.config=assignOptions({isAbtestEnable:!0,abtestUrl:Lf,abtestProjectKey:Df},a)}var t=ABTest.prototype;return t.setOptions=function setOptions(t){this.config=assignOptions(this.config,t)},t.abtRequest=function abtRequest(){var t,a;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var c;return hl.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:if(this.config.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.config.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.core.adapters.request(this.config.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},data:{clientInfo:{projectKey:this.config.abtestProjectKey,appKey:this.core.options.appkey,osType:"Web",sdkVersion:"10.2.3",deviceId:this.core.config.deviceId},useLocalCache:!0}},{exception_service:7});case 9:c=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.core.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(a=null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.data)||void 0===a?void 0:a.abtInfo)||{};case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},ABTest}(),Ff=TypeError,jf=Object.getOwnPropertyDescriptor,Uf=M&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,a){if(ei(t)&&!jf(t,"length").writable)throw Ff("Cannot set read only .length");return t.length=a}:function(t,a){return t.length=a},Bf=TypeError,deletePropertyOrThrow=function(t,a){if(!delete t[a])throw Bf("Cannot delete property "+tryToString(a)+" of "+tryToString(t))},Hf=arrayMethodHasSpeciesSupport("splice"),Gf=Math.max,Kf=Math.min;_export({target:"Array",proto:!0,forced:!Hf},{splice:function splice(t,a){var c,h,m,g,_,E,b=toObject(this),O=lengthOfArrayLike(b),T=toAbsoluteIndex(t,O),S=arguments.length;for(0===S?c=h=0:1===S?(c=0,h=O-T):(c=S-2,h=Kf(Gf(toIntegerOrInfinity(a),0),O-T)),doesNotExceedSafeInteger(O+c-h),m=arraySpeciesCreate(b,h),g=0;g<h;g++)(_=T+g)in b&&createProperty(m,g,b[_]);if(m.length=h,c<h){for(g=T;g<O-h;g++)E=g+c,(_=g+h)in b?b[E]=b[_]:deletePropertyOrThrow(b,E);for(g=O;g>O-h+c;g--)deletePropertyOrThrow(b,g-1)}else if(c>h)for(g=O-h;g>T;g--)E=g+c-1,(_=g+h-1)in b?b[E]=b[_]:deletePropertyOrThrow(b,E);for(g=0;g<c;g++)b[g+T]=arguments[g+2];return Uf(b,O-h+c),m}});var qf=entryVirtual("Array").splice,Wf=Array.prototype,splice=function(t){var a=t.splice;return t===Wf||K(Wf,t)&&a===Wf.splice?qf:a};function _createForOfIteratorHelperLoose$1(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray$1(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$1(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$1(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var zf=function(){function TimerManager(){this.timerList=[],this.id=1,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,a,c){void 0===a&&(a=0),void 0===c&&(c=1);var h=(new Date).getTime(),m=this.id;return this.timerList.push({id:m,loop:c,count:0,timeout:h+a,interval:a,callback:t}),this.id++,this.checkTimer(h),m},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var a,c,h=0,m=_createForOfIteratorHelperLoose$1(this.timerList);!(a=m()).done;){var g=a.value;(0===h||h>g.timeout)&&(h=g.timeout)}if(0!==this.timerList.length)if(null===this.timer||h<this.timeout||this.timeout<t)this.timer=mi(bind$1(c=this.nowTime).call(c,this),h-t),this.timeout=h}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),a=_createForOfIteratorHelperLoose$1(this.timerList);!(t=a()).done;){var c=t.value;nowTime>=c.timeout&&(c.callback(),c.count++,c.timeout=nowTime+c.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var a=this.timerList.length-1;a>=0;a--){var c;if(this.timerList[a].id===t)splice(c=this.timerList).call(c,a,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var a,c=this.timerList[t];if(c.loop>=0&&c.count>=c.loop)splice(a=this.timerList).call(a,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=1,this.timer=null},TimerManager}(),$f=function(){function Service(t,a){this.name=t,this.core=a,this.name=t,this.logger=a.logger,this.core=a}return Service.prototype.process=function process(t){var a=this[t.cmd+"Handler"];if("function"==typeof a)return a.call(this,t);var c=nd(t,"error.detail.ignore");return t.error&&!c?Xn.reject(t.error):Xn.resolve(t)},Service}(),Yf=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),c=Math.floor(a*this.jitter*t);t=0==(1&Math.floor(10*a))?t-c:t+c}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var Xf=Oc(Xs,"Set");var Qf=function noop(){};var Jf=function setToArray(t){var a=-1,c=Array(t.size);return t.forEach((function(t){c[++a]=t})),c},Zf=Xf&&1/Jf(new Xf([,-0]))[1]==1/0?function(t){return new Xf(t)}:Qf,ep=Zf;var tp=function baseUniq(t,a,c){var h=-1,m=Tf,g=t.length,_=!0,E=[],b=E;if(c)_=!1,m=Sf;else if(g>=200){var O=a?null:ep(t);if(O)return Jf(O);_=!1,m=Cf,b=new yf}else b=a?[]:E;e:for(;++h<g;){var T=t[h],S=a?a(T):T;if(T=c||0!==T?T:0,_&&S==S){for(var C=b.length;C--;)if(b[C]===S)continue e;a&&b.push(S),E.push(T)}else m(b,S,c)||(b!==E&&b.push(S),E.push(T))}return E};var rp,op=function uniq(t){return t&&t.length?tp(t):[]},np=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],ip=["transport not supported","client not handshaken","unauthorized"],ap=["reconnect"],sp=function(t){function BaseWebsocket(a,c){var h;return(h=t.call(this)||this).url=c,h.websocket=null,h.socketConnectTimer=0,h.core=a,h.url=c,h.status="disconnected",h.logger=a.logger,h.connect(),h}St(BaseWebsocket,t);var a=BaseWebsocket.prototype;return a.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Zn(),{method:"GET",dataType:"text",timeout:this.core.options.xhrConnectTimeout||8e3},{exception_service:6}).then((function(a){if("connecting"===t.status){var c=a.data.split(":"),h=c[0];return c[1],t.sessionId=h,t.logger.log("imsocket::XHR success. status "+t.status+", "+("connecting"===t.status?"continue websocket connection":"stop websocket connection")),t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+h)}})).catch((function(a){if("connecting"===t.status){var c='imsocket::XHR fail. raw message: "'+(a=a||{}).message+'", code: "'+a.code+'"',h=a.code;h="v2"===nd(t.core,"options.apiVersion")?a.code===Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT?Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT:Bs.V2NIM_ERROR_CODE_CONNECT_FAILED:408===a.code?408:415;var m=new Gs({code:h,detail:{reason:c,rawError:a}});t.logger.error(c),t.status="disconnected",t.emit("handshakeFailed",m)}}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},a.close=function close(){if(this.status="disconnected",this.websocket){this.logger.log("imsocket:: close websocket");try{this.websocket.send(this.encodePacket({type:"disconnect"}))}catch(t){this.logger.warn("imsocket::attempt to send encodePacket error",t)}try{this.websocket.close()}catch(t){this.logger.warn("imsocket::attempt to close websocket error",t)}this.clean(),this.emit("disconnect",{code:0,reason:"Active close websocket"})}},a.clean=function clean(){this.status="disconnected",this.websocket&&(this.socketUrl=void 0,this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null,this.websocket.onclose=null,this.websocket=null)},a.onConnect=function onConnect(){this.status="connected",this.emit("connect"),clearTimeout(this.socketConnectTimer)},a._createWebsocket=function _createWebsocket(t){var a,c=this;this.socketConnectTimer=mi((function(){c.logger.error("imsocket::Websocket connect timeout. url: ",c.socketUrl),c.emit("handshakeFailed",new Gs({code:"v2"===nd(c.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT:415,detail:{reason:"imsocket::Websocket connect timeout. url: "+c.socketUrl}}))}),this.core.options.socketConnectTimeout||8e3),this.socketUrl=t,this.websocket=new Qd.WebSocket(t),this.websocket.onmessage=bind$1(a=this.onMessage).call(a,this),this.websocket.onclose=function(t){var a=(null==t?void 0:t.reason)||(null==t?void 0:t.message)||(null==t?void 0:t.errMsg)||"websocket.onclose";c.logger.log("imsocket::Websocket onclose done. code is "+(null==t?void 0:t.code)+" and reason is "+a),c.clean(),c.emit("disconnect",{code:(null==t?void 0:t.code)||0,reason:a})},this.websocket.onerror=function(t){c.logger.error("imsocket::Websocket onerror",t),"logined"===c.core.status&&c.core.clientSocket.ping()}},a.onMessage=function onMessage(t){var a,c=this.decodePacket(t.data);if(c)switch(c.type){case"connect":this.onConnect();break;case"disconnect":this.close(),this.emit("disconnect",{code:0,reason:"MessageEvent type disconnect"});break;case"message":case"json":this.emit("message",c.data);break;case"event":c.name&&this.emit(c.name,c.args);break;case"error":"unauthorized"===c.reason?this.emit("connect_failed",c.reason):this.emit("error",c.reason),this.logger.error("imsocket::Websocket connect failed, onmessage type error. url: ",this.socketUrl),clearTimeout(this.socketConnectTimer),this.emit("handshakeFailed",new Gs({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CONNECT_FAILED:408,detail:{reason:"imsocket::Websocket connect failed, onMessage socket error. url: "+this.socketUrl}}));break;case"heartbeat":null===(a=this.websocket)||void 0===a||a.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::Websocket no handler type",c.type)}},a.encodePacket=function encodePacket(t){var a,c,h=t.type,m=t.id,g=void 0===m?"":m,_=t.endpoint,E=void 0===_?"":_,b=t.ack,O=null;if(!h)return"";switch(h){case"error":a=t.reason?indexOf(ip).call(ip,t.reason):"",c=t.advice?indexOf(ap).call(ap,t.advice):"",""===a&&""===c||(O=a+(""!==c?"+"+c:""));break;case"message":""!==t.data&&(O=t.data);break;case"event":a={name:t.name},a=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},O=Fs(a);break;case"json":O=Fs(t.data);break;case"connect":t.qs&&(O=t.qs);break;case"ack":O=t.ackId+(t.args&&t.args.length?"+"+Fs(t.args):"")}var T=[indexOf(np).call(np,h),g+("data"===b?"+":""),E];return null!=O&&T.push(O),T.join(":")},a.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var a=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(a){var c,h=a[1],m=a[2],g=a[3],_=a[4],E=a[5],b={type:np[+h],endpoint:_};switch(m&&(b.id=m,b.ack=!g||"data"),b.type){case"error":c=E.split("+"),b.reason=ip[+c[0]]||"";break;case"message":b.data=E||"";break;case"connect":b.qs=E||"";break;case"event":try{var O=JSON.parse(E);b.name=O.name,b.args=O.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}b.args=b.args||[];break;case"json":try{b.data=JSON.parse(E)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((c=E.match(/^([0-9]+)(\+)?(.*)/))&&(b.ackId=c[1],b.args=[],c[3]))try{b.args=c[3]?JSON.parse(c[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return b}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},a.send=function send(t){var a,c={data:t,type:"message",endpoint:""};null===(a=this.websocket)||void 0===a||a.send(this.encodePacket(c))},BaseWebsocket}(gi);function _createForOfIteratorHelperLoose(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(rp||(rp={}));var cp=function(){function V1ClientSocket(t,a){this.linkUrls=[],this.isAutoReconnect=!1,this.packetTimeout=3e4,this.packetSer=1,this.retryCount=0,this.reconnectTimer=0,this.backoff=new Yf({max:8e3,min:1600,jitter:.01}),this.sendingCmdMap=new is,this.pingTimer=0,this.hasNetworkListener=!1,this.core=t,a&&(this.auth=a),this.logger=t.logger,this.reporter=t.reporter,this.timerManager=t.timerManager}var t=V1ClientSocket.prototype;return t.setSessionId=function setSessionId(t){},t.connect=function connect(t,a){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var c,h,m,g,_,E;return hl.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.core.status)){b.next=5;break}return c="Core socket status is "+this.core.status+", and would not connect",this.logger.warn(c),b.abrupt("return",Xn.reject(c));case 5:this.core.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(h=t.linkUrls).call(h,this.linkUrls),this.linkUrls=op(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),m=0;case 9:if(!(m<this.linkUrls.length)){b.next=31;break}return g=this.linkUrls[m],_=(new Date).getTime(),b.prev=12,b.next=15,this.doConnect(g);case 15:return this.core.status="connected",this.logger.log("clientsocketV1::connect success with url: "+g),b.abrupt("return",g);case 20:b.prev=20,b.t0=b.catch(12),E=b.t0,a&&a(E,g),this.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account,start_time:_,action:0,exception_service:6}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof E.code?E.code:0,description:E.message||""+E.code,operation_type:0,target:g},{asyncParams:Qd.net.getNetworkStatus()}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("clientsocketV1::connect failed with url: "+g,b.t0);case 28:m++,b.next=9;break;case 31:throw 0===this.retryCount?this.doDisconnect(rp.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(rp.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("clientSocketV1::socket xhr or socket connect failed");case 33:case"end":return b.stop()}}),_callee,this,[[12,20]])})))},t.doConnect=function doConnect(t){var a=this,c=!1;return new Xn((function(h,m){var g;a.socket=new sp(a.core,t),a.socket.on("connect",(function(){a.logger.log("clientSocketV1::on connect",t),a.core.reporterHookLinkKeep&&(a.core.reporterHookLinkKeep.start(),a.core.reporterHookLinkKeep.update({code:0,description:"",operation_type:0,target:t})),c=!0,h()})),a.socket.on("message",bind$1(g=a.onMessage).call(g,a)),a.socket.on("disconnect",(function(h){return __awaiter(a,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(this.logger.log("clientSocketV1::socket on disconnect",h),!this.core.reporterHookLinkKeep){a.next=5;break}return a.next=4,this.core.reporterHookLinkKeep.update({code:(null==h?void 0:h.code)||0,description:(null==h?void 0:h.reason)||"",operation_type:1,target:t});case 4:this.core.reporterHookLinkKeep.end(!1);case 5:c=!0,this.doDisconnect(rp.OFFLINE,"SocketOnDisconnect");case 7:case"end":return a.stop()}}),_callee2,this)})))})),a.socket.on("handshakeFailed",(function(t){c?a.ping():(a.logger.error('clientsocketV1::handshake failed: "'+(t&&t.message)+'"'),a.cleanSocket()),c=!0,m(t)}))}))},t.cleanSocket=function cleanSocket(){this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0)},t.beforeConnect=function beforeConnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer)},t.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},t.doDisconnect=function doDisconnect(t,a){var c,h;if(this.logger.log("doDisconnect: type "+t+", description "+a),"unconnected"!==this.core.status){var m={1:"close",2:"kicked",3:"broken"}[t]||"";this.markAllCmdInvaild(new Gs({code:415,desc:"Packet timeout due to instance disconnect",detail:{reason:"Packet timeout due to instance disconnect",disconnect_reason:m}})),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.cleanSocket();var g=!this.core.options.needReconnect||this.retryCount>=this.core.options.reconnectionAttempts;if(t===rp.ACTIVE||g)this.logger.log("doDisconnect: emit disconnect, type "+t,g),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),null===(c=this.auth)||void 0===c||c.emit("disconnect"),this.destroyOnlineListener();else if(t===rp.KICKED){this.logger.log("doDisconnect: kicked"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var _="string"==typeof a?{reason:"unknow",message:a}:a;this.core.eventBus.emit("kicked",_),this.core.emit("kicked",_),null===(h=this.auth)||void 0===h||h.emit("kicked",_),this.destroyOnlineListener()}else t===rp.OFFLINE&&this.core.V1NIMLoginService.isManualLoginAttempt?(this.logger.log("doDisconnect: offline in manual login phase. no reconnect"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.destroyOnlineListener()):t===rp.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},t.attempToReconnect=function attempToReconnect(){var t,a,c=this;if("waitReconnect"!==this.core.status){0===this.retryCount&&(this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),null===(t=this.auth)||void 0===t||t.emit("disconnect"));var h=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+h),this.core.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:h}),this.core.emit("willReconnect",{retryCount:this.retryCount,duration:h}),null===(a=this.auth)||void 0===a||a.emit("willReconnect",{retryCount:this.retryCount,duration:h}),this.core.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=mi((function(){return __awaiter(c,void 0,void 0,hl.mark((function _callee3(){var t=this;return hl.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if("waitReconnect"===this.core.status){a.next=3;break}return this.logger.warn("doDisconnect: reconnectTimer status is "+this.core.status+", would not go on reconnecting"),a.abrupt("return");case 3:return a.next=5,Qd.net.getNetworkStatus();case 5:!1===a.sent.net_connect?(this.logger.log("doDisconnect: skip this reconnection attempt because network is offline"),this.core.status="connecting",this.retryCount>=this.core.options.reconnectionAttempts?this.doDisconnect(rp.OFFLINE,"MaxReconnectionAttemptExceed"):this.attempToReconnect()):this.core.V1NIMLoginService.login({isAutoReconnect:!0}).catch((function(){t.logger.error("clientsocketV1::attempToReconnect failed "+t.retryCount)}));case 7:case"end":return a.stop()}}),_callee3,this)})))}),h)}else this.logger.warn("doDisconnect: already is waiting reconnect")},t.sendCmd=function sendCmd(t,a,c){var h=this;if("logined"!==this.core.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("instance status is "+this.core.status+", so can not sendCmd "+t),Xn.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return Xn.reject("No_socket");var m="heartbeat"!==t,g=m?this.packetSer++:0,_=function createCmd(t,a,c,h){var m=rf[t];if(!m)return c.error("createCmd:: can not find cmd config: ",t),null;var g,_={SER:a,SID:m.sid,CID:m.cid,Q:[]};return m.params&&h&&forEach$1(g=m.params).call(g,(function(t){var a=h[t.name];if(null!=a){var c=t.type,m=t.reflectMapper,g=t.select;switch(t.type){case"PropertyArray":c="ArrayMable",a=map$6(a).call(a,(function(t){return{t:"Property",v:m?serialize(t,m,g):t}}));break;case"Property":a=m?serialize(a,m,g):a;break;case"Bool":a=a?"true":"false"}_.Q.push({t:c,v:a})}})),{packet:_,hasPacketResponse:"boolean"!=typeof m.hasPacketResponse||m.hasPacketResponse,hasPacketTimer:"boolean"!=typeof m.hasPacketTimer||m.hasPacketTimer}}(t,g,this.logger,a);if(!_){var E="SendCmd "+g+" "+t+" error";return this.logger.error(E),Xn.reject(new Error(E))}var b=_.packet,O=_.hasPacketResponse,T=_.hasPacketTimer,S=Fs(b);m&&("debug"===this.core.options.debugLevel?this.logger.debug("clientsocketV1::sendCmd",t,"ser:"+g,S):this.logger.log("clientsocketV1::sendCmd",t,"ser:"+g));var C=(new Date).getTime();return new Xn((function(m,_){O&&h.sendingCmdMap.set(g,{cmd:t,params:a,callback:[m,_],timer:T?mi((function(){var a=new Gs({code:408,desc:"Packet Timeout",detail:{reason:"Packet Timeout",cmd:t,ser:g,timetag:Zn()}});h.markCmdInvalid(g,a,t)}),c&&c.timeout?c.timeout:h.core.config.timeout):null});try{h.socket.send(S),O||m(b)}catch(a){var E=new Gs({code:415,detail:{reason:a&&a.message||"Unable to send packet",cmd:t,ser:g,timetag:Zn(),rawError:a}});h.markCmdInvalid(g,E,t),_(a)}})).catch((function(t){var a,c=[408,415];if(!includes(c).call(c,t.code))return Xn.reject(t);h.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(a=h.socket)||void 0===a?void 0:a.sessionId,start_time:C,action:2,exception_service:6});var m=nd(t,"data.disconnect_reason")||"",g=408===t.code?"Send failed due to timeout":"Send failed. Reason unknown";return g=415===t.code?Fs({disconnect_reason:m}):g,h.reporter.reportTraceUpdateV2("exceptions",{code:t.code||415,description:g,operation_type:1,target:b.SID+"-"+b.CID,context:""+b.SER},{asyncParams:Qd.net.getNetworkStatus()}),h.reporter.reportTraceEnd("exceptions",1),Xn.reject(t)}))},t.onMessage=function onMessage(t){var a=function parseCmd(t,a){var c,h;try{h=JSON.parse(t)}catch(c){return void a.error('Parse command error:"'+t+'"')}var m=h.sid+"_"+h.cid,g=h.r;if(includes(c=["4_1","4_2","4_10","4_11"]).call(c,m)){var _=h.r[1].headerPacket;m=_.sid+"_"+_.cid,h.sid=_.sid,h.cid=_.cid,g=h.r[1].body}var E=nf[m],b=[];if(E){for(var O,T=_createForOfIteratorHelperLoose$2(E);!(O=T()).done;){var S=O.value;b.push(parseEachCmd(h,S.config,S.cmd,g,a))}return b}a.error("parseCmd:: mapper not exist",m,h.code)}(t,this.logger);if(a)for(var c,h=_createForOfIteratorHelperLoose(a);!(c=h()).done;){var m=c.value,g=m.raw.ser;if(m.error&&this.logger.error("core:onMessage packet error",m.raw.sid+"_"+m.raw.cid+", ser:"+g+",",m.error),m.notFound)return void this.logger.warn("clientsocketV1::onMessage packet not found",m.raw.sid+"_"+m.raw.cid+", ser:"+g);"heartbeat"!==m.cmd&&("debug"===this.core.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+g,m.cmd,m.content):this.logger.log("imsocket::recvCmd ser:"+g,m.cmd)),this.packetHandler(m)}},t.packetHandler=function packetHandler(t){var a,c;if(t){var h=t.raw.ser,m=this.sendingCmdMap.get(h);if(m&&m.cmd===t.cmd){var g=m.callback,_=m.timer,E=m.params;if(clearTimeout(_),t.params=E,this.sendingCmdMap.delete(h),"heartbeat"===t.cmd)return void g[0]();var b=null===(a=this.core[t.service])||void 0===a?void 0:a.process(t);b&&"function"==typeof b.then?b.then((function(t){g[0](t)})).catch((function(t){g[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",t.service,t.cmd),g[0]())}else null===(c=this.core[t.service])||void 0===c||c.process(t)}},t.markCmdInvalid=function markCmdInvalid(t,a,c){var h=this.sendingCmdMap.get(t);if(h){var m=h.callback,g=h.timer;g&&clearTimeout(g),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+c+" is invalid:",a),m[1](a)}},t.markAllCmdInvaild=function markAllCmdInvaild(t){var a,c=this;this.logger.log("markAllCmdInvaild",t),forEach$1(a=this.sendingCmdMap).call(a,(function(a){var h=a.callback,m=a.timer,g=a.cmd;c.logger.debug('markAllCmdInvaild:: cmd "'+g+'"'),m&&clearTimeout(m),h[1](t)})),this.sendingCmdMap.clear()},t.ping=function ping(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a=this;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:return clearTimeout(this.pingTimer),c.prev=1,c.next=4,this.sendCmd("heartbeat");case 4:c.next=18;break;case 6:return c.prev=6,c.t0=c.catch(1),c.next=10,this.testHeartBeat5Timeout();case 10:if(!c.sent){c.next=18;break}if(!this.core.reporterHookLinkKeep){c.next=16;break}return c.next=15,this.core.reporterHookLinkKeep.update({code:0,description:"Heartbeat-discovered link failure",operation_type:1,target:null===(t=this.socket)||void 0===t?void 0:t.url});case 15:this.core.reporterHookLinkKeep.end(!0);case 16:return this.doDisconnect(rp.OFFLINE,"PingError"),c.abrupt("return");case 18:this.pingTimer=mi((function(){a.ping()}),3e4);case 19:case"end":return c.stop()}}),_callee4,this,[[1,6]])})))},t.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var t;return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){a.next=15;break}return a.prev=3,a.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return a.abrupt("return",!1);case 9:a.prev=9,a.t0=a.catch(3),this.logger.debug("clientsocketV1:: test heartbeat "+t+" Timeout");case 12:t++,a.next=2;break;case 15:return a.abrupt("return",!0);case 16:case"end":return a.stop()}}),_callee5,this,[[3,9]])})))},t.initOnlineListener=function initOnlineListener(){var t=this;this.hasNetworkListener||(this.logger.log("clientsocketV1::onlineListener:init"),this.hasNetworkListener=!0,Qd.net.onNetworkStatusChange((function(a){t.logger.log("clientsocketV1::onlineListener:network change",a),a.isConnected&&"logined"===t.core.status?t.ping():a.isConnected&&"waitReconnect"===t.core.status?(t.reconnectTimer&&clearTimeout(t.reconnectTimer),t.core.V1NIMLoginService.login({isAutoReconnect:!0}).catch((function(){t.logger.error("clientsocketV1::attempToReconnect failed "+t.retryCount)}))):a.isConnected||t.doDisconnect(rp.OFFLINE,"OfflineListener")})))},t.destroyOnlineListener=function destroyOnlineListener(){this.logger.log("clientsocketV1::onlineListener:destroy"),Qd.net.offNetworkStatusChange(),this.hasNetworkListener=!1},t.disconnect=function disconnect(){switch(this.core.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(rp.ACTIVE,"UserActiveDisconnect"),Xn.resolve();default:return Xn.resolve()}},V1ClientSocket}();var up=function baseForOwn(t,a){return t&&fd(t,a,gu)};var lp=function baseInverter(t,a,c,h){return up(t,(function(t,m,g){a(h,c(t),m,g)})),h};var dp,fp,pp=function createInverter(t,a){return function(c,h){return lp(c,t,a(h),{})}},hp=Object.prototype.toString,mp=pp((function(t,a,c){null!=a&&"function"!=typeof a.toString&&(a=hp.call(a)),t[a]=c}),Ac(kc));function formatChatroom(t){var a=wt({},t),c=["announcement","broadcastUrl","ext"],h=["createTime","updateTime","onlineMemberNum"],m=["mute"];return forEach$1(c).call(c,(function(t){void 0===a[t]&&(a[t]="")})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=pa(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===pa(a[t]))})),a}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac",t[t.HarmonyOS=65]="HarmonyOS"}(dp||(dp={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(fp||(fp={}));var gp=mp({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var a,c=wt({},t),h=["chatroomId"],m=["level","enterTime","updateTime","tempMuteDuration"],g=["online","guest","blacked","muted","valid","tempMuted"],_={tempMuted:!1,tempMuteDuration:0};return forEach$1(a=Fi(_)).call(a,(function(t){c[t]=c[t]||_[t]})),forEach$1(h).call(h,(function(t){void 0!==c[t]&&(c[t]=c[t].toString())})),forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),forEach$1(g).call(g,(function(t){void 0!==c[t]&&(c[t]=1===pa(c[t]))})),void 0!==c.type&&(c.type=gp[c.type]),c.avatar,c.online||delete c.enterTime,c.guest&&(c.type="guest",delete c.valid,delete c.guest),"common"!==c.type&&delete c.level,c}function formatChatroomMembers(t){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,a,c){t.onSendBefore;var h=__rest(t,["onSendBefore"]),m=["subType"],g=["body","antiSpamContent","antiSpamBusinessId","ext"],_=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(h.idClient=Eu()),h.type=fp[t.type],h.from=a,h.fromClientType=16,h.fromDeviceId=c,h.status=h.status||"sending",forEach$1(_).call(_,(function(a){void 0!==t[a]&&(h[a]=t[a]?1:0)})),forEach$1(m).call(m,(function(a){void 0!==t[a]&&(h[a]=pa(t[a]))})),forEach$1(g).call(g,(function(a){void 0!==t[a]&&(h[a]="string"==typeof t[a]?t[a]:Fs(t[a]))})),h}var vp={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,a){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var c=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),h=["time","userUpdateTime"],m=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(h).call(h,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=1===pa(c[t]))})),c.type=getEnumKeyByEnumValue(fp,c.type),c.fromClientType=getEnumKeyByEnumValue(dp,c.fromClientType),c.flow=c.from===a?"out":"in",c.status=c.status||"success","string"==typeof c.body)try{c.body=JSON.parse(c.body)}catch(t){}return"notification"===c.type&&(c.attach=c.body?function formatNotificationBody(t){var a,c={};if(c.type=vp[t.id]||t.id,!t.data)return t;c=wt(c,t.data);var h={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(a=Fi(h)).call(a,(function(t){void 0!==c[t]&&(c[h[t]]=c[t],delete c[t])}));var m=["muteDuration"];if(forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),!c.queueChange)return c;var g={};try{g=JSON.parse(c.queueChange)}catch(t){return c}switch(g._e){case"OFFER":g={type:"OFFER",elementKey:g.key,elementValue:g.content};break;case"POLL":g={type:"POLL",elementKey:g.key,elementValue:g.content};break;case"DROP":g={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":g={type:g._e,elementKv:g.kvObject}}return c.queueChange=g,c}(c.body):{},c.body=""),c}function formatChatroomMsgs(t,a){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMsg(t,a)})):[]}var yp={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var _p=function(){function V1AuthAuthenticatorService(t){this.core=t}return V1AuthAuthenticatorService.prototype.verifyAuthentication=function verifyAuthentication(t){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h,m,g,_,E,b;return hl.wrap((function _callee$(O){for(;;)switch(O.prev=O.next){case 0:return c=this.core.options,h=Qd.getSystemInfo(),m=wt(wt({},c),{appLogin:t?0:1,deviceId:this.core.config.deviceId,clientSession:this.core.config.clientSession,clientType:16,protocolVersion:1,sdkVersion:100203,sdkHumanVersion:"10.2.3",os:h.os,browser:h.browser,userAgent:this.core.options.loginSDKTypeParamCompat?"Native/10.2.3":slice(a=h.userAgent).call(a,0,299),libEnv:this.core.options.loginSDKTypeParamCompat?void 0:h.libEnv,hostEnv:this.core.options.loginSDKTypeParamCompat?0:h.hostEnvEnum}),g=wt(wt({},c),{appkey:c.appkey,account:c.account,deviceId:this.core.config.deviceId,clientSession:this.core.config.clientSession,appLogin:1}),c.isAnonymous&&(g.isAnonymous=1,g.account=g.account||"nimanon_"+Eu(),m.account=g.account,g.chatroomNick=g.account||"nimanon_"+Eu(),g.chatroomAvatar=g.chatroomAvatar||" "),c.tags&&c.tags.length>0&&(g.tags=Fs(c.tags)),O.next=8,this.core.clientSocket.sendCmd("chatroomLogin",{type:1,chatroomLogin:g,chatroomIMLogin:m});case 8:return _=O.sent,this.core.status="logined",E=formatChatroom(_.content.chatroom),b=formatChatroomMember(_.content.chatroomMember),O.abrupt("return",{chatroom:E,member:b});case 13:case"end":return O.stop()}}),_callee,this)})))},V1AuthAuthenticatorService}(),Ep=function(t){function ChatroomAuthService(a){var c;return(c=t.call(this,"chatroomAuth",a)||this).account="",c.token="",c.deviceId="",c.isManualLoginAttempt=!1,c.authenticatorService=new _p(a),c}St(ChatroomAuthService,t);var a=ChatroomAuthService.prototype;return a.login=function login(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c;return hl.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:return t.isAutoReconnect||(this.isManualLoginAttempt=!0),a=Zn(),h.next=4,this._connect(t);case 4:return c=h.sent,this.core.abtest.abtRequest(),h.prev=6,h.next=9,this.doLogin(t.isAutoReconnect,c,a);case 9:this.isManualLoginAttempt=!1,h.next=16;break;case 12:throw h.prev=12,h.t0=h.catch(6),this.isManualLoginAttempt=!1,h.t0;case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},a._connect=function _connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h;return hl.wrap((function _callee2$(m){for(;;)switch(m.prev=m.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.core.status)){m.next=4;break}return a="Chatroom status is "+this.core.status+", and would not connect",this.logger.warn(a),m.abrupt("return",Xn.reject(a));case 4:return this.core.clientSocket.beforeConnect(),c=t.isAutoReconnect||!1,m.next=8,this.core.clientSocket.connect({linkUrls:this.core.options.chatroomAddresses,isAutoReconnect:c});case 8:return h=m.sent,m.abrupt("return",h);case 10:case"end":return m.stop()}}),_callee2,this)})))},a.doLogin=function doLogin(t,a,c){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,hl.mark((function _callee3(){var h,m,g,_,E,b,O;return hl.wrap((function _callee3$(T){for(;;)switch(T.prev=T.next){case 0:return T.prev=0,T.next=3,this.authenticatorService.verifyAuthentication(t);case 3:return h=T.sent,T.next=6,Qd.net.getNetworkStatus();case 6:m=T.sent,g=m.net_connect,this.core.status="logined",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zn()-c,result:200,failReason:"",time:Zn(),net_connect:g}),T.next=26;break;case 12:return T.prev=12,T.t0=T.catch(0),this.logger.error("chatroom login error",T.t0),_=nd(T.t0,"error.code")||nd(T.t0,"code")||408,E=nd(T.t0,"error.message")||nd(T.t0,"message")||"login failed",T.next=19,Qd.net.getNetworkStatus();case 19:if(b=T.sent,O=b.net_connect,this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zn()-c,result:_,failReason:E,time:Zn(),net_connect:O}),this.core.clientSocket.doDisconnect(rp.OFFLINE,this.isManualLoginAttempt?"FailedToInitializeLogin":"ReconnectLoginFailed"),!this.isManualLoginAttempt){T.next=25;break}throw T.t0;case 25:return T.abrupt("return");case 26:return T.prev=26,T.next=29,this.core.cloudStorage.init();case 29:T.next=34;break;case 31:T.prev=31,T.t1=T.catch(26),this.logger.error("NIM:login cloudStorage init failed ",T.t1);case 34:this.core.eventBus.emit("logined",h),this.core.emit("logined",h),this.core.clientSocket.resetConnectStatus(),this.core.clientSocket.ping(),this.core.timeOrigin.setOriginTimetick();case 39:case"end":return T.stop()}}),_callee3,this,[[0,12],[26,31]])})))},a.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var a=t.content,c=a.reason,h=a.ext,m=function formatKickedReason(t){var a=yp[t];return{reason:a?a.code:"unknow",message:a?a.message:"Unknown reason"}}(c);this.logger.warn("beKickedFromChatroomHandler:: ",m.reason,m.message,h),this.core.clientSocket.doDisconnect(rp.KICKED,m)},ChatroomAuthService}($f),bp=function(t){function ChatroomService(a){return t.call(this,"chatroom",a)||this}St(ChatroomService,t);var a=ChatroomService.prototype;return a.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a;return hl.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.core.sendCmd("getChatroom");case 2:return a=c.sent,c.abrupt("return",formatChatroom(null===(t=a.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return c.stop()}}),_callee,this)})))},a.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("updateChatroom",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.updateChatroomTagHandler=function updateChatroomTagHandler(t){var a,c=t.content;this.logger.log("updateChatroomTagHandler:: ",c);var h=null===(a=null==c?void 0:c.updateTags)||void 0===a?void 0:a.currentTags;try{h=JSON.parse(h)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",h)},ChatroomService}($f),Op=getDefaultExportFromCjs(createCommonjsModule((function(t){function _defineProperties(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}t.exports=function _createClass(t,a,c){return a&&_defineProperties(t.prototype,a),c&&_defineProperties(t,c),_i(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports})));var Tp=function arraySome(t,a){for(var c=-1,h=null==t?0:t.length;++c<h;)if(a(t[c],c,t))return!0;return!1};var Sp=function equalArrays(t,a,c,h,m,g){var _=1&c,E=t.length,b=a.length;if(E!=b&&!(_&&b>E))return!1;var O=g.get(t),T=g.get(a);if(O&&T)return O==a&&T==t;var S=-1,C=!0,I=2&c?new yf:void 0;for(g.set(t,a),g.set(a,t);++S<E;){var R=t[S],M=a[S];if(h)var k=_?h(M,R,S,a,t,g):h(R,M,S,t,a,g);if(void 0!==k){if(k)continue;C=!1;break}if(I){if(!Tp(a,(function(t,a){if(!Cf(I,a)&&(R===t||m(R,t,c,h,g)))return I.push(a)}))){C=!1;break}}else if(R!==M&&!m(R,M,c,h,g)){C=!1;break}}return g.delete(t),g.delete(a),C};var Cp=function mapToArray(t){var a=-1,c=Array(t.size);return t.forEach((function(t,h){c[++a]=[h,t]})),c},Ip=Qs?Qs.prototype:void 0,Rp=Ip?Ip.valueOf:void 0;var Mp=function equalByTag(t,a,c,h,m,g,_){switch(c){case"[object DataView]":if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=a.byteLength||!g(new hd(t),new hd(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Cc(+t,+a);case"[object Error]":return t.name==a.name&&t.message==a.message;case"[object RegExp]":case"[object String]":return t==a+"";case"[object Map]":var E=Cp;case"[object Set]":var b=1&h;if(E||(E=Jf),t.size!=a.size&&!b)return!1;var O=_.get(t);if(O)return O==a;h|=2,_.set(t,a);var T=Sp(E(t),E(a),h,m,g,_);return _.delete(t),T;case"[object Symbol]":if(Rp)return Rp.call(t)==Rp.call(a)}return!1};var kp=function arrayPush(t,a){for(var c=-1,h=a.length,m=t.length;++c<h;)t[m+c]=a[c];return t};var wp=function baseGetAllKeys(t,a,c){var h=a(t);return Zc(t)?h:kp(h,c(t))};var Np=function arrayFilter(t,a){for(var c=-1,h=null==t?0:t.length,m=0,g=[];++c<h;){var _=t[c];a(_,c,t)&&(g[m++]=_)}return g};var xp=function stubArray(){return[]},Ap=Object.prototype.propertyIsEnumerable,Pp=Object.getOwnPropertySymbols,Lp=Pp?function(t){return null==t?[]:(t=Object(t),Np(Pp(t),(function(a){return Ap.call(t,a)})))}:xp,Dp=Lp;var Vp=function getAllKeys(t){return wp(t,gu,Dp)},Fp=Object.prototype.hasOwnProperty;var jp=function equalObjects(t,a,c,h,m,g){var _=1&c,E=Vp(t),b=E.length;if(b!=Vp(a).length&&!_)return!1;for(var O=b;O--;){var T=E[O];if(!(_?T in a:Fp.call(a,T)))return!1}var S=g.get(t),C=g.get(a);if(S&&C)return S==a&&C==t;var I=!0;g.set(t,a),g.set(a,t);for(var R=_;++O<b;){var M=t[T=E[O]],k=a[T];if(h)var w=_?h(k,M,T,a,t,g):h(M,k,T,t,a,g);if(!(void 0===w?M===k||m(M,k,c,h,g):w)){I=!1;break}R||(R="constructor"==T)}if(I&&!R){var N=t.constructor,x=a.constructor;N==x||!("constructor"in t)||!("constructor"in a)||"function"==typeof N&&N instanceof N&&"function"==typeof x&&x instanceof x||(I=!1)}return g.delete(t),g.delete(a),I},Up=Oc(Xs,"DataView"),Bp=Oc(Xs,"Promise"),Hp=Oc(Xs,"WeakMap"),Gp="[object Map]",Kp="[object Promise]",qp="[object Set]",Wp="[object WeakMap]",zp="[object DataView]",$p=pc(Up),Yp=pc(Dl),Xp=pc(Bp),Qp=pc(Xf),Jp=pc(Hp),Zp=ac;(Up&&Zp(new Up(new ArrayBuffer(1)))!=zp||Dl&&Zp(new Dl)!=Gp||Bp&&Zp(Bp.resolve())!=Kp||Xf&&Zp(new Xf)!=qp||Hp&&Zp(new Hp)!=Wp)&&(Zp=function(t){var a=ac(t),c="[object Object]"==a?t.constructor:void 0,h=c?pc(c):"";if(h)switch(h){case $p:return zp;case Yp:return Gp;case Xp:return Kp;case Qp:return qp;case Jp:return Wp}return a});var eh=Zp,th="[object Arguments]",rh="[object Array]",oh="[object Object]",nh=Object.prototype.hasOwnProperty;var ih=function baseIsEqualDeep(t,a,c,h,m,g){var _=Zc(t),E=Zc(a),b=_?rh:eh(t),O=E?rh:eh(a),T=(b=b==th?oh:b)==oh,S=(O=O==th?oh:O)==oh,C=b==O;if(C&&tu(t)){if(!tu(a))return!1;_=!0,T=!1}if(C&&!T)return g||(g=new ld),_||su(t)?Sp(t,a,c,h,m,g):Mp(t,a,b,c,h,m,g);if(!(1&c)){var I=T&&nh.call(t,"__wrapped__"),R=S&&nh.call(a,"__wrapped__");if(I||R){var M=I?t.value():t,k=R?a.value():a;return g||(g=new ld),m(M,k,c,h,g)}}return!!C&&(g||(g=new ld),jp(t,a,c,h,m,g))};var ah=function baseIsEqual(t,a,c,h,m){return t===a||(null==t||null==a||!Wc(t)&&!Wc(a)?t!=t&&a!=a:ih(t,a,c,h,baseIsEqual,m))};var sh=function baseIsMatch(t,a,c,h){var m=c.length,g=m,_=!h;if(null==t)return!g;for(t=Object(t);m--;){var E=c[m];if(_&&E[2]?E[1]!==t[E[0]]:!(E[0]in t))return!1}for(;++m<g;){var b=(E=c[m])[0],O=t[b],T=E[1];if(_&&E[2]){if(void 0===O&&!(b in t))return!1}else{var S=new ld;if(h)var C=h(O,T,b,t,a,S);if(!(void 0===C?ah(T,O,3,h,S):C))return!1}}return!0};var ch=function isStrictComparable(t){return t==t&&!sc(t)};var uh=function getMatchData(t){for(var a=gu(t),c=a.length;c--;){var h=a[c],m=t[h];a[c]=[h,m,ch(m)]}return a};var lh=function matchesStrictComparable(t,a){return function(c){return null!=c&&(c[t]===a&&(void 0!==a||t in Object(c)))}};var dh=function baseMatches(t){var a=uh(t);return 1==a.length&&a[0][2]?lh(a[0][0],a[0][1]):function(c){return c===t||sh(c,t,a)}};var fh=function baseHasIn(t,a){return null!=t&&a in Object(t)};var ph=function hasPath(t,a,c){for(var h=-1,m=(a=td(a,t)).length,g=!1;++h<m;){var _=rd(a[h]);if(!(g=null!=t&&c(t,_)))break;t=t[_]}return g||++h!=m?g:!!(m=null==t?0:t.length)&&jc(m)&&Hc(_,m)&&(Zc(t)||Jc(t))};var hh=function hasIn(t,a){return null!=t&&ph(t,a,fh)};var mh=function baseMatchesProperty(t,a){return yl(t)&&ch(a)?lh(rd(t),a):function(c){var h=nd(c,t);return void 0===h&&h===a?hh(c,t):ah(a,h,3)}};var gh=function baseProperty(t){return function(a){return null==a?void 0:a[t]}};var vh=function basePropertyDeep(t){return function(a){return od(a,t)}};var yh=function property(t){return yl(t)?gh(rd(t)):vh(t)};var _h=function baseIteratee(t){return"function"==typeof t?t:null==t?kc:"object"==typeof t?Zc(t)?mh(t[0],t[1]):dh(t):yh(t)};var Eh=function baseSet(t,a,c,h){if(!sc(t))return t;for(var m=-1,g=(a=td(a,t)).length,_=g-1,E=t;null!=E&&++m<g;){var b=rd(a[m]),O=c;if("__proto__"===b||"constructor"===b||"prototype"===b)return t;if(m!=_){var T=E[b];void 0===(O=h?h(T,b,E):void 0)&&(O=sc(T)?T:Hc(a[m+1])?[]:{})}Rc(E,b,O),E=E[b]}return t};var bh=function basePickBy(t,a,c){for(var h=-1,m=a.length,g={};++h<m;){var _=a[h],E=od(t,_);c(E,_)&&Eh(g,td(_,t),E)}return g},Oh=Object.getOwnPropertySymbols?function(t){for(var a=[];t;)kp(a,Dp(t)),t=Ed(t);return a}:xp;var Th=function getAllKeysIn(t){return wp(t,Ad,Oh)};var Sh,Ch,Ih=function pickBy(t,a){if(null==t)return{};var c=Xl(Th(t),(function(t){return[t]}));return a=_h(a),bh(t,c,(function(t,c){return a(t,c[0])}))},Rh=function(){function NOS(t,a){this.nosCdnHostTimer=0,this.nosErrorCount=0,this.core=t,this.cloudStorage=a}var t=NOS.prototype;return t.reset=function reset(){this.nosErrorCount=0},t.getNosAccessToken=function getNosAccessToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("getNosAccessToken",{tag:t});case 2:return a=m.sent,c=nd(a,"content.nosAccessTokenTag.token"),h=t.url,m.abrupt("return",{token:c,url:-1!==indexOf(h).call(h,"?")?h+"&token="+c:h+"?token="+c});case 6:case"end":return m.stop()}}),_callee,this)})))},t.deleteNosAccessToken=function deleteNosAccessToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("deleteNosAccessToken",{tag:t});case 2:case"end":return a.stop()}}),_callee2,this)})))},t.nosUpload=function nosUpload(t,a){var c,h,m,g,_,E,b;return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var O,T,S,C,I,R,M,k,w,N,x,A,P,L,D,V,j,U,B;return hl.wrap((function _callee3$(H){for(;;)switch(H.prev=H.next){case 0:if(O=nd(this.core,"config.cdn.bucket"),T={tag:t.nosScenes||O||"nim",expireSec:t.nosSurvivalTime},S=this.core.adapters.getFileUploadInformation(t),!(!a&&!S)){H.next=17;break}return H.prev=5,H.next=8,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:T});case 8:C=H.sent,H.next=17;break;case 11:if(H.prev=11,H.t0=H.catch(5),this.core.logger.error("uploadFile:: getNosToken error",H.t0),!(H.t0 instanceof Gs)){H.next=16;break}throw H.t0;case 16:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"getNosToken error",rawError:H.t0,curProvider:1}});case 17:return I=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",S?null===(c=S.uploadInfo)||void 0===c?void 0:c.objectName:a?null==a?void 0:a.objectName:C.content.nosToken.objectName),R="",a&&a.shortUrl&&(R=a.shortUrl),(null===(m=null===(h=null==S?void 0:S.uploadInfo)||void 0===h?void 0:h.payload)||void 0===m?void 0:m.shortUrl)&&(R=S.uploadInfo.payload.shortUrl),M=R||I,H.prev=22,w=S?{token:null===(g=null==S?void 0:S.uploadInfo)||void 0===g?void 0:g.token,bucket:null===(_=null==S?void 0:S.uploadInfo)||void 0===_?void 0:_.bucketName,objectName:null===(E=null==S?void 0:S.uploadInfo)||void 0===E?void 0:E.objectName}:a||C.content.nosToken,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:w,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,platform:Qd.platform}),N="BROWSER"===Qd.platform?this.config.chunkUploadHost:this.config.commonUploadHost?this.config.commonUploadHost+"/"+(w&&w.bucket):"https://nos.netease.com/nim",this.core.reporterHookCloudStorage.update({remote_addr:N,operation_type:a?2:0}),H.next=29,this.core.adapters.uploadFile(wt(wt(wt({},t),{nosToken:w,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,maxSize:t.maxSize||this.config.chunkMaxSize}),R?{payload:{shortUrl:R}}:{}));case 29:k=H.sent,H.next=64;break;case 32:if(H.prev=32,H.t1=H.catch(22),this.core.logger.error("uploadFile::nos uploadFile error:",H.t1),x="v2"===nd(this.core,"options.apiVersion"),H.t1.code!==Bs.V2NIM_ERROR_CODE_CANCELLED&&10499!==H.t1.errCode){H.next=38;break}throw new Ws({code:x?Bs.V2NIM_ERROR_CODE_CANCELLED:400,detail:{reason:nd(H.t1,"message")||"Request abort",rawError:H.t1,curProvider:1}});case 38:if(!x||H.t1.errCode!==Bs.V2NIM_ERROR_CODE_FILE_OPEN_FAILED){H.next=40;break}throw new Gs({code:Bs.V2NIM_ERROR_CODE_FILE_OPEN_FAILED,detail:{reason:nd(H.t1,"message")||"Read file failed",rawError:H.t1,curProvider:1}});case 40:return H.next=42,Qd.net.getNetworkStatus();case 42:if(A=H.sent,!1!==A.net_connect){H.next=46;break}throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"No network",rawError:H.t1,curProvider:1}});case 46:if(!a){H.next=63;break}if(0!==this.nosErrorCount){H.next=59;break}H.prev=48,this.cloudStorage.mixStorage._addCircuitTimer(),H.next=55;break;case 52:throw H.prev=52,H.t2=H.catch(48),new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"All upload attempts failed",rawError:H.t2,curProvider:this.cloudStorage.mixStorage.curProvider,mixStorePolicy:this.cloudStorage.mixStorage.mixStorePolicy,file:t.file||t.filePath}});case 55:return this.nosErrorCount=nd(this.cloudStorage,"mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry"),H.abrupt("return",this.cloudStorage._uploadFile(t));case 59:return this.nosErrorCount--,H.abrupt("return",this.nosUpload(t,a));case 61:H.next=64;break;case 63:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"NOS attempts failed",rawError:H.t1,curProvider:1}});case 64:if(P=null==k?void 0:k.type,L=P&&indexOf(P).call(P,"/")>-1?slice(P).call(P,0,indexOf(P).call(P,"/")):"",(D={image:"imageInfo",video:"vinfo",audio:"vinfo"})[L]){H.next=69;break}return H.abrupt("return",wt({url:M},k));case 69:return H.prev=69,H.next=72,this.core.adapters.request(I+"?"+D[L],{method:"GET",dataType:"json",timeout:5e3},{exception_service:3});case 72:V=H.sent,H.next=79;break;case 75:return H.prev=75,H.t3=H.catch(69),this.core.logger.error("uploadFile:: fetch file info error",H.t3),H.abrupt("return",wt({url:M},k));case 79:if(!V){H.next=86;break}return j=V.data,U="imageInfo"===D[L]?j:null===(b=null==j?void 0:j.GetVideoInfo)||void 0===b?void 0:b.VideoInfo,B={url:M,name:k.name,size:k.size,ext:k.ext,w:U.Width,h:U.Height,orientation:U.Orientation,dur:U.Duration,audioCodec:U.AudioCodec,videoCodec:U.VideoCodec,container:U.Container},H.abrupt("return",Ih(B,(function(t,a){return void 0!==a})));case 86:return H.abrupt("return",wt({url:M},k));case 87:case"end":return H.stop()}}),_callee3,this,[[5,11],[22,32],[48,52],[69,75]])})))},t._getNosCdnHost=function _getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a,c,h,m=this;return hl.wrap((function _callee4$(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,this.core.sendCmd("getNosCdnHost");case 3:a=g.sent,g.next=10;break;case 6:return g.prev=6,g.t0=g.catch(0),this.core.logger.error("getNosCdnHost::error",g.t0),g.abrupt("return");case 10:if(a){g.next=12;break}return g.abrupt("return");case 12:c=null===(t=null==a?void 0:a.content)||void 0===t?void 0:t.nosConfigTag,0!==(h=pa(null==c?void 0:c.expire))&&c.cdnDomain?-1===h?(this.config.cdn.bucket=c.bucket,this.config.cdn.cdnDomain=c.cdnDomain,this.config.cdn.objectNamePrefix=c.objectNamePrefix):(this.config.cdn.bucket=c.bucket,this.config.cdn.cdnDomain=c.cdnDomain,this.config.cdn.objectNamePrefix=c.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){m._getNosCdnHost()}),1e3*h)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return g.stop()}}),_callee4,this,[[0,6]])})))},Op(NOS,[{key:"config",get:function get(){return this.cloudStorage.config}}]),NOS}(),Mh={"6_2":"getNosToken","6_22":"getOriginUrl","6_24":"getNosAccessToken","6_25":"deleteNosAccessToken","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},kh={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,nosSurvivalTime:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4},nosAccessTokenTag:{token:0,url:1,userAgent:2,ext:3}},wh={getNosToken:{sid:6,cid:2,service:"cloudStorage",params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:kh.nosToken}],response:[{type:"Property",name:"nosToken",reflectMapper:mp(kh.nosToken)}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:kh.nosSafeUrlTag}],response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:mp(kh.nosSafeUrlTag)}]},getNosCdnHost:{sid:6,cid:26,service:"cloudStorage",response:[{type:"Property",name:"nosConfigTag",reflectMapper:mp(kh.nosConfigTag)}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",params:[{type:"Property",name:"config"}],response:[{type:"Property",name:"grayConfigTag",reflectMapper:mp(kh.grayConfigTag)}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:mp(kh.mixStorePolicyTag)}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:kh.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:mp(kh.mixStoreTokenResTag)}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:kh.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:mp(kh.mixStoreAuthTokenResTag)}]},getNosAccessToken:{sid:6,cid:24,service:"cloudStorage",params:[{type:"Property",name:"tag",reflectMapper:kh.nosAccessTokenTag}],response:[{type:"Property",name:"tag",reflectMapper:mp(kh.nosAccessTokenTag)}]},deleteNosAccessToken:{sid:6,cid:25,service:"cloudStorage",params:[{type:"Property",name:"tag",reflectMapper:kh.nosAccessTokenTag}]}},Nh={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},xh={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Sh||(Sh={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(Ch||(Ch={}));var Ah={chunkUploadHost:"https://wanproxy-web.127.net",commonUploadHost:"https://nos.netease.com",chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0},Ph=function(){function MixStorage(t,a){this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Sh.nos,this.mixStoreErrorCount=10,this.circuitTimer=0,this.core=t,this.cloudStorage=a,this.logger=t.logger}var t=MixStorage.prototype;return t.reset=function reset(){this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Sh.nos,this.mixStoreErrorCount=10},t.getGrayscaleConfig=function getGrayscaleConfig(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:if(Qd.localStorage)try{Qd.localStorage.getItem&&Qd.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(Qd.localStorage.getItem(this.GRAYKEY))[t])}catch(t){Qd.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){m.next=17;break}return m.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(c=m.sent).content||!c.content.grayConfigTag){m.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(c.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(c.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){m.next=10;break}return m.abrupt("return");case 10:h=Qd.localStorage.getItem(this.GRAYKEY)?JSON.parse(Qd.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),h[t]=this.grayConfig,Qd.localStorage.setItem(this.GRAYKEY,Fs(h)),m.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",c.content);case 17:if(!(null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable)){m.next=20;break}return m.next=20,this._getMixStorePolicy(t);case 20:case"end":return m.stop()}}),_callee,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h,m,g,_,E;return hl.wrap((function _callee2$(b){for(;;)switch(b.prev=b.next){case 0:if(a=(new Date).getTime(),Qd.localStorage)try{this.mixStorePolicy=JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=pa(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>a&&(h=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-a,this.core.timerManager.addTimer(bind$1(c=this._getMixStorePolicy).call(c,this,t),h))}catch(a){Qd.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",a)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=a)){b.next=30;break}return b.prev=3,b.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.cloudStorage.aws.s3?[1,2]:[1]});case 6:g=b.sent,_=g.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(_.ttl),this.mixStorePolicy.providers=_.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=pa(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=_.nosPolicy?JSON.parse(_.nosPolicy):null,this.mixStorePolicy.s3Policy=_.s3Policy?JSON.parse(_.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(m=this._getMixStorePolicy).call(m,this,t),1e3*this.mixStorePolicy.ttl),E=Qd.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),E[t]=this.mixStorePolicy,Qd.localStorage.setItem(this.MIXSTOREKEY,Fs(E)),b.next=30;break;case 23:if(b.prev=23,b.t0=b.catch(3),this.logger.error("getMixStorePolicy error",b.t0),0!==this.mixStoreErrorCount){b.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.cloudStorage.nos.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return b.stop()}}),_callee2,this,[[3,23]])})))},t._addCircuitTimer=function _addCircuitTimer(){var t=this,a=this.mixStorePolicy.providers,c=a[(indexOf(a).call(a,String(this.curProvider))+1)%a.length];if(c===a[0])throw new Error("uploadFile all policy fail");var h=nd(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(h&&h.retryNext&&c&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+c),this.curProvider=pa(c),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var m=this.mixStorePolicy[this.curProvider===Sh.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!m||0===m)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+pa(t.mixStorePolicy.providers[0])),t.curProvider=pa(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*m)}},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return a=c.sent,c.abrupt("return",a.content.mixStoreAuthTokenResTag);case 4:case"end":return c.stop()}}),_callee3,this)})))},MixStorage}(),Lh=ia.trim,Dh=R("".charAt),Vh=m.parseFloat,Fh=m.Symbol,jh=Fh&&Fh.iterator,Uh=1/Vh(ea+"-0")!=-1/0||jh&&!fails((function(){Vh(Object(jh))}))?function parseFloat(t){var a=Lh(toString$1(t)),c=Vh(a);return 0===c&&"-"==Dh(a,0)?-0:c}:Vh;_export({global:!0,forced:parseFloat!=Uh},{parseFloat:Uh});var Bh=G.parseFloat,Hh=function(){function AWS(t,a){this.s3=null,this.core=t,this.cloudStorage=a,this.logger=t.logger}return AWS.prototype.s3Upload=function s3Upload(t,a){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var c,h,m,g,_,E,b,O,T,S,C=this;return hl.wrap((function _callee2$(I){for(;;)switch(I.prev=I.next){case 0:if(!t.file){I.next=4;break}c=t.file,I.next=19;break;case 4:if("string"!=typeof t.fileInput){I.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((h=document.getElementById(t.fileInput))&&h.files&&h.files[0])){I.next=11;break}c=h.files[0],I.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:I.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){I.next=18;break}c=t.fileInput.files[0],I.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){I.next=21;break}throw new Error("dont get s3 policy");case 21:return m={accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,sessionToken:a.sessionToken,region:a.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},g=this.s3,(_=new g).config.update(m),E=decodeURIComponent(a.bucket),b=decodeURIComponent(a.objectName),T={Bucket:E,Key:b,Body:O=c,Metadata:{token:a.token},ContentType:O.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",T),(S=_.upload(T)).on("httpUploadProgress",(function(a){var c=Bh((a.loaded/a.total).toFixed(2));t.onUploadProgress&&t.onUploadProgress({total:a.total,loaded:a.loaded,percentage:c,percentageText:Math.round(100*c)+"%"})})),I.abrupt("return",new Xn((function(c,h){var m=(new Date).getTime();S.send((function(g,_){return __awaiter(C,void 0,void 0,hl.mark((function _callee(){var T,S,C,I,R;return hl.wrap((function _callee$(M){for(;;)switch(M.prev=M.next){case 0:if(!g||"RequestAbortedError"!==g.code){M.next=5;break}this.logger.error("uploadFile:","api::s3:upload file abort.",g),h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CANCELLED:400,detail:{reason:"S3RequestAbortedError",rawError:g,curProvider:2}})),M.next=31;break;case 5:if(!g){M.next=26;break}return this.logger.error("uploadFile:","api::s3:upload file failed.",g),this.core.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account||(null===(S=null===(T=this.core)||void 0===T?void 0:T.auth)||void 0===S?void 0:S.account),trace_id:null===(C=this.core.clientSocket.socket)||void 0===C?void 0:C.sessionId,start_time:m,action:1,exception_service:4}),this.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof g.status?g.status:"number"==typeof g.code?g.code:0,description:g.message||""+g.code,operation_type:1,target:Fs({bucket:E,object:b})},{asyncParams:Qd.net.getNetworkStatus()}),this.core.reporter.reportTraceEnd("exceptions",1),M.next=12,Qd.net.getNetworkStatus();case 12:if(I=M.sent,!1!==I.net_connect){M.next=16;break}return M.abrupt("return",h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"No network",rawError:g,curProvider:this.cloudStorage.mixStorage.curProvider}})));case 16:M.prev=16,this.cloudStorage.mixStorage._addCircuitTimer(),M.next=23;break;case 20:return M.prev=20,M.t0=M.catch(16),M.abrupt("return",h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"All upload attempts failed",rawError:M.t0,curProvider:this.cloudStorage.mixStorage.curProvider,mixStorePolicy:this.mixStorePolicy,file:t.file||t.filePath}})));case 23:c(this.cloudStorage._uploadFile(t)),M.next=31;break;case 26:R=(R=this.mixStorePolicy.s3Policy.cdnSchema).replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn),this.core.reporterHookCloudStorage.update({remote_addr:R,operation_type:1}),R=R.replace("{objectName}",_.Key),c({size:O.size,name:O.name,url:a.shortUrl?a.shortUrl:R,ext:O.name.split(".")[1]||"unknown"});case 31:case"end":return M.stop()}}),_callee,this,[[16,20]])})))})),t.onUploadStart&&t.onUploadStart(S)})));case 33:case"end":return I.stop()}}),_callee2,this)})))},Op(AWS,[{key:"mixStorePolicy",get:function get(){return this.cloudStorage.mixStorage.mixStorePolicy}}]),AWS}();function getUploadResponseFormat(t){return void 0===t&&(t="file"),Fs(Nh[t]||{}).replace(/"/gi,'\\"')}var Gh,Kh=function(){function CloudStorageService(t,a){void 0===a&&(a={}),this.config={},this.uploadTaskMap={},this.name="cloudStorage",this.logger=t.logger,this.core=t,this.nos=new Rh(t,this),this.mixStorage=new Ph(t,this),this.aws=new Hh(t,this),registerParser({cmdMap:Mh,cmdConfig:wh}),this.setOptions(a),this.setListeners()}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var a=t.storageKeyPrefix||"NIMClient";this.mixStorage.GRAYKEY=a+"-AllGrayscaleConfig",this.mixStorage.MIXSTOREKEY=a+"-AllMixStorePolicy";var c=t.s3,h=__rest(t,["s3"]),m=wt({},Ah,this.config);if(h&&Object.prototype.hasOwnProperty.call(h,"cdn")){var g=wt(wt({},m.cdn),h.cdn);this.config=wt({},m,h),this.config.cdn=g}else this.config=wt({},m,h);c&&(this.aws.s3=c)},t.setListeners=function setListeners(){var t,a,c,h;this.core.eventBus.on("kicked",bind$1(t=this._clearUnCompleteTask).call(t,this)),this.core.eventBus.on("disconnect",bind$1(a=this._clearUnCompleteTask).call(a,this)),this.core.eventBus.on("V2NIMLoginService/loginLifeCycleLogout",bind$1(c=this._clearUnCompleteTask).call(c,this)),this.core.eventBus.on("V2NIMLoginService/loginLifeCycleKicked",bind$1(h=this._clearUnCompleteTask).call(h,this))},t._clearUnCompleteTask=function _clearUnCompleteTask(){var t,a=this;forEach$1(t=Fi(this.uploadTaskMap)).call(t,(function(t){var c=a.uploadTaskMap[t];c&&c.abort&&c.abort()})),this.uploadTaskMap={}},t.init=function init(){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.mixStorage.reset(),this.nos.reset(),!this.config.isNeedToGetUploadPolicyFromServer){t.next=7;break}return t.next=5,this.mixStorage.getGrayscaleConfig(this.core.options.appkey);case 5:return t.next=7,this.nos._getNosCdnHost();case 7:case"end":return t.stop()}}),_callee,this)})))},t.processCallback=function processCallback(t,a){var c=this,h=t.onUploadProgress,m=t.onUploadDone,g=t.onUploadStart;return{onUploadStart:"function"==typeof g?function(t){c.uploadTaskMap[a]=t;try{g(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadStart execute error",t)}}:function(t){c.uploadTaskMap[a]=t},onUploadProgress:"function"==typeof h?function(t){c.core.reporterHookCloudStorage.update({transferred_size:t.loaded});try{h(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadProgress execute error",t)}}:function(t){c.core.reporterHookCloudStorage.update({transferred_size:t.loaded})},onUploadDone:"function"==typeof m?function(t){c.core.reporterHookCloudStorage.end(0);try{m(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadDone execute error",t)}}:function(){c.core.reporterHookCloudStorage.end(0)},taskKey:a}},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h,m,g,_,E,b;return hl.wrap((function _callee2$(O){for(;;)switch(O.prev=O.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){O.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){O.next=7;break}if("string"!=typeof(a=nd(t,"file.type"))||-1!==indexOf(a).call(a,t.type)){O.next=7;break}throw new Error('The meta type "'+a+'" does not match "'+t.type+'"');case 7:return this.core.reporterHookCloudStorage.start(),t.file?this.core.reporterHookCloudStorage.update({full_size:t.file.size}):"string"==typeof t.fileInput?(c=document.getElementById(t.fileInput))&&c.files&&c.files[0]&&this.core.reporterHookCloudStorage.update({full_size:c.files[0].size}):t.fileInput&&t.fileInput.files&&t.fileInput.files[0]&&this.core.reporterHookCloudStorage.update({full_size:t.fileInput.files[0].size}),h=Eu(),m=this.processCallback(t,h),g=m.onUploadStart,_=m.onUploadProgress,E=m.onUploadDone,t.onUploadStart=g,t.onUploadProgress=_,t.onUploadDone=E,b=null,O.prev=15,O.next=18,this._uploadFile(t);case 18:b=O.sent,delete this.uploadTaskMap[h],O.next=27;break;case 22:throw O.prev=22,O.t0=O.catch(15),delete this.uploadTaskMap[h],this.core.reporterHookCloudStorage.end((O.t0&&O.t0.code)===Bs.V2NIM_ERROR_CODE_CANCELLED?3:1),O.t0;case 27:return b&&(b.size=void 0===b.size?void 0:Number(b.size),b.w=void 0===b.w?void 0:Number(b.w),b.h=void 0===b.h?void 0:Number(b.h),b.dur=void 0===b.dur?void 0:Number(b.dur)),b.url=decodeURIComponent(b.url),t.onUploadDone({size:b.size,name:b.name,url:b.url,ext:b.name.split(".")[1]||"unknown"}),O.abrupt("return",b);case 31:case"end":return O.stop()}}),_callee2,this,[[15,22]])})))},t._uploadFile=function _uploadFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a,c,h,m;return hl.wrap((function _callee3$(g){for(;;)switch(g.prev=g.next){case 0:if(nd(this.mixStorage,"grayConfig.mixStoreEnable")&&nd(this.mixStorage,"mixStorePolicy.providers.length")){g.next=3;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),g.abrupt("return",this.nos.nosUpload(t));case 3:if(this.logger.log("uploadFile::_uploadFile, grayConfig enable:"+nd(this.mixStorage,"grayConfig.mixStoreEnable")+" curProvider:"+nd(this.mixStorage,"curProvider")),a=this.core.adapters.getFileUploadInformation(t),c=!0,a?!1===a.complete&&this.mixStorage.curProvider===Sh.s3&&(c=!1):c=!1,this.aws.s3||(this.mixStorage.curProvider=Sh.nos),h=xh,c){g.next=23;break}return g.prev=10,g.next=13,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.mixStorage.curProvider,tokenCount:1,tag:"qchat",nosSurvivalTime:t.nosSurvivalTime,returnBody:getUploadResponseFormat(t.type)}});case 13:m=g.sent,h=m.content.mixStoreTokenResTag,g.next=23;break;case 17:if(g.prev=17,g.t0=g.catch(10),this.core.logger.error("uploadFile:: getMixStoreToken error",g.t0),!(g.t0 instanceof Gs)){g.next=22;break}throw g.t0;case 22:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"getMixStoreToken error",rawError:g.t0,curProvider:this.mixStorage.curProvider,mixStorePolicy:this.mixStorage.mixStorePolicy}});case 23:if(c){g.next=27;break}return g.abrupt("return",this.mixStorage.curProvider===Sh.s3?this.aws.s3Upload(t,h):this.nos.nosUpload(t,h));case 27:return g.abrupt("return",this.nos.nosUpload(t));case 28:case"end":return g.stop()}}),_callee3,this,[[10,17]])})))},t.getPrivateUrl=function getPrivateUrl(t){var a;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var c=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);c[0];var h=c[1];c[2];var m=c[3];c[4];var g=c[5];if(c[6],c[7],null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable){var _=this._getUrlType(t);return _===Sh.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",g)),_===Sh.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",g)),t}var E=this.config,b=E.downloadUrl,O=E.downloadHostList,T=E.nosCdnEnable,S=this.config.cdn.cdnDomain,C=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",I=decodeURIComponent(g),R=indexOf(I).call(I,C);if(S&&R>-1&&T)return""+h+S+"/"+slice(I).call(I,R);if(includes(O).call(O,m)&&includes(g).call(g,"/")){var M=indexOf(g).call(g,"/"),k=g.substring(0,M),w=g.substring(M+1);return b.replace("{bucket}",k).replace("{object}",w)}var N=filter(O).call(O,(function(t){return"string"==typeof m&&includes(m).call(m,t)}))[0],x=N?m.replace(N,"").replace(/\W/g,""):null;return x?b.replace("{bucket}",x).replace("{object}",g):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:if("string"==typeof t&&includes(t).call(t,"_im_url=1")){c.next=2;break}return c.abrupt("return",t);case 2:return c.next=4,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 4:return a=c.sent,c.abrupt("return",a.content.nosSafeUrlTag.originUrl);case 6:case"end":return c.stop()}}),_callee4,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var a,c,h,m,g,_=this;return hl.wrap((function _callee5$(E){for(;;)switch(E.prev=E.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),a=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,c=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,a!==String(Ch.dontNeed)||c!==String(Ch.dontNeed)){E.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==Ch.time){E.next=17;break}if(!(a&&indexOf(a).call(a,String(Ch.time))>=0||c&&indexOf(c).call(c,String(Ch.time))>0)){E.next=13;break}return E.abrupt("return",this.mixStorage.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:E.next=33;break;case 17:if(t.urls&&t.urls.length){E.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(m=[],g=[],forEach$1(h=t.urls).call(h,(function(t){var a=_._getUrlType(t);a===Sh.nos&&g.push(t),a===Sh.s3&&m.push(t)})),(!c||0!==m.length&&indexOf(c).call(c,String(Ch.urls))<0)&&(this.logger.warn("s3 url don't support url token"),m=[]),(!a||0!==g.length&&indexOf(a).call(a,String(Ch.urls))<0)&&(this.logger.warn("nos url don't support url token"),g=[]),0!==m.length||0!==g.length){E.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==m.length&&0!==g.length){E.next=33;break}return t.urls=Fs(t.urls),E.abrupt("return",this.mixStorage.getFileAuthToken(t));case 33:case"end":return E.stop()}}),_callee5,this)})))},t._getUrlType=function _getUrlType(t){var a,c;return this.mixStorePolicy.nosPolicy&&some(a=this.mixStorePolicy.nosPolicy.dlcdns).call(a,(function(a){return indexOf(t).call(t,a)>=0}))?Sh.nos:this.mixStorePolicy.s3Policy&&some(c=this.mixStorePolicy.s3Policy.dlcdns).call(c,(function(a){return indexOf(t).call(t,a)>=0}))?Sh.s3:null},t.getNosAccessToken=function getNosAccessToken(t){return validate({url:{type:"string",allowEmpty:!1}},t),this.nos.getNosAccessToken(t)},t.deleteNosAccessToken=function deleteNosAccessToken(t){return validate({token:{type:"string",allowEmpty:!1}},t),this.nos.deleteNosAccessToken(t)},t.process=function process(t){var a=nd(t,"error.detail.ignore");return t.error&&!a?Xn.reject(t.error):Xn.resolve(t)},Op(CloudStorageService,[{key:"grayConfig",get:function get(){return this.mixStorage.grayConfig}},{key:"mixStorePolicy",get:function get(){return this.mixStorage.mixStorePolicy}}]),CloudStorageService}(),qh=function(t){function ChatroomMsgService(a){return t.call(this,"chatroomMsg",a)||this}St(ChatroomMsgService,t);var a=ChatroomMsgService.prototype;return a.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(wt(wt({},t),{type:"text"}))},a.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(wt(wt({},t),{type:"geo",body:Fs(t.body)}))},a.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(wt(wt({},t),{type:"tip"})));case 2:case"end":return a.stop()}}),_callee,this)})))},a.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(wt(wt({},t),{type:"custom"})));case 2:case"end":return a.stop()}}),_callee2,this)})))},a.sendImageMsg=function sendImageMsg(t){return this.doSendFile(wt(wt({},t),{type:"image"}))},a.sendFileMsg=function sendFileMsg(t){return this.doSendFile(wt(wt({},t),{type:"file"}))},a.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(wt(wt({},t),{type:"audio"}))},a.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(wt(wt({},t),{type:"video"}))},a.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),a=t.body){c.next=15;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){c.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return c.prev=5,c.next=8,this.core.cloudStorage.uploadFile(t);case 8:a=c.sent,c.next=15;break;case 11:throw c.prev=11,c.t0=c.catch(5),this.logger.error("sendFile:: upload File error or abort.",c.t0),c.t0;case 15:return c.abrupt("return",this.sendMsg(wt(wt({},t),{body:Fs(a),type:t.type})));case 16:case"end":return c.stop()}}),_callee3,this,[[5,11]])})))},a.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a,c,h;return hl.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),m.next=3,this.core.sendCmd("chatroomQueryMessageHistory",wt(wt({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map$6(a=t.msgTypes).call(a,(function(t){return fp[t]})):[]}));case 3:return c=m.sent,h=c.content.chatroomMsgs,m.abrupt("return",formatChatroomMsgs(h,this.core.account));case 6:case"end":return m.stop()}}),_callee4,this)})))},a.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var a,c,h,m,g;return hl.wrap((function _callee5$(_){for(;;)switch(_.prev=_.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),h=wt(wt({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map$6(a=filter(c=t.types).call(c,(function(t){return void 0!==fp[t]}))).call(a,(function(t){return fp[t]})):[]}),_.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:wt(h,{tags:Fs(h.tags),types:Fs(h.types)})});case 4:return m=_.sent,g=m.content.chatroomMsgs,_.abrupt("return",formatChatroomMsgs(g,this.core.account));case 7:case"end":return _.stop()}}),_callee5,this)})))},a.onChatroomMsgHandler=function onChatroomMsgHandler(t){var a=t.content;Zn();var c=formatChatroomMsg(null==a?void 0:a.chatroomMsg,this.core.account);"debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",c.type,c.idClient,c):this.logger.log("onChatroomMsgHandler::recvMsg",c.type,c.idClient),this.core.emit("chatroomMsg",c),"out"!==c.flow&&this.doMsgReceiveReport(c,t)},a.doMsgReceiveReport=function doMsgReceiveReport(t,a){if(t.from!==this.core.account){var c=nd(t,"__clientExt.statistics.apiCallingTime")||0,h=nd(t,"__clientExt.statistics.sendTime")||0,m=nd(t,"__clientExt.statistics.attachUploadDuration")||0,g=this.core.timeOrigin.getNTPTime(),_=t.time,E=this.core.timeOrigin.checkNodeReliable(a.__receiveTimeNode)?this.core.timeOrigin.getNTPTime(a.__receiveTimeNode):g;this.core.reporter.report("msgReceive",{msgId:"",clientId:t.idClient,serverTime:_,receiveTime:E,fromAccid:t.from,toAccid:this.core.account,type:4,roomId:t.chatroomId,apiCallingTime:c,sendTime:h,attachUploadDuration:m,callbackTime:g,preHandleTime:g,result:200,failReason:"",rt:g-_})}},a.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var a,c,h,m,g;return hl.wrap((function _callee6$(_){for(;;)switch(_.prev=_.next){case 0:validate({type:{type:"enum",values:getEnumKeys(fp)},subType:{type:"number",min:1,required:!1}},t),a=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),c=formatChatroomMsg(wt(wt({},a),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(c)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return _.prev=4,_.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:a});case 7:return h=_.sent,m=formatChatroomMsg(wt(wt(wt({},a),h.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,msgTime:m.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:200,failReason:"",rt:Zn()-c.time}),_.abrupt("return",m);case 13:throw _.prev=13,_.t0=_.catch(4),g=formatChatroomMsg(wt(wt({},a),{status:"fail"}),this.core.account),_.t0.msg=g,this.core.reporter.report("msgSend",{msgId:"",clientId:g.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:g.chatroomId,tid:"",result:null===_.t0||void 0===_.t0?void 0:_.t0.code,failReason:(null===_.t0||void 0===_.t0?void 0:_.t0.message)||"",rt:Zn()-a.time}),_.t0;case 19:case"end":return _.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}($f);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(Gh||(Gh={}));var Wh=function(t){function ChatroomMemberService(a){return t.call(this,"chatroomMember",a)||this}St(ChatroomMemberService,t);var a=ChatroomMemberService.prototype;return a.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),a.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",wt(wt({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee,this)})))},a.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee2,this)})))},a.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){return hl.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee3,this)})))},a.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){return hl.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:-2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee4,this)})))},a.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:-1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee5,this)})))},a.queryMembers=function queryMembers(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var c;return hl.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(Gh)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembers",wt(wt({time:0,limit:100},t),{type:Gh[t.type]}));case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee6,this)})))},a.queryMembersByAccounts=function queryMembersByAccounts(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee7(){var c;return hl.wrap((function _callee7$(h){for(;;)switch(h.prev=h.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee7,this)})))},a.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee8(){return hl.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMemberTempMute",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee8,this)})))},a.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee9(){return hl.wrap((function _callee9$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomKickMember",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee9,this)})))},a.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee10(){var a;return hl.wrap((function _callee10$(c){for(;;)switch(c.prev=c.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",wt({},t));case 3:return a=c.sent,c.abrupt("return",a.content.count);case 5:case"end":return c.stop()}}),_callee10,this)})))},a.queryMembersByTag=function queryMembersByTag(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee11(){var c;return hl.wrap((function _callee11$(h){for(;;)switch(h.prev=h.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:wt({time:0,limit:100},t)});case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee11,this)})))},a.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee12(){return hl.wrap((function _callee12$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:wt(wt({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return a.stop()}}),_callee12,this)})))},a.markChatroomMember=function markChatroomMember(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee13(){var c;return hl.wrap((function _callee13$(h){for(;;)switch(h.prev=h.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("markChatroomMember",wt(wt({level:0},t),{ext:t.ext||""}));case 3:return c=h.sent,h.abrupt("return",formatChatroomMember(null===(a=c.content)||void 0===a?void 0:a.chatroomMember));case 5:case"end":return h.stop()}}),_callee13,this)})))},ChatroomMemberService}($f),zh=function(t){function ChatroomQueueService(a){return t.call(this,"chatroomQueue",a)||this}St(ChatroomQueueService,t);var a=ChatroomQueueService.prototype;return a.init=function init(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),a.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return a.stop()}}),_callee,this)})))},a.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueOffer",wt(wt({},t),{transient:!!t.transient}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.poll=function poll(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),c.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return a=c.sent,c.abrupt("return",a.content);case 6:case"end":return c.stop()}}),_callee3,this)})))},a.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueueChange",wt(wt({},t),{needNotify:!!t.needNotify}));case 3:return a=c.sent,c.abrupt("return",a.content.invalidKeyList);case 5:case"end":return c.stop()}}),_callee4,this)})))},a.fetch=function fetch(){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var t;return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=a.sent,a.abrupt("return",t.content.itemList);case 4:case"end":return a.stop()}}),_callee5,this)})))},a.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var t,a,c,h;return hl.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return a=m.sent,c=a.content.elementKey,h=a.content.elementValue,m.abrupt("return",((t={})[c]=h,t));case 6:case"end":return m.stop()}}),_callee6,this)})))},a.clear=function clear(){return __awaiter(this,void 0,void 0,hl.mark((function _callee7(){return hl.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}($f),$h={"1_2":"heartbeat","6_23":"getServerTime","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},Yh={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,clientSession:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,clientSession:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,hostEnv:41,userAgent:42,libEnv:44,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33,__clientExt:{id:39,converter:function objectToJSONString(t){if(t&&"object"==typeof t)try{return Fs(t)}catch(t){return}},retConverter:function stringToJSONObject(t){if(t&&"string"==typeof t)try{return JSON.parse(t)}catch(t){return}}}},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Xh=function getDeserializeTag(){return function invertSerializeMap(t){var a,c={};return forEach$1(a=Fi(t)).call(a,(function(a){c[a]=function invertSerializeItem(t){var a={};for(var c in t){var h=t[c];"number"==typeof h?a[h]=c:"object"==typeof h&&(a[h.id]={prop:c,type:h.retType,access:h.retAccess?h.retAccess:h.access?h.access:c,def:h.retDef,converter:h.retConverter})}return a}(t[a])})),c}(Yh)},Qh=function getCmdConfig(){var t=Xh();return{heartbeat:{sid:1,cid:2,service:"chatroom"},getServerTime:{sid:6,cid:23,service:"chatroom",response:[{type:"Long",name:"time"}]},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:Yh.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:Yh.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:t.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:t.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:t.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:Yh.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:t.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:t.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:Yh.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:t.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:t.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:Yh.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:Yh.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:t.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"String",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:Yh.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:Yh.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"Bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"Bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:t.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"auth",response:[{type:"Int",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:t.updateTags}]}}},Jh={user_id:"",trace_id:"",action:7,exception_service:6,duration:0,start_time:0,state:1,extension:[]},Zh=function(){function ReporterHookLinkKeep(t,a){this.traceData=Jh,this.core=t,this.traceData=wt({},Jh,a),this.traceData.extension=[]}var t=ReporterHookLinkKeep.prototype;return t.reset=function reset(){this.traceData=wt({},Jh),this.traceData.extension=[]},t.start=function start(){var t,a;this.reset(),this.traceData.user_id=this.core.account,this.traceData.trace_id=(null===(a=null===(t=this.core.clientSocket)||void 0===t?void 0:t.socket)||void 0===a?void 0:a.sessionId)||"",this.traceData.start_time=(new Date).getTime()},t.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,Qd.net.getNetworkStatus();case 2:a=m.sent,c=a.net_type,h=a.net_connect,this.traceData.extension.push(wt({code:0,description:"",foreground:!0,foreg_backg_switch:!1,net_type:c,net_connect:h},t));case 6:case"end":return m.stop()}}),_callee,this)})))},t.end=function end(t){var a=this.traceData.extension[0],c=this.traceData.extension[1];if(a&&0===a.operation_type&&c&&1===c.operation_type){var h=a.net_type!==c.net_type||a.net_connect!==c.net_connect;if(t||!h)return this.traceData.duration=(new Date).getTime()-this.traceData.start_time,this.core.reporter.report("exceptions",this.traceData),void this.reset();this.reset()}else this.reset()},ReporterHookLinkKeep}(),em={user_id:"",trace_id:"",action:0,state:0,duration:0,start_time:0,offset:0,full_size:0,transferred_size:0,operation_type:0,remote_addr:""},tm="ReporterHook::setMonitorForResources:",rm=function(){function ReporterHookCloudStorage(t,a){this.traceData=em,this.core=t,this.traceData=wt({},em,a)}var t=ReporterHookCloudStorage.prototype;return t.reset=function reset(){this.traceData=wt({},em)},t.start=function start(){var t,a;this.reset(),this.traceData.user_id=this.core.account,this.traceData.trace_id=(null===(a=null===(t=this.core.clientSocket)||void 0===t?void 0:t.socket)||void 0===a?void 0:a.sessionId)||"",this.traceData.start_time="timeOrigin"in this.core?this.core.timeOrigin.getNTPTime():Zn()},t.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(this.traceData.user_id){a.next=2;break}return a.abrupt("return");case 2:this.core.logger.log(tm+" upload update",t),wt(this.traceData,t);case 4:case"end":return a.stop()}}),_callee,this)})))},t.end=function end(t){this.traceData.user_id&&(this.core.logger.log(tm+" upload end cause of "+t),this.traceData.state=t,this.traceData.duration=("timeOrigin"in this.core?this.core.timeOrigin.getNTPTime():Zn())-this.traceData.start_time,this.core.reporter.report("nim_sdk_resources",this.traceData),this.traceData=em)},ReporterHookCloudStorage}(),om={debugLevel:"off",needReconnect:!0,reconnectionAttempts:9007199254740991,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:Lf,abtestProjectKey:Df},nm=function(t){function Chatroom(a,c){var m,g,_,E;void 0===c&&(c={}),(m=t.call(this)||this).instanceName="Chatroom",m.status="unconnected",m.account="",m.eventBus=new gi,m.options={},m.chatroom={},m.chatroomMsg={},m.chatroomMember={},m.chatroomQueue={},m.cloudStorage={},m.logger=new Af(a.debugLevel),m.setInitOptions(a),registerParser({cmdMap:$h,cmdConfig:Qh()}),m.otherOptions=c,m.timerManager=new zf,m.adapters=new Pf(h(m)),m.timeOrigin=new tf(h(m)),m.abtest=new Vf(h(m),{isAbtestEnable:m.options.isAbtestEnable,abtestUrl:m.options.abtestUrl,abtestProjectKey:Df});var b="",O="";m.options.isFixedDeviceId?(b=Qd.localStorage.getItem("__CHATROOM_DEVC_ID__")||Eu(),O=Qd.localStorage.getItem("__CHATROOM_CLIENT_SESSION_ID__")||Eu(),Qd.localStorage.setItem("__CHATROOM_DEVC_ID__",b),Qd.localStorage.setItem("__CHATROOM_CLIENT_SESSION_ID__",O)):(b=Eu(),O=Eu()),m.config={timeout:8e3,deviceId:b,clientSession:O};var T=Qd.getSystemInfo(),S=null===(g=null==c?void 0:c.reporterConfig)||void 0===g?void 0:g.isDataReportEnable;return"boolean"!=typeof S&&(S=!0),m.reporter=new Yi({reportConfigUrl:(null===(_=null==c?void 0:c.reporterConfig)||void 0===_?void 0:_.reportConfigUrl)||"https://statistic.live.126.net/dispatcher/req",reportUrl:(null===(E=null==c?void 0:c.reporterConfig)||void 0===E?void 0:E.reportUrl)||"https://statistic.live.126.net/statics/report/common/form",isDataReportEnable:S,common:{app_key:a.appkey,dev_id:m.config.deviceId,platform:"Web",sdk_ver:"10.2.3",env:"online",os_name:T.os,os_ver:T.osVer,lib_env:T.libEnv,host_env:T.hostEnv,host_env_ver:T.hostEnvVer,manufactor:T.manufactor,model:T.model,v2:!1},request:Qd.request,logger:m.logger,autoStart:!0}),m.reporterHookLinkKeep=new Zh(h(m)),m.reporterHookCloudStorage=new rm(h(m)),Qd.setLogger(m.logger),m.auth=new Ep(h(m)),m.V1NIMLoginService=m.auth,m.clientSocket=new cp(h(m)),m.chatroom=new bp(h(m)),m.chatroomMsg=new qh(h(m)),m.chatroomMember=new Wh(h(m)),m.chatroomQueue=new zh(h(m)),m.cloudStorage=new Kh(h(m),wt({storageKeyPrefix:m.instanceName},c.cloudStorageConfig)),Chatroom.instance=h(m),m.logger.log("Chatroom init, version ","10.2.3"," sdk version ",100203," appkey ",a.appkey),m}St(Chatroom,t),Chatroom.getInstance=function getInstance(t,a){if(!Chatroom.instance){if(t)return new Chatroom(t,a);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var a=Chatroom.prototype;return a.setOptions=function setOptions(t){if("object"==typeof t&&null!==t&&(Object.prototype.hasOwnProperty.call(t,"account")&&t.account!==this.options.account||Object.prototype.hasOwnProperty.call(t,"appkey")&&t.appkey!==this.options.appkey))throw new Error("chatroom::setOptions account and appkey is not allowed to reset");validate({token:{type:"string",required:!1},chatroomId:{type:"string",required:!1},chatroomAddresses:{type:"array",itemType:"string",min:1,required:!1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.options=wt(wt({},this.options),t)},a.setInitOptions=function setInitOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger&&this.logger.log("chatroom::setInitOptions options is",t),this.account=t.account,this.options=wt(wt({},om),t)},a.connect=function connect(t){return void 0===t&&(t={}),this.auth.login(t)},a.disconnect=function disconnect(){var t=this;switch(this.status){case"logined":return this.sendCmd("chatroomExit",void 0,{timeout:1e3}).then((function(){t.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect")})).catch((function(a){t.logger.error("Instance::disconnect sendCmd:logout error",a),t.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect")}));case"connected":case"connecting":case"waitReconnect":return this.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect"),Xn.resolve();case"unconnected":case"destroyed":return Xn.resolve()}},a.destroy=function destroy(){var t=this;return Chatroom.instance=void 0,this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.logger.destroy(),t.reporter.destroy(),t.timerManager.destroy(),t.connect=emptyFuncWithPromise,t.disconnect=emptyFuncWithPromise,t.destroy=emptyFuncWithPromise}))},a.sendCmd=function sendCmd(t,a,c){return this.clientSocket.sendCmd(t,a,c)},a.emit=function emit(a){var c=this;try{for(var h,m,g=Zn(),_=arguments.length,E=new Array(_>1?_-1:0),b=1;b<_;b++)E[b-1]=arguments[b];var O=(h=t.prototype.emit).call.apply(h,concat(m=[this,a]).call(m,E)),T=Zn()-g;return T>=10&&this.logger.warn("Core::emit event: "+a+" process takes: "+T+"ms"),O}catch(t){return this.logger.error("Core::emit event: "+a+". Error: "+t),mi((function(){throw c.logger.error("Core::emit throw error in setTimeout. event: "+a+". Error: "+t),t}),0),!1}},Chatroom}(gi),im=createCommonjsModule((function(a,c){(function(){var h={function:!0,object:!0}[typeof window]&&window||this,m=c,g=a&&!a.nodeType&&a,_=m&&g&&"object"==typeof t&&t;!_||_.global!==_&&_.window!==_&&_.self!==_||(h=_);var E=Math.pow(2,53)-1,b=/\bOpera/,O=Object.prototype,T=O.hasOwnProperty,S=O.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,a){for(var c in t)T.call(t,c)&&a(t[c],c,t)}function getClassOf(t){return null==t?capitalize(t):S.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,a){var c=null;return function each(t,a){var c=-1,h=t?t.length:0;if("number"==typeof h&&h>-1&&h<=E)for(;++c<h;)a(t[c],c,t);else forOwn(t,a)}(t,(function(h,m){c=a(c,h,m,t)})),c}function trim(t){return String(t).replace(/^ +| +$/g,"")}var C=function parse(t){var a=h,c=t&&"object"==typeof t&&"String"!=getClassOf(t);c&&(a=t,t=null);var m=a.navigator||{},g=m.userAgent||"";t||(t=g);var _,E,O=c?!!m.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(S.toString()),T="Object",C=c?T:"ScriptBridgingProxyObject",I=c?T:"Environment",R=c&&a.java?"JavaPackage":getClassOf(a.java),M=c?T:"RuntimeObject",k=/\bJava/.test(R)&&a.java,w=k&&getClassOf(a.environment)==I,N=k?"a":"α",x=k?"b":"β",A=a.document||{},P=a.operamini||a.opera,L=b.test(L=c&&P?P["[[Class]]"]:getClassOf(P))?L:P=null,D=t,V=[],j=null,U=t==g,B=U&&P&&"function"==typeof P.version&&P.version(),H=function getLayout(a){return reduce(a,(function(a,c){return a||RegExp("\\b"+(c.pattern||qualify(c))+"\\b","i").exec(t)&&(c.label||c)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),G=function getName(a){return reduce(a,(function(a,c){return a||RegExp("\\b"+(c.pattern||qualify(c))+"\\b","i").exec(t)&&(c.label||c)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),K=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),q=function getManufacturer(a){return reduce(a,(function(a,c,h){return a||(c[K]||c[/^[a-z]+(?: +[a-z]+\b)*/i.exec(K)]||RegExp("\\b"+qualify(h)+"(?:\\b|\\w*\\d)","i").exec(t))&&h}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),W=function getOS(a){return reduce(a,(function(a,c){var h=c.pattern||qualify(c);return!a&&(a=RegExp("\\b"+h+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(a=function cleanupOS(t,a,c){var h={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return a&&c&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(h=h[/[\d.]+$/.exec(t)])&&(t="Windows "+h),t=String(t),a&&c&&(t=t.replace(RegExp(a,"i"),c)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(a,h,c.label||c)),a}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(a){return reduce(a,(function(a,c){var h=c.pattern||qualify(c);return!a&&(a=RegExp("\\b"+h+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+h+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+h+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((a=String(c.label&&!RegExp(h,"i").test(c.label)?c.label:a).split("/"))[1]&&!/[\d.]+/.test(a[0])&&(a[0]+=" "+a[1]),c=c.label||c,a=format(a[0].replace(RegExp(h,"i"),c).replace(RegExp("; *(?:"+c+"[_-])?","i")," ").replace(RegExp("("+c+")[-_.]?(\\w)","i"),"$1 $2"))),a}))}function getVersion(a){return reduce(a,(function(a,c){return a||(RegExp(c+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(H&&(H=[H]),/\bAndroid\b/.test(W)&&!K&&(_=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(K=trim(_[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),q&&!K?K=getProduct([q]):q&&K&&(K=K.replace(RegExp("^("+qualify(q)+")[-_.\\s]","i"),q+" ").replace(RegExp("^("+qualify(q)+")[-_.]?(\\w)","i"),q+" $2")),(_=/\bGoogle TV\b/.exec(K))&&(K=_[0]),/\bSimulator\b/i.test(t)&&(K=(K?K+" ":"")+"Simulator"),"Opera Mini"==G&&/\bOPiOS\b/.test(t)&&V.push("running in Turbo/Uncompressed mode"),"IE"==G&&/\blike iPhone OS\b/.test(t)?(q=(_=parse(t.replace(/like iPhone OS/,""))).manufacturer,K=_.product):/^iP/.test(K)?(G||(G="Safari"),W="iOS"+((_=/ OS ([\d_]+)/i.exec(t))?" "+_[1].replace(/_/g,"."):"")):"Konqueror"==G&&/^Linux\b/i.test(W)?W="Kubuntu":q&&"Google"!=q&&(/Chrome/.test(G)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(K))||/\bAndroid\b/.test(W)&&/^Chrome/.test(G)&&/\bVersion\//i.test(t)?(G="Android Browser",W=/\bAndroid\b/.test(W)?W:"Android"):"Silk"==G?(/\bMobi/i.test(t)||(W="Android",V.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&V.unshift("accelerated")):"UC Browser"==G&&/\bUCWEB\b/.test(t)?V.push("speed mode"):"PaleMoon"==G&&(_=/\bFirefox\/([\d.]+)\b/.exec(t))?V.push("identifying as Firefox "+_[1]):"Firefox"==G&&(_=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(W||(W="Firefox OS"),K||(K=_[1])):!G||(_=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(G))?(G&&!K&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(_+"/")+8))&&(G=null),(_=K||q||W)&&(K||q||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(W))&&(G=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(W)?W:_)+" Browser")):"Electron"==G&&(_=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&V.push("Chromium "+_),B||(B=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(G),"(?:Firefox|Minefield|NetFront)"])),(_=("iCab"==H&&parseFloat(B)>3?"WebKit":/\bOpera\b/.test(G)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(H)&&"WebKit"||!H&&/\bMSIE\b/i.test(t)&&("Mac OS"==W?"Tasman":"Trident")||"WebKit"==H&&/\bPlayStation\b(?! Vita\b)/i.test(G)&&"NetFront")&&(H=[_]),"IE"==G&&(_=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(G+=" Mobile",W="Windows Phone "+(/\+$/.test(_)?_:_+".x"),V.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(G="IE Mobile",W="Windows Phone 8.x",V.unshift("desktop mode"),B||(B=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=G&&"Trident"==H&&(_=/\brv:([\d.]+)/.exec(t))&&(G&&V.push("identifying as "+G+(B?" "+B:"")),G="IE",B=_[1]),U){if(function isHostType(t,a){var c=null!=t?typeof t[a]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(c)||"object"==c&&!t[a])}(a,"global"))if(k&&(D=(_=k.lang.System).getProperty("os.arch"),W=W||_.getProperty("os.name")+" "+_.getProperty("os.version")),w){try{B=a.require("ringo/engine").version.join("."),G="RingoJS"}catch(t){(_=a.system)&&_.global.system==a.system&&(G="Narwhal",W||(W=_[0].os||null))}G||(G="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(_=a.process)&&("object"==typeof _.versions&&("string"==typeof _.versions.electron?(V.push("Node "+_.versions.node),G="Electron",B=_.versions.electron):"string"==typeof _.versions.nw&&(V.push("Chromium "+B,"Node "+_.versions.node),G="NW.js",B=_.versions.nw)),G||(G="Node.js",D=_.arch,W=_.platform,B=(B=/[\d.]+/.exec(_.version))?B[0]:null));else getClassOf(_=a.runtime)==C?(G="Adobe AIR",W=_.flash.system.Capabilities.os):getClassOf(_=a.phantom)==M?(G="PhantomJS",B=(_=_.version||null)&&_.major+"."+_.minor+"."+_.patch):"number"==typeof A.documentMode&&(_=/\bTrident\/(\d+)/i.exec(t))?(B=[B,A.documentMode],(_=+_[1]+4)!=B[1]&&(V.push("IE "+B[1]+" mode"),H&&(H[1]=""),B[1]=_),B="IE"==G?String(B[1].toFixed(1)):B[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(G)&&(V.push("masking as "+G+" "+B),G="IE",B="11.0",H=["Trident"],W="Windows");W=W&&format(W)}if(B&&(_=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(B)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(U&&m.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(j=/b/i.test(_)?"beta":"alpha",B=B.replace(RegExp(_+"\\+?$"),"")+("beta"==j?x:N)+(/\d+\+?/.exec(_)||"")),"Fennec"==G||"Firefox"==G&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(W))G="Firefox Mobile";else if("Maxthon"==G&&B)B=B.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(K))"Xbox 360"==K&&(W=null),"Xbox 360"==K&&/\bIEMobile\b/.test(t)&&V.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(G)&&(!G||K||/Browser|Mobi/.test(G))||"Windows CE"!=W&&!/Mobi/i.test(t))if("IE"==G&&U)try{null===a.external&&V.unshift("platform preview")}catch(t){V.unshift("embedded")}else(/\bBlackBerry\b/.test(K)||/\bBB10\b/.test(t))&&(_=(RegExp(K.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||B)?(W=((_=[_,/BB10/.test(t)])[1]?(K=null,q="BlackBerry"):"Device Software")+" "+_[0],B=null):this!=forOwn&&"Wii"!=K&&(U&&P||/Opera/.test(G)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==G&&/\bOS X (?:\d+\.){2,}/.test(W)||"IE"==G&&(W&&!/^Win/.test(W)&&B>5.5||/\bWindows XP\b/.test(W)&&B>8||8==B&&!/\bTrident\b/.test(t)))&&!b.test(_=parse.call(forOwn,t.replace(b,"")+";"))&&_.name&&(_="ing as "+_.name+((_=_.version)?" "+_:""),b.test(G)?(/\bIE\b/.test(_)&&"Mac OS"==W&&(W=null),_="identify"+_):(_="mask"+_,G=L?format(L.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(_)&&(W=null),U||(B=null)),H=["Presto"],V.push(_));else G+=" Mobile";(_=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(_=[parseFloat(_.replace(/\.(\d)$/,".0$1")),_],"Safari"==G&&"+"==_[1].slice(-1)?(G="WebKit Nightly",j="alpha",B=_[1].slice(0,-1)):B!=_[1]&&B!=(_[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(B=null),_[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==_[0]&&537.36==_[2]&&parseFloat(_[1])>=28&&"WebKit"==H&&(H=["Blink"]),U&&(O||_[1])?(H&&(H[1]="like Chrome"),_=_[1]||((_=_[0])<530?1:_<532?2:_<532.05?3:_<533?4:_<534.03?5:_<534.07?6:_<534.1?7:_<534.13?8:_<534.16?9:_<534.24?10:_<534.3?11:_<535.01?12:_<535.02?"13+":_<535.07?15:_<535.11?16:_<535.19?17:_<536.05?18:_<536.1?19:_<537.01?20:_<537.11?"21+":_<537.13?23:_<537.18?24:_<537.24?25:_<537.36?26:"Blink"!=H?"27":"28")):(H&&(H[1]="like Safari"),_=(_=_[0])<400?1:_<500?2:_<526?3:_<533?4:_<534?"4+":_<535?5:_<537?6:_<538?7:_<601?8:_<602?9:_<604?10:_<606?11:_<608?12:"12"),H&&(H[1]+=" "+(_+="number"==typeof _?".x":/[.+]/.test(_)?"":"+")),"Safari"==G&&(!B||parseInt(B)>45)?B=_:"Chrome"==G&&/\bHeadlessChrome/i.test(t)&&V.unshift("headless")),"Opera"==G&&(_=/\bzbov|zvav$/.exec(W))?(G+=" ",V.unshift("desktop mode"),"zvav"==_?(G+="Mini",B=null):G+="Mobile",W=W.replace(RegExp(" *"+_+"$"),"")):"Safari"==G&&/\bChrome\b/.exec(H&&H[1])?(V.unshift("desktop mode"),G="Chrome Mobile",B=null,/\bOS X\b/.test(W)?(q="Apple",W="iOS 4.3+"):W=null):/\bSRWare Iron\b/.test(G)&&!B&&(B=getVersion("Chrome")),B&&0==B.indexOf(_=/[\d.]+$/.exec(W))&&t.indexOf("/"+_+"-")>-1&&(W=trim(W.replace(_,""))),W&&-1!=W.indexOf(G)&&!RegExp(G+" OS").test(W)&&(W=W.replace(RegExp(" *"+qualify(G)+" *"),"")),H&&!/\b(?:Avant|Nook)\b/.test(G)&&(/Browser|Lunascape|Maxthon/.test(G)||"Safari"!=G&&/^iOS/.test(W)&&/\bSafari\b/.test(H[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(G)&&H[1])&&(_=H[H.length-1])&&V.push(_),V.length&&(V=["("+V.join("; ")+")"]),q&&K&&K.indexOf(q)<0&&V.push("on "+q),K&&V.push((/^on /.test(V[V.length-1])?"":"on ")+K),W&&(_=/ ([\d.+]+)$/.exec(W),E=_&&"/"==W.charAt(W.length-_[0].length-1),W={architecture:32,family:_&&!E?W.replace(_[0],""):W,version:_?_[1]:null,toString:function(){var t=this.version;return this.family+(t&&!E?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(_=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(W&&(W.architecture=64,W.family=W.family.replace(RegExp(" *"+_),"")),G&&(/\bWOW64\b/i.test(t)||U&&/\w(?:86|32)$/.test(m.cpuClass||m.platform)&&!/\bWin64; x64\b/i.test(t))&&V.unshift("32-bit")):W&&/^OS X/.test(W.family)&&"Chrome"==G&&parseFloat(B)>=39&&(W.architecture=64),t||(t=null);var z={};return z.description=t,z.layout=H&&H[0],z.manufacturer=q,z.name=G,z.prerelease=j,z.product=K,z.ua=t,z.version=G&&B,z.os=W||{architecture:null,family:null,version:null,toString:function(){return"null"}},z.parse=parse,z.toString=function toStringPlatform(){return this.description||""},z.version&&V.unshift(B),z.name&&V.unshift(G),W&&G&&(W!=String(W).split(" ")[0]||W!=G.split(" ")[0]&&!K)&&V.push(K?"("+W+")":"on "+W),V.length&&(z.description=V.join(" ")),z}();m&&g?forOwn(C,(function(t,a){m[a]=t})):h.platform=C}).call(t)})),am=Math.floor,mergeSort=function(t,a){var c=t.length,h=am(c/2);return c<8?insertionSort(t,a):merge(t,mergeSort(arraySliceSimple(t,0,h),a),mergeSort(arraySliceSimple(t,h),a),a)},insertionSort=function(t,a){for(var c,h,m=t.length,g=1;g<m;){for(h=g,c=t[g];h&&a(t[h-1],c)>0;)t[h]=t[--h];h!==g++&&(t[h]=c)}return t},merge=function(t,a,c,h){for(var m=a.length,g=c.length,_=0,E=0;_<m||E<g;)t[_+E]=_<m&&E<g?h(a[_],c[E])<=0?a[_++]:c[E++]:_<m?a[_++]:c[E++];return t},sm=mergeSort,cm=q.match(/firefox\/(\d+)/i),um=!!cm&&+cm[1],lm=/MSIE|Trident/.test(q),dm=q.match(/AppleWebKit\/(\d+)\./),fm=!!dm&&+dm[1],pm=[],hm=R(pm.sort),mm=R(pm.push),gm=fails((function(){pm.sort(void 0)})),vm=fails((function(){pm.sort(null)})),ym=arrayMethodIsStrict("sort"),_m=!fails((function(){if(Q)return Q<70;if(!(um&&um>3)){if(lm)return!0;if(fm)return fm<603;var t,a,c,h,m="";for(t=65;t<76;t++){switch(a=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:c=3;break;case 68:case 71:c=4;break;default:c=2}for(h=0;h<47;h++)pm.push({k:a+h,v:c})}for(pm.sort((function(t,a){return a.v-t.v})),h=0;h<pm.length;h++)a=pm[h].k.charAt(0),m.charAt(m.length-1)!==a&&(m+=a);return"DGBEFHACIJK"!==m}}));_export({target:"Array",proto:!0,forced:gm||!vm||!ym||!_m},{sort:function sort(t){void 0!==t&&aCallable(t);var a=toObject(this);if(_m)return void 0===t?hm(a):hm(a,t);var c,h,m=[],g=lengthOfArrayLike(a);for(h=0;h<g;h++)h in a&&mm(m,a[h]);for(sm(m,function(t){return function(a,c){return void 0===c?-1:void 0===a?1:void 0!==t?+t(a,c)||0:toString$1(a)>toString$1(c)?1:-1}}(t)),c=lengthOfArrayLike(m),h=0;h<c;)a[h]=m[h++];for(;h<g;)deletePropertyOrThrow(a,h++);return a}});var Em=entryVirtual("Array").sort,bm=Array.prototype,sort=function(t){var a=t.sort;return t===bm||K(bm,t)&&a===bm.sort?Em:a},Om=createCommonjsModule((function(t,a){self,t.exports=function(){var t={d:function d(a,c){for(var h in c)t.o(c,h)&&!t.o(a,h)&&_i(a,h,{enumerable:!0,get:c[h]})},o:function o(t,a){return Object.prototype.hasOwnProperty.call(t,a)}},a={};t.d(a,{default:function _default(){return S}});var c=function e(t){for(var a in function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=4,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.enableCache=!0,this.logger=console,this.onError=function(t){},this.onProgress=function(t){},this.onUploadProgress=function(t){},this.onComplete=function(t){},t)this[a]=t[a]};function n(t,a){var c=void 0!==nl&&il(t)||t["@@iterator"];if(!c){if(bu(t)||(c=function(t,a){if(t){var c;if("string"==typeof t)return r(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);return"Object"===h&&t.constructor&&(h=t.constructor.name),"Map"===h||"Set"===h?Su(t):"Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?r(t,a):void 0}}(t))||a&&t&&"number"==typeof t.length){c&&(t=c);var h=0,m=function i(){};return{s:m,n:function n(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}},e:function e(t){throw t},f:m}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,_=!0,E=!1;return{s:function s(){c=c.call(t)},n:function n(){var t=c.next();return _=t.done,t},e:function e(t){E=!0,g=t},f:function f(){try{_||null==c.return||c.return()}finally{if(E)throw g}}}}function r(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var h={privateObj:{},setItem:function setItem(t,a){h.privateObj[t]=a},getItem:function getItem(t){return h.privateObj[t]},removeItem:function removeItem(t){delete h.privateObj[t]},getKeys:function getKeys(){return Fi(h.privateObj)}},m={getFileKey:function getFileKey(t){var a=t.size.toString(),c=t.lastModified.toString();return"_NosUploader_"+t.name+slice(a).call(a,a.length-5)+slice(c).call(c,c.length-5)},getFileInfo:function getFileInfo(t){var a=h.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch(t){return null}},initFile:function initFile(t,a,c){m.clearExpiredInfo();var g=this.getFileKey(a),_={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Zn(),end:!1};return t.payload&&(_.payload=t.payload),c&&h.setItem(g,Fs(_)),g},setUploadContext:function setUploadContext(t,a,c){var m=this.getFileInfo(t);m&&(m.ctx=a,c&&h.setItem(t,Fs(m)))},setComplete:function setComplete(t,a){var c=this.getFileInfo(t);c&&(c.modifyAt=Zn(),c.end=!0,a&&h.setItem(t,Fs(c)))},getUploadContext:function getUploadContext(t){var a=this.getFileInfo(t);return a?a.ctx:""},removeFileInfo:function removeFileInfo(t){0===indexOf(t).call(t,"_NosUploader_")&&h.removeItem(t)},clearExpiredInfo:function clearExpiredInfo(){var t,a="function"==typeof h.getKeys?h.getKeys():Fi(h),c=Zn(),g=[],_=n(a);try{for(_.s();!(t=_.n()).done;){var E=t.value;if(0===indexOf(E).call(E,"_NosUploader_")){var b=m.getFileInfo(E);null===b||c-b.modifyAt>S.expireTime?h.removeItem(E):g.push({fileInfo:b,key:E})}}}catch(t){_.e(t)}finally{_.f()}if(g.length>S.maxFileCache){var O,T,C=n(slice(O=sort(g).call(g,(function(t,a){return a.fileInfo.modifyAt-t.fileInfo.modifyAt}))).call(O,S.maxFileCache));try{for(C.s();!(T=C.n()).done;){var I,R=T.value;0===indexOf(I=R.key).call(I,"_NosUploader_")&&h.removeItem(R.key)}}catch(t){C.e(t)}finally{C.f()}}}},g=m;function u(t){return(u="function"==typeof nl&&"symbol"==typeof al?function(t){return typeof t}:function(t){return t&&"function"==typeof nl&&t.constructor===nl&&t!==nl.prototype?"symbol":typeof t})(t)}function f(t,a){return!a||"object"!==u(a)&&"function"!=typeof a?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):a}function l(t){var a="function"==typeof is?new is:void 0;return(l=function l(t){var c,h;if(null===t||(h=t,-1===indexOf(c=Function.toString.call(h)).call(c,"[native code]")))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,n)}function n(){return s(t,arguments,y(this).constructor)}return n.prototype=lt(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function s(t,a,c){return(s=p()?gs:function(t,a,c){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return c&&d(m,c.prototype),m}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!gs)return!1;if(gs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gs(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,a){return(d=ht||function(t,a){return t.__proto__=a,t})(t,a)}function y(t){return(y=ht?ss:function(t){return t.__proto__||ss(t)})(t)}var _=function(t){!function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");t.prototype=lt(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&d(t,a)}(r,t);var a,c,h=(a=r,c=p(),function(){var t,h=y(a);if(c){var m=y(this).constructor;t=gs(h,arguments,m)}else t=h.apply(this,arguments);return f(this,t)});function r(t,a){var c;return function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,r),(c=h.call(this,"NosUploadError:"+t)).errCode=a,c.errMsg=t,c}return r}(l(Error)),E=function e(t,a,c){if("uploading"===t.uploadState){var h=t.config,m=t.param,E=g.getUploadContext(t.fileKey);if(!E)return c(0);var b=new XMLHttpRequest,O=h.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName))+"?uploadContext"+"&context=".concat(E)+"&version=".concat(h.version);b.onreadystatechange=function(){var m;if("abort"!==t.uploadState&&4===b.readyState){var E,T,S,C;try{C=JSON.parse(b.responseText)}catch(t){C={errMsg:"JsonParseError in getOffset",errCode:500}}200===b.status?C.errCode?t.config.onError(new _(C.errMsg,C.errCode)):c(C.offset):b.status.toString().match(/^5/)?e(t,a-1,c):a>0?("function"==typeof(null===(m=h.logger)||void 0===m?void 0:m.error)&&h.logger.error(concat(E="getOffset(".concat(O,") error. retry after 3 seconds. ")).call(E,(new Date).toTimeString())),mi((function(){e(t,a-1,c)}),3500)):(g.removeFileInfo(t.fileKey),b.status?h.onError(new _(concat(T=concat(S="getOffset(".concat(O,") error: ")).call(S,b.status," ")).call(T,b.statusText))):h.onError(new _("getOffset(".concat(O,") error. no Error Code"))))}},b.open("get",O),b.setRequestHeader("x-nos-token",m.token),b.timeout=h.getOffsetTimeout,b.send()}},b=function e(t,a,c,h){if("uploading"===t.uploadState){var m=t.param,E=t.config,b=slice(File.prototype),O=void 0!==m.ctx?m.ctx:"",T=a+E.trunkSize>t.file.size,S=T?t.file.size:a+E.trunkSize,C=new XMLHttpRequest,I=E.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName));if(C.upload.onprogress=function(c){if("abort"!==t.uploadState){var h=0;c.lengthComputable?(h=(a+c.loaded)/t.file.size,E.onProgress(h),E.onUploadProgress({loaded:c.loaded,total:t.file.size,percentage:h,percentageText:(100*h).toFixed(2)+"%"})):E.onError(new _("browser does not support query upload progress"))}},C.onreadystatechange=function(){var m,b;if("abort"!==t.uploadState&&4===C.readyState){var O,S,R,M;try{M=JSON.parse(C.responseText)}catch(t){"function"==typeof(null===(m=E.logger)||void 0===m?void 0:m.error)&&E.logger.error("JsonParseError in uploadTrunk",t),M={errMsg:"JsonParseError in uploadTrunk"}}200===C.status?(t.setContext(M.context),T?(h(),t.setComplete()):e(t,M.offset,E.retryCount,h)):C.status.toString().match(/^5/)?c>0?e(t,a,c-1,h):(g.removeFileInfo(t.fileKey),E.onError(new _(M.errMsg,M.errCode))):c>0?("function"==typeof(null===(b=E.logger)||void 0===b?void 0:b.error)&&E.logger.error(concat(O="uploadTrunk(".concat(I,") error. retry after 3 seconds. ")).call(O,(new Date).toTimeString())),mi((function(){e(t,a,c-1,h)}),3500)):C.status?(g.removeFileInfo(t.fileKey),E.onError(new _(concat(S=concat(R="uploadTrunk(".concat(I,") error: ")).call(R,C.status," ")).call(S,C.statusText)))):E.onError(new _("uploadTrunk(".concat(I,") error. no Error Code. Please check your network")))}},C.open("post",I+"?offset=".concat(a)+"&complete=".concat(T)+"&context=".concat(O)+"&version=".concat(E.version)),C.setRequestHeader("x-nos-token",m.token),m.md5&&C.setRequestHeader("content-md5",m.md5),t.file.type&&C.setRequestHeader("content-type",t.file.type),C.timeout=E.trunkUploadTimeout,"undefined"!=typeof FileReader){var R=new FileReader;R.addEventListener("load",(function(t){var a;(null===(a=null==t?void 0:t.target)||void 0===a?void 0:a.result)instanceof ArrayBuffer&&t.target.result.byteLength>0?C.send(t.target.result):E.onError(new _("Read ArrayBuffer failed",194003))})),R.addEventListener("error",(function(t){var a=t.target.error;E.onError(new _("Read ArrayBuffer error. ".concat(a.toString()),194003))})),R.readAsArrayBuffer(b.call(t.file,a,S))}else C.send(b.call(t.file,a,S))}};function v(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}var O=function(){function e(t,a,c){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=c,this.file=t,this.param=a,this.fileKey=g.initFile(a,t,this.config.enableCache),this.resume()}var t;return(t=[{key:"resume",value:function value(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var a=this.config;E(this,a.retryCount,(function(c){b(t,c,a.retryCount,(function(){t.setUploadState("ended"),"function"==typeof a.onComplete&&a.onComplete(t.param)}))}))}}},{key:"pause",value:function value(){this.setUploadState("paused")}},{key:"abort",value:function value(){"ended"!==this.uploadState&&"abort"!==this.uploadState&&(this.setUploadState("abort"),this.config.onError(new _("Upload Aborted",10499)))}},{key:"setUploadState",value:function value(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function value(t){g.setUploadContext(this.fileKey,t,this.config.enableCache),this.param.ctx=t}},{key:"setComplete",value:function value(){g.setComplete(this.fileKey,this.config.enableCache),this.setUploadState("ended")}}])&&v(e.prototype,t),e}(),T={maxFileCache:1/0,expireTime:864e5,getFileUploadInformation:function getFileUploadInformation(t){var a=g.getFileKey(t),c=g.getFileInfo(a);return null===c?null:Zn()-c.modifyAt>T.expireTime?(g.removeFileInfo(a),null):{uploadInfo:wt({bucketName:c.bucket,objectName:c.obj,token:c.token,ctx:c.ctx},c.payload?{payload:c.payload}:{}),complete:c.end}},setMaxFileCache:function setMaxFileCache(t){T.maxFileCache=t},setExpireTime:function setExpireTime(t){T.expireTime=t},printCaches:function printCaches(){if("undefined"!=typeof localStorage)for(var t=0,a=Fi(localStorage);t<a.length;t++){var c=a[t],h=g.getFileInfo(c);h&&console.log(h,"modifiedAt",new Date(h.modifyAt).toTimeString())}},createConfig:function createConfig(t){return new c(t)},createTask:function createTask(t,a,c){return new O(t,a,c)}},S=T;return a.default}()})),Tm=createCommonjsModule((function(t,a){t.exports=function(){function object2String(t){if(t){var a,c="";return forEach$1(a=Fi(t)).call(a,(function(a,h){c+=0===h?"?":"&",c+=a+"="+t[a]})),c}return""}var t=function(t){function V2NIMError(a,c,h,m){var g;return(g=t.call(this,h)||this).source=a,g.code=c,g.desc=h,g.detail=m||{},g}return St(V2NIMError,t),V2NIMError}(Es(Error));function request(a,c){void 0===c&&(c={dataType:"json",method:"GET",timeout:5e3});var h="text"===c.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8",m="GET"===c.method?object2String(c.params):"";return new Xn((function(g,_){if(window.XMLHttpRequest){var E,b=new XMLHttpRequest;if(b.onreadystatechange=function(){if(4===b.readyState)if(200===b.status){try{E=JSON.parse(b.response||"{}")}catch(t){E=b.response}g({status:b.status,data:E})}else mi((function(){_(new t(1,b.status,"readyState: "+b.readyState+"; statusText: "+b.statusText))}),0)},b.open(c.method,""+a+m),b.timeout=c.timeout||5e3,b.setRequestHeader("Content-Type",h),c.headers)for(var O in c.headers)b.setRequestHeader(O,c.headers[O]);b.ontimeout=function(a){_(new t(1,408,a&&a.message?a.message:"request timeout"))},b.send(Fs(c.data))}else _(new t(2,10400,"request no suppout"))}))}return request}()})),Sm=console;var Cm=null,Im=null,Rm={setLogger:function setLogger(t){Sm=t},platform:"BROWSER",localStorage:window.localStorage,request:Tm,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h,m,g,_;return hl.wrap((function _callee$(E){for(;;)switch(E.prev=E.next){case 0:if(t.fileInput||t.file){E.next=2;break}throw new Error("File not exist");case 2:if(!t.file){E.next=6;break}m=t.file,E.next=20;break;case 6:if("string"!=typeof t.fileInput){E.next=15;break}if(!((g=document.getElementById(t.fileInput))&&g.files&&g.files[0])){E.next=12;break}m=g.files[0],E.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:E.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){E.next=19;break}m=t.fileInput.files[0],E.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&m.size>t.maxSize)){E.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+m.size);case 22:return E.next=24,new Xn((function(a,c){var h,g=Om.getFileUploadInformation(m),_=Om.createConfig({enableCache:!0,retryCount:0,directUploadAddr:t.chunkUploadHost,onError:function onError(t){c(t)},onUploadProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){a(t)}});if(g)if(g.complete)a(g.uploadInfo);else{h=Om.createTask(m,g.uploadInfo,_);try{t.onUploadStart&&t.onUploadStart(h)}catch(t){Sm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),h.abort(),c(t)}}else{h=Om.createTask(m,wt(wt({bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},t.md5?{md5:t.md5}:{}),t.payload?{payload:t.payload}:{}),_);try{t.onUploadStart&&t.onUploadStart(h)}catch(t){Sm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),h.abort(),c(t)}}}));case 24:return(_=E.sent).name=m.name,_.size=m.size,_.type=m.type,_.ext=lastIndexOf(a=_.name).call(a,".")>-1?slice(c=_.name).call(c,lastIndexOf(h=_.name).call(h,".")+1).toLowerCase():"",E.abrupt("return",_);case 30:case"end":return E.stop()}}),_callee)})))},getFileUploadInformation:function getFileUploadInformation(t){var a;if(t.file)a=t.file;else if("string"==typeof t.fileInput){var c=document.getElementById(t.fileInput);if(!(c&&c.files&&c.files[0]))throw new Error("Can not get file from fileInput");a=c.files[0]}else{if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0]))throw new Error("Can not get file from fileInput "+t.fileInput);a=t.fileInput.files[0]}return Om.getFileUploadInformation(a)},getSystemInfo:function getSystemInfo(){var t,a,c=im.version||"";if(isElectron())try{var h=navigator.userAgent.match(/Electron\/([\d.]+\d+)/);h&&h[1]&&"string"==typeof h[1]&&(c=h[1])}catch(t){}return{os:(null===(t=im.os)||void 0===t?void 0:t.family)||"",osVer:(null===(a=im.os)||void 0===a?void 0:a.version)||"",browser:im.name||"",browserVer:im.version||"",libEnv:"BROWSER",hostEnv:isElectron()?"Electron":isMobile()?"H5":isBrowser()?"BROWSER":"Unset",hostEnvEnum:isElectron()?Ud.Electron:isMobile()?Ud.H5:isBrowser()?Ud.BROWSER:Ud.Unset,hostEnvVer:c,userAgent:navigator&&navigator.userAgent,model:c,manufactor:im.name||""}},net:{getNetworkStatus:function getNetworkStatus(){return Xn.resolve({net_type:Bd.kStatNetTypeUnkonw,net_connect:"undefined"==typeof navigator||"boolean"!=typeof navigator.onLine||navigator.onLine})},onNetworkStatusChange:function onNetworkStatusChange(t){Cm=function onlineListener(){t({isConnected:!0,networkType:Bd.kStatNetTypeUnkonw})},Im=function offlineListener(){t({isConnected:!1,networkType:Bd.kStatNetTypeUnkonw})},window.addEventListener("online",Cm),window.addEventListener("offline",Im)},offNetworkStatusChange:function offNetworkStatusChange(){Cm&&window.removeEventListener("online",Cm),Im&&window.removeEventListener("offline",Im),Cm=null,Im=null}}};return function setAdapters(t){Vd(Qd,t)}(Rm),nm}));
|
|
13
|
+
!function(t,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a():"function"==typeof define&&define.amd?define(a):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=a()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var a={exports:{}};return t(a,a.exports),a.exports}var a,c,h=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},m=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},g=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),_=Function.prototype,E=_.apply,b=_.call,O="object"==typeof Reflect&&Reflect.apply||(g?b.bind(E):function(){return b.apply(E,arguments)}),T=Function.prototype,S=T.bind,C=T.call,I=g&&S.bind(C,C),R=g?function(t){return t&&I(t)}:function(t){return t&&function(){return C.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},M=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),k=Function.prototype.call,w=g?k.bind(k):function(){return k.apply(k,arguments)},N={}.propertyIsEnumerable,x=Object.getOwnPropertyDescriptor,A={f:x&&!N.call({1:2},1)?function propertyIsEnumerable(t){var a=x(this,t);return!!a&&a.enumerable}:N},createPropertyDescriptor=function(t,a){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:a}},P=R({}.toString),L=R("".slice),classofRaw=function(t){return L(P(t),8,-1)},D=Object,V=R("".split),j=fails((function(){return!D("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?V(t,""):D(t)}:D,isNullOrUndefined=function(t){return null==t},U=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw U("Can't call method on "+t);return t},toIndexedObject=function(t){return j(requireObjectCoercible(t))},B="object"==typeof document&&document.all,H=void 0===B&&void 0!==B?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===B}:function(t){return"object"==typeof t?null!==t:isCallable(t)},G={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,a){return arguments.length<2?aFunction(G[t])||aFunction(m[t]):G[t]&&G[t][a]||m[t]&&m[t][a]},K=R({}.isPrototypeOf),q=getBuiltIn("navigator","userAgent")||"",W=m.process,z=m.Deno,$=W&&W.versions||z&&z.version,Y=$&&$.v8;Y&&(c=(a=Y.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!c&&q&&(!(a=q.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=q.match(/Chrome\/(\d+)/))&&(c=+a[1]);var X,Q=c,J=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&Q&&Q<41})),Z=J&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ee=Object,te=Z?function(t){return"symbol"==typeof t}:function(t){var a=getBuiltIn("Symbol");return isCallable(a)&&K(a.prototype,ee(t))},re=String,tryToString=function(t){try{return re(t)}catch(t){return"Object"}},oe=TypeError,aCallable=function(t){if(isCallable(t))return t;throw oe(tryToString(t)+" is not a function")},getMethod=function(t,a){var c=t[a];return isNullOrUndefined(c)?void 0:aCallable(c)},ne=TypeError,ie=Object.defineProperty,ae="__core-js_shared__",se=m[ae]||function(t,a){try{ie(m,t,{value:a,configurable:!0,writable:!0})}catch(c){m[t]=a}return a}(ae,{}),ce=createCommonjsModule((function(t){(t.exports=function(t,a){return se[t]||(se[t]=void 0!==a?a:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ue=Object,toObject=function(t){return ue(requireObjectCoercible(t))},le=R({}.hasOwnProperty),de=Object.hasOwn||function hasOwn(t,a){return le(toObject(t),a)},fe=0,pe=Math.random(),he=R(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+he(++fe+pe,36)},me=ce("wks"),ge=m.Symbol,ve=ge&&ge.for,ye=Z?ge:ge&&ge.withoutSetter||uid,wellKnownSymbol=function(t){if(!de(me,t)||!J&&"string"!=typeof me[t]){var a="Symbol."+t;J&&de(ge,t)?me[t]=ge[t]:me[t]=Z&&ve?ve(a):ye(a)}return me[t]},_e=TypeError,Ee=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,a){if(!H(t)||te(t))return t;var c,h=getMethod(t,Ee);if(h){if(void 0===a&&(a="default"),c=w(h,t,a),!H(c)||te(c))return c;throw _e("Can't convert object to primitive value")}return void 0===a&&(a="number"),function(t,a){var c,h;if("string"===a&&isCallable(c=t.toString)&&!H(h=w(c,t)))return h;if(isCallable(c=t.valueOf)&&!H(h=w(c,t)))return h;if("string"!==a&&isCallable(c=t.toString)&&!H(h=w(c,t)))return h;throw ne("Can't convert object to primitive value")}(t,a)},toPropertyKey=function(t){var a=toPrimitive(t,"string");return te(a)?a:a+""},be=m.document,Oe=H(be)&&H(be.createElement),documentCreateElement=function(t){return Oe?be.createElement(t):{}},Te=!M&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),Se=Object.getOwnPropertyDescriptor,Ce={f:M?Se:function getOwnPropertyDescriptor(t,a){if(t=toIndexedObject(t),a=toPropertyKey(a),Te)try{return Se(t,a)}catch(t){}if(de(t,a))return createPropertyDescriptor(!w(A.f,t,a),t[a])}},Ie=/#|\.prototype\./,isForced=function(t,a){var c=Me[Re(t)];return c==we||c!=ke&&(isCallable(a)?fails(a):!!a)},Re=isForced.normalize=function(t){return String(t).replace(Ie,".").toLowerCase()},Me=isForced.data={},ke=isForced.NATIVE="N",we=isForced.POLYFILL="P",Ne=isForced,xe=R(R.bind),functionBindContext=function(t,a){return aCallable(t),void 0===a?t:g?xe(t,a):function(){return t.apply(a,arguments)}},Ae=M&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Pe=String,Le=TypeError,anObject=function(t){if(H(t))return t;throw Le(Pe(t)+" is not an object")},De=TypeError,Ve=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,je="enumerable",Ue="configurable",Be="writable",He={f:M?Ae?function defineProperty(t,a,c){if(anObject(t),a=toPropertyKey(a),anObject(c),"function"==typeof t&&"prototype"===a&&"value"in c&&Be in c&&!c.writable){var h=Fe(t,a);h&&h.writable&&(t[a]=c.value,c={configurable:Ue in c?c.configurable:h.configurable,enumerable:je in c?c.enumerable:h.enumerable,writable:!1})}return Ve(t,a,c)}:Ve:function defineProperty(t,a,c){if(anObject(t),a=toPropertyKey(a),anObject(c),Te)try{return Ve(t,a,c)}catch(t){}if("get"in c||"set"in c)throw De("Accessors not supported");return"value"in c&&(t[a]=c.value),t}},Ge=M?function(t,a,c){return He.f(t,a,createPropertyDescriptor(1,c))}:function(t,a,c){return t[a]=c,t},Ke=Ce.f,wrapConstructor=function(t){var Wrapper=function(a,c,h){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(a);case 2:return new t(a,c)}return new t(a,c,h)}return O(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,a){var c,h,g,_,E,b,O,T,S=t.target,C=t.global,I=t.stat,M=t.proto,k=C?m:I?m[S]:(m[S]||{}).prototype,w=C?G:G[S]||Ge(G,S,{})[S],N=w.prototype;for(g in a)c=!Ne(C?g:S+(I?".":"#")+g,t.forced)&&k&&de(k,g),E=w[g],c&&(b=t.dontCallGetSet?(T=Ke(k,g))&&T.value:k[g]),_=c&&b?b:a[g],c&&typeof E==typeof _||(O=t.bind&&c?functionBindContext(_,m):t.wrap&&c?wrapConstructor(_):M&&isCallable(_)?R(_):_,(t.sham||_&&_.sham||E&&E.sham)&&Ge(O,"sham",!0),Ge(w,g,O),M&&(de(G,h=S+"Prototype")||Ge(G,h,{}),Ge(G[h],g,_),t.real&&N&&!N[g]&&Ge(N,g,_)))},qe=Math.ceil,We=Math.floor,ze=Math.trunc||function trunc(t){var a=+t;return(a>0?We:qe)(a)},toIntegerOrInfinity=function(t){var a=+t;return a!=a||0===a?0:ze(a)},$e=Math.max,Ye=Math.min,toAbsoluteIndex=function(t,a){var c=toIntegerOrInfinity(t);return c<0?$e(c+a,0):Ye(c,a)},Xe=Math.min,lengthOfArrayLike=function(t){return(a=t.length)>0?Xe(toIntegerOrInfinity(a),9007199254740991):0;var a},createMethod$4=function(t){return function(a,c,h){var m,g=toIndexedObject(a),_=lengthOfArrayLike(g),E=toAbsoluteIndex(h,_);if(t&&c!=c){for(;_>E;)if((m=g[E++])!=m)return!0}else for(;_>E;E++)if((t||E in g)&&g[E]===c)return t||E||0;return!t&&-1}},Qe={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Je={},Ze=Qe.indexOf,et=R([].push),objectKeysInternal=function(t,a){var c,h=toIndexedObject(t),m=0,g=[];for(c in h)!de(Je,c)&&de(h,c)&&et(g,c);for(;a.length>m;)de(h,c=a[m++])&&(~Ze(g,c)||et(g,c));return g},tt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=Object.keys||function keys(t){return objectKeysInternal(t,tt)},ot=M&&!Ae?Object.defineProperties:function defineProperties(t,a){anObject(t);for(var c,h=toIndexedObject(a),m=rt(a),g=m.length,_=0;g>_;)He.f(t,c=m[_++],h[c]);return t},nt={f:ot},it=getBuiltIn("document","documentElement"),at=ce("keys"),sharedKey=function(t){return at[t]||(at[t]=uid(t))},st=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var a=t.parentWindow.Object;return t=null,a},NullProtoObject=function(){try{X=new ActiveXObject("htmlfile")}catch(t){}var t,a;NullProtoObject="undefined"!=typeof document?document.domain&&X?NullProtoObjectViaActiveX(X):((a=documentCreateElement("iframe")).style.display="none",it.appendChild(a),a.src=String("javascript:"),(t=a.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(X);for(var c=tt.length;c--;)delete NullProtoObject.prototype[tt[c]];return NullProtoObject()};Je[st]=!0;var ct=Object.create||function create(t,a){var c;return null!==t?(EmptyConstructor.prototype=anObject(t),c=new EmptyConstructor,EmptyConstructor.prototype=null,c[st]=t):c=NullProtoObject(),void 0===a?c:nt.f(c,a)};_export({target:"Object",stat:!0,sham:!M},{create:ct});var ut=G.Object,lt=function create(t,a){return ut.create(t,a)},dt=String,ft=TypeError,pt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,a=!1,c={};try{(t=R(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(c,[]),a=c instanceof Array}catch(t){}return function setPrototypeOf(c,h){return anObject(c),function(t){if("object"==typeof t||isCallable(t))return t;throw ft("Can't set "+dt(t)+" as a prototype")}(h),a?t(c,h):c.__proto__=h,c}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:pt});var ht=G.Object.setPrototypeOf,mt=R([].slice),gt=Function,vt=R([].concat),yt=R([].join),_t={},construct$8=function(t,a,c){if(!de(_t,a)){for(var h=[],m=0;m<a;m++)h[m]="a["+m+"]";_t[a]=gt("C,a","return new C("+yt(h,",")+")")}return _t[a](t,c)},Et=g?gt.bind:function bind(t){var a=aCallable(this),c=a.prototype,h=mt(arguments,1),m=function bound(){var c=vt(h,mt(arguments));return this instanceof m?construct$8(a,c.length,c):a.apply(t,c)};return H(c)&&(m.prototype=c),m};_export({target:"Function",proto:!0,forced:Function.bind!==Et},{bind:Et});var entryVirtual=function(t){return G[t+"Prototype"]},bt=entryVirtual("Function").bind,Ot=Function.prototype,bind$1=function(t){var a=t.bind;return t===Ot||K(Ot,t)&&a===Ot.bind?bt:a},Tt=createCommonjsModule((function(t){function _setPrototypeOf(a,c){var h;return t.exports=_setPrototypeOf=ht?bind$1(h=ht).call(h):function _setPrototypeOf(t,a){return t.__proto__=a,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(a,c)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),St=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,a){t.prototype=lt(a.prototype),t.prototype.constructor=t,Tt(t,a)},t.exports.__esModule=!0,t.exports.default=t.exports})));_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Ct={f:Object.getOwnPropertySymbols},It=Object.assign,Rt=Object.defineProperty,Mt=R([].concat),kt=!It||fails((function(){if(M&&1!==It({b:1},It(Rt({},"a",{enumerable:!0,get:function(){Rt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},a={},c=Symbol(),h="abcdefghijklmnopqrst";return t[c]=7,h.split("").forEach((function(t){a[t]=t})),7!=It({},t)[c]||rt(It({},a)).join("")!=h}))?function assign(t,a){for(var c=toObject(t),h=arguments.length,m=1,g=Ct.f,_=A.f;h>m;)for(var E,b=j(arguments[m++]),O=g?Mt(rt(b),g(b)):rt(b),T=O.length,S=0;T>S;)E=O[S++],M&&!w(_,b,E)||(c[E]=b[E]);return c}:It;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==kt},{assign:kt});var wt=G.Object.assign,Nt=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),xt=sharedKey("IE_PROTO"),At=Object,Pt=At.prototype,Lt=Nt?At.getPrototypeOf:function(t){var a=toObject(t);if(de(a,xt))return a[xt];var c=a.constructor;return isCallable(c)&&a instanceof c?c.prototype:a instanceof At?Pt:null},Dt=tt.concat("length","prototype"),Vt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Dt)}},Ft=R([].concat),jt=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var a=Vt.f(anObject(t)),c=Ct.f;return c?Ft(a,c(t)):a},Ut=Error,Bt=R("".replace),Ht=String(Ut("zxcasd").stack),Gt=/\n\s*at [^:]*:[^\n]*/,Kt=Gt.test(Ht),errorStackClear=function(t,a){if(Kt&&"string"==typeof t&&!Ut.prepareStackTrace)for(;a--;)t=Bt(t,Gt,"");return t},installErrorCause=function(t,a){H(a)&&"cause"in a&&Ge(t,"cause",a.cause)},qt={},Wt=wellKnownSymbol("iterator"),zt=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(qt.Array===t||zt[Wt]===t)},$t={};$t[wellKnownSymbol("toStringTag")]="z";var Yt="[object z]"===String($t),Xt=wellKnownSymbol("toStringTag"),Qt=Object,Jt="Arguments"==classofRaw(function(){return arguments}()),Zt=Yt?classofRaw:function(t){var a,c,h;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,a){try{return t[a]}catch(t){}}(a=Qt(t),Xt))?c:Jt?classofRaw(a):"Object"==(h=classofRaw(a))&&isCallable(a.callee)?"Arguments":h},er=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,er)||getMethod(t,"@@iterator")||qt[Zt(t)]},tr=TypeError,getIterator=function(t,a){var c=arguments.length<2?getIteratorMethod$5(t):a;if(aCallable(c))return anObject(w(c,t));throw tr(tryToString(t)+" is not iterable")},iteratorClose=function(t,a,c){var h,m;anObject(t);try{if(!(h=getMethod(t,"return"))){if("throw"===a)throw c;return c}h=w(h,t)}catch(t){m=!0,h=t}if("throw"===a)throw c;if(m)throw h;return anObject(h),c},rr=TypeError,Result=function(t,a){this.stopped=t,this.result=a},or=Result.prototype,iterate=function(t,a,c){var h,m,g,_,E,b,O,T=c&&c.that,S=!(!c||!c.AS_ENTRIES),C=!(!c||!c.IS_RECORD),I=!(!c||!c.IS_ITERATOR),R=!(!c||!c.INTERRUPTED),M=functionBindContext(a,T),stop=function(t){return h&&iteratorClose(h,"normal",t),new Result(!0,t)},callFn=function(t){return S?(anObject(t),R?M(t[0],t[1],stop):M(t[0],t[1])):R?M(t,stop):M(t)};if(C)h=t.iterator;else if(I)h=t;else{if(!(m=getIteratorMethod$5(t)))throw rr(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(m)){for(g=0,_=lengthOfArrayLike(t);_>g;g++)if((E=callFn(t[g]))&&K(or,E))return E;return new Result(!1)}h=getIterator(t,m)}for(b=C?t.next:h.next;!(O=w(b,h)).done;){try{E=callFn(O.value)}catch(t){iteratorClose(h,"throw",t)}if("object"==typeof E&&E&&K(or,E))return E}return new Result(!1)},nr=String,toString$1=function(t){if("Symbol"===Zt(t))throw TypeError("Cannot convert a Symbol value to a string");return nr(t)},normalizeStringArgument=function(t,a){return void 0===t?arguments.length<2?"":a:toString$1(t)},ir=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),ar=wellKnownSymbol("toStringTag"),sr=Error,cr=[].push,ur=function AggregateError(t,a){var c,h=arguments.length>2?arguments[2]:void 0,m=K(lr,this);pt?c=pt(sr(),m?Lt(this):lr):(c=m?this:ct(lr),Ge(c,ar,"Error")),void 0!==a&&Ge(c,"message",normalizeStringArgument(a)),ir&&Ge(c,"stack",errorStackClear(c.stack,1)),installErrorCause(c,h);var g=[];return iterate(t,cr,{that:g}),Ge(c,"errors",g),c};pt?pt(ur,sr):function(t,a,c){for(var h=jt(a),m=He.f,g=Ce.f,_=0;_<h.length;_++){var E=h[_];de(t,E)||c&&de(c,E)||m(t,E,g(a,E))}}(ur,sr,{name:!0});var lr=ur.prototype=ct(sr.prototype,{constructor:createPropertyDescriptor(1,ur),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:ur});var dr,fr,pr,hr=m.WeakMap,mr=isCallable(hr)&&/native code/.test(String(hr)),gr="Object already initialized",vr=m.TypeError,yr=m.WeakMap;if(mr||se.state){var _r=se.state||(se.state=new yr),Er=R(_r.get),br=R(_r.has),Or=R(_r.set);dr=function(t,a){if(br(_r,t))throw vr(gr);return a.facade=t,Or(_r,t,a),a},fr=function(t){return Er(_r,t)||{}},pr=function(t){return br(_r,t)}}else{var Tr=sharedKey("state");Je[Tr]=!0,dr=function(t,a){if(de(t,Tr))throw vr(gr);return a.facade=t,Ge(t,Tr,a),a},fr=function(t){return de(t,Tr)?t[Tr]:{}},pr=function(t){return de(t,Tr)}}var Sr,Cr,Ir,Rr={set:dr,get:fr,has:pr,enforce:function(t){return pr(t)?fr(t):dr(t,{})},getterFor:function(t){return function(a){var c;if(!H(a)||(c=fr(a)).type!==t)throw vr("Incompatible receiver, "+t+" required");return c}}},Mr=Function.prototype,kr=M&&Object.getOwnPropertyDescriptor,wr=de(Mr,"name"),Nr={EXISTS:wr,PROPER:wr&&"something"===function something(){}.name,CONFIGURABLE:wr&&(!M||M&&kr(Mr,"name").configurable)},defineBuiltIn=function(t,a,c,h){return h&&h.enumerable?t[a]=c:Ge(t,a,c),t},xr=wellKnownSymbol("iterator"),Ar=!1;[].keys&&("next"in(Ir=[].keys())?(Cr=Lt(Lt(Ir)))!==Object.prototype&&(Sr=Cr):Ar=!0);var Pr=!H(Sr)||fails((function(){var t={};return Sr[xr].call(t)!==t}));Sr=Pr?{}:ct(Sr),isCallable(Sr[xr])||defineBuiltIn(Sr,xr,(function(){return this}));var Lr={IteratorPrototype:Sr,BUGGY_SAFARI_ITERATORS:Ar},Dr=Yt?{}.toString:function toString(){return"[object "+Zt(this)+"]"},Vr=He.f,Fr=wellKnownSymbol("toStringTag"),setToStringTag=function(t,a,c,h){if(t){var m=c?t:t.prototype;de(m,Fr)||Vr(m,Fr,{configurable:!0,value:a}),h&&!Yt&&Ge(m,"toString",Dr)}},jr=Lr.IteratorPrototype,returnThis$1=function(){return this},Ur=Nr.PROPER,Br=Lr.BUGGY_SAFARI_ITERATORS,Hr=wellKnownSymbol("iterator"),Gr="keys",Kr="values",qr="entries",returnThis=function(){return this},iteratorDefine=function(t,a,c,h,m,g,_){!function(t,a,c,h){var m=a+" Iterator";t.prototype=ct(jr,{next:createPropertyDescriptor(+!h,c)}),setToStringTag(t,m,!1,!0),qt[m]=returnThis$1}(c,a,h);var E,b,O,getIterationMethod=function(t){if(t===m&&R)return R;if(!Br&&t in C)return C[t];switch(t){case Gr:return function keys(){return new c(this,t)};case Kr:return function values(){return new c(this,t)};case qr:return function entries(){return new c(this,t)}}return function(){return new c(this)}},T=a+" Iterator",S=!1,C=t.prototype,I=C[Hr]||C["@@iterator"]||m&&C[m],R=!Br&&I||getIterationMethod(m),M="Array"==a&&C.entries||I;if(M&&(E=Lt(M.call(new t)))!==Object.prototype&&E.next&&(setToStringTag(E,T,!0,!0),qt[T]=returnThis),Ur&&m==Kr&&I&&I.name!==Kr&&(S=!0,R=function values(){return w(I,this)}),m)if(b={values:getIterationMethod(Kr),keys:g?R:getIterationMethod(Gr),entries:getIterationMethod(qr)},_)for(O in b)(Br||S||!(O in C))&&defineBuiltIn(C,O,b[O]);else _export({target:a,proto:!0,forced:Br||S},b);return _&&C[Hr]!==R&&defineBuiltIn(C,Hr,R,{name:m}),qt[a]=R,b};He.f;var Wr="Array Iterator",zr=Rr.set,$r=Rr.getterFor(Wr);iteratorDefine(Array,"Array",(function(t,a){zr(this,{type:Wr,target:toIndexedObject(t),index:0,kind:a})}),(function(){var t=$r(this),a=t.target,c=t.kind,h=t.index++;return!a||h>=a.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==c?{value:h,done:!1}:"values"==c?{value:a[h],done:!1}:{value:[h,a[h]],done:!1}}),"values"),qt.Arguments=qt.Array;var Yr="process"==classofRaw(m.process),Xr=wellKnownSymbol("species"),setSpecies=function(t){var a=getBuiltIn(t),c=He.f;M&&a&&!a[Xr]&&c(a,Xr,{configurable:!0,get:function(){return this}})},Qr=TypeError,anInstance=function(t,a){if(K(a,t))return t;throw Qr("Incorrect invocation")},Jr=R(Function.toString);isCallable(se.inspectSource)||(se.inspectSource=function(t){return Jr(t)});var Zr=se.inspectSource,noop$1=function(){},eo=[],to=getBuiltIn("Reflect","construct"),ro=/^\s*(?:class|function)\b/,oo=R(ro.exec),no=!ro.exec(noop$1),io=function isConstructor(t){if(!isCallable(t))return!1;try{return to(noop$1,eo,t),!0}catch(t){return!1}},ao=function isConstructor(t){if(!isCallable(t))return!1;switch(Zt(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return no||!!oo(ro,Zr(t))}catch(t){return!0}};ao.sham=!0;var so,co,uo,lo,fo=!to||fails((function(){var t;return io(io.call)||!io(Object)||!io((function(){t=!0}))||t}))?ao:io,po=TypeError,aConstructor=function(t){if(fo(t))return t;throw po(tryToString(t)+" is not a constructor")},ho=wellKnownSymbol("species"),speciesConstructor=function(t,a){var c,h=anObject(t).constructor;return void 0===h||isNullOrUndefined(c=anObject(h)[ho])?a:aConstructor(c)},mo=TypeError,validateArgumentsLength=function(t,a){if(t<a)throw mo("Not enough arguments");return t},go=/(?:ipad|iphone|ipod).*applewebkit/i.test(q),vo=m.setImmediate,yo=m.clearImmediate,_o=m.process,Eo=m.Dispatch,bo=m.Function,Oo=m.MessageChannel,To=m.String,So=0,Co={},Io="onreadystatechange";try{so=m.location}catch(t){}var run=function(t){if(de(Co,t)){var a=Co[t];delete Co[t],a()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){m.postMessage(To(t),so.protocol+"//"+so.host)};vo&&yo||(vo=function setImmediate(t){validateArgumentsLength(arguments.length,1);var a=isCallable(t)?t:bo(t),c=mt(arguments,1);return Co[++So]=function(){O(a,void 0,c)},co(So),So},yo=function clearImmediate(t){delete Co[t]},Yr?co=function(t){_o.nextTick(runner(t))}:Eo&&Eo.now?co=function(t){Eo.now(runner(t))}:Oo&&!go?(lo=(uo=new Oo).port2,uo.port1.onmessage=listener,co=functionBindContext(lo.postMessage,lo)):m.addEventListener&&isCallable(m.postMessage)&&!m.importScripts&&so&&"file:"!==so.protocol&&!fails(post)?(co=post,m.addEventListener("message",listener,!1)):co=Io in documentCreateElement("script")?function(t){it.appendChild(documentCreateElement("script")).onreadystatechange=function(){it.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var Ro,Mo,ko,wo,No,xo,Ao,Po,Lo={set:vo,clear:yo},Do=/ipad|iphone|ipod/i.test(q)&&void 0!==m.Pebble,Vo=/web0s(?!.*chrome)/i.test(q),Fo=Ce.f,jo=Lo.set,Uo=m.MutationObserver||m.WebKitMutationObserver,Bo=m.document,Ho=m.process,Go=m.Promise,Ko=Fo(m,"queueMicrotask"),qo=Ko&&Ko.value;qo||(Ro=function(){var t,a;for(Yr&&(t=Ho.domain)&&t.exit();Mo;){a=Mo.fn,Mo=Mo.next;try{a()}catch(t){throw Mo?wo():ko=void 0,t}}ko=void 0,t&&t.enter()},go||Yr||Vo||!Uo||!Bo?!Do&&Go&&Go.resolve?((Ao=Go.resolve(void 0)).constructor=Go,Po=functionBindContext(Ao.then,Ao),wo=function(){Po(Ro)}):Yr?wo=function(){Ho.nextTick(Ro)}:(jo=functionBindContext(jo,m),wo=function(){jo(Ro)}):(No=!0,xo=Bo.createTextNode(""),new Uo(Ro).observe(xo,{characterData:!0}),wo=function(){xo.data=No=!No}));var Wo=qo||function(t){var a={fn:t,next:void 0};ko&&(ko.next=a),Mo||(Mo=a,wo()),ko=a},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var a={item:t,next:null};this.head?this.tail.next=a:this.head=a,this.tail=a},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var zo,$o,Yo=Queue,Xo=m.Promise,Qo="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Jo=!Qo&&!Yr&&"object"==typeof window&&"object"==typeof document,Zo=Xo&&Xo.prototype,en=wellKnownSymbol("species"),tn=!1,rn=isCallable(m.PromiseRejectionEvent),nn=Ne("Promise",(function(){var t=Zr(Xo),a=t!==String(Xo);if(!a&&66===Q)return!0;if(!Zo.catch||!Zo.finally)return!0;if(!Q||Q<51||!/native code/.test(t)){var c=new Xo((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((c.constructor={})[en]=FakePromise,!(tn=c.then((function(){}))instanceof FakePromise))return!0}return!a&&(Jo||Qo)&&!rn})),an={CONSTRUCTOR:nn,REJECTION_EVENT:rn,SUBCLASSING:tn},sn=TypeError,PromiseCapability=function(t){var a,c;this.promise=new t((function(t,h){if(void 0!==a||void 0!==c)throw sn("Bad Promise constructor");a=t,c=h})),this.resolve=aCallable(a),this.reject=aCallable(c)},cn={f:function(t){return new PromiseCapability(t)}},un=Lo.set,ln="Promise",dn=an.CONSTRUCTOR,fn=an.REJECTION_EVENT,pn=Rr.getterFor(ln),hn=Rr.set,mn=Xo&&Xo.prototype,gn=Xo,vn=mn,yn=m.TypeError,_n=m.document,En=m.process,bn=cn.f,On=bn,Tn=!!(_n&&_n.createEvent&&m.dispatchEvent),Sn="unhandledrejection",isThenable=function(t){var a;return!(!H(t)||!isCallable(a=t.then))&&a},callReaction=function(t,a){var c,h,m,g=a.value,_=1==a.state,E=_?t.ok:t.fail,b=t.resolve,O=t.reject,T=t.domain;try{E?(_||(2===a.rejection&&onHandleUnhandled(a),a.rejection=1),!0===E?c=g:(T&&T.enter(),c=E(g),T&&(T.exit(),m=!0)),c===t.promise?O(yn("Promise-chain cycle")):(h=isThenable(c))?w(h,c,b,O):b(c)):O(g)}catch(t){T&&!m&&T.exit(),O(t)}},notify=function(t,a){t.notified||(t.notified=!0,Wo((function(){for(var c,h=t.reactions;c=h.get();)callReaction(c,t);t.notified=!1,a&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,a,c){var h,g;Tn?((h=_n.createEvent("Event")).promise=a,h.reason=c,h.initEvent(t,!1,!0),m.dispatchEvent(h)):h={promise:a,reason:c},!fn&&(g=m["on"+t])?g(h):t===Sn&&function(t,a){var c=m.console;c&&c.error&&(1==arguments.length?c.error(t):c.error(t,a))}("Unhandled promise rejection",c)},onUnhandled=function(t){w(un,m,(function(){var a,c=t.facade,h=t.value;if(isUnhandled(t)&&(a=perform((function(){Yr?En.emit("unhandledRejection",h,c):dispatchEvent(Sn,c,h)})),t.rejection=Yr||isUnhandled(t)?2:1,a.error))throw a.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){w(un,m,(function(){var a=t.facade;Yr?En.emit("rejectionHandled",a):dispatchEvent("rejectionhandled",a,t.value)}))},bind=function(t,a,c){return function(h){t(a,h,c)}},internalReject=function(t,a,c){t.done||(t.done=!0,c&&(t=c),t.value=a,t.state=2,notify(t,!0))},internalResolve=function(t,a,c){if(!t.done){t.done=!0,c&&(t=c);try{if(t.facade===a)throw yn("Promise can't be resolved itself");var h=isThenable(a);h?Wo((function(){var c={done:!1};try{w(h,a,bind(internalResolve,c,t),bind(internalReject,c,t))}catch(a){internalReject(c,a,t)}})):(t.value=a,t.state=1,notify(t,!1))}catch(a){internalReject({done:!1},a,t)}}};dn&&(vn=(gn=function Promise(t){anInstance(this,vn),aCallable(t),w(zo,this);var a=pn(this);try{t(bind(internalResolve,a),bind(internalReject,a))}catch(t){internalReject(a,t)}}).prototype,(zo=function Promise(t){hn(this,{type:ln,done:!1,notified:!1,parent:!1,reactions:new Yo,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(vn,"then",(function then(t,a){var c=pn(this),h=bn(speciesConstructor(this,gn));return c.parent=!0,h.ok=!isCallable(t)||t,h.fail=isCallable(a)&&a,h.domain=Yr?En.domain:void 0,0==c.state?c.reactions.add(h):Wo((function(){callReaction(h,c)})),h.promise})),$o=function(){var t=new zo,a=pn(t);this.promise=t,this.resolve=bind(internalResolve,a),this.reject=bind(internalReject,a)},cn.f=bn=function(t){return t===gn||undefined===t?new $o(t):On(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:dn},{Promise:gn}),setToStringTag(gn,ln,!1,!0),setSpecies(ln);var Cn=wellKnownSymbol("iterator"),In=!1;try{var Rn=0,Mn={next:function(){return{done:!!Rn++}},return:function(){In=!0}};Mn[Cn]=function(){return this},Array.from(Mn,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,a){if(!a&&!In)return!1;var c=!1;try{var h={};h[Cn]=function(){return{next:function(){return{done:c=!0}}}},t(h)}catch(t){}return c},kn=an.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Xo.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:kn},{all:function all(t){var a=this,c=cn.f(a),h=c.resolve,m=c.reject,g=perform((function(){var c=aCallable(a.resolve),g=[],_=0,E=1;iterate(t,(function(t){var b=_++,O=!1;E++,w(c,a,t).then((function(t){O||(O=!0,g[b]=t,--E||h(g))}),m)})),--E||h(g)}));return g.error&&m(g.value),c.promise}});var wn=an.CONSTRUCTOR;Xo&&Xo.prototype,_export({target:"Promise",proto:!0,forced:wn,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:kn},{race:function race(t){var a=this,c=cn.f(a),h=c.reject,m=perform((function(){var m=aCallable(a.resolve);iterate(t,(function(t){w(m,a,t).then(c.resolve,h)}))}));return m.error&&h(m.value),c.promise}}),_export({target:"Promise",stat:!0,forced:an.CONSTRUCTOR},{reject:function reject(t){var a=cn.f(this);return w(a.reject,void 0,t),a.promise}});var promiseResolve=function(t,a){if(anObject(t),H(a)&&a.constructor===t)return a;var c=cn.f(t);return(0,c.resolve)(a),c.promise},Nn=an.CONSTRUCTOR,xn=getBuiltIn("Promise"),An=!Nn;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(An&&this===xn?Xo:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var a=this,c=cn.f(a),h=c.resolve,m=c.reject,g=perform((function(){var c=aCallable(a.resolve),m=[],g=0,_=1;iterate(t,(function(t){var E=g++,b=!1;_++,w(c,a,t).then((function(t){b||(b=!0,m[E]={status:"fulfilled",value:t},--_||h(m))}),(function(t){b||(b=!0,m[E]={status:"rejected",reason:t},--_||h(m))}))})),--_||h(m)}));return g.error&&m(g.value),c.promise}});var Pn="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var a=this,c=getBuiltIn("AggregateError"),h=cn.f(a),m=h.resolve,g=h.reject,_=perform((function(){var h=aCallable(a.resolve),_=[],E=0,b=1,O=!1;iterate(t,(function(t){var T=E++,S=!1;b++,w(h,a,t).then((function(t){S||O||(O=!0,m(t))}),(function(t){S||O||(S=!0,_[T]=t,--b||g(new c(_,Pn)))}))})),--b||g(new c(_,Pn))}));return _.error&&g(_.value),h.promise}});var Ln=Xo&&Xo.prototype,Dn=!!Xo&&fails((function(){Ln.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:Dn},{finally:function(t){var a=speciesConstructor(this,getBuiltIn("Promise")),c=isCallable(t);return this.then(c?function(c){return promiseResolve(a,t()).then((function(){return c}))}:t,c?function(c){return promiseResolve(a,t()).then((function(){throw c}))}:t)}});var Vn=R("".charAt),Fn=R("".charCodeAt),jn=R("".slice),createMethod$3=function(t){return function(a,c){var h,m,g=toString$1(requireObjectCoercible(a)),_=toIntegerOrInfinity(c),E=g.length;return _<0||_>=E?t?"":void 0:(h=Fn(g,_))<55296||h>56319||_+1===E||(m=Fn(g,_+1))<56320||m>57343?t?Vn(g,_):h:t?jn(g,_,_+2):m-56320+(h-55296<<10)+65536}},Un={codeAt:createMethod$3(!1),charAt:createMethod$3(!0)}.charAt,Bn="String Iterator",Hn=Rr.set,Gn=Rr.getterFor(Bn);iteratorDefine(String,"String",(function(t){Hn(this,{type:Bn,string:toString$1(t),index:0})}),(function next(){var t,a=Gn(this),c=a.string,h=a.index;return h>=c.length?{value:void 0,done:!0}:(t=Un(c,h),a.index+=t.length,{value:t,done:!1})}));var Kn=G.Promise,qn=wellKnownSymbol("toStringTag");for(var Wn in{CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}){var zn=m[Wn],$n=zn&&zn.prototype;$n&&Zt($n)!==qn&&Ge($n,qn,Wn),qt[Wn]=qt.Array}var Yn=Kn;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var a=cn.f(this),c=perform(t);return(c.error?a.reject:a.resolve)(c.value),a.promise}});var Xn=Yn,Qn=Date,Jn=R(Qn.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Jn(new Qn)}});var Zn=G.Date.now,ei=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},ti=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw ti("Maximum allowed index exceeded");return t},createProperty=function(t,a,c){var h=toPropertyKey(a);h in t?He.f(t,h,createPropertyDescriptor(0,c)):t[h]=c},ri=wellKnownSymbol("species"),oi=Array,arraySpeciesCreate=function(t,a){return new(function(t){var a;return ei(t)&&(a=t.constructor,(fo(a)&&(a===oi||ei(a.prototype))||H(a)&&null===(a=a[ri]))&&(a=void 0)),void 0===a?oi:a}(t))(0===a?0:a)},ni=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return Q>=51||!fails((function(){var a=[];return(a.constructor={})[ni]=function(){return{foo:1}},1!==a[t](Boolean).foo}))},ii=wellKnownSymbol("isConcatSpreadable"),ai=Q>=51||!fails((function(){var t=[];return t[ii]=!1,t.concat()[0]!==t})),si=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!H(t))return!1;var a=t[ii];return void 0!==a?!!a:ei(t)};_export({target:"Array",proto:!0,arity:1,forced:!ai||!si},{concat:function concat(t){var a,c,h,m,g,_=toObject(this),E=arraySpeciesCreate(_,0),b=0;for(a=-1,h=arguments.length;a<h;a++)if(isConcatSpreadable(g=-1===a?_:arguments[a]))for(m=lengthOfArrayLike(g),doesNotExceedSafeInteger(b+m),c=0;c<m;c++,b++)c in g&&createProperty(E,b,g[c]);else doesNotExceedSafeInteger(b+1),createProperty(E,b++,g);return E.length=b,E}});var ci=entryVirtual("Array").concat,ui=Array.prototype,concat=function(t){var a=t.concat;return t===ui||K(ui,t)&&a===ui.concat?ci:a},li=/MSIE .\./.test(q),di=m.Function,wrap$1=function(t){return li?function(a,c){var h=validateArgumentsLength(arguments.length,1)>2,m=isCallable(a)?a:di(a),g=h?mt(arguments,2):void 0;return t(h?function(){O(m,this,g)}:m,c)}:t},fi={setTimeout:wrap$1(m.setTimeout),setInterval:wrap$1(m.setInterval)},pi=fi.setInterval;_export({global:!0,bind:!0,forced:m.setInterval!==pi},{setInterval:pi});var hi=fi.setTimeout;_export({global:!0,bind:!0,forced:m.setTimeout!==hi},{setTimeout:hi});var mi=G.setTimeout,gi=createCommonjsModule((function(t){var a=Object.prototype.hasOwnProperty,c="~";function Events(){}function EE(t,a,c){this.fn=t,this.context=a,this.once=c||!1}function addListener(t,a,h,m,g){if("function"!=typeof h)throw new TypeError("The listener must be a function");var _=new EE(h,m||t,g),E=c?c+a:a;return t._events[E]?t._events[E].fn?t._events[E]=[t._events[E],_]:t._events[E].push(_):(t._events[E]=_,t._eventsCount++),t}function clearEvent(t,a){0==--t._eventsCount?t._events=new Events:delete t._events[a]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(c=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,h,m=[];if(0===this._eventsCount)return m;for(h in t=this._events)a.call(t,h)&&m.push(c?h.slice(1):h);return Object.getOwnPropertySymbols?m.concat(Object.getOwnPropertySymbols(t)):m},EventEmitter.prototype.listeners=function listeners(t){var a=c?c+t:t,h=this._events[a];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,g=h.length,_=new Array(g);m<g;m++)_[m]=h[m].fn;return _},EventEmitter.prototype.listenerCount=function listenerCount(t){var a=c?c+t:t,h=this._events[a];return h?h.fn?1:h.length:0},EventEmitter.prototype.emit=function emit(t,a,h,m,g,_){var E=c?c+t:t;if(!this._events[E])return!1;var b,O,T=this._events[E],S=arguments.length;if(T.fn){switch(T.once&&this.removeListener(t,T.fn,void 0,!0),S){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,a),!0;case 3:return T.fn.call(T.context,a,h),!0;case 4:return T.fn.call(T.context,a,h,m),!0;case 5:return T.fn.call(T.context,a,h,m,g),!0;case 6:return T.fn.call(T.context,a,h,m,g,_),!0}for(O=1,b=new Array(S-1);O<S;O++)b[O-1]=arguments[O];T.fn.apply(T.context,b)}else{var C,I=T.length;for(O=0;O<I;O++)switch(T[O].once&&this.removeListener(t,T[O].fn,void 0,!0),S){case 1:T[O].fn.call(T[O].context);break;case 2:T[O].fn.call(T[O].context,a);break;case 3:T[O].fn.call(T[O].context,a,h);break;case 4:T[O].fn.call(T[O].context,a,h,m);break;default:if(!b)for(C=1,b=new Array(S-1);C<S;C++)b[C-1]=arguments[C];T[O].fn.apply(T[O].context,b)}}return!0},EventEmitter.prototype.on=function on(t,a,c){return addListener(this,t,a,c,!1)},EventEmitter.prototype.once=function once(t,a,c){return addListener(this,t,a,c,!0)},EventEmitter.prototype.removeListener=function removeListener(t,a,h,m){var g=c?c+t:t;if(!this._events[g])return this;if(!a)return clearEvent(this,g),this;var _=this._events[g];if(_.fn)_.fn!==a||m&&!_.once||h&&_.context!==h||clearEvent(this,g);else{for(var E=0,b=[],O=_.length;E<O;E++)(_[E].fn!==a||m&&!_[E].once||h&&_[E].context!==h)&&b.push(_[E]);b.length?this._events[g]=1===b.length?b[0]:b:clearEvent(this,g)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var a;return t?(a=c?c+t:t,this._events[a]&&clearEvent(this,a)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=c,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter}));_export({global:!0},{globalThis:m});var vi=He.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==vi,sham:!M},{defineProperty:vi});var yi=createCommonjsModule((function(t){var a=G.Object,c=t.exports=function defineProperty(t,c,h){return a.defineProperty(t,c,h)};a.defineProperty.sham&&(c.sham=!0)})),_i=yi,Ei=R([].push),createMethod$2=function(t){var a=1==t,c=2==t,h=3==t,m=4==t,g=6==t,_=7==t,E=5==t||g;return function(b,O,T,S){for(var C,I,R=toObject(b),M=j(R),k=functionBindContext(O,T),w=lengthOfArrayLike(M),N=0,x=S||arraySpeciesCreate,A=a?x(b,w):c||_?x(b,0):void 0;w>N;N++)if((E||N in M)&&(I=k(C=M[N],N,R),t))if(a)A[N]=I;else if(I)switch(t){case 3:return!0;case 5:return C;case 6:return N;case 2:Ei(A,C)}else switch(t){case 4:return!1;case 7:Ei(A,C)}return g?-1:h||m?m:A}},bi={forEach:createMethod$2(0),map:createMethod$2(1),filter:createMethod$2(2),some:createMethod$2(3),every:createMethod$2(4),find:createMethod$2(5),findIndex:createMethod$2(6),filterReject:createMethod$2(7)},arrayMethodIsStrict=function(t,a){var c=[][t];return!!c&&fails((function(){c.call(null,a||function(){return 1},1)}))},Oi=bi.forEach,Ti=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return Oi(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=Ti},{forEach:Ti});var Si=entryVirtual("Array").forEach,Ci=Array.prototype,Ii={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var a=t.forEach;return t===Ci||K(Ci,t)&&a===Ci.forEach||de(Ii,Zt(t))?Si:a},Ri=Qe.includes,Mi=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Mi},{includes:function includes(t){return Ri(this,t,arguments.length>1?arguments[1]:void 0)}});var ki=entryVirtual("Array").includes,wi=wellKnownSymbol("match"),Ni=TypeError,notARegexp=function(t){if(function(t){var a;return H(t)&&(void 0!==(a=t[wi])?!!a:"RegExp"==classofRaw(t))}(t))throw Ni("The method doesn't accept regular expressions");return t},xi=wellKnownSymbol("match"),Ai=R("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var a=/./;try{"/./"[t](a)}catch(c){try{return a[xi]=!1,"/./"[t](a)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~Ai(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Pi=entryVirtual("String").includes,Li=Array.prototype,Di=String.prototype,includes=function(t){var a=t.includes;return t===Li||K(Li,t)&&a===Li.includes?ki:"string"==typeof t||t===Di||K(Di,t)&&a===Di.includes?Pi:a},Vi=fails((function(){rt(1)}));_export({target:"Object",stat:!0,forced:Vi},{keys:function keys(t){return rt(toObject(t))}});var Fi=G.Object.keys,ji=bi.filter,Ui=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!Ui},{filter:function filter(t){return ji(this,t,arguments.length>1?arguments[1]:void 0)}});var Bi=entryVirtual("Array").filter,Hi=Array.prototype,filter=function(t){var a=t.filter;return t===Hi||K(Hi,t)&&a===Hi.filter?Bi:a},Gi=arrayMethodHasSpeciesSupport("slice"),Ki=wellKnownSymbol("species"),qi=Array,Wi=Math.max;_export({target:"Array",proto:!0,forced:!Gi},{slice:function slice(t,a){var c,h,m,g=toIndexedObject(this),_=lengthOfArrayLike(g),E=toAbsoluteIndex(t,_),b=toAbsoluteIndex(void 0===a?_:a,_);if(ei(g)&&(c=g.constructor,(fo(c)&&(c===qi||ei(c.prototype))||H(c)&&null===(c=c[Ki]))&&(c=void 0),c===qi||void 0===c))return mt(g,E,b);for(h=new(void 0===c?qi:c)(Wi(b-E,0)),m=0;E<b;E++,m++)E in g&&createProperty(h,m,g[E]);return h.length=m,h}});var zi=entryVirtual("Array").slice,$i=Array.prototype,slice=function(t){var a=t.slice;return t===$i||K($i,t)&&a===$i.slice?zi:a},Yi=createCommonjsModule((function(t,a){t.exports=function(){function _classCallCheck(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}function _createClass(t,a,c){return a&&_defineProperties(t.prototype,a),c&&_defineProperties(t,c),_i(t,"prototype",{writable:!1}),t}var t={isDataReportEnable:!0,maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0},a=function emptyFn(){},c=function(){function Reporter(a){_classCallCheck(this,Reporter),this.isUploadEnable=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.traceMsgCache={},this.highPriorityMsgList=[],this.msgList=[],this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Zn(),this.timer=null,this.endedAsyncMsgByModule={},this.setConfig(a),this.reportConfig.isDataReportEnable&&this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){var a=wt({},this.reportConfig.common,t.common);this.reportConfig=wt({},this.reportConfig,t),this.reportConfig.common=a,this.reportConfig.common.sdk_type||(this.reportConfig.common.sdk_type="im")}},{key:"reportImmediately",value:function reportImmediately(t,a){var c=this;this.reportConfig.isDataReportEnable&&this.reportConfig.request(t,wt({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},a)).catch((function(t){var a,h;null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(t,a){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(c.priority||(c.priority=this.getEventPriority(t,a)),this.reportConfig.isDataReportEnable&&t){var h=Zn();"HIGH"===c.priority?this.highPriorityMsgList.push({module:t,msg:a,createTime:h}):"NORMAL"===c.priority?this.msgList.push({module:t,msg:a,createTime:h}):"LOW"===c.priority&&this.lowPriorityMsgList.push({module:t,msg:a,createTime:h}),this.highPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.highPriorityMsgList.shift(),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,a){if(this.reportConfig.isDataReportEnable&&t&&!this.traceMsgCache[t]){var c=wt(wt({start_time:Zn()},a),{extension:[]});this.traceMsgCache[t]=c}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,a,c){var h,m=this;if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t]){var g=this.traceMsgCache[t].extension,_=g.length,E=(new Date).getTime();0===_?a.duration=E-this.traceMsgCache[t].start_time:g[_-1].end_time?a.duration=E-g[_-1].end_time:a.duration=E-this.traceMsgCache[t].start_time,g.push(wt({end_time:E},a));var b=g.length-1;(null==c?void 0:c.asyncParams)&&((h=this.traceMsgCache[t]).asyncPromiseArray||(h.asyncPromiseArray=[]),this.traceMsgCache[t].asyncPromiseArray.push(c.asyncParams.then((function(a){m.traceMsgCache[t]&&m.traceMsgCache[t].extension[b]&&wt(m.traceMsgCache[t].extension[b],a)}))))}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var a,c,h=this,m=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.reportConfig.isDataReportEnable&&this.traceMsgCache[t])if("nos"!==t||!1===m){"boolean"==typeof m?this.traceMsgCache[t].succeed=!!m:this.traceMsgCache[t].state=m,this.traceMsgCache[t].duration=Zn()-this.traceMsgCache[t].start_time,forEach$1(a=this.traceMsgCache[t].extension).call(a,(function(t){delete t.end_time}));var g=this.traceMsgCache[t];if(this.traceMsgCache[t]=null,g.asyncPromiseArray){(c=this.endedAsyncMsgByModule)[t]||(c[t]=[]),this.endedAsyncMsgByModule[t].push(g);var _=function asyncCallback(){var a;h.endedAsyncMsgByModule[t]&&includes(a=h.endedAsyncMsgByModule[t]).call(a,g)&&(delete g.asyncPromiseArray,h.report(t,g,{priority:h.getEventPriority(t,g)}))};Xn.all(g.asyncPromiseArray).then(_).catch(_)}else this.report(t,g,{priority:this.getEventPriority(t,g)})}else this.traceMsgCache[t]=null}},{key:"getEventPriority",value:function getEventPriority(t,a){if("exceptions"===t){if(0===a.action)return"HIGH";if(2===a.action)return"HIGH";if(1===a.action&&0!==a.exception_service)return"HIGH"}else{if("msgReceive"===t)return"LOW";if("nim_api_trace"===t)return"LOW"}return"NORMAL"}},{key:"reportTraceCancel",value:function reportTraceCancel(t){this.reportConfig.isDataReportEnable&&(this.endedAsyncMsgByModule[t]=[],this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!1)}},{key:"restore",value:function restore(){this.reportConfig.isDataReportEnable&&(this.isUploadEnable=!0,this.initConfigLoaded||this.initUploadConfig())}},{key:"destroy",value:function destroy(){var t,c=this;this.reportConfig.isDataReportEnable&&(forEach$1(t=Fi(this.traceMsgCache)).call(t,(function(t){c.reportTraceEnd(t,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.highPriorityMsgList=[],this.reportConfig={},this.isDestroyed=!0)}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a,c=this;if(!this.loading){this.loading=!0;var h=this.reportConfig.common||{};try{this.reportConfig.request(this.reportConfig.reportConfigUrl,{method:"GET",dataType:"json",params:{deviceId:h.dev_id,sdkVer:h.sdk_ver,platform:h.platform,appkey:h.app_key},timeout:this.reportConfig.timeout}).then((function(t){var a,h;if(!c.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){var m=t.data.data||{};c.reportConfig.maxSize=m.maxSize>1e3?1e3:m.maxSize,c.reportConfig.maxInterval=m.maxInterval>1e4?1e4:m.maxInterval,c.reportConfig.maxInterval=m.maxInterval<10?10:m.maxInterval,c.reportConfig.minInterval=m.minInterval<2?2:m.minInterval,c.reportConfig.maxDelay=m.maxDelay||300,c.reportConfig.maxInterval=1e3*c.reportConfig.maxInterval,c.reportConfig.minInterval=1e3*c.reportConfig.minInterval,c.reportConfig.maxDelay=1e3*c.reportConfig.maxDelay,c.isUploadEnable=!0,c.initConfigLoaded=!0,c.loading=!1,c.reportHeartBeat()}null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.log("Get reporter upload config success")}})).catch((function(t){var a,h;c.loading=!1,null===(h=null===(a=c.reportConfig)||void 0===a?void 0:a.logger)||void 0===h||h.error("Get reporter upload config failed",t)}))}catch(c){this.loading=!1,null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",c)}}}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=mi((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.highPriorityMsgList.length+this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Zn()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t,a,c,h,m,g,_=this,E={},b=Zn();this.highPriorityMsgList=filter(t=this.highPriorityMsgList).call(t,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.msgList=filter(a=this.msgList).call(a,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.lowPriorityMsgList=filter(c=this.lowPriorityMsgList).call(c,(function(t){return b-t.createTime<_.reportConfig.maxDelay})),this.cacheMsgList=filter(h=this.cacheMsgList).call(h,(function(t){return b-t.createTime<_.reportConfig.maxDelay}));var O=slice(m=this.highPriorityMsgList).call(m,0,this.reportConfig.maxSize);if(this.highPriorityMsgList=slice(g=this.highPriorityMsgList).call(g,O.length),O.length<this.reportConfig.maxSize){var T,S,C=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(T=this.msgList).call(T,0,C)),this.msgList=slice(S=this.msgList).call(S,C)}if(O.length<this.reportConfig.maxSize){var I,R,M=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(I=this.lowPriorityMsgList).call(I,0,M)),this.lowPriorityMsgList=slice(R=this.lowPriorityMsgList).call(R,M)}if(O.length<this.reportConfig.maxSize){var k,w,N=this.reportConfig.maxSize-O.length;O=concat(O).call(O,slice(k=this.cacheMsgList).call(k,0,N)),this.cacheMsgList=slice(w=this.cacheMsgList).call(w,N)}return forEach$1(O).call(O,(function(t){E[t.module]?E[t.module].push(t.msg):E[t.module]=[t.msg]})),{uploadMsgArr:O,uploadMsg:E}}},{key:"upload",value:function upload(){var t,a,c=this;if(this.isUploadEnable&&!(this.lastReportTime&&Zn()-this.lastReportTime<this.reportConfig.minInterval)){var h=this.getUploadMsg(),m=h.uploadMsgArr,g=h.uploadMsg;if(m.length){this.lastReportTime=Zn();try{this.reportConfig.request(this.reportConfig.reportUrl,{dataType:"json",method:"POST",data:{common:this.reportConfig.common,event:g},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var a,h,g,_;c.cacheMsgList=slice(a=concat(h=c.cacheMsgList).call(h,m)).call(a,0,c.reportConfig.cacheMaxSize),null===(_=null===(g=c.reportConfig)||void 0===g?void 0:g.logger)||void 0===_||_.warn("Reporter upload failed",t)}))}catch(c){null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.warn("Exec reporter request failed",c)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return c}()})),Xi=bi.map,Qi=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!Qi},{map:function map(t){return Xi(this,t,arguments.length>1?arguments[1]:void 0)}});var Ji=entryVirtual("Array").map,Zi=Array.prototype,map$6=function(t){var a=t.map;return t===Zi||K(Zi,t)&&a===Zi.map?Ji:a},ea="\t\n\v\f\r \u2028\u2029\ufeff",ta=R("".replace),ra="["+ea+"]",oa=RegExp("^"+ra+ra+"*"),na=RegExp(ra+ra+"*$"),createMethod$1=function(t){return function(a){var c=toString$1(requireObjectCoercible(a));return 1&t&&(c=ta(c,oa,"")),2&t&&(c=ta(c,na,"")),c}},ia={start:createMethod$1(1),end:createMethod$1(2),trim:createMethod$1(3)},aa=ia.trim,sa=m.parseInt,ca=m.Symbol,ua=ca&&ca.iterator,la=/^[+-]?0x/i,da=R(la.exec),fa=8!==sa(ea+"08")||22!==sa(ea+"0x16")||ua&&!fails((function(){sa(Object(ua))}))?function parseInt(t,a){var c=aa(toString$1(t));return sa(c,a>>>0||(da(la,c)?16:10))}:sa;_export({global:!0,forced:parseInt!=fa},{parseInt:fa});var pa=G.parseInt,ha=Qe.indexOf,ma=R([].indexOf),ga=!!ma&&1/ma([1],1,-0)<0,va=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:ga||!va},{indexOf:function indexOf(t){var a=arguments.length>1?arguments[1]:void 0;return ga?ma(this,t,a)||0:ha(this,t,a)}});var ya=entryVirtual("Array").indexOf,_a=Array.prototype,indexOf=function(t){var a=t.indexOf;return t===_a||K(_a,t)&&a===_a.indexOf?ya:a},Ea=Math.min,ba=[].lastIndexOf,Oa=!!ba&&1/[1].lastIndexOf(1,-0)<0,Ta=arrayMethodIsStrict("lastIndexOf"),Sa=Oa||!Ta?function lastIndexOf(t){if(Oa)return O(ba,this,arguments)||0;var a=toIndexedObject(this),c=lengthOfArrayLike(a),h=c-1;for(arguments.length>1&&(h=Ea(h,toIntegerOrInfinity(arguments[1]))),h<0&&(h=c+h);h>=0;h--)if(h in a&&a[h]===t)return h||0;return-1}:ba;_export({target:"Array",proto:!0,forced:Sa!==[].lastIndexOf},{lastIndexOf:Sa});var Ca=entryVirtual("Array").lastIndexOf,Ia=Array.prototype,lastIndexOf=function(t){var a=t.lastIndexOf;return t===Ia||K(Ia,t)&&a===Ia.lastIndexOf?Ca:a},Ra=bi.findIndex,Ma="findIndex",ka=!0;Ma in[]&&Array(1).findIndex((function(){ka=!1})),_export({target:"Array",proto:!0,forced:ka},{findIndex:function findIndex(t){return Ra(this,t,arguments.length>1?arguments[1]:void 0)}});var wa=entryVirtual("Array").findIndex,Na=Array.prototype,findIndex=function(t){var a=t.findIndex;return t===Na||K(Na,t)&&a===Na.findIndex?wa:a},xa=Array,Aa=Math.max,arraySliceSimple=function(t,a,c){for(var h=lengthOfArrayLike(t),m=toAbsoluteIndex(a,h),g=toAbsoluteIndex(void 0===c?h:c,h),_=xa(Aa(g-m,0)),E=0;m<g;m++,E++)createProperty(_,E,t[m]);return _.length=E,_},Pa=Vt.f,La="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Da={f:function getOwnPropertyNames(t){return La&&"Window"==classofRaw(t)?function(t){try{return Pa(t)}catch(t){return arraySliceSimple(La)}}(t):Pa(toIndexedObject(t))}},Va=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Fa=Object.isExtensible,ja=fails((function(){Fa(1)}))||Va?function isExtensible(t){return!!H(t)&&((!Va||"ArrayBuffer"!=classofRaw(t))&&(!Fa||Fa(t)))}:Fa,Ua=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ba=createCommonjsModule((function(t){var a=He.f,c=!1,h=uid("meta"),m=0,setMetadata=function(t){a(t,h,{value:{objectID:"O"+m++,weakData:{}}})},g=t.exports={enable:function(){g.enable=function(){},c=!0;var t=Vt.f,a=R([].splice),m={};m[h]=1,t(m).length&&(Vt.f=function(c){for(var m=t(c),g=0,_=m.length;g<_;g++)if(m[g]===h){a(m,g,1);break}return m},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Da.f}))},fastKey:function(t,a){if(!H(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!de(t,h)){if(!ja(t))return"F";if(!a)return"E";setMetadata(t)}return t[h].objectID},getWeakData:function(t,a){if(!de(t,h)){if(!ja(t))return!0;if(!a)return!1;setMetadata(t)}return t[h].weakData},onFreeze:function(t){return Ua&&c&&ja(t)&&!de(t,h)&&setMetadata(t),t}};Je[h]=!0})),Ha=He.f,Ga=bi.forEach,Ka=Rr.set,qa=Rr.getterFor,defineBuiltIns=function(t,a,c){for(var h in a)c&&c.unsafe&&t[h]?t[h]=a[h]:defineBuiltIn(t,h,a[h],c);return t},Wa=He.f,za=Ba.fastKey,$a=Rr.set,Ya=Rr.getterFor,Xa={getConstructor:function(t,a,c,h){var m=t((function(t,m){anInstance(t,g),$a(t,{type:a,index:ct(null),first:void 0,last:void 0,size:0}),M||(t.size=0),isNullOrUndefined(m)||iterate(m,t[h],{that:t,AS_ENTRIES:c})})),g=m.prototype,_=Ya(a),define=function(t,a,c){var h,m,g=_(t),E=getEntry(t,a);return E?E.value=c:(g.last=E={index:m=za(a,!0),key:a,value:c,previous:h=g.last,next:void 0,removed:!1},g.first||(g.first=E),h&&(h.next=E),M?g.size++:t.size++,"F"!==m&&(g.index[m]=E)),t},getEntry=function(t,a){var c,h=_(t),m=za(a);if("F"!==m)return h.index[m];for(c=h.first;c;c=c.next)if(c.key==a)return c};return defineBuiltIns(g,{clear:function clear(){for(var t=_(this),a=t.index,c=t.first;c;)c.removed=!0,c.previous&&(c.previous=c.previous.next=void 0),delete a[c.index],c=c.next;t.first=t.last=void 0,M?t.size=0:this.size=0},delete:function(t){var a=this,c=_(a),h=getEntry(a,t);if(h){var m=h.next,g=h.previous;delete c.index[h.index],h.removed=!0,g&&(g.next=m),m&&(m.previous=g),c.first==h&&(c.first=m),c.last==h&&(c.last=g),M?c.size--:a.size--}return!!h},forEach:function forEach(t){for(var a,c=_(this),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);a=a?a.next:c.first;)for(h(a.value,a.key,this);a&&a.removed;)a=a.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(g,c?{get:function get(t){var a=getEntry(this,t);return a&&a.value},set:function set(t,a){return define(this,0===t?0:t,a)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),M&&Wa(g,"size",{get:function(){return _(this).size}}),m},setStrong:function(t,a,c){var h=a+" Iterator",m=Ya(a),g=Ya(h);iteratorDefine(t,a,(function(t,a){$a(this,{type:h,target:t,state:m(t),kind:a,last:void 0})}),(function(){for(var t=g(this),a=t.kind,c=t.last;c&&c.removed;)c=c.previous;return t.target&&(t.last=c=c?c.next:t.state.first)?"keys"==a?{value:c.key,done:!1}:"values"==a?{value:c.value,done:!1}:{value:[c.key,c.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),c?"entries":"values",!c,!0),setSpecies(a)}};!function(t,a,c){var h,g=-1!==t.indexOf("Map"),_=-1!==t.indexOf("Weak"),E=g?"set":"add",b=m[t],O=b&&b.prototype,T={};if(M&&isCallable(b)&&(_||O.forEach&&!fails((function(){(new b).entries().next()})))){var S=(h=a((function(a,c){Ka(anInstance(a,S),{type:t,collection:new b}),null!=c&&iterate(c,a[E],{that:a,AS_ENTRIES:g})}))).prototype,C=qa(t);Ga(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var a="add"==t||"set"==t;!(t in O)||_&&"clear"==t||Ge(S,t,(function(c,h){var m=C(this).collection;if(!a&&_&&!H(c))return"get"==t&&void 0;var g=m[t](0===c?0:c,h);return a?this:g}))})),_||Ha(S,"size",{configurable:!0,get:function(){return C(this).collection.size}})}else h=c.getConstructor(a,t,g,E),Ba.enable();setToStringTag(h,t,!1,!0),T[t]=h,_export({global:!0,forced:!0},T),_||c.setStrong(h,t,g)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),Xa);var Qa=G.Map,Ja=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var a,c,h,m,g=arguments.length,_=g>1?arguments[1]:void 0;return aConstructor(this),(a=void 0!==_)&&aCallable(_),isNullOrUndefined(t)?new this:(c=[],a?(h=0,m=functionBindContext(_,g>2?arguments[2]:void 0),iterate(t,(function(t){w(Ja,c,m(t,h++))}))):iterate(t,Ja,{that:c}),new this(c))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(mt(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,a=anObject(this),c=aCallable(a.delete),h=!0,m=0,g=arguments.length;m<g;m++)t=w(c,a,arguments[m]),h=h&&t;return!!h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,a){var c,h,m=anObject(this),g=aCallable(m.get),_=aCallable(m.has),E=aCallable(m.set);return w(_,m,t)?(c=w(g,m,t),"update"in a&&(c=a.update(c,t,m),w(E,m,t,c)),c):(h=a.insert(t,m),w(E,m,t,h),h)}});var Za=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(c,(function(t,c,m){if(!h(c,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){h(c,t,a)&&w(g,m,t,c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m(c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var es=R([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,a){aCallable(a);var c=getIterator(t),h=new this,m=aCallable(h.has),g=aCallable(h.get),_=aCallable(h.set);return iterate(c,(function(t){var c=a(t);w(m,h,c)?es(w(g,h,c),t):w(_,h,c,[t])}),{IS_ITERATOR:!0}),h}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Za(anObject(this)),(function(a,c,h){if((m=c)===(g=t)||m!=m&&g!=g)return h();var m,g}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,a){var c=new this;aCallable(a);var h=aCallable(c.set);return iterate(t,(function(t){w(h,c,a(t),t)})),c}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Za(anObject(this)),(function(a,c,h){if(c===t)return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){w(g,m,h(c,t,a),c)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0),m=new(speciesConstructor(a,getBuiltIn("Map"))),g=aCallable(m.set);return iterate(c,(function(t,c){w(g,m,t,h(c,t,a))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),m}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var a=anObject(this),c=aCallable(a.set),h=arguments.length,m=0;m<h;)iterate(arguments[m++],c,{that:a,AS_ENTRIES:!0});return a}});var ts=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var a=anObject(this),c=Za(a),h=arguments.length<2,m=h?void 0:arguments[1];if(aCallable(t),iterate(c,(function(c,g){h?(h=!1,m=g):m=t(m,g,c,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h)throw ts("Reduce of empty map with no initial value");return m}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var a=anObject(this),c=Za(a),h=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(c,(function(t,c,m){if(h(c,t,a))return m()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var rs=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,a){var c=anObject(this),h=aCallable(c.get),m=aCallable(c.has),g=aCallable(c.set),_=arguments.length;aCallable(a);var E=w(m,c,t);if(!E&&_<3)throw rs("Updating absent value");var b=E?w(h,c,t):aCallable(_>2?arguments[2]:void 0)(t,c);return w(g,c,t,a(b,t,c)),c}});var os=TypeError,ns=function upsert(t,a){var c,h=anObject(this),m=aCallable(h.get),g=aCallable(h.has),_=aCallable(h.set),E=arguments.length>2?arguments[2]:void 0;if(!isCallable(a)&&!isCallable(E))throw os("At least one callback required");return w(g,h,t)?(c=w(m,h,t),isCallable(a)&&(c=a(c),w(_,h,t,c))):isCallable(E)&&(c=E(),w(_,h,t,c)),c};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:ns}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:ns});var is=Qa,as=fails((function(){Lt(1)}));_export({target:"Object",stat:!0,forced:as,sham:!Nt},{getPrototypeOf:function getPrototypeOf(t){return Lt(toObject(t))}});var ss=G.Object.getPrototypeOf,cs=createCommonjsModule((function(t){function _getPrototypeOf(a){var c;return t.exports=_getPrototypeOf=ht?bind$1(c=ss).call(c):function _getPrototypeOf(t){return t.__proto__||ss(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(a)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),us=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var a;return-1!==indexOf(a=Function.toString.call(t)).call(a,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),ls=getBuiltIn("Reflect","construct"),ds=Object.prototype,fs=[].push,ps=fails((function(){function F(){}return!(ls((function(){}),[],F)instanceof F)})),hs=!fails((function(){ls((function(){}))})),ms=ps||hs;_export({target:"Reflect",stat:!0,forced:ms,sham:ms},{construct:function construct(t,a){aConstructor(t),anObject(a);var c=arguments.length<3?t:aConstructor(arguments[2]);if(hs&&!ps)return ls(t,a,c);if(t==c){switch(a.length){case 0:return new t;case 1:return new t(a[0]);case 2:return new t(a[0],a[1]);case 3:return new t(a[0],a[1],a[2]);case 4:return new t(a[0],a[1],a[2],a[3])}var h=[null];return O(fs,h,a),new(O(Et,t,h))}var m=c.prototype,g=ct(H(m)?m:ds),_=O(t,g,a);return H(_)?_:g}});var gs=G.Reflect.construct,vs=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!gs)return!1;if(gs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gs(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),ys=createCommonjsModule((function(t){function _construct(a,c,h){var m;vs()?(t.exports=_construct=bind$1(m=gs).call(m),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,a,c){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return c&&Tt(m,c.prototype),m},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),_s=createCommonjsModule((function(t){function _wrapNativeSuper(a){var c="function"==typeof is?new is:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!us(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==c){if(c.has(t))return c.get(t);c.set(t,Wrapper)}function Wrapper(){return ys(t,arguments,cs(this).constructor)}return Wrapper.prototype=lt(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),Tt(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(a)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),Es=getDefaultExportFromCjs(_s),bs=TypeError,createMethod=function(t){return function(a,c,h,m){aCallable(c);var g=toObject(a),_=j(g),E=lengthOfArrayLike(g),b=t?E-1:0,O=t?-1:1;if(h<2)for(;;){if(b in _){m=_[b],b+=O;break}if(b+=O,t?b<0:E<=b)throw bs("Reduce of empty array with no initial value")}for(;t?b>=0:E>b;b+=O)b in _&&(m=c(m,_[b],b,g));return m}},Os={left:createMethod(!1),right:createMethod(!0)}.left,Ts=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Ts||!Yr&&Q>79&&Q<83},{reduce:function reduce(t){var a=arguments.length;return Os(this,t,a,a>1?arguments[1]:void 0)}});var Ss=entryVirtual("Array").reduce,Cs=Array.prototype,reduce=function(t){var a=t.reduce;return t===Cs||K(Cs,t)&&a===Cs.reduce?Ss:a},Is=getBuiltIn("JSON","stringify"),Rs=R(/./.exec),Ms=R("".charAt),ks=R("".charCodeAt),ws=R("".replace),Ns=R(1..toString),xs=/[\uD800-\uDFFF]/g,As=/^[\uD800-\uDBFF]$/,Ps=/^[\uDC00-\uDFFF]$/,Ls=!J||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=Is([t])||"{}"!=Is({a:t})||"{}"!=Is(Object(t))})),Ds=fails((function(){return'"\\udf06\\ud834"'!==Is("\udf06\ud834")||'"\\udead"'!==Is("\udead")})),stringifyWithSymbolsFix=function(t,a){var c=mt(arguments),h=a;if((H(a)||void 0!==t)&&!te(t))return ei(a)||(a=function(t,a){if(isCallable(h)&&(a=w(h,this,t,a)),!te(a))return a}),c[1]=a,O(Is,null,c)},fixIllFormed=function(t,a,c){var h=Ms(c,a-1),m=Ms(c,a+1);return Rs(As,t)&&!Rs(Ps,m)||Rs(Ps,t)&&!Rs(As,h)?"\\u"+Ns(ks(t,0),16):t};Is&&_export({target:"JSON",stat:!0,arity:3,forced:Ls||Ds},{stringify:function stringify(t,a,c){var h=mt(arguments),m=O(Ls?stringifyWithSymbolsFix:Is,null,h);return Ds&&"string"==typeof m?ws(m,xs,fixIllFormed):m}}),G.JSON||(G.JSON={stringify:JSON.stringify});var Vs=function stringify(t,a,c){return O(G.JSON.stringify,null,arguments)},Fs=Vs,js={V2NIM_ERROR_CODE_UNKNOWN:{code:0,message:"unknown error"},V2NIM_ERROR_CODE_SUCCESS:{code:200,message:"success"},V2NIM_ERROR_CODE_HANDSHAKE:{code:201,message:"handshake error"},V2NIM_ERROR_CODE_REQUEST_TEMPERARY_FORBIDDEN:{code:398,message:"request temprary forbidden"},V2NIM_ERROR_CODE_SERVER_UNIT_ERROR:{code:399,message:"server unit error"},V2NIM_ERROR_CODE_FORBIDDEN:{code:403,message:"forbidden"},V2NIM_ERROR_CODE_NOT_FOUND:{code:404,message:"not found"},V2NIM_ERROR_CODE_PARAMETER_ERROR:{code:414,message:"parameter error"},V2NIM_ERROR_CODE_RATE_LIMIT_REACHED:{code:416,message:"rate limit reached"},V2NIM_ERROR_CODE_MULTI_LOGIN_FORBIDDEN:{code:417,message:"multi login forbidden"},V2NIM_ERROR_CODE_SERVER_INTERNAL_ERROR:{code:500,message:"server internal error"},V2NIM_ERROR_CODE_SERVER_BUSY:{code:503,message:"server busy"},V2NIM_ERROR_CODE_APP_UNREACHABLE:{code:511,message:"app server unreachable"},V2NIM_ERROR_CODE_SERVICE_UNAVAILABLE:{code:514,message:"service unavailable"},V2NIM_ERROR_CODE_PROTOCOL_BLACKHOLE_FILTERED:{code:599,message:"protocol filtered by blackhole rule"},V2NIM_ERROR_CODE_NO_PERMISSION:{code:997,message:"appid has no permission to call the protocol"},V2NIM_ERROR_CODE_UNPACK_ERROR:{code:998,message:"unpack error"},V2NIM_ERROR_CODE_PACK_ERROR:{code:999,message:"pack error"},V2NIM_ERROR_CODE_IM_DISABLED:{code:101301,message:"IM disabled"},V2NIM_ERROR_CODE_SERVICE_ADDRESS_INVALID:{code:101302,message:"service address invalid"},V2NIM_ERROR_CODE_APPKEY_NOT_EXIST:{code:101303,message:"appkey not exist"},V2NIM_ERROR_CODE_BUNDLEID_CHECK_FAILED:{code:101304,message:"bundleid check failed"},V2NIM_ERROR_CODE_APPKEY_BLOCKED:{code:101403,message:"appkey blocked"},V2NIM_ERROR_CODE_INVALID_TOKEN:{code:102302,message:"invalid token"},V2NIM_ERROR_CODE_ROBOT_NOT_ALLOWED:{code:102303,message:"robot not allowed"},V2NIM_ERROR_CODE_ACCOUNT_NOT_EXIST:{code:102404,message:"account not exist"},V2NIM_ERROR_CODE_ACCOUNT_CHAT_BANNED:{code:102421,message:"account chat banned"},V2NIM_ERROR_CODE_ACCOUNT_BANNED:{code:102422,message:"account banned"},V2NIM_ERROR_CODE_ACCOUNT_IN_BLOCK_LIST:{code:102426,message:"account in block list"},V2NIM_ERROR_CODE_USER_PROFILE_NOT_EXIST:{code:103404,message:"user profile not exist"},V2NIM_ERROR_CODE_USER_PROFILE_HIT_ANTISPAM:{code:103451,message:"user profile hit antispam"},V2NIM_ERROR_CODE_PEER_FRIEND_LIMIT:{code:104301,message:"peer friend limit"},V2NIM_ERROR_CODE_FRIEND_APPLICATION_NOT_EXIST:{code:104302,message:"friend application not exist"},V2NIM_ERROR_CODE_FRIEND_NOT_EXIST:{code:104404,message:"friend not exist"},V2NIM_ERROR_CODE_FRIEND_ALREADY_EXIST:{code:104405,message:"friend already exist"},V2NIM_ERROR_CODE_SELF_FRIEND_OPERATION_NOT_ALLOWED:{code:104429,message:"self friend operation not allowed"},V2NIM_ERROR_CODE_FRIEND_LIMIT:{code:104435,message:"friend limit"},V2NIM_ERROR_CODE_FRIEND_OPERATION_RATE_LIMIT:{code:104449,message:"friend operation rate limit"},V2NIM_ERROR_CODE_FRIEND_HIT_ANTISPAM:{code:104451,message:"friend hit antispam"},V2NIM_ERROR_CODE_SELF_MUTE_OPERATION_NOT_ALLOWED:{code:105429,message:"self mute operation not allowed"},V2NIM_ERROR_CODE_MUTE_LIST_LIMIT:{code:105435,message:"mute list limit"},V2NIM_ERROR_CODE_SELF_BLOCK_LIST_OPERATION_NOT_ALLOWED:{code:106429,message:"self block list operation not allowed"},V2NIM_ERROR_CODE_BLOCK_LIST_LIMIT:{code:106435,message:"block list limit"},V2NIM_ERROR_CODE_REVOKE_THIRD_PARTY_MESSAGE_NOT_ALLOWED:{code:107301,message:"revoke third party message not allowed"},V2NIM_ERROR_CODE_SHORT_TO_LONG_URL_FAILED:{code:107307,message:"short to long URL failed"},V2NIM_ERROR_CODE_URL_INVALID:{code:107308,message:"URL invalid"},V2NIM_ERROR_CODE_DURATION_OUT_OF_RANGE:{code:107309,message:"duration out of range"},V2NIM_ERROR_CODE_GET_FILE_META_INFO_FAILED:{code:107310,message:"get file meta info failed"},V2NIM_ERROR_CODE_AUDIO_FILE_SIZE_LIMIT:{code:107311,message:"audio file size limit"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_TIMEOUT:{code:107312,message:"voice to text timeout"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_FAILED:{code:107313,message:"voice to text failed"},V2NIM_ERROR_CODE_REVOKE_EXCEED_TIME_LIMIT:{code:107314,message:"revoke message exceed time limit"},V2NIM_ERROR_CODE_REVOKE_MESSAGE_NOT_ALLOWED:{code:107315,message:"revoke specific message not allowed"},V2NIM_ERROR_CODE_FORCE_PUSH_LIST_LIMIT:{code:107316,message:"force push list limit"},V2NIM_ERROR_CODE_TEAM_MESSAGE_RECEIPT_RATE_LIMIT:{code:107317,message:"team message receipt rate limit"},V2NIM_ERROR_CODE_SNAPSHOT_NOT_EXIST:{code:107318,message:"snapshot not exist"},V2NIM_ERROR_CODE_PIN_LIMIT:{code:107319,message:"pin limit"},V2NIM_ERROR_CODE_PIN_NOT_EXIST:{code:107320,message:"pin not exist"},V2NIM_ERROR_CODE_QUICK_COMMENT_LIMIT:{code:107321,message:"quick comment limit"},V2NIM_ERROR_CODE_PIN_ALREADY_EXIST:{code:107322,message:"pin already exist"},V2NIM_ERROR_CODE_VOICE_TO_TEXT_FUNCTION_DISABLED:{code:107333,message:"voice to text function disabled"},V2NIM_ERROR_CODE_CLOUD_SEARCH_FUNCTION_DISABLED:{code:107334,message:"cloud search function disabled"},V2NIM_ERROR_CODE_ONE_WAY_DELETE_FUNCTION_DISABLED:{code:107335,message:"one-way delete function disabled"},V2NIM_ERROR_CODE_REVOKE_MESSAGE_TO_SELF_NOT_ALLOWED:{code:107429,message:"revoke message to self not allowed"},V2NIM_ERROR_CODE_APP_CHAT_BANNED:{code:107410,message:"app chat banned"},V2NIM_ERROR_CODE_QUICK_COMMENT_FUNCTION_DISABLED:{code:107326,message:"quick comment function disabled"},V2NIM_ERROR_CODE_PIN_FUNCTION_DISABLED:{code:107327,message:"PIN function disabled"},V2NIM_ERROR_CODE_TEAM_READ_RECEIPT_FUNCTION_DISABLED:{code:107324,message:"read receipt for team messages function disabled"},V2NIM_ERROR_CODE_P2P_READ_RECEIPT_FUNCTION_DISABLED:{code:107325,message:"read receipt for p2p messages function disabled"},V2NIM_ERROR_CODE_RATE_LIMIT_FOR_MESSAGING_REACHED:{code:107323,message:"rate limit for messaging reached"},V2NIM_ERROR_CODE_MESSAGE_HIT_ANTISPAM:{code:107451,message:"message hit antispam"},V2NIM_ERROR_CODE_MESSAGE_NOT_EXIST:{code:107404,message:"message not exist"},V2NIM_ERROR_CODE_UNSENDING_MESSAGE_EXPIRED:{code:107406,message:"unsending message expired"},V2NIM_ERROR_CODE_TEAM_MARK_READ_FAILED:{code:107302,message:"sending message failed for marking message read failed for too many team members"},V2NIM_ERROR_CODE_SENDER_OR_MANAGER_PERMISSION_ONLY_REVOKE:{code:107303,message:"only sender or manager can revoke message"},V2NIM_ERROR_CODE_DELETE_SELF_MESSAGE_NOT_ALLOWED:{code:107328,message:"delete self message not allowed"},V2NIM_ERROR_CODE_NOT_CHATBOT_ACCOUNT:{code:107329,message:"is not chatbot account"},V2NIM_ERROR_CODE_MESSAGE_SENSE_REQUIRED:{code:107330,message:"sender or receiver must sense message"},V2NIM_ERROR_CODE_HIGH_PRIORITY_MESSAGE_RATE_LIMIT:{code:107304,message:"rate limit of high-priority messages exceeded"},ACK_MESSAGE_BE_HIGH_PRIORITY:{code:107305,message:"ack message should be high-priority"},V2NIM_ERROR_CODE_DUPLICATE_CLIENT_MESSAGE_ID:{code:107306,message:"duplicate client message ID"},V2NIM_ERROR_CODE_INVALID_TIME_RANGE:{code:107439,message:"invalid time range"},V2NIM_ERROR_CODE_MESSAGE_HIT_CLIENT_ANTISPAM:{code:107452,message:"message hit client antispam"},V2NIM_ERROR_CODE_NOT_ADVANCED_TEAM:{code:108302,message:"not advanced team"},V2NIM_ERROR_CODE_TEAM_MANAGER_LIMIT:{code:108303,message:"team manager limit"},V2NIM_ERROR_CODE_JOINED_TEAM_LIMIT:{code:108305,message:"joined team limit"},V2NIM_ERROR_CODE_TEAM_NORMAL_MEMBER_CHAT_BANNED:{code:108306,message:"team normal member chat banned"},V2NIM_ERROR_CODE_INVITED_ACCOUNT_NOT_FRIEND:{code:108307,message:"invited account not friend"},V2NIM_ERROR_CODE_REJECT_ALL_TEAM_APPLICATIONS:{code:108308,message:"reject all team applications"},V2NIM_ERROR_CODE_TEAM_NOT_EXIST:{code:108404,message:"team not exist"},V2NIM_ERROR_CODE_TEAM_ALREADY_CHAT_BANNED:{code:108420,message:"team already chat banned"},V2NIM_ERROR_CODE_ALL_TEAM_MEMBER_CHAT_BANNED:{code:108423,message:"all team member chat banned"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_LIMIT:{code:108434,message:"extended super team limit"},V2NIM_ERROR_CODE_CREATED_TEAM_LIMIT:{code:108435,message:"created team limit"},V2NIM_ERROR_CODE_TEAM_INVITATION_LIMIT:{code:108437,message:"team invitation limit"},V2NIM_ERROR_CODE_TEAM_HIT_ANTISPAM:{code:108451,message:"team hit antispam"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_LIMIT_NOT_CONFIGURED:{code:108304,message:"extended super team limit not configured"},V2NIM_ERROR_CODE_SUPER_TEAM_SERVICE_DISABLED:{code:108311,message:"super team service disabled"},V2NIM_ERROR_CODE_TEAM_READ_RECEIPT_RECORD_NOT_FOUND:{code:108301,message:"read receipt record for the team message not found"},V2NIM_ERROR_CODE_NOT_MANAGER:{code:108430,message:"unable to assign owner manager"},V2NIM_ERROR_CODE_ONLINE_MEMBER_COUNT_DISABLED:{code:108406,message:"number of online users service disabled"},V2NIM_ERROR_CODE_TRANSFER_DISABLED:{code:108310,message:"unable to transfer the ownership to owner"},V2NIM_ERROR_CODE_CREATE_TEAM_DISABLED:{code:108309,message:"unable to create team with more than %s people"},V2NIM_ERROR_CODE_EXTENDED_SUPER_TEAM_CREATE_FAILED:{code:108313,message:"/ extended super team creation failed,use open api to create the team"},V2NIM_ERROR_CODE_TEAM_MESSAGE_READ_RECEIPT_DISABLED:{code:108312,message:"read receipt for team messages function disabled"},V2NIM_ERROR_CODE_RETRY:{code:108449,message:"an error occurred, try again"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_NOT_TEAM_MEMBER:{code:109301,message:"list of chat banned users contains non team members"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_OPERATOR:{code:109303,message:"list of chat banned users contains the operator"},V2NIM_ERROR_CODE_CHAT_BAN_LIST_CONTAIN_TEAM_OWNER:{code:109304,message:"list of chat banned users contains the team owner"},V2NIM_ERROR_CODE_OPERATION_ON_TEAM_MANAGER_NOT_ALLOWED:{code:109305,message:"operation on team manager not allowed"},V2NIM_ERROR_CODE_NO_TEAM_INVITE_PERMISSION:{code:109306,message:"no team invite permission"},V2NIM_ERROR_CODE_TEAM_OWNER_QUIT_NOT_ALLOWED:{code:109307,message:"team owner quit not allowed"},V2NIM_ERROR_CODE_TEAM_OWNER_IN_KICK_LIST:{code:109308,message:"list of kicked user contains the team owner"},V2NIM_ERROR_CODE_INVITE_ROBOT_ACCOUNT_NOT_ALLOWED:{code:109309,message:"invite robot account not allowed"},V2NIM_ERROR_CODE_KICK_OPERATOR_NOT_ALLOWED:{code:109310,message:"kick operator not allowed"},V2NIM_ERROR_CODE_TEAM_MEMBER_ALREADY_EXIST:{code:109311,message:"team member already exist"},V2NIM_ERROR_CODE_TEAM_INVITATION_OR_APPLICATION_NOT_EXIST:{code:109313,message:"team invitation or application not exist"},V2NIM_ERROR_CODE_OPERATION_ON_TEAM_OWNER_NOT_ALLOWED:{code:109314,message:"operation on team owner not allowed"},V2NIM_ERROR_CODE_TEAM_MEMBER_NOT_EXIST:{code:109404,message:"team member not exist"},V2NIM_ERROR_CODE_TEAM_MEMBER_CHAT_BANNED:{code:109424,message:"team member chat banned"},V2NIM_ERROR_CODE_TEAM_OWNER_OPERATION_PERMISSION_REQUIRED:{code:109427,message:"team owner operation permission required"},V2NIM_ERROR_CODE_TEAM_OWNER_OR_MANAGER_OPERATION_PERMISSION_REQUIRED:{code:109432,message:"team owner or manager operation permission required"},V2NIM_ERROR_CODE_TEAM_MEMBER_CONCURRENT_OPERATION_FAILED:{code:109449,message:"team member concurrent operation failed"},V2NIM_ERROR_CODE_TEAM_MEMBER_HIT_ANTISPAM:{code:109451,message:"team member hit antispam"},V2NIM_ERROR_CODE_CONVERSATION_AND_ACCOUNT_MISMATCH:{code:110302,message:"conversation and account mismatch"},V2NIM_ERROR_CODE_CONVERSATION_STICK_TOP_LIMIT:{code:110303,message:"conversation stick top limit"},V2NIM_ERROR_CODE_CONVERSATION_BELONGED_GROUP_LIMIT:{code:110304,message:"conversation belonged group limit"},V2NIM_ERROR_CODE_CONVERSATION_NOT_EXIST:{code:110404,message:"conversation not exist"},V2NIM_ERROR_CODE_CHATROOM_LINK_UNAVAILABLE:{code:113304,message:"chatroom link unavailable"},V2NIM_ERROR_CODE_IM_CONNECTION_ABNORMAL:{code:113305,message:"IM connection abnormal"},V2NIM_ERROR_CODE_CHATROOM_NOT_EXIST:{code:113404,message:"chatroom not exist"},V2NIM_ERROR_CODE_CHATROOM_CLOSED:{code:113406,message:"chatroom closed"},V2NIM_ERROR_CODE_CHATROOM_REPEATED_OPERATION:{code:113409,message:"chatroom repeated operation"},V2NIM_ERROR_CODE_CHATROOM_DISABLED:{code:113410,message:"chatroom disabled"},V2NIM_ERROR_CODE_ALL_CHATROOM_MEMBER_CHAT_BANNED:{code:113423,message:"all chatroom member chat banned"},V2NIM_ERROR_CODE_CHATROOM_HIT_ANTISPAM:{code:113451,message:"chatroom hit antispam"},V2NIM_ERROR_CODE_ANONYMOUS_MEMBER_FORBIDDEN:{code:114303,message:"anonymous member forbidden"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_NOT_EXIST:{code:114404,message:"chatroom member not exist"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_REPEATED_OPERATION:{code:114405,message:"chatroom member repeated operation"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_CHAT_BANNED:{code:114421,message:"chatroom member chat banned"},V2NIM_ERROR_CODE_ACCOUNT_IN_CHATROOM_BLOCK_LIST:{code:114426,message:"account in chatroom block list"},V2NIM_ERROR_CODE_CHATROOM_OWNER_OPERATION_PERMISSION_REQUIRED:{code:114427,message:"chatroom owner operation permission required"},V2NIM_ERROR_CODE_SELF_IN_CHATROOM_MEMBER_OPERATION_LIST:{code:114429,message:"self in chatroom member operation list"},V2NIM_ERROR_CODE_CHATROOM_OWNER_OR_MANAGER_OPERATION_PERMISSION_REQUIRED:{code:114432,message:"chatroom owner or manager operation permission required"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_LIMIT:{code:114437,message:"chatroom member limit"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_CONCURRENT_OPERATION_FAILED:{code:114449,message:"chatroom member concurrent operation failed"},V2NIM_ERROR_CODE_CHATROOM_MEMBER_HIT_ANTISPAM:{code:114451,message:"chatroom member hit antispam"},V2NIM_ERROR_CODE_CONVERSATION_GROUP_NOT_EXIST:{code:116404,message:"conversation group not exist"},V2NIM_ERROR_CODE_CONVERSATION_GROUP_LIMIT:{code:116435,message:"conversation group limit"},V2NIM_ERROR_CODE_CONVERSATIONS_IN_GROUP_LIMIT:{code:116437,message:"conversations in group limit"},V2NIM_ERROR_CODE_COLLECTION_LIMIT:{code:189301,message:"collection limit"},V2NIM_ERROR_CODE_COLLECTION_NOT_EXIST:{code:189302,message:"collection not exist"},V2NIM_ERROR_CODE_COLLECTION_CONCURRENT_OPERATION_FAILED:{code:189449,message:"collection concurrent operation failed"},V2NIM_ERROR_CODE_INTERNAL:{code:190001,message:"internal error"},V2NIM_ERROR_CODE_ILLEGAL_STATE:{code:190002,message:"illegal state"},V2NIM_ERROR_CODE_MISUSE:{code:191001,message:"misuse"},V2NIM_ERROR_CODE_CANCELLED:{code:191002,message:"operation cancelled"},V2NIM_ERROR_CODE_CALLBACK_FAILED:{code:191003,message:"callback failed"},V2NIM_ERROR_CODE_INVALID_PARAMETER:{code:191004,message:"invalid parameter"},V2NIM_ERROR_CODE_TIMEOUT:{code:191005,message:"timeout"},V2NIM_ERROR_CODE_RESOURCE_NOT_EXIST:{code:191006,message:"resource not exist"},V2NIM_ERROR_CODE_RESOURCE_ALREADY_EXIST:{code:191007,message:"resource already exist"},V2NIM_ERROR_CODE_CONNECT_FAILED:{code:192001,message:"connect failed"},V2NIM_ERROR_CODE_CONNECT_TIMEOUT:{code:192002,message:"connect timeout"},V2NIM_ERROR_CODE_DISCONNECT:{code:192003,message:"disconnect"},V2NIM_ERROR_CODE_PROTOCOL_TIMEOUT:{code:192004,message:"protocol timeout"},V2NIM_ERROR_CODE_PROTOCOL_SEND_FAILED:{code:192005,message:"protocol send failed"},V2NIM_ERROR_CODE_REQUEST_FAILED:{code:192006,message:"request failed"},V2NIM_ERROR_CODE_FILE_NOT_FOUND:{code:194001,message:"file not found"},V2NIM_ERROR_CODE_FILE_CREATE_FAILED:{code:194002,message:"file create failed"},V2NIM_ERROR_CODE_FILE_OPEN_FAILED:{code:194003,message:"file open failed"},V2NIM_ERROR_CODE_FILE_WRITE_FAILED:{code:194004,message:"file write failed"},V2NIM_ERROR_CODE_FILE_READ_FAILED:{code:194005,message:"file read failed"},V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:{code:194006,message:"file upload failed"},V2NIM_ERROR_CODE_FILE_DOWNLOAD_FAILED:{code:194007,message:"file download failed"},V2NIM_ERROR_CODE_CLIENT_ANTISPAM:{code:195001,message:"client anti-spam"},V2NIM_ERROR_CODE_SERVER_ANTISPAM:{code:195002,message:"server anti-spam"}},Us=Fi(js),Bs=reduce(Us).call(Us,(function(t,a){var c=js[a];return t[a]=c.code,t}),{}),Hs=reduce(Us).call(Us,(function(t,a){var c=js[a];return t[c.code]=c.message,t}),{}),Gs=function(t){function V2NIMErrorImpl(a){var c;return(c=t.call(this,a.desc)||this).name="V2NIMError",c.code=a.code||0,c.desc=a.desc||Hs[c.code]||zs[c.code]||"",c.message=c.desc,c.detail=a.detail||{},c}return St(V2NIMErrorImpl,t),V2NIMErrorImpl.prototype.toString=function toString(){var t,a=this.name+"\n code: "+this.code+'\n message: "'+this.message+'"\n detail: '+(this.detail?Fs(this.detail):"");return(null===(t=null==this?void 0:this.detail)||void 0===t?void 0:t.rawError)&&(a+="\n rawError: "+this.detail.rawError.message),a},V2NIMErrorImpl}(Es(Error));var Ks=function(t){function ValidateError(a,c,h){var m;return void 0===c&&(c={}),(m=t.call(this,{code:Bs.V2NIM_ERROR_CODE_PARAMETER_ERROR,detail:{reason:a,rules:h,data:c}})||this).name="validateError",m.message=m.message+"\n"+Fs(m.detail,null,2),m.data=c,m.rules=h,m}return St(ValidateError,t),ValidateError}(Gs),qs=function(t){function ValidateErrorV2(a){var c,h,m,g;return(c=t.call(this,{code:Bs.V2NIM_ERROR_CODE_INVALID_PARAMETER,detail:{reason:null===(h=a.detail)||void 0===h?void 0:h.reason,rules:null===(m=a.detail)||void 0===m?void 0:m.rules,data:null===(g=a.detail)||void 0===g?void 0:g.data}})||this).name="ValidateErrorV2",c}return St(ValidateErrorV2,t),ValidateErrorV2}(Gs),Ws=function(t){function UploadError(a){var c;return(c=t.call(this,wt({code:400},a))||this).desc=c.desc||"upload file error",c.message=c.desc,c.name="uploadError",c}return St(UploadError,t),UploadError}(Gs),zs={200:null,406:null,808:null,810:null,302:"The user name or password is incorrect.",405:"Parameter length too long",408:"Client request timed out",415:"Service unavailable",422:"Account disabled",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},$s="object"==typeof t&&t&&t.Object===Object&&t,Ys="object"==typeof self&&self&&self.Object===Object&&self,Xs=$s||Ys||Function("return this")(),Qs=Xs.Symbol,Js=Object.prototype,Zs=Js.hasOwnProperty,ec=Js.toString,tc=Qs?Qs.toStringTag:void 0;var rc=function getRawTag(t){var a=Zs.call(t,tc),c=t[tc];try{t[tc]=void 0;var h=!0}catch(t){}var m=ec.call(t);return h&&(a?t[tc]=c:delete t[tc]),m},oc=Object.prototype.toString;var nc=function objectToString(t){return oc.call(t)},ic=Qs?Qs.toStringTag:void 0;var ac=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":ic&&ic in Object(t)?rc(t):nc(t)};var sc=function isObject(t){var a=typeof t;return null!=t&&("object"==a||"function"==a)};var cc=function isFunction(t){if(!sc(t))return!1;var a=ac(t);return"[object Function]"==a||"[object GeneratorFunction]"==a||"[object AsyncFunction]"==a||"[object Proxy]"==a},uc=Xs["__core-js_shared__"],lc=function(){var t=/[^.]+$/.exec(uc&&uc.keys&&uc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var dc=function isMasked(t){return!!lc&&lc in t},fc=Function.prototype.toString;var pc=function toSource(t){if(null!=t){try{return fc.call(t)}catch(t){}try{return t+""}catch(t){}}return""},hc=/^\[object .+?Constructor\]$/,mc=Function.prototype,gc=Object.prototype,vc=mc.toString,yc=gc.hasOwnProperty,_c=RegExp("^"+vc.call(yc).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var Ec=function baseIsNative(t){return!(!sc(t)||dc(t))&&(cc(t)?_c:hc).test(pc(t))};var bc=function getValue(t,a){return null==t?void 0:t[a]};var Oc=function getNative(t,a){var c=bc(t,a);return Ec(c)?c:void 0},Tc=function(){try{var t=Oc(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Sc=function baseAssignValue(t,a,c){"__proto__"==a&&Tc?Tc(t,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):t[a]=c};var Cc=function eq(t,a){return t===a||t!=t&&a!=a},Ic=Object.prototype.hasOwnProperty;var Rc=function assignValue(t,a,c){var h=t[a];Ic.call(t,a)&&Cc(h,c)&&(void 0!==c||a in t)||Sc(t,a,c)};var Mc=function copyObject(t,a,c,h){var m=!c;c||(c={});for(var g=-1,_=a.length;++g<_;){var E=a[g],b=h?h(c[E],t[E],E,c,t):void 0;void 0===b&&(b=t[E]),m?Sc(c,E,b):Rc(c,E,b)}return c};var kc=function identity(t){return t};var wc=function apply(t,a,c){switch(c.length){case 0:return t.call(a);case 1:return t.call(a,c[0]);case 2:return t.call(a,c[0],c[1]);case 3:return t.call(a,c[0],c[1],c[2])}return t.apply(a,c)},Nc=Math.max;var xc=function overRest(t,a,c){return a=Nc(void 0===a?t.length-1:a,0),function(){for(var h=arguments,m=-1,g=Nc(h.length-a,0),_=Array(g);++m<g;)_[m]=h[a+m];m=-1;for(var E=Array(a+1);++m<a;)E[m]=h[m];return E[a]=c(_),wc(t,this,E)}};var Ac=function constant(t){return function(){return t}},Pc=Tc?function(t,a){return Tc(t,"toString",{configurable:!0,enumerable:!1,value:Ac(a),writable:!0})}:kc,Lc=Date.now;var Dc=function shortOut(t){var a=0,c=0;return function(){var h=Lc(),m=16-(h-c);if(c=h,m>0){if(++a>=800)return arguments[0]}else a=0;return t.apply(void 0,arguments)}},Vc=Dc(Pc);var Fc=function baseRest(t,a){return Vc(xc(t,a,kc),t+"")};var jc=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var Uc=function isArrayLike(t){return null!=t&&jc(t.length)&&!cc(t)},Bc=/^(?:0|[1-9]\d*)$/;var Hc=function isIndex(t,a){var c=typeof t;return!!(a=null==a?9007199254740991:a)&&("number"==c||"symbol"!=c&&Bc.test(t))&&t>-1&&t%1==0&&t<a};var Gc=function isIterateeCall(t,a,c){if(!sc(c))return!1;var h=typeof a;return!!("number"==h?Uc(c)&&Hc(a,c.length):"string"==h&&a in c)&&Cc(c[a],t)};var Kc=function createAssigner(t){return Fc((function(a,c){var h=-1,m=c.length,g=m>1?c[m-1]:void 0,_=m>2?c[2]:void 0;for(g=t.length>3&&"function"==typeof g?(m--,g):void 0,_&&Gc(c[0],c[1],_)&&(g=m<3?void 0:g,m=1),a=Object(a);++h<m;){var E=c[h];E&&t(a,E,h,g)}return a}))};var qc=function baseTimes(t,a){for(var c=-1,h=Array(t);++c<t;)h[c]=a(c);return h};var Wc=function isObjectLike(t){return null!=t&&"object"==typeof t};var zc=function baseIsArguments(t){return Wc(t)&&"[object Arguments]"==ac(t)},$c=Object.prototype,Yc=$c.hasOwnProperty,Xc=$c.propertyIsEnumerable,Qc=zc(function(){return arguments}())?zc:function(t){return Wc(t)&&Yc.call(t,"callee")&&!Xc.call(t,"callee")},Jc=Qc,Zc=Array.isArray;var eu=function stubFalse(){return!1},tu=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c?Xs.Buffer:void 0,g=(m?m.isBuffer:void 0)||eu;t.exports=g})),ru={};ru["[object Float32Array]"]=ru["[object Float64Array]"]=ru["[object Int8Array]"]=ru["[object Int16Array]"]=ru["[object Int32Array]"]=ru["[object Uint8Array]"]=ru["[object Uint8ClampedArray]"]=ru["[object Uint16Array]"]=ru["[object Uint32Array]"]=!0,ru["[object Arguments]"]=ru["[object Array]"]=ru["[object ArrayBuffer]"]=ru["[object Boolean]"]=ru["[object DataView]"]=ru["[object Date]"]=ru["[object Error]"]=ru["[object Function]"]=ru["[object Map]"]=ru["[object Number]"]=ru["[object Object]"]=ru["[object RegExp]"]=ru["[object Set]"]=ru["[object String]"]=ru["[object WeakMap]"]=!1;var ou=function baseIsTypedArray(t){return Wc(t)&&jc(t.length)&&!!ru[ac(t)]};var nu=function baseUnary(t){return function(a){return t(a)}},iu=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c&&$s.process,g=function(){try{var t=h&&h.require&&h.require("util").types;return t||m&&m.binding&&m.binding("util")}catch(t){}}();t.exports=g})),au=iu&&iu.isTypedArray,su=au?nu(au):ou,cu=Object.prototype.hasOwnProperty;var uu=function arrayLikeKeys(t,a){var c=Zc(t),h=!c&&Jc(t),m=!c&&!h&&tu(t),g=!c&&!h&&!m&&su(t),_=c||h||m||g,E=_?qc(t.length,String):[],b=E.length;for(var O in t)!a&&!cu.call(t,O)||_&&("length"==O||m&&("offset"==O||"parent"==O)||g&&("buffer"==O||"byteLength"==O||"byteOffset"==O)||Hc(O,b))||E.push(O);return E},lu=Object.prototype;var du=function isPrototype(t){var a=t&&t.constructor;return t===("function"==typeof a&&a.prototype||lu)};var fu=function overArg(t,a){return function(c){return t(a(c))}},pu=fu(Object.keys,Object),hu=Object.prototype.hasOwnProperty;var mu=function baseKeys(t){if(!du(t))return pu(t);var a=[];for(var c in Object(t))hu.call(t,c)&&"constructor"!=c&&a.push(c);return a};var gu=function keys(t){return Uc(t)?uu(t):mu(t)},vu=Kc((function(t,a,c,h){Mc(a,gu(a),t,h)}));var yu,_u=function isUndefined(t){return void 0===t},Eu=(yu=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return yu()+yu()+yu()+yu()+yu()+yu()+yu()+yu()});function getEnumKeys(t){var a;return filter(a=Fi(t)).call(a,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,a){var c,h=filter(c=Fi(t)).call(c,(function(c){return t[c]==a}));return h.length>0?h[0]:void 0}function assignOptions(t,a){return vu({},t,a,(function(t,a){return _u(a)?t:a}))}function emptyFuncWithPromise(){return Xn.resolve()}_export({target:"Array",stat:!0},{isArray:ei});var bu=G.Array.isArray,callWithSafeIterationClosing=function(t,a,c,h){try{return h?a(anObject(c)[0],c[1]):a(c)}catch(a){iteratorClose(t,"throw",a)}},Ou=Array,Tu=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:Tu},{from:function from(t){var a=toObject(t),c=fo(this),h=arguments.length,m=h>1?arguments[1]:void 0,g=void 0!==m;g&&(m=functionBindContext(m,h>2?arguments[2]:void 0));var _,E,b,O,T,S,C=getIteratorMethod$5(a),I=0;if(!C||this===Ou&&isArrayIteratorMethod(C))for(_=lengthOfArrayLike(a),E=c?new this(_):Ou(_);_>I;I++)S=g?m(a[I],I):a[I],createProperty(E,I,S);else for(T=(O=getIterator(a,C)).next,E=c?new this:[];!(b=w(T,O)).done;I++)S=g?callWithSafeIterationClosing(O,m,[b.value,I],!0):b.value,createProperty(E,I,S);return E.length=I,E}});var Su=G.Array.from,Cu={f:wellKnownSymbol},Iu=He.f,wellKnownSymbolDefine=function(t){var a=G.Symbol||(G.Symbol={});de(a,t)||Iu(a,t,{value:Cu.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),a=t&&t.prototype,c=a&&a.valueOf,h=wellKnownSymbol("toPrimitive");a&&!a[h]&&defineBuiltIn(a,h,(function(t){return w(c,this)}),{arity:1})},Ru=bi.forEach,Mu=sharedKey("hidden"),ku="Symbol",wu=Rr.set,Nu=Rr.getterFor(ku),xu=Object.prototype,Au=m.Symbol,Pu=Au&&Au.prototype,Lu=m.TypeError,Du=m.QObject,Vu=Ce.f,Fu=He.f,ju=Da.f,Uu=A.f,Bu=R([].push),Hu=ce("symbols"),Gu=ce("op-symbols"),Ku=ce("wks"),qu=!Du||!Du.prototype||!Du.prototype.findChild,Wu=M&&fails((function(){return 7!=ct(Fu({},"a",{get:function(){return Fu(this,"a",{value:7}).a}})).a}))?function(t,a,c){var h=Vu(xu,a);h&&delete xu[a],Fu(t,a,c),h&&t!==xu&&Fu(xu,a,h)}:Fu,wrap=function(t,a){var c=Hu[t]=ct(Pu);return wu(c,{type:ku,tag:t,description:a}),M||(c.description=a),c},zu=function defineProperty(t,a,c){t===xu&&zu(Gu,a,c),anObject(t);var h=toPropertyKey(a);return anObject(c),de(Hu,h)?(c.enumerable?(de(t,Mu)&&t[Mu][h]&&(t[Mu][h]=!1),c=ct(c,{enumerable:createPropertyDescriptor(0,!1)})):(de(t,Mu)||Fu(t,Mu,createPropertyDescriptor(1,{})),t[Mu][h]=!0),Wu(t,h,c)):Fu(t,h,c)},$u=function defineProperties(t,a){anObject(t);var c=toIndexedObject(a),h=rt(c).concat($getOwnPropertySymbols(c));return Ru(h,(function(a){M&&!w(Yu,c,a)||zu(t,a,c[a])})),t},Yu=function propertyIsEnumerable(t){var a=toPropertyKey(t),c=w(Uu,this,a);return!(this===xu&&de(Hu,a)&&!de(Gu,a))&&(!(c||!de(this,a)||!de(Hu,a)||de(this,Mu)&&this[Mu][a])||c)},Xu=function getOwnPropertyDescriptor(t,a){var c=toIndexedObject(t),h=toPropertyKey(a);if(c!==xu||!de(Hu,h)||de(Gu,h)){var m=Vu(c,h);return!m||!de(Hu,h)||de(c,Mu)&&c[Mu][h]||(m.enumerable=!0),m}},Qu=function getOwnPropertyNames(t){var a=ju(toIndexedObject(t)),c=[];return Ru(a,(function(t){de(Hu,t)||de(Je,t)||Bu(c,t)})),c},$getOwnPropertySymbols=function(t){var a=t===xu,c=ju(a?Gu:toIndexedObject(t)),h=[];return Ru(c,(function(t){!de(Hu,t)||a&&!de(xu,t)||Bu(h,Hu[t])})),h};J||(Au=function Symbol(){if(K(Pu,this))throw Lu("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,a=uid(t),setter=function(t){this===xu&&w(setter,Gu,t),de(this,Mu)&&de(this[Mu],a)&&(this[Mu][a]=!1),Wu(this,a,createPropertyDescriptor(1,t))};return M&&qu&&Wu(xu,a,{configurable:!0,set:setter}),wrap(a,t)},Pu=Au.prototype,defineBuiltIn(Pu,"toString",(function toString(){return Nu(this).tag})),defineBuiltIn(Au,"withoutSetter",(function(t){return wrap(uid(t),t)})),A.f=Yu,He.f=zu,nt.f=$u,Ce.f=Xu,Vt.f=Da.f=Qu,Ct.f=$getOwnPropertySymbols,Cu.f=function(t){return wrap(wellKnownSymbol(t),t)},M&&Fu(Pu,"description",{configurable:!0,get:function description(){return Nu(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!J,sham:!J},{Symbol:Au}),Ru(rt(Ku),(function(t){wellKnownSymbolDefine(t)})),_export({target:ku,stat:!0,forced:!J},{useSetter:function(){qu=!0},useSimple:function(){qu=!1}}),_export({target:"Object",stat:!0,forced:!J,sham:!M},{create:function create(t,a){return void 0===a?ct(t):$u(ct(t),a)},defineProperty:zu,defineProperties:$u,getOwnPropertyDescriptor:Xu}),_export({target:"Object",stat:!0,forced:!J},{getOwnPropertyNames:Qu}),symbolDefineToPrimitive(),setToStringTag(Au,ku),Je[Mu]=!0;var Ju=J&&!!Symbol.for&&!!Symbol.keyFor,Zu=ce("string-to-symbol-registry"),el=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Ju},{for:function(t){var a=toString$1(t);if(de(Zu,a))return Zu[a];var c=getBuiltIn("Symbol")(a);return Zu[a]=c,el[c]=a,c}});var tl=ce("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Ju},{keyFor:function keyFor(t){if(!te(t))throw TypeError(tryToString(t)+" is not a symbol");if(de(tl,t))return tl[t]}});var rl=!J||fails((function(){Ct.f(1)}));_export({target:"Object",stat:!0,forced:rl},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var a=Ct.f;return a?a(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(m.JSON,"JSON",!0);var ol=G.Symbol;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var nl=ol,il=getIteratorMethod$5;var al=Cu.f("iterator"),sl=createCommonjsModule((function(t){function _typeof(a){return t.exports=_typeof="function"==typeof nl&&"symbol"==typeof al?function(t){return typeof t}:function(t){return t&&"function"==typeof nl&&t.constructor===nl&&t!==nl.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(a)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),cl=R([].reverse),ul=[1,2];_export({target:"Array",proto:!0,forced:String(ul)===String(ul.reverse())},{reverse:function reverse(){return ei(this)&&(this.length=this.length),cl(this)}});var ll=entryVirtual("Array").reverse,dl=Array.prototype,reverse=function(t){var a=t.reverse;return t===dl||K(dl,t)&&a===dl.reverse?ll:a},fl=createCommonjsModule((function(t){var a=sl.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return c},t.exports.__esModule=!0,t.exports.default=t.exports;var c={},h=Object.prototype,m=h.hasOwnProperty,g="function"==typeof nl?nl:{},_=g.iterator||"@@iterator",E=g.asyncIterator||"@@asyncIterator",b=g.toStringTag||"@@toStringTag";function define(t,a,c){return _i(t,a,{value:c,enumerable:!0,configurable:!0,writable:!0}),t[a]}try{define({},"")}catch(t){define=function define(t,a,c){return t[a]=c}}function wrap(t,a,c,h){var m=a&&a.prototype instanceof Generator?a:Generator,g=lt(m.prototype),_=new Context(h||[]);return g._invoke=function(t,a,c){var h="suspendedStart";return function(m,g){if("executing"===h)throw new Error("Generator is already running");if("completed"===h){if("throw"===m)throw g;return doneResult()}for(c.method=m,c.arg=g;;){var _=c.delegate;if(_){var E=maybeInvokeDelegate(_,c);if(E){if(E===O)continue;return E}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if("suspendedStart"===h)throw h="completed",c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);h="executing";var b=tryCatch(t,a,c);if("normal"===b.type){if(h=c.done?"completed":"suspendedYield",b.arg===O)continue;return{value:b.arg,done:c.done}}"throw"===b.type&&(h="completed",c.method="throw",c.arg=b.arg)}}}(t,c,_),g}function tryCatch(t,a,c){try{return{type:"normal",arg:t.call(a,c)}}catch(t){return{type:"throw",arg:t}}}c.wrap=wrap;var O={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var T={};define(T,_,(function(){return this}));var S=ss&&ss(ss(values([])));S&&S!==h&&m.call(S,_)&&(T=S);var C=GeneratorFunctionPrototype.prototype=Generator.prototype=lt(T);function defineIteratorMethods(t){var a;forEach$1(a=["next","throw","return"]).call(a,(function(a){define(t,a,(function(t){return this._invoke(a,t)}))}))}function AsyncIterator(t,c){function invoke(h,g,_,E){var b=tryCatch(t[h],t,g);if("throw"!==b.type){var O=b.arg,T=O.value;return T&&"object"==a(T)&&m.call(T,"__await")?c.resolve(T.__await).then((function(t){invoke("next",t,_,E)}),(function(t){invoke("throw",t,_,E)})):c.resolve(T).then((function(t){O.value=t,_(O)}),(function(t){return invoke("throw",t,_,E)}))}E(b.arg)}var h;this._invoke=function(t,a){function callInvokeWithMethodAndArg(){return new c((function(c,h){invoke(t,a,c,h)}))}return h=h?h.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,a){var c=t.iterator[a.method];if(void 0===c){if(a.delegate=null,"throw"===a.method){if(t.iterator.return&&(a.method="return",a.arg=void 0,maybeInvokeDelegate(t,a),"throw"===a.method))return O;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var h=tryCatch(c,t.iterator,a.arg);if("throw"===h.type)return a.method="throw",a.arg=h.arg,a.delegate=null,O;var m=h.arg;return m?m.done?(a[t.resultName]=m.value,a.next=t.nextLoc,"return"!==a.method&&(a.method="next",a.arg=void 0),a.delegate=null,O):m:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,O)}function pushTryEntry(t){var a={tryLoc:t[0]};1 in t&&(a.catchLoc=t[1]),2 in t&&(a.finallyLoc=t[2],a.afterLoc=t[3]),this.tryEntries.push(a)}function resetTryEntry(t){var a=t.completion||{};a.type="normal",delete a.arg,t.completion=a}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var a=t[_];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var c=-1,h=function next(){for(;++c<t.length;)if(m.call(t,c))return next.value=t[c],next.done=!1,next;return next.value=void 0,next.done=!0,next};return h.next=h}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(C,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,b,"GeneratorFunction"),c.isGeneratorFunction=function(t){var a="function"==typeof t&&t.constructor;return!!a&&(a===GeneratorFunction||"GeneratorFunction"===(a.displayName||a.name))},c.mark=function(t){return ht?ht(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,b,"GeneratorFunction")),t.prototype=lt(C),t},c.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,E,(function(){return this})),c.AsyncIterator=AsyncIterator,c.async=function(t,a,h,m,g){void 0===g&&(g=Xn);var _=new AsyncIterator(wrap(t,a,h,m),g);return c.isGeneratorFunction(a)?_:_.next().then((function(t){return t.done?t.value:_.next()}))},defineIteratorMethods(C),define(C,b,"Generator"),define(C,_,(function(){return this})),define(C,"toString",(function(){return"[object Generator]"})),c.keys=function(t){var a=[];for(var c in t)a.push(c);return reverse(a).call(a),function next(){for(;a.length;){var c=a.pop();if(c in t)return next.value=c,next.done=!1,next}return next.done=!0,next}},c.values=values,Context.prototype={constructor:Context,reset:function reset(t){var a;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(a=this.tryEntries).call(a,resetTryEntry),!t)for(var c in this)"t"===c.charAt(0)&&m.call(this,c)&&!isNaN(+slice(c).call(c,1))&&(this[c]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(c,h){return g.type="throw",g.arg=t,a.next=c,h&&(a.method="next",a.arg=void 0),!!h}for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c],g=h.completion;if("root"===h.tryLoc)return handle("end");if(h.tryLoc<=this.prev){var _=m.call(h,"catchLoc"),E=m.call(h,"finallyLoc");if(_&&E){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0);if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}else if(_){if(this.prev<h.catchLoc)return handle(h.catchLoc,!0)}else{if(!E)throw new Error("try statement without catch or finally");if(this.prev<h.finallyLoc)return handle(h.finallyLoc)}}}},abrupt:function abrupt(t,a){for(var c=this.tryEntries.length-1;c>=0;--c){var h=this.tryEntries[c];if(h.tryLoc<=this.prev&&m.call(h,"finallyLoc")&&this.prev<h.finallyLoc){var g=h;break}}g&&("break"===t||"continue"===t)&&g.tryLoc<=a&&a<=g.finallyLoc&&(g=null);var _=g?g.completion:{};return _.type=t,_.arg=a,g?(this.method="next",this.next=g.finallyLoc,O):this.complete(_)},complete:function complete(t,a){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&a&&(this.next=a),O},finish:function finish(t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.finallyLoc===t)return this.complete(c.completion,c.afterLoc),resetTryEntry(c),O}},catch:function _catch(t){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc===t){var h=c.completion;if("throw"===h.type){var m=h.arg;resetTryEntry(c)}return m}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,c){return this.delegate={iterator:values(t),resultName:a,nextLoc:c},"next"===this.method&&(this.arg=void 0),O}},c}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),pl=fl(),hl=pl;try{regeneratorRuntime=pl}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=pl:Function("r","regeneratorRuntime = r")(pl)}function __rest(t,a){var c={};for(var h in t)Object.prototype.hasOwnProperty.call(t,h)&&a.indexOf(h)<0&&(c[h]=t[h]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var m=0;for(h=Object.getOwnPropertySymbols(t);m<h.length;m++)a.indexOf(h[m])<0&&Object.prototype.propertyIsEnumerable.call(t,h[m])&&(c[h[m]]=t[h[m]])}return c}function __awaiter(t,a,c,h){return new(c||(c=Promise))((function(m,g){function fulfilled(t){try{step(h.next(t))}catch(t){g(t)}}function rejected(t){try{step(h.throw(t))}catch(t){g(t)}}function step(t){t.done?m(t.value):function adopt(t){return t instanceof c?t:new c((function(a){a(t)}))}(t.value).then(fulfilled,rejected)}step((h=h.apply(t,a||[])).next())}))}var ml=function isSymbol(t){return"symbol"==typeof t||Wc(t)&&"[object Symbol]"==ac(t)},gl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vl=/^\w*$/;var yl=function isKey(t,a){if(Zc(t))return!1;var c=typeof t;return!("number"!=c&&"symbol"!=c&&"boolean"!=c&&null!=t&&!ml(t))||(vl.test(t)||!gl.test(t)||null!=a&&t in Object(a))},_l=Oc(Object,"create");var El=function hashClear(){this.__data__=_l?_l(null):{},this.size=0};var bl=function hashDelete(t){var a=this.has(t)&&delete this.__data__[t];return this.size-=a?1:0,a},Ol=Object.prototype.hasOwnProperty;var Tl=function hashGet(t){var a=this.__data__;if(_l){var c=a[t];return"__lodash_hash_undefined__"===c?void 0:c}return Ol.call(a,t)?a[t]:void 0},Sl=Object.prototype.hasOwnProperty;var Cl=function hashHas(t){var a=this.__data__;return _l?void 0!==a[t]:Sl.call(a,t)};var Il=function hashSet(t,a){var c=this.__data__;return this.size+=this.has(t)?0:1,c[t]=_l&&void 0===a?"__lodash_hash_undefined__":a,this};function Hash(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}Hash.prototype.clear=El,Hash.prototype.delete=bl,Hash.prototype.get=Tl,Hash.prototype.has=Cl,Hash.prototype.set=Il;var Rl=Hash;var Ml=function listCacheClear(){this.__data__=[],this.size=0};var kl=function assocIndexOf(t,a){for(var c=t.length;c--;)if(Cc(t[c][0],a))return c;return-1},wl=Array.prototype.splice;var Nl=function listCacheDelete(t){var a=this.__data__,c=kl(a,t);return!(c<0)&&(c==a.length-1?a.pop():wl.call(a,c,1),--this.size,!0)};var xl=function listCacheGet(t){var a=this.__data__,c=kl(a,t);return c<0?void 0:a[c][1]};var Al=function listCacheHas(t){return kl(this.__data__,t)>-1};var Pl=function listCacheSet(t,a){var c=this.__data__,h=kl(c,t);return h<0?(++this.size,c.push([t,a])):c[h][1]=a,this};function ListCache(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}ListCache.prototype.clear=Ml,ListCache.prototype.delete=Nl,ListCache.prototype.get=xl,ListCache.prototype.has=Al,ListCache.prototype.set=Pl;var Ll=ListCache,Dl=Oc(Xs,"Map");var Vl=function mapCacheClear(){this.size=0,this.__data__={hash:new Rl,map:new(Dl||Ll),string:new Rl}};var Fl=function isKeyable(t){var a=typeof t;return"string"==a||"number"==a||"symbol"==a||"boolean"==a?"__proto__"!==t:null===t};var jl=function getMapData(t,a){var c=t.__data__;return Fl(a)?c["string"==typeof a?"string":"hash"]:c.map};var Ul=function mapCacheDelete(t){var a=jl(this,t).delete(t);return this.size-=a?1:0,a};var Bl=function mapCacheGet(t){return jl(this,t).get(t)};var Hl=function mapCacheHas(t){return jl(this,t).has(t)};var Gl=function mapCacheSet(t,a){var c=jl(this,t),h=c.size;return c.set(t,a),this.size+=c.size==h?0:1,this};function MapCache(t){var a=-1,c=null==t?0:t.length;for(this.clear();++a<c;){var h=t[a];this.set(h[0],h[1])}}MapCache.prototype.clear=Vl,MapCache.prototype.delete=Ul,MapCache.prototype.get=Bl,MapCache.prototype.has=Hl,MapCache.prototype.set=Gl;var Kl=MapCache;function memoize(t,a){if("function"!=typeof t||null!=a&&"function"!=typeof a)throw new TypeError("Expected a function");var memoized=function(){var c=arguments,h=a?a.apply(this,c):c[0],m=memoized.cache;if(m.has(h))return m.get(h);var g=t.apply(this,c);return memoized.cache=m.set(h,g)||m,g};return memoized.cache=new(memoize.Cache||Kl),memoized}memoize.Cache=Kl;var ql=memoize;var Wl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,zl=/\\(\\)?/g,$l=function memoizeCapped(t){var a=ql(t,(function(t){return 500===c.size&&c.clear(),t})),c=a.cache;return a}((function(t){var a=[];return 46===t.charCodeAt(0)&&a.push(""),t.replace(Wl,(function(t,c,h,m){a.push(h?m.replace(zl,"$1"):c||t)})),a})),Yl=$l;var Xl=function arrayMap(t,a){for(var c=-1,h=null==t?0:t.length,m=Array(h);++c<h;)m[c]=a(t[c],c,t);return m},Ql=Qs?Qs.prototype:void 0,Jl=Ql?Ql.toString:void 0;var Zl=function baseToString(t){if("string"==typeof t)return t;if(Zc(t))return Xl(t,baseToString)+"";if(ml(t))return Jl?Jl.call(t):"";var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var ed=function toString(t){return null==t?"":Zl(t)};var td=function castPath(t,a){return Zc(t)?t:yl(t,a)?[t]:Yl(ed(t))};var rd=function toKey(t){if("string"==typeof t||ml(t))return t;var a=t+"";return"0"==a&&1/t==-Infinity?"-0":a};var od=function baseGet(t,a){for(var c=0,h=(a=td(a,t)).length;null!=t&&c<h;)t=t[rd(a[c++])];return c&&c==h?t:void 0};var nd=function get(t,a,c){var h=null==t?void 0:od(t,a);return void 0===h?c:h};var id=function stackClear(){this.__data__=new Ll,this.size=0};var ad=function stackDelete(t){var a=this.__data__,c=a.delete(t);return this.size=a.size,c};var sd=function stackGet(t){return this.__data__.get(t)};var cd=function stackHas(t){return this.__data__.has(t)};var ud=function stackSet(t,a){var c=this.__data__;if(c instanceof Ll){var h=c.__data__;if(!Dl||h.length<199)return h.push([t,a]),this.size=++c.size,this;c=this.__data__=new Kl(h)}return c.set(t,a),this.size=c.size,this};function Stack(t){var a=this.__data__=new Ll(t);this.size=a.size}Stack.prototype.clear=id,Stack.prototype.delete=ad,Stack.prototype.get=sd,Stack.prototype.has=cd,Stack.prototype.set=ud;var ld=Stack;var dd=function assignMergeValue(t,a,c){(void 0!==c&&!Cc(t[a],c)||void 0===c&&!(a in t))&&Sc(t,a,c)};var fd=function createBaseFor(t){return function(a,c,h){for(var m=-1,g=Object(a),_=h(a),E=_.length;E--;){var b=_[t?E:++m];if(!1===c(g[b],b,g))break}return a}}(),pd=createCommonjsModule((function(t,a){var c=a&&!a.nodeType&&a,h=c&&t&&!t.nodeType&&t,m=h&&h.exports===c?Xs.Buffer:void 0,g=m?m.allocUnsafe:void 0;t.exports=function cloneBuffer(t,a){if(a)return t.slice();var c=t.length,h=g?g(c):new t.constructor(c);return t.copy(h),h}})),hd=Xs.Uint8Array;var md=function cloneArrayBuffer(t){var a=new t.constructor(t.byteLength);return new hd(a).set(new hd(t)),a};var gd=function cloneTypedArray(t,a){var c=a?md(t.buffer):t.buffer;return new t.constructor(c,t.byteOffset,t.length)};var vd=function copyArray(t,a){var c=-1,h=t.length;for(a||(a=Array(h));++c<h;)a[c]=t[c];return a},yd=Object.create,_d=function(){function object(){}return function(t){if(!sc(t))return{};if(yd)return yd(t);object.prototype=t;var a=new object;return object.prototype=void 0,a}}(),Ed=fu(Object.getPrototypeOf,Object);var bd=function initCloneObject(t){return"function"!=typeof t.constructor||du(t)?{}:_d(Ed(t))};var Od=function isArrayLikeObject(t){return Wc(t)&&Uc(t)},Td=Function.prototype,Sd=Object.prototype,Cd=Td.toString,Id=Sd.hasOwnProperty,Rd=Cd.call(Object);var Md=function isPlainObject(t){if(!Wc(t)||"[object Object]"!=ac(t))return!1;var a=Ed(t);if(null===a)return!0;var c=Id.call(a,"constructor")&&a.constructor;return"function"==typeof c&&c instanceof c&&Cd.call(c)==Rd};var kd=function safeGet(t,a){if(("constructor"!==a||"function"!=typeof t[a])&&"__proto__"!=a)return t[a]};var wd=function nativeKeysIn(t){var a=[];if(null!=t)for(var c in Object(t))a.push(c);return a},Nd=Object.prototype.hasOwnProperty;var xd=function baseKeysIn(t){if(!sc(t))return wd(t);var a=du(t),c=[];for(var h in t)("constructor"!=h||!a&&Nd.call(t,h))&&c.push(h);return c};var Ad=function keysIn(t){return Uc(t)?uu(t,!0):xd(t)};var Pd=function toPlainObject(t){return Mc(t,Ad(t))};var Ld=function baseMergeDeep(t,a,c,h,m,g,_){var E=kd(t,c),b=kd(a,c),O=_.get(b);if(O)dd(t,c,O);else{var T=g?g(E,b,c+"",t,a,_):void 0,S=void 0===T;if(S){var C=Zc(b),I=!C&&tu(b),R=!C&&!I&&su(b);T=b,C||I||R?Zc(E)?T=E:Od(E)?T=vd(E):I?(S=!1,T=pd(b,!0)):R?(S=!1,T=gd(b,!0)):T=[]:Md(b)||Jc(b)?(T=E,Jc(E)?T=Pd(E):sc(E)&&!cc(E)||(T=bd(b))):S=!1}S&&(_.set(b,T),m(T,b,h,g,_),_.delete(b)),dd(t,c,T)}};var Dd=function baseMerge(t,a,c,h,m){t!==a&&fd(a,(function(g,_){if(m||(m=new ld),sc(g))Ld(t,a,_,c,baseMerge,h,m);else{var E=h?h(kd(t,_),g,_+"",t,a,m):void 0;void 0===E&&(E=g),dd(t,_,E)}}),Ad)},Vd=Kc((function(t,a,c){Dd(t,a,c)})),Fd=bi.some,jd=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!jd},{some:function some(t){return Fd(this,t,arguments.length>1?arguments[1]:void 0)}});var Ud,Bd,Hd=entryVirtual("Array").some,Gd=Array.prototype,some=function(t){var a=t.some;return t===Gd||K(Gd,t)&&a===Gd.some?Hd:a};!function(t){t[t.Unset=0]="Unset",t[t.RN=2]="RN",t[t.UNIAPP=3]="UNIAPP",t[t.Electron=5]="Electron",t[t.WeiXin=6]="WeiXin",t[t.BROWSER=100]="BROWSER",t[t.H5=101]="H5",t[t.Ali=102]="Ali",t[t.Baidu=103]="Baidu",t[t.Tiktok=104]="Tiktok"}(Ud||(Ud={})),function(t){t[t.kStatNetTypeUnkonw=0]="kStatNetTypeUnkonw",t[t.kStatNetTypeEthernet=1]="kStatNetTypeEthernet",t[t.kStatNetTypeWifi=2]="kStatNetTypeWifi",t[t.kStatNetType2G=3]="kStatNetType2G",t[t.kStatNetType3G=4]="kStatNetType3G",t[t.kStatNetType4G=5]="kStatNetType4G",t[t.kStatNetType5G=6]="kStatNetType5G"}(Bd||(Bd={}));var Kd={wifi:Bd.kStatNetTypeWifi,"2g":Bd.kStatNetType2G,"3g":Bd.kStatNetType3G,"4g":Bd.kStatNetType4G,"5g":Bd.kStatNetType5G,ethernet:Bd.kStatNetTypeEthernet,unknown:Bd.kStatNetTypeUnkonw,none:Bd.kStatNetTypeUnkonw,notreachable:Bd.kStatNetTypeUnkonw,wwan:Bd.kStatNetTypeUnkonw};function isMobile(){if(!navigator||!navigator.userAgent)return!1;var t=[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i];return some(t).call(t,(function(t){return navigator.userAgent.match(t)}))}function isElectron(){var t;return!(!navigator||!navigator.userAgent)&&("object"==typeof navigator&&"string"==typeof navigator.userAgent&&indexOf(t=navigator.userAgent).call(t,"Electron")>=0)}function isBrowser(){return navigator&&navigator.userAgent}var qd,Wd,zd,$d,Yd,Xd,Qd={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,a){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,this.binaryType="",new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,a){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,a){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")},getFileUploadInformation:function getFileUploadInformation(t){throw new Error("Function not implemented.")},net:{__getEnv:function __getEnv(){return null},__onNetworkStatusChangeFn:null,getNetworkStatus:function getNetworkStatus(){var t=this.__getEnv();return new Xn((function(a,c){t.getNetworkType({success:function success(t){var c=!1;c="boolean"==typeof t.networkAvailable?t.networkAvailable:"none"!==t.networkType.toLowerCase(),a({net_type:Kd[t.networkType.toLowerCase()],net_connect:c})},fail:function fail(){c(new Error("getNetworkType failed"))}})}))},onNetworkStatusChange:function onNetworkStatusChange(t){var a=this.__getEnv();this.offNetworkStatusChange(),a.onNetworkStatusChange&&(this.__onNetworkStatusChangeFn=function(a){var c=a.networkType.toLowerCase();t({isConnected:a.isConnected||"none"!==c,networkType:Kd[c]})},a.onNetworkStatusChange(this.__onNetworkStatusChangeFn))},offNetworkStatusChange:function offNetworkStatusChange(){var t=this.__getEnv();t.offNetworkStatusChange&&(this.__onNetworkStatusChangeFn&&t.offNetworkStatusChange(this.__onNetworkStatusChangeFn),this.__onNetworkStatusChangeFn=null)}}};function getPromiseWithAbort(t){var a={},c=new Xn((function(t,c){a.abort=c}));return a.promise=Xn.race([t,c]),a}!function(t){t[t.V2NIM_LOGIN_AUTH_TYPE_DEFAULT=0]="V2NIM_LOGIN_AUTH_TYPE_DEFAULT",t[t.V2NIM_LOGIN_AUTH_TYPE_DYNAMIC_TOKEN=1]="V2NIM_LOGIN_AUTH_TYPE_DYNAMIC_TOKEN",t[t.V2NIM_LOGIN_AUTH_TYPE_THIRD_PARTY=2]="V2NIM_LOGIN_AUTH_TYPE_THIRD_PARTY"}(qd||(qd={})),function(t){t[t.V2NIM_LOGIN_STATUS_LOGOUT=0]="V2NIM_LOGIN_STATUS_LOGOUT",t[t.V2NIM_LOGIN_STATUS_LOGINED=1]="V2NIM_LOGIN_STATUS_LOGINED",t[t.V2NIM_LOGIN_STATUS_LOGINING=2]="V2NIM_LOGIN_STATUS_LOGINING",t[t.V2NIM_LOGIN_STATUS_UNLOGIN=3]="V2NIM_LOGIN_STATUS_UNLOGIN"}(Wd||(Wd={})),function(t){t[t.V2NIM_LOGIN_CLIENT_TYPE_UNKNOWN=0]="V2NIM_LOGIN_CLIENT_TYPE_UNKNOWN",t[t.V2NIM_LOGIN_CLIENT_TYPE_ANDROID=1]="V2NIM_LOGIN_CLIENT_TYPE_ANDROID",t[t.V2NIM_LOGIN_CLIENT_TYPE_IOS=2]="V2NIM_LOGIN_CLIENT_TYPE_IOS",t[t.V2NIM_LOGIN_CLIENT_TYPE_PC=4]="V2NIM_LOGIN_CLIENT_TYPE_PC",t[t.V2NIM_LOGIN_CLIENT_TYPE_WP=8]="V2NIM_LOGIN_CLIENT_TYPE_WP",t[t.V2NIM_LOGIN_CLIENT_TYPE_WEB=16]="V2NIM_LOGIN_CLIENT_TYPE_WEB",t[t.V2NIM_LOGIN_CLIENT_TYPE_RESTFUL=32]="V2NIM_LOGIN_CLIENT_TYPE_RESTFUL",t[t.V2NIM_LOGIN_CLIENT_TYPE_MAC_OS=64]="V2NIM_LOGIN_CLIENT_TYPE_MAC_OS",t[t.V2NIM_LOGIN_CLIENT_TYPE_HARMONY_OS=65]="V2NIM_LOGIN_CLIENT_TYPE_HARMONY_OS"}(zd||(zd={})),function(t){t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT_EXCLUSIVE=1]="V2NIM_KICKED_OFFLINE_REASON_CLIENT_EXCLUSIVE",t[t.V2NIM_KICKED_OFFLINE_REASON_SERVER=2]="V2NIM_KICKED_OFFLINE_REASON_SERVER",t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT=3]="V2NIM_KICKED_OFFLINE_REASON_CLIENT",t[t.V2NIM_KICKED_OFFLINE_REASON_CLIENT_QUIETLY=4]="V2NIM_KICKED_OFFLINE_REASON_CLIENT_QUIETLY"}($d||($d={})),function(t){t[t.V2NIM_LOGIN_CLIENT_CHANGE_LIST=1]="V2NIM_LOGIN_CLIENT_CHANGE_LIST",t[t.V2NIM_LOGIN_CLIENT_CHANGE_LOGIN=2]="V2NIM_LOGIN_CLIENT_CHANGE_LOGIN",t[t.V2NIM_LOGIN_CLIENT_CHANGE_LOGOUT=3]="V2NIM_LOGIN_CLIENT_CHANGE_LOGOUT"}(Yd||(Yd={})),function(t){t[t.V2NIM_CONNECT_STATUS_DISCONNECTED=0]="V2NIM_CONNECT_STATUS_DISCONNECTED",t[t.V2NIM_CONNECT_STATUS_CONNECTED=1]="V2NIM_CONNECT_STATUS_CONNECTED",t[t.V2NIM_CONNECT_STATUS_CONNECTING=2]="V2NIM_CONNECT_STATUS_CONNECTING",t[t.V2NIM_CONNECT_STATUS_WAITING=3]="V2NIM_CONNECT_STATUS_WAITING"}(Xd||(Xd={})),Xn.reject;var Jd=function(){function PromiseManager(){this.abortFns=[]}var t=PromiseManager.prototype;return t.add=function add(t){var a=getPromiseWithAbort(t);return this.abortFns.push(a.abort),a.promise},t.clear=function clear(t){var a;forEach$1(a=this.abortFns).call(a,(function(a){return a(t||new Gs({code:Bs.V2NIM_ERROR_CODE_CANCELLED,detail:{reason:"Aborted"}}))})),this.abortFns=[]},t.destroy=function destroy(){this.clear()},PromiseManager}(),Zd={tolerantRTT:3e3,bestRTT:100,maxChances:5,enable:!0},ef={timestamp:0,rtt:0,baseClock:0,baseTime:0},tf=function(){function TimeOrigin(t,a,c){void 0===c&&(c="getServerTime"),this.serverOrigin=ef,this.config=Zd,this.isSettingNTP=!1,this.currentChance=0,this.failedDelay=2e3,this.successDelay=3e5,this.timer=0,this.cmdName="getServerTime",this.core=t,this.logger=t.logger,this.promiseManager=new Jd,this.cmdName=c,a&&this.setOptions(a)}var t=TimeOrigin.prototype;return t.setOptions=function setOptions(t){this.config=wt({},Zd,this.config,t)},t.reset=function reset(){this.timer&&clearTimeout(this.timer),this.promiseManager.clear(),this.serverOrigin=ef,this.currentChance=0},t.setOriginTimetick=function setOriginTimetick(){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var t,a,c,h,m,g,_,E,b,O;return hl.wrap((function _callee$(T){for(;;)switch(T.prev=T.next){case 0:if(this.config.enable){T.next=2;break}return T.abrupt("return");case 2:if(!this.isSettingNTP){T.next=4;break}return T.abrupt("return");case 4:if(!(this.currentChance>=this.config.maxChances)){T.next=6;break}return T.abrupt("return");case 6:if(t=nd(this.core,"auth.status"),a=nd(this.core,"status"),c=nd(this.core,"V2NIMLoginService.lifeCycle.loginStatus"),"logined"===t||"logined"===a||c===Wd.V2NIM_LOGIN_STATUS_LOGINED){T.next=11;break}return T.abrupt("return");case 11:return this.isSettingNTP=!0,this.currentChance++,this.timer&&clearTimeout(this.timer),this.timer=0,h="TimeOrigin::setOriginTimetick:",m=Zn(),this.core.logger.log(h+" getServerTime start, times "+this.currentChance),T.prev=18,T.next=21,this.promiseManager.add(this.core.sendCmd(this.cmdName));case 21:_=T.sent,g=nd(_,"content.time"),this.isSettingNTP=!1,T.next=33;break;case 26:return T.prev=26,T.t0=T.catch(18),E=T.t0,this.isSettingNTP=!1,this.logger.warn(h+" Calculate Delay time, getServerTime error",E),E.code!==Bs.V2NIM_ERROR_CODE_CANCELLED&&(this.timer=mi(bind$1(b=this.setOriginTimetick).call(b,this),this.failedDelay)),T.abrupt("return");case 33:if(g){T.next=37;break}return this.core.logger.warn(h+" Calculate Delay time incorrect format"),this.config.enable=!1,T.abrupt("return");case 37:O=Zn()-m,this.doSet(g,O);case 39:case"end":return T.stop()}}),_callee,this,[[18,26]])})))},t.doSet=function doSet(t,a){var c,h="TimeOrigin::setOriginTimetick:";if(a>this.config.tolerantRTT)this.logger.warn(h+" Denied, cause of exceeding the maximum tolerance range of RTT: "+a),this.timer=mi(bind$1(c=this.setOriginTimetick).call(c,this),this.failedDelay);else if(a>this.config.bestRTT){var m;this.serverOrigin.rtt&&a>=this.serverOrigin.rtt?this.logger.log(h+" Denied, cause of current.RTT >= serverOrigin.RTT: "+a):(this.setServerOrigin(a,t),this.logger.log(h+" Accept within maximum tolerance range of RTT: "+a+", ntpTimestamp: "+this.serverOrigin.timestamp+", localClock: "+this.serverOrigin.baseClock+", localTime: "+this.serverOrigin.baseTime)),this.timer=mi(bind$1(m=this.setOriginTimetick).call(m,this),this.failedDelay)}else{var g;this.setServerOrigin(a,t),this.logger.log(h+" Accept within best RTT: "+a+", ntpTimestamp: "+this.serverOrigin.timestamp+", localClock: "+this.serverOrigin.baseClock+", localTime: "+this.serverOrigin.baseTime),this.currentChance=0,this.timer=mi(bind$1(g=this.setOriginTimetick).call(g,this),this.successDelay)}},t.getNTPTime=function getNTPTime(t){if(void 0===t&&(t=this.getTimeNode()),this.checkNodeReliable(t)){var a=Math.floor(t.time-this.serverOrigin.baseTime);return this.serverOrigin.timestamp+a}return Zn()},t.checkNodeReliable=function checkNodeReliable(t){if(this.serverOrigin.timestamp){if(0===this.serverOrigin.baseClock)return!0;var a=t.clock-this.serverOrigin.baseClock,c=t.time-this.serverOrigin.baseTime;return Math.abs(c-a)<500}return!1},t.checkPerformance=function checkPerformance(){return"BROWSER"===Qd.platform&&!("undefined"==typeof performance||!performance.now)},TimeOrigin.checkPerformance=function checkPerformance(){return"BROWSER"===Qd.platform&&!("undefined"==typeof performance||!performance.now)},t.getTimeNode=function getTimeNode(){return{clock:this.checkPerformance()?performance.now():0,time:Zn()}},TimeOrigin.getTimeNode=function getTimeNode(){return{clock:TimeOrigin.checkPerformance()?performance.now():0,time:Zn()}},t.setServerOrigin=function setServerOrigin(t,a){this.serverOrigin={timestamp:a+Math.floor(t/2),rtt:t,baseClock:this.checkPerformance()?performance.now():0,baseTime:Zn()}},TimeOrigin}();function _createForOfIteratorHelperLoose$2(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray$2(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$2(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$2(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$2(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var rf={},nf={};function parseEachCmd(t,a,c,h,m){var g,_={cmd:c,raw:t,error:null,service:null==a?void 0:a.service,content:{},__receiveTimeNode:tf.getTimeNode()};if(!c||!a)return _.notFound=!0,_;a.sid>=26&&a.sid<100&&(t.code=function toReadableCode(t){if("number"!=typeof t)throw new Gs({code:Bs.V2NIM_ERROR_CODE_INTERNAL,detail:{reason:"Read code failed",rawData:t}});if(t>=0&&t<1e3)return t;if(t>=2e4&&t<=20099)return t;var a=(65535&t)>>9;a-=a<=38?1:2;return 1e5+1e3*a+(511&t)}(t.code));var E,b=function genCmdError(t,a){var c=Hs[t],h=zs[t];return null===h?null:new Gs({code:t,desc:c||h||t,detail:{cmd:a,timetag:Zn()}})}(t.code,c);if(_.error=b,_.error){if(_.error.detail.cmd=c,!(null===(g=null==a?void 0:a.ignoreErrCodes)||void 0===g?void 0:includes(g).call(g,t.code)))return _;m.warn("parseCmd:: ignore error ",_.error),_.error.detail.ignore=!0}a.response&&forEach$1(E=a.response).call(E,(function(t,a){var c=h[a],m=t.type,g=t.name,E=t.reflectMapper;if(!_u(c))switch(m){case"Property":_.content[g]=E?deserialize(c,E):c;break;case"PropertyArray":_.content[g]=map$6(c).call(c,(function(t){return E?deserialize(t,E):t}));break;case"Int":case"Long":case"Byte":_.content[g]=+c;break;case"Bool":_.content[g]="true"===c||!0===c||1===c;break;default:_.content[g]=c}}));return _}function serialize(t,a,c){var h={};for(var m in t=function flattenObjByMapper(t,a){var c={};for(var h in a){for(var m,g=a[h],_="number"==typeof g?h:g.access?g.access:h,E=t,b=_createForOfIteratorHelperLoose$2(_.split("."));!(m=b()).done;){var O=m.value;if(void 0===E[O]||null===E[O]){E=void 0;break}E=E[O]}void 0!==E&&(c[_]=E)}return c}(t,a),a){var g=a[m],_="number"==typeof g?m:g.access?g.access:m;c&&!includes(c).call(c,m)||(_ in t?"number"==typeof g?h[g]=t[_]:"object"==typeof g&&(g.converter?h[g.id]=g.converter(t[_],t):h[g.id]=t[_]):"object"==typeof g&&g.def&&("function"==typeof g.def?h[g.id]=g.def(t):h[g.id]=g.def))}return h}function deserialize(t,a){var c={};for(var h in t){var m=a[h];if("string"==typeof m)c[m]=t[h];else if("object"==typeof m&&"prop"in m){var g=m.access?m.access:m.prop;m.converter?c[g]=m.converter(t[h],t):m.type&&"number"===m.type?c[g]=+t[h]:m.type&&"boolean"===m.type?c[g]=!("0"===t[h]||!t[h]):c[g]=t[h]}}for(var _ in a){var E=a[_];if(E&&void 0!==E.def){var b=E.access?E.access:E.prop;b in c||("function"==typeof E.def?c[b]=E.def(t):c[b]=E.def)}}return c=function unflattenObj(t){var a={},c=function _loop(c){var h=c.split(".");reduce(h).call(h,(function(a,m,g){return a[m]||(a[m]=isNaN(Number(h[g+1]))?h.length-1==g?t[c]:{}:[])}),a)};for(var h in t)c(h);return a}(c),c}function registerParser(t){for(var a in wt(rf,t.cmdConfig),t.cmdMap){var c=t.cmdMap[a],h=t.cmdConfig[c];if(h)if(bu(nf[a])){for(var m,g=!1,_=_createForOfIteratorHelperLoose$2(nf[a]);!(m=_()).done;){var E=m.value;if(E.cmd===c&&E.config.service===h.service){g=!0;break}}g||nf[a].push({config:h,cmd:c})}else nf[a]=[{config:h,cmd:c}]}}var af=entryVirtual("Array").values,sf=Array.prototype,cf={DOMTokenList:!0,NodeList:!0},values=function(t){var a=t.values;return t===sf||K(sf,t)&&a===sf.values||de(cf,Zt(t))?af:a},uf=bi.every,lf=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!lf},{every:function every(t){return uf(this,t,arguments.length>1?arguments[1]:void 0)}});var df=entryVirtual("Array").every,ff=Array.prototype,every=function(t){var a=t.every;return t===ff||K(ff,t)&&a===ff.every?df:a};var pf=function baseIsRegExp(t){return Wc(t)&&"[object RegExp]"==ac(t)},hf=iu&&iu.isRegExp,mf=hf?nu(hf):pf;var gf=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var vf=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var a=-1,c=null==t?0:t.length;for(this.__data__=new Kl;++a<c;)this.add(t[a])}SetCache.prototype.add=SetCache.prototype.push=gf,SetCache.prototype.has=vf;var yf=SetCache;var _f=function baseFindIndex(t,a,c,h){for(var m=t.length,g=c+(h?1:-1);h?g--:++g<m;)if(a(t[g],g,t))return g;return-1};var Ef=function baseIsNaN(t){return t!=t};var bf=function strictIndexOf(t,a,c){for(var h=c-1,m=t.length;++h<m;)if(t[h]===a)return h;return-1};var Of=function baseIndexOf(t,a,c){return a==a?bf(t,a,c):_f(t,Ef,c)};var Tf=function arrayIncludes(t,a){return!!(null==t?0:t.length)&&Of(t,a,0)>-1};var Sf=function arrayIncludesWith(t,a,c){for(var h=-1,m=null==t?0:t.length;++h<m;)if(c(a,t[h]))return!0;return!1};var Cf=function cacheHas(t,a){return t.has(a)};var If=function baseDifference(t,a,c,h){var m=-1,g=Tf,_=!0,E=t.length,b=[],O=a.length;if(!E)return b;c&&(a=Xl(a,nu(c))),h?(g=Sf,_=!1):a.length>=200&&(g=Cf,_=!1,a=new yf(a));e:for(;++m<E;){var T=t[m],S=null==c?T:c(T);if(T=h||0!==T?T:0,_&&S==S){for(var C=O;C--;)if(a[C]===S)continue e;b.push(T)}else g(a,S,h)||b.push(T)}return b},Rf=Fc((function(t,a){return Od(t)?If(t,a):[]})),Mf=Rf;function replacer(t,a){return a instanceof RegExp?"__REGEXP "+a.toString():a}function validate(t,a,c,h){var m;void 0===a&&(a={}),void 0===h&&(h=!1);var g={};return forEach$1(m=Fi(t)).call(m,(function(m){var _=t[m].type,E=c?"In "+c+", ":"";if(null==a){var b=E+"param is null or undefined";throw h?new qs({detail:{reason:b,data:{key:m},rules:"required"}}):new Ks(b,{key:m},"required")}if(void 0===a[m]){if(!1===t[m].required)return void(g[m]=a[m]);var O=E+"param '"+m+"' is required";throw h?new qs({detail:{reason:O,data:{key:m},rules:"required"}}):new Ks(O,{key:m},"required")}var T=kf[_];if(T&&!T(a,m,t[m],h)){var S=E+"param '"+m+"' unexpected",C={key:m,value:a[m]};throw h?new qs({detail:{reason:S,data:C,rules:Fs(t[m],replacer)}}):new Ks(S,C,Fs(t[m],replacer))}g[m]=a[m]})),g}var kf={string:function string(t,a,c){var h=c.allowEmpty,m=c.max,g=c.min,_=c.regExp,E=t[a];return"string"==typeof E&&((!1!==h||""!==E)&&(!("number"==typeof m&&E.length>m)&&(!("number"==typeof g&&E.length<g)&&!(mf(_)&&!_.test(E)))))},number:function number(t,a,c){var h=c.min,m=c.max,g=t[a];return"number"==typeof g&&(!("number"==typeof h&&g<h)&&!("number"==typeof m&&g>m))},boolean:function boolean(t,a){return"boolean"==typeof t[a]},file:function file(t,a){return!0},enum:function _enum(t,a,c){var h=values(c),m=t[a];return!h||indexOf(h).call(h,m)>-1},func:function func(t,a){return"function"==typeof t[a]},array:function array(t,a,c,h){var m;void 0===h&&(h=!1);var g=c.itemType,_=c.rules,E=c.min,b=c.max,O=values(c),T=t[a];return!!bu(T)&&(!("number"==typeof b&&T.length>b)&&(!("number"==typeof E&&T.length<E)&&(!(g&&"enum"!==g&&!every(T).call(T,(function(t){return typeof t===g})))&&(("enum"!==g||!O||!Mf.apply(void 0,concat(m=[T]).call(m,O)).length)&&(_&&forEach$1(T).call(T,(function(t,c){return validate(_,t,a+"["+c+"]",h)})),!0)))))},object:function object(t,a,c,h){void 0===h&&(h=!1);var m=c.rules,g=c.allowEmpty,_=t[a];if("object"!=typeof _||null===_)return!1;if(m){var E=Fi(m),b=Fi(_),O=filter(b).call(b,(function(t){return indexOf(E).call(E,t)>-1}));if(!1===g&&0===O.length)return!1;validate(m,_,a,h)}return!0}},wf=["error","warn","log","debug"],Nf=function emptyFunc(){},xf=["off","error","warn","log","debug"],Af=function(){function Logger(t){this.strategies={debug:{name:"debug",func:console.log},log:{name:" log",func:console.log},warn:{name:" warn",func:console.warn},error:{name:"error",func:console.error}},this.debug=Nf,this.log=Nf,this.warn=Nf,this.error=Nf,includes(xf).call(xf,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var a=this,c=findIndex(wf).call(wf,(function(a){return a===t}));forEach$1(wf).call(wf,(function(t,h){h<=c&&(a[t]=function(){var a=slice(Array.prototype).call(arguments),c=this.strategies[t],h=this.formatArgs(a,c.name);c.func(h)})}))},t.formatArgs=function formatArgs(t,a){var c=new Date;return"[NIM "+a+" "+(c.getMonth()+1+"-"+c.getDate()+" "+c.getHours()+":"+c.getMinutes()+":"+c.getSeconds()+":"+c.getMilliseconds())+"] "+map$6(t).call(t,(function(t){return t instanceof Gs?t.toString():t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Fs(t):t})).join(" ")},t.destroy=function destroy(){this.debug=Nf,this.log=Nf,this.warn=Nf,this.error=Nf},Logger}(),Pf=function(){function CoreAdapters(t){this.core=t}var t=CoreAdapters.prototype;return t.getFileUploadInformation=function getFileUploadInformation(t){return Qd.getFileUploadInformation(t)},t.request=function request(t,a,c){var h=this,m=(new Date).getTime(),g=(null==c?void 0:c.exception_service)||0;return Qd.request(t,a).catch((function(c){var _,E,b,O,T=c;throw h.core.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account||(null===(E=null===(_=h.core)||void 0===_?void 0:_.auth)||void 0===E?void 0:E.account),trace_id:null===(O=null===(b=h.core.clientSocket)||void 0===b?void 0:b.socket)||void 0===O?void 0:O.sessionId,start_time:m,action:1,exception_service:g}),h.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof T.code?T.code:0,description:T.message||""+T.code,operation_type:0,target:t,context:a?Fs(a):""},{asyncParams:Qd.net.getNetworkStatus()}),h.core.reporter.reportTraceEnd("exceptions",1),c}))},t.uploadFile=function uploadFile(t){var a=this,c=(new Date).getTime();return Qd.uploadFile(t).catch((function(h){var m,g,_,E,b=h;a.core.reporter.reportTraceStart("exceptions",{user_id:a.core.options.account||(null===(g=null===(m=a.core)||void 0===m?void 0:m.auth)||void 0===g?void 0:g.account),trace_id:null===(E=null===(_=a.core.clientSocket)||void 0===_?void 0:_.socket)||void 0===E?void 0:E.sessionId,start_time:c,action:1,exception_service:3});var O="BROWSER"===Qd.platform?t.chunkUploadHost:t.commonUploadHost?t.commonUploadHost+"/"+(t.nosToken&&t.nosToken.bucket):"https://nos.netease.com/nim";throw a.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof b.code?b.code:0,description:b.message||""+b.code,operation_type:1,target:O},{asyncParams:Qd.net.getNetworkStatus()}),a.core.reporter.reportTraceEnd("exceptions",1),h}))},CoreAdapters}(),Lf="https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",Df="imElite_sdk_abtest_web",Vf=function(){function ABTest(t,a){this.abtInfo={},this.core=t,this.config=assignOptions({isAbtestEnable:!0,abtestUrl:Lf,abtestProjectKey:Df},a)}var t=ABTest.prototype;return t.setOptions=function setOptions(t){this.config=assignOptions(this.config,t)},t.abtRequest=function abtRequest(){var t,a;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var c;return hl.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:if(this.config.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.config.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.core.adapters.request(this.config.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},data:{clientInfo:{projectKey:this.config.abtestProjectKey,appKey:this.core.options.appkey,osType:"Web",sdkVersion:"10.2.4",deviceId:this.core.config.deviceId},useLocalCache:!0}},{exception_service:7});case 9:c=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.core.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(a=null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.data)||void 0===a?void 0:a.abtInfo)||{};case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},ABTest}(),Ff=TypeError,jf=Object.getOwnPropertyDescriptor,Uf=M&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,a){if(ei(t)&&!jf(t,"length").writable)throw Ff("Cannot set read only .length");return t.length=a}:function(t,a){return t.length=a},Bf=TypeError,deletePropertyOrThrow=function(t,a){if(!delete t[a])throw Bf("Cannot delete property "+tryToString(a)+" of "+tryToString(t))},Hf=arrayMethodHasSpeciesSupport("splice"),Gf=Math.max,Kf=Math.min;_export({target:"Array",proto:!0,forced:!Hf},{splice:function splice(t,a){var c,h,m,g,_,E,b=toObject(this),O=lengthOfArrayLike(b),T=toAbsoluteIndex(t,O),S=arguments.length;for(0===S?c=h=0:1===S?(c=0,h=O-T):(c=S-2,h=Kf(Gf(toIntegerOrInfinity(a),0),O-T)),doesNotExceedSafeInteger(O+c-h),m=arraySpeciesCreate(b,h),g=0;g<h;g++)(_=T+g)in b&&createProperty(m,g,b[_]);if(m.length=h,c<h){for(g=T;g<O-h;g++)E=g+c,(_=g+h)in b?b[E]=b[_]:deletePropertyOrThrow(b,E);for(g=O;g>O-h+c;g--)deletePropertyOrThrow(b,g-1)}else if(c>h)for(g=O-h;g>T;g--)E=g+c-1,(_=g+h-1)in b?b[E]=b[_]:deletePropertyOrThrow(b,E);for(g=0;g<c;g++)b[g+T]=arguments[g+2];return Uf(b,O-h+c),m}});var qf=entryVirtual("Array").splice,Wf=Array.prototype,splice=function(t){var a=t.splice;return t===Wf||K(Wf,t)&&a===Wf.splice?qf:a};function _createForOfIteratorHelperLoose$1(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray$1(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray$1(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray$1(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray$1(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var zf=function(){function TimerManager(){this.timerList=[],this.id=1,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,a,c){void 0===a&&(a=0),void 0===c&&(c=1);var h=(new Date).getTime(),m=this.id;return this.timerList.push({id:m,loop:c,count:0,timeout:h+a,interval:a,callback:t}),this.id++,this.checkTimer(h),m},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var a,c,h=0,m=_createForOfIteratorHelperLoose$1(this.timerList);!(a=m()).done;){var g=a.value;(0===h||h>g.timeout)&&(h=g.timeout)}if(0!==this.timerList.length)if(null===this.timer||h<this.timeout||this.timeout<t)this.timer=mi(bind$1(c=this.nowTime).call(c,this),h-t),this.timeout=h}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),a=_createForOfIteratorHelperLoose$1(this.timerList);!(t=a()).done;){var c=t.value;nowTime>=c.timeout&&(c.callback(),c.count++,c.timeout=nowTime+c.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var a=this.timerList.length-1;a>=0;a--){var c;if(this.timerList[a].id===t)splice(c=this.timerList).call(c,a,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var a,c=this.timerList[t];if(c.loop>=0&&c.count>=c.loop)splice(a=this.timerList).call(a,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=1,this.timer=null},TimerManager}(),$f=function(){function Service(t,a){this.name=t,this.core=a,this.name=t,this.logger=a.logger,this.core=a}return Service.prototype.process=function process(t){var a=this[t.cmd+"Handler"];if("function"==typeof a)return a.call(this,t);var c=nd(t,"error.detail.ignore");return t.error&&!c?Xn.reject(t.error):Xn.resolve(t)},Service}(),Yf=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var a=Math.random(),c=Math.floor(a*this.jitter*t);t=0==(1&Math.floor(10*a))?t-c:t+c}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var Xf=Oc(Xs,"Set");var Qf=function noop(){};var Jf=function setToArray(t){var a=-1,c=Array(t.size);return t.forEach((function(t){c[++a]=t})),c},Zf=Xf&&1/Jf(new Xf([,-0]))[1]==1/0?function(t){return new Xf(t)}:Qf,ep=Zf;var tp=function baseUniq(t,a,c){var h=-1,m=Tf,g=t.length,_=!0,E=[],b=E;if(c)_=!1,m=Sf;else if(g>=200){var O=a?null:ep(t);if(O)return Jf(O);_=!1,m=Cf,b=new yf}else b=a?[]:E;e:for(;++h<g;){var T=t[h],S=a?a(T):T;if(T=c||0!==T?T:0,_&&S==S){for(var C=b.length;C--;)if(b[C]===S)continue e;a&&b.push(S),E.push(T)}else m(b,S,c)||(b!==E&&b.push(S),E.push(T))}return E};var rp,op=function uniq(t){return t&&t.length?tp(t):[]},np=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],ip=["transport not supported","client not handshaken","unauthorized"],ap=["reconnect"],sp=function(t){function BaseWebsocket(a,c){var h;return(h=t.call(this)||this).url=c,h.websocket=null,h.socketConnectTimer=0,h.core=a,h.url=c,h.status="disconnected",h.logger=a.logger,h.connect(),h}St(BaseWebsocket,t);var a=BaseWebsocket.prototype;return a.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Zn(),{method:"GET",dataType:"text",timeout:this.core.options.xhrConnectTimeout||8e3},{exception_service:6}).then((function(a){if("connecting"===t.status){var c=a.data.split(":"),h=c[0];return c[1],t.sessionId=h,t.logger.log("imsocket::XHR success. status "+t.status+", "+("connecting"===t.status?"continue websocket connection":"stop websocket connection")),t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+h)}})).catch((function(a){if("connecting"===t.status){var c='imsocket::XHR fail. raw message: "'+(a=a||{}).message+'", code: "'+a.code+'"',h=a.code;h="v2"===nd(t.core,"options.apiVersion")?a.code===Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT?Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT:Bs.V2NIM_ERROR_CODE_CONNECT_FAILED:408===a.code?408:415;var m=new Gs({code:h,detail:{reason:c,rawError:a}});t.logger.error(c),t.status="disconnected",t.emit("handshakeFailed",m)}}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},a.close=function close(){if(this.status="disconnected",this.websocket){this.logger.log("imsocket:: close websocket");try{this.websocket.send(this.encodePacket({type:"disconnect"}))}catch(t){this.logger.warn("imsocket::attempt to send encodePacket error",t)}try{this.websocket.close()}catch(t){this.logger.warn("imsocket::attempt to close websocket error",t)}this.clean(),this.emit("disconnect",{code:0,reason:"Active close websocket"})}},a.clean=function clean(){this.status="disconnected",this.websocket&&(this.socketUrl=void 0,this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null,this.websocket.onclose=null,this.websocket=null)},a.onConnect=function onConnect(){this.status="connected",this.emit("connect"),clearTimeout(this.socketConnectTimer)},a._createWebsocket=function _createWebsocket(t){var a,c=this;this.socketConnectTimer=mi((function(){c.logger.error("imsocket::Websocket connect timeout. url: ",c.socketUrl),c.emit("handshakeFailed",new Gs({code:"v2"===nd(c.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CONNECT_TIMEOUT:415,detail:{reason:"imsocket::Websocket connect timeout. url: "+c.socketUrl}}))}),this.core.options.socketConnectTimeout||8e3),this.socketUrl=t,this.websocket=new Qd.WebSocket(t),this.websocket.onmessage=bind$1(a=this.onMessage).call(a,this),this.websocket.onclose=function(t){var a=(null==t?void 0:t.reason)||(null==t?void 0:t.message)||(null==t?void 0:t.errMsg)||"websocket.onclose";c.logger.log("imsocket::Websocket onclose done. code is "+(null==t?void 0:t.code)+" and reason is "+a),c.clean(),c.emit("disconnect",{code:(null==t?void 0:t.code)||0,reason:a})},this.websocket.onerror=function(t){c.logger.error("imsocket::Websocket onerror",t),"logined"===c.core.status&&c.core.clientSocket.ping()}},a.onMessage=function onMessage(t){var a,c=this.decodePacket(t.data);if(c)switch(c.type){case"connect":this.onConnect();break;case"disconnect":this.close(),this.emit("disconnect",{code:0,reason:"MessageEvent type disconnect"});break;case"message":case"json":this.emit("message",c.data);break;case"event":c.name&&this.emit(c.name,c.args);break;case"error":"unauthorized"===c.reason?this.emit("connect_failed",c.reason):this.emit("error",c.reason),this.logger.error("imsocket::Websocket connect failed, onmessage type error. url: ",this.socketUrl),clearTimeout(this.socketConnectTimer),this.emit("handshakeFailed",new Gs({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CONNECT_FAILED:408,detail:{reason:"imsocket::Websocket connect failed, onMessage socket error. url: "+this.socketUrl}}));break;case"heartbeat":null===(a=this.websocket)||void 0===a||a.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::Websocket no handler type",c.type)}},a.encodePacket=function encodePacket(t){var a,c,h=t.type,m=t.id,g=void 0===m?"":m,_=t.endpoint,E=void 0===_?"":_,b=t.ack,O=null;if(!h)return"";switch(h){case"error":a=t.reason?indexOf(ip).call(ip,t.reason):"",c=t.advice?indexOf(ap).call(ap,t.advice):"",""===a&&""===c||(O=a+(""!==c?"+"+c:""));break;case"message":""!==t.data&&(O=t.data);break;case"event":a={name:t.name},a=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},O=Fs(a);break;case"json":O=Fs(t.data);break;case"connect":t.qs&&(O=t.qs);break;case"ack":O=t.ackId+(t.args&&t.args.length?"+"+Fs(t.args):"")}var T=[indexOf(np).call(np,h),g+("data"===b?"+":""),E];return null!=O&&T.push(O),T.join(":")},a.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var a=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(a){var c,h=a[1],m=a[2],g=a[3],_=a[4],E=a[5],b={type:np[+h],endpoint:_};switch(m&&(b.id=m,b.ack=!g||"data"),b.type){case"error":c=E.split("+"),b.reason=ip[+c[0]]||"";break;case"message":b.data=E||"";break;case"connect":b.qs=E||"";break;case"event":try{var O=JSON.parse(E);b.name=O.name,b.args=O.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}b.args=b.args||[];break;case"json":try{b.data=JSON.parse(E)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((c=E.match(/^([0-9]+)(\+)?(.*)/))&&(b.ackId=c[1],b.args=[],c[3]))try{b.args=c[3]?JSON.parse(c[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return b}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},a.send=function send(t){var a,c={data:t,type:"message",endpoint:""};null===(a=this.websocket)||void 0===a||a.send(this.encodePacket(c))},BaseWebsocket}(gi);function _createForOfIteratorHelperLoose(t,a){var c,h=void 0!==nl&&il(t)||t["@@iterator"];if(h)return bind$1(c=(h=h.call(t)).next).call(c,h);if(bu(t)||(h=function _unsupportedIterableToArray(t,a){var c;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);"Object"===h&&t.constructor&&(h=t.constructor.name);if("Map"===h||"Set"===h)return Su(t);if("Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h))return _arrayLikeToArray(t,a)}(t))||a&&t&&"number"==typeof t.length){h&&(t=h);var m=0;return function(){return m>=t.length?{done:!0}:{done:!1,value:t[m++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(rp||(rp={}));var cp=function(){function V1ClientSocket(t,a){this.linkUrls=[],this.isAutoReconnect=!1,this.packetTimeout=3e4,this.packetSer=1,this.retryCount=0,this.reconnectTimer=0,this.backoff=new Yf({max:8e3,min:1600,jitter:.01}),this.sendingCmdMap=new is,this.pingTimer=0,this.hasNetworkListener=!1,this.core=t,a&&(this.auth=a),this.logger=t.logger,this.reporter=t.reporter,this.timerManager=t.timerManager}var t=V1ClientSocket.prototype;return t.setSessionId=function setSessionId(t){},t.connect=function connect(t,a){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var c,h,m,g,_,E;return hl.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.core.status)){b.next=5;break}return c="Core socket status is "+this.core.status+", and would not connect",this.logger.warn(c),b.abrupt("return",Xn.reject(c));case 5:this.core.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(h=t.linkUrls).call(h,this.linkUrls),this.linkUrls=op(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),m=0;case 9:if(!(m<this.linkUrls.length)){b.next=31;break}return g=this.linkUrls[m],_=(new Date).getTime(),b.prev=12,b.next=15,this.doConnect(g);case 15:return this.core.status="connected",this.logger.log("clientsocketV1::connect success with url: "+g),b.abrupt("return",g);case 20:b.prev=20,b.t0=b.catch(12),E=b.t0,a&&a(E,g),this.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account,start_time:_,action:0,exception_service:6}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof E.code?E.code:0,description:E.message||""+E.code,operation_type:0,target:g},{asyncParams:Qd.net.getNetworkStatus()}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("clientsocketV1::connect failed with url: "+g,b.t0);case 28:m++,b.next=9;break;case 31:throw 0===this.retryCount?this.doDisconnect(rp.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(rp.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("clientSocketV1::socket xhr or socket connect failed");case 33:case"end":return b.stop()}}),_callee,this,[[12,20]])})))},t.doConnect=function doConnect(t){var a=this,c=!1;return new Xn((function(h,m){var g;a.socket=new sp(a.core,t),a.socket.on("connect",(function(){a.logger.log("clientSocketV1::on connect",t),a.core.reporterHookLinkKeep&&(a.core.reporterHookLinkKeep.start(),a.core.reporterHookLinkKeep.update({code:0,description:"",operation_type:0,target:t})),c=!0,h()})),a.socket.on("message",bind$1(g=a.onMessage).call(g,a)),a.socket.on("disconnect",(function(h){return __awaiter(a,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(this.logger.log("clientSocketV1::socket on disconnect",h),!this.core.reporterHookLinkKeep){a.next=5;break}return a.next=4,this.core.reporterHookLinkKeep.update({code:(null==h?void 0:h.code)||0,description:(null==h?void 0:h.reason)||"",operation_type:1,target:t});case 4:this.core.reporterHookLinkKeep.end(!1);case 5:c=!0,this.doDisconnect(rp.OFFLINE,"SocketOnDisconnect");case 7:case"end":return a.stop()}}),_callee2,this)})))})),a.socket.on("handshakeFailed",(function(t){c?a.ping():(a.logger.error('clientsocketV1::handshake failed: "'+(t&&t.message)+'"'),a.cleanSocket()),c=!0,m(t)}))}))},t.cleanSocket=function cleanSocket(){this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0)},t.beforeConnect=function beforeConnect(){this.reconnectTimer&&clearTimeout(this.reconnectTimer)},t.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},t.doDisconnect=function doDisconnect(t,a){var c,h;if(this.logger.log("doDisconnect: type "+t+", description "+a),"unconnected"!==this.core.status){var m={1:"close",2:"kicked",3:"broken"}[t]||"";this.markAllCmdInvaild(new Gs({code:415,desc:"Packet timeout due to instance disconnect",detail:{reason:"Packet timeout due to instance disconnect",disconnect_reason:m}})),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.cleanSocket();var g=!this.core.options.needReconnect||this.retryCount>=this.core.options.reconnectionAttempts;if(t===rp.ACTIVE||g)this.logger.log("doDisconnect: emit disconnect, type "+t,g),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),null===(c=this.auth)||void 0===c||c.emit("disconnect"),this.destroyOnlineListener();else if(t===rp.KICKED){this.logger.log("doDisconnect: kicked"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var _="string"==typeof a?{reason:"unknow",message:a}:a;this.core.eventBus.emit("kicked",_),this.core.emit("kicked",_),null===(h=this.auth)||void 0===h||h.emit("kicked",_),this.destroyOnlineListener()}else t===rp.OFFLINE&&this.core.V1NIMLoginService.isManualLoginAttempt?(this.logger.log("doDisconnect: offline in manual login phase. no reconnect"),this.core.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.destroyOnlineListener()):t===rp.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},t.attempToReconnect=function attempToReconnect(){var t,a,c=this;if("waitReconnect"!==this.core.status){0===this.retryCount&&(this.core.eventBus.emit("disconnect"),this.core.emit("disconnect"),null===(t=this.auth)||void 0===t||t.emit("disconnect"));var h=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+h),this.core.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:h}),this.core.emit("willReconnect",{retryCount:this.retryCount,duration:h}),null===(a=this.auth)||void 0===a||a.emit("willReconnect",{retryCount:this.retryCount,duration:h}),this.core.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=mi((function(){return __awaiter(c,void 0,void 0,hl.mark((function _callee3(){var t=this;return hl.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if("waitReconnect"===this.core.status){a.next=3;break}return this.logger.warn("doDisconnect: reconnectTimer status is "+this.core.status+", would not go on reconnecting"),a.abrupt("return");case 3:return a.next=5,Qd.net.getNetworkStatus();case 5:!1===a.sent.net_connect?(this.logger.log("doDisconnect: skip this reconnection attempt because network is offline"),this.core.status="connecting",this.retryCount>=this.core.options.reconnectionAttempts?this.doDisconnect(rp.OFFLINE,"MaxReconnectionAttemptExceed"):this.attempToReconnect()):this.core.V1NIMLoginService.login({isAutoReconnect:!0}).catch((function(){t.logger.error("clientsocketV1::attempToReconnect failed "+t.retryCount)}));case 7:case"end":return a.stop()}}),_callee3,this)})))}),h)}else this.logger.warn("doDisconnect: already is waiting reconnect")},t.sendCmd=function sendCmd(t,a,c){var h=this;if("logined"!==this.core.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("instance status is "+this.core.status+", so can not sendCmd "+t),Xn.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return Xn.reject("No_socket");var m="heartbeat"!==t,g=m?this.packetSer++:0,_=function createCmd(t,a,c,h){var m=rf[t];if(!m)return c.error("createCmd:: can not find cmd config: ",t),null;var g,_={SER:a,SID:m.sid,CID:m.cid,Q:[]};return m.params&&h&&forEach$1(g=m.params).call(g,(function(t){var a=h[t.name];if(null!=a){var c=t.type,m=t.reflectMapper,g=t.select;switch(t.type){case"PropertyArray":c="ArrayMable",a=map$6(a).call(a,(function(t){return{t:"Property",v:m?serialize(t,m,g):t}}));break;case"Property":a=m?serialize(a,m,g):a;break;case"Bool":a=a?"true":"false"}_.Q.push({t:c,v:a})}})),{packet:_,hasPacketResponse:"boolean"!=typeof m.hasPacketResponse||m.hasPacketResponse,hasPacketTimer:"boolean"!=typeof m.hasPacketTimer||m.hasPacketTimer}}(t,g,this.logger,a);if(!_){var E="SendCmd "+g+" "+t+" error";return this.logger.error(E),Xn.reject(new Error(E))}var b=_.packet,O=_.hasPacketResponse,T=_.hasPacketTimer,S=Fs(b);m&&("debug"===this.core.options.debugLevel?this.logger.debug("clientsocketV1::sendCmd",t,"ser:"+g,S):this.logger.log("clientsocketV1::sendCmd",t,"ser:"+g));var C=(new Date).getTime();return new Xn((function(m,_){O&&h.sendingCmdMap.set(g,{cmd:t,params:a,callback:[m,_],timer:T?mi((function(){var a=new Gs({code:408,desc:"Packet Timeout",detail:{reason:"Packet Timeout",cmd:t,ser:g,timetag:Zn()}});h.markCmdInvalid(g,a,t)}),c&&c.timeout?c.timeout:h.core.config.timeout):null});try{h.socket.send(S),O||m(b)}catch(a){var E=new Gs({code:415,detail:{reason:a&&a.message||"Unable to send packet",cmd:t,ser:g,timetag:Zn(),rawError:a}});h.markCmdInvalid(g,E,t),_(a)}})).catch((function(t){var a,c=[408,415];if(!includes(c).call(c,t.code))return Xn.reject(t);h.reporter.reportTraceStart("exceptions",{user_id:h.core.options.account,trace_id:null===(a=h.socket)||void 0===a?void 0:a.sessionId,start_time:C,action:2,exception_service:6});var m=nd(t,"data.disconnect_reason")||"",g=408===t.code?"Send failed due to timeout":"Send failed. Reason unknown";return g=415===t.code?Fs({disconnect_reason:m}):g,h.reporter.reportTraceUpdateV2("exceptions",{code:t.code||415,description:g,operation_type:1,target:b.SID+"-"+b.CID,context:""+b.SER},{asyncParams:Qd.net.getNetworkStatus()}),h.reporter.reportTraceEnd("exceptions",1),Xn.reject(t)}))},t.onMessage=function onMessage(t){var a=function parseCmd(t,a){var c,h;try{h=JSON.parse(t)}catch(c){return void a.error('Parse command error:"'+t+'"')}var m=h.sid+"_"+h.cid,g=h.r;if(includes(c=["4_1","4_2","4_10","4_11"]).call(c,m)){var _=h.r[1].headerPacket;m=_.sid+"_"+_.cid,h.sid=_.sid,h.cid=_.cid,g=h.r[1].body}var E=nf[m],b=[];if(E){for(var O,T=_createForOfIteratorHelperLoose$2(E);!(O=T()).done;){var S=O.value;b.push(parseEachCmd(h,S.config,S.cmd,g,a))}return b}a.error("parseCmd:: mapper not exist",m,h.code)}(t,this.logger);if(a)for(var c,h=_createForOfIteratorHelperLoose(a);!(c=h()).done;){var m=c.value,g=m.raw.ser;if(m.error&&this.logger.error("core:onMessage packet error",m.raw.sid+"_"+m.raw.cid+", ser:"+g+",",m.error),m.notFound)return void this.logger.warn("clientsocketV1::onMessage packet not found",m.raw.sid+"_"+m.raw.cid+", ser:"+g);"heartbeat"!==m.cmd&&("debug"===this.core.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+g,m.cmd,m.content):this.logger.log("imsocket::recvCmd ser:"+g,m.cmd)),this.packetHandler(m)}},t.packetHandler=function packetHandler(t){var a,c;if(t){var h=t.raw.ser,m=this.sendingCmdMap.get(h);if(m&&m.cmd===t.cmd){var g=m.callback,_=m.timer,E=m.params;if(clearTimeout(_),t.params=E,this.sendingCmdMap.delete(h),"heartbeat"===t.cmd)return void g[0]();var b=null===(a=this.core[t.service])||void 0===a?void 0:a.process(t);b&&"function"==typeof b.then?b.then((function(t){g[0](t)})).catch((function(t){g[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",t.service,t.cmd),g[0]())}else null===(c=this.core[t.service])||void 0===c||c.process(t)}},t.markCmdInvalid=function markCmdInvalid(t,a,c){var h=this.sendingCmdMap.get(t);if(h){var m=h.callback,g=h.timer;g&&clearTimeout(g),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+c+" is invalid:",a),m[1](a)}},t.markAllCmdInvaild=function markAllCmdInvaild(t){var a,c=this;this.logger.log("markAllCmdInvaild",t),forEach$1(a=this.sendingCmdMap).call(a,(function(a){var h=a.callback,m=a.timer,g=a.cmd;c.logger.debug('markAllCmdInvaild:: cmd "'+g+'"'),m&&clearTimeout(m),h[1](t)})),this.sendingCmdMap.clear()},t.ping=function ping(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a=this;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:return clearTimeout(this.pingTimer),c.prev=1,c.next=4,this.sendCmd("heartbeat");case 4:c.next=18;break;case 6:return c.prev=6,c.t0=c.catch(1),c.next=10,this.testHeartBeat5Timeout();case 10:if(!c.sent){c.next=18;break}if(!this.core.reporterHookLinkKeep){c.next=16;break}return c.next=15,this.core.reporterHookLinkKeep.update({code:0,description:"Heartbeat-discovered link failure",operation_type:1,target:null===(t=this.socket)||void 0===t?void 0:t.url});case 15:this.core.reporterHookLinkKeep.end(!0);case 16:return this.doDisconnect(rp.OFFLINE,"PingError"),c.abrupt("return");case 18:this.pingTimer=mi((function(){a.ping()}),3e4);case 19:case"end":return c.stop()}}),_callee4,this,[[1,6]])})))},t.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var t;return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){a.next=15;break}return a.prev=3,a.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return a.abrupt("return",!1);case 9:a.prev=9,a.t0=a.catch(3),this.logger.debug("clientsocketV1:: test heartbeat "+t+" Timeout");case 12:t++,a.next=2;break;case 15:return a.abrupt("return",!0);case 16:case"end":return a.stop()}}),_callee5,this,[[3,9]])})))},t.initOnlineListener=function initOnlineListener(){var t=this;this.hasNetworkListener||(this.logger.log("clientsocketV1::onlineListener:init"),this.hasNetworkListener=!0,Qd.net.onNetworkStatusChange((function(a){t.logger.log("clientsocketV1::onlineListener:network change",a),a.isConnected&&"logined"===t.core.status?t.ping():a.isConnected&&"waitReconnect"===t.core.status?(t.reconnectTimer&&clearTimeout(t.reconnectTimer),t.core.V1NIMLoginService.login({isAutoReconnect:!0}).catch((function(){t.logger.error("clientsocketV1::attempToReconnect failed "+t.retryCount)}))):a.isConnected||t.doDisconnect(rp.OFFLINE,"OfflineListener")})))},t.destroyOnlineListener=function destroyOnlineListener(){this.logger.log("clientsocketV1::onlineListener:destroy"),Qd.net.offNetworkStatusChange(),this.hasNetworkListener=!1},t.disconnect=function disconnect(){switch(this.core.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(rp.ACTIVE,"UserActiveDisconnect"),Xn.resolve();default:return Xn.resolve()}},V1ClientSocket}();var up=function baseForOwn(t,a){return t&&fd(t,a,gu)};var lp=function baseInverter(t,a,c,h){return up(t,(function(t,m,g){a(h,c(t),m,g)})),h};var dp,fp,pp=function createInverter(t,a){return function(c,h){return lp(c,t,a(h),{})}},hp=Object.prototype.toString,mp=pp((function(t,a,c){null!=a&&"function"!=typeof a.toString&&(a=hp.call(a)),t[a]=c}),Ac(kc));function formatChatroom(t){var a=wt({},t),c=["announcement","broadcastUrl","ext"],h=["createTime","updateTime","onlineMemberNum"],m=["mute"];return forEach$1(c).call(c,(function(t){void 0===a[t]&&(a[t]="")})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=pa(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===pa(a[t]))})),a}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac",t[t.HarmonyOS=65]="HarmonyOS"}(dp||(dp={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(fp||(fp={}));var gp=mp({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var a,c=wt({},t),h=["chatroomId"],m=["level","enterTime","updateTime","tempMuteDuration"],g=["online","guest","blacked","muted","valid","tempMuted"],_={tempMuted:!1,tempMuteDuration:0};return forEach$1(a=Fi(_)).call(a,(function(t){c[t]=c[t]||_[t]})),forEach$1(h).call(h,(function(t){void 0!==c[t]&&(c[t]=c[t].toString())})),forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),forEach$1(g).call(g,(function(t){void 0!==c[t]&&(c[t]=1===pa(c[t]))})),void 0!==c.type&&(c.type=gp[c.type]),c.avatar,c.online||delete c.enterTime,c.guest&&(c.type="guest",delete c.valid,delete c.guest),"common"!==c.type&&delete c.level,c}function formatChatroomMembers(t){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,a,c){t.onSendBefore;var h=__rest(t,["onSendBefore"]),m=["subType"],g=["body","antiSpamContent","antiSpamBusinessId","ext"],_=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(h.idClient=Eu()),h.type=fp[t.type],h.from=a,h.fromClientType=16,h.fromDeviceId=c,h.status=h.status||"sending",forEach$1(_).call(_,(function(a){void 0!==t[a]&&(h[a]=t[a]?1:0)})),forEach$1(m).call(m,(function(a){void 0!==t[a]&&(h[a]=pa(t[a]))})),forEach$1(g).call(g,(function(a){void 0!==t[a]&&(h[a]="string"==typeof t[a]?t[a]:Fs(t[a]))})),h}var vp={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,a){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var c=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),h=["time","userUpdateTime"],m=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(h).call(h,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=1===pa(c[t]))})),c.type=getEnumKeyByEnumValue(fp,c.type),c.fromClientType=getEnumKeyByEnumValue(dp,c.fromClientType),c.flow=c.from===a?"out":"in",c.status=c.status||"success","string"==typeof c.body)try{c.body=JSON.parse(c.body)}catch(t){}return"notification"===c.type&&(c.attach=c.body?function formatNotificationBody(t){var a,c={};if(c.type=vp[t.id]||t.id,!t.data)return t;c=wt(c,t.data);var h={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(a=Fi(h)).call(a,(function(t){void 0!==c[t]&&(c[h[t]]=c[t],delete c[t])}));var m=["muteDuration"];if(forEach$1(m).call(m,(function(t){void 0!==c[t]&&(c[t]=pa(c[t]))})),!c.queueChange)return c;var g={};try{g=JSON.parse(c.queueChange)}catch(t){return c}switch(g._e){case"OFFER":g={type:"OFFER",elementKey:g.key,elementValue:g.content};break;case"POLL":g={type:"POLL",elementKey:g.key,elementValue:g.content};break;case"DROP":g={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":g={type:g._e,elementKv:g.kvObject}}return c.queueChange=g,c}(c.body):{},c.body=""),c}function formatChatroomMsgs(t,a){return t&&t.length>0?map$6(t).call(t,(function(t){return formatChatroomMsg(t,a)})):[]}var yp={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var _p=function(){function V1AuthAuthenticatorService(t){this.core=t}return V1AuthAuthenticatorService.prototype.verifyAuthentication=function verifyAuthentication(t){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h,m,g,_,E,b;return hl.wrap((function _callee$(O){for(;;)switch(O.prev=O.next){case 0:return c=this.core.options,h=Qd.getSystemInfo(),m=wt(wt({},c),{appLogin:t?0:1,deviceId:this.core.config.deviceId,clientSession:this.core.config.clientSession,clientType:16,protocolVersion:1,sdkVersion:100204,sdkHumanVersion:"10.2.4",os:h.os,browser:h.browser,userAgent:this.core.options.loginSDKTypeParamCompat?"Native/10.2.4":slice(a=h.userAgent).call(a,0,299),libEnv:this.core.options.loginSDKTypeParamCompat?void 0:h.libEnv,hostEnv:this.core.options.loginSDKTypeParamCompat?0:h.hostEnvEnum}),g=wt(wt({},c),{appkey:c.appkey,account:c.account,deviceId:this.core.config.deviceId,clientSession:this.core.config.clientSession,appLogin:1}),c.isAnonymous&&(g.isAnonymous=1,g.account=g.account||"nimanon_"+Eu(),m.account=g.account,g.chatroomNick=g.account||"nimanon_"+Eu(),g.chatroomAvatar=g.chatroomAvatar||" "),c.tags&&c.tags.length>0&&(g.tags=Fs(c.tags)),O.next=8,this.core.clientSocket.sendCmd("chatroomLogin",{type:1,chatroomLogin:g,chatroomIMLogin:m});case 8:return _=O.sent,this.core.status="logined",E=formatChatroom(_.content.chatroom),b=formatChatroomMember(_.content.chatroomMember),O.abrupt("return",{chatroom:E,member:b});case 13:case"end":return O.stop()}}),_callee,this)})))},V1AuthAuthenticatorService}(),Ep=function(t){function ChatroomAuthService(a){var c;return(c=t.call(this,"chatroomAuth",a)||this).account="",c.token="",c.deviceId="",c.isManualLoginAttempt=!1,c.authenticatorService=new _p(a),c}St(ChatroomAuthService,t);var a=ChatroomAuthService.prototype;return a.login=function login(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c;return hl.wrap((function _callee$(h){for(;;)switch(h.prev=h.next){case 0:return t.isAutoReconnect||(this.isManualLoginAttempt=!0),a=Zn(),h.next=4,this._connect(t);case 4:return c=h.sent,this.core.abtest.abtRequest(),h.prev=6,h.next=9,this.doLogin(t.isAutoReconnect,c,a);case 9:this.isManualLoginAttempt=!1,h.next=16;break;case 12:throw h.prev=12,h.t0=h.catch(6),this.isManualLoginAttempt=!1,h.t0;case 16:case"end":return h.stop()}}),_callee,this,[[6,12]])})))},a._connect=function _connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h;return hl.wrap((function _callee2$(m){for(;;)switch(m.prev=m.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.core.status)){m.next=4;break}return a="Chatroom status is "+this.core.status+", and would not connect",this.logger.warn(a),m.abrupt("return",Xn.reject(a));case 4:return this.core.clientSocket.beforeConnect(),c=t.isAutoReconnect||!1,m.next=8,this.core.clientSocket.connect({linkUrls:this.core.options.chatroomAddresses,isAutoReconnect:c});case 8:return h=m.sent,m.abrupt("return",h);case 10:case"end":return m.stop()}}),_callee2,this)})))},a.doLogin=function doLogin(t,a,c){return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,hl.mark((function _callee3(){var h,m,g,_,E,b,O;return hl.wrap((function _callee3$(T){for(;;)switch(T.prev=T.next){case 0:return T.prev=0,T.next=3,this.authenticatorService.verifyAuthentication(t);case 3:return h=T.sent,T.next=6,Qd.net.getNetworkStatus();case 6:m=T.sent,g=m.net_connect,this.core.status="logined",this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zn()-c,result:200,failReason:"",time:Zn(),net_connect:g}),T.next=26;break;case 12:return T.prev=12,T.t0=T.catch(0),this.logger.error("chatroom login error",T.t0),_=nd(T.t0,"error.code")||nd(T.t0,"code")||408,E=nd(T.t0,"error.message")||nd(T.t0,"message")||"login failed",T.next=19,Qd.net.getNetworkStatus();case 19:if(b=T.sent,O=b.net_connect,this.core.reporter.report("chatroomLogin",{accid:this.core.account,roomId:this.core.options.chatroomId,serverIps:this.core.options.chatroomAddresses,currentServerIp:a,rt:Zn()-c,result:_,failReason:E,time:Zn(),net_connect:O}),this.core.clientSocket.doDisconnect(rp.OFFLINE,this.isManualLoginAttempt?"FailedToInitializeLogin":"ReconnectLoginFailed"),!this.isManualLoginAttempt){T.next=25;break}throw T.t0;case 25:return T.abrupt("return");case 26:return T.prev=26,T.next=29,this.core.cloudStorage.init();case 29:T.next=34;break;case 31:T.prev=31,T.t1=T.catch(26),this.logger.error("NIM:login cloudStorage init failed ",T.t1);case 34:this.core.eventBus.emit("logined",h),this.core.emit("logined",h),this.core.clientSocket.resetConnectStatus(),this.core.clientSocket.ping(),this.core.timeOrigin.setOriginTimetick();case 39:case"end":return T.stop()}}),_callee3,this,[[0,12],[26,31]])})))},a.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var a=t.content,c=a.reason,h=a.ext,m=function formatKickedReason(t){var a=yp[t];return{reason:a?a.code:"unknow",message:a?a.message:"Unknown reason"}}(c);this.logger.warn("beKickedFromChatroomHandler:: ",m.reason,m.message,h),this.core.clientSocket.doDisconnect(rp.KICKED,m)},ChatroomAuthService}($f),bp=function(t){function ChatroomService(a){return t.call(this,"chatroom",a)||this}St(ChatroomService,t);var a=ChatroomService.prototype;return a.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a;return hl.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.core.sendCmd("getChatroom");case 2:return a=c.sent,c.abrupt("return",formatChatroom(null===(t=a.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return c.stop()}}),_callee,this)})))},a.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("updateChatroom",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.updateChatroomTagHandler=function updateChatroomTagHandler(t){var a,c=t.content;this.logger.log("updateChatroomTagHandler:: ",c);var h=null===(a=null==c?void 0:c.updateTags)||void 0===a?void 0:a.currentTags;try{h=JSON.parse(h)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",h)},ChatroomService}($f),Op=getDefaultExportFromCjs(createCommonjsModule((function(t){function _defineProperties(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}t.exports=function _createClass(t,a,c){return a&&_defineProperties(t.prototype,a),c&&_defineProperties(t,c),_i(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports})));var Tp=function arraySome(t,a){for(var c=-1,h=null==t?0:t.length;++c<h;)if(a(t[c],c,t))return!0;return!1};var Sp=function equalArrays(t,a,c,h,m,g){var _=1&c,E=t.length,b=a.length;if(E!=b&&!(_&&b>E))return!1;var O=g.get(t),T=g.get(a);if(O&&T)return O==a&&T==t;var S=-1,C=!0,I=2&c?new yf:void 0;for(g.set(t,a),g.set(a,t);++S<E;){var R=t[S],M=a[S];if(h)var k=_?h(M,R,S,a,t,g):h(R,M,S,t,a,g);if(void 0!==k){if(k)continue;C=!1;break}if(I){if(!Tp(a,(function(t,a){if(!Cf(I,a)&&(R===t||m(R,t,c,h,g)))return I.push(a)}))){C=!1;break}}else if(R!==M&&!m(R,M,c,h,g)){C=!1;break}}return g.delete(t),g.delete(a),C};var Cp=function mapToArray(t){var a=-1,c=Array(t.size);return t.forEach((function(t,h){c[++a]=[h,t]})),c},Ip=Qs?Qs.prototype:void 0,Rp=Ip?Ip.valueOf:void 0;var Mp=function equalByTag(t,a,c,h,m,g,_){switch(c){case"[object DataView]":if(t.byteLength!=a.byteLength||t.byteOffset!=a.byteOffset)return!1;t=t.buffer,a=a.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=a.byteLength||!g(new hd(t),new hd(a)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Cc(+t,+a);case"[object Error]":return t.name==a.name&&t.message==a.message;case"[object RegExp]":case"[object String]":return t==a+"";case"[object Map]":var E=Cp;case"[object Set]":var b=1&h;if(E||(E=Jf),t.size!=a.size&&!b)return!1;var O=_.get(t);if(O)return O==a;h|=2,_.set(t,a);var T=Sp(E(t),E(a),h,m,g,_);return _.delete(t),T;case"[object Symbol]":if(Rp)return Rp.call(t)==Rp.call(a)}return!1};var kp=function arrayPush(t,a){for(var c=-1,h=a.length,m=t.length;++c<h;)t[m+c]=a[c];return t};var wp=function baseGetAllKeys(t,a,c){var h=a(t);return Zc(t)?h:kp(h,c(t))};var Np=function arrayFilter(t,a){for(var c=-1,h=null==t?0:t.length,m=0,g=[];++c<h;){var _=t[c];a(_,c,t)&&(g[m++]=_)}return g};var xp=function stubArray(){return[]},Ap=Object.prototype.propertyIsEnumerable,Pp=Object.getOwnPropertySymbols,Lp=Pp?function(t){return null==t?[]:(t=Object(t),Np(Pp(t),(function(a){return Ap.call(t,a)})))}:xp,Dp=Lp;var Vp=function getAllKeys(t){return wp(t,gu,Dp)},Fp=Object.prototype.hasOwnProperty;var jp=function equalObjects(t,a,c,h,m,g){var _=1&c,E=Vp(t),b=E.length;if(b!=Vp(a).length&&!_)return!1;for(var O=b;O--;){var T=E[O];if(!(_?T in a:Fp.call(a,T)))return!1}var S=g.get(t),C=g.get(a);if(S&&C)return S==a&&C==t;var I=!0;g.set(t,a),g.set(a,t);for(var R=_;++O<b;){var M=t[T=E[O]],k=a[T];if(h)var w=_?h(k,M,T,a,t,g):h(M,k,T,t,a,g);if(!(void 0===w?M===k||m(M,k,c,h,g):w)){I=!1;break}R||(R="constructor"==T)}if(I&&!R){var N=t.constructor,x=a.constructor;N==x||!("constructor"in t)||!("constructor"in a)||"function"==typeof N&&N instanceof N&&"function"==typeof x&&x instanceof x||(I=!1)}return g.delete(t),g.delete(a),I},Up=Oc(Xs,"DataView"),Bp=Oc(Xs,"Promise"),Hp=Oc(Xs,"WeakMap"),Gp="[object Map]",Kp="[object Promise]",qp="[object Set]",Wp="[object WeakMap]",zp="[object DataView]",$p=pc(Up),Yp=pc(Dl),Xp=pc(Bp),Qp=pc(Xf),Jp=pc(Hp),Zp=ac;(Up&&Zp(new Up(new ArrayBuffer(1)))!=zp||Dl&&Zp(new Dl)!=Gp||Bp&&Zp(Bp.resolve())!=Kp||Xf&&Zp(new Xf)!=qp||Hp&&Zp(new Hp)!=Wp)&&(Zp=function(t){var a=ac(t),c="[object Object]"==a?t.constructor:void 0,h=c?pc(c):"";if(h)switch(h){case $p:return zp;case Yp:return Gp;case Xp:return Kp;case Qp:return qp;case Jp:return Wp}return a});var eh=Zp,th="[object Arguments]",rh="[object Array]",oh="[object Object]",nh=Object.prototype.hasOwnProperty;var ih=function baseIsEqualDeep(t,a,c,h,m,g){var _=Zc(t),E=Zc(a),b=_?rh:eh(t),O=E?rh:eh(a),T=(b=b==th?oh:b)==oh,S=(O=O==th?oh:O)==oh,C=b==O;if(C&&tu(t)){if(!tu(a))return!1;_=!0,T=!1}if(C&&!T)return g||(g=new ld),_||su(t)?Sp(t,a,c,h,m,g):Mp(t,a,b,c,h,m,g);if(!(1&c)){var I=T&&nh.call(t,"__wrapped__"),R=S&&nh.call(a,"__wrapped__");if(I||R){var M=I?t.value():t,k=R?a.value():a;return g||(g=new ld),m(M,k,c,h,g)}}return!!C&&(g||(g=new ld),jp(t,a,c,h,m,g))};var ah=function baseIsEqual(t,a,c,h,m){return t===a||(null==t||null==a||!Wc(t)&&!Wc(a)?t!=t&&a!=a:ih(t,a,c,h,baseIsEqual,m))};var sh=function baseIsMatch(t,a,c,h){var m=c.length,g=m,_=!h;if(null==t)return!g;for(t=Object(t);m--;){var E=c[m];if(_&&E[2]?E[1]!==t[E[0]]:!(E[0]in t))return!1}for(;++m<g;){var b=(E=c[m])[0],O=t[b],T=E[1];if(_&&E[2]){if(void 0===O&&!(b in t))return!1}else{var S=new ld;if(h)var C=h(O,T,b,t,a,S);if(!(void 0===C?ah(T,O,3,h,S):C))return!1}}return!0};var ch=function isStrictComparable(t){return t==t&&!sc(t)};var uh=function getMatchData(t){for(var a=gu(t),c=a.length;c--;){var h=a[c],m=t[h];a[c]=[h,m,ch(m)]}return a};var lh=function matchesStrictComparable(t,a){return function(c){return null!=c&&(c[t]===a&&(void 0!==a||t in Object(c)))}};var dh=function baseMatches(t){var a=uh(t);return 1==a.length&&a[0][2]?lh(a[0][0],a[0][1]):function(c){return c===t||sh(c,t,a)}};var fh=function baseHasIn(t,a){return null!=t&&a in Object(t)};var ph=function hasPath(t,a,c){for(var h=-1,m=(a=td(a,t)).length,g=!1;++h<m;){var _=rd(a[h]);if(!(g=null!=t&&c(t,_)))break;t=t[_]}return g||++h!=m?g:!!(m=null==t?0:t.length)&&jc(m)&&Hc(_,m)&&(Zc(t)||Jc(t))};var hh=function hasIn(t,a){return null!=t&&ph(t,a,fh)};var mh=function baseMatchesProperty(t,a){return yl(t)&&ch(a)?lh(rd(t),a):function(c){var h=nd(c,t);return void 0===h&&h===a?hh(c,t):ah(a,h,3)}};var gh=function baseProperty(t){return function(a){return null==a?void 0:a[t]}};var vh=function basePropertyDeep(t){return function(a){return od(a,t)}};var yh=function property(t){return yl(t)?gh(rd(t)):vh(t)};var _h=function baseIteratee(t){return"function"==typeof t?t:null==t?kc:"object"==typeof t?Zc(t)?mh(t[0],t[1]):dh(t):yh(t)};var Eh=function baseSet(t,a,c,h){if(!sc(t))return t;for(var m=-1,g=(a=td(a,t)).length,_=g-1,E=t;null!=E&&++m<g;){var b=rd(a[m]),O=c;if("__proto__"===b||"constructor"===b||"prototype"===b)return t;if(m!=_){var T=E[b];void 0===(O=h?h(T,b,E):void 0)&&(O=sc(T)?T:Hc(a[m+1])?[]:{})}Rc(E,b,O),E=E[b]}return t};var bh=function basePickBy(t,a,c){for(var h=-1,m=a.length,g={};++h<m;){var _=a[h],E=od(t,_);c(E,_)&&Eh(g,td(_,t),E)}return g},Oh=Object.getOwnPropertySymbols?function(t){for(var a=[];t;)kp(a,Dp(t)),t=Ed(t);return a}:xp;var Th=function getAllKeysIn(t){return wp(t,Ad,Oh)};var Sh,Ch,Ih=function pickBy(t,a){if(null==t)return{};var c=Xl(Th(t),(function(t){return[t]}));return a=_h(a),bh(t,c,(function(t,c){return a(t,c[0])}))},Rh=function(){function NOS(t,a){this.nosCdnHostTimer=0,this.nosErrorCount=0,this.core=t,this.cloudStorage=a}var t=NOS.prototype;return t.reset=function reset(){this.nosErrorCount=0},t.getNosAccessToken=function getNosAccessToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("getNosAccessToken",{tag:t});case 2:return a=m.sent,c=nd(a,"content.nosAccessTokenTag.token"),h=t.url,m.abrupt("return",{token:c,url:-1!==indexOf(h).call(h,"?")?h+"&token="+c:h+"?token="+c});case 6:case"end":return m.stop()}}),_callee,this)})))},t.deleteNosAccessToken=function deleteNosAccessToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("deleteNosAccessToken",{tag:t});case 2:case"end":return a.stop()}}),_callee2,this)})))},t.nosUpload=function nosUpload(t,a){var c,h,m,g,_,E,b,O;return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var T,S,C,I,R,M,k,w,N,x,A,P,L,D,V,j,U,B,H;return hl.wrap((function _callee3$(G){for(;;)switch(G.prev=G.next){case 0:if(T=nd(this.core,"config.cdn.bucket"),S={tag:t.nosScenes||T||"nim",expireSec:t.nosSurvivalTime},C=this.core.adapters.getFileUploadInformation(t),!(!a&&!C)){G.next=17;break}return G.prev=5,G.next=8,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:S});case 8:I=G.sent,G.next=17;break;case 11:if(G.prev=11,G.t0=G.catch(5),this.core.logger.error("uploadFile:: getNosToken error",G.t0),!(G.t0 instanceof Gs)){G.next=16;break}throw G.t0;case 16:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"getNosToken error",rawError:G.t0,curProvider:1}});case 17:return R=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",C?null===(c=C.uploadInfo)||void 0===c?void 0:c.objectName:a?null==a?void 0:a.objectName:I.content.nosToken.objectName),M="",a&&a.shortUrl&&(M=a.shortUrl),(null===(g=null===(m=null===(h=null==C?void 0:C.uploadInfo)||void 0===h?void 0:h.payload)||void 0===m?void 0:m.mixStoreToken)||void 0===g?void 0:g.shortUrl)&&(M=C.uploadInfo.payload.mixStoreToken.shortUrl),k=M||R,G.prev=22,N=C?{token:null===(_=null==C?void 0:C.uploadInfo)||void 0===_?void 0:_.token,bucket:null===(E=null==C?void 0:C.uploadInfo)||void 0===E?void 0:E.bucketName,objectName:null===(b=null==C?void 0:C.uploadInfo)||void 0===b?void 0:b.objectName}:a||I.content.nosToken,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:N,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,platform:Qd.platform}),x="BROWSER"===Qd.platform?this.config.chunkUploadHost:this.config.commonUploadHost?this.config.commonUploadHost+"/"+(N&&N.bucket):"https://nos.netease.com/nim",this.core.reporterHookCloudStorage.update({remote_addr:x,operation_type:a?2:0}),G.next=29,this.core.adapters.uploadFile(wt(wt(wt({},t),{nosToken:N,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,maxSize:t.maxSize||this.config.chunkMaxSize}),a?{payload:{mixStoreToken:a}}:{}));case 29:w=G.sent,G.next=64;break;case 32:if(G.prev=32,G.t1=G.catch(22),this.core.logger.error("uploadFile::nos uploadFile error:",G.t1),A="v2"===nd(this.core,"options.apiVersion"),G.t1.code!==Bs.V2NIM_ERROR_CODE_CANCELLED&&10499!==G.t1.errCode){G.next=38;break}throw new Ws({code:A?Bs.V2NIM_ERROR_CODE_CANCELLED:400,detail:{reason:nd(G.t1,"message")||"Request abort",rawError:G.t1,curProvider:1}});case 38:if(!A||G.t1.errCode!==Bs.V2NIM_ERROR_CODE_FILE_OPEN_FAILED){G.next=40;break}throw new Gs({code:Bs.V2NIM_ERROR_CODE_FILE_OPEN_FAILED,detail:{reason:nd(G.t1,"message")||"Read file failed",rawError:G.t1,curProvider:1}});case 40:return G.next=42,Qd.net.getNetworkStatus();case 42:if(P=G.sent,!1!==P.net_connect){G.next=46;break}throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"No network",rawError:G.t1,curProvider:1}});case 46:if(!a){G.next=63;break}if(0!==this.nosErrorCount){G.next=59;break}G.prev=48,this.cloudStorage.mixStorage._addCircuitTimer(),G.next=55;break;case 52:throw G.prev=52,G.t2=G.catch(48),new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"All upload attempts failed",rawError:G.t2,curProvider:this.cloudStorage.mixStorage.curProvider,mixStorePolicy:this.cloudStorage.mixStorage.mixStorePolicy,file:t.file||t.filePath}});case 55:return this.nosErrorCount=nd(this.cloudStorage,"mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry"),G.abrupt("return",this.cloudStorage._uploadFile(t));case 59:return this.nosErrorCount--,G.abrupt("return",this.nosUpload(t,a));case 61:G.next=64;break;case 63:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"NOS attempts failed",rawError:G.t1,curProvider:1}});case 64:if(L=null==w?void 0:w.type,D=L&&indexOf(L).call(L,"/")>-1?slice(L).call(L,0,indexOf(L).call(L,"/")):"",(V={image:"imageInfo",video:"vinfo",audio:"vinfo"})[D]){G.next=69;break}return G.abrupt("return",wt({url:k},w));case 69:return G.prev=69,G.next=72,this.core.adapters.request(R+"?"+V[D],{method:"GET",dataType:"json",timeout:5e3},{exception_service:3});case 72:j=G.sent,G.next=79;break;case 75:return G.prev=75,G.t3=G.catch(69),this.core.logger.error("uploadFile:: fetch file info error",G.t3),G.abrupt("return",wt({url:k},w));case 79:if(!j){G.next=86;break}return U=j.data,B="imageInfo"===V[D]?U:null===(O=null==U?void 0:U.GetVideoInfo)||void 0===O?void 0:O.VideoInfo,H={url:k,name:w.name,size:w.size,ext:w.ext,w:B.Width,h:B.Height,orientation:B.Orientation,dur:B.Duration,audioCodec:B.AudioCodec,videoCodec:B.VideoCodec,container:B.Container},G.abrupt("return",Ih(H,(function(t,a){return void 0!==a})));case 86:return G.abrupt("return",wt({url:k},w));case 87:case"end":return G.stop()}}),_callee3,this,[[5,11],[22,32],[48,52],[69,75]])})))},t._getNosCdnHost=function _getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a,c,h,m=this;return hl.wrap((function _callee4$(g){for(;;)switch(g.prev=g.next){case 0:return g.prev=0,g.next=3,this.core.sendCmd("getNosCdnHost");case 3:a=g.sent,g.next=10;break;case 6:return g.prev=6,g.t0=g.catch(0),this.core.logger.error("getNosCdnHost::error",g.t0),g.abrupt("return");case 10:if(a){g.next=12;break}return g.abrupt("return");case 12:c=null===(t=null==a?void 0:a.content)||void 0===t?void 0:t.nosConfigTag,0!==(h=pa(null==c?void 0:c.expire))&&c.cdnDomain?-1===h?(this.config.cdn.bucket=c.bucket,this.config.cdn.cdnDomain=c.cdnDomain,this.config.cdn.objectNamePrefix=c.objectNamePrefix):(this.config.cdn.bucket=c.bucket,this.config.cdn.cdnDomain=c.cdnDomain,this.config.cdn.objectNamePrefix=c.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){m._getNosCdnHost()}),1e3*h)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return g.stop()}}),_callee4,this,[[0,6]])})))},Op(NOS,[{key:"config",get:function get(){return this.cloudStorage.config}}]),NOS}(),Mh={"6_2":"getNosToken","6_22":"getOriginUrl","6_24":"getNosAccessToken","6_25":"deleteNosAccessToken","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},kh={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,nosSurvivalTime:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4},nosAccessTokenTag:{token:0,url:1,userAgent:2,ext:3}},wh={getNosToken:{sid:6,cid:2,service:"cloudStorage",params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:kh.nosToken}],response:[{type:"Property",name:"nosToken",reflectMapper:mp(kh.nosToken)}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:kh.nosSafeUrlTag}],response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:mp(kh.nosSafeUrlTag)}]},getNosCdnHost:{sid:6,cid:26,service:"cloudStorage",response:[{type:"Property",name:"nosConfigTag",reflectMapper:mp(kh.nosConfigTag)}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",params:[{type:"Property",name:"config"}],response:[{type:"Property",name:"grayConfigTag",reflectMapper:mp(kh.grayConfigTag)}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:mp(kh.mixStorePolicyTag)}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:kh.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:mp(kh.mixStoreTokenResTag)}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:kh.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:mp(kh.mixStoreAuthTokenResTag)}]},getNosAccessToken:{sid:6,cid:24,service:"cloudStorage",params:[{type:"Property",name:"tag",reflectMapper:kh.nosAccessTokenTag}],response:[{type:"Property",name:"tag",reflectMapper:mp(kh.nosAccessTokenTag)}]},deleteNosAccessToken:{sid:6,cid:25,service:"cloudStorage",params:[{type:"Property",name:"tag",reflectMapper:kh.nosAccessTokenTag}]}},Nh={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},xh={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Sh||(Sh={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(Ch||(Ch={}));var Ah={chunkUploadHost:"https://wanproxy-web.127.net",commonUploadHost:"https://nos.netease.com",chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0},Ph=function(){function MixStorage(t,a){this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Sh.nos,this.mixStoreErrorCount=10,this.circuitTimer=0,this.core=t,this.cloudStorage=a,this.logger=t.logger}var t=MixStorage.prototype;return t.reset=function reset(){this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Sh.nos,this.mixStoreErrorCount=10},t.getGrayscaleConfig=function getGrayscaleConfig(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:if(Qd.localStorage)try{Qd.localStorage.getItem&&Qd.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(Qd.localStorage.getItem(this.GRAYKEY))[t])}catch(t){Qd.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){m.next=17;break}return m.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(c=m.sent).content||!c.content.grayConfigTag){m.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(c.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(c.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){m.next=10;break}return m.abrupt("return");case 10:h=Qd.localStorage.getItem(this.GRAYKEY)?JSON.parse(Qd.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),h[t]=this.grayConfig,Qd.localStorage.setItem(this.GRAYKEY,Fs(h)),m.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",c.content);case 17:if(!(null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable)){m.next=20;break}return m.next=20,this._getMixStorePolicy(t);case 20:case"end":return m.stop()}}),_callee,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h,m,g,_,E;return hl.wrap((function _callee2$(b){for(;;)switch(b.prev=b.next){case 0:if(a=(new Date).getTime(),Qd.localStorage)try{this.mixStorePolicy=JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=pa(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>a&&(h=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-a,this.core.timerManager.addTimer(bind$1(c=this._getMixStorePolicy).call(c,this,t),h))}catch(a){Qd.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",a)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=a)){b.next=30;break}return b.prev=3,b.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.cloudStorage.aws.s3?[1,2]:[1]});case 6:g=b.sent,_=g.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(_.ttl),this.mixStorePolicy.providers=_.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=pa(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=_.nosPolicy?JSON.parse(_.nosPolicy):null,this.mixStorePolicy.s3Policy=_.s3Policy?JSON.parse(_.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(m=this._getMixStorePolicy).call(m,this,t),1e3*this.mixStorePolicy.ttl),E=Qd.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(Qd.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),E[t]=this.mixStorePolicy,Qd.localStorage.setItem(this.MIXSTOREKEY,Fs(E)),b.next=30;break;case 23:if(b.prev=23,b.t0=b.catch(3),this.logger.error("getMixStorePolicy error",b.t0),0!==this.mixStoreErrorCount){b.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.cloudStorage.nos.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return b.stop()}}),_callee2,this,[[3,23]])})))},t._addCircuitTimer=function _addCircuitTimer(){var t=this,a=this.mixStorePolicy.providers,c=a[(indexOf(a).call(a,String(this.curProvider))+1)%a.length];if(c===a[0])throw new Error("uploadFile all policy fail");var h=nd(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(h&&h.retryNext&&c&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+c),this.curProvider=pa(c),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var m=this.mixStorePolicy[this.curProvider===Sh.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!m||0===m)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+pa(t.mixStorePolicy.providers[0])),t.curProvider=pa(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*m)}},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return a=c.sent,c.abrupt("return",a.content.mixStoreAuthTokenResTag);case 4:case"end":return c.stop()}}),_callee3,this)})))},MixStorage}(),Lh=ia.trim,Dh=R("".charAt),Vh=m.parseFloat,Fh=m.Symbol,jh=Fh&&Fh.iterator,Uh=1/Vh(ea+"-0")!=-1/0||jh&&!fails((function(){Vh(Object(jh))}))?function parseFloat(t){var a=Lh(toString$1(t)),c=Vh(a);return 0===c&&"-"==Dh(a,0)?-0:c}:Vh;_export({global:!0,forced:parseFloat!=Uh},{parseFloat:Uh});var Bh=G.parseFloat,Hh=function(){function AWS(t,a){this.s3=null,this.core=t,this.cloudStorage=a,this.logger=t.logger}return AWS.prototype.s3Upload=function s3Upload(t,a){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var c,h,m,g,_,E,b,O,T,S,C=this;return hl.wrap((function _callee2$(I){for(;;)switch(I.prev=I.next){case 0:if(!t.file){I.next=4;break}c=t.file,I.next=19;break;case 4:if("string"!=typeof t.fileInput){I.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((h=document.getElementById(t.fileInput))&&h.files&&h.files[0])){I.next=11;break}c=h.files[0],I.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:I.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){I.next=18;break}c=t.fileInput.files[0],I.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){I.next=21;break}throw new Error("dont get s3 policy");case 21:return m={accessKeyId:a.accessKeyId,secretAccessKey:a.secretAccessKey,sessionToken:a.sessionToken,region:a.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},g=this.s3,(_=new g).config.update(m),E=decodeURIComponent(a.bucket),b=decodeURIComponent(a.objectName),T={Bucket:E,Key:b,Body:O=c,Metadata:{token:a.token},ContentType:O.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",T),(S=_.upload(T)).on("httpUploadProgress",(function(a){var c=Bh((a.loaded/a.total).toFixed(2));t.onUploadProgress&&t.onUploadProgress({total:a.total,loaded:a.loaded,percentage:c,percentageText:Math.round(100*c)+"%"})})),I.abrupt("return",new Xn((function(c,h){var m=(new Date).getTime();S.send((function(g,_){return __awaiter(C,void 0,void 0,hl.mark((function _callee(){var T,S,C,I,R;return hl.wrap((function _callee$(M){for(;;)switch(M.prev=M.next){case 0:if(!g||"RequestAbortedError"!==g.code){M.next=5;break}this.logger.error("uploadFile:","api::s3:upload file abort.",g),h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_CANCELLED:400,detail:{reason:"S3RequestAbortedError",rawError:g,curProvider:2}})),M.next=31;break;case 5:if(!g){M.next=26;break}return this.logger.error("uploadFile:","api::s3:upload file failed.",g),this.core.reporter.reportTraceStart("exceptions",{user_id:this.core.options.account||(null===(S=null===(T=this.core)||void 0===T?void 0:T.auth)||void 0===S?void 0:S.account),trace_id:null===(C=this.core.clientSocket.socket)||void 0===C?void 0:C.sessionId,start_time:m,action:1,exception_service:4}),this.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof g.status?g.status:"number"==typeof g.code?g.code:0,description:g.message||""+g.code,operation_type:1,target:Fs({bucket:E,object:b})},{asyncParams:Qd.net.getNetworkStatus()}),this.core.reporter.reportTraceEnd("exceptions",1),M.next=12,Qd.net.getNetworkStatus();case 12:if(I=M.sent,!1!==I.net_connect){M.next=16;break}return M.abrupt("return",h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"No network",rawError:g,curProvider:this.cloudStorage.mixStorage.curProvider}})));case 16:M.prev=16,this.cloudStorage.mixStorage._addCircuitTimer(),M.next=23;break;case 20:return M.prev=20,M.t0=M.catch(16),M.abrupt("return",h(new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"All upload attempts failed",rawError:M.t0,curProvider:this.cloudStorage.mixStorage.curProvider,mixStorePolicy:this.mixStorePolicy,file:t.file||t.filePath}})));case 23:c(this.cloudStorage._uploadFile(t)),M.next=31;break;case 26:R=(R=this.mixStorePolicy.s3Policy.cdnSchema).replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn),this.core.reporterHookCloudStorage.update({remote_addr:R,operation_type:1}),R=R.replace("{objectName}",_.Key),c({size:O.size,name:O.name,url:a.shortUrl?a.shortUrl:R,ext:O.name.split(".")[1]||"unknown"});case 31:case"end":return M.stop()}}),_callee,this,[[16,20]])})))})),t.onUploadStart&&t.onUploadStart(S)})));case 33:case"end":return I.stop()}}),_callee2,this)})))},Op(AWS,[{key:"mixStorePolicy",get:function get(){return this.cloudStorage.mixStorage.mixStorePolicy}}]),AWS}();function getUploadResponseFormat(t){return void 0===t&&(t="file"),Fs(Nh[t]||{}).replace(/"/gi,'\\"')}var Gh,Kh=function(){function CloudStorageService(t,a){void 0===a&&(a={}),this.config={},this.uploadTaskMap={},this.name="cloudStorage",this.logger=t.logger,this.core=t,this.nos=new Rh(t,this),this.mixStorage=new Ph(t,this),this.aws=new Hh(t,this),registerParser({cmdMap:Mh,cmdConfig:wh}),this.setOptions(a),this.setListeners()}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var a=t.storageKeyPrefix||"NIMClient";this.mixStorage.GRAYKEY=a+"-AllGrayscaleConfig",this.mixStorage.MIXSTOREKEY=a+"-AllMixStorePolicy";var c=t.s3,h=__rest(t,["s3"]),m=wt({},Ah,this.config);if(h&&Object.prototype.hasOwnProperty.call(h,"cdn")){var g=wt(wt({},m.cdn),h.cdn);this.config=wt({},m,h),this.config.cdn=g}else this.config=wt({},m,h);c&&(this.aws.s3=c)},t.setListeners=function setListeners(){var t,a,c,h;this.core.eventBus.on("kicked",bind$1(t=this._clearUnCompleteTask).call(t,this)),this.core.eventBus.on("disconnect",bind$1(a=this._clearUnCompleteTask).call(a,this)),this.core.eventBus.on("V2NIMLoginService/loginLifeCycleLogout",bind$1(c=this._clearUnCompleteTask).call(c,this)),this.core.eventBus.on("V2NIMLoginService/loginLifeCycleKicked",bind$1(h=this._clearUnCompleteTask).call(h,this))},t._clearUnCompleteTask=function _clearUnCompleteTask(){var t,a=this;forEach$1(t=Fi(this.uploadTaskMap)).call(t,(function(t){var c=a.uploadTaskMap[t];c&&c.abort&&c.abort()})),this.uploadTaskMap={}},t.init=function init(){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.mixStorage.reset(),this.nos.reset(),!this.config.isNeedToGetUploadPolicyFromServer){t.next=7;break}return t.next=5,this.mixStorage.getGrayscaleConfig(this.core.options.appkey);case 5:return t.next=7,this.nos._getNosCdnHost();case 7:case"end":return t.stop()}}),_callee,this)})))},t.processCallback=function processCallback(t,a){var c=this,h=t.onUploadProgress,m=t.onUploadDone,g=t.onUploadStart;return{onUploadStart:"function"==typeof g?function(t){c.uploadTaskMap[a]=t;try{g(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadStart execute error",t)}}:function(t){c.uploadTaskMap[a]=t},onUploadProgress:"function"==typeof h?function(t){c.core.reporterHookCloudStorage.update({transferred_size:t.loaded});try{h(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadProgress execute error",t)}}:function(t){c.core.reporterHookCloudStorage.update({transferred_size:t.loaded})},onUploadDone:"function"==typeof m?function(t){c.core.reporterHookCloudStorage.end(0);try{m(t)}catch(t){c.logger.error("CloudStorage::uploadFile:options.onUploadDone execute error",t)}}:function(){c.core.reporterHookCloudStorage.end(0)},taskKey:a}},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){var a,c,h,m,g,_,E,b;return hl.wrap((function _callee2$(O){for(;;)switch(O.prev=O.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){O.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){O.next=7;break}if("string"!=typeof(a=nd(t,"file.type"))||-1!==indexOf(a).call(a,t.type)){O.next=7;break}throw new Error('The meta type "'+a+'" does not match "'+t.type+'"');case 7:return this.core.reporterHookCloudStorage.start(),t.file?this.core.reporterHookCloudStorage.update({full_size:t.file.size}):"string"==typeof t.fileInput?(c=document.getElementById(t.fileInput))&&c.files&&c.files[0]&&this.core.reporterHookCloudStorage.update({full_size:c.files[0].size}):t.fileInput&&t.fileInput.files&&t.fileInput.files[0]&&this.core.reporterHookCloudStorage.update({full_size:t.fileInput.files[0].size}),h=Eu(),m=this.processCallback(t,h),g=m.onUploadStart,_=m.onUploadProgress,E=m.onUploadDone,t.onUploadStart=g,t.onUploadProgress=_,t.onUploadDone=E,b=null,O.prev=15,O.next=18,this._uploadFile(t);case 18:b=O.sent,delete this.uploadTaskMap[h],O.next=27;break;case 22:throw O.prev=22,O.t0=O.catch(15),delete this.uploadTaskMap[h],this.core.reporterHookCloudStorage.end((O.t0&&O.t0.code)===Bs.V2NIM_ERROR_CODE_CANCELLED?3:1),O.t0;case 27:return b&&(b.size=void 0===b.size?void 0:Number(b.size),b.w=void 0===b.w?void 0:Number(b.w),b.h=void 0===b.h?void 0:Number(b.h),b.dur=void 0===b.dur?void 0:Number(b.dur)),b.url=decodeURIComponent(b.url),t.onUploadDone({size:b.size,name:b.name,url:b.url,ext:b.name.split(".")[1]||"unknown"}),O.abrupt("return",b);case 31:case"end":return O.stop()}}),_callee2,this,[[15,22]])})))},t._uploadFile=function _uploadFile(t){var a,c;return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var h,m,g,_;return hl.wrap((function _callee3$(E){for(;;)switch(E.prev=E.next){case 0:if(nd(this.mixStorage,"grayConfig.mixStoreEnable")&&nd(this.mixStorage,"mixStorePolicy.providers.length")){E.next=3;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),E.abrupt("return",this.nos.nosUpload(t));case 3:if(this.logger.log("uploadFile::_uploadFile, grayConfig enable:"+nd(this.mixStorage,"grayConfig.mixStoreEnable")+" curProvider:"+nd(this.mixStorage,"curProvider")),h=this.core.adapters.getFileUploadInformation(t),m=!0,h?!1===h.complete&&this.mixStorage.curProvider===Sh.s3&&(m=!1):m=!1,this.aws.s3||(this.mixStorage.curProvider=Sh.nos),g=xh,m){E.next=23;break}return E.prev=10,E.next=13,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.mixStorage.curProvider,tokenCount:1,tag:"qchat",nosSurvivalTime:t.nosSurvivalTime,returnBody:getUploadResponseFormat(t.type)}});case 13:_=E.sent,g=_.content.mixStoreTokenResTag,E.next=23;break;case 17:if(E.prev=17,E.t0=E.catch(10),this.core.logger.error("uploadFile:: getMixStoreToken error",E.t0),!(E.t0 instanceof Gs)){E.next=22;break}throw E.t0;case 22:throw new Ws({code:"v2"===nd(this.core,"options.apiVersion")?Bs.V2NIM_ERROR_CODE_FILE_UPLOAD_FAILED:400,detail:{reason:"getMixStoreToken error",rawError:E.t0,curProvider:this.mixStorage.curProvider,mixStorePolicy:this.mixStorage.mixStorePolicy}});case 23:if(m){E.next=27;break}return E.abrupt("return",this.mixStorage.curProvider===Sh.s3?this.aws.s3Upload(t,g):this.nos.nosUpload(t,g));case 27:return E.abrupt("return",this.nos.nosUpload(t,null===(c=null===(a=null==h?void 0:h.uploadInfo)||void 0===a?void 0:a.payload)||void 0===c?void 0:c.mixStoreToken));case 28:case"end":return E.stop()}}),_callee3,this,[[10,17]])})))},t.getPrivateUrl=function getPrivateUrl(t){var a;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var c=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);c[0];var h=c[1];c[2];var m=c[3];c[4];var g=c[5];if(c[6],c[7],null===(a=this.grayConfig)||void 0===a?void 0:a.mixStoreEnable){var _=this._getUrlType(t);return _===Sh.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",g)),_===Sh.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",g)),t}var E=this.config,b=E.downloadUrl,O=E.downloadHostList,T=E.nosCdnEnable,S=this.config.cdn.cdnDomain,C=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",I=decodeURIComponent(g),R=indexOf(I).call(I,C);if(S&&R>-1&&T)return""+h+S+"/"+slice(I).call(I,R);if(includes(O).call(O,m)&&includes(g).call(g,"/")){var M=indexOf(g).call(g,"/"),k=g.substring(0,M),w=g.substring(M+1);return b.replace("{bucket}",k).replace("{object}",w)}var N=filter(O).call(O,(function(t){return"string"==typeof m&&includes(m).call(m,t)}))[0],x=N?m.replace(N,"").replace(/\W/g,""):null;return x?b.replace("{bucket}",x).replace("{object}",g):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:if("string"==typeof t&&includes(t).call(t,"_im_url=1")){c.next=2;break}return c.abrupt("return",t);case 2:return c.next=4,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 4:return a=c.sent,c.abrupt("return",a.content.nosSafeUrlTag.originUrl);case 6:case"end":return c.stop()}}),_callee4,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var a,c,h,m,g,_=this;return hl.wrap((function _callee5$(E){for(;;)switch(E.prev=E.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),a=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,c=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,a!==String(Ch.dontNeed)||c!==String(Ch.dontNeed)){E.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==Ch.time){E.next=17;break}if(!(a&&indexOf(a).call(a,String(Ch.time))>=0||c&&indexOf(c).call(c,String(Ch.time))>0)){E.next=13;break}return E.abrupt("return",this.mixStorage.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:E.next=33;break;case 17:if(t.urls&&t.urls.length){E.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(m=[],g=[],forEach$1(h=t.urls).call(h,(function(t){var a=_._getUrlType(t);a===Sh.nos&&g.push(t),a===Sh.s3&&m.push(t)})),(!c||0!==m.length&&indexOf(c).call(c,String(Ch.urls))<0)&&(this.logger.warn("s3 url don't support url token"),m=[]),(!a||0!==g.length&&indexOf(a).call(a,String(Ch.urls))<0)&&(this.logger.warn("nos url don't support url token"),g=[]),0!==m.length||0!==g.length){E.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==m.length&&0!==g.length){E.next=33;break}return t.urls=Fs(t.urls),E.abrupt("return",this.mixStorage.getFileAuthToken(t));case 33:case"end":return E.stop()}}),_callee5,this)})))},t._getUrlType=function _getUrlType(t){var a,c;return this.mixStorePolicy.nosPolicy&&some(a=this.mixStorePolicy.nosPolicy.dlcdns).call(a,(function(a){return indexOf(t).call(t,a)>=0}))?Sh.nos:this.mixStorePolicy.s3Policy&&some(c=this.mixStorePolicy.s3Policy.dlcdns).call(c,(function(a){return indexOf(t).call(t,a)>=0}))?Sh.s3:null},t.getNosAccessToken=function getNosAccessToken(t){return validate({url:{type:"string",allowEmpty:!1}},t),this.nos.getNosAccessToken(t)},t.deleteNosAccessToken=function deleteNosAccessToken(t){return validate({token:{type:"string",allowEmpty:!1}},t),this.nos.deleteNosAccessToken(t)},t.process=function process(t){var a=nd(t,"error.detail.ignore");return t.error&&!a?Xn.reject(t.error):Xn.resolve(t)},Op(CloudStorageService,[{key:"grayConfig",get:function get(){return this.mixStorage.grayConfig}},{key:"mixStorePolicy",get:function get(){return this.mixStorage.mixStorePolicy}}]),CloudStorageService}(),qh=function(t){function ChatroomMsgService(a){return t.call(this,"chatroomMsg",a)||this}St(ChatroomMsgService,t);var a=ChatroomMsgService.prototype;return a.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(wt(wt({},t),{type:"text"}))},a.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(wt(wt({},t),{type:"geo",body:Fs(t.body)}))},a.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(wt(wt({},t),{type:"tip"})));case 2:case"end":return a.stop()}}),_callee,this)})))},a.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),a.abrupt("return",this.sendMsg(wt(wt({},t),{type:"custom"})));case 2:case"end":return a.stop()}}),_callee2,this)})))},a.sendImageMsg=function sendImageMsg(t){return this.doSendFile(wt(wt({},t),{type:"image"}))},a.sendFileMsg=function sendFileMsg(t){return this.doSendFile(wt(wt({},t),{type:"file"}))},a.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(wt(wt({},t),{type:"audio"}))},a.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(wt(wt({},t),{type:"video"}))},a.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),a=t.body){c.next=15;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){c.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return c.prev=5,c.next=8,this.core.cloudStorage.uploadFile(t);case 8:a=c.sent,c.next=15;break;case 11:throw c.prev=11,c.t0=c.catch(5),this.logger.error("sendFile:: upload File error or abort.",c.t0),c.t0;case 15:return c.abrupt("return",this.sendMsg(wt(wt({},t),{body:Fs(a),type:t.type})));case 16:case"end":return c.stop()}}),_callee3,this,[[5,11]])})))},a.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a,c,h;return hl.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),m.next=3,this.core.sendCmd("chatroomQueryMessageHistory",wt(wt({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map$6(a=t.msgTypes).call(a,(function(t){return fp[t]})):[]}));case 3:return c=m.sent,h=c.content.chatroomMsgs,m.abrupt("return",formatChatroomMsgs(h,this.core.account));case 6:case"end":return m.stop()}}),_callee4,this)})))},a.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var a,c,h,m,g;return hl.wrap((function _callee5$(_){for(;;)switch(_.prev=_.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),h=wt(wt({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map$6(a=filter(c=t.types).call(c,(function(t){return void 0!==fp[t]}))).call(a,(function(t){return fp[t]})):[]}),_.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:wt(h,{tags:Fs(h.tags),types:Fs(h.types)})});case 4:return m=_.sent,g=m.content.chatroomMsgs,_.abrupt("return",formatChatroomMsgs(g,this.core.account));case 7:case"end":return _.stop()}}),_callee5,this)})))},a.onChatroomMsgHandler=function onChatroomMsgHandler(t){var a=t.content;Zn();var c=formatChatroomMsg(null==a?void 0:a.chatroomMsg,this.core.account);"debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",c.type,c.idClient,c):this.logger.log("onChatroomMsgHandler::recvMsg",c.type,c.idClient),this.core.emit("chatroomMsg",c),"out"!==c.flow&&this.doMsgReceiveReport(c,t)},a.doMsgReceiveReport=function doMsgReceiveReport(t,a){if(t.from!==this.core.account){var c=nd(t,"__clientExt.statistics.apiCallingTime")||0,h=nd(t,"__clientExt.statistics.sendTime")||0,m=nd(t,"__clientExt.statistics.attachUploadDuration")||0,g=this.core.timeOrigin.getNTPTime(),_=t.time,E=this.core.timeOrigin.checkNodeReliable(a.__receiveTimeNode)?this.core.timeOrigin.getNTPTime(a.__receiveTimeNode):g;this.core.reporter.report("msgReceive",{msgId:"",clientId:t.idClient,serverTime:_,receiveTime:E,fromAccid:t.from,toAccid:this.core.account,type:4,roomId:t.chatroomId,apiCallingTime:c,sendTime:h,attachUploadDuration:m,callbackTime:g,preHandleTime:g,result:200,failReason:"",rt:g-_})}},a.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var a,c,h,m,g;return hl.wrap((function _callee6$(_){for(;;)switch(_.prev=_.next){case 0:validate({type:{type:"enum",values:getEnumKeys(fp)},subType:{type:"number",min:1,required:!1}},t),a=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),c=formatChatroomMsg(wt(wt({},a),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(c)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return _.prev=4,_.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:a});case 7:return h=_.sent,m=formatChatroomMsg(wt(wt(wt({},a),h.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,msgTime:m.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:200,failReason:"",rt:Zn()-c.time}),_.abrupt("return",m);case 13:throw _.prev=13,_.t0=_.catch(4),g=formatChatroomMsg(wt(wt({},a),{status:"fail"}),this.core.account),_.t0.msg=g,this.core.reporter.report("msgSend",{msgId:"",clientId:g.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:g.chatroomId,tid:"",result:null===_.t0||void 0===_.t0?void 0:_.t0.code,failReason:(null===_.t0||void 0===_.t0?void 0:_.t0.message)||"",rt:Zn()-a.time}),_.t0;case 19:case"end":return _.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}($f);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(Gh||(Gh={}));var Wh=function(t){function ChatroomMemberService(a){return t.call(this,"chatroomMember",a)||this}St(ChatroomMemberService,t);var a=ChatroomMemberService.prototype;return a.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),a.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",wt(wt({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee,this)})))},a.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee2,this)})))},a.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){return hl.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee3,this)})))},a.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){return hl.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:-2}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee4,this)})))},a.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.markChatroomMember(wt(wt({},t),{type:-1}));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}),_callee5,this)})))},a.queryMembers=function queryMembers(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var c;return hl.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(Gh)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembers",wt(wt({time:0,limit:100},t),{type:Gh[t.type]}));case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee6,this)})))},a.queryMembersByAccounts=function queryMembersByAccounts(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee7(){var c;return hl.wrap((function _callee7$(h){for(;;)switch(h.prev=h.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee7,this)})))},a.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee8(){return hl.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMemberTempMute",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee8,this)})))},a.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee9(){return hl.wrap((function _callee9$(a){for(;;)switch(a.prev=a.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomKickMember",wt(wt({},t),{ext:t.ext||""}));case 3:case"end":return a.stop()}}),_callee9,this)})))},a.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee10(){var a;return hl.wrap((function _callee10$(c){for(;;)switch(c.prev=c.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",wt({},t));case 3:return a=c.sent,c.abrupt("return",a.content.count);case 5:case"end":return c.stop()}}),_callee10,this)})))},a.queryMembersByTag=function queryMembersByTag(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee11(){var c;return hl.wrap((function _callee11$(h){for(;;)switch(h.prev=h.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:wt({time:0,limit:100},t)});case 3:return c=h.sent,h.abrupt("return",formatChatroomMembers(null===(a=c.content)||void 0===a?void 0:a.members));case 5:case"end":return h.stop()}}),_callee11,this)})))},a.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee12(){return hl.wrap((function _callee12$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:wt(wt({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return a.stop()}}),_callee12,this)})))},a.markChatroomMember=function markChatroomMember(t){var a;return __awaiter(this,void 0,void 0,hl.mark((function _callee13(){var c;return hl.wrap((function _callee13$(h){for(;;)switch(h.prev=h.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),h.next=3,this.core.sendCmd("markChatroomMember",wt(wt({level:0},t),{ext:t.ext||""}));case 3:return c=h.sent,h.abrupt("return",formatChatroomMember(null===(a=c.content)||void 0===a?void 0:a.chatroomMember));case 5:case"end":return h.stop()}}),_callee13,this)})))},ChatroomMemberService}($f),zh=function(t){function ChatroomQueueService(a){return t.call(this,"chatroomQueue",a)||this}St(ChatroomQueueService,t);var a=ChatroomQueueService.prototype;return a.init=function init(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),a.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return a.stop()}}),_callee,this)})))},a.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee2(){return hl.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueOffer",wt(wt({},t),{transient:!!t.transient}));case 3:case"end":return a.stop()}}),_callee2,this)})))},a.poll=function poll(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee3(){var a;return hl.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),c.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return a=c.sent,c.abrupt("return",a.content);case 6:case"end":return c.stop()}}),_callee3,this)})))},a.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee4(){var a;return hl.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueueChange",wt(wt({},t),{needNotify:!!t.needNotify}));case 3:return a=c.sent,c.abrupt("return",a.content.invalidKeyList);case 5:case"end":return c.stop()}}),_callee4,this)})))},a.fetch=function fetch(){return __awaiter(this,void 0,void 0,hl.mark((function _callee5(){var t;return hl.wrap((function _callee5$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=a.sent,a.abrupt("return",t.content.itemList);case 4:case"end":return a.stop()}}),_callee5,this)})))},a.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,hl.mark((function _callee6(){var t,a,c,h;return hl.wrap((function _callee6$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return a=m.sent,c=a.content.elementKey,h=a.content.elementValue,m.abrupt("return",((t={})[c]=h,t));case 6:case"end":return m.stop()}}),_callee6,this)})))},a.clear=function clear(){return __awaiter(this,void 0,void 0,hl.mark((function _callee7(){return hl.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}($f),$h={"1_2":"heartbeat","6_23":"getServerTime","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},Yh={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,clientSession:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,clientSession:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,hostEnv:41,userAgent:42,libEnv:44,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33,__clientExt:{id:39,converter:function objectToJSONString(t){if(t&&"object"==typeof t)try{return Fs(t)}catch(t){return}},retConverter:function stringToJSONObject(t){if(t&&"string"==typeof t)try{return JSON.parse(t)}catch(t){return}}}},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Xh=function getDeserializeTag(){return function invertSerializeMap(t){var a,c={};return forEach$1(a=Fi(t)).call(a,(function(a){c[a]=function invertSerializeItem(t){var a={};for(var c in t){var h=t[c];"number"==typeof h?a[h]=c:"object"==typeof h&&(a[h.id]={prop:c,type:h.retType,access:h.retAccess?h.retAccess:h.access?h.access:c,def:h.retDef,converter:h.retConverter})}return a}(t[a])})),c}(Yh)},Qh=function getCmdConfig(){var t=Xh();return{heartbeat:{sid:1,cid:2,service:"chatroom"},getServerTime:{sid:6,cid:23,service:"chatroom",response:[{type:"Long",name:"time"}]},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:Yh.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:Yh.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:t.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:t.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:t.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:Yh.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:t.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:t.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:Yh.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:t.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:t.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:Yh.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:Yh.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:t.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"String",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:Yh.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:t.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:Yh.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"Bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"Bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:t.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"auth",response:[{type:"Int",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:t.updateTags}]}}},Jh={user_id:"",trace_id:"",action:7,exception_service:6,duration:0,start_time:0,state:1,extension:[]},Zh=function(){function ReporterHookLinkKeep(t,a){this.traceData=Jh,this.core=t,this.traceData=wt({},Jh,a),this.traceData.extension=[]}var t=ReporterHookLinkKeep.prototype;return t.reset=function reset(){this.traceData=wt({},Jh),this.traceData.extension=[]},t.start=function start(){var t,a;this.reset(),this.traceData.user_id=this.core.account,this.traceData.trace_id=(null===(a=null===(t=this.core.clientSocket)||void 0===t?void 0:t.socket)||void 0===a?void 0:a.sessionId)||"",this.traceData.start_time=(new Date).getTime()},t.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h;return hl.wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,Qd.net.getNetworkStatus();case 2:a=m.sent,c=a.net_type,h=a.net_connect,this.traceData.extension.push(wt({code:0,description:"",foreground:!0,foreg_backg_switch:!1,net_type:c,net_connect:h},t));case 6:case"end":return m.stop()}}),_callee,this)})))},t.end=function end(t){var a=this.traceData.extension[0],c=this.traceData.extension[1];if(a&&0===a.operation_type&&c&&1===c.operation_type){var h=a.net_type!==c.net_type||a.net_connect!==c.net_connect;if(t||!h)return this.traceData.duration=(new Date).getTime()-this.traceData.start_time,this.core.reporter.report("exceptions",this.traceData),void this.reset();this.reset()}else this.reset()},ReporterHookLinkKeep}(),em={user_id:"",trace_id:"",action:0,state:0,duration:0,start_time:0,offset:0,full_size:0,transferred_size:0,operation_type:0,remote_addr:""},tm="ReporterHook::setMonitorForResources:",rm=function(){function ReporterHookCloudStorage(t,a){this.traceData=em,this.core=t,this.traceData=wt({},em,a)}var t=ReporterHookCloudStorage.prototype;return t.reset=function reset(){this.traceData=wt({},em)},t.start=function start(){var t,a;this.reset(),this.traceData.user_id=this.core.account,this.traceData.trace_id=(null===(a=null===(t=this.core.clientSocket)||void 0===t?void 0:t.socket)||void 0===a?void 0:a.sessionId)||"",this.traceData.start_time="timeOrigin"in this.core?this.core.timeOrigin.getNTPTime():Zn()},t.update=function update(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){return hl.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(this.traceData.user_id){a.next=2;break}return a.abrupt("return");case 2:this.core.logger.log(tm+" upload update",t),wt(this.traceData,t);case 4:case"end":return a.stop()}}),_callee,this)})))},t.end=function end(t){this.traceData.user_id&&(this.core.logger.log(tm+" upload end cause of "+t),this.traceData.state=t,this.traceData.duration=("timeOrigin"in this.core?this.core.timeOrigin.getNTPTime():Zn())-this.traceData.start_time,this.core.reporter.report("nim_sdk_resources",this.traceData),this.traceData=em)},ReporterHookCloudStorage}(),om={debugLevel:"off",needReconnect:!0,reconnectionAttempts:9007199254740991,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:Lf,abtestProjectKey:Df},nm=function(t){function Chatroom(a,c){var m,g,_,E;void 0===c&&(c={}),(m=t.call(this)||this).instanceName="Chatroom",m.status="unconnected",m.account="",m.eventBus=new gi,m.options={},m.chatroom={},m.chatroomMsg={},m.chatroomMember={},m.chatroomQueue={},m.cloudStorage={},m.logger=new Af(a.debugLevel),m.setInitOptions(a),registerParser({cmdMap:$h,cmdConfig:Qh()}),m.otherOptions=c,m.timerManager=new zf,m.adapters=new Pf(h(m)),m.timeOrigin=new tf(h(m)),m.abtest=new Vf(h(m),{isAbtestEnable:m.options.isAbtestEnable,abtestUrl:m.options.abtestUrl,abtestProjectKey:Df});var b="",O="";m.options.isFixedDeviceId?(b=Qd.localStorage.getItem("__CHATROOM_DEVC_ID__")||Eu(),O=Qd.localStorage.getItem("__CHATROOM_CLIENT_SESSION_ID__")||Eu(),Qd.localStorage.setItem("__CHATROOM_DEVC_ID__",b),Qd.localStorage.setItem("__CHATROOM_CLIENT_SESSION_ID__",O)):(b=Eu(),O=Eu()),m.config={timeout:8e3,deviceId:b,clientSession:O};var T=Qd.getSystemInfo(),S=null===(g=null==c?void 0:c.reporterConfig)||void 0===g?void 0:g.isDataReportEnable;return"boolean"!=typeof S&&(S=!0),m.reporter=new Yi({reportConfigUrl:(null===(_=null==c?void 0:c.reporterConfig)||void 0===_?void 0:_.reportConfigUrl)||"https://statistic.live.126.net/dispatcher/req",reportUrl:(null===(E=null==c?void 0:c.reporterConfig)||void 0===E?void 0:E.reportUrl)||"https://statistic.live.126.net/statics/report/common/form",isDataReportEnable:S,common:{app_key:a.appkey,dev_id:m.config.deviceId,platform:"Web",sdk_ver:"10.2.4",env:"online",os_name:T.os,os_ver:T.osVer,lib_env:T.libEnv,host_env:T.hostEnv,host_env_ver:T.hostEnvVer,manufactor:T.manufactor,model:T.model,v2:!1},request:Qd.request,logger:m.logger,autoStart:!0}),m.reporterHookLinkKeep=new Zh(h(m)),m.reporterHookCloudStorage=new rm(h(m)),Qd.setLogger(m.logger),m.auth=new Ep(h(m)),m.V1NIMLoginService=m.auth,m.clientSocket=new cp(h(m)),m.chatroom=new bp(h(m)),m.chatroomMsg=new qh(h(m)),m.chatroomMember=new Wh(h(m)),m.chatroomQueue=new zh(h(m)),m.cloudStorage=new Kh(h(m),wt({storageKeyPrefix:m.instanceName},c.cloudStorageConfig)),Chatroom.instance=h(m),m.logger.log("Chatroom init, version ","10.2.4"," sdk version ",100204," appkey ",a.appkey),m}St(Chatroom,t),Chatroom.getInstance=function getInstance(t,a){if(!Chatroom.instance){if(t)return new Chatroom(t,a);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var a=Chatroom.prototype;return a.setOptions=function setOptions(t){if("object"==typeof t&&null!==t&&(Object.prototype.hasOwnProperty.call(t,"account")&&t.account!==this.options.account||Object.prototype.hasOwnProperty.call(t,"appkey")&&t.appkey!==this.options.appkey))throw new Error("chatroom::setOptions account and appkey is not allowed to reset");validate({token:{type:"string",required:!1},chatroomId:{type:"string",required:!1},chatroomAddresses:{type:"array",itemType:"string",min:1,required:!1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.options=wt(wt({},this.options),t)},a.setInitOptions=function setInitOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger&&this.logger.log("chatroom::setInitOptions options is",t),this.account=t.account,this.options=wt(wt({},om),t)},a.connect=function connect(t){return void 0===t&&(t={}),this.auth.login(t)},a.disconnect=function disconnect(){var t=this;switch(this.status){case"logined":return this.sendCmd("chatroomExit",void 0,{timeout:1e3}).then((function(){t.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect")})).catch((function(a){t.logger.error("Instance::disconnect sendCmd:logout error",a),t.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect")}));case"connected":case"connecting":case"waitReconnect":return this.clientSocket.doDisconnect(rp.ACTIVE,"UserActiveDisconnect"),Xn.resolve();case"unconnected":case"destroyed":return Xn.resolve()}},a.destroy=function destroy(){var t=this;return Chatroom.instance=void 0,this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.logger.destroy(),t.reporter.destroy(),t.timerManager.destroy(),t.connect=emptyFuncWithPromise,t.disconnect=emptyFuncWithPromise,t.destroy=emptyFuncWithPromise}))},a.sendCmd=function sendCmd(t,a,c){return this.clientSocket.sendCmd(t,a,c)},a.emit=function emit(a){var c=this;try{for(var h,m,g=Zn(),_=arguments.length,E=new Array(_>1?_-1:0),b=1;b<_;b++)E[b-1]=arguments[b];var O=(h=t.prototype.emit).call.apply(h,concat(m=[this,a]).call(m,E)),T=Zn()-g;return T>=10&&this.logger.warn("Core::emit event: "+a+" process takes: "+T+"ms"),O}catch(t){return this.logger.error("Core::emit event: "+a+". Error: "+t),mi((function(){throw c.logger.error("Core::emit throw error in setTimeout. event: "+a+". Error: "+t),t}),0),!1}},Chatroom}(gi),im=createCommonjsModule((function(a,c){(function(){var h={function:!0,object:!0}[typeof window]&&window||this,m=c,g=a&&!a.nodeType&&a,_=m&&g&&"object"==typeof t&&t;!_||_.global!==_&&_.window!==_&&_.self!==_||(h=_);var E=Math.pow(2,53)-1,b=/\bOpera/,O=Object.prototype,T=O.hasOwnProperty,S=O.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,a){for(var c in t)T.call(t,c)&&a(t[c],c,t)}function getClassOf(t){return null==t?capitalize(t):S.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,a){var c=null;return function each(t,a){var c=-1,h=t?t.length:0;if("number"==typeof h&&h>-1&&h<=E)for(;++c<h;)a(t[c],c,t);else forOwn(t,a)}(t,(function(h,m){c=a(c,h,m,t)})),c}function trim(t){return String(t).replace(/^ +| +$/g,"")}var C=function parse(t){var a=h,c=t&&"object"==typeof t&&"String"!=getClassOf(t);c&&(a=t,t=null);var m=a.navigator||{},g=m.userAgent||"";t||(t=g);var _,E,O=c?!!m.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(S.toString()),T="Object",C=c?T:"ScriptBridgingProxyObject",I=c?T:"Environment",R=c&&a.java?"JavaPackage":getClassOf(a.java),M=c?T:"RuntimeObject",k=/\bJava/.test(R)&&a.java,w=k&&getClassOf(a.environment)==I,N=k?"a":"α",x=k?"b":"β",A=a.document||{},P=a.operamini||a.opera,L=b.test(L=c&&P?P["[[Class]]"]:getClassOf(P))?L:P=null,D=t,V=[],j=null,U=t==g,B=U&&P&&"function"==typeof P.version&&P.version(),H=function getLayout(a){return reduce(a,(function(a,c){return a||RegExp("\\b"+(c.pattern||qualify(c))+"\\b","i").exec(t)&&(c.label||c)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),G=function getName(a){return reduce(a,(function(a,c){return a||RegExp("\\b"+(c.pattern||qualify(c))+"\\b","i").exec(t)&&(c.label||c)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),K=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),q=function getManufacturer(a){return reduce(a,(function(a,c,h){return a||(c[K]||c[/^[a-z]+(?: +[a-z]+\b)*/i.exec(K)]||RegExp("\\b"+qualify(h)+"(?:\\b|\\w*\\d)","i").exec(t))&&h}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),W=function getOS(a){return reduce(a,(function(a,c){var h=c.pattern||qualify(c);return!a&&(a=RegExp("\\b"+h+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(a=function cleanupOS(t,a,c){var h={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return a&&c&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(h=h[/[\d.]+$/.exec(t)])&&(t="Windows "+h),t=String(t),a&&c&&(t=t.replace(RegExp(a,"i"),c)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(a,h,c.label||c)),a}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(a){return reduce(a,(function(a,c){var h=c.pattern||qualify(c);return!a&&(a=RegExp("\\b"+h+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+h+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+h+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((a=String(c.label&&!RegExp(h,"i").test(c.label)?c.label:a).split("/"))[1]&&!/[\d.]+/.test(a[0])&&(a[0]+=" "+a[1]),c=c.label||c,a=format(a[0].replace(RegExp(h,"i"),c).replace(RegExp("; *(?:"+c+"[_-])?","i")," ").replace(RegExp("("+c+")[-_.]?(\\w)","i"),"$1 $2"))),a}))}function getVersion(a){return reduce(a,(function(a,c){return a||(RegExp(c+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(H&&(H=[H]),/\bAndroid\b/.test(W)&&!K&&(_=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(K=trim(_[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),q&&!K?K=getProduct([q]):q&&K&&(K=K.replace(RegExp("^("+qualify(q)+")[-_.\\s]","i"),q+" ").replace(RegExp("^("+qualify(q)+")[-_.]?(\\w)","i"),q+" $2")),(_=/\bGoogle TV\b/.exec(K))&&(K=_[0]),/\bSimulator\b/i.test(t)&&(K=(K?K+" ":"")+"Simulator"),"Opera Mini"==G&&/\bOPiOS\b/.test(t)&&V.push("running in Turbo/Uncompressed mode"),"IE"==G&&/\blike iPhone OS\b/.test(t)?(q=(_=parse(t.replace(/like iPhone OS/,""))).manufacturer,K=_.product):/^iP/.test(K)?(G||(G="Safari"),W="iOS"+((_=/ OS ([\d_]+)/i.exec(t))?" "+_[1].replace(/_/g,"."):"")):"Konqueror"==G&&/^Linux\b/i.test(W)?W="Kubuntu":q&&"Google"!=q&&(/Chrome/.test(G)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(K))||/\bAndroid\b/.test(W)&&/^Chrome/.test(G)&&/\bVersion\//i.test(t)?(G="Android Browser",W=/\bAndroid\b/.test(W)?W:"Android"):"Silk"==G?(/\bMobi/i.test(t)||(W="Android",V.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&V.unshift("accelerated")):"UC Browser"==G&&/\bUCWEB\b/.test(t)?V.push("speed mode"):"PaleMoon"==G&&(_=/\bFirefox\/([\d.]+)\b/.exec(t))?V.push("identifying as Firefox "+_[1]):"Firefox"==G&&(_=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(W||(W="Firefox OS"),K||(K=_[1])):!G||(_=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(G))?(G&&!K&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(_+"/")+8))&&(G=null),(_=K||q||W)&&(K||q||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(W))&&(G=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(W)?W:_)+" Browser")):"Electron"==G&&(_=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&V.push("Chromium "+_),B||(B=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(G),"(?:Firefox|Minefield|NetFront)"])),(_=("iCab"==H&&parseFloat(B)>3?"WebKit":/\bOpera\b/.test(G)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(H)&&"WebKit"||!H&&/\bMSIE\b/i.test(t)&&("Mac OS"==W?"Tasman":"Trident")||"WebKit"==H&&/\bPlayStation\b(?! Vita\b)/i.test(G)&&"NetFront")&&(H=[_]),"IE"==G&&(_=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(G+=" Mobile",W="Windows Phone "+(/\+$/.test(_)?_:_+".x"),V.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(G="IE Mobile",W="Windows Phone 8.x",V.unshift("desktop mode"),B||(B=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=G&&"Trident"==H&&(_=/\brv:([\d.]+)/.exec(t))&&(G&&V.push("identifying as "+G+(B?" "+B:"")),G="IE",B=_[1]),U){if(function isHostType(t,a){var c=null!=t?typeof t[a]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(c)||"object"==c&&!t[a])}(a,"global"))if(k&&(D=(_=k.lang.System).getProperty("os.arch"),W=W||_.getProperty("os.name")+" "+_.getProperty("os.version")),w){try{B=a.require("ringo/engine").version.join("."),G="RingoJS"}catch(t){(_=a.system)&&_.global.system==a.system&&(G="Narwhal",W||(W=_[0].os||null))}G||(G="Rhino")}else"object"==typeof a.process&&!a.process.browser&&(_=a.process)&&("object"==typeof _.versions&&("string"==typeof _.versions.electron?(V.push("Node "+_.versions.node),G="Electron",B=_.versions.electron):"string"==typeof _.versions.nw&&(V.push("Chromium "+B,"Node "+_.versions.node),G="NW.js",B=_.versions.nw)),G||(G="Node.js",D=_.arch,W=_.platform,B=(B=/[\d.]+/.exec(_.version))?B[0]:null));else getClassOf(_=a.runtime)==C?(G="Adobe AIR",W=_.flash.system.Capabilities.os):getClassOf(_=a.phantom)==M?(G="PhantomJS",B=(_=_.version||null)&&_.major+"."+_.minor+"."+_.patch):"number"==typeof A.documentMode&&(_=/\bTrident\/(\d+)/i.exec(t))?(B=[B,A.documentMode],(_=+_[1]+4)!=B[1]&&(V.push("IE "+B[1]+" mode"),H&&(H[1]=""),B[1]=_),B="IE"==G?String(B[1].toFixed(1)):B[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(G)&&(V.push("masking as "+G+" "+B),G="IE",B="11.0",H=["Trident"],W="Windows");W=W&&format(W)}if(B&&(_=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(B)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(U&&m.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(j=/b/i.test(_)?"beta":"alpha",B=B.replace(RegExp(_+"\\+?$"),"")+("beta"==j?x:N)+(/\d+\+?/.exec(_)||"")),"Fennec"==G||"Firefox"==G&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(W))G="Firefox Mobile";else if("Maxthon"==G&&B)B=B.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(K))"Xbox 360"==K&&(W=null),"Xbox 360"==K&&/\bIEMobile\b/.test(t)&&V.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(G)&&(!G||K||/Browser|Mobi/.test(G))||"Windows CE"!=W&&!/Mobi/i.test(t))if("IE"==G&&U)try{null===a.external&&V.unshift("platform preview")}catch(t){V.unshift("embedded")}else(/\bBlackBerry\b/.test(K)||/\bBB10\b/.test(t))&&(_=(RegExp(K.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||B)?(W=((_=[_,/BB10/.test(t)])[1]?(K=null,q="BlackBerry"):"Device Software")+" "+_[0],B=null):this!=forOwn&&"Wii"!=K&&(U&&P||/Opera/.test(G)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==G&&/\bOS X (?:\d+\.){2,}/.test(W)||"IE"==G&&(W&&!/^Win/.test(W)&&B>5.5||/\bWindows XP\b/.test(W)&&B>8||8==B&&!/\bTrident\b/.test(t)))&&!b.test(_=parse.call(forOwn,t.replace(b,"")+";"))&&_.name&&(_="ing as "+_.name+((_=_.version)?" "+_:""),b.test(G)?(/\bIE\b/.test(_)&&"Mac OS"==W&&(W=null),_="identify"+_):(_="mask"+_,G=L?format(L.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(_)&&(W=null),U||(B=null)),H=["Presto"],V.push(_));else G+=" Mobile";(_=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(_=[parseFloat(_.replace(/\.(\d)$/,".0$1")),_],"Safari"==G&&"+"==_[1].slice(-1)?(G="WebKit Nightly",j="alpha",B=_[1].slice(0,-1)):B!=_[1]&&B!=(_[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(B=null),_[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==_[0]&&537.36==_[2]&&parseFloat(_[1])>=28&&"WebKit"==H&&(H=["Blink"]),U&&(O||_[1])?(H&&(H[1]="like Chrome"),_=_[1]||((_=_[0])<530?1:_<532?2:_<532.05?3:_<533?4:_<534.03?5:_<534.07?6:_<534.1?7:_<534.13?8:_<534.16?9:_<534.24?10:_<534.3?11:_<535.01?12:_<535.02?"13+":_<535.07?15:_<535.11?16:_<535.19?17:_<536.05?18:_<536.1?19:_<537.01?20:_<537.11?"21+":_<537.13?23:_<537.18?24:_<537.24?25:_<537.36?26:"Blink"!=H?"27":"28")):(H&&(H[1]="like Safari"),_=(_=_[0])<400?1:_<500?2:_<526?3:_<533?4:_<534?"4+":_<535?5:_<537?6:_<538?7:_<601?8:_<602?9:_<604?10:_<606?11:_<608?12:"12"),H&&(H[1]+=" "+(_+="number"==typeof _?".x":/[.+]/.test(_)?"":"+")),"Safari"==G&&(!B||parseInt(B)>45)?B=_:"Chrome"==G&&/\bHeadlessChrome/i.test(t)&&V.unshift("headless")),"Opera"==G&&(_=/\bzbov|zvav$/.exec(W))?(G+=" ",V.unshift("desktop mode"),"zvav"==_?(G+="Mini",B=null):G+="Mobile",W=W.replace(RegExp(" *"+_+"$"),"")):"Safari"==G&&/\bChrome\b/.exec(H&&H[1])?(V.unshift("desktop mode"),G="Chrome Mobile",B=null,/\bOS X\b/.test(W)?(q="Apple",W="iOS 4.3+"):W=null):/\bSRWare Iron\b/.test(G)&&!B&&(B=getVersion("Chrome")),B&&0==B.indexOf(_=/[\d.]+$/.exec(W))&&t.indexOf("/"+_+"-")>-1&&(W=trim(W.replace(_,""))),W&&-1!=W.indexOf(G)&&!RegExp(G+" OS").test(W)&&(W=W.replace(RegExp(" *"+qualify(G)+" *"),"")),H&&!/\b(?:Avant|Nook)\b/.test(G)&&(/Browser|Lunascape|Maxthon/.test(G)||"Safari"!=G&&/^iOS/.test(W)&&/\bSafari\b/.test(H[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(G)&&H[1])&&(_=H[H.length-1])&&V.push(_),V.length&&(V=["("+V.join("; ")+")"]),q&&K&&K.indexOf(q)<0&&V.push("on "+q),K&&V.push((/^on /.test(V[V.length-1])?"":"on ")+K),W&&(_=/ ([\d.+]+)$/.exec(W),E=_&&"/"==W.charAt(W.length-_[0].length-1),W={architecture:32,family:_&&!E?W.replace(_[0],""):W,version:_?_[1]:null,toString:function(){var t=this.version;return this.family+(t&&!E?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(_=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(D))&&!/\bi686\b/i.test(D)?(W&&(W.architecture=64,W.family=W.family.replace(RegExp(" *"+_),"")),G&&(/\bWOW64\b/i.test(t)||U&&/\w(?:86|32)$/.test(m.cpuClass||m.platform)&&!/\bWin64; x64\b/i.test(t))&&V.unshift("32-bit")):W&&/^OS X/.test(W.family)&&"Chrome"==G&&parseFloat(B)>=39&&(W.architecture=64),t||(t=null);var z={};return z.description=t,z.layout=H&&H[0],z.manufacturer=q,z.name=G,z.prerelease=j,z.product=K,z.ua=t,z.version=G&&B,z.os=W||{architecture:null,family:null,version:null,toString:function(){return"null"}},z.parse=parse,z.toString=function toStringPlatform(){return this.description||""},z.version&&V.unshift(B),z.name&&V.unshift(G),W&&G&&(W!=String(W).split(" ")[0]||W!=G.split(" ")[0]&&!K)&&V.push(K?"("+W+")":"on "+W),V.length&&(z.description=V.join(" ")),z}();m&&g?forOwn(C,(function(t,a){m[a]=t})):h.platform=C}).call(t)})),am=Math.floor,mergeSort=function(t,a){var c=t.length,h=am(c/2);return c<8?insertionSort(t,a):merge(t,mergeSort(arraySliceSimple(t,0,h),a),mergeSort(arraySliceSimple(t,h),a),a)},insertionSort=function(t,a){for(var c,h,m=t.length,g=1;g<m;){for(h=g,c=t[g];h&&a(t[h-1],c)>0;)t[h]=t[--h];h!==g++&&(t[h]=c)}return t},merge=function(t,a,c,h){for(var m=a.length,g=c.length,_=0,E=0;_<m||E<g;)t[_+E]=_<m&&E<g?h(a[_],c[E])<=0?a[_++]:c[E++]:_<m?a[_++]:c[E++];return t},sm=mergeSort,cm=q.match(/firefox\/(\d+)/i),um=!!cm&&+cm[1],lm=/MSIE|Trident/.test(q),dm=q.match(/AppleWebKit\/(\d+)\./),fm=!!dm&&+dm[1],pm=[],hm=R(pm.sort),mm=R(pm.push),gm=fails((function(){pm.sort(void 0)})),vm=fails((function(){pm.sort(null)})),ym=arrayMethodIsStrict("sort"),_m=!fails((function(){if(Q)return Q<70;if(!(um&&um>3)){if(lm)return!0;if(fm)return fm<603;var t,a,c,h,m="";for(t=65;t<76;t++){switch(a=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:c=3;break;case 68:case 71:c=4;break;default:c=2}for(h=0;h<47;h++)pm.push({k:a+h,v:c})}for(pm.sort((function(t,a){return a.v-t.v})),h=0;h<pm.length;h++)a=pm[h].k.charAt(0),m.charAt(m.length-1)!==a&&(m+=a);return"DGBEFHACIJK"!==m}}));_export({target:"Array",proto:!0,forced:gm||!vm||!ym||!_m},{sort:function sort(t){void 0!==t&&aCallable(t);var a=toObject(this);if(_m)return void 0===t?hm(a):hm(a,t);var c,h,m=[],g=lengthOfArrayLike(a);for(h=0;h<g;h++)h in a&&mm(m,a[h]);for(sm(m,function(t){return function(a,c){return void 0===c?-1:void 0===a?1:void 0!==t?+t(a,c)||0:toString$1(a)>toString$1(c)?1:-1}}(t)),c=lengthOfArrayLike(m),h=0;h<c;)a[h]=m[h++];for(;h<g;)deletePropertyOrThrow(a,h++);return a}});var Em=entryVirtual("Array").sort,bm=Array.prototype,sort=function(t){var a=t.sort;return t===bm||K(bm,t)&&a===bm.sort?Em:a},Om=createCommonjsModule((function(t,a){self,t.exports=function(){var t={d:function d(a,c){for(var h in c)t.o(c,h)&&!t.o(a,h)&&_i(a,h,{enumerable:!0,get:c[h]})},o:function o(t,a){return Object.prototype.hasOwnProperty.call(t,a)}},a={};t.d(a,{default:function _default(){return S}});var c=function e(t){for(var a in function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=4,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.enableCache=!0,this.logger=console,this.onError=function(t){},this.onProgress=function(t){},this.onUploadProgress=function(t){},this.onComplete=function(t){},t)this[a]=t[a]};function n(t,a){var c=void 0!==nl&&il(t)||t["@@iterator"];if(!c){if(bu(t)||(c=function(t,a){if(t){var c;if("string"==typeof t)return r(t,a);var h=slice(c=Object.prototype.toString.call(t)).call(c,8,-1);return"Object"===h&&t.constructor&&(h=t.constructor.name),"Map"===h||"Set"===h?Su(t):"Arguments"===h||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?r(t,a):void 0}}(t))||a&&t&&"number"==typeof t.length){c&&(t=c);var h=0,m=function i(){};return{s:m,n:function n(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}},e:function e(t){throw t},f:m}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,_=!0,E=!1;return{s:function s(){c=c.call(t)},n:function n(){var t=c.next();return _=t.done,t},e:function e(t){E=!0,g=t},f:function f(){try{_||null==c.return||c.return()}finally{if(E)throw g}}}}function r(t,a){(null==a||a>t.length)&&(a=t.length);for(var c=0,h=new Array(a);c<a;c++)h[c]=t[c];return h}var h={privateObj:{},setItem:function setItem(t,a){h.privateObj[t]=a},getItem:function getItem(t){return h.privateObj[t]},removeItem:function removeItem(t){delete h.privateObj[t]},getKeys:function getKeys(){return Fi(h.privateObj)}},m={getFileKey:function getFileKey(t){var a=t.size.toString(),c=t.lastModified.toString();return"_NosUploader_"+t.name+slice(a).call(a,a.length-5)+slice(c).call(c,c.length-5)},getFileInfo:function getFileInfo(t){var a=h.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch(t){return null}},initFile:function initFile(t,a,c){m.clearExpiredInfo();var g=this.getFileKey(a),_={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Zn(),end:!1};return t.payload&&(_.payload=t.payload),c&&h.setItem(g,Fs(_)),g},setUploadContext:function setUploadContext(t,a,c){var m=this.getFileInfo(t);m&&(m.ctx=a,c&&h.setItem(t,Fs(m)))},setComplete:function setComplete(t,a){var c=this.getFileInfo(t);c&&(c.modifyAt=Zn(),c.end=!0,a&&h.setItem(t,Fs(c)))},getUploadContext:function getUploadContext(t){var a=this.getFileInfo(t);return a?a.ctx:""},removeFileInfo:function removeFileInfo(t){0===indexOf(t).call(t,"_NosUploader_")&&h.removeItem(t)},clearExpiredInfo:function clearExpiredInfo(){var t,a="function"==typeof h.getKeys?h.getKeys():Fi(h),c=Zn(),g=[],_=n(a);try{for(_.s();!(t=_.n()).done;){var E=t.value;if(0===indexOf(E).call(E,"_NosUploader_")){var b=m.getFileInfo(E);null===b||c-b.modifyAt>S.expireTime?h.removeItem(E):g.push({fileInfo:b,key:E})}}}catch(t){_.e(t)}finally{_.f()}if(g.length>S.maxFileCache){var O,T,C=n(slice(O=sort(g).call(g,(function(t,a){return a.fileInfo.modifyAt-t.fileInfo.modifyAt}))).call(O,S.maxFileCache));try{for(C.s();!(T=C.n()).done;){var I,R=T.value;0===indexOf(I=R.key).call(I,"_NosUploader_")&&h.removeItem(R.key)}}catch(t){C.e(t)}finally{C.f()}}}},g=m;function u(t){return(u="function"==typeof nl&&"symbol"==typeof al?function(t){return typeof t}:function(t){return t&&"function"==typeof nl&&t.constructor===nl&&t!==nl.prototype?"symbol":typeof t})(t)}function f(t,a){return!a||"object"!==u(a)&&"function"!=typeof a?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):a}function l(t){var a="function"==typeof is?new is:void 0;return(l=function l(t){var c,h;if(null===t||(h=t,-1===indexOf(c=Function.toString.call(h)).call(c,"[native code]")))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,n)}function n(){return s(t,arguments,y(this).constructor)}return n.prototype=lt(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function s(t,a,c){return(s=p()?gs:function(t,a,c){var h=[null];h.push.apply(h,a);var m=new(bind$1(Function).apply(t,h));return c&&d(m,c.prototype),m}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!gs)return!1;if(gs.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(gs(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,a){return(d=ht||function(t,a){return t.__proto__=a,t})(t,a)}function y(t){return(y=ht?ss:function(t){return t.__proto__||ss(t)})(t)}var _=function(t){!function(t,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");t.prototype=lt(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&d(t,a)}(r,t);var a,c,h=(a=r,c=p(),function(){var t,h=y(a);if(c){var m=y(this).constructor;t=gs(h,arguments,m)}else t=h.apply(this,arguments);return f(this,t)});function r(t,a){var c;return function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,r),(c=h.call(this,"NosUploadError:"+t)).errCode=a,c.errMsg=t,c}return r}(l(Error)),E=function e(t,a,c){if("uploading"===t.uploadState){var h=t.config,m=t.param,E=g.getUploadContext(t.fileKey);if(!E)return c(0);var b=new XMLHttpRequest,O=h.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName))+"?uploadContext"+"&context=".concat(E)+"&version=".concat(h.version);b.onreadystatechange=function(){var m;if("abort"!==t.uploadState&&4===b.readyState){var E,T,S,C;try{C=JSON.parse(b.responseText)}catch(t){C={errMsg:"JsonParseError in getOffset",errCode:500}}200===b.status?C.errCode?t.config.onError(new _(C.errMsg,C.errCode)):c(C.offset):b.status.toString().match(/^5/)?e(t,a-1,c):a>0?("function"==typeof(null===(m=h.logger)||void 0===m?void 0:m.error)&&h.logger.error(concat(E="getOffset(".concat(O,") error. retry after 3 seconds. ")).call(E,(new Date).toTimeString())),mi((function(){e(t,a-1,c)}),3500)):b.status?(g.removeFileInfo(t.fileKey),h.onError(new _(concat(T=concat(S="getOffset(".concat(O,") error: ")).call(S,b.status," ")).call(T,b.statusText)))):h.onError(new _("getOffset(".concat(O,") error. no Error Code")))}},b.open("get",O),b.setRequestHeader("x-nos-token",m.token),b.timeout=h.getOffsetTimeout,b.send()}},b=function e(t,a,c,h){if("uploading"===t.uploadState){var m=t.param,E=t.config,b=slice(File.prototype),O=void 0!==m.ctx?m.ctx:"",T=a+E.trunkSize>t.file.size,S=T?t.file.size:a+E.trunkSize,C=new XMLHttpRequest,I=E.directUploadAddr+"/".concat(m.bucketName)+"/".concat(encodeURIComponent(m.objectName));if(C.upload.onprogress=function(c){if("abort"!==t.uploadState){var h=0;c.lengthComputable?(h=(a+c.loaded)/t.file.size,E.onProgress(h),E.onUploadProgress({loaded:c.loaded,total:t.file.size,percentage:h,percentageText:(100*h).toFixed(2)+"%"})):E.onError(new _("browser does not support query upload progress"))}},C.onreadystatechange=function(){var m,b;if("abort"!==t.uploadState&&4===C.readyState){var O,S,R,M;try{M=JSON.parse(C.responseText)}catch(t){"function"==typeof(null===(m=E.logger)||void 0===m?void 0:m.error)&&E.logger.error("JsonParseError in uploadTrunk",t),M={errMsg:"JsonParseError in uploadTrunk"}}200===C.status?(t.setContext(M.context),T?(h(),t.setComplete()):e(t,M.offset,E.retryCount,h)):C.status.toString().match(/^5/)?c>0?e(t,a,c-1,h):(g.removeFileInfo(t.fileKey),E.onError(new _(M.errMsg,M.errCode))):c>0?("function"==typeof(null===(b=E.logger)||void 0===b?void 0:b.error)&&E.logger.error(concat(O="uploadTrunk(".concat(I,") error. retry after 3 seconds. ")).call(O,(new Date).toTimeString())),mi((function(){e(t,a,c-1,h)}),3500)):C.status?(g.removeFileInfo(t.fileKey),E.onError(new _(concat(S=concat(R="uploadTrunk(".concat(I,") error: ")).call(R,C.status," ")).call(S,C.statusText)))):E.onError(new _("uploadTrunk(".concat(I,") error. no Error Code. Please check your network")))}},C.open("post",I+"?offset=".concat(a)+"&complete=".concat(T)+"&context=".concat(O)+"&version=".concat(E.version)),C.setRequestHeader("x-nos-token",m.token),m.md5&&C.setRequestHeader("content-md5",m.md5),t.file.type&&C.setRequestHeader("content-type",t.file.type),C.timeout=E.trunkUploadTimeout,"undefined"!=typeof FileReader){var R=new FileReader;R.addEventListener("load",(function(t){var a;(null===(a=null==t?void 0:t.target)||void 0===a?void 0:a.result)instanceof ArrayBuffer&&t.target.result.byteLength>0?C.send(t.target.result):E.onError(new _("Read ArrayBuffer failed",194003))})),R.addEventListener("error",(function(t){var a=t.target.error;E.onError(new _("Read ArrayBuffer error. ".concat(a.toString()),194003))})),R.readAsArrayBuffer(b.call(t.file,a,S))}else C.send(b.call(t.file,a,S))}};function v(t,a){for(var c=0;c<a.length;c++){var h=a[c];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),_i(t,h.key,h)}}var O=function(){function e(t,a,c){!function(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=c,this.file=t,this.param=a,this.fileKey=g.initFile(a,t,this.config.enableCache),this.resume()}var t;return(t=[{key:"resume",value:function value(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var a=this.config;E(this,a.retryCount,(function(c){b(t,c,a.retryCount,(function(){t.setUploadState("ended"),"function"==typeof a.onComplete&&a.onComplete(t.param)}))}))}}},{key:"pause",value:function value(){this.setUploadState("paused")}},{key:"abort",value:function value(){"ended"!==this.uploadState&&"abort"!==this.uploadState&&(this.setUploadState("abort"),this.config.onError(new _("Upload Aborted",10499)))}},{key:"setUploadState",value:function value(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function value(t){g.setUploadContext(this.fileKey,t,this.config.enableCache),this.param.ctx=t}},{key:"setComplete",value:function value(){g.setComplete(this.fileKey,this.config.enableCache),this.setUploadState("ended")}}])&&v(e.prototype,t),e}(),T={maxFileCache:1/0,expireTime:864e5,getFileUploadInformation:function getFileUploadInformation(t){var a=g.getFileKey(t),c=g.getFileInfo(a);return null===c?null:Zn()-c.modifyAt>T.expireTime?(g.removeFileInfo(a),null):{uploadInfo:wt({bucketName:c.bucket,objectName:c.obj,token:c.token,ctx:c.ctx},c.payload?{payload:c.payload}:{}),complete:c.end}},setMaxFileCache:function setMaxFileCache(t){T.maxFileCache=t},setExpireTime:function setExpireTime(t){T.expireTime=t},printCaches:function printCaches(){if("undefined"!=typeof localStorage)for(var t=0,a=Fi(localStorage);t<a.length;t++){var c=a[t],h=g.getFileInfo(c);h&&console.log(h,"modifiedAt",new Date(h.modifyAt).toTimeString())}},createConfig:function createConfig(t){return new c(t)},createTask:function createTask(t,a,c){return new O(t,a,c)}},S=T;return a.default}()})),Tm=createCommonjsModule((function(t,a){t.exports=function(){function object2String(t){if(t){var a,c="";return forEach$1(a=Fi(t)).call(a,(function(a,h){c+=0===h?"?":"&",c+=a+"="+t[a]})),c}return""}var t=function(t){function V2NIMError(a,c,h,m){var g;return(g=t.call(this,h)||this).source=a,g.code=c,g.desc=h,g.detail=m||{},g}return St(V2NIMError,t),V2NIMError}(Es(Error));function request(a,c){void 0===c&&(c={dataType:"json",method:"GET",timeout:5e3});var h="text"===c.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8",m="GET"===c.method?object2String(c.params):"";return new Xn((function(g,_){if(window.XMLHttpRequest){var E,b=new XMLHttpRequest;if(b.onreadystatechange=function(){if(4===b.readyState)if(200===b.status){try{E=JSON.parse(b.response||"{}")}catch(t){E=b.response}g({status:b.status,data:E})}else mi((function(){_(new t(1,b.status,"readyState: "+b.readyState+"; statusText: "+b.statusText))}),0)},b.open(c.method,""+a+m),b.timeout=c.timeout||5e3,b.setRequestHeader("Content-Type",h),c.headers)for(var O in c.headers)b.setRequestHeader(O,c.headers[O]);b.ontimeout=function(a){_(new t(1,408,a&&a.message?a.message:"request timeout"))},b.send(Fs(c.data))}else _(new t(2,10400,"request no suppout"))}))}return request}()})),Sm=console;var Cm=null,Im=null,Rm={setLogger:function setLogger(t){Sm=t},platform:"BROWSER",localStorage:window.localStorage,request:Tm,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,hl.mark((function _callee(){var a,c,h,m,g,_;return hl.wrap((function _callee$(E){for(;;)switch(E.prev=E.next){case 0:if(t.fileInput||t.file){E.next=2;break}throw new Error("File not exist");case 2:if(!t.file){E.next=6;break}m=t.file,E.next=20;break;case 6:if("string"!=typeof t.fileInput){E.next=15;break}if(!((g=document.getElementById(t.fileInput))&&g.files&&g.files[0])){E.next=12;break}m=g.files[0],E.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:E.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){E.next=19;break}m=t.fileInput.files[0],E.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&m.size>t.maxSize)){E.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+m.size);case 22:return E.next=24,new Xn((function(a,c){var h,g=Om.getFileUploadInformation(m),_=Om.createConfig({enableCache:!0,retryCount:0,directUploadAddr:t.chunkUploadHost,onError:function onError(t){c(t)},onUploadProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){a(t)}});if(g)if(g.complete)a(g.uploadInfo);else{h=Om.createTask(m,g.uploadInfo,_);try{t.onUploadStart&&t.onUploadStart(h)}catch(t){Sm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),h.abort(),c(t)}}else{h=Om.createTask(m,wt(wt({bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},t.md5?{md5:t.md5}:{}),t.payload?{payload:t.payload}:{}),_);try{t.onUploadStart&&t.onUploadStart(h)}catch(t){Sm.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),h.abort(),c(t)}}}));case 24:return(_=E.sent).name=m.name,_.size=m.size,_.type=m.type,_.ext=lastIndexOf(a=_.name).call(a,".")>-1?slice(c=_.name).call(c,lastIndexOf(h=_.name).call(h,".")+1).toLowerCase():"",E.abrupt("return",_);case 30:case"end":return E.stop()}}),_callee)})))},getFileUploadInformation:function getFileUploadInformation(t){var a;if(t.file)a=t.file;else if("string"==typeof t.fileInput){var c=document.getElementById(t.fileInput);if(!(c&&c.files&&c.files[0]))throw new Error("Can not get file from fileInput");a=c.files[0]}else{if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0]))throw new Error("Can not get file from fileInput "+t.fileInput);a=t.fileInput.files[0]}return Om.getFileUploadInformation(a)},getSystemInfo:function getSystemInfo(){var t,a,c=im.version||"";if(isElectron())try{var h=navigator.userAgent.match(/Electron\/([\d.]+\d+)/);h&&h[1]&&"string"==typeof h[1]&&(c=h[1])}catch(t){}return{os:(null===(t=im.os)||void 0===t?void 0:t.family)||"",osVer:(null===(a=im.os)||void 0===a?void 0:a.version)||"",browser:im.name||"",browserVer:im.version||"",libEnv:"BROWSER",hostEnv:isElectron()?"Electron":isMobile()?"H5":isBrowser()?"BROWSER":"Unset",hostEnvEnum:isElectron()?Ud.Electron:isMobile()?Ud.H5:isBrowser()?Ud.BROWSER:Ud.Unset,hostEnvVer:c,userAgent:navigator&&navigator.userAgent,model:c,manufactor:im.name||""}},net:{getNetworkStatus:function getNetworkStatus(){return Xn.resolve({net_type:Bd.kStatNetTypeUnkonw,net_connect:"undefined"==typeof navigator||"boolean"!=typeof navigator.onLine||navigator.onLine})},onNetworkStatusChange:function onNetworkStatusChange(t){Cm=function onlineListener(){t({isConnected:!0,networkType:Bd.kStatNetTypeUnkonw})},Im=function offlineListener(){t({isConnected:!1,networkType:Bd.kStatNetTypeUnkonw})},window.addEventListener("online",Cm),window.addEventListener("offline",Im)},offNetworkStatusChange:function offNetworkStatusChange(){Cm&&window.removeEventListener("online",Cm),Im&&window.removeEventListener("offline",Im),Cm=null,Im=null}}};return function setAdapters(t){Vd(Qd,t)}(Rm),nm}));
|