/*! For license information please see app.js.LICENSE.txt */ !function(){var V,$,z,X,Z,ee,ae,ie={"7210":function(V,$,z){"use strict";z.d($,{"mv":function(){return Xn},"AA":function(){return Un},"yM":function(){return createEvent},"h":function(){return h},"GH":function(){return proxyCustomElement}});const X=!1,Z=!0,ee=!1,ae=!0,ie=!0,ce=!0,le=!0,de=!0,pe=!0,fe=!0,ye=!0,_e=!0,Se=!0,Te=!0,He=!0,Qe=!1,ze=!0,bt=!0,At=!0,Mt=!0,St=!0,Tt=!0,kt=!0,Ct=!0,wt=!0,Ot=!0,Nt=!0,Pt=!0,Rt=!0,Lt=!0,Gt=!0,xt=!0,Ft=!0,Ut=!0,Bt=!0,jt=!0,qt=!0,Vt=!0,Ht=!0,$t=!0,Kt=!0,Qt=!0,zt=!0,Wt=!0,Yt=!1,Xt=!1,Jt=!1,Zt=!1,en=!1,tn=!1,nn=!1,rn=!1,on=!1,an=!0,sn=!1,un=!0,cn=!1,ln=!0,dn=!0,pn=!0,fn=!1,hn=!0,gn=!0,mn=!0,vn=!1,yn=!1,_n=!1,bn=!0,An="app";let Mn,Sn,Tn,In,kn=0,En=!1,Cn=!1,wn=!1,Dn=!1,On=null,Nn=0,Pn=!1;const createTime=(V,$="")=>{if(on&&performance.mark){const z=`st:${V}:${$}:${kn++}`;return performance.mark(z),()=>performance.measure(`[Stencil] ${V}() <${$}>`,z)}return()=>{}},Rn="s-id",Ln="sty-id",Gn="c-id",xn="http://www.w3.org/1999/xlink",Fn={},isComplexType=V=>"object"===(V=typeof V)||"function"===V;function queryNonceMetaTagContent(V){var $,z,X;return null!==(X=null===(z=null===($=V.head)||void 0===$?void 0:$.querySelector('meta[name="csp-nonce"]'))||void 0===z?void 0:z.getAttribute("content"))&&void 0!==X?X:void 0}const h=(V,$,...z)=>{let X=null,Z=null,ee=null,ae=!1,ie=!1;const ce=[],walk=$=>{for(let z=0;z<$.length;z++)X=$[z],Array.isArray(X)?walk(X):null!=X&&"boolean"!=typeof X&&((ae="function"!=typeof V&&!isComplexType(X))?X=String(X):Jt&&"function"!=typeof V&&void 0===X.$flags$&&consoleDevError("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),ae&&ie?ce[ce.length-1].$text$+=X:ce.push(ae?newVNode(null,X):X),ie=ae)};if(walk(z),$&&(Jt&&"input"===V&&validateInputProperties($),jt&&$.key&&(Z=$.key),an&&$.name&&(ee=$.name),Ut)){const V=$.className||$.class;V&&($.class="object"!=typeof V?V:Object.keys(V).filter(($=>V[$])).join(" "))}if(Jt&&ce.some(isHost)&&consoleDevError("The must be the single root component. Make sure:\n- You are NOT using hostData() and in the same component.\n- is used once, and it's the single root component of the render() function."),Bt&&"function"==typeof V)return V(null===$?{}:$,ce,Bn);const le=newVNode(V,null);return le.$attrs$=$,ce.length>0&&(le.$children$=ce),jt&&(le.$key$=Z),an&&(le.$name$=ee),le},newVNode=(V,$)=>{const z={"$flags$":0,"$tag$":V,"$text$":$,"$elm$":null,"$children$":null};return xt&&(z.$attrs$=null),jt&&(z.$key$=null),an&&(z.$name$=null),z},Un={},isHost=V=>V&&V.$tag$===Un,Bn={"forEach":(V,$)=>V.map(convertToPublic).forEach($),"map":(V,$)=>V.map(convertToPublic).map($).map(convertToPrivate)},convertToPublic=V=>({"vattrs":V.$attrs$,"vchildren":V.$children$,"vkey":V.$key$,"vname":V.$name$,"vtag":V.$tag$,"vtext":V.$text$}),convertToPrivate=V=>{if("function"==typeof V.vtag){const $=Object.assign({},V.vattrs);return V.vkey&&($.key=V.vkey),V.vname&&($.name=V.vname),h(V.vtag,$,...V.vchildren||[])}const $=newVNode(V.vtag,V.vtext);return $.$attrs$=V.vattrs,$.$children$=V.vchildren,$.$key$=V.vkey,$.$name$=V.vname,$},validateInputProperties=V=>{const $=Object.keys(V),z=$.indexOf("value");if(-1===z)return;const X=$.indexOf("type"),Z=$.indexOf("min"),ee=$.indexOf("max"),ae=$.indexOf("step");(z should be set after "min", "max", "type" and "step"')},clientHydrate=(V,$,z,X,Z,ee,ae)=>{let ie,ce,le,de;if(1===ee.nodeType){for(ie=ee.getAttribute(Gn),ie&&(ce=ie.split("."),ce[0]!==ae&&"0"!==ce[0]||(le={"$flags$":0,"$hostId$":ce[0],"$nodeId$":ce[1],"$depth$":ce[2],"$index$":ce[3],"$tag$":ee.tagName.toLowerCase(),"$elm$":ee,"$attrs$":null,"$children$":null,"$key$":null,"$name$":null,"$text$":null},$.push(le),ee.removeAttribute(Gn),V.$children$||(V.$children$=[]),V.$children$[le.$index$]=le,V=le,X&&"0"===le.$depth$&&(X[le.$index$]=le.$elm$))),de=ee.childNodes.length-1;de>=0;de--)clientHydrate(V,$,z,X,Z,ee.childNodes[de],ae);if(ee.shadowRoot)for(de=ee.shadowRoot.childNodes.length-1;de>=0;de--)clientHydrate(V,$,z,X,Z,ee.shadowRoot.childNodes[de],ae)}else if(8===ee.nodeType)ce=ee.nodeValue.split("."),ce[1]!==ae&&"0"!==ce[1]||(ie=ce[0],le={"$flags$":0,"$hostId$":ce[1],"$nodeId$":ce[2],"$depth$":ce[3],"$index$":ce[4],"$elm$":ee,"$attrs$":null,"$children$":null,"$key$":null,"$name$":null,"$tag$":null,"$text$":null},"t"===ie?(le.$elm$=ee.nextSibling,le.$elm$&&3===le.$elm$.nodeType&&(le.$text$=le.$elm$.textContent,$.push(le),ee.remove(),V.$children$||(V.$children$=[]),V.$children$[le.$index$]=le,X&&"0"===le.$depth$&&(X[le.$index$]=le.$elm$))):le.$hostId$===ae&&("s"===ie?(le.$tag$="slot",ce[5]?ee["s-sn"]=le.$name$=ce[5]:ee["s-sn"]="",ee["s-sr"]=!0,wt&&X&&(le.$elm$=Yn.createElement(le.$tag$),le.$name$&&le.$elm$.setAttribute("name",le.$name$),ee.parentNode.insertBefore(le.$elm$,ee),ee.remove(),"0"===le.$depth$&&(X[le.$index$]=le.$elm$)),z.push(le),V.$children$||(V.$children$=[]),V.$children$[le.$index$]=le):"r"===ie&&(wt&&X?ee.remove():an&&(Z["s-cr"]=ee,ee["s-cn"]=!0))));else if(V&&"style"===V.$tag$){const $=newVNode(null,ee.textContent);$.$elm$=ee,$.$index$="0",V.$children$=[$]}},initializeDocumentHydrate=(V,$)=>{if(1===V.nodeType){let z=0;for(;zzn.map(($=>$(V))).find((V=>!!V)),createEvent=(V,$,z)=>{const X=(V=>rn?getHostRef(V).$hostElement$:V)(V);return{"emit":V=>(Jt&&!X.isConnected&&consoleDevWarn(`The "${$}" event was emitted, but the dispatcher node is no longer connected to the dom.`),emitEvent(X,$,{"bubbles":!!(4&z),"composed":!!(2&z),"cancelable":!!(1&z),"detail":V}))}},emitEvent=(V,$,z)=>{const X=Jn.ce($,z);return V.dispatchEvent(X),X},jn=new WeakMap,registerStyle=(V,$,z)=>{let X=Qn.get(V);tr&&z?(X=X||new CSSStyleSheet,"string"==typeof X?X=$:X.replaceSync($)):X=$,Qn.set(V,X)},addStyle=(V,$,z,X)=>{var Z;let ee=getScopeId($,z);const ae=Qn.get(ee);if(!bn)return ee;if(V=11===V.nodeType?V:Yn,ae)if("string"==typeof ae){V=V.head||V;let z,ie=jn.get(V);if(ie||jn.set(V,ie=new Set),!ie.has(ee)){if(tn&&V.host&&(z=V.querySelector(`[${Ln}="${ee}"]`)))z.innerHTML=ae;else{if(fn&&Jn.$cssShim$){z=Jn.$cssShim$.createHostStyle(X,ee,ae,!!(10&$.$flags$));const V=z["s-sc"];V&&(ee=V,ie=null)}else z=Yn.createElement("style"),z.innerHTML=ae;const ce=null!==(Z=Jn.$nonce$)&&void 0!==Z?Z:queryNonceMetaTagContent(Yn);null!=ce&&z.setAttribute("nonce",ce),(en||Yt)&&z.setAttribute(Ln,ee),V.insertBefore(z,V.querySelector("link"))}ie&&ie.add(ee)}}else hn&&!V.adoptedStyleSheets.includes(ae)&&(V.adoptedStyleSheets=[...V.adoptedStyleSheets,ae]);return ee},attachStyles=V=>{const $=V.$cmpMeta$,z=V.$hostElement$,X=$.$flags$,Z=createTime("attachStyles",$.$tagName$),ee=addStyle(wt&&Zn&&z.shadowRoot?z.shadowRoot:z.getRootNode(),$,V.$modeName$,z);(wt||Ct)&&Nt&&10&X&&(z["s-sc"]=ee,z.classList.add(ee+"-h"),Ct&&2&X&&z.classList.add(ee+"-s")),Z()},getScopeId=(V,$)=>"sc-"+(Mt&&$&&32&V.$flags$?V.$tagName$+"-"+$:V.$tagName$),setAccessor=(V,$,z,X,Z,ee)=>{if(z!==X){let ae=isMemberInElement(V,$),ie=$.toLowerCase();if(Ut&&"class"===$){const $=V.classList,Z=parseClassList(z),ee=parseClassList(X);$.remove(...Z.filter((V=>V&&!ee.includes(V)))),$.add(...ee.filter((V=>V&&!Z.includes(V))))}else if(Kt&&"style"===$){if(Gt)for(const $ in z)X&&null!=X[$]||(!en&&$.includes("-")?V.style.removeProperty($):V.style[$]="");for(const $ in X)z&&X[$]===z[$]||(!en&&$.includes("-")?V.style.setProperty($,X[$]):V.style[$]=X[$])}else if(jt&&"key"===$);else if(Vt&&"ref"===$)X&&X(V);else if(!qt||(rn?ae:V.__lookupSetter__($))||"o"!==$[0]||"n"!==$[1]){if(Ht){const ce=isComplexType(X);if((ae||ce&&null!==X)&&!Z)try{if(V.tagName.includes("-"))V[$]=X;else{const Z=null==X?"":X;"list"===$?ae=!1:null!=z&&V[$]==Z||(V[$]=Z)}}catch(V){}let le=!1;Ft&&ie!==(ie=ie.replace(/^xlink\:?/,""))&&($=ie,le=!0),null==X||!1===X?!1===X&&""!==V.getAttribute($)||(Ft&&le?V.removeAttributeNS(xn,$):V.removeAttribute($)):(!ae||4&ee||Z)&&!ce&&(X=!0===X?"":X,Ft&&le?V.setAttributeNS(xn,$,X):V.setAttribute($,X))}}else $="-"===$[2]?$.slice(3):isMemberInElement(Wn,ie)?ie.slice(2):ie[2]+$.slice(3),z&&Jn.rel(V,$,z,!1),X&&Jn.ael(V,$,X,!1)}},qn=/\s/,parseClassList=V=>V?V.split(qn):[],updateElement=(V,$,z,X)=>{const Z=11===$.$elm$.nodeType&&$.$elm$.host?$.$elm$.host:$.$elm$,ee=V&&V.$attrs$||Fn,ae=$.$attrs$||Fn;if(Gt)for(X in ee)X in ae||setAccessor(Z,X,ee[X],void 0,z,$.$flags$);for(X in ae)setAccessor(Z,X,ee[X],ae[X],z,$.$flags$)},createElm=(V,$,z,X)=>{const Z=$.$children$[z];let ee,ae,ie,ce=0;if(an&&!En&&(wn=!0,"slot"===Z.$tag$&&(Mn&&X.classList.add(Mn+"-s"),Z.$flags$|=Z.$children$?2:1)),Jt&&Z.$elm$&&consoleDevError(`The JSX ${null!==Z.$text$?`"${Z.$text$}" text`:`"${Z.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),Qt&&null!==Z.$text$)ee=Z.$elm$=Yn.createTextNode(Z.$text$);else if(an&&1&Z.$flags$)ee=Z.$elm$=Xt||en?slotReferenceDebugNode(Z):Yn.createTextNode("");else{if(Lt&&!Dn&&(Dn="svg"===Z.$tag$),ee=Z.$elm$=Lt?Yn.createElementNS(Dn?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",an&&2&Z.$flags$?"slot-fb":Z.$tag$):Yn.createElement(an&&2&Z.$flags$?"slot-fb":Z.$tag$),Lt&&Dn&&"foreignObject"===Z.$tag$&&(Dn=!1),xt&&updateElement(null,Z,Dn),(wt||Ct)&&null!=Mn&&ee["s-si"]!==Mn&&ee.classList.add(ee["s-si"]=Mn),Z.$children$)for(ce=0;ce{Jn.$flags$|=1;const z=V.childNodes;for(let V=z.length-1;V>=0;V--){const X=z[V];X["s-hn"]!==Tn&&X["s-ol"]&&(parentReferenceNode(X).insertBefore(X,referenceNode(X)),X["s-ol"].remove(),X["s-ol"]=void 0,wn=!0),$&&putBackInOriginalLocation(X,$)}Jn.$flags$&=-2},addVnodes=(V,$,z,X,Z,ee)=>{let ae,ie=an&&V["s-cr"]&&V["s-cr"].parentNode||V;for(wt&&ie.shadowRoot&&ie.tagName===Tn&&(ie=ie.shadowRoot);Z<=ee;++Z)X[Z]&&(ae=createElm(null,z,Z,V),ae&&(X[Z].$elm$=ae,ie.insertBefore(ae,an?referenceNode($):$)))},removeVnodes=(V,$,z,X,Z)=>{for(;$<=z;++$)(X=V[$])&&(Z=X.$elm$,callNodeRefs(X),an&&(Cn=!0,Z["s-ol"]?Z["s-ol"].remove():putBackInOriginalLocation(Z,!0)),Z.remove())},isSameVnode=(V,$)=>V.$tag$===$.$tag$&&(an&&"slot"===V.$tag$?V.$name$===$.$name$:!jt||V.$key$===$.$key$),referenceNode=V=>V&&V["s-ol"]||V,parentReferenceNode=V=>(V["s-ol"]?V["s-ol"]:V).parentNode,patch=(V,$)=>{const z=$.$elm$=V.$elm$,X=V.$children$,Z=$.$children$,ee=$.$tag$,ae=$.$text$;let ie;Qt&&null!==ae?Qt&&an&&(ie=z["s-cr"])?ie.parentNode.textContent=ae:Qt&&V.$text$!==ae&&(z.data=ae):(Lt&&(Dn="svg"===ee||"foreignObject"!==ee&&Dn),(xt||kt)&&(Ot&&"slot"===ee||updateElement(V,$,Dn)),Gt&&null!==X&&null!==Z?((V,$,z,X)=>{let Z,ee,ae=0,ie=0,ce=0,le=0,de=$.length-1,pe=$[0],fe=$[de],ye=X.length-1,_e=X[0],Se=X[ye];for(;ae<=de&&ie<=ye;)if(null==pe)pe=$[++ae];else if(null==fe)fe=$[--de];else if(null==_e)_e=X[++ie];else if(null==Se)Se=X[--ye];else if(isSameVnode(pe,_e))patch(pe,_e),pe=$[++ae],_e=X[++ie];else if(isSameVnode(fe,Se))patch(fe,Se),fe=$[--de],Se=X[--ye];else if(isSameVnode(pe,Se))!an||"slot"!==pe.$tag$&&"slot"!==Se.$tag$||putBackInOriginalLocation(pe.$elm$.parentNode,!1),patch(pe,Se),V.insertBefore(pe.$elm$,fe.$elm$.nextSibling),pe=$[++ae],Se=X[--ye];else if(isSameVnode(fe,_e))!an||"slot"!==pe.$tag$&&"slot"!==Se.$tag$||putBackInOriginalLocation(fe.$elm$.parentNode,!1),patch(fe,_e),V.insertBefore(fe.$elm$,pe.$elm$),fe=$[--de],_e=X[++ie];else{if(ce=-1,jt)for(le=ae;le<=de;++le)if($[le]&&null!==$[le].$key$&&$[le].$key$===_e.$key$){ce=le;break}jt&&ce>=0?(ee=$[ce],ee.$tag$!==_e.$tag$?Z=createElm($&&$[ie],z,ce,V):(patch(ee,_e),$[ce]=void 0,Z=ee.$elm$),_e=X[++ie]):(Z=createElm($&&$[ie],z,ie,V),_e=X[++ie]),Z&&(an?parentReferenceNode(pe.$elm$).insertBefore(Z,referenceNode(pe.$elm$)):pe.$elm$.parentNode.insertBefore(Z,pe.$elm$))}ae>de?addVnodes(V,null==X[ye+1]?null:X[ye+1].$elm$,z,X,ie,ye):Gt&&ie>ye&&removeVnodes($,ae,de)})(z,X,$,Z):null!==Z?(Gt&&Qt&&null!==V.$text$&&(z.textContent=""),addVnodes(z,null,$,Z,0,Z.length-1)):Gt&&null!==X&&removeVnodes(X,0,X.length-1),Lt&&Dn&&"svg"===ee&&(Dn=!1))},updateFallbackSlotVisibility=V=>{const $=V.childNodes;let z,X,Z,ee,ae,ie;for(X=0,Z=$.length;X{let $,z,X,Z,ee,ae,ie=0;const ce=V.childNodes,le=ce.length;for(;ie=0;ae--)z=X[ae],z["s-cn"]||z["s-nr"]||z["s-hn"]===$["s-hn"]||(isNodeLocatedInSlot(z,Z)?(ee=Vn.find((V=>V.$nodeToRelocate$===z)),Cn=!0,z["s-sn"]=z["s-sn"]||Z,ee?ee.$slotRefNode$=$:Vn.push({"$slotRefNode$":$,"$nodeToRelocate$":z}),z["s-sr"]&&Vn.map((V=>{isNodeLocatedInSlot(V.$nodeToRelocate$,z["s-sn"])&&(ee=Vn.find((V=>V.$nodeToRelocate$===z)),ee&&!V.$slotRefNode$&&(V.$slotRefNode$=ee.$slotRefNode$))}))):Vn.some((V=>V.$nodeToRelocate$===z))||Vn.push({"$nodeToRelocate$":z}));1===$.nodeType&&relocateSlotContent($)}},isNodeLocatedInSlot=(V,$)=>1===V.nodeType?null===V.getAttribute("slot")&&""===$||V.getAttribute("slot")===$:V["s-sn"]===$||""===$,callNodeRefs=V=>{Vt&&(V.$attrs$&&V.$attrs$.ref&&V.$attrs$.ref(null),V.$children$&&V.$children$.map(callNodeRefs))},renderVdom=(V,$)=>{const z=V.$hostElement$,X=V.$cmpMeta$,Z=V.$vnode$||newVNode(null,null),ee=isHost($)?$:h(null,null,$);if(Tn=z.tagName,Jt&&Array.isArray($)&&$.some(isHost))throw new Error(`The must be the single root component.\nLooks like the render() function of "${Tn.toLowerCase()}" is returning an array that contains the .\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n {content}\n );\n}\n `);if(kt&&X.$attrsToReflect$&&(ee.$attrs$=ee.$attrs$||{},X.$attrsToReflect$.map((([V,$])=>ee.$attrs$[$]=z[V]))),ee.$tag$=null,ee.$flags$|=4,V.$vnode$=ee,ee.$elm$=Z.$elm$=wt&&z.shadowRoot||z,(Ct||wt)&&(Mn=z["s-sc"]),an&&(Sn=z["s-cr"],En=Zn&&0!=(1&X.$flags$),Cn=!1),patch(Z,ee),an){if(Jn.$flags$|=1,wn){let V,$,z,X,Z,ae;relocateSlotContent(ee.$elm$);let ie=0;for(;ieYn.createComment(` (host=${Tn.toLowerCase()})`),originalLocationDebugNode=V=>Yn.createComment("org-location for "+(V.localName?`<${V.localName}> (host=${V["s-hn"]})`:`[${V.textContent}]`)),attachToAncestor=(V,$)=>{yn&&$&&!V.$onRenderResolve$&&$["s-p"]&&$["s-p"].push(new Promise(($=>V.$onRenderResolve$=$)))},scheduleUpdate=(V,$)=>{if(Wt&&Gt&&(V.$flags$|=16),yn&&4&V.$flags$)return void(V.$flags$|=512);attachToAncestor(V,V.$ancestorComponent$);const dispatch=()=>dispatchHooks(V,$);return Wt?ar(dispatch):dispatch()},dispatchHooks=(V,$)=>{const z=V.$hostElement$,X=createTime("scheduleUpdate",V.$cmpMeta$.$tagName$),Z=rn?V.$lazyInstance$:z;let ee;return $?(rn&&_e&&(V.$flags$|=256,V.$queuedListeners$&&(V.$queuedListeners$.map((([V,$])=>safeCall(Z,V,$))),V.$queuedListeners$=null)),emitLifecycleEvent(z,"componentWillLoad"),ce&&(ee=safeCall(Z,"componentWillLoad"))):(emitLifecycleEvent(z,"componentWillUpdate"),le&&(ee=safeCall(Z,"componentWillUpdate"))),emitLifecycleEvent(z,"componentWillRender"),de&&(ee=then(ee,(()=>safeCall(Z,"componentWillRender")))),X(),then(ee,(()=>updateComponent(V,Z,$)))},updateComponent=async(V,$,z)=>{const X=V.$hostElement$,Z=createTime("update",V.$cmpMeta$.$tagName$),ee=X["s-rc"];Rt&&z&&attachStyles(V);const ae=createTime("render",V.$cmpMeta$.$tagName$);if(Jt&&(V.$flags$|=1024),en?await callRender(V,$,X):callRender(V,$,X),fn&&Jn.$cssShim$&&Jn.$cssShim$.updateHost(X),Jt&&(V.$renderCount$++,V.$flags$&=-1025),en)try{serverSideConnected(X),z&&(1&V.$cmpMeta$.$flags$?X["s-en"]="":2&V.$cmpMeta$.$flags$&&(X["s-en"]="c"))}catch(V){consoleError(V,X)}if(yn&&ee&&(ee.map((V=>V())),X["s-rc"]=void 0),ae(),Z(),yn){const $=X["s-p"],postUpdate=()=>postUpdateComponent(V);0===$.length?postUpdate():(Promise.all($).then(postUpdate),V.$flags$|=4,$.length=0)}else postUpdateComponent(V)},callRender=(V,$,z)=>{const Z=!!X,ee=!!rn,ae=!!Wt,ie=!!Gt;try{if(On=$,$=(Z||$.render)&&$.render(),ie&&ae&&(V.$flags$&=-17),(ie||ee)&&(V.$flags$|=2),ye||kt)if($t||kt){if(en)return Promise.resolve($).then(($=>renderVdom(V,$)));renderVdom(V,$)}else z.textContent=$}catch($){consoleError($,V.$hostElement$)}return On=null,null},postUpdateComponent=V=>{const $=V.$cmpMeta$.$tagName$,z=V.$hostElement$,X=createTime("postUpdate",$),ee=rn?V.$lazyInstance$:z,ce=V.$ancestorComponent$;ie&&(Jt&&(V.$flags$|=1024),safeCall(ee,"componentDidRender"),Jt&&(V.$flags$&=-1025)),emitLifecycleEvent(z,"componentDidRender"),64&V.$flags$?(ae&&(Jt&&(V.$flags$|=1024),safeCall(ee,"componentDidUpdate"),Jt&&(V.$flags$&=-1025)),emitLifecycleEvent(z,"componentDidUpdate"),X()):(V.$flags$|=64,yn&&Nt&&addHydratedFlag(z),Z&&(Jt&&(V.$flags$|=2048),safeCall(ee,"componentDidLoad"),Jt&&(V.$flags$&=-2049)),emitLifecycleEvent(z,"componentDidLoad"),X(),yn&&(V.$onReadyResolve$(z),ce||appDidLoad($))),Yt&&z["s-hmr-load"]&&z["s-hmr-load"](),At&&rn&&V.$onInstanceResolve$(z),yn&&(V.$onRenderResolve$&&(V.$onRenderResolve$(),V.$onRenderResolve$=void 0),512&V.$flags$&&nextTick((()=>scheduleUpdate(V,!1))),V.$flags$&=-517)},appDidLoad=V=>{Nt&&addHydratedFlag(Yn.documentElement),_n&&(Jn.$flags$|=2),nextTick((()=>emitEvent(Wn,"appload",{"detail":{"namespace":An}}))),on&&performance.measure&&performance.measure(`[Stencil] ${An} initial load (by ${V})`,"st:app:start")},safeCall=(V,$,z)=>{if(V&&V[$])try{return V[$](z)}catch(V){consoleError(V)}},then=(V,$)=>V&&V.then?V.then($):$(),emitLifecycleEvent=(V,$)=>{nn&&emitEvent(V,"stencil_"+$,{"bubbles":!0,"composed":!0,"detail":{"namespace":An}})},addHydratedFlag=V=>un?V.classList.add("hydrated"):sn?V.setAttribute("hydrated",""):void 0,serverSideConnected=V=>{const $=V.children;if(null!=$)for(let V=0,z=$.length;V{const Z=getHostRef(V),ee=rn?Z.$hostElement$:V,ae=Z.$instanceValues$.get($),ie=Z.$flags$,ce=rn?Z.$lazyInstance$:ee;var le,de;le=z,de=X.$members$[$][0],z=null==le||isComplexType(le)?le:ln&&4&de?"false"!==le&&(""===le||!!le):dn&&2&de?parseFloat(le):pn&&1&de?String(le):le;const pe=Number.isNaN(ae)&&Number.isNaN(z);if((!rn||!(8&ie)||void 0===ae)&&(z!==ae&&!pe)&&(Z.$instanceValues$.set($,z),Jt&&(1024&Z.$flags$?consoleDevWarn(`The state/prop "${$}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,"\nElement",ee,"\nNew value",z,"\nOld value",ae):2048&Z.$flags$&&consoleDevWarn(`The state/prop "${$}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,"\nElement",ee,"\nNew value",z,"\nOld value",ae)),!rn||ce)){if(zt&&X.$watchers$&&128&ie){const V=X.$watchers$[$];V&&V.map((V=>{try{ce[V](z,ae,$)}catch(V){consoleError(V,ee)}}))}if(Gt&&2==(18&ie)){if(gn&&ce.componentShouldUpdate&&!1===ce.componentShouldUpdate(z,ae,$))return;scheduleUpdate(Z,!1)}}},proxyComponent=(V,$,z)=>{if(bt&&$.$members$){zt&&V.watchers&&($.$watchers$=V.watchers);const X=Object.entries($.$members$),Z=V.prototype;if(X.map((([V,[X]])=>{(Tt||Pt)&&(31&X||(!rn||2&z)&&32&X)?Object.defineProperty(Z,V,{"get"(){return $=V,getHostRef(this).$instanceValues$.get($);var $},"set"(Z){if(Jt){const Z=getHostRef(this);0==(1&z)&&0==(8&Z.$flags$)&&0!=(31&X)&&0==(1024&X)&&consoleDevWarn(`@Prop() "${V}" on <${$.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`)}setValue(this,V,Z,$)},"configurable":!0,"enumerable":!0}):rn&&At&&1&z&&64&X&&Object.defineProperty(Z,V,{"value"(...$){const z=getHostRef(this);return z.$onInstancePromise$.then((()=>z.$lazyInstance$[V](...$)))}})})),St&&(!rn||1&z)){const z=new Map;Z.attributeChangedCallback=function(V,$,X){Jn.jmp((()=>{const $=z.get(V);if(this.hasOwnProperty($))X=this[$],delete this[$];else if(Z.hasOwnProperty($)&&"number"==typeof this[$]&&this[$]==X)return;this[$]=(null!==X||"boolean"!=typeof this[$])&&X}))},V.observedAttributes=X.filter((([V,$])=>15&$[0])).map((([V,X])=>{const Z=X[1]||V;return z.set(Z,V),kt&&512&X[0]&&$.$attrsToReflect$.push([V,Z]),Z}))}}return V},initializeComponent=async(V,$,X,Z,ee)=>{if((rn||en||Rt)&&0==(32&$.$flags$)){if(rn||tn){if($.$flags$|=32,(ee=loadModule(X,$,Z)).then){const V=(ae=`st:load:${X.$tagName$}:${$.$modeName$}`,ie=`[Stencil] Load module for <${X.$tagName$}>`,on&&performance.mark?(0===performance.getEntriesByName(ae,"mark").length&&performance.mark(ae),()=>{0===performance.getEntriesByName(ie,"measure").length&&performance.measure(ie,ae)}):()=>{});ee=await ee,V()}if((Jt||Xt)&&!ee)throw new Error(`Constructor for "${X.$tagName$}#${$.$modeName$}" was not found`);bt&&!ee.isProxied&&(zt&&(X.$watchers$=ee.watchers),proxyComponent(ee,X,2),ee.isProxied=!0);const V=createTime("createInstance",X.$tagName$);bt&&($.$flags$|=8);try{new ee($)}catch(V){consoleError(V)}bt&&($.$flags$&=-9),zt&&($.$flags$|=128),V(),fireConnectedCallback($.$lazyInstance$)}else ee=V.constructor,$.$flags$|=32,customElements.whenDefined(X.$tagName$).then((()=>$.$flags$|=128));if(Rt&&ee.style){let Z=ee.style;Mt&&"string"!=typeof Z&&(Z=Z[$.$modeName$=computeMode(V)],en&&$.$modeName$&&V.setAttribute("s-mode",$.$modeName$));const ae=getScopeId(X,$.$modeName$);if(!Qn.has(ae)){const V=createTime("registerStyles",X.$tagName$);!en&&wt&&cn&&8&X.$flags$&&(Z=await z.e(576).then(z.bind(z,576)).then((V=>V.scopeCss(Z,ae,!1)))),registerStyle(ae,Z,!!(1&X.$flags$)),V()}}}var ae,ie;const ce=$.$ancestorComponent$,schedule=()=>scheduleUpdate($,!0);yn&&ce&&ce["s-rc"]?ce["s-rc"].push(schedule):schedule()},fireConnectedCallback=V=>{rn&&pe&&safeCall(V,"connectedCallback")},connectedCallback=V=>{if(0==(1&Jn.$flags$)){const $=getHostRef(V),z=$.$cmpMeta$,X=createTime("connectedCallback",z.$tagName$);if(Qe&&addHostEventListeners(V,$,z.$listeners$,!0),1&$.$flags$)addHostEventListeners(V,$,z.$listeners$,!1),fireConnectedCallback($.$lazyInstance$);else{let X;if($.$flags$|=1,tn&&(X=V.getAttribute(Rn),X)){if(wt&&Zn&&1&z.$flags$){const $=Mt?addStyle(V.shadowRoot,z,V.getAttribute("s-mode")):addStyle(V.shadowRoot,z);V.classList.remove($+"-h",$+"-s")}((V,$,z,X)=>{const Z=createTime("hydrateClient",$),ee=V.shadowRoot,ae=[],ie=wt&&ee?[]:null,ce=X.$vnode$=newVNode($,null);Jn.$orgLocNodes$||initializeDocumentHydrate(Yn.body,Jn.$orgLocNodes$=new Map),V[Rn]=z,V.removeAttribute(Rn),clientHydrate(ce,ae,[],ie,V,V,z),ae.map((V=>{const z=V.$hostId$+"."+V.$nodeId$,X=Jn.$orgLocNodes$.get(z),Z=V.$elm$;X&&Zn&&""===X["s-en"]&&X.parentNode.insertBefore(Z,X.nextSibling),ee||(Z["s-hn"]=$,X&&(Z["s-ol"]=X,Z["s-ol"]["s-nr"]=Z)),Jn.$orgLocNodes$.delete(z)})),wt&&ee&&ie.map((V=>{V&&ee.appendChild(V)})),Z()})(V,z.$tagName$,X,$)}if(an&&!X&&(en||(Ot||wt)&&12&z.$flags$)&&setContentReference(V),yn){let z=V;for(;z=z.parentNode||z.host;)if(tn&&1===z.nodeType&&z.hasAttribute("s-id")&&z["s-p"]||z["s-p"]){attachToAncestor($,$.$ancestorComponent$=z);break}}Tt&&!en&&z.$members$&&Object.entries(z.$members$).map((([$,[z]])=>{if(31&z&&V.hasOwnProperty($)){const z=V[$];delete V[$],V[$]=z}})),vn?nextTick((()=>initializeComponent(V,$,z))):initializeComponent(V,$,z)}X()}},setContentReference=V=>{const $=V["s-cr"]=Yn.createComment(Xt?`content-ref (host=${V.localName})`:"");$["s-cn"]=!0,V.insertBefore($,V.firstChild)},disconnectedCallback=V=>{if(0==(1&Jn.$flags$)){const $=getHostRef(V),z=rn?$.$lazyInstance$:V;_e&&$.$rmListeners$&&($.$rmListeners$.map((V=>V())),$.$rmListeners$=void 0),fn&&Jn.$cssShim$&&Jn.$cssShim$.removeHost(V),rn&&fe&&safeCall(z,"disconnectedCallback"),ee&&safeCall(z,"componentDidUnload")}},proxyCustomElement=(V,$)=>{const z={"$flags$":$[0],"$tagName$":$[1]};bt&&(z.$members$=$[2]),_e&&(z.$listeners$=$[3]),zt&&(z.$watchers$=V.$watchers$),kt&&(z.$attrsToReflect$=[]),wt&&!Zn&&1&z.$flags$&&(z.$flags$|=8);const X=V.prototype.connectedCallback,Z=V.prototype.disconnectedCallback;return Object.assign(V.prototype,{"__registerHost"(){registerHost(this,z)},"connectedCallback"(){connectedCallback(this),pe&&X&&X.call(this)},"disconnectedCallback"(){disconnectedCallback(this),fe&&Z&&Z.call(this)},"__attachShadow"(){Zn?mn?this.attachShadow({"mode":"open","delegatesFocus":!!(16&z.$flags$)}):this.attachShadow({"mode":"open"}):this.shadowRoot=this}}),V.is=z.$tagName$,proxyComponent(V,z,3)},addHostEventListeners=(V,$,z,X)=>{_e&&z&&(Qe&&(z=X?z.filter((([V])=>32&V)):z.filter((([V])=>!(32&V)))),z.map((([z,X,Z])=>{const ee=ze?getHostListenerTarget(V,z):V,ae=hostListenerProxy($,Z),ie=hostListenerOpts(z);Jn.ael(ee,X,ae,ie),($.$rmListeners$=$.$rmListeners$||[]).push((()=>Jn.rel(ee,X,ae,ie)))})))},hostListenerProxy=(V,$)=>z=>{try{rn?256&V.$flags$?V.$lazyInstance$[$](z):(V.$queuedListeners$=V.$queuedListeners$||[]).push([$,z]):V.$hostElement$[$](z)}catch(V){consoleError(V)}},getHostListenerTarget=(V,$)=>Te&&4&$?Yn:Se&&8&$?Wn:He&&16&$?Yn.body:Qe&&32&$?V.parentElement:V,hostListenerOpts=V=>er?{"passive":0!=(1&V),"capture":0!=(2&V)}:0!=(2&V),Hn=new WeakMap,getHostRef=V=>Hn.get(V),registerHost=(V,$)=>{const z={"$flags$":0,"$hostElement$":V,"$cmpMeta$":$,"$instanceValues$":new Map};return Jt&&(z.$renderCount$=0),At&&rn&&(z.$onInstancePromise$=new Promise((V=>z.$onInstanceResolve$=V))),yn&&(z.$onReadyPromise$=new Promise((V=>z.$onReadyResolve$=V)),V["s-p"]=[],V["s-rc"]=[]),addHostEventListeners(V,z,$.$listeners$,!1),Hn.set(V,z)},isMemberInElement=(V,$)=>$ in V,consoleError=(V,$)=>(In||console.error)(V,$),$n=Zt?["STENCIL:"]:["%cstencil","color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"],consoleDevError=(...V)=>console.error(...$n,...V),consoleDevWarn=(...V)=>console.warn(...$n,...V),Kn=new Map,loadModule=(V,$,X)=>{const Z=V.$tagName$.replace(/-/g,"_"),ee=V.$lazyBundleId$;if(Jt&&"string"!=typeof ee)return void consoleDevError(`Trying to lazily load component <${V.$tagName$}> with style mode "${$.$modeName$}", but it does not exist.`);const ae=!Yt&&Kn.get(ee);return ae?ae[Z]:z(1993)(`./${ee}.entry.js${Yt&&X?"?s-hmr="+X:""}`).then((V=>(Yt||Kn.set(ee,V),V[Z])),consoleError)},Qn=new Map,zn=[],Wn="undefined"!=typeof window?window:{},Yn=(fn&&Wn.CSS,Wn.document||{"head":{}}),Xn=Wn.HTMLElement||class{},Jn={"$flags$":0,"$resourcesUrl$":"","jmp":V=>V(),"raf":V=>requestAnimationFrame(V),"ael":(V,$,z,X)=>V.addEventListener($,z,X),"rel":(V,$,z,X)=>V.removeEventListener($,z,X),"ce":(V,$)=>new CustomEvent(V,$)},Zn=!cn||!wt||(()=>(Yn.head.attachShadow+"").indexOf("[native")>-1)(),er=(()=>{let V=!1;try{Yn.addEventListener("e",null,Object.defineProperty({},"passive",{"get"(){V=!0}}))}catch(V){}return V})(),tr=!!hn&&(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(V){}return!1})(),nr=[],rr=[],or=[],queueTask=(V,$)=>z=>{V.push(z),Pn||(Pn=!0,$&&4&Jn.$flags$?nextTick(flush):Jn.raf(flush))},consume=V=>{for(let $=0;${let z=0,X=0;for(;z{if(_n&&Nn++,consume(nr),_n){const V=2==(6&Jn.$flags$)?performance.now()+14*Math.ceil(.1*Nn):1/0;consumeTimeout(rr,V),consumeTimeout(or,V),rr.length>0&&(or.push(...rr),rr.length=0),(Pn=nr.length+rr.length+or.length>0)?Jn.raf(flush):Nn=0}else consume(rr),(Pn=nr.length>0)&&Jn.raf(flush)},nextTick=V=>{return Promise.resolve($).then(V);var $},ar=queueTask(rr,!0)},"1993":function(V){function webpackEmptyAsyncContext(V){return Promise.resolve().then((function(){var $=new Error("Cannot find module '"+V+"'");throw $.code="MODULE_NOT_FOUND",$}))}webpackEmptyAsyncContext.keys=function(){return[]},webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id=1993,V.exports=webpackEmptyAsyncContext},"6486":function(V,$,z){var X,Z;X=function(){"use strict";function _classCallCheck(V,$){if(!(V instanceof $))throw new TypeError("Cannot call a class as a function")}function _defineProperties(V,$){for(var z=0;z<$.length;z++){var X=$[z];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(V,X.key,X)}}function _createClass(V,$,z){return $&&_defineProperties(V.prototype,$),z&&_defineProperties(V,z),Object.defineProperty(V,"prototype",{"writable":!1}),V}function _inherits(V,$){if("function"!=typeof $&&null!==$)throw new TypeError("Super expression must either be null or a function");V.prototype=Object.create($&&$.prototype,{"constructor":{"value":V,"writable":!0,"configurable":!0}}),Object.defineProperty(V,"prototype",{"writable":!1}),$&&_setPrototypeOf(V,$)}function _getPrototypeOf(V){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function _getPrototypeOf(V){return V.__proto__||Object.getPrototypeOf(V)},_getPrototypeOf(V)}function _setPrototypeOf(V,$){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function _setPrototypeOf(V,$){return V.__proto__=$,V},_setPrototypeOf(V,$)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(V){return!1}}function _assertThisInitialized(V){if(void 0===V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function _possibleConstructorReturn(V,$){if($&&("object"==typeof $||"function"==typeof $))return $;if(void 0!==$)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(V)}function _createSuper(V){var $=_isNativeReflectConstruct();return function _createSuperInternal(){var z,X=_getPrototypeOf(V);if($){var Z=_getPrototypeOf(this).constructor;z=Reflect.construct(X,arguments,Z)}else z=X.apply(this,arguments);return _possibleConstructorReturn(this,z)}}function _superPropBase(V,$){for(;!Object.prototype.hasOwnProperty.call(V,$)&&null!==(V=_getPrototypeOf(V)););return V}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function _get(V,$,z){var X=_superPropBase(V,$);if(X){var Z=Object.getOwnPropertyDescriptor(X,$);return Z.get?Z.get.call(arguments.length<3?V:z):Z.value}},_get.apply(this,arguments)}var V=function(){function Emitter(){_classCallCheck(this,Emitter),Object.defineProperty(this,"listeners",{"value":{},"writable":!0,"configurable":!0})}return _createClass(Emitter,[{"key":"addEventListener","value":function addEventListener(V,$,z){V in this.listeners||(this.listeners[V]=[]),this.listeners[V].push({"callback":$,"options":z})}},{"key":"removeEventListener","value":function removeEventListener(V,$){if(V in this.listeners)for(var z=this.listeners[V],X=0,Z=z.length;X=V.length?{"done":!0}:{"done":!1,"value":V[X++]}}}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(V,$){(null==$||$>V.length)&&($=V.length);for(var z=0,X=new Array($);z<$;z++)X[z]=V[z];return X}function _defineProperties(V,$){for(var z=0;z<$.length;z++){var X=$[z];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(V,X.key,X)}}function _createClass(V,$,z){return $&&_defineProperties(V.prototype,$),z&&_defineProperties(V,z),Object.defineProperty(V,"prototype",{"writable":!1}),V}var hasSymbols=function(){return"function"==typeof Symbol},hasSymbol=function(V){return hasSymbols()&&Boolean(Symbol[V])},getSymbol=function(V){return hasSymbol(V)?Symbol[V]:"@@"+V};hasSymbols()&&!hasSymbol("observable")&&(Symbol.observable=Symbol("observable"));var Tt=getSymbol("iterator"),kt=getSymbol("observable"),Ct=getSymbol("species");function getMethod(V,$){var z=V[$];if(null!=z){if("function"!=typeof z)throw new TypeError(z+" is not a function");return z}}function getSpecies(V){var $=V.constructor;return void 0!==$&&null===($=$[Ct])&&($=void 0),void 0!==$?$:Nt}function isObservable(V){return V instanceof Nt}function hostReportError(V){hostReportError.log?hostReportError.log(V):setTimeout((function(){throw V}))}function enqueue(V){Promise.resolve().then((function(){try{V()}catch(V){hostReportError(V)}}))}function cleanupSubscription(V){var $=V._cleanup;if(void 0!==$&&(V._cleanup=void 0,$))try{if("function"==typeof $)$();else{var z=getMethod($,"unsubscribe");z&&z.call($)}}catch(V){hostReportError(V)}}function closeSubscription(V){V._observer=void 0,V._queue=void 0,V._state="closed"}function notifySubscription(V,$,z){V._state="running";var X=V._observer;try{var Z=getMethod(X,$);switch($){case"next":Z&&Z.call(X,z);break;case"error":if(closeSubscription(V),!Z)throw z;Z.call(X,z);break;case"complete":closeSubscription(V),Z&&Z.call(X)}}catch(V){hostReportError(V)}"closed"===V._state?cleanupSubscription(V):"running"===V._state&&(V._state="ready")}function onNotify(V,$,z){if("closed"!==V._state){if("buffering"!==V._state)return"ready"!==V._state?(V._state="buffering",V._queue=[{"type":$,"value":z}],void enqueue((function(){return function flushSubscription(V){var $=V._queue;if($){V._queue=void 0,V._state="ready";for(var z=0;z<$.length&&(notifySubscription(V,$[z].type,$[z].value),"closed"!==V._state);++z);}}(V)}))):void notifySubscription(V,$,z);V._queue.push({"type":$,"value":z})}}var wt=function(){function Subscription(V,$){this._cleanup=void 0,this._observer=V,this._queue=void 0,this._state="initializing";var z=new Ot(this);try{this._cleanup=$.call(void 0,z)}catch(V){z.error(V)}"initializing"===this._state&&(this._state="ready")}return Subscription.prototype.unsubscribe=function unsubscribe(){"closed"!==this._state&&(closeSubscription(this),cleanupSubscription(this))},_createClass(Subscription,[{"key":"closed","get":function(){return"closed"===this._state}}]),Subscription}(),Ot=function(){function SubscriptionObserver(V){this._subscription=V}var V=SubscriptionObserver.prototype;return V.next=function next(V){onNotify(this._subscription,"next",V)},V.error=function error(V){onNotify(this._subscription,"error",V)},V.complete=function complete(){onNotify(this._subscription,"complete")},_createClass(SubscriptionObserver,[{"key":"closed","get":function(){return"closed"===this._subscription._state}}]),SubscriptionObserver}(),Nt=function(){function Observable(V){if(!(this instanceof Observable))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof V)throw new TypeError("Observable initializer must be a function");this._subscriber=V}var V=Observable.prototype;return V.subscribe=function subscribe(V){return"object"==typeof V&&null!==V||(V={"next":V,"error":arguments[1],"complete":arguments[2]}),new wt(V,this._subscriber)},V.forEach=function forEach(V){var $=this;return new Promise((function(z,X){if("function"==typeof V)var Z=$.subscribe({"next":function($){try{V($,done)}catch(V){X(V),Z.unsubscribe()}},"error":X,"complete":z});else X(new TypeError(V+" is not a function"));function done(){Z.unsubscribe(),z()}}))},V.map=function map(V){var $=this;if("function"!=typeof V)throw new TypeError(V+" is not a function");return new(getSpecies(this))((function(z){return $.subscribe({"next":function($){try{$=V($)}catch(V){return z.error(V)}z.next($)},"error":function(V){z.error(V)},"complete":function(){z.complete()}})}))},V.filter=function filter(V){var $=this;if("function"!=typeof V)throw new TypeError(V+" is not a function");return new(getSpecies(this))((function(z){return $.subscribe({"next":function($){try{if(!V($))return}catch(V){return z.error(V)}z.next($)},"error":function(V){z.error(V)},"complete":function(){z.complete()}})}))},V.reduce=function reduce(V){var $=this;if("function"!=typeof V)throw new TypeError(V+" is not a function");var z=getSpecies(this),X=arguments.length>1,Z=!1,ee=arguments[1];return new z((function(z){return $.subscribe({"next":function($){var ae=!Z;if(Z=!0,!ae||X)try{ee=V(ee,$)}catch(V){return z.error(V)}else ee=$},"error":function(V){z.error(V)},"complete":function(){if(!Z&&!X)return z.error(new TypeError("Cannot reduce an empty sequence"));z.next(ee),z.complete()}})}))},V.concat=function concat(){for(var V=this,$=arguments.length,z=new Array($),X=0;X<$;X++)z[X]=arguments[X];var Z=getSpecies(this);return new Z((function($){var X,ee=0;return function startNext(V){X=V.subscribe({"next":function(V){$.next(V)},"error":function(V){$.error(V)},"complete":function(){ee===z.length?(X=void 0,$.complete()):startNext(Z.from(z[ee++]))}})}(V),function(){X&&(X.unsubscribe(),X=void 0)}}))},V.flatMap=function flatMap(V){var $=this;if("function"!=typeof V)throw new TypeError(V+" is not a function");var z=getSpecies(this);return new z((function(X){var Z=[],ee=$.subscribe({"next":function($){if(V)try{$=V($)}catch(V){return X.error(V)}var ee=z.from($).subscribe({"next":function(V){X.next(V)},"error":function(V){X.error(V)},"complete":function(){var V=Z.indexOf(ee);V>=0&&Z.splice(V,1),completeIfDone()}});Z.push(ee)},"error":function(V){X.error(V)},"complete":function(){completeIfDone()}});function completeIfDone(){ee.closed&&0===Z.length&&X.complete()}return function(){Z.forEach((function(V){return V.unsubscribe()})),ee.unsubscribe()}}))},V[kt]=function(){return this},Observable.from=function from(V){var $="function"==typeof this?this:Observable;if(null==V)throw new TypeError(V+" is not an object");var z=getMethod(V,kt);if(z){var X=z.call(V);if(Object(X)!==X)throw new TypeError(X+" is not an object");return isObservable(X)&&X.constructor===$?X:new $((function(V){return X.subscribe(V)}))}if(hasSymbol("iterator")&&(z=getMethod(V,Tt)))return new $((function($){enqueue((function(){if(!$.closed){for(var X,Z=_createForOfIteratorHelperLoose(z.call(V));!(X=Z()).done;){var ee=X.value;if($.next(ee),$.closed)return}$.complete()}}))}));if(Array.isArray(V))return new $((function($){enqueue((function(){if(!$.closed){for(var z=0;z0){var X=z.connection.filter?z.connection.filter:[];X.sort();var Z={};return X.forEach((function(V){Z[V]=$[V]})),"".concat(z.connection.key,"(").concat(Gt(Z),")")}return z.connection.key}var ee=V;if($){var ae=Gt($);ee+="(".concat(ae,")")}return z&&Object.keys(z).forEach((function(V){-1===Rt.indexOf(V)&&(z[V]&&Object.keys(z[V]).length?ee+="@".concat(V,"(").concat(Gt(z[V]),")"):ee+="@".concat(V))})),ee}),{"setStringify":function(V){var $=Gt;return Gt=V,$}}),Gt=function defaultStringify(V){return JSON.stringify(V,stringifyReplacer)};function stringifyReplacer(V,$){return(0,Pt.s)($)&&!Array.isArray($)&&($=Object.keys($).sort().reduce((function(V,z){return V[z]=$[z],V}),{})),$}function argumentsObjectFromField(V,$){if(V.arguments&&V.arguments.length){var z={};return V.arguments.forEach((function(V){var X=V.name,Z=V.value;return valueToObjectRepresentation(z,X,Z,$)})),z}return null}function resultKeyNameFromField(V){return V.alias?V.alias.value:V.name.value}function getTypenameFromResult(V,$,z){for(var X,Z=0,ee=$.selections;Z1)for(var X=new zt,Z=1;Z=0;--ee){var ae=Z[ee],ie=!isNaN(+ae)?[]:{};ie[ae]=$,$=ie}z=X.merge(z,$)})),z}var Wt=Object.prototype.hasOwnProperty;function parseHeaders(V){var $={};return V.split("\n").forEach((function(V){var z=V.indexOf(":");if(z>-1){var X=V.slice(0,z).trim().toLowerCase(),Z=V.slice(z+1).trim();$[X]=Z}})),$}function parseJsonBody(V,$){if(V.status>=300){throwServerError(V,function(){try{return JSON.parse($)}catch(V){return $}}(),"Response not successful: Received status code ".concat(V.status))}try{return JSON.parse($)}catch(X){var z=X;throw z.name="ServerParseError",z.response=V,z.statusCode=V.status,z.bodyText=$,z}}function handleError(V,$){var z,X;"AbortError"!==V.name&&(V.result&&V.result.errors&&V.result.data&&(null===(z=$.next)||void 0===z||z.call($,V.result)),null===(X=$.error)||void 0===X||X.call($,V))}function readJsonBody(V,$,z){(function parseAndCheckHttpResponse(V){return function($){return $.text().then((function(V){return parseJsonBody($,V)})).then((function(z){return $.status>=300&&throwServerError($,z,"Response not successful: Received status code ".concat($.status)),Array.isArray(z)||Wt.call(z,"data")||Wt.call(z,"errors")||throwServerError($,z,"Server response was missing for query '".concat(Array.isArray(V)?V.map((function(V){return V.operationName})):V.operationName,"'.")),z}))}})($)(V).then((function(V){var $,X;null===($=z.next)||void 0===$||$.call(z,V),null===(X=z.complete)||void 0===X||X.call(z)})).catch((function(V){return handleError(V,z)}))}var Yt=z(7392);const Xt=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function escapedReplacer(V){return Jt[V.charCodeAt(0)]}const Jt=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"];function print(V){return visitor_visit(V,Zt)}const Zt={"Name":{"leave":V=>V.value},"Variable":{"leave":V=>"$"+V.name},"Document":{"leave":V=>join(V.definitions,"\n\n")},"OperationDefinition":{"leave"(V){const $=wrap("(",join(V.variableDefinitions,", "),")"),z=join([V.operation,join([V.name,$]),join(V.directives," ")]," ");return("query"===z?"":z+" ")+V.selectionSet}},"VariableDefinition":{"leave":({"variable":V,"type":$,"defaultValue":z,"directives":X})=>V+": "+$+wrap(" = ",z)+wrap(" ",join(X," "))},"SelectionSet":{"leave":({"selections":V})=>block(V)},"Field":{"leave"({"alias":V,"name":$,"arguments":z,"directives":X,"selectionSet":Z}){const ee=wrap("",V,": ")+$;let ae=ee+wrap("(",join(z,", "),")");return ae.length>80&&(ae=ee+wrap("(\n",indent(join(z,"\n")),"\n)")),join([ae,join(X," "),Z]," ")}},"Argument":{"leave":({"name":V,"value":$})=>V+": "+$},"FragmentSpread":{"leave":({"name":V,"directives":$})=>"..."+V+wrap(" ",join($," "))},"InlineFragment":{"leave":({"typeCondition":V,"directives":$,"selectionSet":z})=>join(["...",wrap("on ",V),join($," "),z]," ")},"FragmentDefinition":{"leave":({"name":V,"typeCondition":$,"variableDefinitions":z,"directives":X,"selectionSet":Z})=>`fragment ${V}${wrap("(",join(z,", "),")")} on ${$} ${wrap("",join(X," ")," ")}`+Z},"IntValue":{"leave":({"value":V})=>V},"FloatValue":{"leave":({"value":V})=>V},"StringValue":{"leave":({"value":V,"block":$})=>$?(0,Yt.LZ)(V):function printString(V){return`"${V.replace(Xt,escapedReplacer)}"`}(V)},"BooleanValue":{"leave":({"value":V})=>V?"true":"false"},"NullValue":{"leave":()=>"null"},"EnumValue":{"leave":({"value":V})=>V},"ListValue":{"leave":({"values":V})=>"["+join(V,", ")+"]"},"ObjectValue":{"leave":({"fields":V})=>"{"+join(V,", ")+"}"},"ObjectField":{"leave":({"name":V,"value":$})=>V+": "+$},"Directive":{"leave":({"name":V,"arguments":$})=>"@"+V+wrap("(",join($,", "),")")},"NamedType":{"leave":({"name":V})=>V},"ListType":{"leave":({"type":V})=>"["+V+"]"},"NonNullType":{"leave":({"type":V})=>V+"!"},"SchemaDefinition":{"leave":({"description":V,"directives":$,"operationTypes":z})=>wrap("",V,"\n")+join(["schema",join($," "),block(z)]," ")},"OperationTypeDefinition":{"leave":({"operation":V,"type":$})=>V+": "+$},"ScalarTypeDefinition":{"leave":({"description":V,"name":$,"directives":z})=>wrap("",V,"\n")+join(["scalar",$,join(z," ")]," ")},"ObjectTypeDefinition":{"leave":({"description":V,"name":$,"interfaces":z,"directives":X,"fields":Z})=>wrap("",V,"\n")+join(["type",$,wrap("implements ",join(z," & ")),join(X," "),block(Z)]," ")},"FieldDefinition":{"leave":({"description":V,"name":$,"arguments":z,"type":X,"directives":Z})=>wrap("",V,"\n")+$+(hasMultilineItems(z)?wrap("(\n",indent(join(z,"\n")),"\n)"):wrap("(",join(z,", "),")"))+": "+X+wrap(" ",join(Z," "))},"InputValueDefinition":{"leave":({"description":V,"name":$,"type":z,"defaultValue":X,"directives":Z})=>wrap("",V,"\n")+join([$+": "+z,wrap("= ",X),join(Z," ")]," ")},"InterfaceTypeDefinition":{"leave":({"description":V,"name":$,"interfaces":z,"directives":X,"fields":Z})=>wrap("",V,"\n")+join(["interface",$,wrap("implements ",join(z," & ")),join(X," "),block(Z)]," ")},"UnionTypeDefinition":{"leave":({"description":V,"name":$,"directives":z,"types":X})=>wrap("",V,"\n")+join(["union",$,join(z," "),wrap("= ",join(X," | "))]," ")},"EnumTypeDefinition":{"leave":({"description":V,"name":$,"directives":z,"values":X})=>wrap("",V,"\n")+join(["enum",$,join(z," "),block(X)]," ")},"EnumValueDefinition":{"leave":({"description":V,"name":$,"directives":z})=>wrap("",V,"\n")+join([$,join(z," ")]," ")},"InputObjectTypeDefinition":{"leave":({"description":V,"name":$,"directives":z,"fields":X})=>wrap("",V,"\n")+join(["input",$,join(z," "),block(X)]," ")},"DirectiveDefinition":{"leave":({"description":V,"name":$,"arguments":z,"repeatable":X,"locations":Z})=>wrap("",V,"\n")+"directive @"+$+(hasMultilineItems(z)?wrap("(\n",indent(join(z,"\n")),"\n)"):wrap("(",join(z,", "),")"))+(X?" repeatable":"")+" on "+join(Z," | ")},"SchemaExtension":{"leave":({"directives":V,"operationTypes":$})=>join(["extend schema",join(V," "),block($)]," ")},"ScalarTypeExtension":{"leave":({"name":V,"directives":$})=>join(["extend scalar",V,join($," ")]," ")},"ObjectTypeExtension":{"leave":({"name":V,"interfaces":$,"directives":z,"fields":X})=>join(["extend type",V,wrap("implements ",join($," & ")),join(z," "),block(X)]," ")},"InterfaceTypeExtension":{"leave":({"name":V,"interfaces":$,"directives":z,"fields":X})=>join(["extend interface",V,wrap("implements ",join($," & ")),join(z," "),block(X)]," ")},"UnionTypeExtension":{"leave":({"name":V,"directives":$,"types":z})=>join(["extend union",V,join($," "),wrap("= ",join(z," | "))]," ")},"EnumTypeExtension":{"leave":({"name":V,"directives":$,"values":z})=>join(["extend enum",V,join($," "),block(z)]," ")},"InputObjectTypeExtension":{"leave":({"name":V,"directives":$,"fields":z})=>join(["extend input",V,join($," "),block(z)]," ")}};function join(V,$=""){var z;return null!==(z=null==V?void 0:V.filter((V=>V)).join($))&&void 0!==z?z:""}function block(V){return wrap("{\n",indent(join(V,"\n")),"\n}")}function wrap(V,$,z=""){return null!=$&&""!==$?V+$+z:""}function indent(V){return wrap(" ",V.replace(/\n/g,"\n "))}function hasMultilineItems(V){var $;return null!==($=null==V?void 0:V.some((V=>V.includes("\n"))))&&void 0!==$&&$}var en={"http":{"includeQuery":!0,"includeExtensions":!1,"preserveHeaderCase":!1},"headers":{"accept":"*/*","content-type":"application/json"},"options":{"method":"POST"}},defaultPrinter=function(V,$){return $(V)};function selectHttpOptionsAndBodyInternal(V,$){for(var z=[],X=2;X-1;){if(At=void 0,Nt=[fe.slice(0,bt),fe.slice(bt+pe.length)],fe=Nt[1],St=(At=Nt[0]).indexOf("\r\n\r\n"),Tt=parseHeaders(At.slice(0,St)),(kt=Tt["content-type"])&&-1===kt.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(Ct=At.slice(St))try{wt=parseJsonBody(V,Ct),Object.keys(wt).length>1||"data"in wt||"incremental"in wt||"errors"in wt||"payload"in wt?isApolloPayloadResult(wt)?(Ot={},"payload"in wt&&(Ot=(0,Mt.pi)({},wt.payload)),"errors"in wt&&(Ot=(0,Mt.pi)((0,Mt.pi)({},Ot),{"extensions":(0,Mt.pi)((0,Mt.pi)({},"extensions"in Ot?Ot.extensions:null),(Pt={},Pt[$t.YG]=wt.errors,Pt))})),null===(X=$.next)||void 0===X||X.call($,Ot)):null===(Z=$.next)||void 0===Z||Z.call($,wt):1===Object.keys(wt).length&&"hasNext"in wt&&!wt.hasNext&&(null===(ee=$.complete)||void 0===ee||ee.call($))}catch(V){handleError(V,$)}bt=fe.indexOf(pe)}return[3,1];case 3:return null===(ae=$.complete)||void 0===ae||ae.call($),[2]}}))}))}($,z):readJsonBody($,V,z)})).catch((function(V){return handleError(V,z)})),function(){ye&&ye.abort()}}))}))},nn=function(V){function HttpLink($){void 0===$&&($={});var z=V.call(this,createHttpLink($).request)||this;return z.options=$,z}return(0,Mt.ZT)(HttpLink,V),HttpLink}(Ft),rn=Ft.execute,on=z(20);const defaultMakeData=()=>Object.create(null),{"forEach":an,"slice":sn}=Array.prototype,{"hasOwnProperty":un}=Object.prototype;class Trie{"constructor"(V=!0,$=defaultMakeData){this.weakness=V,this.makeData=$}"lookup"(...V){return this.lookupArray(V)}"lookupArray"(V){let $=this;return an.call(V,(V=>$=$.getChildTrie(V))),un.call($,"data")?$.data:$.data=this.makeData(sn.call(V))}"peek"(...V){return this.peekArray(V)}"peekArray"(V){let $=this;for(let z=0,X=V.length;$&&z=0;--ee)$.definitions[ee].kind===qt.h.OPERATION_DEFINITION&&++Z;var ae=getDirectiveMatcher(V),ie=V.some((function(V){return V.remove})),shouldRemoveField=function(V){return ie&&V&&V.some(ae)},ce=new Map,le=!1,de={"enter":function(V){if(shouldRemoveField(V.directives))return le=!0,null}},pe=visitor_visit($,{"Field":de,"InlineFragment":de,"VariableDefinition":{"enter":function(){return!1}},"Variable":{"enter":function(V,$,z,X,Z){var ee=getInUse(Z);ee&&ee.variables.add(V.name.value)}},"FragmentSpread":{"enter":function(V,$,z,X,Z){if(shouldRemoveField(V.directives))return le=!0,null;var ee=getInUse(Z);ee&&ee.fragmentSpreads.add(V.name.value)}},"FragmentDefinition":{"enter":function(V,$,z,X){ce.set(JSON.stringify(X),V)},"leave":function(V,$,z,ee){return V===ce.get(JSON.stringify(ee))?V:Z>0&&V.selectionSet.selections.every((function(V){return V.kind===qt.h.FIELD&&"__typename"===V.name.value}))?(X(V.name.value).removed=!0,le=!0,null):void 0}},"Directive":{"leave":function(V){if(ae(V))return le=!0,null}}});if(!le)return $;var populateTransitiveVars=function(V){return V.transitiveVars||(V.transitiveVars=new Set(V.variables),V.removed||V.fragmentSpreads.forEach((function($){populateTransitiveVars(X($)).transitiveVars.forEach((function($){V.transitiveVars.add($)}))}))),V},fe=new Set;pe.definitions.forEach((function(V){V.kind===qt.h.OPERATION_DEFINITION?populateTransitiveVars(z(V.name&&V.name.value)).fragmentSpreads.forEach((function(V){fe.add(V)})):V.kind!==qt.h.FRAGMENT_DEFINITION||0!==Z||X(V.name.value).removed||fe.add(V.name.value)})),fe.forEach((function(V){populateTransitiveVars(X(V)).fragmentSpreads.forEach((function(V){fe.add(V)}))}));var ye={"enter":function(V){if($=V.name.value,!fe.has($)||X($).removed)return null;var $}};return nullIfDocIsEmpty(visitor_visit(pe,{"FragmentSpread":ye,"FragmentDefinition":ye,"OperationDefinition":{"leave":function(V){if(V.variableDefinitions){var $=populateTransitiveVars(z(V.name&&V.name.value)).transitiveVars;if($.size0},ObservableQuery.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(V){return V.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},ObservableQuery}(Nt);function reobserveCacheFirst(V){var $=V.options,z=$.fetchPolicy,X=$.nextFetchPolicy;return"cache-and-network"===z||"network-only"===z?V.reobserve({"fetchPolicy":"cache-first","nextFetchPolicy":function(){return this.nextFetchPolicy=X,"function"==typeof X?X.apply(this,arguments):z}}):V.reobserve()}function defaultSubscriptionObserverErrorCallback(V){__DEV__&&St.kG.error("Unhandled error",V.message,V.stack)}function logMissingFieldErrors(V){__DEV__&&V&&__DEV__&&St.kG.debug("Missing cache result fields: ".concat(JSON.stringify(V)),V)}function isSelectionNode(V){return V.kind===qt.h.FIELD||V.kind===qt.h.FRAGMENT_SPREAD||V.kind===qt.h.INLINE_FRAGMENT}fixObservableSubclass(Sn);var trie_esm_defaultMakeData=function(){return Object.create(null)},Tn=Array.prototype,In=Tn.forEach,kn=Tn.slice,En=function(){function Trie(V,$){void 0===V&&(V=!0),void 0===$&&($=trie_esm_defaultMakeData),this.weakness=V,this.makeData=$}return Trie.prototype.lookup=function(){for(var V=[],$=0;$globalThis))||maybe((()=>global))||Object.create(null),Pn=Nn[On]||Array[On]||function(V){try{Object.defineProperty(Nn,On,{"value":V,"enumerable":!1,"writable":!1,"configurable":!0})}finally{return V}}(class Slot{"constructor"(){this.id=["slot",Dn++,Date.now(),Math.random().toString(36).slice(2)].join(":")}"hasValue"(){for(let V=Cn;V;V=V.parent)if(this.id in V.slots){const $=V.slots[this.id];if($===wn)break;return V!==Cn&&(Cn.slots[this.id]=$),!0}return Cn&&(Cn.slots[this.id]=wn),!1}"getValue"(){if(this.hasValue())return Cn.slots[this.id]}"withValue"(V,$,z,X){const Z={"__proto__":null,[this.id]:V},ee=Cn;Cn={"parent":ee,"slots":Z};try{return $.apply(X,z)}finally{Cn=ee}}static"bind"(V){const $=Cn;return function(){const z=Cn;try{return Cn=$,V.apply(this,arguments)}finally{Cn=z}}}static"noContext"(V,$,z){if(!Cn)return V.apply(z,$);{const X=Cn;try{return Cn=null,V.apply(z,$)}finally{Cn=X}}}}),{"bind":Rn,"noContext":Ln}=Pn;function defaultDispose(){}var Gn,xn=function(){function Cache(V,$){void 0===V&&(V=1/0),void 0===$&&($=defaultDispose),this.max=V,this.dispose=$,this.map=new Map,this.newest=null,this.oldest=null}return Cache.prototype.has=function(V){return this.map.has(V)},Cache.prototype.get=function(V){var $=this.getNode(V);return $&&$.value},Cache.prototype.getNode=function(V){var $=this.map.get(V);if($&&$!==this.newest){var z=$.older,X=$.newer;X&&(X.older=z),z&&(z.newer=X),$.older=this.newest,$.older.newer=$,$.newer=null,this.newest=$,$===this.oldest&&(this.oldest=X)}return $},Cache.prototype.set=function(V,$){var z=this.getNode(V);return z?z.value=$:(z={"key":V,"value":$,"newer":null,"older":this.newest},this.newest&&(this.newest.newer=z),this.newest=z,this.oldest=this.oldest||z,this.map.set(V,z),z.value)},Cache.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},Cache.prototype.delete=function(V){var $=this.map.get(V);return!!$&&($===this.newest&&(this.newest=$.older),$===this.oldest&&(this.oldest=$.newer),$.newer&&($.newer.older=$.older),$.older&&($.older.newer=$.newer),this.map.delete(V),this.dispose($.value,V),!0)},Cache}(),Fn=new Pn,Un=Object.prototype.hasOwnProperty,Bn=void 0===(Gn=Array.from)?function(V){var $=[];return V.forEach((function(V){return $.push(V)})),$}:Gn;function maybeUnsubscribe(V){var $=V.unsubscribe;"function"==typeof $&&(V.unsubscribe=void 0,$())}var jn=[],qn=100;function assert(V,$){if(!V)throw new Error($||"assertion failure")}function valueGet(V){switch(V.length){case 0:throw new Error("unknown value");case 1:return V[0];case 2:throw V[1]}}var Vn=function(){function Entry(V){this.fn=V,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++Entry.count}return Entry.prototype.peek=function(){if(1===this.value.length&&!mightBeDirty(this))return rememberParent(this),this.value[0]},Entry.prototype.recompute=function(V){return assert(!this.recomputing,"already recomputing"),rememberParent(this),mightBeDirty(this)?function reallyRecompute(V,$){forgetChildren(V),Fn.withValue(V,recomputeNewValue,[V,$]),function maybeSubscribe(V,$){if("function"==typeof V.subscribe)try{maybeUnsubscribe(V),V.unsubscribe=V.subscribe.apply(null,$)}catch($){return V.setDirty(),!1}return!0}(V,$)&&function setClean(V){if(V.dirty=!1,mightBeDirty(V))return;reportClean(V)}(V);return valueGet(V.value)}(this,V):valueGet(this.value)},Entry.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,reportDirty(this),maybeUnsubscribe(this))},Entry.prototype.dispose=function(){var V=this;this.setDirty(),forgetChildren(this),eachParent(this,(function($,z){$.setDirty(),forgetChild($,V)}))},Entry.prototype.forget=function(){this.dispose()},Entry.prototype.dependOn=function(V){V.add(this),this.deps||(this.deps=jn.pop()||new Set),this.deps.add(V)},Entry.prototype.forgetDeps=function(){var V=this;this.deps&&(Bn(this.deps).forEach((function($){return $.delete(V)})),this.deps.clear(),jn.push(this.deps),this.deps=null)},Entry.count=0,Entry}();function rememberParent(V){var $=Fn.getValue();if($)return V.parents.add($),$.childValues.has(V)||$.childValues.set(V,[]),mightBeDirty(V)?reportDirtyChild($,V):reportCleanChild($,V),$}function recomputeNewValue(V,$){V.recomputing=!0,V.value.length=0;try{V.value[0]=V.fn.apply(null,$)}catch($){V.value[1]=$}V.recomputing=!1}function mightBeDirty(V){return V.dirty||!(!V.dirtyChildren||!V.dirtyChildren.size)}function reportDirty(V){eachParent(V,reportDirtyChild)}function reportClean(V){eachParent(V,reportCleanChild)}function eachParent(V,$){var z=V.parents.size;if(z)for(var X=Bn(V.parents),Z=0;Z0&&z===$.length&&V[z-1]===$[z-1]}(z,$.value)||V.setDirty(),removeDirtyChild(V,$),mightBeDirty(V)||reportClean(V)}function removeDirtyChild(V,$){var z=V.dirtyChildren;z&&(z.delete($),0===z.size&&(jn.length0&&V.childValues.forEach((function($,z){forgetChild(V,z)})),V.forgetDeps(),assert(null===V.dirtyChildren)}function forgetChild(V,$){$.parents.delete(V),V.childValues.delete($),removeDirtyChild(V,$)}var Hn={"setDirty":!0,"dispose":!0,"forget":!0};function dep(V){var $=new Map,z=V&&V.subscribe;function depend(V){var X=Fn.getValue();if(X){var Z=$.get(V);Z||$.set(V,Z=new Set),X.dependOn(Z),"function"==typeof z&&(maybeUnsubscribe(Z),Z.unsubscribe=z(V))}}return depend.dirty=function dirty(V,z){var X=$.get(V);if(X){var Z=z&&Un.call(Hn,z)?z:"setDirty";Bn(X).forEach((function(V){return V[Z]()})),$.delete(V),maybeUnsubscribe(X)}},depend}function makeDefaultMakeCacheKeyFunction(){var V=new En("function"==typeof WeakMap);return function(){return V.lookupArray(arguments)}}makeDefaultMakeCacheKeyFunction();var $n=new Set;function bundle_esm_wrap(V,$){void 0===$&&($=Object.create(null));var z=new xn($.max||Math.pow(2,16),(function(V){return V.dispose()})),X=$.keyArgs,Z=$.makeCacheKey||makeDefaultMakeCacheKeyFunction(),optimistic=function(){var ee=Z.apply(null,X?X.apply(null,arguments):arguments);if(void 0===ee)return V.apply(null,arguments);var ae=z.get(ee);ae||(z.set(ee,ae=new Vn(V)),ae.subscribe=$.subscribe,ae.forget=function(){return z.delete(ee)});var ie=ae.recompute(Array.prototype.slice.call(arguments));return z.set(ee,ae),$n.add(z),Fn.hasValue()||($n.forEach((function(V){return V.clean()})),$n.clear()),ie};function dirtyKey(V){var $=z.get(V);$&&$.setDirty()}function peekKey(V){var $=z.get(V);if($)return $.peek()}function forgetKey(V){return z.delete(V)}return Object.defineProperty(optimistic,"size",{"get":function(){return z.map.size},"configurable":!1,"enumerable":!1}),optimistic.dirtyKey=dirtyKey,optimistic.dirty=function dirty(){dirtyKey(Z.apply(null,arguments))},optimistic.peekKey=peekKey,optimistic.peek=function peek(){return peekKey(Z.apply(null,arguments))},optimistic.forgetKey=forgetKey,optimistic.forget=function forget(){return forgetKey(Z.apply(null,arguments))},optimistic.makeCacheKey=Z,optimistic.getKey=X?function getKey(){return Z.apply(null,X.apply(null,arguments))}:Z,Object.freeze(optimistic)}var Kn=new Pn,Qn=new WeakMap;function getCacheInfo(V){var $=Qn.get(V);return $||Qn.set(V,$={"vars":new Set,"dep":dep()}),$}function forgetCache(V){getCacheInfo(V).vars.forEach((function($){return $.forgetCache(V)}))}function makeVar(V){var $=new Set,z=new Set,rv=function(Z){if(arguments.length>0){if(V!==Z){V=Z,$.forEach((function(V){getCacheInfo(V).dep.dirty(rv),function broadcast(V){V.broadcastWatches&&V.broadcastWatches()}(V)}));var ee=Array.from(z);z.clear(),ee.forEach((function($){return $(V)}))}}else{var ae=Kn.getValue();ae&&(X(ae),getCacheInfo(ae).dep(rv))}return V};rv.onNextChange=function(V){return z.add(V),function(){z.delete(V)}};var X=rv.attachCache=function(V){return $.add(V),getCacheInfo(V).vars.add(rv),rv};return rv.forgetCache=function(V){return $.delete(V)},rv}var zn=function(){function LocalState(V){var $=V.cache,z=V.client,X=V.resolvers,Z=V.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=$,z&&(this.client=z),X&&this.addResolvers(X),Z&&this.setFragmentMatcher(Z)}return LocalState.prototype.addResolvers=function(V){var $=this;this.resolvers=this.resolvers||{},Array.isArray(V)?V.forEach((function(V){$.resolvers=mergeDeep($.resolvers,V)})):this.resolvers=mergeDeep(this.resolvers,V)},LocalState.prototype.setResolvers=function(V){this.resolvers={},this.addResolvers(V)},LocalState.prototype.getResolvers=function(){return this.resolvers||{}},LocalState.prototype.runResolvers=function(V){var $=V.document,z=V.remoteResult,X=V.context,Z=V.variables,ee=V.onlyRunForcedResolvers,ae=void 0!==ee&ⅇreturn(0,Mt.mG)(this,void 0,void 0,(function(){return(0,Mt.Jh)(this,(function(V){return $?[2,this.resolveDocument($,z.data,X,Z,this.fragmentMatcher,ae).then((function(V){return(0,Mt.pi)((0,Mt.pi)({},z),{"data":V.result})}))]:[2,z]}))}))},LocalState.prototype.setFragmentMatcher=function(V){this.fragmentMatcher=V},LocalState.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},LocalState.prototype.clientQuery=function(V){return hasDirectives(["client"],V)&&this.resolvers?V:null},LocalState.prototype.serverQuery=function(V){return function removeClientSetsFromDocument(V){return checkDocument(V),removeDirectivesFromDocument([{"test":function(V){return"client"===V.name.value},"remove":!0}],V)}(V)},LocalState.prototype.prepareContext=function(V){var $=this.cache;return(0,Mt.pi)((0,Mt.pi)({},V),{"cache":$,"getCacheKey":function(V){return $.identify(V)}})},LocalState.prototype.addExportedVariables=function(V,$,z){return void 0===$&&($={}),void 0===z&&(z={}),(0,Mt.mG)(this,void 0,void 0,(function(){return(0,Mt.Jh)(this,(function(X){return V?[2,this.resolveDocument(V,this.buildRootValueFromCache(V,$)||{},this.prepareContext(z),$).then((function(V){return(0,Mt.pi)((0,Mt.pi)({},$),V.exportedVariables)}))]:[2,(0,Mt.pi)({},$)]}))}))},LocalState.prototype.shouldForceResolvers=function(V){var $=!1;return visitor_visit(V,{"Directive":{"enter":function(V){if("client"===V.name.value&&V.arguments&&($=V.arguments.some((function(V){return"always"===V.name.value&&"BooleanValue"===V.value.kind&&!0===V.value.value}))))return Vt}}}),$},LocalState.prototype.buildRootValueFromCache=function(V,$){return this.cache.diff({"query":buildQueryFromSelectionSet(V),"variables":$,"returnPartialData":!0,"optimistic":!1}).result},LocalState.prototype.resolveDocument=function(V,$,z,X,Z,ee){return void 0===z&&(z={}),void 0===X&&(X={}),void 0===Z&&(Z=function(){return!0}),void 0===ee&&(ee=!1),(0,Mt.mG)(this,void 0,void 0,(function(){var ae,ie,ce,le,de,pe,fe,ye,_e,Se;return(0,Mt.Jh)(this,(function(Te){return ae=getMainDefinition(V),ie=getFragmentDefinitions(V),ce=createFragmentMap(ie),le=this.collectSelectionsToResolve(ae,ce),de=ae.operation,pe=de?de.charAt(0).toUpperCase()+de.slice(1):"Query",ye=(fe=this).cache,_e=fe.client,Se={"fragmentMap":ce,"context":(0,Mt.pi)((0,Mt.pi)({},z),{"cache":ye,"client":_e}),"variables":X,"fragmentMatcher":Z,"defaultOperationType":pe,"exportedVariables":{},"selectionsToResolve":le,"onlyRunForcedResolvers":ee},!1,[2,this.resolveSelectionSet(ae.selectionSet,false,$,Se).then((function(V){return{"result":V,"exportedVariables":Se.exportedVariables}}))]}))}))},LocalState.prototype.resolveSelectionSet=function(V,$,z,X){return(0,Mt.mG)(this,void 0,void 0,(function(){var Z,ee,ae,ie,ce,le=this;return(0,Mt.Jh)(this,(function(de){return Z=X.fragmentMap,ee=X.context,ae=X.variables,ie=[z],ce=function(V){return(0,Mt.mG)(le,void 0,void 0,(function(){var ce,le;return(0,Mt.Jh)(this,(function(de){return($||X.selectionsToResolve.has(V))&&shouldInclude(V,ae)?storeUtils_isField(V)?[2,this.resolveField(V,$,z,X).then((function($){var z;void 0!==$&&ie.push(((z={})[resultKeyNameFromField(V)]=$,z))}))]:(!function isInlineFragment(V){return"InlineFragment"===V.kind}(V)?(ce=Z[V.name.value],__DEV__?(0,St.kG)(ce,"No fragment named ".concat(V.name.value)):(0,St.kG)(ce,11)):ce=V,ce&&ce.typeCondition&&(le=ce.typeCondition.name.value,X.fragmentMatcher(z,le,ee))?[2,this.resolveSelectionSet(ce.selectionSet,$,z,X).then((function(V){ie.push(V)}))]:[2]):[2]}))}))},[2,Promise.all(V.selections.map(ce)).then((function(){return mergeDeepArray(ie)}))]}))}))},LocalState.prototype.resolveField=function(V,$,z,X){return(0,Mt.mG)(this,void 0,void 0,(function(){var Z,ee,ae,ie,ce,le,de,pe,fe,ye=this;return(0,Mt.Jh)(this,(function(_e){return z?(Z=X.variables,ee=V.name.value,ae=resultKeyNameFromField(V),ie=ee!==ae,ce=z[ae]||z[ee],le=Promise.resolve(ce),X.onlyRunForcedResolvers&&!this.shouldForceResolvers(V)||(de=z.__typename||X.defaultOperationType,(pe=this.resolvers&&this.resolvers[de])&&(fe=pe[ie?ee:ae])&&(le=Promise.resolve(Kn.withValue(this.cache,fe,[z,argumentsObjectFromField(V,Z),X.context,{"field":V,"fragmentMap":X.fragmentMap}])))),[2,le.then((function(z){var Z,ee;if(void 0===z&&(z=ce),V.directives&&V.directives.forEach((function(V){"export"===V.name.value&&V.arguments&&V.arguments.forEach((function(V){"as"===V.name.value&&"StringValue"===V.value.kind&&(X.exportedVariables[V.value.value]=z)}))})),!V.selectionSet)return z;if(null==z)return z;var ae=null!==(ee=null===(Z=V.directives)||void 0===Z?void 0:Z.some((function(V){return"client"===V.name.value})))&&void 0!==ee&ⅇreturn Array.isArray(z)?ye.resolveSubSelectedArray(V,$||ae,z,X):V.selectionSet?ye.resolveSelectionSet(V.selectionSet,$||ae,z,X):void 0}))]):[2,null]}))}))},LocalState.prototype.resolveSubSelectedArray=function(V,$,z,X){var Z=this;return Promise.all(z.map((function(z){return null===z?null:Array.isArray(z)?Z.resolveSubSelectedArray(V,$,z,X):V.selectionSet?Z.resolveSelectionSet(V.selectionSet,$,z,X):void 0})))},LocalState.prototype.collectSelectionsToResolve=function(V,$){var isSingleASTNode=function(V){return!Array.isArray(V)},z=this.selectionsToResolveCache;return function collectByDefinition(V){if(!z.has(V)){var X=new Set;z.set(V,X),visitor_visit(V,{"Directive":function(V,$,z,Z,ee){"client"===V.name.value&&ee.forEach((function(V){isSingleASTNode(V)&&isSelectionNode(V)&&X.add(V)}))},"FragmentSpread":function(V,z,Z,ee,ae){var ie=$[V.name.value];__DEV__?(0,St.kG)(ie,"No fragment named ".concat(V.name.value)):(0,St.kG)(ie,12);var ce=collectByDefinition(ie);ce.size>0&&(ae.forEach((function(V){isSingleASTNode(V)&&isSelectionNode(V)&&X.add(V)})),X.add(V),ce.forEach((function(V){X.add(V)})))}})}return z.get(V)}(V)},LocalState}(),Wn=new(Ht.mr?WeakMap:Map);function wrapDestructiveCacheMethod(V,$){var z=V[$];"function"==typeof z&&(V[$]=function(){return Wn.set(V,(Wn.get(V)+1)%1e15),z.apply(this,arguments)})}function cancelNotifyTimeout(V){V.notifyTimeout&&(clearTimeout(V.notifyTimeout),V.notifyTimeout=void 0)}var Yn=function(){function QueryInfo(V,$){void 0===$&&($=V.generateQueryId()),this.queryId=$,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var z=this.cache=V.cache;Wn.has(z)||(Wn.set(z,0),wrapDestructiveCacheMethod(z,"evict"),wrapDestructiveCacheMethod(z,"modify"),wrapDestructiveCacheMethod(z,"reset"))}return QueryInfo.prototype.init=function(V){var $=V.networkStatus||yn.I.loading;return this.variables&&this.networkStatus!==yn.I.loading&&!(0,on.D)(this.variables,V.variables)&&($=yn.I.setVariables),(0,on.D)(V.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{"document":V.document,"variables":V.variables,"networkError":null,"graphQLErrors":this.graphQLErrors||[],"networkStatus":$}),V.observableQuery&&this.setObservableQuery(V.observableQuery),V.lastRequestId&&(this.lastRequestId=V.lastRequestId),this},QueryInfo.prototype.reset=function(){cancelNotifyTimeout(this),this.dirty=!1},QueryInfo.prototype.getDiff=function(V){void 0===V&&(V=this.variables);var $=this.getDiffOptions(V);if(this.lastDiff&&(0,on.D)($,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=V);var z=this.observableQuery;if(z&&"no-cache"===z.options.fetchPolicy)return{"complete":!1};var X=this.cache.diff($);return this.updateLastDiff(X,$),X},QueryInfo.prototype.updateLastDiff=function(V,$){this.lastDiff=V?{"diff":V,"options":$||this.getDiffOptions()}:void 0},QueryInfo.prototype.getDiffOptions=function(V){var $;return void 0===V&&(V=this.variables),{"query":this.document,"variables":V,"returnPartialData":!0,"optimistic":!0,"canonizeResults":null===($=this.observableQuery)||void 0===$?void 0:$.options.canonizeResults}},QueryInfo.prototype.setDiff=function(V){var $=this,z=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(V),this.dirty||(0,on.D)(z&&z.result,V&&V.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return $.notify()}),0)))},QueryInfo.prototype.setObservableQuery=function(V){var $=this;V!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=V,V?(V.queryInfo=this,this.listeners.add(this.oqListener=function(){$.getDiff().fromOptimisticTransaction?V.observe():reobserveCacheFirst(V)})):delete this.oqListener)},QueryInfo.prototype.notify=function(){var V=this;cancelNotifyTimeout(this),this.shouldNotify()&&this.listeners.forEach((function($){return $(V)})),this.dirty=!1},QueryInfo.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,yn.O)(this.networkStatus)&&this.observableQuery){var V=this.observableQuery.options.fetchPolicy;if("cache-only"!==V&&"cache-and-network"!==V)return!1}return!0},QueryInfo.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=QueryInfo.prototype.cancel,this.subscriptions.forEach((function(V){return V.unsubscribe()}));var V=this.observableQuery;V&&V.stopPolling()}},QueryInfo.prototype.cancel=function(){},QueryInfo.prototype.updateWatch=function(V){var $=this;void 0===V&&(V=this.variables);var z=this.observableQuery;if(!z||"no-cache"!==z.options.fetchPolicy){var X=(0,Mt.pi)((0,Mt.pi)({},this.getDiffOptions(V)),{"watcher":this,"callback":function(V){return $.setDiff(V)}});this.lastWatch&&(0,on.D)(X,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=X))}},QueryInfo.prototype.resetLastWrite=function(){this.lastWrite=void 0},QueryInfo.prototype.shouldWrite=function(V,$){var z=this.lastWrite;return!(z&&z.dmCount===Wn.get(this.cache)&&(0,on.D)($,z.variables)&&(0,on.D)(V.data,z.result.data))},QueryInfo.prototype.markResult=function(V,$,z,X){var Z=this,ee=new zt,ae=(0,Kt.O)(V.errors)?V.errors.slice(0):[];if(this.reset(),"incremental"in V&&(0,Kt.O)(V.incremental)){var ie=mergeIncrementalData(this.getDiff().result,V);V.data=ie}else if("hasNext"in V&&V.hasNext){var ce=this.getDiff();V.data=ee.merge(ce.result,V.data)}this.graphQLErrors=ae,"no-cache"===z.fetchPolicy?this.updateLastDiff({"result":V.data,"complete":!0},this.getDiffOptions(z.variables)):0!==X&&(shouldWriteResult(V,z.errorPolicy)?this.cache.performTransaction((function(ee){if(Z.shouldWrite(V,z.variables))ee.writeQuery({"query":$,"data":V.data,"variables":z.variables,"overwrite":1===X}),Z.lastWrite={"result":V,"variables":z.variables,"dmCount":Wn.get(Z.cache)};else if(Z.lastDiff&&Z.lastDiff.diff.complete)return void(V.data=Z.lastDiff.diff.result);var ae=Z.getDiffOptions(z.variables),ie=ee.diff(ae);Z.stopped||Z.updateWatch(z.variables),Z.updateLastDiff(ie,ae),ie.complete&&(V.data=ie.result)})):this.lastWrite=void 0)},QueryInfo.prototype.markReady=function(){return this.networkError=null,this.networkStatus=yn.I.ready},QueryInfo.prototype.markError=function(V){return this.networkStatus=yn.I.error,this.lastWrite=void 0,this.reset(),V.graphQLErrors&&(this.graphQLErrors=V.graphQLErrors),V.networkError&&(this.networkError=V.networkError),V},QueryInfo}();function shouldWriteResult(V,$){void 0===$&&($="none");var z="ignore"===$||"all"===$,X=!graphQLResultHasError(V);return!X&&z&&V.data&&(X=!0),X}var Xn=Object.prototype.hasOwnProperty,Jn=function(){function QueryManager(V){var $=V.cache,z=V.link,X=V.defaultOptions,Z=V.queryDeduplication,ee=void 0!==Z&&Z,ae=V.onBroadcast,ie=V.ssrMode,ce=void 0!==ie&&ie,le=V.clientAwareness,de=void 0===le?{}:le,pe=V.localState,fe=V.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Ht.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=$,this.link=z,this.defaultOptions=X||Object.create(null),this.queryDeduplication=ee,this.clientAwareness=de,this.localState=pe||new zn({"cache":$}),this.ssrMode=ce,this.assumeImmutableResults=!!fe,(this.onBroadcast=ae)&&(this.mutationStore=Object.create(null))}return QueryManager.prototype.stop=function(){var V=this;this.queries.forEach((function($,z){V.stopQueryNoBroadcast(z)})),this.cancelPendingFetches(__DEV__?new St.ej("QueryManager stopped while query was in flight"):new St.ej(14))},QueryManager.prototype.cancelPendingFetches=function(V){this.fetchCancelFns.forEach((function($){return $(V)})),this.fetchCancelFns.clear()},QueryManager.prototype.mutate=function(V){var $,z,X=V.mutation,Z=V.variables,ee=V.optimisticResponse,ae=V.updateQueries,ie=V.refetchQueries,ce=void 0===ie?[]:ie,le=V.awaitRefetchQueries,de=void 0!==le&&le,pe=V.update,fe=V.onQueryUpdated,ye=V.fetchPolicy,_e=void 0===ye?(null===($=this.defaultOptions.mutate)||void 0===$?void 0:$.fetchPolicy)||"network-only":ye,Se=V.errorPolicy,Te=void 0===Se?(null===(z=this.defaultOptions.mutate)||void 0===z?void 0:z.errorPolicy)||"none":Se,He=V.keepRootFields,Qe=V.context;return(0,Mt.mG)(this,void 0,void 0,(function(){var V,$,z,ie,le,ye;return(0,Mt.Jh)(this,(function(Se){switch(Se.label){case 0:return __DEV__?(0,St.kG)(X,"mutation option is required. You must specify your GraphQL document in the mutation option."):(0,St.kG)(X,15),__DEV__?(0,St.kG)("network-only"===_e||"no-cache"===_e,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):(0,St.kG)("network-only"===_e||"no-cache"===_e,16),V=this.generateMutationId(),$=this.transform(X),z=$.document,ie=$.hasClientExports,X=this.cache.transformForLink(z),Z=this.getVariables(X,Z),ie?[4,this.localState.addExportedVariables(X,Z,Qe)]:[3,2];case 1:Z=Se.sent(),Se.label=2;case 2:return le=this.mutationStore&&(this.mutationStore[V]={"mutation":X,"variables":Z,"loading":!0,"error":null}),ee&&this.markMutationOptimistic(ee,{"mutationId":V,"document":X,"variables":Z,"fetchPolicy":_e,"errorPolicy":Te,"context":Qe,"updateQueries":ae,"update":pe,"keepRootFields":He}),this.broadcastQueries(),ye=this,[2,new Promise((function($,z){return asyncMap(ye.getObservableFromLink(X,(0,Mt.pi)((0,Mt.pi)({},Qe),{"optimisticResponse":ee}),Z,!1),(function($){if(graphQLResultHasError($)&&"none"===Te)throw new $t.cA({"graphQLErrors":getGraphQLErrorsFromResult($)});le&&(le.loading=!1,le.error=null);var z=(0,Mt.pi)({},$);return"function"==typeof ce&&(ce=ce(z)),"ignore"===Te&&graphQLResultHasError(z)&&delete z.errors,ye.markMutationResult({"mutationId":V,"result":z,"document":X,"variables":Z,"fetchPolicy":_e,"errorPolicy":Te,"context":Qe,"update":pe,"updateQueries":ae,"awaitRefetchQueries":de,"refetchQueries":ce,"removeOptimistic":ee?V:void 0,"onQueryUpdated":fe,"keepRootFields":He})})).subscribe({"next":function(V){ye.broadcastQueries(),"hasNext"in V&&!1!==V.hasNext||$(V)},"error":function($){le&&(le.loading=!1,le.error=$),ee&&ye.cache.removeOptimistic(V),ye.broadcastQueries(),z($ instanceof $t.cA?$:new $t.cA({"networkError":$}))}})}))]}}))}))},QueryManager.prototype.markMutationResult=function(V,$){var z=this;void 0===$&&($=this.cache);var X=V.result,Z=[],ee="no-cache"===V.fetchPolicy;if(!ee&&shouldWriteResult(X,V.errorPolicy)){if(isExecutionPatchIncrementalResult(X)||Z.push({"result":X.data,"dataId":"ROOT_MUTATION","query":V.document,"variables":V.variables}),isExecutionPatchIncrementalResult(X)&&(0,Kt.O)(X.incremental)){var ae=$.diff({"id":"ROOT_MUTATION","query":this.transform(V.document).asQuery,"variables":V.variables,"optimistic":!1,"returnPartialData":!0}),ie=void 0;ae.result&&(ie=mergeIncrementalData(ae.result,X)),void 0!==ie&&(X.data=ie,Z.push({"result":ie,"dataId":"ROOT_MUTATION","query":V.document,"variables":V.variables}))}var ce=V.updateQueries;ce&&this.queries.forEach((function(V,ee){var ae=V.observableQuery,ie=ae&&ae.queryName;if(ie&&Xn.call(ce,ie)){var le=ce[ie],de=z.queries.get(ee),pe=de.document,fe=de.variables,ye=$.diff({"query":pe,"variables":fe,"returnPartialData":!0,"optimistic":!1}),_e=ye.result;if(ye.complete&&_e){var Se=le(_e,{"mutationResult":X,"queryName":pe&&getOperationName(pe)||void 0,"queryVariables":fe});Se&&Z.push({"result":Se,"dataId":"ROOT_QUERY","query":pe,"variables":fe})}}}))}if(Z.length>0||V.refetchQueries||V.update||V.onQueryUpdated||V.removeOptimistic){var le=[];if(this.refetchQueries({"updateCache":function($){ee||Z.forEach((function(V){return $.write(V)}));var ae=V.update,ie=!function isExecutionPatchResult(V){return isExecutionPatchIncrementalResult(V)||function isExecutionPatchInitialResult(V){return"hasNext"in V&&"data"in V}(V)}(X)||isExecutionPatchIncrementalResult(X)&&!X.hasNext;if(ae){if(!ee){var ce=$.diff({"id":"ROOT_MUTATION","query":z.transform(V.document).asQuery,"variables":V.variables,"optimistic":!1,"returnPartialData":!0});ce.complete&&("incremental"in(X=(0,Mt.pi)((0,Mt.pi)({},X),{"data":ce.result}))&&delete X.incremental,"hasNext"in X&&delete X.hasNext)}ie&&ae($,X,{"context":V.context,"variables":V.variables})}ee||V.keepRootFields||!ie||$.modify({"id":"ROOT_MUTATION","fields":function(V,$){var z=$.fieldName,X=$.DELETE;return"__typename"===z?V:X}})},"include":V.refetchQueries,"optimistic":!1,"removeOptimistic":V.removeOptimistic,"onQueryUpdated":V.onQueryUpdated||null}).forEach((function(V){return le.push(V)})),V.awaitRefetchQueries||V.onQueryUpdated)return Promise.all(le).then((function(){return X}))}return Promise.resolve(X)},QueryManager.prototype.markMutationOptimistic=function(V,$){var z=this,X="function"==typeof V?V($.variables):V;return this.cache.recordOptimisticTransaction((function(V){try{z.markMutationResult((0,Mt.pi)((0,Mt.pi)({},$),{"result":{"data":X}}),V)}catch(V){__DEV__&&St.kG.error(V)}}),$.mutationId)},QueryManager.prototype.fetchQuery=function(V,$,z){return this.fetchQueryObservable(V,$,z).promise},QueryManager.prototype.getQueryStore=function(){var V=Object.create(null);return this.queries.forEach((function($,z){V[z]={"variables":$.variables,"networkStatus":$.networkStatus,"networkError":$.networkError,"graphQLErrors":$.graphQLErrors}})),V},QueryManager.prototype.resetErrors=function(V){var $=this.queries.get(V);$&&($.networkError=void 0,$.graphQLErrors=[])},QueryManager.prototype.transform=function(V){var $=this.transformCache;if(!$.has(V)){var z=this.cache.transformDocument(V),X=function removeConnectionDirectiveFromDocument(V){return removeDirectivesFromDocument([gn],checkDocument(V))}(z),Z=this.localState.clientQuery(z),ee=X&&this.localState.serverQuery(X),ae={"document":z,"hasClientExports":hasClientExports(z),"hasForcedResolvers":this.localState.shouldForceResolvers(z),"clientQuery":Z,"serverQuery":ee,"defaultVars":getDefaultValues(getOperationDefinition(z)),"asQuery":(0,Mt.pi)((0,Mt.pi)({},z),{"definitions":z.definitions.map((function(V){return"OperationDefinition"===V.kind&&"query"!==V.operation?(0,Mt.pi)((0,Mt.pi)({},V),{"operation":"query"}):V}))})},add=function(V){V&&!$.has(V)&&$.set(V,ae)};add(V),add(z),add(Z),add(ee)}return $.get(V)},QueryManager.prototype.getVariables=function(V,$){return(0,Mt.pi)((0,Mt.pi)({},this.transform(V).defaultVars),$)},QueryManager.prototype.watchQuery=function(V){void 0===(V=(0,Mt.pi)((0,Mt.pi)({},V),{"variables":this.getVariables(V.query,V.variables)})).notifyOnNetworkStatusChange&&(V.notifyOnNetworkStatusChange=!1);var $=new Yn(this),z=new Sn({"queryManager":this,"queryInfo":$,"options":V});return this.queries.set(z.queryId,$),$.init({"document":z.query,"observableQuery":z,"variables":z.variables}),z},QueryManager.prototype.query=function(V,$){var z=this;return void 0===$&&($=this.generateQueryId()),__DEV__?(0,St.kG)(V.query,"query option is required. You must specify your GraphQL document in the query option."):(0,St.kG)(V.query,17),__DEV__?(0,St.kG)("Document"===V.query.kind,'You must wrap the query string in a "gql" tag.'):(0,St.kG)("Document"===V.query.kind,18),__DEV__?(0,St.kG)(!V.returnPartialData,"returnPartialData option only supported on watchQuery."):(0,St.kG)(!V.returnPartialData,19),__DEV__?(0,St.kG)(!V.pollInterval,"pollInterval option only supported on watchQuery."):(0,St.kG)(!V.pollInterval,20),this.fetchQuery($,V).finally((function(){return z.stopQuery($)}))},QueryManager.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},QueryManager.prototype.generateRequestId=function(){return this.requestIdCounter++},QueryManager.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},QueryManager.prototype.stopQueryInStore=function(V){this.stopQueryInStoreNoBroadcast(V),this.broadcastQueries()},QueryManager.prototype.stopQueryInStoreNoBroadcast=function(V){var $=this.queries.get(V);$&&$.stop()},QueryManager.prototype.clearStore=function(V){return void 0===V&&(V={"discardWatches":!0}),this.cancelPendingFetches(__DEV__?new St.ej("Store reset while query was in flight (not completed in link chain)"):new St.ej(21)),this.queries.forEach((function(V){V.observableQuery?V.networkStatus=yn.I.loading:V.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(V)},QueryManager.prototype.getObservableQueries=function(V){var $=this;void 0===V&&(V="active");var z=new Map,X=new Map,Z=new Set;return Array.isArray(V)&&V.forEach((function(V){"string"==typeof V?X.set(V,!1):!function isDocumentNode(V){return(0,Pt.s)(V)&&"Document"===V.kind&&Array.isArray(V.definitions)}(V)?(0,Pt.s)(V)&&V.query&&Z.add(V):X.set($.transform(V).document,!1)})),this.queries.forEach((function($,Z){var ee=$.observableQuery,ae=$.document;if(ee){if("all"===V)return void z.set(Z,ee);var ie=ee.queryName;if("standby"===ee.options.fetchPolicy||"active"===V&&!ee.hasObservers())return;("active"===V||ie&&X.has(ie)||ae&&X.has(ae))&&(z.set(Z,ee),ie&&X.set(ie,!0),ae&&X.set(ae,!0))}})),Z.size&&Z.forEach((function(V){var X=makeUniqueId("legacyOneTimeQuery"),Z=$.getQuery(X).init({"document":V.query,"variables":V.variables}),ee=new Sn({"queryManager":$,"queryInfo":Z,"options":(0,Mt.pi)((0,Mt.pi)({},V),{"fetchPolicy":"network-only"})});(0,St.kG)(ee.queryId===X),Z.setObservableQuery(ee),z.set(X,ee)})),__DEV__&&X.size&&X.forEach((function(V,$){V||__DEV__&&St.kG.warn("Unknown query ".concat("string"==typeof $?"named ":"").concat(JSON.stringify($,null,2)," requested in refetchQueries options.include array"))})),z},QueryManager.prototype.reFetchObservableQueries=function(V){var $=this;void 0===V&&(V=!1);var z=[];return this.getObservableQueries(V?"all":"active").forEach((function(X,Z){var ee=X.options.fetchPolicy;X.resetLastResults(),(V||"standby"!==ee&&"cache-only"!==ee)&&z.push(X.refetch()),$.getQuery(Z).setDiff(null)})),this.broadcastQueries(),Promise.all(z)},QueryManager.prototype.setObservableQuery=function(V){this.getQuery(V.queryId).setObservableQuery(V)},QueryManager.prototype.startGraphQLSubscription=function(V){var $=this,z=V.query,X=V.fetchPolicy,Z=V.errorPolicy,ee=V.variables,ae=V.context,ie=void 0===ae?{}:ae;z=this.transform(z).document,ee=this.getVariables(z,ee);var makeObservable=function(V){return $.getObservableFromLink(z,ie,V).map((function(ee){"no-cache"!==X&&(shouldWriteResult(ee,Z)&&$.cache.write({"query":z,"result":ee.data,"dataId":"ROOT_SUBSCRIPTION","variables":V}),$.broadcastQueries());var ae=graphQLResultHasError(ee),ie=(0,$t.ls)(ee);if(ae||ie){var ce={};throw ae&&(ce.graphQLErrors=ee.errors),ie&&(ce.protocolErrors=ee.extensions[$t.YG]),new $t.cA(ce)}return ee}))};if(this.transform(z).hasClientExports){var ce=this.localState.addExportedVariables(z,ee,ie).then(makeObservable);return new Nt((function(V){var $=null;return ce.then((function(z){return $=z.subscribe(V)}),V.error),function(){return $&&$.unsubscribe()}}))}return makeObservable(ee)},QueryManager.prototype.stopQuery=function(V){this.stopQueryNoBroadcast(V),this.broadcastQueries()},QueryManager.prototype.stopQueryNoBroadcast=function(V){this.stopQueryInStoreNoBroadcast(V),this.removeQuery(V)},QueryManager.prototype.removeQuery=function(V){this.fetchCancelFns.delete(V),this.queries.has(V)&&(this.getQuery(V).stop(),this.queries.delete(V))},QueryManager.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(V){return V.notify()}))},QueryManager.prototype.getLocalState=function(){return this.localState},QueryManager.prototype.getObservableFromLink=function(V,$,z,X){var Z,ee,ae=this;void 0===X&&(X=null!==(Z=null==$?void 0:$.queryDeduplication)&&void 0!==Z?Z:this.queryDeduplication);var ie=this.transform(V).serverQuery;if(ie){var ce=this.inFlightLinkObservables,le=this.link,de={"query":ie,"variables":z,"operationName":getOperationName(ie)||void 0,"context":this.prepareContext((0,Mt.pi)((0,Mt.pi)({},$),{"forceFetch":!X}))};if($=de.context,X){var pe=ce.get(ie)||new Map;ce.set(ie,pe);var fe=pn(z);if(!(ee=pe.get(fe))){var ye=new vn([rn(le,de)]);pe.set(fe,ee=ye),ye.beforeNext((function(){pe.delete(fe)&&pe.size<1&&ce.delete(ie)}))}}else ee=new vn([rn(le,de)])}else ee=new vn([Nt.of({"data":{}})]),$=this.prepareContext($);var _e=this.transform(V).clientQuery;return _e&&(ee=asyncMap(ee,(function(V){return ae.localState.runResolvers({"document":_e,"remoteResult":V,"context":$,"variables":z})}))),ee},QueryManager.prototype.getResultsFromLink=function(V,$,z){var X=V.lastRequestId=this.generateRequestId(),Z=this.cache.transformForLink(this.transform(V.document).document);return asyncMap(this.getObservableFromLink(Z,z.context,z.variables),(function(ee){var ae=getGraphQLErrorsFromResult(ee),ie=ae.length>0;if(X>=V.lastRequestId){if(ie&&"none"===z.errorPolicy)throw V.markError(new $t.cA({"graphQLErrors":ae}));V.markResult(ee,Z,z,$),V.markReady()}var ce={"data":ee.data,"loading":!1,"networkStatus":yn.I.ready};return ie&&"ignore"!==z.errorPolicy&&(ce.errors=ae,ce.networkStatus=yn.I.error),ce}),(function($){var z=(0,$t.MS)($)?$:new $t.cA({"networkError":$});throw X>=V.lastRequestId&&V.markError(z),z}))},QueryManager.prototype.fetchQueryObservable=function(V,$,z){return this.fetchConcastWithInfo(V,$,z).concast},QueryManager.prototype.fetchConcastWithInfo=function(V,$,z){var X=this;void 0===z&&(z=yn.I.loading);var Z,ee,ae=this.transform($.query).document,ie=this.getVariables(ae,$.variables),ce=this.getQuery(V),le=this.defaultOptions.watchQuery,de=$.fetchPolicy,pe=void 0===de?le&&le.fetchPolicy||"cache-first":de,fe=$.errorPolicy,ye=void 0===fe?le&&le.errorPolicy||"none":fe,_e=$.returnPartialData,Se=void 0!==_e&&_e,Te=$.notifyOnNetworkStatusChange,He=void 0!==Te&&Te,Qe=$.context,ze=void 0===Qe?{}:Qe,bt=Object.assign({},$,{"query":ae,"variables":ie,"fetchPolicy":pe,"errorPolicy":ye,"returnPartialData":Se,"notifyOnNetworkStatusChange":He,"context":ze}),fromVariables=function(V){bt.variables=V;var Z=X.fetchQueryByPolicy(ce,bt,z);return"standby"!==bt.fetchPolicy&&Z.sources.length>0&&ce.observableQuery&&ce.observableQuery.applyNextFetchPolicy("after-fetch",$),Z},cleanupCancelFn=function(){return X.fetchCancelFns.delete(V)};if(this.fetchCancelFns.set(V,(function(V){cleanupCancelFn(),setTimeout((function(){return Z.cancel(V)}))})),this.transform(bt.query).hasClientExports)Z=new vn(this.localState.addExportedVariables(bt.query,bt.variables,bt.context).then(fromVariables).then((function(V){return V.sources}))),ee=!0;else{var At=fromVariables(bt.variables);ee=At.fromLink,Z=new vn(At.sources)}return Z.promise.then(cleanupCancelFn,cleanupCancelFn),{"concast":Z,"fromLink":ee}},QueryManager.prototype.refetchQueries=function(V){var $=this,z=V.updateCache,X=V.include,Z=V.optimistic,ee=void 0!==Z&&Z,ae=V.removeOptimistic,ie=void 0===ae?ee?makeUniqueId("refetchQueries"):void 0:ae,ce=V.onQueryUpdated,le=new Map;X&&this.getObservableQueries(X).forEach((function(V,z){le.set(z,{"oq":V,"lastDiff":$.getQuery(z).getDiff()})}));var de=new Map;return z&&this.cache.batch({"update":z,"optimistic":ee&&ie||!1,"removeOptimistic":ie,"onWatchUpdated":function(V,$,z){var X=V.watcher instanceof Yn&&V.watcher.observableQuery;if(X){if(ce){le.delete(X.queryId);var Z=ce(X,$,z);return!0===Z&&(Z=X.refetch()),!1!==Z&&de.set(X,Z),Z}null!==ce&&le.set(X.queryId,{"oq":X,"lastDiff":z,"diff":$})}}}),le.size&&le.forEach((function(V,z){var X,Z=V.oq,ee=V.lastDiff,ae=V.diff;if(ce){if(!ae){var ie=Z.queryInfo;ie.reset(),ae=ie.getDiff()}X=ce(Z,ae,ee)}ce&&!0!==X||(X=Z.refetch()),!1!==X&&de.set(Z,X),z.indexOf("legacyOneTimeQuery")>=0&&$.stopQueryNoBroadcast(z)})),ie&&this.cache.removeOptimistic(ie),de},QueryManager.prototype.fetchQueryByPolicy=function(V,$,z){var X=this,Z=$.query,ee=$.variables,ae=$.fetchPolicy,ie=$.refetchWritePolicy,ce=$.errorPolicy,le=$.returnPartialData,de=$.context,pe=$.notifyOnNetworkStatusChange,fe=V.networkStatus;V.init({"document":this.transform(Z).document,"variables":ee,"networkStatus":z});var readCache=function(){return V.getDiff(ee)},resultsFromCache=function($,z){void 0===z&&(z=V.networkStatus||yn.I.loading);var ae=$.result;!__DEV__||le||(0,on.D)(ae,{})||logMissingFieldErrors($.missing);var fromData=function(V){return Nt.of((0,Mt.pi)({"data":V,"loading":(0,yn.O)(z),"networkStatus":z},$.complete?null:{"partial":!0}))};return ae&&X.transform(Z).hasForcedResolvers?X.localState.runResolvers({"document":Z,"remoteResult":{"data":ae},"context":de,"variables":ee,"onlyRunForcedResolvers":!0}).then((function(V){return fromData(V.data||void 0)})):"none"===ce&&z===yn.I.refetch&&Array.isArray($.missing)?fromData(void 0):fromData(ae)},ye="no-cache"===ae?0:z===yn.I.refetch&&"merge"!==ie?1:2,resultsFromLink=function(){return X.getResultsFromLink(V,ye,{"variables":ee,"context":de,"fetchPolicy":ae,"errorPolicy":ce})},_e=pe&&"number"==typeof fe&&fe!==z&&(0,yn.O)(z);switch(ae){default:case"cache-first":return(Se=readCache()).complete?{"fromLink":!1,"sources":[resultsFromCache(Se,V.markReady())]}:le||_e?{"fromLink":!0,"sources":[resultsFromCache(Se),resultsFromLink()]}:{"fromLink":!0,"sources":[resultsFromLink()]};case"cache-and-network":var Se;return(Se=readCache()).complete||le||_e?{"fromLink":!0,"sources":[resultsFromCache(Se),resultsFromLink()]}:{"fromLink":!0,"sources":[resultsFromLink()]};case"cache-only":return{"fromLink":!1,"sources":[resultsFromCache(readCache(),V.markReady())]};case"network-only":return _e?{"fromLink":!0,"sources":[resultsFromCache(readCache()),resultsFromLink()]}:{"fromLink":!0,"sources":[resultsFromLink()]};case"no-cache":return _e?{"fromLink":!0,"sources":[resultsFromCache(V.getDiff()),resultsFromLink()]}:{"fromLink":!0,"sources":[resultsFromLink()]};case"standby":return{"fromLink":!1,"sources":[]}}},QueryManager.prototype.getQuery=function(V){return V&&!this.queries.has(V)&&this.queries.set(V,new Yn(this,V)),this.queries.get(V)},QueryManager.prototype.prepareContext=function(V){void 0===V&&(V={});var $=this.localState.prepareContext(V);return(0,Mt.pi)((0,Mt.pi)({},$),{"clientAwareness":this.clientAwareness})},QueryManager}(),Zn=z(4012),er=!1,tr=function(){function ApolloClient(V){var $=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var z=V.uri,X=V.credentials,Z=V.headers,ee=V.cache,ae=V.ssrMode,ie=void 0!==ae&&ae,ce=V.ssrForceFetchDelay,le=void 0===ce?0:ce,de=V.connectToDevTools,pe=void 0===de?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:de,fe=V.queryDeduplication,ye=void 0===fe||fe,_e=V.defaultOptions,Se=V.assumeImmutableResults,Te=void 0!==Se&&Se,He=V.resolvers,Qe=V.typeDefs,ze=V.fragmentMatcher,bt=V.name,At=V.version,Mt=V.link;if(Mt||(Mt=z?new nn({"uri":z,"credentials":X,"headers":Z}):Ft.empty()),!ee)throw __DEV__?new St.ej("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new St.ej(9);if(this.link=Mt,this.cache=ee,this.disableNetworkFetches=ie||le>0,this.queryDeduplication=ye,this.defaultOptions=_e||Object.create(null),this.typeDefs=Qe,le&&setTimeout((function(){return $.disableNetworkFetches=!1}),le),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),pe&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!er&&pe&&__DEV__&&(er=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var Tt=window.navigator,kt=Tt&&Tt.userAgent,Ct=void 0;"string"==typeof kt&&(kt.indexOf("Chrome/")>-1?Ct="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":kt.indexOf("Firefox/")>-1&&(Ct="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),Ct&&__DEV__&&St.kG.log("Download the Apollo DevTools for a better development experience: "+Ct)}this.version="3.7.16",this.localState=new zn({"cache":ee,"client":this,"resolvers":He,"fragmentMatcher":ze}),this.queryManager=new Jn({"cache":this.cache,"link":this.link,"defaultOptions":this.defaultOptions,"queryDeduplication":ye,"ssrMode":ie,"clientAwareness":{"name":bt,"version":At},"localState":this.localState,"assumeImmutableResults":Te,"onBroadcast":pe?function(){$.devToolsHookCb&&$.devToolsHookCb({"action":{},"state":{"queries":$.queryManager.getQueryStore(),"mutations":$.queryManager.mutationStore||{}},"dataWithOptimisticResults":$.cache.extract(!0)})}:void 0})}return ApolloClient.prototype.stop=function(){this.queryManager.stop()},ApolloClient.prototype.watchQuery=function(V){return this.defaultOptions.watchQuery&&(V=(0,Zn.J)(this.defaultOptions.watchQuery,V)),!this.disableNetworkFetches||"network-only"!==V.fetchPolicy&&"cache-and-network"!==V.fetchPolicy||(V=(0,Mt.pi)((0,Mt.pi)({},V),{"fetchPolicy":"cache-first"})),this.queryManager.watchQuery(V)},ApolloClient.prototype.query=function(V){return this.defaultOptions.query&&(V=(0,Zn.J)(this.defaultOptions.query,V)),__DEV__?(0,St.kG)("cache-and-network"!==V.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):(0,St.kG)("cache-and-network"!==V.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===V.fetchPolicy&&(V=(0,Mt.pi)((0,Mt.pi)({},V),{"fetchPolicy":"cache-first"})),this.queryManager.query(V)},ApolloClient.prototype.mutate=function(V){return this.defaultOptions.mutate&&(V=(0,Zn.J)(this.defaultOptions.mutate,V)),this.queryManager.mutate(V)},ApolloClient.prototype.subscribe=function(V){return this.queryManager.startGraphQLSubscription(V)},ApolloClient.prototype.readQuery=function(V,$){return void 0===$&&($=!1),this.cache.readQuery(V,$)},ApolloClient.prototype.readFragment=function(V,$){return void 0===$&&($=!1),this.cache.readFragment(V,$)},ApolloClient.prototype.writeQuery=function(V){var $=this.cache.writeQuery(V);return!1!==V.broadcast&&this.queryManager.broadcastQueries(),$},ApolloClient.prototype.writeFragment=function(V){var $=this.cache.writeFragment(V);return!1!==V.broadcast&&this.queryManager.broadcastQueries(),$},ApolloClient.prototype.__actionHookForDevTools=function(V){this.devToolsHookCb=V},ApolloClient.prototype.__requestRaw=function(V){return rn(this.link,V)},ApolloClient.prototype.resetStore=function(){var V=this;return Promise.resolve().then((function(){return V.queryManager.clearStore({"discardWatches":!1})})).then((function(){return Promise.all(V.resetStoreCallbacks.map((function(V){return V()})))})).then((function(){return V.reFetchObservableQueries()}))},ApolloClient.prototype.clearStore=function(){var V=this;return Promise.resolve().then((function(){return V.queryManager.clearStore({"discardWatches":!0})})).then((function(){return Promise.all(V.clearStoreCallbacks.map((function(V){return V()})))}))},ApolloClient.prototype.onResetStore=function(V){var $=this;return this.resetStoreCallbacks.push(V),function(){$.resetStoreCallbacks=$.resetStoreCallbacks.filter((function($){return $!==V}))}},ApolloClient.prototype.onClearStore=function(V){var $=this;return this.clearStoreCallbacks.push(V),function(){$.clearStoreCallbacks=$.clearStoreCallbacks.filter((function($){return $!==V}))}},ApolloClient.prototype.reFetchObservableQueries=function(V){return this.queryManager.reFetchObservableQueries(V)},ApolloClient.prototype.refetchQueries=function(V){var $=this.queryManager.refetchQueries(V),z=[],X=[];$.forEach((function(V,$){z.push($),X.push(V)}));var Z=Promise.all(X);return Z.queries=z,Z.results=X,Z.catch((function(V){__DEV__&&St.kG.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(V))})),Z},ApolloClient.prototype.getObservableQueries=function(V){return void 0===V&&(V="active"),this.queryManager.getObservableQueries(V)},ApolloClient.prototype.extract=function(V){return this.cache.extract(V)},ApolloClient.prototype.restore=function(V){return this.cache.restore(V)},ApolloClient.prototype.addResolvers=function(V){this.localState.addResolvers(V)},ApolloClient.prototype.setResolvers=function(V){this.localState.setResolvers(V)},ApolloClient.prototype.getResolvers=function(){return this.localState.getResolvers()},ApolloClient.prototype.setLocalStateFragmentMatcher=function(V){this.localState.setFragmentMatcher(V)},ApolloClient.prototype.setLink=function(V){this.link=this.queryManager.link=V},ApolloClient}(),nr=Ft.from,rr=function(){function ApolloCache(){this.getFragmentDoc=bundle_esm_wrap(getFragmentQueryDocument)}return ApolloCache.prototype.batch=function(V){var $,z=this,X="string"==typeof V.optimistic?V.optimistic:!1===V.optimistic?null:void 0;return this.performTransaction((function(){return $=V.update(z)}),X),$},ApolloCache.prototype.recordOptimisticTransaction=function(V,$){this.performTransaction(V,$)},ApolloCache.prototype.transformDocument=function(V){return V},ApolloCache.prototype.transformForLink=function(V){return V},ApolloCache.prototype.identify=function(V){},ApolloCache.prototype.gc=function(){return[]},ApolloCache.prototype.modify=function(V){return!1},ApolloCache.prototype.readQuery=function(V,$){return void 0===$&&($=!!V.optimistic),this.read((0,Mt.pi)((0,Mt.pi)({},V),{"rootId":V.id||"ROOT_QUERY","optimistic":$}))},ApolloCache.prototype.readFragment=function(V,$){return void 0===$&&($=!!V.optimistic),this.read((0,Mt.pi)((0,Mt.pi)({},V),{"query":this.getFragmentDoc(V.fragment,V.fragmentName),"rootId":V.id,"optimistic":$}))},ApolloCache.prototype.writeQuery=function(V){var $=V.id,z=V.data,X=(0,Mt._T)(V,["id","data"]);return this.write(Object.assign(X,{"dataId":$||"ROOT_QUERY","result":z}))},ApolloCache.prototype.writeFragment=function(V){var $=V.id,z=V.data,X=V.fragment,Z=V.fragmentName,ee=(0,Mt._T)(V,["id","data","fragment","fragmentName"]);return this.write(Object.assign(ee,{"query":this.getFragmentDoc(X,Z),"dataId":$,"result":z}))},ApolloCache.prototype.updateQuery=function(V,$){return this.batch({"update":function(z){var X=z.readQuery(V),Z=$(X);return null==Z?X:(z.writeQuery((0,Mt.pi)((0,Mt.pi)({},V),{"data":Z})),Z)}})},ApolloCache.prototype.updateFragment=function(V,$){return this.batch({"update":function(z){var X=z.readFragment(V),Z=$(X);return null==Z?X:(z.writeFragment((0,Mt.pi)((0,Mt.pi)({},V),{"data":Z})),Z)}})},ApolloCache}(),or=function(V){function MissingFieldError($,z,X,Z){var ee,ae=V.call(this,$)||this;if(ae.message=$,ae.path=z,ae.query=X,ae.variables=Z,Array.isArray(ae.path)){ae.missing=ae.message;for(var ie=ae.path.length-1;ie>=0;--ie)ae.missing=((ee={})[ae.path[ie]]=ae.missing,ee)}else ae.missing=ae.path;return ae.__proto__=MissingFieldError.prototype,ae}return(0,Mt.ZT)(MissingFieldError,V),MissingFieldError}(Error),ar=z(8702),ir=Object.prototype.hasOwnProperty;function isNullish(V){return null==V}function defaultDataIdFromObject(V,$){var z=V.__typename,X=V.id,Z=V._id;if("string"==typeof z&&($&&($.keyObject=isNullish(X)?isNullish(Z)?void 0:{"_id":Z}:{"id":X}),isNullish(X)&&!isNullish(Z)&&(X=Z),!isNullish(X)))return"".concat(z,":").concat("number"==typeof X||"string"==typeof X?X:JSON.stringify(X))}var sr={"dataIdFromObject":defaultDataIdFromObject,"addTypename":!0,"resultCaching":!0,"canonizeResults":!1};function shouldCanonizeResults(V){var $=V.canonizeResults;return void 0===$?sr.canonizeResults:$}var ur=/^[_a-z][_0-9a-z]*/i;function fieldNameFromStoreName(V){var $=V.match(ur);return $?$[0]:V}function selectionSetMatchesResult(V,$,z){return!!(0,Pt.s)($)&&((0,Kt.k)($)?$.every((function($){return selectionSetMatchesResult(V,$,z)})):V.selections.every((function(V){if(storeUtils_isField(V)&&shouldInclude(V,z)){var X=resultKeyNameFromField(V);return ir.call($,X)&&(!V.selectionSet||selectionSetMatchesResult(V.selectionSet,$[X],z))}return!0})))}function storeValueIsStoreObject(V){return(0,Pt.s)(V)&&!isReference(V)&&!(0,Kt.k)(V)}function extractFragmentContext(V,$){var z=createFragmentMap(getFragmentDefinitions(V));return{"fragmentMap":z,"lookupFragment":function(V){var X=z[V];return!X&&$&&(X=$.lookup(V)),X||null}}}var cr=Object.create(null),delModifier=function(){return cr},lr=Object.create(null),dr=function(){function EntityStore(V,$){var z=this;this.policies=V,this.group=$,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(V,$){return(0,ar.J)(isReference(V)?z.get(V.__ref,$):V&&V[$])},this.canRead=function(V){return isReference(V)?z.has(V.__ref):"object"==typeof V},this.toReference=function(V,$){if("string"==typeof V)return makeReference(V);if(isReference(V))return V;var X=z.policies.identify(V)[0];if(X){var Z=makeReference(X);return $&&z.merge(X,V),Z}}}return EntityStore.prototype.toObject=function(){return(0,Mt.pi)({},this.data)},EntityStore.prototype.has=function(V){return void 0!==this.lookup(V,!0)},EntityStore.prototype.get=function(V,$){if(this.group.depend(V,$),ir.call(this.data,V)){var z=this.data[V];if(z&&ir.call(z,$))return z[$]}return"__typename"===$&&ir.call(this.policies.rootTypenamesById,V)?this.policies.rootTypenamesById[V]:this instanceof fr?this.parent.get(V,$):void 0},EntityStore.prototype.lookup=function(V,$){return $&&this.group.depend(V,"__exists"),ir.call(this.data,V)?this.data[V]:this instanceof fr?this.parent.lookup(V,$):this.policies.rootTypenamesById[V]?Object.create(null):void 0},EntityStore.prototype.merge=function(V,$){var z,X=this;isReference(V)&&(V=V.__ref),isReference($)&&($=$.__ref);var Z="string"==typeof V?this.lookup(z=V):V,ee="string"==typeof $?this.lookup(z=$):$;if(ee){__DEV__?(0,St.kG)("string"==typeof z,"store.merge expects a string ID"):(0,St.kG)("string"==typeof z,1);var ae=new zt(storeObjectReconciler).merge(Z,ee);if(this.data[z]=ae,ae!==Z&&(delete this.refs[z],this.group.caching)){var ie=Object.create(null);Z||(ie.__exists=1),Object.keys(ee).forEach((function(V){if(!Z||Z[V]!==ae[V]){ie[V]=1;var $=fieldNameFromStoreName(V);$===V||X.policies.hasKeyArgs(ae.__typename,$)||(ie[$]=1),void 0!==ae[V]||X instanceof fr||delete ae[V]}})),!ie.__typename||Z&&Z.__typename||this.policies.rootTypenamesById[z]!==ae.__typename||delete ie.__typename,Object.keys(ie).forEach((function(V){return X.group.dirty(z,V)}))}}},EntityStore.prototype.modify=function(V,$){var z=this,X=this.lookup(V);if(X){var Z=Object.create(null),ee=!1,ae=!0,ie={"DELETE":cr,"INVALIDATE":lr,"isReference":isReference,"toReference":this.toReference,"canRead":this.canRead,"readField":function($,X){return z.policies.readField("string"==typeof $?{"fieldName":$,"from":X||makeReference(V)}:$,{"store":z})}};if(Object.keys(X).forEach((function(ce){var le=fieldNameFromStoreName(ce),de=X[ce];if(void 0!==de){var pe="function"==typeof $?$:$[ce]||$[le];if(pe){var fe=pe===delModifier?cr:pe((0,ar.J)(de),(0,Mt.pi)((0,Mt.pi)({},ie),{"fieldName":le,"storeFieldName":ce,"storage":z.getStorage(V,ce)}));fe===lr?z.group.dirty(V,ce):(fe===cr&&(fe=void 0),fe!==de&&(Z[ce]=fe,ee=!0,de=fe))}void 0!==de&&(ae=!1)}})),ee)return this.merge(V,Z),ae&&(this instanceof fr?this.data[V]=void 0:delete this.data[V],this.group.dirty(V,"__exists")),!0}return!1},EntityStore.prototype.delete=function(V,$,z){var X,Z=this.lookup(V);if(Z){var ee=this.getFieldValue(Z,"__typename"),ae=$&&z?this.policies.getStoreFieldName({"typename":ee,"fieldName":$,"args":z}):$;return this.modify(V,ae?((X={})[ae]=delModifier,X):delModifier)}return!1},EntityStore.prototype.evict=function(V,$){var z=!1;return V.id&&(ir.call(this.data,V.id)&&(z=this.delete(V.id,V.fieldName,V.args)),this instanceof fr&&this!==$&&(z=this.parent.evict(V,$)||z),(V.fieldName||z)&&this.group.dirty(V.id,V.fieldName||"__exists")),z},EntityStore.prototype.clear=function(){this.replace(null)},EntityStore.prototype.extract=function(){var V=this,$=this.toObject(),z=[];return this.getRootIdSet().forEach((function($){ir.call(V.policies.rootTypenamesById,$)||z.push($)})),z.length&&($.__META={"extraRootIds":z.sort()}),$},EntityStore.prototype.replace=function(V){var $=this;if(Object.keys(this.data).forEach((function(z){V&&ir.call(V,z)||$.delete(z)})),V){var z=V.__META,X=(0,Mt._T)(V,["__META"]);Object.keys(X).forEach((function(V){$.merge(V,X[V])})),z&&z.extraRootIds.forEach(this.retain,this)}},EntityStore.prototype.retain=function(V){return this.rootIds[V]=(this.rootIds[V]||0)+1},EntityStore.prototype.release=function(V){if(this.rootIds[V]>0){var $=--this.rootIds[V];return $||delete this.rootIds[V],$}return 0},EntityStore.prototype.getRootIdSet=function(V){return void 0===V&&(V=new Set),Object.keys(this.rootIds).forEach(V.add,V),this instanceof fr?this.parent.getRootIdSet(V):Object.keys(this.policies.rootTypenamesById).forEach(V.add,V),V},EntityStore.prototype.gc=function(){var V=this,$=this.getRootIdSet(),z=this.toObject();$.forEach((function(X){ir.call(z,X)&&(Object.keys(V.findChildRefIds(X)).forEach($.add,$),delete z[X])}));var X=Object.keys(z);if(X.length){for(var Z=this;Z instanceof fr;)Z=Z.parent;X.forEach((function(V){return Z.delete(V)}))}return X},EntityStore.prototype.findChildRefIds=function(V){if(!ir.call(this.refs,V)){var $=this.refs[V]=Object.create(null),z=this.data[V];if(!z)return $;var X=new Set([z]);X.forEach((function(V){isReference(V)&&($[V.__ref]=!0),(0,Pt.s)(V)&&Object.keys(V).forEach((function($){var z=V[$];(0,Pt.s)(z)&&X.add(z)}))}))}return this.refs[V]},EntityStore.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},EntityStore}(),pr=function(){function CacheGroup(V,$){void 0===$&&($=null),this.caching=V,this.parent=$,this.d=null,this.resetCaching()}return CacheGroup.prototype.resetCaching=function(){this.d=this.caching?dep():null,this.keyMaker=new Trie(Ht.mr)},CacheGroup.prototype.depend=function(V,$){if(this.d){this.d(makeDepKey(V,$));var z=fieldNameFromStoreName($);z!==$&&this.d(makeDepKey(V,z)),this.parent&&this.parent.depend(V,$)}},CacheGroup.prototype.dirty=function(V,$){this.d&&this.d.dirty(makeDepKey(V,$),"__exists"===$?"forget":"setDirty")},CacheGroup}();function makeDepKey(V,$){return $+"#"+V}function maybeDependOnExistenceOfEntity(V,$){supportsResultCaching(V)&&V.group.depend($,"__exists")}!function(V){var $=function(V){function Root($){var z=$.policies,X=$.resultCaching,Z=void 0===X||X,ee=$.seed,ae=V.call(this,z,new pr(Z))||this;return ae.stump=new hr(ae),ae.storageTrie=new Trie(Ht.mr),ee&&ae.replace(ee),ae}return(0,Mt.ZT)(Root,V),Root.prototype.addLayer=function(V,$){return this.stump.addLayer(V,$)},Root.prototype.removeLayer=function(){return this},Root.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},Root}(V);V.Root=$}(dr||(dr={}));var fr=function(V){function Layer($,z,X,Z){var ee=V.call(this,z.policies,Z)||this;return ee.id=$,ee.parent=z,ee.replay=X,ee.group=Z,X(ee),ee}return(0,Mt.ZT)(Layer,V),Layer.prototype.addLayer=function(V,$){return new Layer(V,this,$,this.group)},Layer.prototype.removeLayer=function(V){var $=this,z=this.parent.removeLayer(V);return V===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(V){var X=$.data[V],Z=z.lookup(V);Z?X?X!==Z&&Object.keys(X).forEach((function(z){(0,on.D)(X[z],Z[z])||$.group.dirty(V,z)})):($.group.dirty(V,"__exists"),Object.keys(Z).forEach((function(z){$.group.dirty(V,z)}))):$.delete(V)})),z):z===this.parent?this:z.addLayer(this.id,this.replay)},Layer.prototype.toObject=function(){return(0,Mt.pi)((0,Mt.pi)({},this.parent.toObject()),this.data)},Layer.prototype.findChildRefIds=function($){var z=this.parent.findChildRefIds($);return ir.call(this.data,$)?(0,Mt.pi)((0,Mt.pi)({},z),V.prototype.findChildRefIds.call(this,$)):z},Layer.prototype.getStorage=function(){for(var V=this.parent;V.parent;)V=V.parent;return V.getStorage.apply(V,arguments)},Layer}(dr),hr=function(V){function Stump($){return V.call(this,"EntityStore.Stump",$,(function(){}),new pr($.group.caching,$.group))||this}return(0,Mt.ZT)(Stump,V),Stump.prototype.removeLayer=function(){return this},Stump.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},Stump}(fr);function storeObjectReconciler(V,$,z){var X=V[z],Z=$[z];return(0,on.D)(X,Z)?X:Z}function supportsResultCaching(V){return!!(V instanceof dr&&V.group.caching)}function execSelectionSetKeyArgs(V){return[V.selectionSet,V.objectOrReference,V.context,V.context.canonizeResults]}var gr=function(){function StoreReader(V){var $=this;this.knownResults=new(Ht.mr?WeakMap:Map),this.config=(0,bn.o)(V,{"addTypename":!1!==V.addTypename,"canonizeResults":shouldCanonizeResults(V)}),this.canon=V.canon||new dn,this.executeSelectionSet=bundle_esm_wrap((function(V){var z,X=V.context.canonizeResults,Z=execSelectionSetKeyArgs(V);Z[3]=!X;var ee=(z=$.executeSelectionSet).peek.apply(z,Z);return ee?X?(0,Mt.pi)((0,Mt.pi)({},ee),{"result":$.canon.admit(ee.result)}):ee:(maybeDependOnExistenceOfEntity(V.context.store,V.enclosingRef.__ref),$.execSelectionSetImpl(V))}),{"max":this.config.resultCacheMaxSize,"keyArgs":execSelectionSetKeyArgs,"makeCacheKey":function(V,$,z,X){if(supportsResultCaching(z.store))return z.store.makeCacheKey(V,isReference($)?$.__ref:$,z.varString,X)}}),this.executeSubSelectedArray=bundle_esm_wrap((function(V){return maybeDependOnExistenceOfEntity(V.context.store,V.enclosingRef.__ref),$.execSubSelectedArrayImpl(V)}),{"max":this.config.resultCacheMaxSize,"makeCacheKey":function(V){var $=V.field,z=V.array,X=V.context;if(supportsResultCaching(X.store))return X.store.makeCacheKey($,z,X.varString)}})}return StoreReader.prototype.resetCanon=function(){this.canon=new dn},StoreReader.prototype.diffQueryAgainstStore=function(V){var $=V.store,z=V.query,X=V.rootId,Z=void 0===X?"ROOT_QUERY":X,ee=V.variables,ae=V.returnPartialData,ie=void 0===ae||ae,ce=V.canonizeResults,le=void 0===ce?this.config.canonizeResults:ce,de=this.config.cache.policies;ee=(0,Mt.pi)((0,Mt.pi)({},getDefaultValues(getQueryDefinition(z))),ee);var pe,fe=makeReference(Z),ye=this.executeSelectionSet({"selectionSet":getMainDefinition(z).selectionSet,"objectOrReference":fe,"enclosingRef":fe,"context":(0,Mt.pi)({"store":$,"query":z,"policies":de,"variables":ee,"varString":pn(ee),"canonizeResults":le},extractFragmentContext(z,this.config.fragments))});if(ye.missing&&(pe=[new or(firstMissing(ye.missing),ye.missing,z,ee)],!ie))throw pe[0];return{"result":ye.result,"complete":!pe,"missing":pe}},StoreReader.prototype.isFresh=function(V,$,z,X){if(supportsResultCaching(X.store)&&this.knownResults.get(V)===z){var Z=this.executeSelectionSet.peek(z,$,X,this.canon.isKnown(V));if(Z&&V===Z.result)return!0}return!1},StoreReader.prototype.execSelectionSetImpl=function(V){var $=this,z=V.selectionSet,X=V.objectOrReference,Z=V.enclosingRef,ee=V.context;if(isReference(X)&&!ee.policies.rootTypenamesById[X.__ref]&&!ee.store.has(X.__ref))return{"result":this.canon.empty,"missing":"Dangling reference to missing ".concat(X.__ref," object")};var ae,ie=ee.variables,ce=ee.policies,le=ee.store.getFieldValue(X,"__typename"),de=[],pe=new zt;function handleMissing(V,$){var z;return V.missing&&(ae=pe.merge(ae,((z={})[$]=V.missing,z))),V.result}this.config.addTypename&&"string"==typeof le&&!ce.rootIdsByTypename[le]&&de.push({"__typename":le});var fe=new Set(z.selections);fe.forEach((function(V){var z,ye;if(shouldInclude(V,ie))if(storeUtils_isField(V)){var _e=ce.readField({"fieldName":V.name.value,"field":V,"variables":ee.variables,"from":X},ee),Se=resultKeyNameFromField(V);void 0===_e?hn.added(V)||(ae=pe.merge(ae,((z={})[Se]="Can't find field '".concat(V.name.value,"' on ").concat(isReference(X)?X.__ref+" object":"object "+JSON.stringify(X,null,2)),z))):(0,Kt.k)(_e)?_e=handleMissing($.executeSubSelectedArray({"field":V,"array":_e,"enclosingRef":Z,"context":ee}),Se):V.selectionSet?null!=_e&&(_e=handleMissing($.executeSelectionSet({"selectionSet":V.selectionSet,"objectOrReference":_e,"enclosingRef":isReference(_e)?_e:Z,"context":ee}),Se)):ee.canonizeResults&&(_e=$.canon.pass(_e)),void 0!==_e&&de.push(((ye={})[Se]=_e,ye))}else{var Te=getFragmentFromSelection(V,ee.lookupFragment);if(!Te&&V.kind===qt.h.FRAGMENT_SPREAD)throw __DEV__?new St.ej("No fragment named ".concat(V.name.value)):new St.ej(5);Te&&ce.fragmentMatches(Te,le)&&Te.selectionSet.selections.forEach(fe.add,fe)}}));var ye={"result":mergeDeepArray(de),"missing":ae},_e=ee.canonizeResults?this.canon.admit(ye):(0,ar.J)(ye);return _e.result&&this.knownResults.set(_e.result,z),_e},StoreReader.prototype.execSubSelectedArrayImpl=function(V){var $,z=this,X=V.field,Z=V.array,ee=V.enclosingRef,ae=V.context,ie=new zt;function handleMissing(V,z){var X;return V.missing&&($=ie.merge($,((X={})[z]=V.missing,X))),V.result}return X.selectionSet&&(Z=Z.filter(ae.store.canRead)),Z=Z.map((function(V,$){return null===V?null:(0,Kt.k)(V)?handleMissing(z.executeSubSelectedArray({"field":X,"array":V,"enclosingRef":ee,"context":ae}),$):X.selectionSet?handleMissing(z.executeSelectionSet({"selectionSet":X.selectionSet,"objectOrReference":V,"enclosingRef":isReference(V)?V:ee,"context":ae}),$):(__DEV__&&function assertSelectionSetForIdValue(V,$,z){if(!$.selectionSet){var X=new Set([z]);X.forEach((function(z){(0,Pt.s)(z)&&(__DEV__?(0,St.kG)(!isReference(z),"Missing selection set for object of type ".concat(function getTypenameFromStoreObject(V,$){return isReference($)?V.get($.__ref,"__typename"):$&&$.__typename}(V,z)," returned for query field ").concat($.name.value)):(0,St.kG)(!isReference(z),6),Object.values(z).forEach(X.add,X))}))}}(ae.store,X,V),V)})),{"result":ae.canonizeResults?this.canon.admit(Z):Z,"missing":$}},StoreReader}();function firstMissing(V){try{JSON.stringify(V,(function(V,$){if("string"==typeof $)throw $;return $}))}catch(V){return V}}var mr=Object.create(null);function lookupSpecifierInfo(V){var $=JSON.stringify(V);return mr[$]||(mr[$]=Object.create(null))}function keyFieldsFnFromSpecifier(V){var $=lookupSpecifierInfo(V);return $.keyFieldsFn||($.keyFieldsFn=function($,z){var extract=function(V,$){return z.readField($,V)},X=z.keyObject=collectSpecifierPaths(V,(function(V){var X=extractKeyPath(z.storeObject,V,extract);return void 0===X&&$!==z.storeObject&&ir.call($,V[0])&&(X=extractKeyPath($,V,extractKey)),__DEV__?(0,St.kG)(void 0!==X,"Missing field '".concat(V.join("."),"' while extracting keyFields from ").concat(JSON.stringify($))):(0,St.kG)(void 0!==X,2),X}));return"".concat(z.typename,":").concat(JSON.stringify(X))})}function keyArgsFnFromSpecifier(V){var $=lookupSpecifierInfo(V);return $.keyArgsFn||($.keyArgsFn=function($,z){var X=z.field,Z=z.variables,ee=z.fieldName,ae=collectSpecifierPaths(V,(function(V){var z=V[0],ee=z.charAt(0);if("@"!==ee)if("$"!==ee){if($)return extractKeyPath($,V)}else{var ae=z.slice(1);if(Z&&ir.call(Z,ae)){var ie=V.slice(0);return ie[0]=ae,extractKeyPath(Z,ie)}}else if(X&&(0,Kt.O)(X.directives)){var ce=z.slice(1),le=X.directives.find((function(V){return V.name.value===ce})),de=le&&argumentsObjectFromField(le,Z);return de&&extractKeyPath(de,V.slice(1))}})),ie=JSON.stringify(ae);return($||"{}"!==ie)&&(ee+=":"+ie),ee})}function collectSpecifierPaths(V,$){var z=new zt;return getSpecifierPaths(V).reduce((function(V,X){var Z,ee=$(X);if(void 0!==ee){for(var ae=X.length-1;ae>=0;--ae)(Z={})[X[ae]]=ee,ee=Z;V=z.merge(V,ee)}return V}),Object.create(null))}function getSpecifierPaths(V){var $=lookupSpecifierInfo(V);if(!$.paths){var z=$.paths=[],X=[];V.forEach((function($,Z){(0,Kt.k)($)?(getSpecifierPaths($).forEach((function(V){return z.push(X.concat(V))})),X.length=0):(X.push($),(0,Kt.k)(V[Z+1])||(z.push(X.slice(0)),X.length=0))}))}return $.paths}function extractKey(V,$){return V[$]}function extractKeyPath(V,$,z){return z=z||extractKey,normalize($.reduce((function reducer(V,$){return(0,Kt.k)(V)?V.map((function(V){return reducer(V,$)})):V&&z(V,$)}),V))}function normalize(V){return(0,Pt.s)(V)?(0,Kt.k)(V)?V.map(normalize):collectSpecifierPaths(Object.keys(V).sort(),(function($){return extractKeyPath(V,$)})):V}function argsFromFieldSpecifier(V){return void 0!==V.args?V.args:V.field?argumentsObjectFromField(V.field,V.variables):null}Lt.setStringify(pn);var nullKeyFieldsFn=function(){},simpleKeyArgsFn=function(V,$){return $.fieldName},mergeTrueFn=function(V,$,z){return(0,z.mergeObjects)(V,$)},mergeFalseFn=function(V,$){return $},vr=function(){function Policies(V){this.config=V,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,Mt.pi)({"dataIdFromObject":defaultDataIdFromObject},V),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),V.possibleTypes&&this.addPossibleTypes(V.possibleTypes),V.typePolicies&&this.addTypePolicies(V.typePolicies)}return Policies.prototype.identify=function(V,$){var z,X=this,Z=$&&($.typename||(null===(z=$.storeObject)||void 0===z?void 0:z.__typename))||V.__typename;if(Z===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var ee,ae=$&&$.storeObject||V,ie=(0,Mt.pi)((0,Mt.pi)({},$),{"typename":Z,"storeObject":ae,"readField":$&&$.readField||function(){var V=normalizeReadFieldOptions(arguments,ae);return X.readField(V,{"store":X.cache.data,"variables":V.variables})}}),ce=Z&&this.getTypePolicy(Z),le=ce&&ce.keyFn||this.config.dataIdFromObject;le;){var de=le((0,Mt.pi)((0,Mt.pi)({},V),ae),ie);if(!(0,Kt.k)(de)){ee=de;break}le=keyFieldsFnFromSpecifier(de)}return ee=ee?String(ee):void 0,ie.keyObject?[ee,ie.keyObject]:[ee]},Policies.prototype.addTypePolicies=function(V){var $=this;Object.keys(V).forEach((function(z){var X=V[z],Z=X.queryType,ee=X.mutationType,ae=X.subscriptionType,ie=(0,Mt._T)(X,["queryType","mutationType","subscriptionType"]);Z&&$.setRootTypename("Query",z),ee&&$.setRootTypename("Mutation",z),ae&&$.setRootTypename("Subscription",z),ir.call($.toBeAdded,z)?$.toBeAdded[z].push(ie):$.toBeAdded[z]=[ie]}))},Policies.prototype.updateTypePolicy=function(V,$){var z=this,X=this.getTypePolicy(V),Z=$.keyFields,ee=$.fields;function setMerge(V,$){V.merge="function"==typeof $?$:!0===$?mergeTrueFn:!1===$?mergeFalseFn:V.merge}setMerge(X,$.merge),X.keyFn=!1===Z?nullKeyFieldsFn:(0,Kt.k)(Z)?keyFieldsFnFromSpecifier(Z):"function"==typeof Z?Z:X.keyFn,ee&&Object.keys(ee).forEach((function($){var X=z.getFieldPolicy(V,$,!0),Z=ee[$];if("function"==typeof Z)X.read=Z;else{var ae=Z.keyArgs,ie=Z.read,ce=Z.merge;X.keyFn=!1===ae?simpleKeyArgsFn:(0,Kt.k)(ae)?keyArgsFnFromSpecifier(ae):"function"==typeof ae?ae:X.keyFn,"function"==typeof ie&&(X.read=ie),setMerge(X,ce)}X.read&&X.merge&&(X.keyFn=X.keyFn||simpleKeyArgsFn)}))},Policies.prototype.setRootTypename=function(V,$){void 0===$&&($=V);var z="ROOT_"+V.toUpperCase(),X=this.rootTypenamesById[z];$!==X&&(__DEV__?(0,St.kG)(!X||X===V,"Cannot change root ".concat(V," __typename more than once")):(0,St.kG)(!X||X===V,3),X&&delete this.rootIdsByTypename[X],this.rootIdsByTypename[$]=z,this.rootTypenamesById[z]=$)},Policies.prototype.addPossibleTypes=function(V){var $=this;this.usingPossibleTypes=!0,Object.keys(V).forEach((function(z){$.getSupertypeSet(z,!0),V[z].forEach((function(V){$.getSupertypeSet(V,!0).add(z);var X=V.match(ur);X&&X[0]===V||$.fuzzySubtypes.set(V,new RegExp(V))}))}))},Policies.prototype.getTypePolicy=function(V){var $=this;if(!ir.call(this.typePolicies,V)){var z=this.typePolicies[V]=Object.create(null);z.fields=Object.create(null);var X=this.supertypeMap.get(V);X&&X.size&&X.forEach((function(V){var X=$.getTypePolicy(V),Z=X.fields,ee=(0,Mt._T)(X,["fields"]);Object.assign(z,ee),Object.assign(z.fields,Z)}))}var Z=this.toBeAdded[V];return Z&&Z.length&&Z.splice(0).forEach((function(z){$.updateTypePolicy(V,z)})),this.typePolicies[V]},Policies.prototype.getFieldPolicy=function(V,$,z){if(V){var X=this.getTypePolicy(V).fields;return X[$]||z&&(X[$]=Object.create(null))}},Policies.prototype.getSupertypeSet=function(V,$){var z=this.supertypeMap.get(V);return!z&&$&&this.supertypeMap.set(V,z=new Set),z},Policies.prototype.fragmentMatches=function(V,$,z,X){var Z=this;if(!V.typeCondition)return!0;if(!$)return!1;var ee=V.typeCondition.name.value;if($===ee)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(ee))for(var ae=this.getSupertypeSet($,!0),ie=[ae],maybeEnqueue_1=function(V){var $=Z.getSupertypeSet(V,!1);$&&$.size&&ie.indexOf($)<0&&ie.push($)},ce=!(!z||!this.fuzzySubtypes.size),le=!1,de=0;de1?ee:$}:(X=(0,Mt.pi)({},Z),ir.call(X,"from")||(X.from=$)),__DEV__&&void 0===X.from&&__DEV__&&St.kG.warn("Undefined 'from' passed to readField with arguments ".concat(function stringifyForDisplay(V){var $=makeUniqueId("stringifyForDisplay");return JSON.stringify(V,(function(V,z){return void 0===z?$:z})).split(JSON.stringify($)).join("")}(Array.from(V)))),void 0===X.variables&&(X.variables=z),X}function makeMergeObjectsFunction(V){return function mergeObjects($,z){if((0,Kt.k)($)||(0,Kt.k)(z))throw __DEV__?new St.ej("Cannot automatically merge arrays"):new St.ej(4);if((0,Pt.s)($)&&(0,Pt.s)(z)){var X=V.getFieldValue($,"__typename"),Z=V.getFieldValue(z,"__typename");if(X&&Z&&X!==Z)return z;if(isReference($)&&storeValueIsStoreObject(z))return V.merge($.__ref,z),$;if(storeValueIsStoreObject($)&&isReference(z))return V.merge($,z.__ref),z;if(storeValueIsStoreObject($)&&storeValueIsStoreObject(z))return(0,Mt.pi)((0,Mt.pi)({},$),z)}return z}}function getContextFlavor(V,$,z){var X="".concat($).concat(z),Z=V.flavors.get(X);return Z||V.flavors.set(X,Z=V.clientOnly===$&&V.deferred===z?V:(0,Mt.pi)((0,Mt.pi)({},V),{"clientOnly":$,"deferred":z})),Z}var yr=function(){function StoreWriter(V,$,z){this.cache=V,this.reader=$,this.fragments=z}return StoreWriter.prototype.writeToStore=function(V,$){var z=this,X=$.query,Z=$.result,ee=$.dataId,ae=$.variables,ie=$.overwrite,ce=getOperationDefinition(X),le=function makeProcessedFieldsMerger(){return new zt}();ae=(0,Mt.pi)((0,Mt.pi)({},getDefaultValues(ce)),ae);var de=(0,Mt.pi)((0,Mt.pi)({"store":V,"written":Object.create(null),"merge":function(V,$){return le.merge(V,$)},"variables":ae,"varString":pn(ae)},extractFragmentContext(X,this.fragments)),{"overwrite":!!ie,"incomingById":new Map,"clientOnly":!1,"deferred":!1,"flavors":new Map}),pe=this.processSelectionSet({"result":Z||Object.create(null),"dataId":ee,"selectionSet":ce.selectionSet,"mergeTree":{"map":new Map},"context":de});if(!isReference(pe))throw __DEV__?new St.ej("Could not identify object ".concat(JSON.stringify(Z))):new St.ej(7);return de.incomingById.forEach((function($,X){var Z=$.storeObject,ee=$.mergeTree,ae=$.fieldNodeSet,ie=makeReference(X);if(ee&&ee.map.size){var ce=z.applyMerges(ee,ie,Z,de);if(isReference(ce))return;Z=ce}if(__DEV__&&!de.overwrite){var le=Object.create(null);ae.forEach((function(V){V.selectionSet&&(le[V.name.value]=!0)}));Object.keys(Z).forEach((function(V){(function(V){return!0===le[fieldNameFromStoreName(V)]})(V)&&!function(V){var $=ee&&ee.map.get(V);return Boolean($&&$.info&&$.info.merge)}(V)&&function warnAboutDataLoss(V,$,z,X){var getChild=function(V){var $=X.getFieldValue(V,z);return"object"==typeof $&&$},Z=getChild(V);if(!Z)return;var ee=getChild($);if(!ee)return;if(isReference(Z))return;if((0,on.D)(Z,ee))return;if(Object.keys(Z).every((function(V){return void 0!==X.getFieldValue(ee,V)})))return;var ae=X.getFieldValue(V,"__typename")||X.getFieldValue($,"__typename"),ie=fieldNameFromStoreName(z),ce="".concat(ae,".").concat(ie);if(br.has(ce))return;br.add(ce);var le=[];(0,Kt.k)(Z)||(0,Kt.k)(ee)||[Z,ee].forEach((function(V){var $=X.getFieldValue(V,"__typename");"string"!=typeof $||le.includes($)||le.push($)}));__DEV__&&St.kG.warn("Cache data may be lost when replacing the ".concat(ie," field of a ").concat(ae," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(le.length?"either ensure all objects of type "+le.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(ce," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(Z).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(ee).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(ie,Z,V,de.store)}))}V.merge(X,Z)})),V.retain(pe.__ref),pe},StoreWriter.prototype.processSelectionSet=function(V){var $=this,z=V.dataId,X=V.result,Z=V.selectionSet,ee=V.context,ae=V.mergeTree,ie=this.cache.policies,ce=Object.create(null),le=z&&ie.rootTypenamesById[z]||getTypenameFromResult(X,Z,ee.fragmentMap)||z&&ee.store.get(z,"__typename");"string"==typeof le&&(ce.__typename=le);var readField=function(){var V=normalizeReadFieldOptions(arguments,ce,ee.variables);if(isReference(V.from)){var $=ee.incomingById.get(V.from.__ref);if($){var z=ie.readField((0,Mt.pi)((0,Mt.pi)({},V),{"from":$.storeObject}),ee);if(void 0!==z)return z}}return ie.readField(V,ee)},de=new Set;this.flattenFields(Z,X,ee,le).forEach((function(V,z){var Z,ee=resultKeyNameFromField(z),pe=X[ee];if(de.add(z),void 0!==pe){var fe=ie.getStoreFieldName({"typename":le,"fieldName":z.name.value,"field":z,"variables":V.variables}),ye=getChildMergeTree(ae,fe),_e=$.processFieldValue(pe,z,z.selectionSet?getContextFlavor(V,!1,!1):V,ye),Se=void 0;z.selectionSet&&(isReference(_e)||storeValueIsStoreObject(_e))&&(Se=readField("__typename",_e));var Te=ie.getMergeFunction(le,z.name.value,Se);Te?ye.info={"field":z,"typename":le,"merge":Te}:maybeRecycleChildMergeTree(ae,fe),ce=V.merge(ce,((Z={})[fe]=_e,Z))}else!__DEV__||V.clientOnly||V.deferred||hn.added(z)||ie.getReadFunction(le,z.name.value)||__DEV__&&St.kG.error("Missing field '".concat(resultKeyNameFromField(z),"' while writing result ").concat(JSON.stringify(X,null,2)).substring(0,1e3))}));try{var pe=ie.identify(X,{"typename":le,"selectionSet":Z,"fragmentMap":ee.fragmentMap,"storeObject":ce,"readField":readField}),fe=pe[0],ye=pe[1];z=z||fe,ye&&(ce=ee.merge(ce,ye))}catch(V){if(!z)throw V}if("string"==typeof z){var _e=makeReference(z),Se=ee.written[z]||(ee.written[z]=[]);if(Se.indexOf(Z)>=0)return _e;if(Se.push(Z),this.reader&&this.reader.isFresh(X,_e,Z,ee))return _e;var Te=ee.incomingById.get(z);return Te?(Te.storeObject=ee.merge(Te.storeObject,ce),Te.mergeTree=mergeMergeTrees(Te.mergeTree,ae),de.forEach((function(V){return Te.fieldNodeSet.add(V)}))):ee.incomingById.set(z,{"storeObject":ce,"mergeTree":mergeTreeIsEmpty(ae)?void 0:ae,"fieldNodeSet":de}),_e}return ce},StoreWriter.prototype.processFieldValue=function(V,$,z,X){var Z=this;return $.selectionSet&&null!==V?(0,Kt.k)(V)?V.map((function(V,ee){var ae=Z.processFieldValue(V,$,z,getChildMergeTree(X,ee));return maybeRecycleChildMergeTree(X,ee),ae})):this.processSelectionSet({"result":V,"selectionSet":$.selectionSet,"context":z,"mergeTree":X}):__DEV__?cloneDeep(V):V},StoreWriter.prototype.flattenFields=function(V,$,z,X){void 0===X&&(X=getTypenameFromResult($,V,z.fragmentMap));var Z=new Map,ee=this.cache.policies,ae=new Trie(!1);return function flatten(V,ie){var ce=ae.lookup(V,ie.clientOnly,ie.deferred);ce.visited||(ce.visited=!0,V.selections.forEach((function(V){if(shouldInclude(V,z.variables)){var ae=ie.clientOnly,ce=ie.deferred;if(ae&&ce||!(0,Kt.O)(V.directives)||V.directives.forEach((function(V){var $=V.name.value;if("client"===$&&(ae=!0),"defer"===$){var X=argumentsObjectFromField(V,z.variables);X&&!1===X.if||(ce=!0)}})),storeUtils_isField(V)){var le=Z.get(V);le&&(ae=ae&&le.clientOnly,ce=ce&&le.deferred),Z.set(V,getContextFlavor(z,ae,ce))}else{var de=getFragmentFromSelection(V,z.lookupFragment);if(!de&&V.kind===qt.h.FRAGMENT_SPREAD)throw __DEV__?new St.ej("No fragment named ".concat(V.name.value)):new St.ej(8);de&&ee.fragmentMatches(de,X,$,z.variables)&&flatten(de.selectionSet,getContextFlavor(z,ae,ce))}}})))}(V,z),Z},StoreWriter.prototype.applyMerges=function(V,$,z,X,Z){var ee,ae=this;if(V.map.size&&!isReference(z)){var ie,ce=(0,Kt.k)(z)||!isReference($)&&!storeValueIsStoreObject($)?void 0:$,le=z;ce&&!Z&&(Z=[isReference(ce)?ce.__ref:ce]);var getValue_1=function(V,$){return(0,Kt.k)(V)?"number"==typeof $?V[$]:void 0:X.store.getFieldValue(V,String($))};V.map.forEach((function(V,$){var z=getValue_1(ce,$),ee=getValue_1(le,$);if(void 0!==ee){Z&&Z.push($);var de=ae.applyMerges(V,z,ee,X,Z);de!==ee&&(ie=ie||new Map).set($,de),Z&&(0,St.kG)(Z.pop()===$)}})),ie&&(z=(0,Kt.k)(le)?le.slice(0):(0,Mt.pi)({},le),ie.forEach((function(V,$){z[$]=V})))}return V.info?this.cache.policies.runMergeFunction($,z,V.info,X,Z&&(ee=X.store).getStorage.apply(ee,Z)):z},StoreWriter}(),_r=[];function getChildMergeTree(V,$){var z=V.map;return z.has($)||z.set($,_r.pop()||{"map":new Map}),z.get($)}function mergeMergeTrees(V,$){if(V===$||!$||mergeTreeIsEmpty($))return V;if(!V||mergeTreeIsEmpty(V))return $;var z=V.info&&$.info?(0,Mt.pi)((0,Mt.pi)({},V.info),$.info):V.info||$.info,X=V.map.size&&$.map.size,Z={"info":z,"map":X?new Map:V.map.size?V.map:$.map};if(X){var ee=new Set($.map.keys());V.map.forEach((function(V,z){Z.map.set(z,mergeMergeTrees(V,$.map.get(z))),ee.delete(z)})),ee.forEach((function(z){Z.map.set(z,mergeMergeTrees($.map.get(z),V.map.get(z)))}))}return Z}function mergeTreeIsEmpty(V){return!V||!(V.info||V.map.size)}function maybeRecycleChildMergeTree(V,$){var z=V.map,X=z.get($);X&&mergeTreeIsEmpty(X)&&(_r.push(X),z.delete($))}var br=new Set;var Ar=function(V){function InMemoryCache($){void 0===$&&($={});var z=V.call(this)||this;return z.watches=new Set,z.typenameDocumentCache=new Map,z.makeVar=makeVar,z.txCount=0,z.config=function normalizeConfig(V){return(0,bn.o)(sr,V)}($),z.addTypename=!!z.config.addTypename,z.policies=new vr({"cache":z,"dataIdFromObject":z.config.dataIdFromObject,"possibleTypes":z.config.possibleTypes,"typePolicies":z.config.typePolicies}),z.init(),z}return(0,Mt.ZT)(InMemoryCache,V),InMemoryCache.prototype.init=function(){var V=this.data=new dr.Root({"policies":this.policies,"resultCaching":this.config.resultCaching});this.optimisticData=V.stump,this.resetResultCache()},InMemoryCache.prototype.resetResultCache=function(V){var $=this,z=this.storeReader,X=this.config.fragments;this.storeWriter=new yr(this,this.storeReader=new gr({"cache":this,"addTypename":this.addTypename,"resultCacheMaxSize":this.config.resultCacheMaxSize,"canonizeResults":shouldCanonizeResults(this.config),"canon":V?void 0:z&&z.canon,"fragments":X}),X),this.maybeBroadcastWatch=bundle_esm_wrap((function(V,z){return $.broadcastWatch(V,z)}),{"max":this.config.resultCacheMaxSize,"makeCacheKey":function(V){var z=V.optimistic?$.optimisticData:$.data;if(supportsResultCaching(z)){var X=V.optimistic,Z=V.id,ee=V.variables;return z.makeCacheKey(V.query,V.callback,pn({"optimistic":X,"id":Z,"variables":ee}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(V){return V.resetCaching()}))},InMemoryCache.prototype.restore=function(V){return this.init(),V&&this.data.replace(V),this},InMemoryCache.prototype.extract=function(V){return void 0===V&&(V=!1),(V?this.optimisticData:this.data).extract()},InMemoryCache.prototype.read=function(V){var $=V.returnPartialData,z=void 0!==$&&$;try{return this.storeReader.diffQueryAgainstStore((0,Mt.pi)((0,Mt.pi)({},V),{"store":V.optimistic?this.optimisticData:this.data,"config":this.config,"returnPartialData":z})).result||null}catch(V){if(V instanceof or)return null;throw V}},InMemoryCache.prototype.write=function(V){try{return++this.txCount,this.storeWriter.writeToStore(this.data,V)}finally{--this.txCount||!1===V.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.modify=function(V){if(ir.call(V,"id")&&!V.id)return!1;var $=V.optimistic?this.optimisticData:this.data;try{return++this.txCount,$.modify(V.id||"ROOT_QUERY",V.fields)}finally{--this.txCount||!1===V.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.diff=function(V){return this.storeReader.diffQueryAgainstStore((0,Mt.pi)((0,Mt.pi)({},V),{"store":V.optimistic?this.optimisticData:this.data,"rootId":V.id||"ROOT_QUERY","config":this.config}))},InMemoryCache.prototype.watch=function(V){var $=this;return this.watches.size||function recallCache(V){getCacheInfo(V).vars.forEach((function($){return $.attachCache(V)}))}(this),this.watches.add(V),V.immediate&&this.maybeBroadcastWatch(V),function(){$.watches.delete(V)&&!$.watches.size&&forgetCache($),$.maybeBroadcastWatch.forget(V)}},InMemoryCache.prototype.gc=function(V){pn.reset();var $=this.optimisticData.gc();return V&&!this.txCount&&(V.resetResultCache?this.resetResultCache(V.resetResultIdentities):V.resetResultIdentities&&this.storeReader.resetCanon()),$},InMemoryCache.prototype.retain=function(V,$){return($?this.optimisticData:this.data).retain(V)},InMemoryCache.prototype.release=function(V,$){return($?this.optimisticData:this.data).release(V)},InMemoryCache.prototype.identify=function(V){if(isReference(V))return V.__ref;try{return this.policies.identify(V)[0]}catch(V){__DEV__&&St.kG.warn(V)}},InMemoryCache.prototype.evict=function(V){if(!V.id){if(ir.call(V,"id"))return!1;V=(0,Mt.pi)((0,Mt.pi)({},V),{"id":"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(V,this.data)}finally{--this.txCount||!1===V.broadcast||this.broadcastWatches()}},InMemoryCache.prototype.reset=function(V){var $=this;return this.init(),pn.reset(),V&&V.discardWatches?(this.watches.forEach((function(V){return $.maybeBroadcastWatch.forget(V)})),this.watches.clear(),forgetCache(this)):this.broadcastWatches(),Promise.resolve()},InMemoryCache.prototype.removeOptimistic=function(V){var $=this.optimisticData.removeLayer(V);$!==this.optimisticData&&(this.optimisticData=$,this.broadcastWatches())},InMemoryCache.prototype.batch=function(V){var $,z=this,X=V.update,Z=V.optimistic,ee=void 0===Z||Z,ae=V.removeOptimistic,ie=V.onWatchUpdated,perform=function(V){var Z=z,ee=Z.data,ae=Z.optimisticData;++z.txCount,V&&(z.data=z.optimisticData=V);try{return $=X(z)}finally{--z.txCount,z.data=ee,z.optimisticData=ae}},ce=new Set;return ie&&!this.txCount&&this.broadcastWatches((0,Mt.pi)((0,Mt.pi)({},V),{"onWatchUpdated":function(V){return ce.add(V),!1}})),"string"==typeof ee?this.optimisticData=this.optimisticData.addLayer(ee,perform):!1===ee?perform(this.data):perform(),"string"==typeof ae&&(this.optimisticData=this.optimisticData.removeLayer(ae)),ie&&ce.size?(this.broadcastWatches((0,Mt.pi)((0,Mt.pi)({},V),{"onWatchUpdated":function(V,$){var z=ie.call(this,V,$);return!1!==z&&ce.delete(V),z}})),ce.size&&ce.forEach((function(V){return z.maybeBroadcastWatch.dirty(V)}))):this.broadcastWatches(V),$},InMemoryCache.prototype.performTransaction=function(V,$){return this.batch({"update":V,"optimistic":$||null!==$})},InMemoryCache.prototype.transformDocument=function(V){if(this.addTypename){var $=this.typenameDocumentCache.get(V);return $||($=hn(V),this.typenameDocumentCache.set(V,$),this.typenameDocumentCache.set($,$)),$}return V},InMemoryCache.prototype.transformForLink=function(V){var $=this.config.fragments;return $?$.transform(V):V},InMemoryCache.prototype.broadcastWatches=function(V){var $=this;this.txCount||this.watches.forEach((function(z){return $.maybeBroadcastWatch(z,V)}))},InMemoryCache.prototype.broadcastWatch=function(V,$){var z=V.lastDiff,X=this.diff(V);$&&(V.optimistic&&"string"==typeof $.optimistic&&(X.fromOptimisticTransaction=!0),$.onWatchUpdated&&!1===$.onWatchUpdated.call(this,V,X,z))||z&&(0,on.D)(z.result,X.result)||V.callback(V.lastDiff=X,z)},InMemoryCache}(rr),Mr=z(5317),ApolloProvider=function(V){var $=V.client,z=V.children,X=(0,Mr.K)();return ye.createElement(X.Consumer,null,(function(V){return void 0===V&&(V={}),$&&V.client!==$&&(V=Object.assign({},V,{"client":$})),__DEV__?(0,St.kG)(V.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'):(0,St.kG)(V.client,29),ye.createElement(X.Provider,{"value":V},z)}))};function onError(V){return new Ft((function($,z){return new Nt((function(X){var Z,ee,ae;try{Z=z($).subscribe({"next":function(Z){Z.errors&&(ae=V({"graphQLErrors":Z.errors,"response":Z,"operation":$,"forward":z}))?ee=ae.subscribe({"next":X.next.bind(X),"error":X.error.bind(X),"complete":X.complete.bind(X)}):X.next(Z)},"error":function(Z){(ae=V({"operation":$,"networkError":Z,"graphQLErrors":Z&&Z.result&&Z.result.errors,"forward":z}))?ee=ae.subscribe({"next":X.next.bind(X),"error":X.error.bind(X),"complete":X.complete.bind(X)}):X.error(Z)},"complete":function(){ae||X.complete.bind(X)()}})}catch(Z){V({"networkError":Z,"operation":$,"forward":z}),X.error(Z)}return function(){Z&&Z.unsubscribe(),ee&&Z.unsubscribe()}}))}))}!function(V){function ErrorLink($){var z=V.call(this)||this;return z.link=onError($),z}(0,Mt.ZT)(ErrorLink,V),ErrorLink.prototype.request=function(V,$){return this.link.request(V,$)}}(Ft);var Sr=z(3099);var Tr=z(5893),Ir=new nn({"uri":At.Wi+"graphql/","fetch":function fetcher(V,$){var z=$.body,X=$.method,Z=$.headers;return new Promise((function($,ee){return(0,Sr.WY)({"url":V,"header":Z,"method":X,"data":z,"dataType":"text","complete":function complete(V){var z=V.data,X=(V.statusCode,V.errMsg),Z=JSON.parse(z);for(var ae in Z.data){var ie=Z.data[ae];if(ie&&ie.errors&&ie.errors.length>0)return ee(ie.errors[0].message)}return $({"ok":!0,"statusText":function statusText(){return X},"text":function text(){return Promise.resolve(z)}})}})}))}}),kr=function setContext(V){return new Ft((function($,z){var X=(0,Mt._T)($,[]);return new Nt((function(Z){var ee,ae=!1;return Promise.resolve(X).then((function(z){return V(z,$.getContext())})).then($.setContext).then((function(){ae||(ee=z($).subscribe({"next":Z.next.bind(Z),"error":Z.error.bind(Z),"complete":Z.complete.bind(Z)}))})).catch(Z.error.bind(Z)),function(){ae=!0,ee&&ee.unsubscribe()}}))}))}((function(V,$){var z=$.headers,X=(0,Se.qu)("shopToken");return{"headers":(0,fe.Z)((0,fe.Z)({},z),{},{"authorization":X?"".concat(X):""})}}));console.log((0,Se.qu)("accessToken"));var Er=new tr({"link":nr([onError((function(V){var $=V.graphQLErrors,z=V.networkError;if(console.log("错误捕获"),$)$.forEach((function(V){var $=V.message;V.path;if($.indexOf("Invalid token")>-1)return Z.ZP.switchTab({"url":"/pages/Home/index"}),void(0,Te.CF)({"title":"登陆信息过期","icon":"none","duration":2e3});throw(0,Te.CF)({"title":"[服务错误]: ".concat($),"icon":"none","duration":2e3}),"接口错误"}));else if(z)throw console.log(z),(0,Te.CF)({"title":"".concat(z),"icon":"none","duration":2e3}),"接口错误"})),kr,Ir]),"cache":new Ar,"defaultOptions":{"watchQuery":{"fetchPolicy":"network-only","errorPolicy":"ignore"},"query":{"fetchPolicy":"network-only","errorPolicy":"all"},"mutate":{"errorPolicy":"all"}}}),Cr=function(V){(0,le.Z)(App,V);var $=(0,de.Z)(App);function App(){var V;(0,ae.Z)(this,App);for(var z=arguments.length,X=new Array(z),Z=0;Z1e3?V:((0,Z.Fj)("showBox",$.showBox),(0,X.Z)((0,X.Z)({},V),{},{"showBox":$.showBox}));case"change_address":return z.cityLoct=$.cityLoct,z.provinceLoct=$.provinceLoct,z.detail=$.detail,z;case"fans_Value":return z.fansNums=$.fansNums,z;case"comt_Value":return z.commetNum=$.commetNum,z;case"like_Value":return z.getlikeNum=$.getlikeNum,z;case"proson_focus":return z.tagId=$.tagId,z.tagsName=$.tagsName,z;case"news_Id":return z.dynamicId=$.dynamicId,z.twcoit=$.twcoit,z;case"ipt_Text":return z.dynamicId=$.dynamicId,z.dylDetail=$.dylDetail,z.value=$.value,z;case"up_date":return z.updataList=$.updataList,z;case"pro_par":return z.partList=$.partList,z;case"peo_list":return z.noPartList=$.noPartList,z;case"up_down":return z.upDown=$.upDown,z;default:return V}},ae={"showBox":(0,Z.qu)("showBox")?(0,Z.qu)("showBox"):-1,"msgs":[],"unreadCounts":{},"cityLoct":"杭州市","provinceLoct":"浙江省","detail":"","commetNum":0,"getlikeNum":0,"fansNums":0,"upDown":!1},ie={"tagId":"","tagsName":"","delete":null},ce={"twcoit":[],"dynamicId":"","dylDetail":null,"value":"","updataList":[]},le={"partList":[],"noPartList":[]}},"8636":function(V,$,z){"use strict";z.d($,{"P":function(){return setupJsBridge},"Z":function(){return isInApp}});var X={};window.callFromAndroid=function(V,$){console.log($),X[V+""]&&(X[V+""](JSON.parse($)),delete X[V+""])};var Z={"callHandler":function callHandler(V,$,z){var Z=(new Date).getTime();switch(X[Z+""]=z,$.method){case"getUri":window.globalJsbridge.getUri(Z+"",JSON.stringify($.param));break;case"setTitle":window.globalJsbridge.setTopTitle(Z+"",JSON.stringify($.param))}}};function isInApp(){return!!window.globalJsbridge||(!!window.WKWebViewJavascriptBridge||(!!window.WKWVJBCallbacks||navigator.userAgent.toLowerCase().indexOf("xiaota-android")>0))}function setupJsBridge(V){return window.globalJsbridge?V(Z):window.WKWebViewJavascriptBridge?V(window.WKWebViewJavascriptBridge):window.WKWVJBCallbacks?window.WKWVJBCallbacks.push(V):(window.WKWVJBCallbacks=[V],void(window.webki&&window.webkit.messageHandlers&&window.webkit.messageHandlers.iOS_Native_InjectJavascript.postMessage(null)))}},"5591":function(V,$,z){"use strict";function phoneCheck(V){return!!/^1[3-9]\d{9}$/.test(V)}function isWeixn(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)}function isAlipay(){return"alipay"==navigator.userAgent.toLowerCase().match(/Alipay/i)}z.d($,{"Ku":function(){return isWeixn},"Nc":function(){return isAlipay},"dI":function(){return phoneCheck}})},"515":function(V,$,z){"use strict";z.d($,{"o":function(){return ae}});var X=z(3099),Z=z(7853),ee=z(4186),ae=function loginWithToken(){return new Promise((function(V,$){return(0,X.WY)({"url":ee.Wi+"plugins/me.asyoume.oauth/token_login","header":{},"method":"POST","data":{"token":"".concat((0,Z.qu)("accessToken"))},"complete":function complete(z){var X=z.data,ee=z.statusCode;z.errMsg;if(ee>=300)return $(X);var ae=X;if(null!=ae.errors&&""!=ae.errors)return $(X);ae.saler_info.token&&((0,Z.Fj)("shopToken","JWT "+ae.saler_info.token),V(ae))},"fail":function fail(V){$(V)}})}))}},"8186":function(V){V.exports={"appKey":"09cd1e14bd","hasPlugin":!1,"getLocation":!1,"getComponentScroll":!1,"hasABTest":!1,"hasHeatmap":!1}},"9122":function(V,$,z){!function($){"use strict";var X,Z,ee="1.10.23",ae="https://hmma.baidu.com/mini.gif",ie={"app":["onShow","onHide","onError"],"page":["onShow","onReady","onHide","onPageScroll"],"share":["onShareAppMessage"],"behavior":["tap"]},ce="mtj_uuid",le="mtj_user",de="mtj_user_property",pe="mtj_track_status",fe="mtj_remote_config",ye="mtj_ab_experiment_list",_e="mtj_ab_active_experiment_ids",Se={},Te={"type":1},He={"aso":{}},Qe={},ze=function y(V){if(!1!==Se.trackStatus){var $=V.data.et?{"mtj_ii":V.data.uuid||"","mtj_et":V.data.et,"mtj_en":V.data.en}:{};return X.request({"url":V.url,"data":V.data,"header":Object.assign({"content-type":"application/json"},$,V.header),"method":V.method||"POST","dataType":V.dataType||"json","success":function success($){V.success&&V.success($)},"fail":function fail($){V.fail&&V.fail($)}})}},bt=function v(){return"undefined"!=typeof crypto&&crypto.getRandomValues?crypto.getRandomValues(new Uint32Array(1))[0]:Math.floor(4294967295*Math.random())},At=function b(V,$){return"[object "+$+"]"==={}.toString.call(V)},Mt=function t(V){return At(V,"Object")||At(V,"Array")?(Object.keys(V).forEach((function($){var z=V[$];At(z,"Object")||At(z,"Array")?V[$]=t(z):V[$]=""+z})),V):V},St=function x(V){return At(V,"String")&&/^\d{11}$/.test(V)},Tt=function P(V){return At(V,"String")&&28===V.length},kt=0,Ct=function T(V){return new Promise((function($,z){return V.data=V.data||{},Se.blacklist&&(Se.blacklist.indexOf("all")>-1&&V.data.et||Se.blacklist.indexOf("behavior")>-1&&"behavior"===V.data.et)?$():(V.data.v=ee,V.data.rqc=++kt,X=V.data,JSON.stringify(X).length<=204800?(V.success=function(V){return $(V)},V.fail=function(V){return z(V)},void ze(V)):(kt--,z(new Error("invalid data"))));var X}))},wt=function I(V,$){var z=At($,"Object")?JSON.stringify($):""+$;Ct({"url":ae,"dataType":"string","data":Object.assign({},Te,{"et":"error","en":V,"ep":{"ex":z},"rid":bt()})})},Ot=function A(V){V.rid=bt(),V.aso=V.aso||{};var $={"url":ae,"dataType":"string","data":Object.assign({},Te,V)};Ct($),(Qe.circleToken||Qe.circleByThreeFingers)&&("page"===V.et&&"show"===V.en||"behavior"===V.et&&"tap"===V.en)&&($.url="https://hmma.baidu.com/mini.gif?circle=1",$.data.token=Qe.circleToken,Ct($).catch((function(V){return console.error(V)})))};function E(V,$){return function(V){if(Array.isArray(V))return V}(V)||function(V,$){var z=V&&("undefined"!=typeof Symbol&&V[Symbol.iterator]||V["@@iterator"]);if(null!=z){var X,Z,ee=[],ae=!0,ie=!1;try{for(z=z.call(V);!(ae=(X=z.next()).done)&&(ee.push(X.value),!$||ee.length!==$);ae=!0);}catch(V){ie=!0,Z=V}finally{try{ae||null==z.return||z.return()}finally{if(ie)throw Z}}return ee}}(V,$)||function(V,$){if(V){if("string"==typeof V)return N(V,$);var z=Object.prototype.toString.call(V).slice(8,-1);return"Object"===z&&V.constructor&&(z=V.constructor.name),"Map"===z||"Set"===z?Array.from(V):"Arguments"===z||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z)?N(V,$):void 0}}(V,$)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(V,$){(null==$||$>V.length)&&($=V.length);for(var z=0,X=new Array($);z<$;z++)X[z]=V[z];return X}var Nt=function C(V){try{return X.getStorageSync(V)}catch(V){wt("getStorageSync",V)}},Pt=function q(V,$){try{X.setStorageSync(V,$)}catch(V){wt("setStorageSync",V)}},Rt=function U(V){try{X.removeStorageSync(V)}catch(V){wt("removeStorageSync",V)}},Lt=function D(){return Promise.resolve().then((function(){var V=Nt(ce);return At(V,"String")&&32===V.length||(V=([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(function(V){return(V^("undefined"!=typeof crypto&&crypto.getRandomValues?crypto.getRandomValues(new Uint8Array(1))[0]:Math.floor(255*Math.random()))&15>>V/4).toString(16)})),Pt(ce,V),Se.hasABTest&&(Rt(ye),Rt(_e))),V}))},Gt=function B(V){return new Promise((function($){if(!V)return $();X.getShareInfo({"shareTicket":V,"success":function success(V){delete V.errMsg,$(V)},"fail":function fail(){$({})}})}))},xt=function M(){return Z||(Te.sid=bt(),Te.rqc=0,Z=Promise.all([Lt(),new Promise((function(V){X.getSystemInfo({"success":function success($){delete $.errMsg,V($)},"fail":function fail(){V({})}})})),new Promise((function(V){X.getNetworkType({"success":function success($){delete $.errMsg,V($)},"fail":function fail(){V({})}})})),Promise.resolve().then((function(){var V=Nt(le),$=At(V,"Object")?V:{};return new Promise((function(V){X.getSetting({"success":function success(z){z.authSetting&&z.authSetting["scope.userInfo"]?X.getUserInfo({"success":function success(z){delete z.userInfo.errMsg,V(Object.assign($,z.userInfo))},"fail":function fail(){V($)}}):V($)},"fail":function fail(){V($)}})}))})),new Promise((function(V){if(!Se.getLocation)return V({});X.getLocation({"type":"wgs84","success":function success($){delete $.errMsg,V($)},"fail":function fail(){V({})}})})),Promise.resolve().then((function(){var V=Nt(de);return At(V,"Object")?V:{}}))]).then((function(V){var $=E(V,6),z=$[0],X=$[1],Z=$[2],ae=$[3],ie=$[4],ce=$[5];Te.uuid=z,He.system=Mt(X),He.network=Mt(Z),Object.keys(ae).length>0&&(He.user=Mt(ae)),Object.keys(ie).length>0&&(He.location=Mt(ie)),Object.keys(ce).length>0&&(He.userProperty=JSON.stringify(ce)),"devtools"===He.system.platform&&Se.latestVersion&&function(V,$){for(var z=V.split("."),X=$.split("."),Z=0;Z<3;Z++){var ee=+z[Z]||0,ae=+X[Z]||0;if(ee>ae)return 1;if(ae>ee)return-1}return 0}(ee,Se.latestVersion)<0&&console.warn("百度移动统计微信小程序SDK已更新,为不影响您的正常使用,请到SDK下载中心 https://mtj.baidu.com/web/sdk/index 下载最新版本")})))},Ft={"onShow":function onShow(){var V=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},$=(He.aso.query||[]).filter((function(V){return 0===V.key.indexOf("mtj_")}));return He.aso.scene=""+(V.scene||""),V.referrerInfo&&V.referrerInfo.appId?He.aso.referrerInfo=V.referrerInfo:delete He.aso.referrerInfo,He.aso.path=V.path||"",He.aso.query=Object.keys(V.query||{}).map((function($){return{"key":$,"value":V.query[$]}})),$.length>0&&!/(^|,)mtj_/.test(Object.keys(V.query||{}).join(","))&&(He.aso.query=He.aso.query.concat($)),(V.query||{}).mtj_ctoken&&!Se.disableCircling&&(Qe.circleToken=V.query.mtj_ctoken),(V.query||{}).mtj_htoken&&Se.hasHeatmap&&(Qe.heatmapToken=V.query.mtj_htoken),xt().then((function(){return Gt(V.shareTicket)})).then((function(V){V?He.aso.shareInfo=V:delete He.aso.shareInfo,Ot(Object.assign({"et":"app","en":"show"},He))})).catch((function(V){wt("app.onShow",V)}))},"onHide":function onHide(){Ot({"et":"app","en":"hide"})},"onError":function onError(V){var $=At(V,"Object")?JSON.stringify(Mt(V)):""+V;Ot({"et":"app","en":"error","ep":{"ex":$}})}};function F(){this.options={"opacity":100,"radius":30,"bshadow":1.5,"boundVal":15e3,"shadowBlur":15,"points":{"max":100,"data":[]},"gradient":{"0.45":"rgb(0,0,255)","0.55":"rgb(0,255,255)","0.65":"rgb(0,255,0)","0.95":"yellow","1":"rgb(255,0,0)"}}}F.prototype={"getCanvas":function getCanvas(V){return new Promise((function($,z){X.createSelectorQuery().select(V).fields({"node":!0,"size":!0}).exec((function(V){$(V[0].node)}))}))},"getPageClientRect":function getPageClientRect(){return new Promise((function(V,$){X.createSelectorQuery().select(".hm-container").boundingClientRect((function($){V([$.width,$.height])})).exec()}))},"init":function init(){var V=this;return Promise.all([this.getPageClientRect(),this.getCanvas("#cvs"),this.getCanvas("#cvd")]).then((function($){var z=E($,3),X=z[0],Z=z[1],ee=z[2];V.options.width=X[0],V.options.height=X[1],Z.width=V.options.width,Z.height=V.options.height,V.options.context.setData({"p_width":V.options.width,"p_height":V.options.height});var ae=Z.getContext("2d");V.options.ctx=ae,ee.width=1,ee.height=256;var ie=ee.getContext("2d");V.options.pctx=ie}))},"renderShadow":function renderShadow(V,$,z,X){var Z=this.options.ctx,ee=this.options.boundVal,ae=parseFloat(z/this.options.points.max,10);Z.shadowColor="rgba(0, 0, 0, "+ae+")",Z.shadowOffsetX=ee,Z.shadowOffsetY=ee,Z.shadowBlur=this.options.shadowBlur,Z.beginPath(),Z.arc(V-ee,$-ee,this.options.radius,0,2*Math.PI,!0),Z.closePath(),Z.fill(),X||this.cachePoint(V,$,z)},"colorize":function colorize(){for(var V=this.options.width,$=this.options.height,z=this.options.ctx,X=z.getImageData(0,0,V,$),Z=X.data,ee=Z.length,ae=this.getPalette(),ie=this.options.opacity,ce=3;ceX.max&&(X.max=z),Z.push([V,$,z])},"addPoint":function addPoint(V,$,z){this.options.ctx.clearRect(0,0,this.options.width,this.options.height),this.options.pctx.clearRect(0,0,1,256);for(var X=this.options.points.data,Z=X.length,ee=0;ee0&&Ot(Object.assign({"et":"page","en":"scroll","ep":Mt(V[0])},ee))}))}catch(V){wt("page.trackComponentScrollEvent",V)}},"onPageScroll":function onPageScroll(V){(!Qe.pageScrollTop||V.scrollTop>Qe.pageScrollTop)&&(Qe.pageScrollTop=V.scrollTop)},"onShareAppMessage":function onShareAppMessage(V){var $=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},z={"from":V.from,"path":$.path};if(!z.path){var X=Te.query.map((function(V){return V.key+"="+V.value})).join("&");z.path=Te.path+(X?"?"+X:"")}$.title&&(z.title=""+$.title),V.target&&(z.target=JSON.stringify(V.target)),Ot(Object.assign({"et":"share","en":"action","ep":z},He));var Z=He.aso.query.filter((function(V){return"mtj_shuuid"===V.key})),ee=Z[0]?Z[0].value.split("_"):[];Te.uuid!==ee[ee.length-1]&&ee.push(Te.uuid);var ae=ee.slice(Math.max(0,ee.length-3)).join("_");return $.path=function j(V,$,z){var X=(V=V.replace(new RegExp($+"=[^&]*","g"),"").replace(/(\?|&)&/g,"$1").replace(/(\?|&)$/g,"")).indexOf("?")>0?"&":"?";return V+X+$+"="+encodeURIComponent(z)}(z.path,"mtj_shuuid",ae),$},"onAction":function onAction(V,$){if(V&&V.type&&V.currentTarget){var z="#"+(V.currentTarget.id||$);if("tap"===V.type){var X=[{"key":"xpath","value":z}],Z=V.detail,ee=Z.x,ae=Z.y,ie={};return void 0!==ee&&void 0!==ae&&(ie={"x":Math.floor(ee),"y":Math.floor(ae)}),void Ot(Object.assign({"et":"behavior","en":"tap","ep":{"data":X},"posi":ie},He))}if("touchmove"===V.type&&-1===Ut&&V.touches instanceof Array&&3===V.touches.length){if(jt+=1,clearTimeout(Bt),3===jt)return Qe.circleByThreeFingers=!0,Qe.circleToken=void 0,void Ot(Object.assign({"et":"page","en":"show"},He));Ut=setTimeout((function(){Ut=-1,Bt=setTimeout((function(){jt=0}),500)}),1e3)}}}},Vt={"trackEvent":function trackEvent(V){var $=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function O(V){return At(V,"String")&&/^[a-z][a-z0-9_]{0,31}$/.test(V)}(V))return Promise.reject(new Error("事件名称不合法"));var z=Object.keys($).filter((function(V){return function w(V){return At(V,"String")&&/^[a-z0-9_]{1,32}$/.test(V)}(V)&&function k(V){return At(V,"String")||At(V,"Number")}($[V])})).map((function(V){return{"key":""+V,"value":""+$[V],"type":At($[V],"String")?"string":"number"}}));return xt().then((function(){Ot(Object.assign({"et":"event","en":""+V,"ep":{"data":z}},He))})).catch((function(V){wt("trackEvent",V)}))},"setTrackStatus":function setTrackStatus(V){At(V,"Boolean")&&(Se.trackStatus=V,Pt(pe,V))},"setUserInfo":function setUserInfo(){var V=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},$=V.tel,z=V.openId;return xt().then((function(){var V=Nt(le),X=At(V,"Object")?V:{};St($)&&(X.tel=He.user.tel=$.substr($.length-11)),Tt(z)&&(X.openId=He.user.openId=z),(X.tel||X.openId)&&Pt(le,X),At($,"Undefined")||St($)||console.error("手机号 ".concat($," 不合法")),At(z,"Undefined")||Tt(z)||console.error("openid ".concat(z," 不合法"))})).catch((function(V){wt("setUserInfo",V)}))},"setUserId":function setUserId(V){return Promise.resolve().then((function(){if(!(At(V,"String")||At(V,"Number")&&Number.isFinite(V)))return Promise.reject(new Error("userId只能是字符串或数字"));var $=""+V,z=Nt(de),X=At(z,"Object")?z:{};if(!X.uid_||X.uid_[0]!==$){X.uid_=[$,"1"],Pt(de,X),He.userProperty=JSON.stringify(X);var Z=[{"key":"uid","value":$}];return xt().then((function(){Ot(Object.assign({"et":"api","en":"setUserId","ep":{"data":Z}},He))})).catch((function(V){wt("setUserId",V)}))}}))},"setUserProperty":function setUserProperty(V){return Promise.resolve().then((function(){var $=Nt(de),z=At($,"Object")?$:{};if(At(V,"Null"))Object.keys(z).forEach((function(V){"_"!==V.charAt(0)&&"_"!==V.charAt(V.length-1)&&delete z[V]}));else if(!At(V,"Object"))return Promise.reject(new Error("userProperty必须是对象"));var X=Object.keys(z).filter((function(V){return"_"!==V.charAt(0)&&"_"!==V.charAt(V.length-1)})).length;Object.keys(V||{}).forEach((function($){var Z=V[$];""===$||"_"===$.charAt(0)||"_"===$.charAt($.length-1)&&"ab_"!==$&&"ab_filter_"!==$||(At(Z,"Null")?z[$]&&(delete z[$],X--):!(At(Z,"String")||At(Z,"Number")&&Number.isFinite(Z))||$.length>256||(""+Z).length>256||!z[$]&&X>=100||(z[$]||X++,z[$]=[Z,"1"]))})),Pt(de,z),He.userProperty=JSON.stringify(z)}))}},Ht={"data":[],"init":function init(){var V=this,$=Te.uuid;$?this.startFetch($):Lt().then((function($){Te.uuid=$,V.startFetch($)}))},"startFetch":function startFetch(V){console.log("---您的设备ID---",V),this.fetchTest()},"getExpDataByParamName":function getExpDataByParamName(V){var $=Nt(ye);if(this.setLocalData($),!$||!At($,"Array"))return{};var z=$.find((function($){return $&&At($.params,"Object")&&!At($.params[V],"Undefined")}));return z&&z.params?{"expValue":z.params[V],"expId":z.e}:{}},"fetchTest":function fetchTest(V,$,z){var X=this,Z=Te.uuid,ee=Te.key;ze({"url":"https://hm.baidu.com/v1/diversion/","data":{"cid":Z,"tid":ee},"method":"GET","success":function success(Z){At(Z,"Object")&&200===Z.statusCode&&At(Z.data,"Object")&&0===Z.data.status?X.handleFetchResponse(Z.data,V,$,z):z&&z($)},"fail":function fail(){console.error("请求分流实验失败"),z&&z($)}})},"handleFetchResponse":function handleFetchResponse(V,$,z,X){var Z=[];if(At(V,"Object")&&At(V.data,"Object")&&At(V.data.expr,"Array")&&(Z=V.data.expr),this.updateStorage(Z),this.setLocalData(Z),X){var ee=this.getExpDataByParamName($),ae=ee.expValue,ie=ee.expId;At(ae,"Null")||At(ae,"Undefined")?X(z):this.handleInTest(ae,ie,X)}},"handleInTest":function handleInTest(V,$,z){z(V),this.updateUserProperty($)},"updateStorage":function updateStorage(V){Pt(ye,V)},"setLocalData":function setLocalData(V){this.data=V||[]},"updateUserProperty":function updateUserProperty(V){var $=this,z=this.getActiveExpIds(V)||[],X={"ab_":null,"ab_filter_":null},Z={},ee=[];if(z.forEach((function(V){var z=$.getExpDataFromId(V);At(z,"Object")&&(Z[z.e]=z.g,ee.push(z.h||0))})),ee.length){var ae=0;ee.forEach((function(V){ae=function(V,$){var z="00000000000000000000000000000000";function r(V){var $=(z+z+Number(V).toString(2)).slice(-64);return[parseInt($.slice(0,32),2),parseInt($.slice(-32),2)]}function o(V){return(z+V.toString(2)).slice(-32)}var X=r(V),Z=r($);return parseInt(o((X[0]|Z[0])>>>0)+o((X[1]|Z[1])>>>0),2)}(ae,V)})),X={"ab_":JSON.stringify(Z),"ab_filter_":ae}}Vt.setUserProperty(X)},"getExpDataFromId":function getExpDataFromId(V){return Nt(ye).find((function($){return String($.e)===String(V)}))},"setActiveExperimentIds":function setActiveExperimentIds(V){Pt(_e,V)},"getActiveExpIds":function getActiveExpIds(V){var $=this,z=Nt(_e)||[];return At(V,"Undefined")||-1!==z.indexOf(V)||z.push(V),z=(z=z.filter((function(V){return!!$.getExpDataFromId(V)}))).filter((function(V,$){return z.indexOf(V)===$})),this.setActiveExperimentIds(z),z}},$t=function K(V){if(Se.hasABTest)if(At(V,"Object")){var $=V.paramName;if(null!=$){var z=V.defaultValue;if(At(z,"Undefined"))console.error("请设置参数默认值");else{var X=V.callback;if(At(X,"Function")){var Z=Ht.getExpDataByParamName($),ee=Z.expValue,ae=Z.expId;At(ee,"Null")||At(ee,"Undefined")?Ht.fetchTest($,z,X):Ht.handleInTest(ee,ae,X)}else console.error("callback必须为函数")}}else console.error("请设置实验参数名称")}else console.error("传递参数请设置为对象")},Kt=function Q(V,$,z){var X=$[V];$[V]=function($){if(z.call(this,$,V),X)return X.apply(this,arguments)}},Qt=App,zt=function W(V){ie.app.forEach((function($){Kt($,V,Ft[$])})),V.mtj=Vt,V.mtj.pageEvent=qt,V.mtj.fetchABTest=$t,Qt(V)},Wt=Page,Yt=function Y(V){ie.page.forEach((function($){Kt($,V,qt[$])})),ie.share.forEach((function($){!function(V,$,z){var X=$[V];$[V]=function(V){var $=X&&X.apply(this,arguments);return z.call(this,V,$)}}($,V,qt[$])})),Object.keys(V).forEach((function($){"function"==typeof V[$]&&-1===ie.page.indexOf($)&&-1===ie.share.indexOf($)&&Kt($,V,qt.onAction)})),Wt(V)},Xt=Behavior,Jt=function tt(V){return ie.page.forEach((function($){Kt($,V.methods,qt[$])})),Xt(V)};Jt.prototype.constructor=Behavior;var Zt=Component,en=function nt(V){return ie.page.forEach((function($){Kt($,V.methods,qt[$])})),Zt(V)},tn=function rt(){var $,Z;$=wx,X=$;try{Z=z(8186)}catch($){return void console.error("请把mtj-wx-sdk.config.js文件拷贝到utils目录中")}Z&&Z.appKey?(Te.key=Z.appKey,Se.getLocation=Z.getLocation||!1,Se.getComponentScroll=Z.getComponentScroll||!1,Se.disableCircling=Z.disableCircling||!1,Se.trackStatus=!(!1===Nt(pe)),Se.hasABTest=Z.hasABTest||!1,Se.hasHeatmap=Z.hasHeatmap||!1,Se.hasABTest&&Ht.init(),function(){var V=Nt(fe);if(V){Object.keys(V).forEach((function($){Se[$]=V[$]}));var $=V.updateTimestamp||0;if(+new Date-$<864e5)return Promise.resolve()}Ct({"url":"https://hmma.baidu.com/mini.conf","method":"POST","header":{"content-type":"application/x-www-form-urlencoded"},"data":{"type":"wx","key":Te.key}}).then((function(V){if(V&&V.data){var $=V.data;Object.keys($).forEach((function(V){Se[V]=$[V]})),$.updateTimestamp=+new Date,Pt(fe,$)}else wt("remoteConfig",V)})).catch((function(V){wt("sendRequest",V)}))}(),Z.hasPlugin||(App=zt,Page=Yt),V.exports={"App":zt,"Page":Yt,"Behavior":Jt,"Component":en}):console.error("请设置mtj-wx-sdk.config.js文件中的appKey字段")};tn(),$.init=tn,Object.defineProperty($,"__esModule",{"value":!0})}({})},"8460":function(V,$,z){"use strict";z.d($,{"FV":function(){return le},"Mh":function(){return He},"XT":function(){return Mt},"bl":function(){return ye},"mj":function(){return X},"wx":function(){return pe},"x4":function(){return _e}});var X,Z=z(1963),ee=z.n(Z),ae=z(6705),ie=z.n(ae),ce=z(3744),le=ee().EVENT,de=ee().TYPES,pe="",fe="",ye=function initTim(V){(X=ee().create({"SDKAppID":V.SDKAppID})).setLogLevel(1),X.registerPlugin({"tim-upload-plugin":ie()}),pe=V.userID,fe=V.userSig,X.on(le.SDK_READY,Se),X.on(le.SDK_NOT_READY,Te),X.on(le.MESSAGE_RECEIVED,He),X.on(le.MESSAGE_MODIFIED,Qe),X.on(le.KICKED_OUT,ze),X.on(le.ERROR,bt),X.on(le.NET_STATE_CHANGE,At),_e(pe,fe)},_e=function login(V,$){X.login({"userID":V,"userSig":$}).then((function(V){console.log("登陆成功:%o",V)})).catch((function(V){console.error("登陆失败:%o",V)}))},Se=function onSDKReady(V){if(V.data&&V.data.state)switch(V.data.state){case de.NET_STATE_CONNECTED:console.log("已接入网络"),_e(pe,fe);break;case de.NET_STATE_CONNECTING:console.log("连接中");break;case de.NET_STATE_DISCONNECTED:console.log("未接入网络,当前网络不可用");break;default:console.log("该更新代码了")}ce.V.imReady=!0,ce.V.storeDispatch,ce.V.storeDispatch({"type":"updateShowBox","showBox":1e3}),X.on(le.CONVERSATION_LIST_UPDATED,Mt)},Te=function onSdkNotReady(V){ce.V.imReady=!1,X.off(le.CONVERSATION_LIST_UPDATED,Mt),X.off(le.MESSAGE_RECEIVED,He),_e(pe,fe),V.data},He=function onMessageReceived(V){console.debug("onMessageReceived:%o",V),V.data},Qe=function onMessageModified(V){console.debug("onMessageModified:%o",V),V.data},ze=function onKickedOut(V){},bt=function onError(V){},At=function onNetStateChange(V){if(V.data&&V.data.state)switch(V.data.state){case de.NET_STATE_CONNECTED:console.debug("已接入网络"),_e(pe,fe);break;case de.NET_STATE_CONNECTING:console.debug("连接中");break;case de.NET_STATE_DISCONNECTED:console.debug("未接入网络,当前网络不可用");break;default:console.debug("该更新代码了")}},Mt=function onConversationListUpdated(V){X.getConversationList().then((function(V){var $=V.data.conversationList;$.length,ce.V.storeDispatch({"type":"updateMsgs","list":$})})).catch((function(V){console.log(V)}))}},"6705":function(V,$,z){var X,Z,ee,ae=z(8698).default;ee=function factory(){function e(V){return(e="function"==typeof Symbol&&"symbol"===ae(Symbol.iterator)?function(V){return ae(V)}:function(V){return V&&"function"==typeof Symbol&&V.constructor===Symbol&&V!==Symbol.prototype?"symbol":ae(V)})(V)}function t(V,$){if(!(V instanceof $))throw new TypeError("Cannot call a class as a function")}function r(V,$){for(var z=0;z<$.length;z++){var X=$[z];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(V,X.key,X)}}function o(V,$,z){return $&&r(V.prototype,$),z&&r(V,z),V}function n(V,$,z){return $ in V?Object.defineProperty(V,$,{"value":z,"enumerable":!0,"configurable":!0,"writable":!0}):V[$]=z,V}function a(V,$){var z=Object.keys(V);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(V);$&&(X=X.filter((function($){return Object.getOwnPropertyDescriptor(V,$).enumerable}))),z.push.apply(z,X)}return z}function s(V){for(var $=1;$1&&void 0!==arguments[1]?arguments[1]:"&",z=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return v(V)?"":ce(V)?Object.keys(V).map((function(X){var Z=encodeURIComponent(X)+z;return Array.isArray(V[X])?V[X].map((function(V){return Z+encodeURIComponent(V)})).join($):Z+encodeURIComponent(V[X])})).filter(Boolean).join($):void 0}(V.qs);ee&&(Z+="".concat(-1===Z.indexOf("?")?"?":"&").concat(ee))}var ae=new XMLHttpRequest;ae.open(X,Z,!0),ae.responseType=V.dataType||"text";var ie=V.headers||{};if(!v(ie))for(var le in ie)ie.hasOwnProperty(le)&&"content-length"!==le.toLowerCase()&&"user-agent"!==le.toLowerCase()&&"origin"!==le.toLowerCase()&&"host"!==le.toLowerCase()&&ae.setRequestHeader(le,ie[le]);return ae.onload=function(){$(null,z._xhrRes(ae,z._xhrBody(ae)))},ae.onerror=function(V){var X=z._xhrBody(ae);if(X)$(V,z._xhrRes(ae,X));else{var Z=ae.statusText;Z||0!==ae.status||(Z="CORS blocked or network error"),$(Z,z._xhrRes(ae,X))}},V.onProgress&&ae.upload&&(ae.upload.onprogress=function($){var z=$.total,X=$.loaded,Z=Math.floor(100*X/z);V.onProgress({"total":z,"loaded":X,"percent":(Z>=100?100:Z)/100})}),ae.send(V.resources),ae}},{"key":"_xhrRes","value":function value(V,$){var z={};return V.getAllResponseHeaders().trim().split("\n").forEach((function(V){if(V){var $=V.indexOf(":"),X=V.substr(0,$).trim().toLowerCase(),Z=V.substr($+1).trim();z[X]=Z}})),{"statusCode":V.status,"statusMessage":V.statusText,"headers":z,"data":$}}},{"key":"_xhrBody","value":function value(V){return 200===V.status&&V.responseURL&&this.downloadUrl?{"location":this.downloadUrl}:{"response":V.responseText}}}]),e}(),de=["unknown","image","video","audio","log"],pe=function(){function e(){t(this,e),this.downloadUrl=""}return o(e,[{"key":"request","value":function value(V,$){var z=this,X=V.resources,ee=void 0===X?"":X,ae=V.headers,ce=void 0===ae?{}:ae,le=V.url,pe=V.downloadUrl,fe=void 0===pe?"":pe;this.downloadUrl=fe;var ye=null,_e="",Se=fe.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/);_e=(_e=decodeURIComponent(Se[3])).indexOf("?")>-1?_e.split("?")[0]:_e,ce["Content-Type"]="multipart/form-data";var Te={"url":le,"header":ce,"name":"file","filePath":ee,"formData":{"key":_e,"success_action_status":200,"Content-Type":""},"timeout":V.timeout||3e5};if(Z){var He=Te;He.name,Te=s(s({},function i(V,$){if(null==V)return{};var z,X,Z=function(V,$){if(null==V)return{};var z,X,Z={},ee=Object.keys(V);for(X=0;X=0||(Z[z]=V[z]);return Z}(V,$);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(V);for(X=0;X=0||Object.prototype.propertyIsEnumerable.call(V,z)&&(Z[z]=V[z])}return Z}(He,["name"])),{},{"fileName":"file","fileType":de[V.fileType]})}return(ye=ie.uploadFile(s(s({},Te),{},{"success":function success(V){z._handleResponse(V,$)},"fail":function fail(V){z._handleResponse(V,$)}}))).onProgressUpdate((function($){V.onProgress&&V.onProgress({"total":$.totalBytesExpectedToSend,"loaded":$.totalBytesSent,"percent":Math.floor($.progress)/100})})),ye}},{"key":"_handleResponse","value":function value(V,$){var z=V.header,X={};if(z)for(var Z in z)z.hasOwnProperty(Z)&&(X[Z.toLowerCase()]=z[Z]);var ee=+V.statusCode;200===ee?$(null,{"statusCode":ee,"headers":X,"data":s(s({},V.data),{},{"location":this.downloadUrl})}):$(V,{"statusCode":ee,"headers":X,"data":void 0})}}]),e}();return function(){function e(){t(this,e),console.log("TIMUploadPlugin.VERSION: ".concat("1.0.1")),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=ee?new pe:new le}return o(e,[{"key":"uploadFile","value":function value(V,$){var z=this;return this.httpRequest.request(V,(function(X,Z){X&&z.tryCount=3e4&&(this.systemClockOffset=ie-ae,$=!0)}else 5===Math.floor(V.statusCode/100)&&($=!0)}return $}}]),e}()},"object"===ae($)?V.exports=ee():void 0===(Z="function"==typeof(X=ee)?X.call($,z,$,V):X)||(V.exports=Z)},"1963":function(V,$,z){var X,Z,ee,ae=z(8698).default;ee=function(){function e(V,$){var z=Object.keys(V);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(V);$&&(X=X.filter((function($){return Object.getOwnPropertyDescriptor(V,$).enumerable}))),z.push.apply(z,X)}return z}function t(V){for(var $=1;$=0||(Z[z]=V[z]);return Z}(V,$);if(Object.getOwnPropertySymbols){var ee=Object.getOwnPropertySymbols(V);for(X=0;X=0||Object.prototype.propertyIsEnumerable.call(V,z)&&(Z[z]=V[z])}return Z}function h(V){if(void 0===V)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return V}function f(V){var $=l();return function(){var z,X=u(V);if($){var Z=u(this).constructor;z=Reflect.construct(X,arguments,Z)}else z=X.apply(this,arguments);return function _(V,$){if($&&("object"==ae($)||"function"==typeof $))return $;if(void 0!==$)throw new TypeError("Derived constructors may only return object or undefined");return h(V)}(this,z)}}function m(V,$){return v(V)||function(V,$){var z=null==V?null:"undefined"!=typeof Symbol&&V[Symbol.iterator]||V["@@iterator"];if(null!=z){var X,Z,ee=[],ae=!0,ie=!1;try{for(z=z.call(V);!(ae=(X=z.next()).done)&&(ee.push(X.value),!$||ee.length!==$);ae=!0);}catch(V){ie=!0,Z=V}finally{try{ae||null==z.return||z.return()}finally{if(ie)throw Z}}return ee}}(V,$)||I(V,$)||C()}function M(V){return function(V){if(Array.isArray(V))return T(V)}(V)||y(V)||I(V)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(V){if(Array.isArray(V))return V}function y(V){if("undefined"!=typeof Symbol&&null!=V[Symbol.iterator]||null!=V["@@iterator"])return Array.from(V)}function I(V,$){if(V){if("string"==typeof V)return T(V,$);var z=Object.prototype.toString.call(V).slice(8,-1);return"Object"===z&&V.constructor&&(z=V.constructor.name),"Map"===z||"Set"===z?Array.from(V):"Arguments"===z||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(z)?T(V,$):void 0}}function T(V,$){(null==$||$>V.length)&&($=V.length);for(var z=0,X=new Array($);z<$;z++)X[z]=V[z];return X}function C(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(V,$){var z="undefined"!=typeof Symbol&&V[Symbol.iterator]||V["@@iterator"];if(!z){if(Array.isArray(V)||(z=I(V))||$&&V&&"number"==typeof V.length){z&&(V=z);var X=0,Z=function a(){};return{"s":Z,"n":function n(){return X>=V.length?{"done":!0}:{"done":!1,"value":V[X++]}},"e":function e(V){throw V},"f":Z}}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 ee,ae=!0,ie=!1;return{"s":function s(){z=z.call(V)},"n":function n(){var V=z.next();return ae=V.done,V},"e":function e(V){ie=!0,ee=V},"f":function f(){try{ae||null==z.return||z.return()}finally{if(ie)throw ee}}}}var V={"SDK_READY":"sdkStateReady","SDK_NOT_READY":"sdkStateNotReady","SDK_DESTROY":"sdkDestroy","MESSAGE_RECEIVED":"onMessageReceived","MESSAGE_MODIFIED":"onMessageModified","MESSAGE_REVOKED":"onMessageRevoked","MESSAGE_READ_BY_PEER":"onMessageReadByPeer","CONVERSATION_LIST_UPDATED":"onConversationListUpdated","GROUP_LIST_UPDATED":"onGroupListUpdated","GROUP_SYSTEM_NOTICE_RECEIVED":"receiveGroupSystemNotice","GROUP_ATTRIBUTES_UPDATED":"groupAttributesUpdated","PROFILE_UPDATED":"onProfileUpdated","BLACKLIST_UPDATED":"blacklistUpdated","FRIEND_LIST_UPDATED":"onFriendListUpdated","FRIEND_GROUP_LIST_UPDATED":"onFriendGroupListUpdated","FRIEND_APPLICATION_LIST_UPDATED":"onFriendApplicationListUpdated","KICKED_OUT":"kickedOut","ERROR":"error","NET_STATE_CHANGE":"netStateChange","SDK_RELOAD":"sdkReload"},$={"MSG_TEXT":"TIMTextElem","MSG_IMAGE":"TIMImageElem","MSG_SOUND":"TIMSoundElem","MSG_AUDIO":"TIMSoundElem","MSG_FILE":"TIMFileElem","MSG_FACE":"TIMFaceElem","MSG_VIDEO":"TIMVideoFileElem","MSG_GEO":"TIMLocationElem","MSG_LOCATION":"TIMLocationElem","MSG_GRP_TIP":"TIMGroupTipElem","MSG_GRP_SYS_NOTICE":"TIMGroupSystemNoticeElem","MSG_CUSTOM":"TIMCustomElem","MSG_MERGER":"TIMRelayElem","MSG_PRIORITY_HIGH":"High","MSG_PRIORITY_NORMAL":"Normal","MSG_PRIORITY_LOW":"Low","MSG_PRIORITY_LOWEST":"Lowest","CONV_C2C":"C2C","CONV_GROUP":"GROUP","CONV_SYSTEM":"@TIM#SYSTEM","CONV_AT_ME":1,"CONV_AT_ALL":2,"CONV_AT_ALL_AT_ME":3,"GRP_PRIVATE":"Private","GRP_WORK":"Private","GRP_PUBLIC":"Public","GRP_CHATROOM":"ChatRoom","GRP_MEETING":"ChatRoom","GRP_AVCHATROOM":"AVChatRoom","GRP_MBR_ROLE_OWNER":"Owner","GRP_MBR_ROLE_ADMIN":"Admin","GRP_MBR_ROLE_MEMBER":"Member","GRP_TIP_MBR_JOIN":1,"GRP_TIP_MBR_QUIT":2,"GRP_TIP_MBR_KICKED_OUT":3,"GRP_TIP_MBR_SET_ADMIN":4,"GRP_TIP_MBR_CANCELED_ADMIN":5,"GRP_TIP_GRP_PROFILE_UPDATED":6,"GRP_TIP_MBR_PROFILE_UPDATED":7,"MSG_REMIND_ACPT_AND_NOTE":"AcceptAndNotify","MSG_REMIND_ACPT_NOT_NOTE":"AcceptNotNotify","MSG_REMIND_DISCARD":"Discard","GENDER_UNKNOWN":"Gender_Type_Unknown","GENDER_FEMALE":"Gender_Type_Female","GENDER_MALE":"Gender_Type_Male","KICKED_OUT_MULT_ACCOUNT":"multipleAccount","KICKED_OUT_MULT_DEVICE":"multipleDevice","KICKED_OUT_USERSIG_EXPIRED":"userSigExpired","ALLOW_TYPE_ALLOW_ANY":"AllowType_Type_AllowAny","ALLOW_TYPE_NEED_CONFIRM":"AllowType_Type_NeedConfirm","ALLOW_TYPE_DENY_ANY":"AllowType_Type_DenyAny","FORBID_TYPE_NONE":"AdminForbid_Type_None","FORBID_TYPE_SEND_OUT":"AdminForbid_Type_SendOut","JOIN_OPTIONS_FREE_ACCESS":"FreeAccess","JOIN_OPTIONS_NEED_PERMISSION":"NeedPermission","JOIN_OPTIONS_DISABLE_APPLY":"DisableApply","JOIN_STATUS_SUCCESS":"JoinedSuccess","JOIN_STATUS_ALREADY_IN_GROUP":"AlreadyInGroup","JOIN_STATUS_WAIT_APPROVAL":"WaitAdminApproval","GRP_PROFILE_OWNER_ID":"ownerID","GRP_PROFILE_CREATE_TIME":"createTime","GRP_PROFILE_LAST_INFO_TIME":"lastInfoTime","GRP_PROFILE_MEMBER_NUM":"memberNum","GRP_PROFILE_MAX_MEMBER_NUM":"maxMemberNum","GRP_PROFILE_JOIN_OPTION":"joinOption","GRP_PROFILE_INTRODUCTION":"introduction","GRP_PROFILE_NOTIFICATION":"notification","GRP_PROFILE_MUTE_ALL_MBRS":"muteAllMembers","SNS_ADD_TYPE_SINGLE":"Add_Type_Single","SNS_ADD_TYPE_BOTH":"Add_Type_Both","SNS_DELETE_TYPE_SINGLE":"Delete_Type_Single","SNS_DELETE_TYPE_BOTH":"Delete_Type_Both","SNS_APPLICATION_TYPE_BOTH":"Pendency_Type_Both","SNS_APPLICATION_SENT_TO_ME":"Pendency_Type_ComeIn","SNS_APPLICATION_SENT_BY_ME":"Pendency_Type_SendOut","SNS_APPLICATION_AGREE":"Response_Action_Agree","SNS_APPLICATION_AGREE_AND_ADD":"Response_Action_AgreeAndAdd","SNS_CHECK_TYPE_BOTH":"CheckResult_Type_Both","SNS_CHECK_TYPE_SINGLE":"CheckResult_Type_Single","SNS_TYPE_NO_RELATION":"CheckResult_Type_NoRelation","SNS_TYPE_A_WITH_B":"CheckResult_Type_AWithB","SNS_TYPE_B_WITH_A":"CheckResult_Type_BWithA","SNS_TYPE_BOTH_WAY":"CheckResult_Type_BothWay","NET_STATE_CONNECTED":"connected","NET_STATE_CONNECTING":"connecting","NET_STATE_DISCONNECTED":"disconnected","MSG_AT_ALL":"__kImSDK_MesssageAtALL__"},X=function(){function e(){o(this,e),this.cache=[],this.options=null}return s(e,[{"key":"use","value":function value(V){if("function"!=typeof V)throw"middleware must be a function";return this.cache.push(V),this}},{"key":"next","value":function value(V){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{"key":"run","value":function value(V){return this.middlewares=this.cache.map((function(V){return V})),this.options=V,this.next()}}]),e}(),Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==z.g?z.g:"undefined"!=typeof self?self:{};function N(V,$){return V($={"exports":{}},$.exports),$.exports}var ee=N((function(V,$){var z,X,ee,ie,ce,le,de,pe,fe,ye,_e,Se,Te,He,Qe,ze,bt,At;V.exports=(z="function"==typeof Promise,X="object"==("undefined"==typeof self?"undefined":ae(self))?self:Z,ee="undefined"!=typeof Symbol,ie="undefined"!=typeof Map,ce="undefined"!=typeof Set,le="undefined"!=typeof WeakMap,de="undefined"!=typeof WeakSet,pe="undefined"!=typeof DataView,fe=ee&&void 0!==Symbol.iterator,ye=ee&&void 0!==Symbol.toStringTag,_e=ce&&"function"==typeof Set.prototype.entries,Se=ie&&"function"==typeof Map.prototype.entries,Te=_e&&Object.getPrototypeOf((new Set).entries()),He=Se&&Object.getPrototypeOf((new Map).entries()),Qe=fe&&"function"==typeof Array.prototype[Symbol.iterator],ze=Qe&&Object.getPrototypeOf([][Symbol.iterator]()),bt=fe&&"function"==typeof String.prototype[Symbol.iterator],At=bt&&Object.getPrototypeOf(""[Symbol.iterator]()),function(V){var $=ae(V);if("object"!==$)return $;if(null===V)return"null";if(V===X)return"global";if(Array.isArray(V)&&(!1===ye||!(Symbol.toStringTag in V)))return"Array";if("object"==("undefined"==typeof window?"undefined":ae(window))&&null!==window){if("object"==ae(window.location)&&V===window.location)return"Location";if("object"==ae(window.document)&&V===window.document)return"Document";if("object"==ae(window.navigator)){if("object"==ae(window.navigator.mimeTypes)&&V===window.navigator.mimeTypes)return"MimeTypeArray";if("object"==ae(window.navigator.plugins)&&V===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"==ae(window.HTMLElement))&&V instanceof window.HTMLElement){if("BLOCKQUOTE"===V.tagName)return"HTMLQuoteElement";if("TD"===V.tagName)return"HTMLTableDataCellElement";if("TH"===V.tagName)return"HTMLTableHeaderCellElement"}}var Z=ye&&V[Symbol.toStringTag];if("string"==typeof Z)return Z;var ee=Object.getPrototypeOf(V);return ee===RegExp.prototype?"RegExp":ee===Date.prototype?"Date":z&&ee===Promise.prototype?"Promise":ce&&ee===Set.prototype?"Set":ie&&ee===Map.prototype?"Map":de&&ee===WeakSet.prototype?"WeakSet":le&&ee===WeakMap.prototype?"WeakMap":pe&&ee===DataView.prototype?"DataView":ie&&ee===He?"Map Iterator":ce&&ee===Te?"Set Iterator":Qe&&ee===ze?"Array Iterator":bt&&ee===At?"String Iterator":null===ee?"Object":Object.prototype.toString.call(V).slice(8,-1)})})),ie={"TEST":{"CHINA":{"DEFAULT":"wss://wss-dev.tim.qq.com"},"OVERSEA":{"DEFAULT":"wss://wss-dev.tim.qq.com"},"SINGAPORE":{"DEFAULT":"wss://wsssgp-dev.im.qcloud.com"},"KOREA":{"DEFAULT":"wss://wsskr-dev.im.qcloud.com"},"GERMANY":{"DEFAULT":"wss://wssger-dev.im.qcloud.com"}},"PRODUCTION":{"CHINA":{"DEFAULT":"wss://wss.im.qcloud.com","BACKUP":"wss://wss.tim.qq.com"},"OVERSEA":{"DEFAULT":"wss://wss.im.qcloud.com"},"SINGAPORE":{"DEFAULT":"wss://wsssgp.im.qcloud.com"},"KOREA":{"DEFAULT":"wss://wsskr.im.qcloud.com"},"GERMANY":{"DEFAULT":"wss://wssger.im.qcloud.com"}}},ce="1.7.3",le=537048168,de="CHINA",pe={"HOST":{"CURRENT":{"DEFAULT":"wss://wss.im.qcloud.com"},"setCurrent":function setCurrent(){var V=arguments.length>0&&void 0!==arguments[0]?arguments[0]:de;this.CURRENT=ie.PRODUCTION[V]}},"NAME":{"OPEN_IM":"openim","GROUP":"group_open_http_svc","GROUP_ATTR":"group_open_attr_http_svc","FRIEND":"sns","PROFILE":"profile","RECENT_CONTACT":"recentcontact","PIC":"openpic","BIG_GROUP_NO_AUTH":"group_open_http_noauth_svc","BIG_GROUP_LONG_POLLING":"group_open_long_polling_http_svc","BIG_GROUP_LONG_POLLING_NO_AUTH":"group_open_long_polling_http_noauth_svc","IM_OPEN_STAT":"imopenstat","WEB_IM":"webim","IM_COS_SIGN":"im_cos_sign_svr","CUSTOM_UPLOAD":"im_cos_msg","HEARTBEAT":"heartbeat","IM_OPEN_PUSH":"im_open_push","IM_OPEN_STATUS":"im_open_status","IM_LONG_MESSAGE":"im_long_msg","CLOUD_CONTROL":"im_sdk_config_mgr"},"CMD":{"ACCESS_LAYER":"accesslayer","LOGIN":"wslogin","LOGOUT_LONG_POLL":"longpollinglogout","LOGOUT":"wslogout","HELLO":"wshello","PORTRAIT_GET":"portrait_get_all","PORTRAIT_SET":"portrait_set","GET_LONG_POLL_ID":"getlongpollingid","LONG_POLL":"longpolling","AVCHATROOM_LONG_POLL":"get_msg","ADD_FRIEND":"friend_add","UPDATE_FRIEND":"friend_update","GET_FRIEND_LIST":"friend_get","GET_FRIEND_PROFILE":"friend_get_list","DELETE_FRIEND":"friend_delete","CHECK_FRIEND":"friend_check","GET_FRIEND_GROUP_LIST":"group_get","RESPOND_FRIEND_APPLICATION":"friend_response","GET_FRIEND_APPLICATION_LIST":"pendency_get","DELETE_FRIEND_APPLICATION":"pendency_delete","REPORT_FRIEND_APPLICATION":"pendency_report","GET_GROUP_APPLICATION":"get_pendency","CREATE_FRIEND_GROUP":"group_add","DELETE_FRIEND_GROUP":"group_delete","UPDATE_FRIEND_GROUP":"group_update","GET_BLACKLIST":"black_list_get","ADD_BLACKLIST":"black_list_add","DELETE_BLACKLIST":"black_list_delete","CREATE_GROUP":"create_group","GET_JOINED_GROUPS":"get_joined_group_list","SET_GROUP_ATTRIBUTES":"set_group_attr","MODIFY_GROUP_ATTRIBUTES":"modify_group_attr","DELETE_GROUP_ATTRIBUTES":"delete_group_attr","CLEAR_GROUP_ATTRIBUTES":"clear_group_attr","GET_GROUP_ATTRIBUTES":"get_group_attr","SEND_MESSAGE":"sendmsg","REVOKE_C2C_MESSAGE":"msgwithdraw","DELETE_C2C_MESSAGE":"delete_c2c_msg_ramble","SEND_GROUP_MESSAGE":"send_group_msg","REVOKE_GROUP_MESSAGE":"group_msg_recall","DELETE_GROUP_MESSAGE":"delete_group_ramble_msg_by_seq","GET_GROUP_INFO":"get_group_info","GET_GROUP_MEMBER_INFO":"get_specified_group_member_info","GET_GROUP_MEMBER_LIST":"get_group_member_info","QUIT_GROUP":"quit_group","CHANGE_GROUP_OWNER":"change_group_owner","DESTROY_GROUP":"destroy_group","ADD_GROUP_MEMBER":"add_group_member","DELETE_GROUP_MEMBER":"delete_group_member","SEARCH_GROUP_BY_ID":"get_group_public_info","APPLY_JOIN_GROUP":"apply_join_group","HANDLE_APPLY_JOIN_GROUP":"handle_apply_join_group","HANDLE_GROUP_INVITATION":"handle_invite_join_group","MODIFY_GROUP_INFO":"modify_group_base_info","MODIFY_GROUP_MEMBER_INFO":"modify_group_member_info","DELETE_GROUP_SYSTEM_MESSAGE":"deletemsg","DELETE_GROUP_AT_TIPS":"deletemsg","GET_CONVERSATION_LIST":"get","PAGING_GET_CONVERSATION_LIST":"page_get","DELETE_CONVERSATION":"delete","PIN_CONVERSATION":"top","GET_MESSAGES":"getmsg","GET_C2C_ROAM_MESSAGES":"getroammsg","GET_GROUP_ROAM_MESSAGES":"group_msg_get","SET_C2C_MESSAGE_READ":"msgreaded","GET_PEER_READ_TIME":"get_peer_read_time","SET_GROUP_MESSAGE_READ":"msg_read_report","FILE_READ_AND_WRITE_AUTHKEY":"authkey","FILE_UPLOAD":"pic_up","COS_SIGN":"cos","COS_PRE_SIG":"pre_sig","TIM_WEB_REPORT_V2":"tim_web_report_v2","BIG_DATA_HALLWAY_AUTH_KEY":"authkey","GET_ONLINE_MEMBER_NUM":"get_online_member_num","ALIVE":"alive","MESSAGE_PUSH":"msg_push","MESSAGE_PUSH_ACK":"ws_msg_push_ack","STATUS_FORCEOFFLINE":"stat_forceoffline","DOWNLOAD_MERGER_MESSAGE":"get_relay_json_msg","UPLOAD_MERGER_MESSAGE":"save_relay_json_msg","FETCH_CLOUD_CONTROL_CONFIG":"fetch_config","PUSHED_CLOUD_CONTROL_CONFIG":"push_configv2"},"CHANNEL":{"SOCKET":1,"XHR":2,"AUTO":0},"NAME_VERSION":{"openim":"v4","group_open_http_svc":"v4","sns":"v4","profile":"v4","recentcontact":"v4","openpic":"v4","group_open_http_noauth_svc":"v4","group_open_long_polling_http_svc":"v4","group_open_long_polling_http_noauth_svc":"v4","imopenstat":"v4","im_cos_sign_svr":"v4","im_cos_msg":"v4","webim":"v4","im_open_push":"v4","im_open_status":"v4"}};pe.HOST.setCurrent(de);var fe,ye,_e,Se,Te="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),He="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),Qe="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),ze="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),bt="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),At="undefined"!=typeof uni&&"undefined"==typeof window,Mt=Te||He||Qe||ze||bt||At,St=("undefined"!=typeof uni||"undefined"!=typeof window)&&!Mt,Tt=He?qq:Qe?tt:ze?swan:bt?my:Te?wx:At?uni:{},kt=(fe="WEB",Ut?fe="WEB":He?fe="QQ_MP":Qe?fe="TT_MP":ze?fe="BAIDU_MP":bt?fe="ALI_MP":Te?fe="WX_MP":At&&(fe="UNI_NATIVE_APP"),{"WEB":7,"WX_MP":8,"QQ_MP":9,"TT_MP":10,"BAIDU_MP":11,"ALI_MP":12,"UNI_NATIVE_APP":15}[fe]),Ct=St&&window&&window.navigator&&window.navigator.userAgent||"",wt=/AppleWebKit\/([\d.]+)/i.exec(Ct),Ot=(wt&&parseFloat(wt.pop()),/iPad/i.test(Ct)),Nt=/iPhone/i.test(Ct)&&!Ot,Pt=/iPod/i.test(Ct),Rt=Nt||Ot||Pt,Lt=((ye=Ct.match(/OS (\d+)_/i))&&ye[1]&&ye[1],/Android/i.test(Ct)),Gt=(function(){var V=Ct.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!V)return null;var $=V[1]&&parseFloat(V[1]),z=V[2]&&parseFloat(V[2]);$&&z&&parseFloat(V[1]+"."+V[2])}(),Lt&&/webkit/i.test(Ct),/Firefox/i.test(Ct),!/Edge/i.test(Ct)&&/Chrome/i.test(Ct),function(){var V=Ct.match(/Chrome\/(\d+)/);V&&V[1]&&parseFloat(V[1])}(),/MSIE/.test(Ct)),xt=(/MSIE\s8\.0/.test(Ct),function(){var V=/MSIE\s(\d+)\.\d/.exec(Ct),$=V&&parseFloat(V[1]);return!$&&/Trident\/7.0/i.test(Ct)&&/rv:11.0/.test(Ct)&&($=11),$}()),Ft=(/Safari/i.test(Ct),/TBS\/\d+/i.test(Ct)),Ut=(function(){var V=Ct.match(/TBS\/(\d+)/i);V&&V[1]&&V[1]}(),!Ft&&/MQQBrowser\/\d+/i.test(Ct),!Ft&&/ QQBrowser\/\d+/i.test(Ct),/(micromessenger|webbrowser)/i.test(Ct)),Bt=/Windows/i.test(Ct),jt=/MAC OS X/i.test(Ct),qt=(/MicroMessenger/i.test(Ct),St&&"undefined"!=typeof Worker),Vt=void 0!==z.g?z.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};_e="undefined"!=typeof console?console:void 0!==Vt&&Vt.console?Vt.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Ht=function ve(){},$t=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Kt=$t.length;Kt--;)Se=$t[Kt],console[Se]||(_e[Se]=Ht);_e.methods=$t;var Qt=_e,zt=0,Wt=function ke(){return(new Date).getTime()+zt},Yt=function De(){zt=0},Xt=0,Jt=new Map;function Ae(){var V,$=((V=new Date).setTime(Wt()),V);return"TIM "+$.toLocaleTimeString("en-US",{"hour12":!1})+"."+function(V){var $;switch(V.toString().length){case 1:$="00"+V;break;case 2:$="0"+V;break;default:$=V}return $}($.getMilliseconds())+":"}var Zt={"arguments2String":function arguments2String(V){var $;if(1===V.length)$=Ae()+V[0];else{$=Ae();for(var z=0,X=V.length;z4294967295?(hn+=4294967295,Date.now()-hn):V},"utc":function utc(){return Math.round(Date.now()/1e3)}},mn=function e(V,$,z,X){if(!cn(V)||!cn($))return 0;for(var Z,ee=0,ae=Object.keys($),ie=0,ce=ae.length;ie=0?$[X]=V[X]:$[X]=e(V[X])):$[X]=void 0:$[X]=null;return $};function ot(V,$){sn(V)&&sn($)?$.forEach((function($){var z=$.key,X=$.value,Z=V.find((function(V){return V.key===z}));Z?Z.value=X:V.push({"key":z,"value":X})})):Zt.warn("updateCustomField target 或 source 不是数组,忽略此次更新。")}var kn=function at(V){return V===$.GRP_PUBLIC},En=function st(V){return V===$.GRP_AVCHATROOM},Cn=function rt(V){return rn(V)&&V.slice(0,3)===$.CONV_C2C},wn=function it(V){return rn(V)&&V.slice(0,5)===$.CONV_GROUP},Dn=function ut(V){return rn(V)&&V===$.CONV_SYSTEM};function ct(V,$){var z={};return Object.keys(V).forEach((function(X){z[X]=$(V[X],X)})),z}function lt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function dt(){var V="unknown";if(jt&&(V="mac"),Bt&&(V="windows"),Rt&&(V="ios"),Lt&&(V="android"),Mt)try{var $=Tt.getSystemInfoSync().platform;void 0!==$&&(V=$)}catch(V){}return V}function pt(V){var $=V.originUrl,z=void 0===$?void 0:$,X=V.originWidth,Z=V.originHeight,ee=V.min,ae=void 0===ee?198:ee,ie=parseInt(X),ce=parseInt(Z),le={"url":void 0,"width":0,"height":0};if((ie<=ce?ie:ce)<=ae)le.url=z,le.width=ie,le.height=ce;else{ce<=ie?(le.width=Math.ceil(ie*ae/ce),le.height=ae):(le.width=ae,le.height=Math.ceil(ce*ae/ie));var de=z&&z.indexOf("?")>-1?"".concat(z,"&"):"".concat(z,"?");le.url="".concat(de,198===ae?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return un(z)?g(le,en):le}function gt(V){var $=V[2];V[2]=V[1],V[1]=$;for(var z=0;z=0}}},"setGroupMemberNameCard":{"groupID":Vn,"userID":{"type":"String"},"nameCard":{"type":"String","validator":function validator(V){return rn(V)?(V.length,!0):(console.warn(qn({"api":"setGroupMemberNameCard","param":"nameCard","desc":"类型必须为 String"})),!1)}}},"setMessageRemindType":{"groupID":Vn,"messageRemindType":Vn},"setGroupMemberCustomField":{"groupID":Vn,"userID":{"type":"String"},"memberCustomField":Hn},"deleteGroupMember":{"groupID":Vn},"createTextMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return an(V)?rn(V.text)?0!==V.text.length||(console.warn(qn({"api":"createTextMessage","desc":"消息内容不能为空"})),!1):(console.warn(qn({"api":"createTextMessage","param":"payload.text","desc":"类型必须为 String"})),!1):(console.warn(qn({"api":"createTextMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}})},"createTextAtMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return an(V)?rn(V.text)?0===V.text.length?(console.warn(qn({"api":"createTextAtMessage","desc":"消息内容不能为空"})),!1):!(V.atUserList&&!sn(V.atUserList)&&(console.warn(qn({"api":"createTextAtMessage","desc":"payload.atUserList 类型必须为数组"})),1)):(console.warn(qn({"api":"createTextAtMessage","param":"payload.text","desc":"类型必须为 String"})),!1):(console.warn(qn({"api":"createTextAtMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}})},"createCustomMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return an(V)?V.data&&!rn(V.data)?(console.warn(qn({"api":"createCustomMessage","param":"payload.data","desc":"类型必须为 String"})),!1):V.description&&!rn(V.description)?(console.warn(qn({"api":"createCustomMessage","param":"payload.description","desc":"类型必须为 String"})),!1):!(V.extension&&!rn(V.extension)&&(console.warn(qn({"api":"createCustomMessage","param":"payload.extension","desc":"类型必须为 String"})),1)):(console.warn(qn({"api":"createCustomMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}})},"createImageMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){if(!an(V))return console.warn(qn({"api":"createImageMessage","param":"payload","desc":"类型必须为 plain object"})),!1;if(un(V.file))return console.warn(qn({"api":"createImageMessage","param":"payload.file","desc":"不能为 undefined"})),!1;if(St){if(!(V.file instanceof HTMLInputElement||tn(V.file)))return an(V.file)&&"undefined"!=typeof uni?0!==V.file.tempFilePaths.length&&0!==V.file.tempFiles.length||(console.warn(qn({"api":"createImageMessage","param":"payload.file","desc":"您没有选择文件,无法发送"})),!1):(console.warn(qn({"api":"createImageMessage","param":"payload.file","desc":"类型必须是 HTMLInputElement 或 File"})),!1);if(V.file instanceof HTMLInputElement&&0===V.file.files.length)return console.warn(qn({"api":"createImageMessage","param":"payload.file","desc":"您没有选择文件,无法发送"})),!1}return!0},"onProgress":{"type":"Function","required":!1,"validator":function validator(V){return un(V)&&console.warn(qn({"api":"createImageMessage","desc":"没有 onProgress 回调,您将无法获取上传进度"})),!0}}})},"createAudioMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return!!an(V)||(console.warn(qn({"api":"createAudioMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}}),"onProgress":{"type":"Function","required":!1,"validator":function validator(V){return un(V)&&console.warn(qn({"api":"createAudioMessage","desc":"没有 onProgress 回调,您将无法获取上传进度"})),!0}}},"createVideoMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){if(!an(V))return console.warn(qn({"api":"createVideoMessage","param":"payload","desc":"类型必须为 plain object"})),!1;if(un(V.file))return console.warn(qn({"api":"createVideoMessage","param":"payload.file","desc":"不能为 undefined"})),!1;if(St){if(!(V.file instanceof HTMLInputElement||tn(V.file)))return an(V.file)&&"undefined"!=typeof uni?!!tn(V.file.tempFile)||(console.warn(qn({"api":"createVideoMessage","param":"payload.file","desc":"您没有选择文件,无法发送"})),!1):(console.warn(qn({"api":"createVideoMessage","param":"payload.file","desc":"类型必须是 HTMLInputElement 或 File"})),!1);if(V.file instanceof HTMLInputElement&&0===V.file.files.length)return console.warn(qn({"api":"createVideoMessage","param":"payload.file","desc":"您没有选择文件,无法发送"})),!1}return!0}}),"onProgress":{"type":"Function","required":!1,"validator":function validator(V){return un(V)&&console.warn(qn({"api":"createVideoMessage","desc":"没有 onProgress 回调,您将无法获取上传进度"})),!0}}},"createFaceMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return an(V)?nn(V.index)?!!rn(V.data)||(console.warn(qn({"api":"createFaceMessage","param":"payload.data","desc":"类型必须为 String"})),!1):(console.warn(qn({"api":"createFaceMessage","param":"payload.index","desc":"类型必须为 Number"})),!1):(console.warn(qn({"api":"createFaceMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}})},"createFileMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){if(!an(V))return console.warn(qn({"api":"createFileMessage","param":"payload","desc":"类型必须为 plain object"})),!1;if(un(V.file))return console.warn(qn({"api":"createFileMessage","param":"payload.file","desc":"不能为 undefined"})),!1;if(St){if(!(V.file instanceof HTMLInputElement||tn(V.file)))return an(V.file)&&"undefined"!=typeof uni?0!==V.file.tempFilePaths.length&&0!==V.file.tempFiles.length||(console.warn(qn({"api":"createFileMessage","param":"payload.file","desc":"您没有选择文件,无法发送"})),!1):(console.warn(qn({"api":"createFileMessage","param":"payload.file","desc":"类型必须是 HTMLInputElement 或 File"})),!1);if(V.file instanceof HTMLInputElement&&0===V.file.files.length)return console.warn(qn({"api":"createFileMessage","desc":"您没有选择文件,无法发送"})),!1}return!0}}),"onProgress":{"type":"Function","required":!1,"validator":function validator(V){return un(V)&&console.warn(qn({"api":"createFileMessage","desc":"没有 onProgress 回调,您将无法获取上传进度"})),!0}}},"createLocationMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){return an(V)?rn(V.description)?nn(V.longitude)?!!nn(V.latitude)||(console.warn(qn({"api":"createLocationMessage","param":"payload.latitude","desc":"类型必须为 Number"})),!1):(console.warn(qn({"api":"createLocationMessage","param":"payload.longitude","desc":"类型必须为 Number"})),!1):(console.warn(qn({"api":"createLocationMessage","param":"payload.description","desc":"类型必须为 String"})),!1):(console.warn(qn({"api":"createLocationMessage","param":"payload","desc":"类型必须为 plain object"})),!1)}})},"createMergerMessage":{"to":Vn,"conversationType":Vn,"payload":t(t({},$n),{},{"validator":function validator(V){if(vt(V.messageList))return console.warn(qn({"api":"createMergerMessage","desc":"不能为空数组"})),!1;if(vt(V.compatibleText))return console.warn(qn({"api":"createMergerMessage","desc":"类型必须为 String,且不能为空"})),!1;var $=!1;return V.messageList.forEach((function(V){V.status===Ln&&($=!0)})),!$||(console.warn(qn({"api":"createMergerMessage","desc":"不支持合并已发送失败的消息"})),!1)}})},"revokeMessage":[t(t({"name":"message"},$n),{},{"validator":function validator(V){return vt(V)?(console.warn("revokeMessage 请传入消息(Message)实例"),!1):V.conversationType===$.CONV_SYSTEM?(console.warn("revokeMessage 不能撤回系统会话消息,只能撤回单聊消息或群消息"),!1):!0!==V.isRevoked||(console.warn("revokeMessage 消息已经被撤回,请勿重复操作"),!1)}})],"deleteMessage":[t(t({"name":"messageList"},Hn),{},{"validator":function validator(V){return!vt(V)||(console.warn(qn({"api":"deleteMessage","param":"messageList","desc":"不能为空数组"})),!1)}})],"getUserProfile":{"userIDList":{"type":"Array","validator":function validator(V){return sn(V)?(0===V.length&&console.warn(qn({"api":"getUserProfile","param":"userIDList","desc":"不能为空数组"})),!0):(console.warn(qn({"api":"getUserProfile","param":"userIDList","desc":"必须为数组"})),!1)}}},"updateMyProfile":{"profileCustomField":{"type":"Array","validator":function validator(V){return!!un(V)||!!sn(V)||(console.warn(qn({"api":"updateMyProfile","param":"profileCustomField","desc":"必须为数组"})),!1)}}},"addFriend":{"to":Vn,"source":{"type":"String","required":!0,"validator":function validator(V){return!(!V||(V.startsWith("AddSource_Type_")?V.replace("AddSource_Type_","").length>8&&(console.warn(qn({"api":"addFriend","desc":"加好友来源字段的关键字长度不得超过8字节"})),1):(console.warn(qn({"api":"addFriend","desc":"加好友来源字段的前缀必须是:AddSource_Type_"})),1)))}},"remark":{"type":"String","required":!1,"validator":function validator(V){return!(rn(V)&&V.length>96&&(console.warn(qn({"api":"updateFriend","desc":" 备注长度最长不得超过 96 个字节"})),1))}}},"deleteFriend":{"userIDList":Hn},"checkFriend":{"userIDList":Hn},"getFriendProfile":{"userIDList":Hn},"updateFriend":{"userID":Vn,"remark":{"type":"String","required":!1,"validator":function validator(V){return!(rn(V)&&V.length>96&&(console.warn(qn({"api":"updateFriend","desc":" 备注长度最长不得超过 96 个字节"})),1))}},"friendCustomField":{"type":"Array","required":!1,"validator":function validator(V){if(V){if(!sn(V))return console.warn(qn({"api":"updateFriend","param":"friendCustomField","desc":"必须为数组"})),!1;var $=!0;return V.forEach((function(V){return rn(V.key)&&-1!==V.key.indexOf("Tag_SNS_Custom")?rn(V.value)?V.value.length>8?(console.warn(qn({"api":"updateFriend","desc":"好友自定义字段的关键字长度不得超过8字节"})),$=!1):void 0:(console.warn(qn({"api":"updateFriend","desc":"类型必须为 String"})),$=!1):(console.warn(qn({"api":"updateFriend","desc":"好友自定义字段的前缀必须是 Tag_SNS_Custom"})),$=!1)})),$}return!0}}},"acceptFriendApplication":{"userID":Vn},"refuseFriendApplication":{"userID":Vn},"deleteFriendApplication":{"userID":Vn},"createFriendGroup":{"name":Vn},"deleteFriendGroup":{"name":Vn},"addToFriendGroup":{"name":Vn,"userIDList":Hn},"removeFromFriendGroup":{"name":Vn,"userIDList":Hn},"renameFriendGroup":{"oldName":Vn,"newName":Vn}},Qn={"login":"login","logout":"logout","on":"on","once":"once","off":"off","setLogLevel":"setLogLevel","registerPlugin":"registerPlugin","destroy":"destroy","createTextMessage":"createTextMessage","createTextAtMessage":"createTextAtMessage","createImageMessage":"createImageMessage","createAudioMessage":"createAudioMessage","createVideoMessage":"createVideoMessage","createCustomMessage":"createCustomMessage","createFaceMessage":"createFaceMessage","createFileMessage":"createFileMessage","createLocationMessage":"createLocationMessage","createMergerMessage":"createMergerMessage","downloadMergerMessage":"downloadMergerMessage","createForwardMessage":"createForwardMessage","sendMessage":"sendMessage","resendMessage":"resendMessage","revokeMessage":"revokeMessage","deleteMessage":"deleteMessage","getMessageList":"getMessageList","setMessageRead":"setMessageRead","getConversationList":"getConversationList","getConversationProfile":"getConversationProfile","deleteConversation":"deleteConversation","pinConversation":"pinConversation","getGroupList":"getGroupList","getGroupProfile":"getGroupProfile","createGroup":"createGroup","joinGroup":"joinGroup","updateGroupProfile":"updateGroupProfile","quitGroup":"quitGroup","dismissGroup":"dismissGroup","changeGroupOwner":"changeGroupOwner","searchGroupByID":"searchGroupByID","setMessageRemindType":"setMessageRemindType","handleGroupApplication":"handleGroupApplication","initGroupAttributes":"initGroupAttributes","setGroupAttributes":"setGroupAttributes","deleteGroupAttributes":"deleteGroupAttributes","getGroupAttributes":"getGroupAttributes","getGroupMemberProfile":"getGroupMemberProfile","getGroupMemberList":"getGroupMemberList","addGroupMember":"addGroupMember","deleteGroupMember":"deleteGroupMember","setGroupMemberNameCard":"setGroupMemberNameCard","setGroupMemberMuteTime":"setGroupMemberMuteTime","setGroupMemberRole":"setGroupMemberRole","setGroupMemberCustomField":"setGroupMemberCustomField","getGroupOnlineMemberCount":"getGroupOnlineMemberCount","getMyProfile":"getMyProfile","getUserProfile":"getUserProfile","updateMyProfile":"updateMyProfile","getBlacklist":"getBlacklist","addToBlacklist":"addToBlacklist","removeFromBlacklist":"removeFromBlacklist","getFriendList":"getFriendList","addFriend":"addFriend","deleteFriend":"deleteFriend","checkFriend":"checkFriend","updateFriend":"updateFriend","getFriendProfile":"getFriendProfile","getFriendApplicationList":"getFriendApplicationList","refuseFriendApplication":"refuseFriendApplication","deleteFriendApplication":"deleteFriendApplication","acceptFriendApplication":"acceptFriendApplication","setFriendApplicationRead":"setFriendApplicationRead","getFriendGroupList":"getFriendGroupList","createFriendGroup":"createFriendGroup","renameFriendGroup":"renameFriendGroup","deleteFriendGroup":"deleteFriendGroup","addToFriendGroup":"addToFriendGroup","removeFromFriendGroup":"removeFromFriendGroup","callExperimentalAPI":"callExperimentalAPI"},zn="sign",Wn="message",Yn="user",Xn="c2c",Jn="group",Zn="sns",er="groupMember",tr="conversation",nr="context",rr="storage",or="eventStat",ar="netMonitor",ir="bigDataChannel",sr="upload",ur="plugin",cr="syncUnreadMessage",lr="session",dr="channel",pr="message_loss_detection",fr="cloudControl",hr="worker",gr="pullGroupMessage",mr="qualityStat",vr=function(){function e(V){o(this,e),this._moduleManager=V,this._className=""}return s(e,[{"key":"isLoggedIn","value":function value(){return this._moduleManager.getModule(nr).isLoggedIn()}},{"key":"isOversea","value":function value(){return this._moduleManager.getModule(nr).isOversea()}},{"key":"getMyUserID","value":function value(){return this._moduleManager.getModule(nr).getUserID()}},{"key":"getModule","value":function value(V){return this._moduleManager.getModule(V)}},{"key":"getPlatform","value":function value(){return kt}},{"key":"getNetworkType","value":function value(){return this._moduleManager.getModule(ar).getNetworkType()}},{"key":"probeNetwork","value":function value(){return this._moduleManager.getModule(ar).probe()}},{"key":"getCloudConfig","value":function value(V){return this._moduleManager.getModule(fr).getCloudConfig(V)}},{"key":"emitOuterEvent","value":function value(V,$){this._moduleManager.getOuterEmitterInstance().emit(V,$)}},{"key":"emitInnerEvent","value":function value(V,$){this._moduleManager.getInnerEmitterInstance().emit(V,$)}},{"key":"getInnerEmitterInstance","value":function value(){return this._moduleManager.getInnerEmitterInstance()}},{"key":"generateTjgID","value":function value(V){return this._moduleManager.getModule(nr).getTinyID()+"-"+V.random}},{"key":"filterModifiedMessage","value":function value($){if(!vt($)){var z=$.filter((function(V){return!0===V.isModified}));z.length>0&&this.emitOuterEvent(V.MESSAGE_MODIFIED,z)}}},{"key":"filterUnmodifiedMessage","value":function value(V){return vt(V)?[]:V.filter((function(V){return!1===V.isModified}))}},{"key":"request","value":function value(V){return this._moduleManager.getModule(lr).request(V)}}]),e}(),yr="wslogin",_r="wslogout",br="wshello",Ar="getmsg",Mr="authkey",Sr="sendmsg",Tr="send_group_msg",Ir="portrait_get_all",kr="portrait_set",Er="black_list_get",Cr="black_list_add",wr="black_list_delete",Dr="msgwithdraw",Or="msgreaded",Nr="getroammsg",Pr="get_peer_read_time",Rr="delete_c2c_msg_ramble",Gr="page_get",xr="delete",Ur="deletemsg",Br="get_joined_group_list",jr="get_group_info",Hr="create_group",Kr="destroy_group",Qr="modify_group_base_info",zr="apply_join_group",Wr="apply_join_group_noauth",Yr="quit_group",Xr="get_group_public_info",Jr="change_group_owner",Zr="handle_apply_join_group",eo="handle_invite_join_group",to="group_msg_recall",no="msg_read_report",ro="group_msg_get",oo="get_pendency",ao="deletemsg",io="get_msg",so="get_msg_noauth",uo="get_online_member_num",co="delete_group_ramble_msg_by_seq",lo="set_group_attr",po="modify_group_attr",fo="delete_group_attr",ho="clear_group_attr",mo="get_group_attr",vo="get_group_member_info",yo="get_specified_group_member_info",_o="add_group_member",bo="delete_group_member",Ao="modify_group_member_info",Mo="pre_sig",So="tim_web_report_v2",To="alive",Io="ws_msg_push_ack",ko="save_relay_json_msg",Eo="get_relay_json_msg",Co="fetch_config",wo="push_configv2",Do={"NO_SDKAPPID":2e3,"NO_ACCOUNT_TYPE":2001,"NO_IDENTIFIER":2002,"NO_USERSIG":2003,"NO_TINYID":2022,"NO_A2KEY":2023,"USER_NOT_LOGGED_IN":2024,"REPEAT_LOGIN":2025,"COS_UNDETECTED":2040,"COS_GET_SIG_FAIL":2041,"MESSAGE_SEND_FAIL":2100,"MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS":2103,"MESSAGE_SEND_NEED_MESSAGE_INSTANCE":2105,"MESSAGE_SEND_INVALID_CONVERSATION_TYPE":2106,"MESSAGE_FILE_IS_EMPTY":2108,"MESSAGE_ONPROGRESS_FUNCTION_ERROR":2109,"MESSAGE_REVOKE_FAIL":2110,"MESSAGE_DELETE_FAIL":2111,"MESSAGE_IMAGE_SELECT_FILE_FIRST":2251,"MESSAGE_IMAGE_TYPES_LIMIT":2252,"MESSAGE_IMAGE_SIZE_LIMIT":2253,"MESSAGE_AUDIO_UPLOAD_FAIL":2300,"MESSAGE_AUDIO_SIZE_LIMIT":2301,"MESSAGE_VIDEO_UPLOAD_FAIL":2350,"MESSAGE_VIDEO_SIZE_LIMIT":2351,"MESSAGE_VIDEO_TYPES_LIMIT":2352,"MESSAGE_FILE_UPLOAD_FAIL":2400,"MESSAGE_FILE_SELECT_FILE_FIRST":2401,"MESSAGE_FILE_SIZE_LIMIT":2402,"MESSAGE_FILE_URL_IS_EMPTY":2403,"MESSAGE_MERGER_TYPE_INVALID":2450,"MESSAGE_MERGER_KEY_INVALID":2451,"MESSAGE_MERGER_DOWNLOAD_FAIL":2452,"MESSAGE_FORWARD_TYPE_INVALID":2453,"CONVERSATION_NOT_FOUND":2500,"USER_OR_GROUP_NOT_FOUND":2501,"CONVERSATION_UN_RECORDED_TYPE":2502,"ILLEGAL_GROUP_TYPE":2600,"CANNOT_JOIN_WORK":2601,"CANNOT_CHANGE_OWNER_IN_AVCHATROOM":2620,"CANNOT_CHANGE_OWNER_TO_SELF":2621,"CANNOT_DISMISS_Work":2622,"MEMBER_NOT_IN_GROUP":2623,"CANNOT_USE_GRP_ATTR_NOT_AVCHATROOM":2641,"CANNOT_USE_GRP_ATTR_AVCHATROOM_UNJOIN":2642,"JOIN_GROUP_FAIL":2660,"CANNOT_ADD_MEMBER_IN_AVCHATROOM":2661,"CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN":2662,"CANNOT_KICK_MEMBER_IN_AVCHATROOM":2680,"NOT_OWNER":2681,"CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM":2682,"INVALID_MEMBER_ROLE":2683,"CANNOT_SET_SELF_MEMBER_ROLE":2684,"CANNOT_MUTE_SELF":2685,"NOT_MY_FRIEND":2700,"ALREADY_MY_FRIEND":2701,"FRIEND_GROUP_EXISTED":2710,"FRIEND_GROUP_NOT_EXIST":2711,"FRIEND_APPLICATION_NOT_EXIST":2716,"UPDATE_PROFILE_INVALID_PARAM":2721,"UPDATE_PROFILE_NO_KEY":2722,"ADD_BLACKLIST_INVALID_PARAM":2740,"DEL_BLACKLIST_INVALID_PARAM":2741,"CANNOT_ADD_SELF_TO_BLACKLIST":2742,"ADD_FRIEND_INVALID_PARAM":2760,"NETWORK_ERROR":2800,"NETWORK_TIMEOUT":2801,"NETWORK_BASE_OPTIONS_NO_URL":2802,"NETWORK_UNDEFINED_SERVER_NAME":2803,"NETWORK_PACKAGE_UNDEFINED":2804,"NO_NETWORK":2805,"CONVERTOR_IRREGULAR_PARAMS":2900,"NOTICE_RUNLOOP_UNEXPECTED_CONDITION":2901,"NOTICE_RUNLOOP_OFFSET_LOST":2902,"UNCAUGHT_ERROR":2903,"GET_LONGPOLL_ID_FAILED":2904,"INVALID_OPERATION":2905,"CANNOT_FIND_PROTOCOL":2997,"CANNOT_FIND_MODULE":2998,"SDK_IS_NOT_READY":2999,"LONG_POLL_KICK_OUT":91101,"MESSAGE_A2KEY_EXPIRED":20002,"ACCOUNT_A2KEY_EXPIRED":70001,"LONG_POLL_API_PARAM_ERROR":90001,"HELLO_ANSWER_KICKED_OUT":1002},Oo="无法发送空文件",No="回调函数运行时遇到错误,请检查接入侧代码",Po="消息撤回失败",Ro="文件上传失败",Lo="没有找到相应的会话,请检查传入参数",Go="AVChatRoom 类型的群不支持邀请群成员",xo="updateMyProfile 无标配资料字段或自定义资料字段",Fo="传入 addToBlacklist 接口的参数无效",Uo="传入 removeFromBlacklist 接口的参数无效",Bo="不能拉黑自己",jo="网络错误",qo="请求超时",Vo="无法找到模块",Ho="接口需要 SDK 处于 ready 状态后才能调用",$o="upload",Ko="networkRTT",Qo="messageE2EDelay",zo="sendMessageC2C",Wo="sendMessageGroup",Yo="sendMessageGroupAV",Xo="sendMessageRichMedia",Jo="cosUpload",Zo="messageReceivedGroup",ea="messageReceivedGroupAVPush",na="messageReceivedGroupAVPull",ra=(r(Nn={},Ko,2),r(Nn,Qo,3),r(Nn,zo,4),r(Nn,Wo,5),r(Nn,Yo,6),r(Nn,Xo,7),r(Nn,Zo,8),r(Nn,ea,9),r(Nn,na,10),r(Nn,Jo,11),Nn),aa={"info":4,"warning":5,"error":6},ia={"wifi":1,"2g":2,"3g":3,"4g":4,"5g":5,"unknown":6,"none":7,"online":8},ua={"login":4},ca=function(){function e(V){o(this,e),this.eventType=ua[V]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=V,this.costTime=0,this.duplicate=!1,this.level=4,this._sentFlag=!1,this._startts=Wt()}return s(e,[{"key":"updateTimeStamp","value":function value(){this.timestamp=Wt()}},{"key":"start","value":function value(V){return this._startts=V,this}},{"key":"end","value":function value(){var V=this,$=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var z=Wt();this.costTime=z-this._startts,this.setMoreMessage("host:".concat(dt()," startts:").concat(this._startts," endts:").concat(z)),$?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){V._sentFlag=!0,V._eventStatModule&&V._eventStatModule.pushIn(V)}),0)}}},{"key":"setError","value":function value(V,$,z){return V instanceof Error?(this._sentFlag||(this.setNetworkType(z),$?(V.code&&this.setCode(V.code),V.message&&this.setMoreMessage(V.message)):(this.setCode(Do.NO_NETWORK),this.setMoreMessage("未连接到网络")),this.setLevel("error")),this):(Zt.warn("SSOLogData.setError value not instanceof Error, please check!"),this)}},{"key":"setCode","value":function value(V){return un(V)||this._sentFlag||("ECONNABORTED"===V&&(this.code=103),nn(V)?this.code=V:Zt.warn("SSOLogData.setCode value not a number, please check!",V,n(V))),this}},{"key":"setMessage","value":function value(V){return un(V)||this._sentFlag||(nn(V)&&(this.message=V.toString()),rn(V)&&(this.message=V)),this}},{"key":"setLevel","value":function value(V){return un(V)||this._sentFlag||(this.level=aa[V]),this}},{"key":"setMoreMessage","value":function value(V){return vt(this.moreMessage)?this.moreMessage="".concat(V):this.moreMessage+=" ".concat(V),this}},{"key":"setNetworkType","value":function value(V){return un(V)||un(ia[V])?Zt.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networkType=ia[V],this}},{"key":"getStartTs","value":function value(){return this._startts}}],[{"key":"bindEventStatModule","value":function value(V){e.prototype._eventStatModule=V}}]),e}(),la="kickedOut",da="upload",ga="getConversationList",ma="applyJoinGroup",va="error",ya=function(){function e(V){o(this,e),this.type=$.MSG_TEXT,this.content={"text":V.text||""}}return s(e,[{"key":"setText","value":function value(V){this.content.text=V}},{"key":"sendable","value":function value(){return 0!==this.content.text.length}}]),e}(),_a={"JSON":{"TYPE":{"C2C":{"NOTICE":1,"COMMON":9,"EVENT":10},"GROUP":{"COMMON":3,"TIP":4,"SYSTEM":5,"TIP2":6},"FRIEND":{"NOTICE":7},"PROFILE":{"NOTICE":8}},"SUBTYPE":{"C2C":{"COMMON":0,"READED":92,"KICKEDOUT":96},"GROUP":{"COMMON":0,"LOVEMESSAGE":1,"TIP":2,"REDPACKET":3}},"OPTIONS":{"GROUP":{"JOIN":1,"QUIT":2,"KICK":3,"SET_ADMIN":4,"CANCEL_ADMIN":5,"MODIFY_GROUP_INFO":6,"MODIFY_MEMBER_INFO":7}}},"PROTOBUF":{},"IMAGE_TYPES":{"ORIGIN":1,"LARGE":2,"SMALL":3},"IMAGE_FORMAT":{"JPG":1,"JPEG":1,"GIF":2,"PNG":3,"BMP":4,"UNKNOWN":255}},ba={"NICK":"Tag_Profile_IM_Nick","GENDER":"Tag_Profile_IM_Gender","BIRTHDAY":"Tag_Profile_IM_BirthDay","LOCATION":"Tag_Profile_IM_Location","SELFSIGNATURE":"Tag_Profile_IM_SelfSignature","ALLOWTYPE":"Tag_Profile_IM_AllowType","LANGUAGE":"Tag_Profile_IM_Language","AVATAR":"Tag_Profile_IM_Image","MESSAGESETTINGS":"Tag_Profile_IM_MsgSettings","ADMINFORBIDTYPE":"Tag_Profile_IM_AdminForbidType","LEVEL":"Tag_Profile_IM_Level","ROLE":"Tag_Profile_IM_Role"},Aa={"UNKNOWN":"Gender_Type_Unknown","FEMALE":"Gender_Type_Female","MALE":"Gender_Type_Male"},Ia={"NONE":"AdminForbid_Type_None","SEND_OUT":"AdminForbid_Type_SendOut"},ka={"NEED_CONFIRM":"AllowType_Type_NeedConfirm","ALLOW_ANY":"AllowType_Type_AllowAny","DENY_ANY":"AllowType_Type_DenyAny"},Ea="JoinedSuccess",Ca="WaitAdminApproval",wa=function(){function e(V){o(this,e),this._imageMemoryURL="",Mt?this.createImageDataASURLInWXMiniApp(V.file):this.createImageDataASURLInWeb(V.file),this._initImageInfoModel(),this.type=$.MSG_IMAGE,this._percent=0,this.content={"imageFormat":V.imageFormat||_a.IMAGE_FORMAT.UNKNOWN,"uuid":V.uuid,"imageInfoArray":[]},this.initImageInfoArray(V.imageInfoArray),this._defaultImage="http://imgcache.qq.com/open/qcloud/video/act/webim-images/default.jpg",this._autoFixUrl()}return s(e,[{"key":"_initImageInfoModel","value":function value(){var V=this;this._ImageInfoModel=function($){this.instanceID=_n(9999999),this.sizeType=$.type||0,this.type=0,this.size=$.size||0,this.width=$.width||0,this.height=$.height||0,this.imageUrl=$.url||"",this.url=$.url||V._imageMemoryURL||V._defaultImage},this._ImageInfoModel.prototype={"setSizeType":function setSizeType(V){this.sizeType=V},"setType":function setType(V){this.type=V},"setImageUrl":function setImageUrl(V){V&&(this.imageUrl=V)},"getImageUrl":function getImageUrl(){return this.imageUrl}}}},{"key":"initImageInfoArray","value":function value(V){for(var $=0,z=null,X=null;$<=2;)X=un(V)||un(V[$])?{"type":0,"size":0,"width":0,"height":0,"url":""}:V[$],(z=new this._ImageInfoModel(X)).setSizeType($+1),z.setType($),this.addImageInfo(z),$++;this.updateAccessSideImageInfoArray()}},{"key":"updateImageInfoArray","value":function value(V){for(var $,z=this.content.imageInfoArray.length,X=0;X1&&(this._percent=1)}},{"key":"updateImageFormat","value":function value(V){this.content.imageFormat=_a.IMAGE_FORMAT[V.toUpperCase()]||_a.IMAGE_FORMAT.UNKNOWN}},{"key":"createImageDataASURLInWeb","value":function value(V){void 0!==V&&V.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(V.files[0]))}},{"key":"createImageDataASURLInWXMiniApp","value":function value(V){V&&V.url&&(this._imageMemoryURL=V.url)}},{"key":"replaceImageInfo","value":function value(V,$){this.content.imageInfoArray[$]instanceof this._ImageInfoModel||(this.content.imageInfoArray[$]=V)}},{"key":"addImageInfo","value":function value(V){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(V)}},{"key":"updateAccessSideImageInfoArray","value":function value(){var V=this.content.imageInfoArray,$=V[0],z=$.width,X=void 0===z?0:z,Z=$.height,ee=void 0===Z?0:Z;0!==X&&0!==ee&&(gt(V),Object.assign(V[2],pt({"originWidth":X,"originHeight":ee,"min":720})))}},{"key":"sendable","value":function value(){return 0!==this.content.imageInfoArray.length&&""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size}}]),e}(),Da=function(){function e(V){o(this,e),this.type=$.MSG_FACE,this.content=V||null}return s(e,[{"key":"sendable","value":function value(){return null!==this.content}}]),e}(),Na=function(){function e(V){o(this,e),this.type=$.MSG_AUDIO,this._percent=0,this.content={"downloadFlag":2,"second":V.second,"size":V.size,"url":V.url,"remoteAudioUrl":V.url||"","uuid":V.uuid}}return s(e,[{"key":"updatePercent","value":function value(V){this._percent=V,this._percent>1&&(this._percent=1)}},{"key":"updateAudioUrl","value":function value(V){this.content.remoteAudioUrl=V}},{"key":"sendable","value":function value(){return""!==this.content.remoteAudioUrl}}]),e}(),La={"from":!0,"groupID":!0,"groupName":!0,"to":!0},Ga=function(){function e(V){o(this,e),this.type=$.MSG_GRP_TIP,this.content={},this._initContent(V)}return s(e,[{"key":"_initContent","value":function value(V){var $=this;Object.keys(V).forEach((function(z){switch(z){case"remarkInfo":case"operatorInfo":case"memberInfoList":case"onlineMemberInfo":break;case"groupProfile":$.content.groupProfile={},$._initGroupProfile(V[z]);break;case"msgMemberInfo":$.content.memberList=V[z],Object.defineProperty($.content,"msgMemberInfo",{"get":function get(){return Zt.warn("!!! 禁言的群提示消息中的 payload.msgMemberInfo 属性即将废弃,请使用 payload.memberList 属性替代。 \n","msgMemberInfo 中的 shutupTime 属性对应更改为 memberList 中的 muteTime 属性,表示禁言时长。 \n","参考:群提示消息 https://web.sdk.qcloud.com/im/doc/zh-cn/Message.html#.GroupTipPayload"),$.content.memberList.map((function(V){return{"userID":V.userID,"shutupTime":V.muteTime}}))}});break;case"memberNum":$.content[z]=V[z],$.content.memberCount=V[z];break;default:$.content[z]=V[z]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{"key":"_initGroupProfile","value":function value(V){for(var $=Object.keys(V),z=0;z<$.length;z++){var X=$[z];La[X]&&(this.content.groupProfile[X]=V[X])}}}]),e}(),xa={"from":!0,"groupID":!0,"groupName":!0,"to":!0},Fa=function(){function e(V){o(this,e),this.type=$.MSG_GRP_SYS_NOTICE,this.content={},this._initContent(V)}return s(e,[{"key":"_initContent","value":function value(V){var $=this;Object.keys(V).forEach((function(z){switch(z){case"memberInfoList":break;case"remarkInfo":$.content.handleMessage=V[z];break;case"groupProfile":$.content.groupProfile={},$._initGroupProfile(V[z]);break;default:$.content[z]=V[z]}}))}},{"key":"_initGroupProfile","value":function value(V){for(var $=Object.keys(V),z=0;z<$.length;z++){var X=$[z];xa[X]&&("groupName"===X?this.content.groupProfile.name=V[X]:this.content.groupProfile[X]=V[X])}}}]),e}(),Ba=function(){function e(V){o(this,e),this.type=$.MSG_FILE,this._percent=0;var z=this._getFileInfo(V);this.content={"downloadFlag":2,"fileUrl":V.url||"","uuid":V.uuid,"fileName":z.name||"","fileSize":z.size||0}}return s(e,[{"key":"_getFileInfo","value":function value(V){if(V.fileName&&V.fileSize)return{"size":V.fileSize,"name":V.fileName};if(Mt)return{};var $=V.file.files[0];return{"size":$.size,"name":$.name,"type":$.type.slice($.type.lastIndexOf("/")+1).toLowerCase()}}},{"key":"updatePercent","value":function value(V){this._percent=V,this._percent>1&&(this._percent=1)}},{"key":"updateFileUrl","value":function value(V){this.content.fileUrl=V}},{"key":"sendable","value":function value(){return""!==this.content.fileUrl&&""!==this.content.fileName&&0!==this.content.fileSize}}]),e}(),ja=function(){function e(V){o(this,e),this.type=$.MSG_CUSTOM,this.content={"data":V.data||"","description":V.description||"","extension":V.extension||""}}return s(e,[{"key":"setData","value":function value(V){return this.content.data=V,this}},{"key":"setDescription","value":function value(V){return this.content.description=V,this}},{"key":"setExtension","value":function value(V){return this.content.extension=V,this}},{"key":"sendable","value":function value(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),Ha=function(){function e(V){o(this,e),this.type=$.MSG_VIDEO,this._percent=0,this.content={"remoteVideoUrl":V.remoteVideoUrl||V.videoUrl||"","videoFormat":V.videoFormat,"videoSecond":parseInt(V.videoSecond,10),"videoSize":V.videoSize,"videoUrl":V.videoUrl,"videoDownloadFlag":2,"videoUUID":V.videoUUID,"thumbUUID":V.thumbUUID,"thumbFormat":V.thumbFormat,"thumbWidth":V.thumbWidth,"thumbHeight":V.thumbHeight,"thumbSize":V.thumbSize,"thumbDownloadFlag":2,"thumbUrl":V.thumbUrl}}return s(e,[{"key":"updatePercent","value":function value(V){this._percent=V,this._percent>1&&(this._percent=1)}},{"key":"updateVideoUrl","value":function value(V){V&&(this.content.remoteVideoUrl=V)}},{"key":"sendable","value":function value(){return""!==this.content.remoteVideoUrl}}]),e}(),$a=function(){function e(V){o(this,e),this.type=$.MSG_LOCATION;var z=V.description,X=V.longitude,Z=V.latitude;this.content={"description":z,"longitude":X,"latitude":Z}}return s(e,[{"key":"sendable","value":function value(){return!0}}]),e}(),za=function(){function e(V){if(o(this,e),this.from=V.from,this.messageSender=V.from,this.time=V.time,this.messageSequence=V.sequence,this.clientSequence=V.clientSequence||V.sequence,this.messageRandom=V.random,this.cloudCustomData=V.cloudCustomData||"",V.ID)this.nick=V.nick||"",this.avatar=V.avatar||"",this.messageBody=[{"type":V.type,"payload":V.payload}],V.conversationType.startsWith($.CONV_C2C)?this.receiverUserID=V.to:V.conversationType.startsWith($.CONV_GROUP)&&(this.receiverGroupID=V.to),this.messageReceiver=V.to;else{this.nick=V.nick||"",this.avatar=V.avatar||"",this.messageBody=[];var z=V.elements[0].type,X=V.elements[0].content;this._patchRichMediaPayload(z,X),z===$.MSG_MERGER?this.messageBody.push({"type":z,"payload":new Ja(X).content}):this.messageBody.push({"type":z,"payload":X}),V.groupID&&(this.receiverGroupID=V.groupID,this.messageReceiver=V.groupID),V.to&&(this.receiverUserID=V.to,this.messageReceiver=V.to)}}return s(e,[{"key":"_patchRichMediaPayload","value":function value(V,z){V===$.MSG_IMAGE?z.imageInfoArray.forEach((function(V){!V.imageUrl&&V.url&&(V.imageUrl=V.url,V.sizeType=V.type,1===V.type?V.type=0:3===V.type&&(V.type=1))})):V===$.MSG_VIDEO?!z.remoteVideoUrl&&z.videoUrl&&(z.remoteVideoUrl=z.videoUrl):V===$.MSG_AUDIO?!z.remoteAudioUrl&&z.url&&(z.remoteAudioUrl=z.url):V===$.MSG_FILE&&!z.fileUrl&&z.url&&(z.fileUrl=z.url,z.url=void 0)}}]),e}(),Ja=function(){function e(V){if(o(this,e),this.type=$.MSG_MERGER,this.content={"downloadKey":"","pbDownloadKey":"","messageList":[],"title":"","abstractList":[],"compatibleText":"","version":0,"layersOverLimit":!1},V.downloadKey){var z=V.downloadKey,X=V.pbDownloadKey,Z=V.title,ee=V.abstractList,ae=V.compatibleText,ie=V.version;this.content.downloadKey=z,this.content.pbDownloadKey=X,this.content.title=Z,this.content.abstractList=ee,this.content.compatibleText=ae,this.content.version=ie||0}else if(vt(V.messageList))1===V.layersOverLimit&&(this.content.layersOverLimit=!0);else{var ce=V.messageList,le=V.title,de=V.abstractList,pe=V.compatibleText,fe=V.version,ye=[];ce.forEach((function(V){if(!vt(V)){var $=new za(V);ye.push($)}})),this.content.messageList=ye,this.content.title=le,this.content.abstractList=de,this.content.compatibleText=pe,this.content.version=fe||0}Zt.debug("MergerElement.content:",this.content)}return s(e,[{"key":"sendable","value":function value(){return!vt(this.content.messageList)||!vt(this.content.downloadKey)}}]),e}(),_i={"1":$.MSG_PRIORITY_HIGH,"2":$.MSG_PRIORITY_NORMAL,"3":$.MSG_PRIORITY_LOW,"4":$.MSG_PRIORITY_LOWEST},Si=function(){function e(V){o(this,e),this.ID="",this.conversationID=V.conversationID||null,this.conversationType=V.conversationType||$.CONV_C2C,this.conversationSubType=V.conversationSubType,this.time=V.time||Math.ceil(Date.now()/1e3),this.sequence=V.sequence||0,this.clientSequence=V.clientSequence||V.sequence||0,this.random=V.random||0===V.random?V.random:_n(),this.priority=this._computePriority(V.priority),this.nick=V.nick||"",this.avatar=V.avatar||"",this.isPeerRead=!1,this.nameCard="",this._elements=[],this.isPlaceMessage=V.isPlaceMessage||0,this.isRevoked=2===V.isPlaceMessage||8===V.msgFlagBits,this.from=V.from||null,this.to=V.to||null,this.flow="",this.isSystemMessage=V.isSystemMessage||!1,this.protocol=V.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=V.status||Rn,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=V.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this.reInitialize(V.currentUser),this.extractGroupInfo(V.groupProfile||null),this.handleGroupAtInfo(V)}return s(e,[{"key":"elements","get":function get(){return Zt.warn("!!!Message 实例的 elements 属性即将废弃,请尽快修改。使用 type 和 payload 属性处理单条消息,兼容组合消息使用 _elements 属性!!!"),this._elements}},{"key":"getElements","value":function value(){return this._elements}},{"key":"extractGroupInfo","value":function value(V){if(null!==V){rn(V.nick)&&(this.nick=V.nick),rn(V.avatar)&&(this.avatar=V.avatar);var $=V.messageFromAccountExtraInformation;an($)&&rn($.nameCard)&&(this.nameCard=$.nameCard)}}},{"key":"handleGroupAtInfo","value":function value(V){var z=this;V.payload&&V.payload.atUserList&&V.payload.atUserList.forEach((function(V){V!==$.MSG_AT_ALL?(z._groupAtInfoList.push({"groupAtAllFlag":0,"groupAtUserID":V}),z.atUserList.push(V)):(z._groupAtInfoList.push({"groupAtAllFlag":1}),z.atUserList.push($.MSG_AT_ALL))})),sn(V.groupAtInfo)&&V.groupAtInfo.forEach((function(V){1===V.groupAtAllFlag?z.atUserList.push(V.groupAtUserID):2===V.groupAtAllFlag&&z.atUserList.push($.MSG_AT_ALL)}))}},{"key":"getGroupAtInfoList","value":function value(){return this._groupAtInfoList}},{"key":"_initProxy","value":function value(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{"key":"reInitialize","value":function value(V){V&&(this.status=this.from?Rn:Pn,!this.from&&(this.from=V)),this._initFlow(V),this._initSequence(V),this._concatConversationID(V),this.generateMessageID(V)}},{"key":"isSendable","value":function value(){return 0!==this._elements.length&&("function"!=typeof this._elements[0].sendable?(Zt.warn("".concat(this._elements[0].type,' need "boolean : sendable()" method')),!1):this._elements[0].sendable())}},{"key":"_initTo","value":function value(V){this.conversationType===$.CONV_GROUP&&(this.to=V.groupID)}},{"key":"_initSequence","value":function value(V){0===this.clientSequence&&V&&(this.clientSequence=function(V){if(!V)return Zt.error("autoIncrementIndex(string: key) need key parameter"),!1;if(void 0===Mn[V]){var $=new Date,z="3".concat($.getHours()).slice(-2),X="0".concat($.getMinutes()).slice(-2),Z="0".concat($.getSeconds()).slice(-2);Mn[V]=parseInt([z,X,Z,"0001"].join("")),z=null,X=null,Z=null,Zt.log("autoIncrementIndex start index:".concat(Mn[V]))}return Mn[V]++}(V)),0===this.sequence&&this.conversationType===$.CONV_C2C&&(this.sequence=this.clientSequence)}},{"key":"generateMessageID","value":function value(V){var $=V===this.from?1:0,z=this.sequence>0?this.sequence:this.clientSequence;this.ID="".concat(this.conversationID,"-").concat(z,"-").concat(this.random,"-").concat($)}},{"key":"_initFlow","value":function value(V){""!==V&&(V===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{"key":"_concatConversationID","value":function value(V){var z=this.to,X="",Z=this.conversationType;Z!==$.CONV_SYSTEM?(X=Z===$.CONV_C2C?V===this.from?z:this.from:this.to,this.conversationID="".concat(Z).concat(X)):this.conversationID=$.CONV_SYSTEM}},{"key":"isElement","value":function value(V){return V instanceof ya||V instanceof wa||V instanceof Da||V instanceof Na||V instanceof Ba||V instanceof Ha||V instanceof Ga||V instanceof Fa||V instanceof ja||V instanceof $a||V instanceof Ja}},{"key":"setElement","value":function value(V){var z=this;if(this.isElement(V))return this._elements=[V],void this._initProxy();var X=function n(V){if(V.type&&V.content)switch(V.type){case $.MSG_TEXT:z.setTextElement(V.content);break;case $.MSG_IMAGE:z.setImageElement(V.content);break;case $.MSG_AUDIO:z.setAudioElement(V.content);break;case $.MSG_FILE:z.setFileElement(V.content);break;case $.MSG_VIDEO:z.setVideoElement(V.content);break;case $.MSG_CUSTOM:z.setCustomElement(V.content);break;case $.MSG_LOCATION:z.setLocationElement(V.content);break;case $.MSG_GRP_TIP:z.setGroupTipElement(V.content);break;case $.MSG_GRP_SYS_NOTICE:z.setGroupSystemNoticeElement(V.content);break;case $.MSG_FACE:z.setFaceElement(V.content);break;case $.MSG_MERGER:z.setMergerElement(V.content);break;default:Zt.warn(V.type,V.content,"no operation......")}};if(sn(V))for(var Z=0;Z1&&void 0!==arguments[1]&&arguments[1];if($ instanceof ns)return z&&null!==rs&&rs.emit(V.ERROR,$),Promise.reject($);if($ instanceof Error){var X=new ns({"code":Do.UNCAUGHT_ERROR,"message":$.message});return z&&null!==rs&&rs.emit(V.ERROR,X),Promise.reject(X)}if(un($)||un($.code)||un($.message))Zt.error("IMPromise.reject 必须指定code(错误码)和message(错误信息)!!!");else{if(nn($.code)&&rn($.message)){var Z=new ns($);return z&&null!==rs&&rs.emit(V.ERROR,Z),Promise.reject(Z)}Zt.error("IMPromise.reject code(错误码)必须为数字,message(错误信息)必须为字符串!!!")}},is=function(z){i(n,z);var X=f(n);function n(V){var $;return o(this,n),($=X.call(this,V))._className="C2CModule",$}return s(n,[{"key":"onNewC2CMessage","value":function value($){var z=$.dataList,X=$.isInstantMessage,Z=$.C2CRemainingUnreadList;Zt.debug("".concat(this._className,".onNewC2CMessage count:").concat(z.length," isInstantMessage:").concat(X));var ee=this._newC2CMessageStoredAndSummary({"dataList":z,"C2CRemainingUnreadList":Z,"isInstantMessage":X}),ae=ee.conversationOptionsList,ie=ee.messageList;this.filterModifiedMessage(ie),ae.length>0&&this.getModule(tr).onNewMessage({"conversationOptionsList":ae,"isInstantMessage":X});var ce=this.filterUnmodifiedMessage(ie);X&&ce.length>0&&this.emitOuterEvent(V.MESSAGE_RECEIVED,ce),ie.length=0}},{"key":"_newC2CMessageStoredAndSummary","value":function value(V){for(var z=V.dataList,X=V.C2CRemainingUnreadList,Z=V.isInstantMessage,ee=null,ae=[],ie=[],ce={},le=this.getModule(ir),de=0,pe=z.length;de0&&(X=V.cloudCustomData),{"protocolName":Sr,"tjgID":this.generateTjgID(V),"requestData":{"fromAccount":this.getMyUserID(),"toAccount":V.to,"msgTimeStamp":Math.ceil(Date.now()/1e3),"msgBody":V.getElements(),"cloudCustomData":X,"msgSeq":V.sequence,"msgRandom":V.random,"msgLifeTime":this.isOnlineMessage(V,$)?0:void 0,"nick":V.nick,"avatar":V.avatar,"offlinePushInfo":z?{"pushFlag":!0===z.disablePush?1:0,"title":z.title||"","desc":z.description||"","ext":z.extension||"","apnsInfo":{"badgeMode":!0===z.ignoreIOSBadge?1:0},"androidInfo":{"OPPOChannelID":z.androidOPPOChannelID||""}}:void 0}}}},{"key":"isOnlineMessage","value":function value(V,$){return!(!$||!0!==$.onlineUserOnly)}},{"key":"revokeMessage","value":function value(V){return this.request({"protocolName":Dr,"requestData":{"msgInfo":{"fromAccount":V.from,"toAccount":V.to,"msgSeq":V.sequence,"msgRandom":V.random,"msgTimeStamp":V.time}}})}},{"key":"deleteMessage","value":function value(V){var $=V.to,z=V.keyList;return Zt.log("".concat(this._className,".deleteMessage toAccount:").concat($," count:").concat(z.length)),this.request({"protocolName":Rr,"requestData":{"fromAccount":this.getMyUserID(),"to":$,"keyList":z}})}},{"key":"setMessageRead","value":function value(V){var $=this,z=V.conversationID,X=V.lastMessageTime,Z="".concat(this._className,".setMessageRead");Zt.log("".concat(Z," conversationID:").concat(z," lastMessageTime:").concat(X)),nn(X)||Zt.warn("".concat(Z," 请勿修改 Conversation.lastMessage.lastTime,否则可能会导致已读上报结果不准确"));var ee=new ca("setC2CMessageRead");return ee.setMessage("conversationID:".concat(z," lastMessageTime:").concat(X)),this.request({"protocolName":Or,"requestData":{"C2CMsgReaded":{"cookie":"","C2CMsgReadedItem":[{"toAccount":z.replace("C2C",""),"lastMessageTime":X,"receipt":1}]}}}).then((function(){ee.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(Z," ok"));var V=$.getModule(tr);return V.updateIsReadAfterReadReport({"conversationID":z,"lastMessageTime":X}),V.updateUnreadCount(z),Ni()})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ee.setError(V,X,Z).end()})),Zt.log("".concat(Z," failed. error:"),V),as(V)}))}},{"key":"getRoamingMessage","value":function value(V){var z=this,X="".concat(this._className,".getRoamingMessage"),Z=V.peerAccount,ee=V.conversationID,ae=V.count,ie=V.lastMessageTime,ce=V.messageKey,le="peerAccount:".concat(Z," count:").concat(ae||15," lastMessageTime:").concat(ie||0," messageKey:").concat(ce);Zt.log("".concat(X," ").concat(le));var de=new ca("getC2CRoamingMessages");return this.request({"protocolName":Nr,"requestData":{"peerAccount":Z,"count":ae||15,"lastMessageTime":ie||0,"messageKey":ce}}).then((function(V){var Z=V.data,ae=Z.complete,ie=Z.messageList,ce=Z.messageKey,pe=Z.lastMessageTime;un(ie)?Zt.log("".concat(X," ok. complete:").concat(ae," but messageList is undefined!")):Zt.log("".concat(X," ok. complete:").concat(ae," count:").concat(ie.length)),de.setNetworkType(z.getNetworkType()).setMessage("".concat(le," complete:").concat(ae," length:").concat(ie.length)).end();var fe=z.getModule(tr);1===ae&&fe.setCompleted(ee);var ye=fe.storeRoamingMessage(ie,ee);fe.modifyMessageList(ee),fe.updateIsRead(ee),fe.updateRoamingMessageKeyAndTime(ee,ce,pe);var _e=fe.getPeerReadTime(ee);if(Zt.log("".concat(X," update isPeerRead property. conversationID:").concat(ee," peerReadTime:").concat(_e)),_e)fe.updateMessageIsPeerReadProperty(ee,_e);else{var Se=ee.replace($.CONV_C2C,"");z.getRemotePeerReadTime([Se]).then((function(){fe.updateMessageIsPeerReadProperty(ee,fe.getPeerReadTime(ee))}))}return ye})).catch((function(V){return z.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];de.setMessage(le).setError(V,X,Z).end()})),Zt.warn("".concat(X," failed. error:"),V),as(V)}))}},{"key":"getRemotePeerReadTime","value":function value(V){var $=this,z="".concat(this._className,".getRemotePeerReadTime");if(vt(V))return Zt.warn("".concat(z," userIDList is empty!")),Promise.resolve();var X=new ca("getPeerReadTime");return Zt.log("".concat(z," userIDList:").concat(V)),this.request({"protocolName":Pr,"requestData":{"userIDList":V}}).then((function(Z){var ee=Z.data.peerReadTimeList;Zt.log("".concat(z," ok. peerReadTimeList:").concat(ee));for(var ae="",ie=$.getModule(tr),ce=0;ce0&&ie.recordPeerReadTime("C2C".concat(V[ce]),ee[ce]);X.setNetworkType($.getNetworkType()).setMessage(ae).end()})).catch((function(V){$.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),Zt.warn("".concat(z," failed. error:"),V)}))}}]),n}(vr),ss=function(){function e(V){o(this,e),this.list=new Map,this._className="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map,this._groupLocalLastMessageSequenceMap=new Map}return s(e,[{"key":"getLocalOldestMessageByConversationID","value":function value(V){if(!V)return null;if(!this.list.has(V))return null;var $=this.list.get(V).values();return $?$.next().value:null}},{"key":"pushIn","value":function value(V){var $=arguments.length>1&&void 0!==arguments[1]&&arguments[1],z=V.conversationID,X=V.ID,Z=!0;if(this.list.has(z)||this.list.set(z,new Map),this.list.get(z).has(X)){var ee=this.list.get(z).get(X);if(!$||!0===ee.isModified)return!1}return this.list.get(z).set(X,V),this._setLatestMessageSentByPeer(z,V),this._setLatestMessageSentByMe(z,V),this._setGroupLocalLastMessageSequence(z,V),Z}},{"key":"unshift","value":function value(V){var z;if(sn(V)){if(V.length>0){z=V[0].conversationID;var X=V.length;this._unshiftMultipleMessages(V),this._setGroupLocalLastMessageSequence(z,V[X-1])}}else z=V.conversationID,this._unshiftSingleMessage(V),this._setGroupLocalLastMessageSequence(z,V);if(z&&z.startsWith($.CONV_C2C)){var Z=Array.from(this.list.get(z).values()),ee=Z.length;if(0===ee)return;for(var ae=ee-1;ae>=0;ae--)if("out"===Z[ae].flow){this._setLatestMessageSentByMe(z,Z[ae]);break}for(var ie=ee-1;ie>=0;ie--)if("in"===Z[ie].flow){this._setLatestMessageSentByPeer(z,Z[ie]);break}}}},{"key":"_unshiftSingleMessage","value":function value(V){var $=V.conversationID,z=V.ID;if(!this.list.has($))return this.list.set($,new Map),void this.list.get($).set(z,V);var X=Array.from(this.list.get($));X.unshift([z,V]),this.list.set($,new Map(X))}},{"key":"_unshiftMultipleMessages","value":function value(V){for(var $=V.length,z=[],X=V[0].conversationID,Z=this.list.has(X)?Array.from(this.list.get(X)):[],ee=0;ee<$;ee++)z.push([V[ee].ID,V[ee]]);this.list.set(X,new Map(z.concat(Z)))}},{"key":"remove","value":function value(V){var $=V.conversationID,z=V.ID;this.list.has($)&&this.list.get($).delete(z)}},{"key":"revoke","value":function value(V,$,z){if(Zt.debug("revoke message",V,$,z),this.list.has(V)){var X,Z=k(this.list.get(V));try{for(Z.s();!(X=Z.n()).done;){var ee=m(X.value,2)[1];if(ee.sequence===$&&!ee.isRevoked&&(un(z)||ee.random===z))return ee.isRevoked=!0,ee}}catch(V){Z.e(V)}finally{Z.f()}}return null}},{"key":"removeByConversationID","value":function value(V){this.list.has(V)&&(this.list.delete(V),this._latestMessageSentByPeerMap.delete(V),this._latestMessageSentByMeMap.delete(V))}},{"key":"updateMessageIsPeerReadProperty","value":function value(V,$){var z=[];if(this.list.has(V)){var X,Z=k(this.list.get(V));try{for(Z.s();!(X=Z.n()).done;){var ee=m(X.value,2)[1];ee.time<=$&&!ee.isPeerRead&&"out"===ee.flow&&(ee.isPeerRead=!0,z.push(ee))}}catch(V){Z.e(V)}finally{Z.f()}Zt.log("".concat(this._className,".updateMessageIsPeerReadProperty conversationID:").concat(V," peerReadTime:").concat($," count:").concat(z.length))}return z}},{"key":"updateMessageIsModifiedProperty","value":function value(V){var $=V.conversationID,z=V.ID;if(this.list.has($)){var X=this.list.get($).get(z);X&&(X.isModified=!0)}}},{"key":"hasLocalMessageList","value":function value(V){return this.list.has(V)}},{"key":"getLocalMessageList","value":function value(V){return this.hasLocalMessageList(V)?M(this.list.get(V).values()):[]}},{"key":"hasLocalMessage","value":function value(V,$){return!!this.hasLocalMessageList(V)&&this.list.get(V).has($)}},{"key":"getLocalMessage","value":function value(V,$){return this.hasLocalMessage(V,$)?this.list.get(V).get($):null}},{"key":"_setLatestMessageSentByPeer","value":function value(V,z){V.startsWith($.CONV_C2C)&&"in"===z.flow&&this._latestMessageSentByPeerMap.set(V,z)}},{"key":"_setLatestMessageSentByMe","value":function value(V,z){V.startsWith($.CONV_C2C)&&"out"===z.flow&&this._latestMessageSentByMeMap.set(V,z)}},{"key":"_setGroupLocalLastMessageSequence","value":function value(V,z){V.startsWith($.CONV_GROUP)&&this._groupLocalLastMessageSequenceMap.set(V,z.sequence)}},{"key":"getLatestMessageSentByPeer","value":function value(V){return this._latestMessageSentByPeerMap.get(V)}},{"key":"getLatestMessageSentByMe","value":function value(V){return this._latestMessageSentByMeMap.get(V)}},{"key":"getGroupLocalLastMessageSequence","value":function value(V){return this._groupLocalLastMessageSequenceMap.get(V)||0}},{"key":"modifyMessageSentByPeer","value":function value(V){var $=V.conversationID,z=V.latestNick,X=V.latestAvatar,Z=this.list.get($);if(!vt(Z)){var ee=Array.from(Z.values()),ae=ee.length;if(0!==ae){for(var ie=null,ce=0,le=!1,de=ae-1;de>=0;de--)"in"===ee[de].flow&&((ie=ee[de]).nick!==z&&(ie.setNickAndAvatar({"nick":z}),le=!0),ie.avatar!==X&&(ie.setNickAndAvatar({"avatar":X}),le=!0),le&&(ce+=1));Zt.log("".concat(this._className,".modifyMessageSentByPeer conversationID:").concat($," count:").concat(ce))}}}},{"key":"modifyMessageSentByMe","value":function value(V){var $=V.conversationID,z=V.latestNick,X=V.latestAvatar,Z=this.list.get($);if(!vt(Z)){var ee=Array.from(Z.values()),ae=ee.length;if(0!==ae){for(var ie=null,ce=0,le=!1,de=ae-1;de>=0;de--)"out"===ee[de].flow&&((ie=ee[de]).nick!==z&&(ie.setNickAndAvatar({"nick":z}),le=!0),ie.avatar!==X&&(ie.setNickAndAvatar({"avatar":X}),le=!0),le&&(ce+=1));Zt.log("".concat(this._className,".modifyMessageSentByMe conversationID:").concat($," count:").concat(ce))}}}},{"key":"traversal","value":function value(){if(0!==this.list.size&&-1===Zt.getLevel()){console.group("conversationID-messageCount");var V,$=k(this.list);try{for($.s();!(V=$.n()).done;){var z=m(V.value,2),X=z[0],Z=z[1];console.log("".concat(X,"-").concat(Z.size))}}catch(V){$.e(V)}finally{$.f()}console.groupEnd()}}},{"key":"reset","value":function value(){this.list.clear(),this._latestMessageSentByPeerMap.clear(),this._latestMessageSentByMeMap.clear(),this._groupLocalLastMessageSequenceMap.clear()}}]),e}(),us="_a2KeyAndTinyIDUpdated",cs="_cloudConfigUpdated",ls="_profileUpdated";function $r(V){this.mixin(V)}$r.mixin=function(V){var $=V.prototype||V;$._isReady=!1,$.ready=function(V){var $=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(V)return this._isReady?void($?V.call(this):setTimeout(V,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(V))},$.triggerReady=function(){var V=this;this._isReady=!0,setTimeout((function(){var $=V._readyQueue;V._readyQueue=[],$&&$.length>0&&$.forEach((function(V){V.call(this)}),V)}),1)},$.resetReady=function(){this._isReady=!1,this._readyQueue=[]},$.isReady=function(){return this._isReady}};var ds=["jpg","jpeg","gif","png","bmp"],ps=["mp4"],fs=function(){function e(V){var z=this;o(this,e),vt(V)||(this.userID=V.userID||"",this.nick=V.nick||"",this.gender=V.gender||"",this.birthday=V.birthday||0,this.location=V.location||"",this.selfSignature=V.selfSignature||"",this.allowType=V.allowType||$.ALLOW_TYPE_ALLOW_ANY,this.language=V.language||0,this.avatar=V.avatar||"",this.messageSettings=V.messageSettings||0,this.adminForbidType=V.adminForbidType||$.FORBID_TYPE_NONE,this.level=V.level||0,this.role=V.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],vt(V.profileCustomField)||V.profileCustomField.forEach((function(V){z.profileCustomField.push({"key":V.key,"value":V.value})})))}return s(e,[{"key":"validate","value":function value(V){var $=!0,z="";if(vt(V))return{"valid":!1,"tips":"empty options"};if(V.profileCustomField)for(var X=V.profileCustomField.length,Z=null,ee=0;ee500&&(z="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(yn(V[ae])," bytes"),$=!1);break;case"gender":An(Aa,V.gender)||(z="key:gender, invalid value:"+V.gender,$=!1);break;case"birthday":nn(V.birthday)||(z="birthday should be a number",$=!1);break;case"location":rn(V.location)||(z="location should be a string",$=!1);break;case"selfSignature":rn(V.selfSignature)||(z="selfSignature should be a string",$=!1);break;case"allowType":An(ka,V.allowType)||(z="key:allowType, invalid value:"+V.allowType,$=!1);break;case"language":nn(V.language)||(z="language should be a number",$=!1);break;case"avatar":rn(V.avatar)||(z="avatar should be a string",$=!1);break;case"messageSettings":0!==V.messageSettings&&1!==V.messageSettings&&(z="messageSettings should be 0 or 1",$=!1);break;case"adminForbidType":An(Ia,V.adminForbidType)||(z="key:adminForbidType, invalid value:"+V.adminForbidType,$=!1);break;case"level":nn(V.level)||(z="level should be a number",$=!1);break;case"role":nn(V.role)||(z="role should be a number",$=!1);break;default:z="unknown key:"+ae+" "+V[ae],$=!1}}return{"valid":$,"tips":z}}}]),e}(),hs=function e(V){o(this,e),this.value=V,this.next=null},gs=function(){function e(V){o(this,e),this.MAX_LENGTH=V,this.pTail=null,this.pNodeToDel=null,this.map=new Map,Zt.debug("SinglyLinkedList init MAX_LENGTH:".concat(this.MAX_LENGTH))}return s(e,[{"key":"set","value":function value(V){var $=new hs(V);if(this.map.size=1&&(this.unreadCount-=1)}},{"key":"isLastMessageRevoked","value":function value(V){var z=V.sequence,X=V.time;return this.type===$.CONV_C2C&&z===this.lastMessage.lastSequence&&X===this.lastMessage.lastTime||this.type===$.CONV_GROUP&&z===this.lastMessage.lastSequence}},{"key":"setLastMessageRevoked","value":function value(V){this.lastMessage.isRevoked=V}}]),e}(),As=function(z){i(a,z);var X=f(a);function a(V){var $;return o(this,a),($=X.call(this,V))._className="ConversationModule",$r.mixin(h($)),$._messageListHandler=new ss,$.singlyLinkedList=new gs(100),$._pagingStatus=Gn,$._pagingTimeStamp=0,$._pagingStartIndex=0,$._pagingPinnedTimeStamp=0,$._pagingPinnedStartIndex=0,$._conversationMap=new Map,$._tmpGroupList=[],$._tmpGroupAtTipsList=[],$._peerReadTimeMap=new Map,$._completedMap=new Map,$._roamingMessageKeyAndTimeMap=new Map,$._initListeners(),$}return s(a,[{"key":"_initListeners","value":function value(){var V=this.getInnerEmitterInstance();V.on(us,this._initLocalConversationList,this),V.on(ls,this._onProfileUpdated,this)}},{"key":"onCheckTimer","value":function value(V){V%60==0&&this._messageListHandler.traversal()}},{"key":"_initLocalConversationList","value":function value(){var V=this,z=new ca("getConversationListInStorage");Zt.log("".concat(this._className,"._initLocalConversationList."));var X="",Z=this._getStorageConversationList();if(Z){for(var ee=Z.length,ae=0;ae0&&(V.updateConversationGroupProfile(V._tmpGroupList),V._tmpGroupList.length=0)})),this._syncConversationList()}},{"key":"onMessageSent","value":function value(V){this._onSendOrReceiveMessage(V.conversationOptionsList,!0)}},{"key":"onNewMessage","value":function value(V){this._onSendOrReceiveMessage(V.conversationOptionsList,V.isInstantMessage)}},{"key":"_onSendOrReceiveMessage","value":function value(V){var $=this,z=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._isReady?0!==V.length&&(this._getC2CPeerReadTime(V),this._updateLocalConversationList(V,!1,z),this._setStorageConversationList(),this._emitConversationUpdate()):this.ready((function(){$._onSendOrReceiveMessage(V,z)}))}},{"key":"updateConversationGroupProfile","value":function value(V){var $=this;sn(V)&&0===V.length||(0!==this._conversationMap.size?(V.forEach((function(V){var z="GROUP".concat(V.groupID);if($._conversationMap.has(z)){var X=$._conversationMap.get(z);X.groupProfile=V,X.lastMessage.lastSequence0;ee--)if(!X[ee].isDeleted){Z=X[ee];break}var ae=this._conversationMap.get(z);if(ae){var ie=!1;ae.lastMessage.lastSequence!==Z.sequence&&ae.lastMessage.lastTime!==Z.time&&(ae.updateLastMessage(Z),ie=!0,Zt.log("".concat(this._className,".onMessageDeleted. update conversationID:").concat(z," with lastMessage:"),ae.lastMessage)),z.startsWith($.CONV_C2C)&&this.updateUnreadCount(z),ie&&this._emitConversationUpdate(!0,!1)}}}},{"key":"onNewGroupAtTips","value":function value(V){var $=this,z=V.dataList,X=null;z.forEach((function(V){V.groupAtTips?X=V.groupAtTips:V.elements&&(X=V.elements),X.__random=V.random,X.__sequence=V.clientSequence,$._tmpGroupAtTipsList.push(X)})),Zt.debug("".concat(this._className,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{"key":"_handleGroupAtTipsList","value":function value(){var V=this;if(0!==this._tmpGroupAtTipsList.length){var z=!1;this._tmpGroupAtTipsList.forEach((function(X){var Z=X.groupID;if(X.from!==V.getMyUserID()){var ee=V._conversationMap.get("".concat($.CONV_GROUP).concat(Z));ee&&(ee.updateGroupAtInfoList(X),z=!0)}})),z&&this._emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{"key":"_getC2CPeerReadTime","value":function value(V){var z=this,X=[];if(V.forEach((function(V){z._conversationMap.has(V.conversationID)||V.type!==$.CONV_C2C||X.push(V.conversationID.replace($.CONV_C2C,""))})),X.length>0){Zt.debug("".concat(this._className,"._getC2CPeerReadTime userIDList:").concat(X));var Z=this.getModule(Xn);Z&&Z.getRemotePeerReadTime(X)}}},{"key":"_getStorageConversationList","value":function value(){return this.getModule(rr).getItem("conversationMap")}},{"key":"_setStorageConversationList","value":function value(){var V=this.getLocalConversationList().slice(0,20).map((function(V){return{"conversationID":V.conversationID,"type":V.type,"subType":V.subType,"lastMessage":V.lastMessage,"groupProfile":V.groupProfile,"userProfile":V.userProfile}}));this.getModule(rr).setItem("conversationMap",V)}},{"key":"_emitConversationUpdate","value":function value(){var $=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],z=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],X=M(this._conversationMap.values());if(z){var Z=this.getModule(Jn);Z&&Z.updateGroupLastMessage(X)}$&&this.emitOuterEvent(V.CONVERSATION_LIST_UPDATED,X)}},{"key":"getLocalConversationList","value":function value(){return M(this._conversationMap.values())}},{"key":"getLocalConversation","value":function value(V){return this._conversationMap.get(V)}},{"key":"_syncConversationList","value":function value(){var V=this,$=new ca("syncConversationList");return this._pagingStatus===Gn&&this._conversationMap.clear(),this._pagingGetConversationList().then((function(z){return V._pagingStatus=Fn,V._setStorageConversationList(),V._handleC2CPeerReadTime(),V.checkAndPatchRemark(),$.setMessage(V._conversationMap.size).setNetworkType(V.getNetworkType()).end(),z})).catch((function(z){return V._pagingStatus=Un,$.setMessage(V._pagingTimeStamp),V.probeNetwork().then((function(V){var X=m(V,2),Z=X[0],ee=X[1];$.setError(z,Z,ee).end()})),as(z)}))}},{"key":"_pagingGetConversationList","value":function value(){var V=this,$="".concat(this._className,"._pagingGetConversationList");return Zt.log("".concat($," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex)),this._pagingStatus=xn,this.request({"protocolName":Gr,"requestData":{"fromAccount":this.getMyUserID(),"timeStamp":this._pagingTimeStamp,"startIndex":this._pagingStartIndex,"pinnedTimeStamp":this._pagingPinnedTimeStamp,"pinnedStartIndex":this._pagingStartIndex,"orderType":1}}).then((function(z){var X=z.data,Z=X.completeFlag,ee=X.conversations,ae=void 0===ee?[]:ee,ie=X.timeStamp,ce=X.startIndex,le=X.pinnedTimeStamp,de=X.pinnedStartIndex;if(Zt.log("".concat($," ok. completeFlag:").concat(Z," count:").concat(ae.length," isReady:").concat(V._isReady)),ae.length>0){var pe=V._getConversationOptions(ae);V._updateLocalConversationList(pe,!0),V.isLoggedIn()&&V._emitConversationUpdate()}if(!V._isReady){if(!V.isLoggedIn())return os();V.triggerReady()}return V._pagingTimeStamp=ie,V._pagingStartIndex=ce,V._pagingPinnedTimeStamp=le,V._pagingPinnedStartIndex=de,1!==Z?V._pagingGetConversationList():(V._handleGroupAtTipsList(),os())})).catch((function(z){throw V.isLoggedIn()&&(V._isReady||(Zt.warn("".concat($," failed. error:"),z),V.triggerReady())),z}))}},{"key":"_updateLocalConversationList","value":function value(V,$,z){var X,Z=Date.now();X=this._getTmpConversationListMapping(V,$,z),this._conversationMap=new Map(this._sortConversationList([].concat(M(X.toBeUpdatedConversationList),M(this._conversationMap)))),$||this._updateUserOrGroupProfile(X.newConversationList),Zt.debug("".concat(this._className,"._updateLocalConversationList cost ").concat(Date.now()-Z," ms"))}},{"key":"_getTmpConversationListMapping","value":function value(V,z,X){for(var Z=[],ee=[],ae=this.getModule(Jn),ie=this.getModule(Zn),ce=0,le=V.length;ce0&&ee.getUserProfile({"userIDList":X}).then((function(V){var $=V.data;sn($)?$.forEach((function(V){z._conversationMap.get("C2C".concat(V.userID)).userProfile=V})):z._conversationMap.get("C2C".concat($.userID)).userProfile=$})),Z.length>0&&ae.getGroupProfileAdvance({"groupIDList":Z,"responseFilter":{"groupBaseInfoFilter":["Type","Name","FaceUrl"]}}).then((function(V){V.data.successGroupList.forEach((function(V){var $="GROUP".concat(V.groupID);if(z._conversationMap.has($)){var X=z._conversationMap.get($);mn(X.groupProfile,V,[],[null,void 0,"",0,NaN]),!X.subType&&V.type&&(X.subType=V.type)}}))}))}}},{"key":"_getConversationOptions","value":function value(V){var $=[],z=V.filter((function(V){var $=V.lastMsg;return an($)})).filter((function(V){var $=V.type,z=V.userID;return 1===$&&"@TLS#NOT_FOUND"!==z&&"@TLS#ERROR"!==z||2===$})).map((function(V){if(1===V.type){var z={"userID":V.userID,"nick":V.peerNick,"avatar":V.peerAvatar};return $.push(z),{"conversationID":"C2C".concat(V.userID),"type":"C2C","lastMessage":{"lastTime":V.time,"lastSequence":V.sequence,"fromAccount":V.lastC2CMsgFromAccount,"messageForShow":V.messageShow,"type":V.lastMsg.elements[0]?V.lastMsg.elements[0].type:null,"payload":V.lastMsg.elements[0]?V.lastMsg.elements[0].content:null,"cloudCustomData":V.cloudCustomData||"","isRevoked":8===V.lastMessageFlag,"onlineOnlyFlag":!1,"nick":"","nameCard":""},"userProfile":new fs(z),"peerReadTime":V.c2cPeerReadTime,"isPinned":1===V.isPinned}}return{"conversationID":"GROUP".concat(V.groupID),"type":"GROUP","lastMessage":{"lastTime":V.time,"lastSequence":V.messageReadSeq+V.unreadCount,"fromAccount":V.msgGroupFromAccount,"messageForShow":V.messageShow,"type":V.lastMsg.elements[0]?V.lastMsg.elements[0].type:null,"payload":V.lastMsg.elements[0]?V.lastMsg.elements[0].content:null,"cloudCustomData":V.cloudCustomData||"","isRevoked":2===V.lastMessageFlag,"onlineOnlyFlag":!1,"nick":V.senderNick||"","nameCard":V.senderNameCard||""},"groupProfile":new vs({"groupID":V.groupID,"name":V.groupNick,"avatar":V.groupImage}),"unreadCount":V.unreadCount,"peerReadTime":0,"isPinned":1===V.isPinned}}));return $.length>0&&this.getModule(Yn).onConversationsProfileUpdated($),z}},{"key":"getLocalMessageList","value":function value(V){return this._messageListHandler.getLocalMessageList(V)}},{"key":"deleteLocalMessage","value":function value(V){V instanceof Si&&this._messageListHandler.remove(V)}},{"key":"onConversationDeleted","value":function value(V){var z=this;Zt.log("".concat(this._className,".onConversationDeleted")),sn(V)&&V.forEach((function(V){var X=V.type,Z=V.userID,ee=V.groupID,ae="";1===X?ae="".concat($.CONV_C2C).concat(Z):2===X&&(ae="".concat($.CONV_GROUP).concat(ee)),z.deleteLocalConversation(ae)}))}},{"key":"onConversationPinned","value":function value(V){var z=this;if(sn(V)){var X=!1;V.forEach((function(V){var Z,ee=V.type,ae=V.userID,ie=V.groupID;1===ee?Z=z.getLocalConversation("".concat($.CONV_C2C).concat(ae)):2===ee&&(Z=z.getLocalConversation("".concat($.CONV_GROUP).concat(ie))),Z&&(Zt.log("".concat(z._className,".onConversationPinned conversationID:").concat(Z.conversationID," isPinned:").concat(Z.isPinned)),Z.isPinned||(Z.isPinned=!0,X=!0))})),X&&this._sortConversationListAndEmitEvent()}}},{"key":"onConversationUnpinned","value":function value(V){var z=this;if(sn(V)){var X=!1;V.forEach((function(V){var Z,ee=V.type,ae=V.userID,ie=V.groupID;1===ee?Z=z.getLocalConversation("".concat($.CONV_C2C).concat(ae)):2===ee&&(Z=z.getLocalConversation("".concat($.CONV_GROUP).concat(ie))),Z&&(Zt.log("".concat(z._className,".onConversationUnpinned conversationID:").concat(Z.conversationID," isPinned:").concat(Z.isPinned)),Z.isPinned&&(Z.isPinned=!1,X=!0))})),X&&this._sortConversationListAndEmitEvent()}}},{"key":"getMessageList","value":function value(V){var $=this,z=V.conversationID,X=V.nextReqMessageID,Z=V.count,ee="".concat(this._className,".getMessageList"),ae=this.getLocalConversation(z),ie="";if(ae&&ae.groupProfile&&(ie=ae.groupProfile.type),En(ie))return Zt.log("".concat(ee," not available in avchatroom. conversationID:").concat(z)),os({"messageList":[],"nextReqMessageID":"","isCompleted":!0});(un(Z)||Z>15)&&(Z=15);var ce=this._computeLeftCount({"conversationID":z,"nextReqMessageID":X});return Zt.log("".concat(ee," conversationID:").concat(z," leftCount:").concat(ce," count:").concat(Z," nextReqMessageID:").concat(X)),this._needGetHistory({"conversationID":z,"leftCount":ce,"count":Z})?this.getHistoryMessages({"conversationID":z,"nextReqMessageID":X,"count":20}).then((function(){return ce=$._computeLeftCount({"conversationID":z,"nextReqMessageID":X}),Ni($._computeResult({"conversationID":z,"nextReqMessageID":X,"count":Z,"leftCount":ce}))})):(Zt.log("".concat(ee,".getMessageList get message list from memory")),this.modifyMessageList(z),os(this._computeResult({"conversationID":z,"nextReqMessageID":X,"count":Z,"leftCount":ce})))}},{"key":"_computeLeftCount","value":function value(V){var $=V.conversationID,z=V.nextReqMessageID;return z?this._messageListHandler.getLocalMessageList($).findIndex((function(V){return V.ID===z})):this._getMessageListSize($)}},{"key":"_getMessageListSize","value":function value(V){return this._messageListHandler.getLocalMessageList(V).length}},{"key":"_needGetHistory","value":function value(V){var $=V.conversationID,z=V.leftCount,X=V.count,Z=this.getLocalConversation($),ee="";return Z&&Z.groupProfile&&(ee=Z.groupProfile.type),!Dn($)&&!En(ee)&&zz?$-z:0}},{"key":"_computeIsCompleted","value":function value(V){var $=V.conversationID;return!!(V.leftCount<=V.count&&this._completedMap.has($))}},{"key":"getHistoryMessages","value":function value(V){var z=V.conversationID,X=V.nextReqMessageID;if(z===$.CONV_SYSTEM)return os();V.count?V.count>20&&(V.count=20):V.count=15;var Z=this._messageListHandler.getLocalOldestMessageByConversationID(z);Z||((Z={}).time=0,Z.sequence=0,0===z.indexOf($.CONV_C2C)?(Z.to=z.replace($.CONV_C2C,""),Z.conversationType=$.CONV_C2C):0===z.indexOf($.CONV_GROUP)&&(Z.to=z.replace($.CONV_GROUP,""),Z.conversationType=$.CONV_GROUP));var ee="",ae=null,ie=this._roamingMessageKeyAndTimeMap.has(z);switch(Z.conversationType){case $.CONV_C2C:return ee=z.replace($.CONV_C2C,""),(ae=this.getModule(Xn))?ae.getRoamingMessage({"conversationID":V.conversationID,"peerAccount":ee,"count":V.count,"lastMessageTime":ie?this._roamingMessageKeyAndTimeMap.get(z).lastMessageTime:0,"messageKey":ie?this._roamingMessageKeyAndTimeMap.get(z).messageKey:""}):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo});case $.CONV_GROUP:return(ae=this.getModule(Jn))?ae.getRoamingMessage({"conversationID":V.conversationID,"groupID":Z.to,"count":V.count,"sequence":X&&!1===Z.getOnlineOnlyFlag()?Z.sequence-1:Z.sequence}):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo});default:return os()}}},{"key":"patchConversationLastMessage","value":function value(V){var $=this.getLocalConversation(V);if($){var z=$.lastMessage,X=z.messageForShow,Z=z.payload;if(vt(X)||vt(Z)){var ee=this._messageListHandler.getLocalMessageList(V);if(0===ee.length)return;var ae=ee[ee.length-1];Zt.log("".concat(this._className,".patchConversationLastMessage conversationID:").concat(V," payload:"),ae.payload),$.updateLastMessage(ae)}}}},{"key":"storeRoamingMessage","value":function value(){var V=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],z=arguments.length>1?arguments[1]:void 0,X=z.startsWith($.CONV_C2C)?$.CONV_C2C:$.CONV_GROUP,Z=null,ee=[],ae=0,ie=V.length,ce=null,le=X===$.CONV_GROUP,de=this.getModule(ir),pe=function d(){ae=le?V.length-1:0,ie=le?0:V.length},fe=function p(){le?--ae:++ae},ye=function g(){return le?ae>=ie:ae=0;ae--)if(ee=Z[ae],!(X&&ee.time>X||z&&ee.sequence>z)){if("in"===ee.flow&&ee.isRead)break;ee.setIsRead(!0)}}},{"key":"updateUnreadCount","value":function value(V){var $=this.getLocalConversation(V),z=this._messageListHandler.getLocalMessageList(V);if($){var X=$.unreadCount,Z=z.filter((function(V){return!V.isRead&&!V.getOnlineOnlyFlag()&&!V.isDeleted})).length;X!==Z&&($.unreadCount=Z,Zt.log("".concat(this._className,".updateUnreadCount from ").concat(X," to ").concat(Z,", conversationID:").concat(V)),this._emitConversationUpdate(!0,!1))}}},{"key":"updateIsRead","value":function value(V){var z=this.getLocalConversation(V),X=this.getLocalMessageList(V);if(z&&0!==X.length&&!Dn(z.type)){for(var Z=[],ee=0,ae=X.length;ee0){var Z=this._messageListHandler.updateMessageIsPeerReadProperty(z,X);Z.length>0&&this.emitOuterEvent(V.MESSAGE_READ_BY_PEER,Z)}}},{"key":"updateMessageIsReadProperty","value":function value(V){var z=this.getLocalConversation(V),X=this._messageListHandler.getLocalMessageList(V);if(z&&0!==X.length&&!Dn(z.type)){for(var Z=[],ee=0;ee0&&this._checkCachedGroupTips()}},{"key":"_checkCachedGroupTips","value":function value(){var V=this;this._cachedGroupTipsMap.forEach((function($,z){var X=V._checkCountMap.get(z),Z=V._groupModule.hasLocalGroup(z);Zt.log("".concat(V._className,"._checkCachedGroupTips groupID:").concat(z," hasLocalGroup:").concat(Z," checkCount:").concat(X)),Z?(V._notifyCachedGroupTips(z),V._checkCountMap.delete(z),V._groupModule.deleteUnjoinedAVChatRoom(z)):X>=V.MAX_CHECK_COUNT?(V._deleteCachedGroupTips(z),V._checkCountMap.delete(z)):(X++,V._checkCountMap.set(z,X))}))}},{"key":"onNewGroupTips","value":function value($){Zt.debug("".concat(this._className,".onReceiveGroupTips count:").concat($.dataList.length));var z=this.newGroupTipsStoredAndSummary($),X=z.eventDataList,Z=z.result,ee=z.AVChatRoomMessageList;ee.length>0&&this._groupModule.onAVChatRoomMessage(ee),X.length>0&&(this._groupModule.getModule(tr).onNewMessage({"conversationOptionsList":X,"isInstantMessage":!0}),this._groupModule.updateNextMessageSeq(X)),Z.length>0&&(this._groupModule.emitOuterEvent(V.MESSAGE_RECEIVED,Z),this.handleMessageList(Z))}},{"key":"newGroupTipsStoredAndSummary","value":function value(V){for(var z=V.event,X=V.dataList,Z=null,ee=[],ae=[],ie={},ce=[],le=0,de=X.length;le0&&this._checkCachedGroupMessage()}},{"key":"_checkCachedGroupMessage","value":function value(){var V=this;this._cachedGroupMessageMap.forEach((function($,z){var X=V._checkCountMap.get(z),Z=V._groupModule.hasLocalGroup(z);Zt.log("".concat(V._className,"._checkCachedGroupMessage groupID:").concat(z," hasLocalGroup:").concat(Z," checkCount:").concat(X)),Z?(V._notifyCachedGroupMessage(z),V._checkCountMap.delete(z),V._groupModule.deleteUnjoinedAVChatRoom(z)):X>=V.MAX_CHECK_COUNT?(V._deleteCachedGroupMessage(z),V._checkCountMap.delete(z)):(X++,V._checkCountMap.set(z,X))}))}},{"key":"_initGroupList","value":function value(){var V=this;Zt.log("".concat(this._className,"._initGroupList"));var $=new ca("getGroupListInStorage"),z=this._groupModule.getStorageGroupList();if(sn(z)&&z.length>0){z.forEach((function($){V._groupModule.initGroupMap($)})),this._groupModule.emitGroupListUpdate(!0,!1);var X=this._groupModule.getLocalGroupList().length;$.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:".concat(X)).end()}else $.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:0").end();Zt.log("".concat(this._className,"._initGroupList ok")),this.getGroupList()}},{"key":"handleUpdateGroupLastMessage","value":function value(V){var z="".concat(this._className,".handleUpdateGroupLastMessage");if(Zt.debug("".concat(z," conversation count:").concat(V.length,", local group count:").concat(this._groupModule.getLocalGroupList().length)),0!==this._groupModule.getGroupMap().size){for(var X,Z,ee,ae=!1,ie=0,ce=V.length;ie0&&this._groupModule.onAVChatRoomMessage(ee),this._groupModule.filterModifiedMessage(Z),X.length>0&&(this._groupModule.getModule(tr).onNewMessage({"conversationOptionsList":X,"isInstantMessage":!0}),this._groupModule.updateNextMessageSeq(X));var ae=this._groupModule.filterUnmodifiedMessage(Z);ae.length>0&&this._groupModule.emitOuterEvent(V.MESSAGE_RECEIVED,ae),Z.length=0}},{"key":"_newGroupMessageStoredAndSummary","value":function value(V){var z=V.dataList,X=V.event,Z=V.isInstantMessage,ee=null,ae=[],ie=[],ce=[],le={},de=$.CONV_GROUP,pe=this._groupModule.getModule(ir),fe=z.length;fe>1&&z.sort((function(V,$){return V.sequence-$.sequence}));for(var ye=0;yepe);return ie.setNetworkType($._groupModule.getNetworkType()).setMessage("offset:".concat(Z," totalCount:").concat(de," isCompleted:").concat(fe," currentCount:").concat(ae.length)).end(),fe?(Zt.log("".concat(z," ok. totalCount:").concat(de)),Ni({"groupList":ae})):(Z=pe,$._pagingGetGroupList({"limit":X,"offset":Z,"groupBaseInfoFilter":ee,"groupList":ae}))})).catch((function(V){return $._groupModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ie.setError(V,X,Z).end()})),as(V)}))}},{"key":"_cacheGroupMessage","value":function value(V,$){this._cachedGroupMessageMap.has(V)||this._cachedGroupMessageMap.set(V,[]),this._cachedGroupMessageMap.get(V).push($)}},{"key":"_deleteCachedGroupMessage","value":function value(V){this._cachedGroupMessageMap.has(V)&&this._cachedGroupMessageMap.delete(V)}},{"key":"_notifyCachedGroupMessage","value":function value(V){var $=this,z=this._cachedGroupMessageMap.get(V)||[];z.forEach((function(V){$.onNewGroupMessage(V)})),this._deleteCachedGroupMessage(V),Zt.log("".concat(this._className,"._notifyCachedGroupMessage groupID:").concat(V," count:").concat(z.length))}},{"key":"_cacheGroupMessageAndProbe","value":function value(V){var z=this,X=V.groupID,Z=V.event,ee=V.item;this._cacheGroupMessage(X,{"event":Z,"dataList":[ee]}),this._groupModule.getGroupSimplifiedInfo(X).then((function(V){V.type===$.GRP_AVCHATROOM?z._groupModule.hasLocalGroup(X)?z._notifyCachedGroupMessage(X):z._groupModule.setUnjoinedAVChatRoom(X):(z._groupModule.updateGroupMap([V]),z._notifyCachedGroupMessage(X))})),this._checkCountMap.has(X)||this._checkCountMap.set(X,0),Zt.log("".concat(this._className,"._cacheGroupMessageAndProbe groupID:").concat(X))}},{"key":"reset","value":function value(){this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._groupModule.getInnerEmitterInstance().once(us,this._initGroupList,this)}}]),e}(),Ts={"1":"init","2":"modify","3":"clear","4":"delete"},Is=function(){function e(V){o(this,e),this._groupModule=V,this._className="GroupAttributesHandler",this._groupAttributesMap=new Map,this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(cs,this._onCloudConfigUpdated,this)}return s(e,[{"key":"_onCloudConfigUpdated","value":function value(){var V=this._groupModule.getCloudConfig("grp_attr_cache_time");un(V)||(this.CACHE_EXPIRE_TIME=Number(V))}},{"key":"updateLocalMainSequenceOnReconnected","value":function value(){this._groupAttributesMap.forEach((function(V){V.localMainSequence=0}))}},{"key":"onGroupAttributesUpdated","value":function value(V){var $=this,z=V.groupID,X=V.groupAttributeOption,Z=X.mainSequence,ee=X.hasChangedAttributeInfo,ae=X.groupAttributeList,ie=void 0===ae?[]:ae,ce=X.operationType;if(Zt.log("".concat(this._className,".onGroupAttributesUpdated. hasChangedAttributeInfo:").concat(ee," operationType:").concat(ce)),1===ee){if(4===ce){var le=[];ie.forEach((function(V){le.push(V.key)})),ie=M(le),le=null}return this._refreshCachedGroupAttributes({"groupID":z,"remoteMainSequence":Z,"groupAttributeList":ie,"operationType":Ts[ce]}),void this._emitGroupAttributesUpdated(z)}if(this._groupAttributesMap.has(z)){var de=this._groupAttributesMap.get(z).avChatRoomKey;this._getGroupAttributes({"groupID":z,"avChatRoomKey":de}).then((function(){$._emitGroupAttributesUpdated(z)}))}}},{"key":"initGroupAttributesCache","value":function value(V){var $=V.groupID,z=V.avChatRoomKey;this._groupAttributesMap.set($,{"lastUpdateTime":0,"localMainSequence":0,"remoteMainSequence":0,"attributes":new Map,"avChatRoomKey":z}),Zt.log("".concat(this._className,".initGroupAttributesCache groupID:").concat($," avChatRoomKey:").concat(z))}},{"key":"initGroupAttributes","value":function value(V){var $=this,z=V.groupID,X=V.groupAttributes,Z=this._checkCachedGroupAttributes({"groupID":z,"funcName":"initGroupAttributes"});if(!0!==Z)return as(Z);var ee=this._groupAttributesMap.get(z),ae=ee.remoteMainSequence,ie=ee.avChatRoomKey,ce=new ca("initGroupAttributes");return ce.setMessage("groupID:".concat(z," mainSequence:").concat(ae," groupAttributes:").concat(JSON.stringify(X))),this._groupModule.request({"protocolName":lo,"requestData":{"groupID":z,"avChatRoomKey":ie,"mainSequence":ae,"groupAttributeList":this._transformGroupAttributes(X)}}).then((function(V){var Z=V.data,ee=Z.mainSequence,ae=M(Z.groupAttributeList);return ae.forEach((function(V){V.value=X[V.key]})),$._refreshCachedGroupAttributes({"groupID":z,"remoteMainSequence":ee,"groupAttributeList":ae,"operationType":"init"}),ce.setNetworkType($._groupModule.getNetworkType()).end(),Zt.log("".concat($._className,".initGroupAttributes ok. groupID:").concat(z)),Ni({"groupAttributes":X})})).catch((function(V){return $._groupModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ce.setError(V,X,Z).end()})),as(V)}))}},{"key":"setGroupAttributes","value":function value(V){var $=this,z=V.groupID,X=V.groupAttributes,Z=this._checkCachedGroupAttributes({"groupID":z,"funcName":"setGroupAttributes"});if(!0!==Z)return as(Z);var ee=this._groupAttributesMap.get(z),ae=ee.remoteMainSequence,ie=ee.avChatRoomKey,ce=ee.attributes,le=this._transformGroupAttributes(X);le.forEach((function(V){var $=V.key;V.sequence=0,ce.has($)&&(V.sequence=ce.get($).sequence)}));var de=new ca("setGroupAttributes");return de.setMessage("groupID:".concat(z," mainSequence:").concat(ae," groupAttributes:").concat(JSON.stringify(X))),this._groupModule.request({"protocolName":po,"requestData":{"groupID":z,"avChatRoomKey":ie,"mainSequence":ae,"groupAttributeList":le}}).then((function(V){var Z=V.data,ee=Z.mainSequence,ae=M(Z.groupAttributeList);return ae.forEach((function(V){V.value=X[V.key]})),$._refreshCachedGroupAttributes({"groupID":z,"remoteMainSequence":ee,"groupAttributeList":ae,"operationType":"modify"}),de.setNetworkType($._groupModule.getNetworkType()).end(),Zt.log("".concat($._className,".setGroupAttributes ok. groupID:").concat(z)),Ni({"groupAttributes":X})})).catch((function(V){return $._groupModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];de.setError(V,X,Z).end()})),as(V)}))}},{"key":"deleteGroupAttributes","value":function value(V){var $=this,z=V.groupID,X=V.keyList,Z=void 0===X?[]:X,ee=this._checkCachedGroupAttributes({"groupID":z,"funcName":"deleteGroupAttributes"});if(!0!==ee)return as(ee);var ae=this._groupAttributesMap.get(z),ie=ae.remoteMainSequence,ce=ae.avChatRoomKey,le=ae.attributes,de=M(le.keys()),pe=ho,fe="clear",ye={"groupID":z,"avChatRoomKey":ce,"mainSequence":ie};if(Z.length>0){var _e=[];de=[],pe=fo,fe="delete",Z.forEach((function(V){var $=0;le.has(V)&&($=le.get(V).sequence,de.push(V)),_e.push({"key":V,"sequence":$})})),ye.groupAttributeList=_e}var Se=new ca("deleteGroupAttributes");return Se.setMessage("groupID:".concat(z," mainSequence:").concat(ie," keyList:").concat(Z," protocolName:").concat(pe)),this._groupModule.request({"protocolName":pe,"requestData":ye}).then((function(V){var X=V.data.mainSequence;return $._refreshCachedGroupAttributes({"groupID":z,"remoteMainSequence":X,"groupAttributeList":Z,"operationType":fe}),Se.setNetworkType($._groupModule.getNetworkType()).end(),Zt.log("".concat($._className,".deleteGroupAttributes ok. groupID:").concat(z)),Ni({"keyList":de})})).catch((function(V){return $._groupModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];Se.setError(V,X,Z).end()})),as(V)}))}},{"key":"getGroupAttributes","value":function value(V){var $=this,z=V.groupID,X=this._checkCachedGroupAttributes({"groupID":z,"funcName":"getGroupAttributes"});if(!0!==X)return as(X);var Z=this._groupAttributesMap.get(z),ee=Z.avChatRoomKey,ae=Z.lastUpdateTime,ie=Z.localMainSequence,ce=Z.remoteMainSequence,le=new ca("getGroupAttributes");if(le.setMessage("groupID:".concat(z," localMainSequence:").concat(ie," remoteMainSequence:").concat(ce," keyList:").concat(V.keyList)),Date.now()-ae>=this.CACHE_EXPIRE_TIME||ie0)X.forEach((function(V){ee.has(V)&&(Z[V]=ee.get(V).value)}));else{var ae,ie=k(ee.keys());try{for(ie.s();!(ae=ie.n()).done;){var ce=ae.value;Z[ce]=ee.get(ce).value}}catch(V){ie.e(V)}finally{ie.f()}}return Z}},{"key":"_refreshCachedGroupAttributes","value":function value(V){var $=V.groupID,z=V.remoteMainSequence,X=V.groupAttributeList,Z=V.operationType;if(this._groupAttributesMap.has($)){var ee=this._groupAttributesMap.get($),ae=ee.localMainSequence;if("get"===Z||z-ae==1)ee.remoteMainSequence=z,ee.localMainSequence=z,ee.lastUpdateTime=Date.now(),this._updateCachedAttributes({"groupAttributes":ee,"groupAttributeList":X,"operationType":Z});else{if(ae===z)return;ee.remoteMainSequence=z}this._groupAttributesMap.set($,ee);var ie="operationType:".concat(Z," localMainSequence:").concat(ae," remoteMainSequence:").concat(z);Zt.log("".concat(this._className,"._refreshCachedGroupAttributes. ").concat(ie))}}},{"key":"_updateCachedAttributes","value":function value(V){var $=V.groupAttributes,z=V.groupAttributeList,X=V.operationType;"clear"!==X?"delete"!==X?("init"===X&&$.attributes.clear(),z.forEach((function(V){var z=V.key,X=V.value,Z=V.sequence;$.attributes.set(z,{"value":X,"sequence":Z})}))):z.forEach((function(V){$.attributes.delete(V)})):$.attributes.clear()}},{"key":"_checkCachedGroupAttributes","value":function value(V){var z=V.groupID,X=V.funcName;if(this._groupModule.hasLocalGroup(z)&&this._groupModule.getLocalGroupProfile(z).type!==$.GRP_AVCHATROOM)return Zt.warn("".concat(this._className,"._checkCachedGroupAttributes. ").concat("非直播群不能使用群属性 API")),new ns({"code":Do.CANNOT_USE_GRP_ATTR_NOT_AVCHATROOM,"message":"非直播群不能使用群属性 API"});var Z=this._groupAttributesMap.get(z);if(un(Z)){var ee="如果 groupID:".concat(z," 是直播群,使用 ").concat(X," 前先使用 joinGroup 接口申请加入群组,详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#joinGroup");return Zt.warn("".concat(this._className,"._checkCachedGroupAttributes. ").concat(ee)),new ns({"code":Do.CANNOT_USE_GRP_ATTR_AVCHATROOM_UNJOIN,"message":ee})}return!0}},{"key":"_transformGroupAttributes","value":function value(V){var $=[];return Object.keys(V).forEach((function(z){$.push({"key":z,"value":V[z]})})),$}},{"key":"_emitGroupAttributesUpdated","value":function value($){var z=this._getLocalGroupAttributes({"groupID":$});this._groupModule.emitOuterEvent(V.GROUP_ATTRIBUTES_UPDATED,{"groupID":$,"groupAttributes":z})}},{"key":"reset","value":function value(){this._groupAttributesMap.clear(),this.CACHE_EXPIRE_TIME=3e4}}]),e}(),ks=function(){function e(V){o(this,e);var $=V.manager,z=V.groupID,X=V.onInit,Z=V.onSuccess,ee=V.onFail;this._className="Polling",this._manager=$,this._groupModule=$._groupModule,this._onInit=X,this._onSuccess=Z,this._onFail=ee,this._groupID=z,this._timeoutID=-1,this._isRunning=!1}return s(e,[{"key":"start","value":function value(){Zt.log("".concat(this._className,".start pollingInterval:").concat(this._manager.getPollingInterval())),this._isRunning=!0,this._request()}},{"key":"isRunning","value":function value(){return this._isRunning}},{"key":"_request","value":function value(){var V=this,$=this._onInit(this._groupID),z=io;this._groupModule.isLoggedIn()||(z=so),this._groupModule.request({"protocolName":z,"requestData":$}).then((function($){V._onSuccess(V._groupID,$),V.isRunning()&&(clearTimeout(V._timeoutID),V._timeoutID=setTimeout(V._request.bind(V),V._manager.getPollingInterval()))})).catch((function($){V._onFail(V._groupID,$),V.isRunning()&&(clearTimeout(V._timeoutID),V._timeoutID=setTimeout(V._request.bind(V),V._manager.MAX_POLLING_INTERVAL))}))}},{"key":"stop","value":function value(){Zt.log("".concat(this._className,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}}]),e}(),Es={"3":!0,"4":!0,"5":!0,"6":!0},Cs=function(){function e(V){o(this,e),this._groupModule=V,this._className="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new gs(100),this.messageIDLinkedList=new gs(100),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL}return s(e,[{"key":"hasJoinedAVChatRoom","value":function value(){return this._joinedGroupMap.size>0}},{"key":"checkJoinedAVChatRoomByID","value":function value(V){return this._joinedGroupMap.has(V)}},{"key":"getJoinedAVChatRoom","value":function value(){return this._joinedGroupMap.size>0?M(this._joinedGroupMap.keys()):null}},{"key":"_updateRequestData","value":function value(V){return t({},this._pollingRequestInfoMap.get(V))}},{"key":"_handleSuccess","value":function value(V,$){var z=$.data,X=z.key,Z=z.nextSeq,ee=z.rspMsgList;if(0!==z.errorCode){var ae=this._pollingRequestInfoMap.get(V),ie=new ca("longPollingAVError"),ce=ae?"".concat(ae.key,"-").concat(ae.startSeq):"requestInfo is undefined";ie.setMessage("".concat(V,"-").concat(ce,"-").concat($.errorInfo)).setCode($.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(V))return;rn(X)&&nn(Z)&&this._pollingRequestInfoMap.set(V,{"key":X,"startSeq":Z}),sn(ee)&&ee.length>0&&(ee.forEach((function(V){V.to=V.groupID})),this.onMessage(ee))}}},{"key":"_handleFailure","value":function value(V,$){}},{"key":"onMessage","value":function value(z){if(sn(z)&&0!==z.length){var X=null,Z=[],ee=this._getModule(tr),ae=z.length;ae>1&&z.sort((function(V,$){return V.sequence-$.sequence}));for(var ie=this._getModule(nr),ce=0;ce1&&fe<=20?this._getModule(pr).onMessageMaybeLost(de,pe+1,fe-1):fe<-1&&fe>=-20&&this._getModule(pr).onMessageMaybeLost(de,X.sequence+1,Math.abs(fe)-1)}this.sequencesLinkedList.set(X.sequence),this.messageIDLinkedList.set(X.ID);var ye=!1;if(this._isMessageSentByCurrentInstance(X)?le&&(ye=!0,X.isModified=le,ee.updateMessageIsModifiedProperty(X)):ye=!0,ye){if(X.conversationType,$.CONV_SYSTEM,X.conversationType!==$.CONV_SYSTEM){var _e=this._getModule(mr),Se=X.conversationID.replace($.CONV_GROUP,"");this._pollingInstanceMap.has(Se)?_e.addMessageSequence({"key":na,"message":X}):(X.type!==$.MSG_GRP_TIP&&_e.addMessageDelay({"currentTime":Date.now(),"time":X.time}),_e.addMessageSequence({"key":ea,"message":X}))}Z.push(X)}}}else Zt.warn("".concat(this._className,".onMessage 未处理的 event 类型: ").concat(z[ce].event));if(0!==Z.length){this._groupModule.filterModifiedMessage(Z);var Te=this.packConversationOption(Z);Te.length>0&&this._getModule(tr).onNewMessage({"conversationOptionsList":Te,"isInstantMessage":!0}),Zt.debug("".concat(this._className,".onMessage count:").concat(Z.length)),this._checkMessageStacked(Z);var He=this._groupModule.filterUnmodifiedMessage(Z);He.length>0&&this._groupModule.emitOuterEvent(V.MESSAGE_RECEIVED,He),Z.length=0}}}},{"key":"_checkMessageStacked","value":function value(V){var $=V.length;$>=100&&(Zt.warn("".concat(this._className,"._checkMessageStacked 直播群消息堆积数:").concat(V.length,'!可能会导致微信小程序渲染时遇到 "Dom limit exceeded" 的错误,建议接入侧此时只渲染最近的10条消息')),this._reportMessageStackedCount<5&&(new ca("messageStacked").setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat($," groupID:").concat(M(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{"key":"_isMessageSentByCurrentInstance","value":function value(V){return!!this._getModule(tr).isMessageSentByCurrentInstance(V)}},{"key":"packMessage","value":function value(V,z){V.currentUser=this._groupModule.getMyUserID(),V.conversationType=5===z?$.CONV_SYSTEM:$.CONV_GROUP,V.isSystemMessage=!!V.isSystemMessage;var X=new Si(V),Z=this.packElements(V,z);return X.setElement(Z),X}},{"key":"packElements","value":function value(V,z){return 4===z||6===z?(this._updateMemberCountByGroupTips(V),this._onGroupAttributesUpdated(V),{"type":$.MSG_GRP_TIP,"content":t(t({},V.elements),{},{"groupProfile":V.groupProfile})}):5===z?{"type":$.MSG_GRP_SYS_NOTICE,"content":t(t({},V.elements),{},{"groupProfile":V.groupProfile})}:this._getModule(ir).parseElements(V.elements,V.from)}},{"key":"packConversationOption","value":function value(V){for(var $=new Map,z=0;z1e3*$.expireTime&&z-$.latestUpdateTime>1e4&&z-$.lastReqTime>3e3?($.lastReqTime=z,this._onlineMemberCountMap.set(V,$),this._getGroupOnlineMemberCount(V).then((function(V){return Ni({"memberCount":V.memberCount})})).catch((function(V){return as(V)}))):os({"memberCount":$.memberCount})}},{"key":"_getGroupOnlineMemberCount","value":function value(V){var $=this,z="".concat(this._className,"._getGroupOnlineMemberCount");return this._groupModule.request({"protocolName":uo,"requestData":{"groupID":V}}).then((function(X){var Z=$._onlineMemberCountMap.get(V)||{},ee=X.data,ae=ee.onlineMemberNum,ie=void 0===ae?0:ae,ce=ee.expireTime,le=void 0===ce?$.DEFAULT_EXPIRE_TIME:ce;Zt.log("".concat(z," ok. groupID:").concat(V," memberCount:").concat(ie," expireTime:").concat(le));var de=Date.now();return vt(Z)&&(Z.lastReqTime=de),$._onlineMemberCountMap.set(V,Object.assign(Z,{"lastSyncTime":de,"latestUpdateTime":de,"memberCount":ie,"expireTime":le})),{"memberCount":ie}})).catch((function(X){return Zt.warn("".concat(z," failed. error:"),X),new ca("getGroupOnlineMemberCount").setCode(X.code).setMessage("groupID:".concat(V," error:").concat(JSON.stringify(X))).setNetworkType($._groupModule.getNetworkType()).end(),Promise.reject(X)}))}},{"key":"_onGroupAttributesUpdated","value":function value(V){var $=V.groupProfile.groupID,z=V.elements,X=z.operationType,Z=z.newGroupProfile;if(6===X){var ee=(void 0===Z?void 0:Z).groupAttributeOption;un(ee)||this._groupModule.onGroupAttributesUpdated({"groupID":$,"groupAttributeOption":ee})}}},{"key":"_getModule","value":function value(V){return this._groupModule.getModule(V)}},{"key":"setPollingInterval","value":function value(V){un(V)||nn(V)||(this._pollingInterval=parseInt(V,10),Zt.log("".concat(this._className,".setPollingInterval value:").concat(this._pollingInterval)))}},{"key":"getPollingInterval","value":function value(){return this._pollingInterval}},{"key":"reset","value":function value(V){if(V){Zt.log("".concat(this._className,".reset groupID:").concat(V));var $=this._pollingInstanceMap.get(V);$&&$.stop(),this._pollingInstanceMap.delete(V),this._joinedGroupMap.delete(V),this._pollingRequestInfoMap.delete(V),this._onlineMemberCountMap.delete(V)}else{Zt.log("".concat(this._className,".reset all"));var z,X=k(this._pollingInstanceMap.values());try{for(X.s();!(z=X.n()).done;)z.value.stop()}catch(V){X.e(V)}finally{X.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL}}]),e}(),ws=function(){function e(V){o(this,e),this._groupModule=V,this._className="GroupSystemNoticeHandler",this.pendencyMap=new Map}return s(e,[{"key":"onNewGroupSystemNotice","value":function value($){var z=$.dataList,X=$.isSyncingEnded,Z=$.isInstantMessage;Zt.debug("".concat(this._className,".onReceiveSystemNotice count:").concat(z.length));var ee=this.newSystemNoticeStoredAndSummary({"notifiesList":z,"isInstantMessage":Z}),ae=ee.eventDataList,ie=ee.result;ae.length>0&&(this._groupModule.getModule(tr).onNewMessage({"conversationOptionsList":ae,"isInstantMessage":Z}),this._onReceivedGroupSystemNotice({"result":ie,"isInstantMessage":Z})),Z?ie.length>0&&this._groupModule.emitOuterEvent(V.MESSAGE_RECEIVED,ie):!0===X&&this._clearGroupSystemNotice()}},{"key":"newSystemNoticeStoredAndSummary","value":function value(V){var z=V.notifiesList,X=V.isInstantMessage,Z=null,ee=z.length,ae=0,ie=[],ce={"conversationID":$.CONV_SYSTEM,"unreadCount":0,"type":$.CONV_SYSTEM,"subType":null,"lastMessage":null};for(ae=0;ae0?[ce]:[],"result":ie}}},{"key":"_clearGroupSystemNotice","value":function value(){var V=this;this.getPendencyList().then((function(z){z.forEach((function($){V.pendencyMap.set("".concat($.from,"_").concat($.groupID,"_").concat($.to),$)}));var X=V._groupModule.getModule(tr).getLocalMessageList($.CONV_SYSTEM),Z=[];X.forEach((function($){var z=$.payload,X=z.operatorID,ee=z.operationType,ae=z.groupProfile;if(1===ee){var ie="".concat(X,"_").concat(ae.groupID,"_").concat(ae.to),ce=V.pendencyMap.get(ie);ce&&nn(ce.handled)&&0!==ce.handled&&Z.push($)}})),V.deleteGroupSystemNotice({"messageList":Z})}))}},{"key":"deleteGroupSystemNotice","value":function value(V){var z=this,X="".concat(this._className,".deleteGroupSystemNotice");return sn(V.messageList)&&0!==V.messageList.length?(Zt.log("".concat(X)+V.messageList.map((function(V){return V.ID}))),this._groupModule.request({"protocolName":ao,"requestData":{"messageListToDelete":V.messageList.map((function(V){return{"from":$.CONV_SYSTEM,"messageSeq":V.clientSequence,"messageRandom":V.random}}))}}).then((function(){Zt.log("".concat(X," ok"));var $=z._groupModule.getModule(tr);return V.messageList.forEach((function(V){$.deleteLocalMessage(V)})),Ni()})).catch((function(V){return Zt.error("".concat(X," error:"),V),as(V)}))):os()}},{"key":"getPendencyList","value":function value(V){var $=this;return this._groupModule.request({"protocolName":oo,"requestData":{"startTime":V&&V.startTime?V.startTime:0,"limit":V&&V.limit?V.limit:10,"handleAccount":this._groupModule.getMyUserID()}}).then((function(V){var z=V.data.pendencyList;return 0!==V.data.nextStartTime?$.getPendencyList({"startTime":V.data.nextStartTime}).then((function(V){return[].concat(M(z),M(V))})):z}))}},{"key":"_onReceivedGroupSystemNotice","value":function value(V){var $=this,z=V.result;V.isInstantMessage&&z.forEach((function(V){switch(V.payload.operationType){case 1:case 3:case 6:break;case 2:$._onApplyGroupRequestAgreed(V);break;case 4:$._onMemberKicked(V);break;case 5:$._onGroupDismissed(V);break;case 7:$._onInviteGroup(V);break;case 8:$._onQuitGroup(V);break;case 9:$._onSetManager(V);break;case 10:$._onDeleteManager(V)}}))}},{"key":"_onApplyGroupRequestAgreed","value":function value(V){var $=this,z=V.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(z)||this._groupModule.getGroupProfile({"groupID":z}).then((function(V){var z=V.data.group;z&&($._groupModule.updateGroupMap([z]),$._groupModule.emitGroupListUpdate())}))}},{"key":"_onMemberKicked","value":function value(V){var $=V.payload.groupProfile.groupID;this._groupModule.hasLocalGroup($)&&this._groupModule.deleteLocalGroupAndConversation($)}},{"key":"_onGroupDismissed","value":function value(V){var $=V.payload.groupProfile.groupID;this._groupModule.hasLocalGroup($)&&this._groupModule.deleteLocalGroupAndConversation($);var z=this._groupModule._AVChatRoomHandler;z&&z.checkJoinedAVChatRoomByID($)&&z.reset($)}},{"key":"_onInviteGroup","value":function value(V){var $=this,z=V.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(z)||this._groupModule.getGroupProfile({"groupID":z}).then((function(V){var z=V.data.group;z&&($._groupModule.updateGroupMap([z]),$._groupModule.emitGroupListUpdate())}))}},{"key":"_onQuitGroup","value":function value(V){var $=V.payload.groupProfile.groupID;this._groupModule.hasLocalGroup($)&&this._groupModule.deleteLocalGroupAndConversation($)}},{"key":"_onSetManager","value":function value(V){var z=V.payload.groupProfile,X=z.to,Z=z.groupID,ee=this._groupModule.getModule(er).getLocalGroupMemberInfo(Z,X);ee&&ee.updateRole($.GRP_MBR_ROLE_ADMIN)}},{"key":"_onDeleteManager","value":function value(V){var z=V.payload.groupProfile,X=z.to,Z=z.groupID,ee=this._groupModule.getModule(er).getLocalGroupMemberInfo(Z,X);ee&&ee.updateRole($.GRP_MBR_ROLE_MEMBER)}},{"key":"reset","value":function value(){this.pendencyMap.clear()}}]),e}(),Ds=function(z){i(a,z);var X=f(a);function a(V){var $;return o(this,a),($=X.call(this,V))._className="GroupModule",$._commonGroupHandler=null,$._AVChatRoomHandler=null,$._groupSystemNoticeHandler=null,$._commonGroupHandler=new Ss(h($)),$._groupAttributesHandler=new Is(h($)),$._AVChatRoomHandler=new Cs(h($)),$._groupTipsHandler=new Ms(h($)),$._groupSystemNoticeHandler=new ws(h($)),$.groupMap=new Map,$._unjoinedAVChatRoomList=new Map,$.getInnerEmitterInstance().on(cs,$._onCloudConfigUpdated,h($)),$}return s(a,[{"key":"_onCloudConfigUpdated","value":function value(){var V=this.getCloudConfig("polling_interval");this._AVChatRoomHandler&&this._AVChatRoomHandler.setPollingInterval(V)}},{"key":"onCheckTimer","value":function value(V){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(V),this._groupTipsHandler.onCheckTimer(V))}},{"key":"guardForAVChatRoom","value":function value(V){var z=this;if(V.conversationType===$.CONV_GROUP){var X=V.to;return this.hasLocalGroup(X)?os():this.getGroupProfile({"groupID":X}).then((function(Z){var ee=Z.data.group.type;if(Zt.log("".concat(z._className,".guardForAVChatRoom. groupID:").concat(X," type:").concat(ee)),ee===$.GRP_AVCHATROOM){var ae="userId:".concat(V.from," 未加入群 groupID:").concat(X,"。发消息前先使用 joinGroup 接口申请加群,详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#joinGroup");return Zt.warn("".concat(z._className,".guardForAVChatRoom sendMessage not allowed. ").concat(ae)),as(new ns({"code":Do.MESSAGE_SEND_FAIL,"message":ae,"data":{"message":V}}))}return os()}))}return os()}},{"key":"checkJoinedAVChatRoomByID","value":function value(V){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(V)}},{"key":"onNewGroupMessage","value":function value(V){this._commonGroupHandler&&this._commonGroupHandler.onNewGroupMessage(V)}},{"key":"updateNextMessageSeq","value":function value(V){var z=this;sn(V)&&V.forEach((function(V){var X=V.conversationID.replace($.CONV_GROUP,"");z.groupMap.has(X)&&(z.groupMap.get(X).nextMessageSeq=V.lastMessage.sequence+1)}))}},{"key":"onNewGroupTips","value":function value(V){this._groupTipsHandler&&this._groupTipsHandler.onNewGroupTips(V)}},{"key":"onGroupMessageRevoked","value":function value(V){this._commonGroupHandler&&this._commonGroupHandler.onGroupMessageRevoked(V)}},{"key":"onNewGroupSystemNotice","value":function value(V){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.onNewGroupSystemNotice(V)}},{"key":"onGroupMessageReadNotice","value":function value(V){var z=this;V.dataList.forEach((function(V){var X=V.elements.groupMessageReadNotice;if(!un(X)){var Z=z.getModule(tr);X.forEach((function(V){var X=V.groupID,ee=V.lastMessageSeq;Zt.debug("".concat(z._className,".onGroupMessageReadNotice groupID:").concat(X," lastMessageSeq:").concat(ee));var ae="".concat($.CONV_GROUP).concat(X);Z.updateIsReadAfterReadReport({"conversationID":ae,"lastMessageSeq":ee}),Z.updateUnreadCount(ae)}))}}))}},{"key":"deleteGroupSystemNotice","value":function value(V){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.deleteGroupSystemNotice(V)}},{"key":"initGroupMap","value":function value(V){this.groupMap.set(V.groupID,new vs(V))}},{"key":"deleteGroup","value":function value(V){this.groupMap.delete(V)}},{"key":"updateGroupMap","value":function value(V){var $=this;V.forEach((function(V){$.groupMap.has(V.groupID)?$.groupMap.get(V.groupID).updateGroup(V):$.groupMap.set(V.groupID,new vs(V))})),this._setStorageGroupList()}},{"key":"getStorageGroupList","value":function value(){return this.getModule(rr).getItem("groupMap")}},{"key":"_setStorageGroupList","value":function value(){var V=this.getLocalGroupList().filter((function(V){var $=V.type;return!En($)})).slice(0,20).map((function(V){return{"groupID":V.groupID,"name":V.name,"avatar":V.avatar,"type":V.type}}));this.getModule(rr).setItem("groupMap",V)}},{"key":"getGroupMap","value":function value(){return this.groupMap}},{"key":"getLocalGroupList","value":function value(){return M(this.groupMap.values())}},{"key":"getLocalGroupProfile","value":function value(V){return this.groupMap.get(V)}},{"key":"sortLocalGroupList","value":function value(){var V=M(this.groupMap).filter((function(V){var $=m(V,2);return $[0],!vt($[1].lastMessage)}));V.sort((function(V,$){return $[1].lastMessage.lastTime-V[1].lastMessage.lastTime})),this.groupMap=new Map(M(V))}},{"key":"updateGroupLastMessage","value":function value(V){this._commonGroupHandler&&this._commonGroupHandler.handleUpdateGroupLastMessage(V)}},{"key":"emitGroupListUpdate","value":function value(){var $=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],z=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],X=this.getLocalGroupList();if($&&this.emitOuterEvent(V.GROUP_LIST_UPDATED,X),z){var Z=JSON.parse(JSON.stringify(X));this.getModule(tr).updateConversationGroupProfile(Z)}}},{"key":"getMyNameCardByGroupID","value":function value(V){var $=this.getLocalGroupProfile(V);return $?$.selfInfo.nameCard:""}},{"key":"getGroupList","value":function value(V){return this._commonGroupHandler?this._commonGroupHandler.getGroupList(V):os()}},{"key":"getGroupProfile","value":function value(V){var $=this,z=new ca("getGroupProfile"),X="".concat(this._className,".getGroupProfile"),Z=V.groupID,ee=V.groupCustomFieldFilter;Zt.log("".concat(X," groupID:").concat(Z));var ae={"groupIDList":[Z],"responseFilter":{"groupBaseInfoFilter":["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],"groupCustomFieldFilter":ee}};return this.getGroupProfileAdvance(ae).then((function(V){var ee,ae=V.data,ie=ae.successGroupList,ce=ae.failureGroupList;return Zt.log("".concat(X," ok")),ce.length>0?as(ce[0]):(En(ie[0].type)&&!$.hasLocalGroup(Z)?ee=new vs(ie[0]):($.updateGroupMap(ie),ee=$.getLocalGroupProfile(Z)),z.setNetworkType($.getNetworkType()).setMessage("groupID:".concat(Z," type:").concat(ee.type," muteAllMembers:").concat(ee.muteAllMembers," ownerID:").concat(ee.ownerID)).end(),ee&&ee.selfInfo&&!ee.selfInfo.nameCard?$.updateSelfInfo(ee).then((function(V){return Ni({"group":V})})):Ni({"group":ee}))})).catch((function(Z){return $.probeNetwork().then((function($){var X=m($,2),ee=X[0],ae=X[1];z.setError(Z,ee,ae).setMessage("groupID:".concat(V.groupID)).end()})),Zt.error("".concat(X," failed. error:"),Z),as(Z)}))}},{"key":"getGroupProfileAdvance","value":function value(V){var $="".concat(this._className,".getGroupProfileAdvance");return sn(V.groupIDList)&&V.groupIDList.length>50&&(Zt.warn("".concat($," 获取群资料的数量不能超过50个")),V.groupIDList.length=50),Zt.log("".concat($," groupIDList:").concat(V.groupIDList)),this.request({"protocolName":jr,"requestData":V}).then((function(V){Zt.log("".concat($," ok"));var z=V.data.groups,X=z.filter((function(V){return un(V.errorCode)||0===V.errorCode})),Z=z.filter((function(V){return V.errorCode&&0!==V.errorCode})).map((function(V){return new ns({"code":V.errorCode,"message":V.errorInfo,"data":{"groupID":V.groupID}})}));return Ni({"successGroupList":X,"failureGroupList":Z})})).catch((function(V){return Zt.error("".concat($," failed. error:"),V),as(V)}))}},{"key":"updateSelfInfo","value":function value(V){var $="".concat(this._className,".updateSelfInfo"),z=V.groupID;return Zt.log("".concat($," groupID:").concat(z)),this.getModule(er).getGroupMemberProfile({"groupID":z,"userIDList":[this.getMyUserID()]}).then((function(z){var X=z.data.memberList;return Zt.log("".concat($," ok")),V&&0!==X.length&&V.updateSelfInfo(X[0]),V}))}},{"key":"createGroup","value":function value(V){var z=this,X="".concat(this._className,".createGroup");if(!["Public","Private","ChatRoom","AVChatRoom"].includes(V.type)){var Z=new ns({"code":Do.ILLEGAL_GROUP_TYPE,"message":"非法的群类型,请检查传入参数"});return as(Z)}En(V.type)&&!un(V.memberList)&&V.memberList.length>0&&(Zt.warn("".concat(X," 创建 AVChatRoom 时不能添加群成员,自动忽略该字段")),V.memberList=void 0),kn(V.type)||un(V.joinOption)||(Zt.warn("".concat(X," 创建 Work/Meeting/AVChatRoom 群时不能设置字段 joinOption,自动忽略该字段")),V.joinOption=void 0);var ee=new ca("createGroup");Zt.log("".concat(X," options:"),V);var ae=[];return this.request({"protocolName":Hr,"requestData":t(t({},V),{},{"ownerID":this.getMyUserID(),"webPushFlag":1})}).then((function(Z){var ie=Z.data,ce=ie.groupID,le=ie.overLimitUserIDList,de=void 0===le?[]:le;if(ae=de,ee.setNetworkType(z.getNetworkType()).setMessage("groupType:".concat(V.type," groupID:").concat(ce," overLimitUserIDList=").concat(de)).end(),Zt.log("".concat(X," ok groupID:").concat(ce," overLimitUserIDList:"),de),V.type===$.GRP_AVCHATROOM)return z.getGroupProfile({"groupID":ce});vt(V.memberList)||vt(de)||(V.memberList=V.memberList.filter((function(V){return-1===de.indexOf(V.userID)}))),z.updateGroupMap([t(t({},V),{},{"groupID":ce})]);var pe=z.getModule(Wn),fe=pe.createCustomMessage({"to":ce,"conversationType":$.CONV_GROUP,"payload":{"data":"group_create","extension":"".concat(z.getMyUserID(),"创建群组")}});return pe.sendMessageInstance(fe),z.emitGroupListUpdate(),z.getGroupProfile({"groupID":ce})})).then((function(V){var z=V.data.group,X=z.selfInfo,Z=X.nameCard,ee=X.joinTime;return z.updateSelfInfo({"nameCard":Z,"joinTime":ee,"messageRemindType":$.MSG_REMIND_ACPT_AND_NOTE,"role":$.GRP_MBR_ROLE_OWNER}),Ni({"group":z,"overLimitUserIDList":ae})})).catch((function($){return ee.setMessage("groupType:".concat(V.type)),z.probeNetwork().then((function(V){var z=m(V,2),X=z[0],Z=z[1];ee.setError($,X,Z).end()})),Zt.error("".concat(X," failed. error:"),$),as($)}))}},{"key":"dismissGroup","value":function value(V){var z=this,X="".concat(this._className,".dismissGroup");if(this.hasLocalGroup(V)&&this.getLocalGroupProfile(V).type===$.GRP_WORK)return as(new ns({"code":Do.CANNOT_DISMISS_WORK,"message":"不能解散 Work 类型的群组"}));var Z=new ca("dismissGroup");return Z.setMessage("groupID:".concat(V)),Zt.log("".concat(X," groupID:").concat(V)),this.request({"protocolName":Kr,"requestData":{"groupID":V}}).then((function(){return Z.setNetworkType(z.getNetworkType()).end(),Zt.log("".concat(X," ok")),z.deleteLocalGroupAndConversation(V),z.checkJoinedAVChatRoomByID(V)&&z._AVChatRoomHandler.reset(V),Ni({"groupID":V})})).catch((function(V){return z.probeNetwork().then((function($){var z=m($,2),X=z[0],ee=z[1];Z.setError(V,X,ee).end()})),Zt.error("".concat(X," failed. error:"),V),as(V)}))}},{"key":"updateGroupProfile","value":function value(V){var $=this,z="".concat(this._className,".updateGroupProfile");!this.hasLocalGroup(V.groupID)||kn(this.getLocalGroupProfile(V.groupID).type)||un(V.joinOption)||(Zt.warn("".concat(z," Work/Meeting/AVChatRoom 群不能设置字段 joinOption,自动忽略该字段")),V.joinOption=void 0),un(V.muteAllMembers)||(V.muteAllMembers?V.muteAllMembers="On":V.muteAllMembers="Off");var X=new ca("updateGroupProfile");return X.setMessage(JSON.stringify(V)),Zt.log("".concat(z," groupID:").concat(V.groupID)),this.request({"protocolName":Qr,"requestData":V}).then((function(){return X.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),$.hasLocalGroup(V.groupID)&&($.groupMap.get(V.groupID).updateGroup(V),$._setStorageGroupList()),Ni({"group":$.groupMap.get(V.groupID)})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),Zt.log("".concat(z," failed. error:"),V),as(V)}))}},{"key":"joinGroup","value":function value(V){var z=this,X=V.groupID,Z=V.type,ee="".concat(this._className,".joinGroup");if(Z===$.GRP_WORK){var ae=new ns({"code":Do.CANNOT_JOIN_WORK,"message":"不能加入 Work 类型的群组"});return as(ae)}if(this.deleteUnjoinedAVChatRoom(X),this.hasLocalGroup(X)){if(!this.isLoggedIn())return os({"status":$.JOIN_STATUS_ALREADY_IN_GROUP});var ie=new ca(ma);return this.getGroupProfile({"groupID":X}).then((function(){return ie.setNetworkType(z.getNetworkType()).setMessage("groupID:".concat(X," joinedStatus:").concat($.JOIN_STATUS_ALREADY_IN_GROUP)).end(),os({"status":$.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function($){return ie.setNetworkType(z.getNetworkType()).setMessage("groupID:".concat(X," unjoined")).end(),Zt.warn("".concat(ee," ").concat(X," was unjoined, now join!")),z.groupMap.delete(X),z.applyJoinGroup(V)}))}return Zt.log("".concat(ee," groupID:").concat(X)),this.isLoggedIn()?this.applyJoinGroup(V):this._AVChatRoomHandler.joinWithoutAuth(V)}},{"key":"applyJoinGroup","value":function value(V){var z=this,X="".concat(this._className,".applyJoinGroup"),Z=V.groupID,ee=new ca(ma);return this.request({"protocolName":zr,"requestData":V}).then((function(V){var ae=V.data,ie=ae.joinedStatus,ce=ae.longPollingKey,le=ae.avChatRoomFlag,de=ae.avChatRoomKey,pe="groupID:".concat(Z," joinedStatus:").concat(ie," longPollingKey:").concat(ce," avChatRoomFlag:").concat(le);switch(ee.setNetworkType(z.getNetworkType()).setMessage("".concat(pe)).end(),Zt.log("".concat(X," ok. ").concat(pe)),ie){case Ca:return Ni({"status":Ca});case Ea:return z.getGroupProfile({"groupID":Z}).then((function(V){var X=V.data.group,ee={"status":Ea,"group":X};return 1===le?(z.getModule(tr).setCompleted("".concat($.CONV_GROUP).concat(Z)),z._groupAttributesHandler.initGroupAttributesCache({"groupID":Z,"avChatRoomKey":de}),un(ce)?z._AVChatRoomHandler.handleJoinResult({"group":X}):z._AVChatRoomHandler.startRunLoop({"longPollingKey":ce,"group":X})):(z.emitGroupListUpdate(!0,!1),Ni(ee))}));default:var fe=new ns({"code":Do.JOIN_GROUP_FAIL,"message":"加群失败,请检查传入参数或重试"});return Zt.error("".concat(X," error:"),fe),as(fe)}})).catch((function($){return ee.setMessage("groupID:".concat(V.groupID)),z.probeNetwork().then((function(V){var z=m(V,2),X=z[0],Z=z[1];ee.setError($,X,Z).end()})),Zt.error("".concat(X," error:"),$),as($)}))}},{"key":"quitGroup","value":function value(V){var $=this,z="".concat(this._className,".quitGroup");Zt.log("".concat(z," groupID:").concat(V));var X=this.checkJoinedAVChatRoomByID(V);if(!X&&!this.hasLocalGroup(V)){var Z=new ns({"code":Do.MEMBER_NOT_IN_GROUP,"message":"用户不在该群组内"});return as(Z)}if(X&&!this.isLoggedIn())return Zt.log("".concat(z," anonymously ok. groupID:").concat(V)),this.deleteLocalGroupAndConversation(V),this._AVChatRoomHandler.reset(V),os({"groupID":V});var ee=new ca("quitGroup");return ee.setMessage("groupID:".concat(V)),this.request({"protocolName":Yr,"requestData":{"groupID":V}}).then((function(){return ee.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),X&&$._AVChatRoomHandler.reset(V),$.deleteLocalGroupAndConversation(V),Ni({"groupID":V})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ee.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"searchGroupByID","value":function value(V){var $=this,z="".concat(this._className,".searchGroupByID"),X={"groupIDList":[V]},Z=new ca("searchGroupByID");return Z.setMessage("groupID:".concat(V)),Zt.log("".concat(z," groupID:").concat(V)),this.request({"protocolName":Xr,"requestData":X}).then((function(V){var X=V.data.groupProfile;if(0!==X[0].errorCode)throw new ns({"code":X[0].errorCode,"message":X[0].errorInfo});return Z.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),Ni({"group":new vs(X[0])})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],ee=z[1];Z.setError(V,X,ee).end()})),Zt.warn("".concat(z," failed. error:"),V),as(V)}))}},{"key":"changeGroupOwner","value":function value(V){var z=this,X="".concat(this._className,".changeGroupOwner");if(this.hasLocalGroup(V.groupID)&&this.getLocalGroupProfile(V.groupID).type===$.GRP_AVCHATROOM)return as(new ns({"code":Do.CANNOT_CHANGE_OWNER_IN_AVCHATROOM,"message":"AVChatRoom 类型的群组不能转让群主"}));if(V.newOwnerID===this.getMyUserID())return as(new ns({"code":Do.CANNOT_CHANGE_OWNER_TO_SELF,"message":"不能把群主转让给自己"}));var Z=new ca("changeGroupOwner");return Z.setMessage("groupID:".concat(V.groupID," newOwnerID:").concat(V.newOwnerID)),Zt.log("".concat(X," groupID:").concat(V.groupID)),this.request({"protocolName":Jr,"requestData":V}).then((function(){Z.setNetworkType(z.getNetworkType()).end(),Zt.log("".concat(X," ok"));var $=V.groupID,ee=V.newOwnerID;z.groupMap.get($).ownerID=ee;var ae=z.getModule(er).getLocalGroupMemberList($);if(ae instanceof Map){var ie=ae.get(z.getMyUserID());un(ie)||(ie.updateRole("Member"),z.groupMap.get($).selfInfo.role="Member");var ce=ae.get(ee);un(ce)||ce.updateRole("Owner")}return z.emitGroupListUpdate(!0,!1),Ni({"group":z.groupMap.get($)})})).catch((function(V){return z.probeNetwork().then((function($){var z=m($,2),X=z[0],ee=z[1];Z.setError(V,X,ee).end()})),Zt.error("".concat(X," failed. error:"),V),as(V)}))}},{"key":"handleGroupApplication","value":function value(V){var $=this,z="".concat(this._className,".handleGroupApplication"),X=V.message.payload,Z=X.groupProfile.groupID,ee=X.authentication,ae=X.messageKey,ie=X.operatorID,ce=new ca("handleGroupApplication");return ce.setMessage("groupID:".concat(Z)),Zt.log("".concat(z," groupID:").concat(Z)),this.request({"protocolName":Zr,"requestData":t(t({},V),{},{"applicant":ie,"groupID":Z,"authentication":ee,"messageKey":ae})}).then((function(){return ce.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),$._groupSystemNoticeHandler.deleteGroupSystemNotice({"messageList":[V.message]}),Ni({"group":$.getLocalGroupProfile(Z)})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ce.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error"),V),as(V)}))}},{"key":"handleGroupInvitation","value":function value(V){var $=this,z="".concat(this._className,".handleGroupInvitation"),X=V.message.payload,Z=X.groupProfile.groupID,ee=X.authentication,ae=X.messageKey,ie=X.operatorID,ce=V.handleAction,le=new ca("handleGroupInvitation");return le.setMessage("groupID:".concat(Z," inviter:").concat(ie," handleAction:").concat(ce)),Zt.log("".concat(z," groupID:").concat(Z," inviter:").concat(ie," handleAction:").concat(ce)),this.request({"protocolName":eo,"requestData":t(t({},V),{},{"inviter":ie,"groupID":Z,"authentication":ee,"messageKey":ae})}).then((function(){return le.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),$._groupSystemNoticeHandler.deleteGroupSystemNotice({"messageList":[V.message]}),Ni({"group":$.getLocalGroupProfile(Z)})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];le.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error"),V),as(V)}))}},{"key":"getGroupOnlineMemberCount","value":function value(V){return this._AVChatRoomHandler?this._AVChatRoomHandler.checkJoinedAVChatRoomByID(V)?this._AVChatRoomHandler.getGroupOnlineMemberCount(V):os({"memberCount":0}):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"hasLocalGroup","value":function value(V){return this.groupMap.has(V)}},{"key":"deleteLocalGroupAndConversation","value":function value(V){this._deleteLocalGroup(V),this.getModule(tr).deleteLocalConversation("GROUP".concat(V)),this.emitGroupListUpdate(!0,!1)}},{"key":"_deleteLocalGroup","value":function value(V){this.groupMap.delete(V),this.getModule(er).deleteGroupMemberList(V),this._setStorageGroupList()}},{"key":"sendMessage","value":function value(V,$){var z=this.createGroupMessagePack(V,$);return this.request(z)}},{"key":"createGroupMessagePack","value":function value(V,z){var X=null;z&&z.offlinePushInfo&&(X=z.offlinePushInfo);var Z="";rn(V.cloudCustomData)&&V.cloudCustomData.length>0&&(Z=V.cloudCustomData);var ee=V.getGroupAtInfoList();return{"protocolName":Tr,"tjgID":this.generateTjgID(V),"requestData":{"fromAccount":this.getMyUserID(),"groupID":V.to,"msgBody":V.getElements(),"cloudCustomData":Z,"random":V.random,"priority":V.priority,"clientSequence":V.clientSequence,"groupAtInfo":V.type!==$.MSG_TEXT||vt(ee)?void 0:ee,"onlineOnlyFlag":this.isOnlineMessage(V,z)?1:0,"offlinePushInfo":X?{"pushFlag":!0===X.disablePush?1:0,"title":X.title||"","desc":X.description||"","ext":X.extension||"","apnsInfo":{"badgeMode":!0===X.ignoreIOSBadge?1:0},"androidInfo":{"OPPOChannelID":X.androidOPPOChannelID||""}}:void 0}}}},{"key":"revokeMessage","value":function value(V){return this.request({"protocolName":to,"requestData":{"to":V.to,"msgSeqList":[{"msgSeq":V.sequence}]}})}},{"key":"deleteMessage","value":function value(V){var $=V.to,z=V.keyList;return Zt.log("".concat(this._className,".deleteMessage groupID:").concat($," count:").concat(z.length)),this.request({"protocolName":co,"requestData":{"groupID":$,"deleter":this.getMyUserID(),"keyList":z}})}},{"key":"getRoamingMessage","value":function value(V){var $=this,z="".concat(this._className,".getRoamingMessage"),X=new ca("getGroupRoamingMessages"),Z=0;return this._computeLastSequence(V).then((function(z){return Z=z,Zt.log("".concat($._className,".getRoamingMessage groupID:").concat(V.groupID," lastSequence:").concat(Z)),$.request({"protocolName":ro,"requestData":{"groupID":V.groupID,"count":21,"sequence":Z}})})).then((function(ee){var ae=ee.data,ie=ae.messageList,ce=ae.complete;un(ie)?Zt.log("".concat(z," ok. complete:").concat(ce," but messageList is undefined!")):Zt.log("".concat(z," ok. complete:").concat(ce," count:").concat(ie.length)),X.setNetworkType($.getNetworkType()).setMessage("groupID:".concat(V.groupID," lastSequence:").concat(Z," complete:").concat(ce," count:").concat(ie?ie.length:"undefined")).end();var le="GROUP".concat(V.groupID),de=$.getModule(tr);if(2===ce||vt(ie))return de.setCompleted(le),[];var pe=de.storeRoamingMessage(ie,le);return de.updateIsRead(le),de.patchConversationLastMessage(le),pe})).catch((function(ee){return $.probeNetwork().then((function($){var z=m($,2),ae=z[0],ie=z[1];X.setError(ee,ae,ie).setMessage("groupID:".concat(V.groupID," lastSequence:").concat(Z)).end()})),Zt.warn("".concat(z," failed. error:"),ee),as(ee)}))}},{"key":"setMessageRead","value":function value(V){var $=this,z=V.conversationID,X=V.lastMessageSeq,Z="".concat(this._className,".setMessageRead");Zt.log("".concat(Z," conversationID:").concat(z," lastMessageSeq:").concat(X)),nn(X)||Zt.warn("".concat(Z," 请勿修改 Conversation.lastMessage.lastSequence,否则可能会导致已读上报结果不准确"));var ee=new ca("setGroupMessageRead");return ee.setMessage("".concat(z,"-").concat(X)),this.request({"protocolName":no,"requestData":{"groupID":z.replace("GROUP",""),"messageReadSeq":X}}).then((function(){ee.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(Z," ok."));var V=$.getModule(tr);return V.updateIsReadAfterReadReport({"conversationID":z,"lastMessageSeq":X}),V.updateUnreadCount(z),Ni()})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ee.setError(V,X,Z).end()})),Zt.log("".concat(Z," failed. error:"),V),as(V)}))}},{"key":"_computeLastSequence","value":function value(V){return V.sequence>0?Promise.resolve(V.sequence):this.getGroupLastSequence(V.groupID)}},{"key":"getGroupLastSequence","value":function value(V){var $=this,z="".concat(this._className,".getGroupLastSequence"),X=new ca("getGroupLastSequence"),Z=0,ee="";if(this.hasLocalGroup(V)){var ae=this.getLocalGroupProfile(V),ie=ae.lastMessage;if(ie.lastSequence>0&&!1===ie.onlineOnlyFlag)return Z=ie.lastSequence,ee="got lastSequence:".concat(Z," from local group profile[lastMessage.lastSequence]. groupID:").concat(V),Zt.log("".concat(z," ").concat(ee)),X.setNetworkType(this.getNetworkType()).setMessage("".concat(ee)).end(),Promise.resolve(Z);if(ae.nextMessageSeq>1)return Z=ae.nextMessageSeq-1,ee="got lastSequence:".concat(Z," from local group profile[nextMessageSeq]. groupID:").concat(V),Zt.log("".concat(z," ").concat(ee)),X.setNetworkType(this.getNetworkType()).setMessage("".concat(ee)).end(),Promise.resolve(Z)}var ce="GROUP".concat(V),le=this.getModule(tr).getLocalConversation(ce);if(le&&le.lastMessage.lastSequence&&!1===le.lastMessage.onlineOnlyFlag)return Z=le.lastMessage.lastSequence,ee="got lastSequence:".concat(Z," from local conversation profile[lastMessage.lastSequence]. groupID:").concat(V),Zt.log("".concat(z," ").concat(ee)),X.setNetworkType(this.getNetworkType()).setMessage("".concat(ee)).end(),Promise.resolve(Z);var de={"groupIDList":[V],"responseFilter":{"groupBaseInfoFilter":["NextMsgSeq"]}};return this.getGroupProfileAdvance(de).then((function(ae){var ie=ae.data.successGroupList;return vt(ie)?Zt.log("".concat(z," successGroupList is empty. groupID:").concat(V)):(Z=ie[0].nextMessageSeq-1,ee="got lastSequence:".concat(Z," from getGroupProfileAdvance. groupID:").concat(V),Zt.log("".concat(z," ").concat(ee))),X.setNetworkType($.getNetworkType()).setMessage("".concat(ee)).end(),Z})).catch((function(Z){return $.probeNetwork().then((function($){var z=m($,2),ee=z[0],ae=z[1];X.setError(Z,ee,ae).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(V)).end()})),Zt.warn("".concat(z," failed. error:"),Z),as(Z)}))}},{"key":"isMessageFromAVChatroom","value":function value(V){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(V)}},{"key":"hasJoinedAVChatRoom","value":function value(){return this._AVChatRoomHandler?this._AVChatRoomHandler.hasJoinedAVChatRoom():0}},{"key":"getJoinedAVChatRoom","value":function value(){return this._AVChatRoomHandler?this._AVChatRoomHandler.getJoinedAVChatRoom():[]}},{"key":"isOnlineMessage","value":function value(V,$){return!(!this._canIUseOnlineOnlyFlag(V)||!$||!0!==$.onlineUserOnly)}},{"key":"_canIUseOnlineOnlyFlag","value":function value(V){var z=this.getJoinedAVChatRoom();return!z||!z.includes(V.to)||V.conversationType!==$.CONV_GROUP}},{"key":"deleteLocalGroupMembers","value":function value(V,$){this.getModule(er).deleteLocalGroupMembers(V,$)}},{"key":"onAVChatRoomMessage","value":function value(V){this._AVChatRoomHandler&&this._AVChatRoomHandler.onMessage(V)}},{"key":"getGroupSimplifiedInfo","value":function value(V){var $=this,z=new ca("getGroupSimplifiedInfo"),X={"groupIDList":[V],"responseFilter":{"groupBaseInfoFilter":["Type","Name"]}};return this.getGroupProfileAdvance(X).then((function(X){var Z=X.data.successGroupList;return z.setNetworkType($.getNetworkType()).setMessage("groupID:".concat(V," type:").concat(Z[0].type)).end(),Z[0]})).catch((function(X){$.probeNetwork().then((function($){var Z=m($,2),ee=Z[0],ae=Z[1];z.setError(X,ee,ae).setMessage("groupID:".concat(V)).end()}))}))}},{"key":"setUnjoinedAVChatRoom","value":function value(V){this._unjoinedAVChatRoomList.set(V,1)}},{"key":"deleteUnjoinedAVChatRoom","value":function value(V){this._unjoinedAVChatRoomList.has(V)&&this._unjoinedAVChatRoomList.delete(V)}},{"key":"isUnjoinedAVChatRoom","value":function value(V){return this._unjoinedAVChatRoomList.has(V)}},{"key":"onGroupAttributesUpdated","value":function value(V){this._groupAttributesHandler&&this._groupAttributesHandler.onGroupAttributesUpdated(V)}},{"key":"updateLocalMainSequenceOnReconnected","value":function value(){this._groupAttributesHandler&&this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{"key":"initGroupAttributes","value":function value(V){return this._groupAttributesHandler.initGroupAttributes(V)}},{"key":"setGroupAttributes","value":function value(V){return this._groupAttributesHandler.setGroupAttributes(V)}},{"key":"deleteGroupAttributes","value":function value(V){return this._groupAttributesHandler.deleteGroupAttributes(V)}},{"key":"getGroupAttributes","value":function value(V){return this._groupAttributesHandler.getGroupAttributes(V)}},{"key":"reset","value":function value(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._AVChatRoomHandler&&this._AVChatRoomHandler.reset()}}]),a}(vr),Os=function(){function e(V){o(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this._initMember(V)}return s(e,[{"key":"_initMember","value":function value(V){this.updateMember(V)}},{"key":"updateMember","value":function value(V){var $=[null,void 0,"",0,NaN];V.memberCustomField&&ot(this.memberCustomField,V.memberCustomField),mn(this,V,["memberCustomField"],$)}},{"key":"updateRole","value":function value(V){["Owner","Admin","Member"].indexOf(V)<0||(this.role=V)}},{"key":"updateMuteUntil","value":function value(V){un(V)||(this.muteUntil=Math.floor((Date.now()+1e3*V)/1e3))}},{"key":"updateNameCard","value":function value(V){un(V)||(this.nameCard=V)}},{"key":"updateMemberCustomField","value":function value(V){V&&ot(this.memberCustomField,V)}}]),e}(),Ns=function(V){i(a,V);var z=f(a);function a(V){var $;return o(this,a),($=z.call(this,V))._className="GroupMemberModule",$.groupMemberListMap=new Map,$.getInnerEmitterInstance().on(ls,$._onProfileUpdated,h($)),$}return s(a,[{"key":"_onProfileUpdated","value":function value(V){for(var $=this,z=V.data,X=function o(V){var o=z[V];$.groupMemberListMap.forEach((function(V){V.has(o.userID)&&V.get(o.userID).updateMember({"nick":o.nick,"avatar":o.avatar})}))},Z=0;Z100?100:ae}}).then((function(V){var X=V.data,Z=X.members,ee=X.memberNum;if(!sn(Z)||0===Z.length)return Promise.resolve([]);var ae=$.getModule(Jn);return ae.hasLocalGroup(z)&&(ae.getLocalGroupProfile(z).memberNum=ee),le=$._updateLocalGroupMemberMap(z,Z),$.getModule(Yn).getUserProfile({"userIDList":Z.map((function(V){return V.userID})),"tagList":[ba.NICK,ba.AVATAR]})})).then((function(V){var X=V.data;if(!sn(X)||0===X.length)return os({"memberList":[]});var ee=X.map((function(V){return{"userID":V.userID,"nick":V.nick,"avatar":V.avatar}}));return $._updateLocalGroupMemberMap(z,ee),ce.setNetworkType($.getNetworkType()).setMessage("groupID:".concat(z," offset:").concat(Z," count:").concat(ae)).end(),Zt.log("".concat(ie," ok.")),Ni({"memberList":le})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ce.setError(V,X,Z).end()})),Zt.error("".concat(ie," failed. error:"),V),as(V)}))}},{"key":"getGroupMemberProfile","value":function value(V){var $=this,z="".concat(this._className,".getGroupMemberProfile"),X=new ca("getGroupMemberProfile");X.setMessage(V.userIDList.length>5?"userIDList.length:".concat(V.userIDList.length):"userIDList:".concat(V.userIDList)),Zt.log("".concat(z," groupID:").concat(V.groupID," userIDList:").concat(V.userIDList.join(","))),V.userIDList.length>50&&(V.userIDList=V.userIDList.slice(0,50));var Z=V.groupID,ee=V.userIDList;return this._getGroupMemberProfileAdvance(t(t({},V),{},{"userIDList":ee})).then((function(V){var z=V.data.members;return sn(z)&&0!==z.length?($._updateLocalGroupMemberMap(Z,z),$.getModule(Yn).getUserProfile({"userIDList":z.map((function(V){return V.userID})),"tagList":[ba.NICK,ba.AVATAR]})):os([])})).then((function(V){var z=V.data.map((function(V){return{"userID":V.userID,"nick":V.nick,"avatar":V.avatar}}));$._updateLocalGroupMemberMap(Z,z);var ae=ee.filter((function(V){return $.hasLocalGroupMember(Z,V)})).map((function(V){return $.getLocalGroupMemberInfo(Z,V)}));return X.setNetworkType($.getNetworkType()).end(),Ni({"memberList":ae})}))}},{"key":"addGroupMember","value":function value(V){var $=this,z="".concat(this._className,".addGroupMember"),X=V.groupID,Z=this.getModule(Jn).getLocalGroupProfile(X),ee=Z.type,ae=new ca("addGroupMember");if(ae.setMessage("groupID:".concat(X," groupType:").concat(ee)),En(ee)){var ie=new ns({"code":Do.CANNOT_ADD_MEMBER_IN_AVCHATROOM,"message":Go});return ae.setCode(Do.CANNOT_ADD_MEMBER_IN_AVCHATROOM).setError(Go).setNetworkType(this.getNetworkType()).end(),as(ie)}return V.userIDList=V.userIDList.map((function(V){return{"userID":V}})),Zt.log("".concat(z," groupID:").concat(X)),this.request({"protocolName":_o,"requestData":V}).then((function(X){var ee=X.data.members;Zt.log("".concat(z," ok"));var ie=ee.filter((function(V){return 1===V.result})).map((function(V){return V.userID})),ce=ee.filter((function(V){return 0===V.result})).map((function(V){return V.userID})),le=ee.filter((function(V){return 2===V.result})).map((function(V){return V.userID})),de=ee.filter((function(V){return 4===V.result})).map((function(V){return V.userID})),pe="groupID:".concat(V.groupID,", ")+"successUserIDList:".concat(ie,", ")+"failureUserIDList:".concat(ce,", ")+"existedUserIDList:".concat(le,", ")+"overLimitUserIDList:".concat(de);return ae.setNetworkType($.getNetworkType()).setMoreMessage(pe).end(),0===ie.length?Ni({"successUserIDList":ie,"failureUserIDList":ce,"existedUserIDList":le,"overLimitUserIDList":de}):(Z.memberNum+=ie.length,Ni({"successUserIDList":ie,"failureUserIDList":ce,"existedUserIDList":le,"overLimitUserIDList":de,"group":Z}))})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ae.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"deleteGroupMember","value":function value(V){var $=this,z="".concat(this._className,".deleteGroupMember"),X=V.groupID,Z=V.userIDList,ee=new ca("deleteGroupMember"),ae="groupID:".concat(X," ").concat(Z.length>5?"userIDList.length:".concat(Z.length):"userIDList:".concat(Z));ee.setMessage(ae),Zt.log("".concat(z," groupID:").concat(X," userIDList:"),Z);var ie=this.getModule(Jn).getLocalGroupProfile(X);return En(ie.type)?as(new ns({"code":Do.CANNOT_KICK_MEMBER_IN_AVCHATROOM,"message":"不能在 AVChatRoom 类型的群组踢人"})):this.request({"protocolName":bo,"requestData":V}).then((function(){return ee.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok")),ie.memberNum--,$.deleteLocalGroupMembers(X,Z),Ni({"group":ie,"userIDList":Z})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ee.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"setGroupMemberMuteTime","value":function value(V){var $=this,z=V.groupID,X=V.userID,Z=V.muteTime,ee="".concat(this._className,".setGroupMemberMuteTime");if(X===this.getMyUserID())return as(new ns({"code":Do.CANNOT_MUTE_SELF,"message":"不能将自己禁言,请检查传入参数"}));Zt.log("".concat(ee," groupID:").concat(z," userID:").concat(X));var ae=new ca("setGroupMemberMuteTime");return ae.setMessage("groupID:".concat(z," userID:").concat(X," muteTime:").concat(Z)),this._modifyGroupMemberInfo({"groupID":z,"userID":X,"muteTime":Z}).then((function(V){ae.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(ee," ok"));var X=$.getModule(Jn);return Ni({"group":X.getLocalGroupProfile(z),"member":V})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ae.setError(V,X,Z).end()})),Zt.error("".concat(ee," failed. error:"),V),as(V)}))}},{"key":"setGroupMemberRole","value":function value(V){var z=this,X="".concat(this._className,".setGroupMemberRole"),Z=V.groupID,ee=V.userID,ae=V.role,ie=this.getModule(Jn).getLocalGroupProfile(Z);if(ie.selfInfo.role!==$.GRP_MBR_ROLE_OWNER)return as(new ns({"code":Do.NOT_OWNER,"message":"你不是群主,只有群主才有权限操作"}));if([$.GRP_WORK,$.GRP_AVCHATROOM].includes(ie.type))return as(new ns({"code":Do.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM,"message":"不能在 Work / AVChatRoom 类型的群中设置群成员身份"}));if([$.GRP_MBR_ROLE_ADMIN,$.GRP_MBR_ROLE_MEMBER].indexOf(ae)<0)return as(new ns({"code":Do.INVALID_MEMBER_ROLE,"message":"不合法的群成员身份,请检查传入参数"}));if(ee===this.getMyUserID())return as(new ns({"code":Do.CANNOT_SET_SELF_MEMBER_ROLE,"message":"不能设置自己的群成员身份,请检查传入参数"}));var ce=new ca("setGroupMemberRole");return ce.setMessage("groupID:".concat(Z," userID:").concat(ee," role:").concat(ae)),Zt.log("".concat(X," groupID:").concat(Z," userID:").concat(ee)),this._modifyGroupMemberInfo({"groupID":Z,"userID":ee,"role":ae}).then((function(V){return ce.setNetworkType(z.getNetworkType()).end(),Zt.log("".concat(X," ok")),Ni({"group":ie,"member":V})})).catch((function(V){return z.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ce.setError(V,X,Z).end()})),Zt.error("".concat(X," failed. error:"),V),as(V)}))}},{"key":"setGroupMemberNameCard","value":function value(V){var $=this,z="".concat(this._className,".setGroupMemberNameCard"),X=V.groupID,Z=V.userID,ee=void 0===Z?this.getMyUserID():Z,ae=V.nameCard;Zt.log("".concat(z," groupID:").concat(X," userID:").concat(ee));var ie=new ca("setGroupMemberNameCard");return ie.setMessage("groupID:".concat(X," userID:").concat(ee," nameCard:").concat(ae)),this._modifyGroupMemberInfo({"groupID":X,"userID":ee,"nameCard":ae}).then((function(V){Zt.log("".concat(z," ok")),ie.setNetworkType($.getNetworkType()).end();var Z=$.getModule(Jn).getLocalGroupProfile(X);return ee===$.getMyUserID()&&Z&&Z.setSelfNameCard(ae),Ni({"group":Z,"member":V})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ie.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"setGroupMemberCustomField","value":function value(V){var $=this,z="".concat(this._className,".setGroupMemberCustomField"),X=V.groupID,Z=V.userID,ee=void 0===Z?this.getMyUserID():Z,ae=V.memberCustomField;Zt.log("".concat(z," groupID:").concat(X," userID:").concat(ee));var ie=new ca("setGroupMemberCustomField");return ie.setMessage("groupID:".concat(X," userID:").concat(ee," memberCustomField:").concat(JSON.stringify(ae))),this._modifyGroupMemberInfo({"groupID":X,"userID":ee,"memberCustomField":ae}).then((function(V){ie.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok"));var Z=$.getModule(Jn).getLocalGroupProfile(X);return Ni({"group":Z,"member":V})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ie.setError(V,X,Z).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"setMessageRemindType","value":function value(V){var $=this,z="".concat(this._className,".setMessageRemindType"),X=new ca("setMessageRemindType");X.setMessage("groupID:".concat(V.groupID)),Zt.log("".concat(z," groupID:").concat(V.groupID));var Z=V.groupID,ee=V.messageRemindType;return this._modifyGroupMemberInfo({"groupID":Z,"messageRemindType":ee,"userID":this.getMyUserID()}).then((function(){X.setNetworkType($.getNetworkType()).end(),Zt.log("".concat(z," ok. groupID:").concat(V.groupID));var Z=$.getModule(Jn).getLocalGroupProfile(V.groupID);return Z&&(Z.selfInfo.messageRemindType=ee),Ni({"group":Z})})).catch((function(V){return $.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"_modifyGroupMemberInfo","value":function value(V){var $=this,z=V.groupID,X=V.userID;return this.request({"protocolName":Ao,"requestData":V}).then((function(){if($.hasLocalGroupMember(z,X)){var Z=$.getLocalGroupMemberInfo(z,X);return un(V.muteTime)||Z.updateMuteUntil(V.muteTime),un(V.role)||Z.updateRole(V.role),un(V.nameCard)||Z.updateNameCard(V.nameCard),un(V.memberCustomField)||Z.updateMemberCustomField(V.memberCustomField),Z}return $.getGroupMemberProfile({"groupID":z,"userIDList":[X]}).then((function(V){return m(V.data.memberList,1)[0]}))}))}},{"key":"_getGroupMemberProfileAdvance","value":function value(V){return this.request({"protocolName":yo,"requestData":t(t({},V),{},{"memberInfoFilter":V.memberInfoFilter?V.memberInfoFilter:["Role","JoinTime","NameCard","ShutUpUntil"]})})}},{"key":"_updateLocalGroupMemberMap","value":function value(V,$){var z=this;return sn($)&&0!==$.length?$.map((function($){return z.hasLocalGroupMember(V,$.userID)?z.getLocalGroupMemberInfo(V,$.userID).updateMember($):z.setLocalGroupMember(V,new Os($)),z.getLocalGroupMemberInfo(V,$.userID)})):[]}},{"key":"deleteLocalGroupMembers","value":function value(V,$){var z=this.groupMemberListMap.get(V);z&&$.forEach((function(V){z.delete(V)}))}},{"key":"getLocalGroupMemberInfo","value":function value(V,$){return this.groupMemberListMap.has(V)?this.groupMemberListMap.get(V).get($):null}},{"key":"setLocalGroupMember","value":function value(V,$){if(this.groupMemberListMap.has(V))this.groupMemberListMap.get(V).set($.userID,$);else{var z=(new Map).set($.userID,$);this.groupMemberListMap.set(V,z)}}},{"key":"getLocalGroupMemberList","value":function value(V){return this.groupMemberListMap.get(V)}},{"key":"hasLocalGroupMember","value":function value(V,$){return this.groupMemberListMap.has(V)&&this.groupMemberListMap.get(V).has($)}},{"key":"hasLocalGroupMemberMap","value":function value(V){return this.groupMemberListMap.has(V)}},{"key":"reset","value":function value(){this.groupMemberListMap.clear()}}]),a}(vr),Ps=function(){function e(V){o(this,e),this._userModule=V,this._className="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return s(e,[{"key":"setExpirationTime","value":function value(V){this.expirationTime=V}},{"key":"getUserProfile","value":function value(V){var $=this,z=V.userIDList;V.fromAccount=this._userModule.getMyAccount(),z.length>100&&(Zt.warn("".concat(this._className,".getUserProfile 获取用户资料人数不能超过100人")),z.length=100);for(var X,Z=[],ee=[],ae=0,ie=z.length;ae5?"userIDList.length:".concat(z.length):"userIDList:".concat(z)),this._userModule.request({"protocolName":Ir,"requestData":V}).then((function(V){de.setNetworkType($._userModule.getNetworkType()).end(),Zt.info("".concat($._className,".getUserProfile ok"));var z=$._handleResponse(V).concat(ee);return Ni(ce?z[0]:z)})).catch((function(V){return $._userModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];de.setError(V,X,Z).end()})),Zt.error("".concat($._className,".getUserProfile failed. error:"),V),as(V)}))}},{"key":"getMyProfile","value":function value(){var V=this._userModule.getMyAccount();if(Zt.log("".concat(this._className,".getMyProfile myAccount:").concat(V)),this._fillMap(),this._containsAccount(V)){var $=this._getProfileFromMap(V);return Zt.debug("".concat(this._className,".getMyProfile from cache, myProfile:")+JSON.stringify($)),os($)}return this.getUserProfile({"fromAccount":V,"userIDList":[V],"bFromGetMyProfile":!0})}},{"key":"_handleResponse","value":function value(V){for(var $,z,X=gn.now(),Z=V.data.userProfileItem,ee=[],ae=0,ie=Z.length;ae-1)z.profileCustomField.push({"key":$[X].tag,"value":$[X].value});else switch($[X].tag){case ba.NICK:z.nick=$[X].value;break;case ba.GENDER:z.gender=$[X].value;break;case ba.BIRTHDAY:z.birthday=$[X].value;break;case ba.LOCATION:z.location=$[X].value;break;case ba.SELFSIGNATURE:z.selfSignature=$[X].value;break;case ba.ALLOWTYPE:z.allowType=$[X].value;break;case ba.LANGUAGE:z.language=$[X].value;break;case ba.AVATAR:z.avatar=$[X].value;break;case ba.MESSAGESETTINGS:z.messageSettings=$[X].value;break;case ba.ADMINFORBIDTYPE:z.adminForbidType=$[X].value;break;case ba.LEVEL:z.level=$[X].value;break;case ba.ROLE:z.role=$[X].value;break;default:Zt.warn("".concat(this._className,"._handleResponse unknown tag:"),$[X].tag,$[X].value)}return z}},{"key":"updateMyProfile","value":function value($){var z=this,X="".concat(this._className,".updateMyProfile"),Z=new ca("updateMyProfile");Z.setMessage(JSON.stringify($));var ee=(new fs).validate($);if(!ee.valid)return Z.setCode(Do.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("".concat(X," info:").concat(ee.tips)).setNetworkType(this._userModule.getNetworkType()).end(),Zt.error("".concat(X," info:").concat(ee.tips,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#updateMyProfile")),as({"code":Do.UPDATE_PROFILE_INVALID_PARAM,"message":"传入 updateMyProfile 接口的参数无效"});var ae=[];for(var ie in $)Object.prototype.hasOwnProperty.call($,ie)&&("profileCustomField"===ie?$.profileCustomField.forEach((function(V){ae.push({"tag":V.key,"value":V.value})})):ae.push({"tag":ba[ie.toUpperCase()],"value":$[ie]}));return 0===ae.length?(Z.setCode(Do.UPDATE_PROFILE_NO_KEY).setMoreMessage(xo).setNetworkType(this._userModule.getNetworkType()).end(),Zt.error("".concat(X," info:").concat(xo,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#updateMyProfile")),as({"code":Do.UPDATE_PROFILE_NO_KEY,"message":xo})):this._userModule.request({"protocolName":kr,"requestData":{"fromAccount":this._userModule.getMyAccount(),"profileItem":ae}}).then((function(ee){Z.setNetworkType(z._userModule.getNetworkType()).end(),Zt.info("".concat(X," ok"));var ae=z._updateMap(z._userModule.getMyAccount(),$);return z._userModule.emitOuterEvent(V.PROFILE_UPDATED,[ae]),os(ae)})).catch((function(V){return z._userModule.probeNetwork().then((function($){var z=m($,2),X=z[0],ee=z[1];Z.setError(V,X,ee).end()})),Zt.error("".concat(X," failed. error:"),V),as(V)}))}},{"key":"onProfileModified","value":function value($){var z=$.dataList;if(!vt(z)){var X,Z,ee=z.length;Zt.debug("".concat(this._className,".onProfileModified count:").concat(ee," dataList:"),$.dataList);for(var ae=[],ie=0;ie0&&(this._userModule.emitInnerEvent(ls,ae),this._userModule.emitOuterEvent(V.PROFILE_UPDATED,ae))}}},{"key":"_fillMap","value":function value(){if(0===this.accountProfileMap.size){for(var V=this._getCachedProfiles(),$=Date.now(),z=0,X=V.length;z0&&Z.push(z)):Z.push($.userID));0!==Z.length&&(Zt.info("".concat(this._className,".onConversationsProfileUpdated toAccountList:").concat(Z)),this.getUserProfile({"userIDList":Z}))}},{"key":"getNickAndAvatarByUserID","value":function value(V){if(this._containsAccount(V)){var $=this._getProfileFromMap(V);return{"nick":$.nick,"avatar":$.avatar}}return{"nick":"","avatar":""}}},{"key":"reset","value":function value(){this._flushMap(!0),this.accountProfileMap.clear()}}]),e}(),Rs=function e(V){o(this,e),vt||(this.userID=V.userID||"",this.timeStamp=V.timeStamp||0)},Ls=function(){function e(V){o(this,e),this._userModule=V,this._className="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return s(e,[{"key":"getLocalBlacklist","value":function value(){return M(this._blacklistMap.keys())}},{"key":"getBlacklist","value":function value(){var $=this,z="".concat(this._className,".getBlacklist"),X={"fromAccount":this._userModule.getMyAccount(),"maxLimited":this.maxLimited,"startIndex":0,"lastSequence":this.currentSequence},Z=new ca("getBlacklist");return this._userModule.request({"protocolName":Er,"requestData":X}).then((function(X){var ee=X.data,ae=ee.blackListItem,ie=ee.currentSequence,ce=vt(ae)?0:ae.length;Z.setNetworkType($._userModule.getNetworkType()).setMessage("blackList count:".concat(ce)).end(),Zt.info("".concat(z," ok")),$.currentSequence=ie,$._handleResponse(ae,!0),$._userModule.emitOuterEvent(V.BLACKLIST_UPDATED,M($._blacklistMap.keys()))})).catch((function(V){return $._userModule.probeNetwork().then((function($){var z=m($,2),X=z[0],ee=z[1];Z.setError(V,X,ee).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))}},{"key":"addBlacklist","value":function value(V){var $=this,z="".concat(this._className,".addBlacklist"),X=new ca("addToBlacklist");if(!sn(V.userIDList))return X.setCode(Do.ADD_BLACKLIST_INVALID_PARAM).setMessage(Fo).setNetworkType(this._userModule.getNetworkType()).end(),Zt.error("".concat(z," options.userIDList 必需是数组")),as({"code":Do.ADD_BLACKLIST_INVALID_PARAM,"message":Fo});var Z=this._userModule.getMyAccount();return 1===V.userIDList.length&&V.userIDList[0]===Z?(X.setCode(Do.CANNOT_ADD_SELF_TO_BLACKLIST).setMessage(Bo).setNetworkType(this._userModule.getNetworkType()).end(),Zt.error("".concat(z," 不能把自己拉黑")),as({"code":Do.CANNOT_ADD_SELF_TO_BLACKLIST,"message":Bo})):(V.userIDList.includes(Z)&&(V.userIDList=V.userIDList.filter((function(V){return V!==Z})),Zt.warn("".concat(z," 不能把自己拉黑,已过滤"))),V.fromAccount=this._userModule.getMyAccount(),V.toAccount=V.userIDList,this._userModule.request({"protocolName":Cr,"requestData":V}).then((function(Z){return X.setNetworkType($._userModule.getNetworkType()).setMessage(V.userIDList.length>5?"userIDList.length:".concat(V.userIDList.length):"userIDList:".concat(V.userIDList)).end(),Zt.info("".concat(z," ok")),$._handleResponse(Z.resultItem,!0),Ni(M($._blacklistMap.keys()))})).catch((function(V){return $._userModule.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)})))}},{"key":"_handleResponse","value":function value(V,$){if(!vt(V))for(var z,X,Z,ee=0,ae=V.length;ee5?"userIDList.length:".concat(V.userIDList.length):"userIDList:".concat(V.userIDList)).end(),Zt.info("".concat(z," ok")),$._handleResponse(Z.data.resultItem,!1),Ni(M($._blacklistMap.keys()))})).catch((function(V){return $._userModule.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),Zt.error("".concat(z," failed. error:"),V),as(V)}))):(X.setCode(Do.DEL_BLACKLIST_INVALID_PARAM).setMessage(Uo).setNetworkType(this._userModule.getNetworkType()).end(),Zt.error("".concat(z," options.userIDList 必需是数组")),as({"code":Do.DEL_BLACKLIST_INVALID_PARAM,"message":Uo}))}},{"key":"onAccountDeleted","value":function value($){for(var z,X=[],Z=0,ee=$.length;Z0&&(Zt.log("".concat(this._className,".onAccountDeleted count:").concat(X.length," userIDList:"),X),this._userModule.emitOuterEvent(V.BLACKLIST_UPDATED,M(this._blacklistMap.keys())))}},{"key":"onAccountAdded","value":function value($){for(var z,X=[],Z=0,ee=$.length;Z0&&(Zt.log("".concat(this._className,".onAccountAdded count:").concat(X.length," userIDList:"),X),this._userModule.emitOuterEvent(V.BLACKLIST_UPDATED,M(this._blacklistMap.keys())))}},{"key":"reset","value":function value(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),Gs=function(V){i(n,V);var $=f(n);function n(V){var z;return o(this,n),(z=$.call(this,V))._className="UserModule",z._profileHandler=new Ps(h(z)),z._blacklistHandler=new Ls(h(z)),z.getInnerEmitterInstance().on(us,z.onContextUpdated,h(z)),z}return s(n,[{"key":"onContextUpdated","value":function value(V){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{"key":"onProfileModified","value":function value(V){this._profileHandler.onProfileModified(V)}},{"key":"onRelationChainModified","value":function value(V){var $=V.dataList;if(!vt($)){var z=[];$.forEach((function(V){V.blackListDelAccount&&z.push.apply(z,M(V.blackListDelAccount))})),z.length>0&&this._blacklistHandler.onAccountDeleted(z);var X=[];$.forEach((function(V){V.blackListAddAccount&&X.push.apply(X,M(V.blackListAddAccount))})),X.length>0&&this._blacklistHandler.onAccountAdded(X)}}},{"key":"onConversationsProfileUpdated","value":function value(V){this._profileHandler.onConversationsProfileUpdated(V)}},{"key":"getMyAccount","value":function value(){return this.getMyUserID()}},{"key":"getMyProfile","value":function value(){return this._profileHandler.getMyProfile()}},{"key":"getStorageModule","value":function value(){return this.getModule(rr)}},{"key":"isMyFriend","value":function value(V){var $=this.getModule(Zn);return!!$&&$.isMyFriend(V)}},{"key":"getUserProfile","value":function value(V){return this._profileHandler.getUserProfile(V)}},{"key":"updateMyProfile","value":function value(V){return this._profileHandler.updateMyProfile(V)}},{"key":"getNickAndAvatarByUserID","value":function value(V){return this._profileHandler.getNickAndAvatarByUserID(V)}},{"key":"getLocalBlacklist","value":function value(){var V=this._blacklistHandler.getLocalBlacklist();return os(V)}},{"key":"addBlacklist","value":function value(V){return this._blacklistHandler.addBlacklist(V)}},{"key":"deleteBlacklist","value":function value(V){return this._blacklistHandler.deleteBlacklist(V)}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset()}}]),n}(vr),xs=function(){function e(V,$){o(this,e),this._moduleManager=V,this._isLoggedIn=!1,this._SDKAppID=$.SDKAppID,this._userID=$.userID||"",this._userSig=$.userSig||"",this._version="2.15.0",this._a2Key="",this._tinyID="",this._contentType="json",this._unlimitedAVChatRoom=$.unlimitedAVChatRoom,this._scene=$.scene||"",this._oversea=$.oversea,this._instanceID=$.instanceID,this._statusInstanceID=0}return s(e,[{"key":"isLoggedIn","value":function value(){return this._isLoggedIn}},{"key":"isOversea","value":function value(){return this._oversea}},{"key":"isUnlimitedAVChatRoom","value":function value(){return this._unlimitedAVChatRoom}},{"key":"getUserID","value":function value(){return this._userID}},{"key":"setUserID","value":function value(V){this._userID=V}},{"key":"setUserSig","value":function value(V){this._userSig=V}},{"key":"getUserSig","value":function value(){return this._userSig}},{"key":"getSDKAppID","value":function value(){return this._SDKAppID}},{"key":"getTinyID","value":function value(){return this._tinyID}},{"key":"setTinyID","value":function value(V){this._tinyID=V,this._isLoggedIn=!0}},{"key":"getScene","value":function value(){return function(){var V=!1,$=[];Mt&&($=Object.keys(Tt)),St&&($=Object.keys(window));for(var z=0,X=$.length;z0&&void 0!==arguments[0]?arguments[0]:0;return this.isLoggedIn()?(new ca("logout").setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0),Zt.info("".concat(this._className,".logout type:").concat($)),this.request({"protocolName":_r,"requestData":{"type":$}}).then((function(){return V.resetReady(),os({})})).catch((function($){return Zt.error("".concat(V._className,"._logout error:"),$),V.resetReady(),os({})}))):as({"code":Do.USER_NOT_LOGGED_IN,"message":"用户未登录"})}},{"key":"_fetchCloudControlConfig","value":function value(){this.getModule(fr).fetchConfig()}},{"key":"_hello","value":function value(){var V=this;this.request({"protocolName":br}).catch((function($){Zt.warn("".concat(V._className,"._hello error:"),$)}))}},{"key":"_checkLoginInfo","value":function value(V){var $=0,z="";return vt(this.getModule(nr).getSDKAppID())?($=Do.NO_SDKAPPID,z="无 SDKAppID"):vt(V.userID)?($=Do.NO_IDENTIFIER,z="无 userID"):vt(V.userSig)&&($=Do.NO_USERSIG,z="无 userSig"),{"code":$,"message":z}}},{"key":"onMultipleAccountKickedOut","value":function value(z){var X=this;new ca(la).setNetworkType(this.getNetworkType()).setMessage("type:".concat($.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(z))).end(!0),Zt.warn("".concat(this._className,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),z),this.logout(1).then((function(){X.emitOuterEvent(V.KICKED_OUT,{"type":$.KICKED_OUT_MULT_ACCOUNT}),X._moduleManager.reset()}))}},{"key":"onMultipleDeviceKickedOut","value":function value(z){var X=this;new ca(la).setNetworkType(this.getNetworkType()).setMessage("type:".concat($.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(z))).end(!0),Zt.warn("".concat(this._className,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),z),this.logout(1).then((function(){X.emitOuterEvent(V.KICKED_OUT,{"type":$.KICKED_OUT_MULT_DEVICE}),X._moduleManager.reset()}))}},{"key":"onUserSigExpired","value":function value(){new ca(la).setNetworkType(this.getNetworkType()).setMessage($.KICKED_OUT_USERSIG_EXPIRED).end(!0),Zt.warn("".concat(this._className,".onUserSigExpired: userSig 签名过期被踢下线")),0!==this.getModule(nr).getStatusInstanceID()&&(this.emitOuterEvent(V.KICKED_OUT,{"type":$.KICKED_OUT_USERSIG_EXPIRED}),this._moduleManager.reset())}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0}}]),n}(vr);function Ei(){return null}var Us=function(){function e(V){o(this,e),this._moduleManager=V,this._className="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return s(e,[{"key":"_errorTolerantHandle","value":function value(){Mt||!un(window)&&!un(window.localStorage)||(this.getItem=Ei,this.setItem=Ei,this.removeItem=Ei,this.clear=Ei)}},{"key":"onCheckTimer","value":function value(V){if(V%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{"key":"_doFlush","value":function value(){try{var V,$=k(this._storageQueue);try{for($.s();!(V=$.n()).done;){var z=m(V.value,2),X=z[0],Z=z[1];this._setStorageSync(this._getKey(X),Z)}}catch(V){$.e(V)}finally{$.f()}this._storageQueue.clear()}catch(V){Zt.warn("".concat(this._className,"._doFlush error:"),V)}}},{"key":"_getPrefix","value":function value(){var V=this._moduleManager.getModule(nr);return"TIM_".concat(V.getSDKAppID(),"_").concat(V.getUserID(),"_")}},{"key":"_getKey","value":function value(V){return"".concat(this._getPrefix()).concat(V)}},{"key":"getItem","value":function value(V){var $=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var z=$?this._getKey(V):V;return this._getStorageSync(z)}catch(V){return Zt.warn("".concat(this._className,".getItem error:"),V),{}}}},{"key":"setItem","value":function value(V,$){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2]){var z=arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?V:this._getKey(V);this._setStorageSync(z,$)}else this._storageQueue.set(V,$)}},{"key":"clear","value":function value(){try{Mt?Tt.clearStorageSync():localStorage&&localStorage.clear()}catch(V){Zt.warn("".concat(this._className,".clear error:"),V)}}},{"key":"removeItem","value":function value(V){var $=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var z=$?this._getKey(V):V;this._removeStorageSync(z)}catch(V){Zt.warn("".concat(this._className,".removeItem error:"),V)}}},{"key":"getSize","value":function value(V){var $=this,z=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"b";try{var X={"size":0,"limitSize":5242880,"unit":z};if(Object.defineProperty(X,"leftSize",{"enumerable":!0,"get":function get(){return X.limitSize-X.size}}),Mt&&(X.limitSize=1024*Tt.getStorageInfoSync().limitSize),V)X.size=JSON.stringify(this.getItem(V)).length+this._getKey(V).length;else if(Mt)Tt.getStorageInfoSync().keys.forEach((function(V){X.size+=JSON.stringify($._getStorageSync(V)).length+$._getKey(V).length}));else if(localStorage)for(var Z in localStorage)localStorage.hasOwnProperty(Z)&&(X.size+=localStorage.getItem(Z).length+Z.length);return this._convertUnit(X)}catch(V){Zt.warn("".concat(this._className," error:"),V)}}},{"key":"_convertUnit","value":function value(V){var $={},z=V.unit;for(var X in $.unit=z,V)"number"==typeof V[X]&&("kb"===z.toLowerCase()?$[X]=Math.round(V[X]/1024):"mb"===z.toLowerCase()?$[X]=Math.round(V[X]/1024/1024):$[X]=V[X]);return $}},{"key":"_setStorageSync","value":function value(V,$){Mt?bt?my.setStorageSync({"key":V,"data":$}):Tt.setStorageSync(V,$):localStorage&&localStorage.setItem(V,JSON.stringify($))}},{"key":"_getStorageSync","value":function value(V){return Mt?bt?my.getStorageSync({"key":V}).data:Tt.getStorageSync(V):localStorage?JSON.parse(localStorage.getItem(V)):{}}},{"key":"_removeStorageSync","value":function value(V){Mt?bt?my.removeStorageSync({"key":V}):Tt.removeStorageSync(V):localStorage&&localStorage.removeItem(V)}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._doFlush()}}]),e}(),Bs=function(){function e(V){o(this,e),this._className="SSOLogBody",this._report=[]}return s(e,[{"key":"pushIn","value":function value(V){Zt.debug("".concat(this._className,".pushIn"),this._report.length,V),this._report.push(V)}},{"key":"backfill","value":function value(V){var $;sn(V)&&0!==V.length&&(Zt.debug("".concat(this._className,".backfill"),this._report.length,V.length),($=this._report).unshift.apply($,M(V)))}},{"key":"getLogsNumInMemory","value":function value(){return this._report.length}},{"key":"isEmpty","value":function value(){return 0===this._report.length}},{"key":"_reset","value":function value(){this._report.length=0,this._report=[]}},{"key":"getLogsInMemory","value":function value(){var V=this._report.slice();return this._reset(),V}}]),e}(),js=function Li(V){var $=V.getModule(nr);return{"SDKType":10,"SDKAppID":$.getSDKAppID(),"SDKVersion":$.getVersion(),"tinyID":Number($.getTinyID()),"userID":$.getUserID(),"platform":V.getPlatform(),"instanceID":$.getInstanceID(),"traceID":Wt()}},qs=function(V){i(a,V);var $=f(a);function a(V){var z;o(this,a),(z=$.call(this,V))._className="EventStatModule",z.TAG="im-ssolog-event",z._reportBody=new Bs,z.MIN_THRESHOLD=20,z.MAX_THRESHOLD=100,z.WAITING_TIME=6e4,z.REPORT_LEVEL=[4,5,6],z.REPORT_SDKAPPID_BLACKLIST=[],z.REPORT_TINYID_WHITELIST=[],z._lastReportTime=Date.now();var X=z.getInnerEmitterInstance();return X.on(us,z._onLoginSuccess,h(z)),X.on(cs,z._onCloudConfigUpdated,h(z)),z}return s(a,[{"key":"reportAtOnce","value":function value(){Zt.debug("".concat(this._className,".reportAtOnce")),this._report()}},{"key":"_onLoginSuccess","value":function value(){var V=this,$=this.getModule(rr),z=$.getItem(this.TAG,!1);!vt(z)&&ln(z.forEach)&&(Zt.log("".concat(this._className,"._onLoginSuccess get ssolog in storage, count:").concat(z.length)),z.forEach((function($){V._reportBody.pushIn($)})),$.removeItem(this.TAG,!1))}},{"key":"_onCloudConfigUpdated","value":function value(){var V=this.getCloudConfig("evt_rpt_threshold"),$=this.getCloudConfig("evt_rpt_waiting"),z=this.getCloudConfig("evt_rpt_level"),X=this.getCloudConfig("evt_rpt_sdkappid_bl"),Z=this.getCloudConfig("evt_rpt_tinyid_wl");un(V)||(this.MIN_THRESHOLD=Number(V)),un($)||(this.WAITING_TIME=Number($)),un(z)||(this.REPORT_LEVEL=z.split(",").map((function(V){return Number(V)}))),un(X)||(this.REPORT_SDKAPPID_BLACKLIST=X.split(",").map((function(V){return Number(V)}))),un(Z)||(this.REPORT_TINYID_WHITELIST=Z.split(","))}},{"key":"pushIn","value":function value(V){V instanceof ca&&(V.updateTimeStamp(),this._reportBody.pushIn(V),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{"key":"onCheckTimer","value":function value(){Date.now()V.MAX_THRESHOLD&&V._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{"key":"_flushAtOnce","value":function value(){var V=this.getModule(rr),$=V.getItem(this.TAG,!1),z=this._reportBody.getLogsInMemory();if(vt($))Zt.log("".concat(this._className,"._flushAtOnce count:").concat(z.length)),V.setItem(this.TAG,z,!0,!1);else{var X=z.concat($);X.length>this.MAX_THRESHOLD&&(X=X.slice(0,this.MAX_THRESHOLD)),Zt.log("".concat(this._className,"._flushAtOnce count:").concat(X.length)),V.setItem(this.TAG,X,!0,!1)}}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),a}(vr),Vs="none",Hs="online",$s=function(){function e(V){o(this,e),this._moduleManager=V,this._networkType="",this._className="NetMonitorModule",this.MAX_WAIT_TIME=3e3}return s(e,[{"key":"start","value":function value(){var V=this;if(Mt){Tt.getNetworkType({"success":function success($){V._networkType=$.networkType,$.networkType===Vs?Zt.warn("".concat(V._className,".start no network, please check!")):Zt.info("".concat(V._className,".start networkType:").concat($.networkType))}});var $=this._onNetworkStatusChange.bind(this);Tt.offNetworkStatusChange&&(At||Qe?Tt.offNetworkStatusChange($):Tt.offNetworkStatusChange()),Tt.onNetworkStatusChange($)}else this._networkType=Hs}},{"key":"_onNetworkStatusChange","value":function value(V){V.isConnected?(Zt.info("".concat(this._className,"._onNetworkStatusChange previousNetworkType:").concat(this._networkType," currentNetworkType:").concat(V.networkType)),this._networkType!==V.networkType&&this._moduleManager.getModule(dr).reConnect()):Zt.warn("".concat(this._className,"._onNetworkStatusChange no network, please check!")),this._networkType=V.networkType}},{"key":"probe","value":function value(){var V=this;return new Promise((function($,z){if(Mt)Tt.getNetworkType({"success":function success(z){V._networkType=z.networkType,z.networkType===Vs?(Zt.warn("".concat(V._className,".probe no network, please check!")),$([!1,z.networkType])):(Zt.info("".concat(V._className,".probe networkType:").concat(z.networkType)),$([!0,z.networkType]))}});else if(window&&window.fetch)fetch("".concat(Sn(),"//web.sdk.qcloud.com/im/assets/speed.xml?random=").concat(Math.random())).then((function(V){V.ok?$([!0,Hs]):$([!1,Vs])})).catch((function(V){$([!1,Vs])}));else{var X=new XMLHttpRequest,Z=setTimeout((function(){Zt.warn("".concat(V._className,".probe fetch timeout. Probably no network, please check!")),X.abort(),V._networkType=Vs,$([!1,Vs])}),V.MAX_WAIT_TIME);X.onreadystatechange=function(){4===X.readyState&&(clearTimeout(Z),200===X.status||304===X.status?(this._networkType=Hs,$([!0,Hs])):(Zt.warn("".concat(this.className,".probe fetch status:").concat(X.status,". Probably no network, please check!")),this._networkType=Vs,$([!1,Vs])))},X.open("GET","".concat(Sn(),"//web.sdk.qcloud.com/im/assets/speed.xml?random=").concat(Math.random())),X.send()}}))}},{"key":"getNetworkType","value":function value(){return this._networkType}}]),e}(),Ks=N((function(V){var $=Object.prototype.hasOwnProperty,z="~";function o(){}function a(V,$,z){this.fn=V,this.context=$,this.once=z||!1}function s(V,$,X,Z,ee){if("function"!=typeof X)throw new TypeError("The listener must be a function");var ae=new a(X,Z||V,ee),ie=z?z+$:$;return V._events[ie]?V._events[ie].fn?V._events[ie]=[V._events[ie],ae]:V._events[ie].push(ae):(V._events[ie]=ae,V._eventsCount++),V}function r(V,$){0==--V._eventsCount?V._events=new o:delete V._events[$]}function i(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(z=!1)),i.prototype.eventNames=function(){var V,X,Z=[];if(0===this._eventsCount)return Z;for(X in V=this._events)$.call(V,X)&&Z.push(z?X.slice(1):X);return Object.getOwnPropertySymbols?Z.concat(Object.getOwnPropertySymbols(V)):Z},i.prototype.listeners=function(V){var $=z?z+V:V,X=this._events[$];if(!X)return[];if(X.fn)return[X.fn];for(var Z=0,ee=X.length,ae=new Array(ee);Z=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{"key":"_getAuthorization","value":function value(V,$){$({"TmpSecretId":this.cosOptions.secretId,"TmpSecretKey":this.cosOptions.secretKey,"XCosSecurityToken":this.cosOptions.sessionToken,"ExpiredTime":this.cosOptions.expiredTime})}},{"key":"upload","value":function value(V){if(!0===V.getRelayFlag())return Promise.resolve();var z=this.getModule(mr);switch(V.type){case $.MSG_IMAGE:return z.addTotalCount(Jo),this._uploadImage(V);case $.MSG_FILE:return z.addTotalCount(Jo),this._uploadFile(V);case $.MSG_AUDIO:return z.addTotalCount(Jo),this._uploadAudio(V);case $.MSG_VIDEO:return z.addTotalCount(Jo),this._uploadVideo(V);default:return Promise.resolve()}}},{"key":"_uploadImage","value":function value(V){var $=this.getModule(Wn),z=V.getElements()[0],X=$.getMessageOptionByID(V.ID);return this.doUploadImage({"file":X.payload.file,"to":X.to,"onProgress":function onProgress(V){if(z.updatePercent(V),ln(X.onProgress))try{X.onProgress(V)}catch(V){return as({"code":Do.MESSAGE_ONPROGRESS_FUNCTION_ERROR,"message":No})}}}).then((function($){var X=$.location,Z=$.fileType,ee=$.fileSize,ae=$.width,ie=$.height,ce=Tn(X);z.updateImageFormat(Z);var le=pt({"originUrl":ce,"originWidth":ae,"originHeight":ie,"min":198}),de=pt({"originUrl":ce,"originWidth":ae,"originHeight":ie,"min":720});return z.updateImageInfoArray([{"size":ee,"url":ce,"width":ae,"height":ie},t({},de),t({},le)]),V}))}},{"key":"_uploadFile","value":function value(V){var $=this.getModule(Wn),z=V.getElements()[0],X=$.getMessageOptionByID(V.ID);return this.doUploadFile({"file":X.payload.file,"to":X.to,"onProgress":function onProgress(V){if(z.updatePercent(V),ln(X.onProgress))try{X.onProgress(V)}catch(V){return as({"code":Do.MESSAGE_ONPROGRESS_FUNCTION_ERROR,"message":No})}}}).then((function($){var X=$.location,Z=Tn(X);return z.updateFileUrl(Z),V}))}},{"key":"_uploadAudio","value":function value(V){var $=this.getModule(Wn),z=V.getElements()[0],X=$.getMessageOptionByID(V.ID);return this.doUploadAudio({"file":X.payload.file,"to":X.to,"onProgress":function onProgress(V){if(z.updatePercent(V),ln(X.onProgress))try{X.onProgress(V)}catch(V){return as({"code":Do.MESSAGE_ONPROGRESS_FUNCTION_ERROR,"message":No})}}}).then((function($){var X=$.location,Z=Tn(X);return z.updateAudioUrl(Z),V}))}},{"key":"_uploadVideo","value":function value(V){var $=this.getModule(Wn),z=V.getElements()[0],X=$.getMessageOptionByID(V.ID);return this.doUploadVideo({"file":X.payload.file,"to":X.to,"onProgress":function onProgress(V){if(z.updatePercent(V),ln(X.onProgress))try{X.onProgress(V)}catch(V){return as({"code":Do.MESSAGE_ONPROGRESS_FUNCTION_ERROR,"message":No})}}}).then((function($){var X=Tn($.location);return z.updateVideoUrl(X),V}))}},{"key":"doUploadImage","value":function value(V){if(!V.file)return as({"code":Do.MESSAGE_IMAGE_SELECT_FILE_FIRST,"message":"请先选择一个图片"});var $=this._checkImageType(V.file);if(!0!==$)return $;var z=this._checkImageSize(V.file);if(!0!==z)return z;var X=null;return this._setUploadFileType(1),this.uploadByCOS(V).then((function(V){return X=V,$="https://".concat(V.location),Mt?new Promise((function(V,z){Tt.getImageInfo({"src":$,"success":function success($){V({"width":$.width,"height":$.height})},"fail":function fail(){V({"width":0,"height":0})}})})):Gt&&9===xt?Promise.resolve({"width":0,"height":0}):new Promise((function(V,z){var X=new Image;X.onload=function(){V({"width":this.width,"height":this.height}),X=null},X.onerror=function(){V({"width":0,"height":0}),X=null},X.src=$}));var $})).then((function(V){return X.width=V.width,X.height=V.height,Promise.resolve(X)}))}},{"key":"_checkImageType","value":function value(V){var $="";return $=Mt?V.url.slice(V.url.lastIndexOf(".")+1):V.files[0].name.slice(V.files[0].name.lastIndexOf(".")+1),ds.indexOf($.toLowerCase())>=0||as({"code":Do.MESSAGE_IMAGE_TYPES_LIMIT,"message":"只允许上传 jpg png jpeg gif bmp格式的图片"})}},{"key":"_checkImageSize","value":function value(V){var $;return 0===($=Mt?V.size:V.files[0].size)?as({"code":Do.MESSAGE_FILE_IS_EMPTY,"message":"".concat(Oo)}):$<20971520||as({"code":Do.MESSAGE_IMAGE_SIZE_LIMIT,"message":"".concat("图片大小超过20M,无法发送")})}},{"key":"doUploadFile","value":function value(V){var $=null;return V.file?V.file.files[0].size>104857600?as($={"code":Do.MESSAGE_FILE_SIZE_LIMIT,"message":"文件大小超过100M,无法发送 "}):0===V.file.files[0].size?($={"code":Do.MESSAGE_FILE_IS_EMPTY,"message":"".concat(Oo)},as($)):(this._setUploadFileType(255),this.uploadByCOS(V)):as($={"code":Do.MESSAGE_FILE_SELECT_FILE_FIRST,"message":"请先选择一个文件"})}},{"key":"doUploadVideo","value":function value(V){return V.file.videoFile.size>104857600?as({"code":Do.MESSAGE_VIDEO_SIZE_LIMIT,"message":"".concat("视频大小超过100M,无法发送")}):0===V.file.videoFile.size?as({"code":Do.MESSAGE_FILE_IS_EMPTY,"message":"".concat(Oo)}):-1===ps.indexOf(V.file.videoFile.type)?as({"code":Do.MESSAGE_VIDEO_TYPES_LIMIT,"message":"".concat("只允许上传 mp4 格式的视频")}):(this._setUploadFileType(2),Mt?this.handleVideoUpload({"file":V.file.videoFile,"onProgress":V.onProgress}):St?this.handleVideoUpload(V):void 0)}},{"key":"handleVideoUpload","value":function value(V){var $=this;return new Promise((function(z,X){$.uploadByCOS(V).then((function(V){z(V)})).catch((function(){$.uploadByCOS(V).then((function(V){z(V)})).catch((function(){X(new ns({"code":Do.MESSAGE_VIDEO_UPLOAD_FAIL,"message":"视频上传失败"}))}))}))}))}},{"key":"doUploadAudio","value":function value(V){return V.file?V.file.size>20971520?as(new ns({"code":Do.MESSAGE_AUDIO_SIZE_LIMIT,"message":"".concat("语音大小大于20M,无法发送")})):0===V.file.size?as(new ns({"code":Do.MESSAGE_FILE_IS_EMPTY,"message":"".concat(Oo)})):(this._setUploadFileType(3),this.uploadByCOS(V)):as(new ns({"code":Do.MESSAGE_AUDIO_UPLOAD_FAIL,"message":"语音上传失败"}))}},{"key":"uploadByCOS","value":function value(V){var $=this,z="".concat(this._className,".uploadByCOS");if(!ln(this._cosUploadMethod))return Zt.warn("".concat(z," 没有检测到上传插件,将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#registerPlugin")),as({"code":Do.COS_UNDETECTED,"message":"未检测到 COS 上传插件"});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(V);var X=new ca(da),Z=Date.now(),ee=Mt?V.file:V.file.files[0];return new Promise((function(ae,ie){var ce=Mt?$._createCosOptionsWXMiniApp(V):$._createCosOptionsWeb(V),le=$;$._cosUploadMethod(ce,(function(V,ce){var de=Object.create(null);if(ce){if(V||sn(ce.files)&&ce.files[0].error){var pe=new ns({"code":Do.MESSAGE_FILE_UPLOAD_FAIL,"message":Ro});return X.setError(pe,!0,$.getNetworkType()).end(),Zt.log("".concat(z," failed. error:"),ce.files[0].error),403===ce.files[0].error.statusCode&&(Zt.warn("".concat(z," failed. cos AccessKeyId was invalid, regain auth key!")),$._getAuthorizationKey()),void ie(pe)}de.fileName=ee.name,de.fileSize=ee.size,de.fileType=ee.type.slice(ee.type.indexOf("/")+1).toLowerCase(),de.location=Mt?ce.Location:ce.files[0].data.Location;var fe=Date.now()-Z,ye=le._formatFileSize(ee.size),_e=le._formatSpeed(1e3*ee.size/fe),Se="size:".concat(ye," time:").concat(fe,"ms speed:").concat(_e);Zt.log("".concat(z," success. name:").concat(ee.name," ").concat(Se)),ae(de);var Te=$.getModule(mr);return Te.addCost(Jo,fe),Te.addFileSize(Jo,ee.size),void X.setNetworkType($.getNetworkType()).setMessage(Se).end()}var He=new ns({"code":Do.MESSAGE_FILE_UPLOAD_FAIL,"message":Ro});X.setError(He,!0,le.getNetworkType()).end(),Zt.warn("".concat(z," failed. error:"),V),403===V.statusCode&&(Zt.warn("".concat(z," failed. cos AccessKeyId was invalid, regain auth key!")),$._getAuthorizationKey()),ie(He)}))}))}},{"key":"_uploadWithPreSigUrl","value":function value(V){var $=this,z="".concat(this._className,"._uploadWithPreSigUrl"),X=Mt?V.file:V.file.files[0];return this._createCosOptionsPreSigUrl(V).then((function(V){return new Promise((function(Z,ee){var ae=new ca(da);Zt.time($o),$._cosUploadMethod(V,(function(V,ie){var ce=Object.create(null);if(V||403===ie.statusCode){var le=new ns({"code":Do.MESSAGE_FILE_UPLOAD_FAIL,"message":Ro});return ae.setError(le,!0,$.getNetworkType()).end(),Zt.log("".concat(z," failed, error:"),V),void ee(le)}var de=ie.data.location||"";0!==de.indexOf("https://")&&0!==de.indexOf("http://")||(de=de.split("//")[1]),ce.fileName=X.name,ce.fileSize=X.size,ce.fileType=X.type.slice(X.type.indexOf("/")+1).toLowerCase(),ce.location=de;var pe=Zt.timeEnd($o),fe=$._formatFileSize(X.size),ye=$._formatSpeed(1e3*X.size/pe),_e="size:".concat(fe,",time:").concat(pe,"ms,speed:").concat(ye);Zt.log("".concat(z," success name:").concat(X.name,",").concat(_e)),ae.setNetworkType($.getNetworkType()).setMessage(_e).end();var Se=$.getModule(mr);Se.addCost(Jo,pe),Se.addFileSize(Jo,X.size),Z(ce)}))}))}))}},{"key":"_formatFileSize","value":function value(V){return V<1024?V+"B":V<1048576?Math.floor(V/1024)+"KB":Math.floor(V/1048576)+"MB"}},{"key":"_formatSpeed","value":function value(V){return V<=1048576?_t(V/1024,1)+"KB/s":_t(V/1048576,1)+"MB/s"}},{"key":"_createCosOptionsWeb","value":function value(V){var $=V.file.files[0].name,z=$.slice($.lastIndexOf(".")),X=this._genFileName("".concat(_n(999999)).concat(z));return{"files":[{"Bucket":"".concat(this.bucketName,"-").concat(this.appid),"Region":this.region,"Key":"".concat(this.directory,"/").concat(X),"Body":V.file.files[0]}],"SliceSize":1048576,"onProgress":function onProgress($){if("function"==typeof V.onProgress)try{V.onProgress($.percent)}catch(V){Zt.warn("onProgress callback error:",V)}},"onFileFinish":function onFileFinish(V,$,z){}}}},{"key":"_createCosOptionsWXMiniApp","value":function value(V){var $=this._genFileName(V.file.name),z=V.file.url;return{"Bucket":"".concat(this.bucketName,"-").concat(this.appid),"Region":this.region,"Key":"".concat(this.directory,"/").concat($),"FilePath":z,"onProgress":function onProgress($){if(Zt.log(JSON.stringify($)),"function"==typeof V.onProgress)try{V.onProgress($.percent)}catch(V){Zt.warn("onProgress callback error:",V)}}}}},{"key":"_createCosOptionsPreSigUrl","value":function value(V){var $=this,z="",X="",Z=0;if(Mt)z=this._genFileName(V.file.name),X=V.file.url,Z=1;else{var ee=V.file.files[0].name,ae=ee.slice(ee.lastIndexOf("."));z=this._genFileName("".concat(_n(999999)).concat(ae)),X=V.file.files[0],Z=0}return this._getCosPreSigUrl({"fileType":this.uploadFileType,"fileName":z,"uploadMethod":Z,"duration":this.duration}).then((function(Z){var ee=Z.uploadUrl,ae=Z.downloadUrl;return{"url":ee,"fileType":$.uploadFileType,"fileName":z,"resources":X,"downloadUrl":ae,"onProgress":function onProgress($){if("function"==typeof V.onProgress)try{V.onProgress($.percent)}catch(V){Zt.warn("onProgress callback error:",V),Zt.error(V)}}}}))}},{"key":"_genFileName","value":function value(V){return"".concat(lt(),"-").concat(V)}},{"key":"_setUploadFileType","value":function value(V){this.uploadFileType=V}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset"))}}]),a}(vr),Ws=["downloadKey","pbDownloadKey","messageList"],Ys=function(){function e(V){o(this,e),this._className="MergerMessageHandler",this._messageModule=V}return s(e,[{"key":"uploadMergerMessage","value":function value(V,$){var z=this;Zt.debug("".concat(this._className,".uploadMergerMessage message:"),V,"messageBytes:".concat($));var X=V.payload.messageList,Z=X.length,ee=new ca("uploadMergerMessage");return this._messageModule.request({"protocolName":ko,"requestData":{"messageList":X}}).then((function(V){Zt.debug("".concat(z._className,".uploadMergerMessage ok. response:"),V.data);var X=V.data,ae=X.pbDownloadKey,ie=X.downloadKey,ce={"pbDownloadKey":ae,"downloadKey":ie,"messageNumber":Z};return ee.setNetworkType(z._messageModule.getNetworkType()).setMessage("".concat(Z,"-").concat($,"-").concat(ie)).end(),ce})).catch((function(V){throw Zt.warn("".concat(z._className,".uploadMergerMessage failed. error:"),V),z._messageModule.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];ee.setError(V,X,Z).end()})),V}))}},{"key":"downloadMergerMessage","value":function value(V){var $=this;Zt.debug("".concat(this._className,".downloadMergerMessage message:"),V);var z=V.payload.downloadKey,X=new ca("downloadMergerMessage");return X.setMessage("downloadKey:".concat(z)),this._messageModule.request({"protocolName":Eo,"requestData":{"downloadKey":z}}).then((function(z){if(Zt.debug("".concat($._className,".downloadMergerMessage ok. response:"),z.data),ln(V.clearElement)){var Z=V.payload,ee=(Z.downloadKey,Z.pbDownloadKey,Z.messageList,g(Z,Ws));V.clearElement(),V.setElement({"type":V.type,"content":t({"messageList":z.data.messageList},ee)})}else{var ae=[];z.data.messageList.forEach((function(V){if(!vt(V)){var $=new za(V);ae.push($)}})),V.payload.messageList=ae,V.payload.downloadKey="",V.payload.pbDownloadKey=""}return X.setNetworkType($._messageModule.getNetworkType()).end(),V})).catch((function(V){throw Zt.warn("".concat($._className,".downloadMergerMessage failed. key:").concat(z," error:"),V),$._messageModule.probeNetwork().then((function($){var z=m($,2),Z=z[0],ee=z[1];X.setError(V,Z,ee).end()})),V}))}},{"key":"createMergerMessagePack","value":function value(V,z,X){return V.conversationType===$.CONV_C2C?this._createC2CMergerMessagePack(V,z,X):this._createGroupMergerMessagePack(V,z,X)}},{"key":"_createC2CMergerMessagePack","value":function value(V,$,z){var X=null;$&&($.offlinePushInfo&&(X=$.offlinePushInfo),!0===$.onlineUserOnly&&(X?X.disablePush=!0:X={"disablePush":!0}));var Z="";rn(V.cloudCustomData)&&V.cloudCustomData.length>0&&(Z=V.cloudCustomData);var ee=z.pbDownloadKey,ae=z.downloadKey,ie=z.messageNumber,ce=V.payload,le=ce.title,de=ce.abstractList,pe=ce.compatibleText,fe=this._messageModule.getModule(Xn);return{"protocolName":Sr,"tjgID":this._messageModule.generateTjgID(V),"requestData":{"fromAccount":this._messageModule.getMyUserID(),"toAccount":V.to,"msgBody":[{"msgType":V.type,"msgContent":{"pbDownloadKey":ee,"downloadKey":ae,"title":le,"abstractList":de,"compatibleText":pe,"messageNumber":ie}}],"cloudCustomData":Z,"msgSeq":V.sequence,"msgRandom":V.random,"msgLifeTime":fe&&fe.isOnlineMessage(V,$)?0:void 0,"offlinePushInfo":X?{"pushFlag":!0===X.disablePush?1:0,"title":X.title||"","desc":X.description||"","ext":X.extension||"","apnsInfo":{"badgeMode":!0===X.ignoreIOSBadge?1:0},"androidInfo":{"OPPOChannelID":X.androidOPPOChannelID||""}}:void 0}}}},{"key":"_createGroupMergerMessagePack","value":function value(V,$,z){var X=null;$&&$.offlinePushInfo&&(X=$.offlinePushInfo);var Z="";rn(V.cloudCustomData)&&V.cloudCustomData.length>0&&(Z=V.cloudCustomData);var ee=z.pbDownloadKey,ae=z.downloadKey,ie=z.messageNumber,ce=V.payload,le=ce.title,de=ce.abstractList,pe=ce.compatibleText,fe=this._messageModule.getModule(Jn);return{"protocolName":Tr,"tjgID":this._messageModule.generateTjgID(V),"requestData":{"fromAccount":this._messageModule.getMyUserID(),"groupID":V.to,"msgBody":[{"msgType":V.type,"msgContent":{"pbDownloadKey":ee,"downloadKey":ae,"title":le,"abstractList":de,"compatibleText":pe,"messageNumber":ie}}],"random":V.random,"priority":V.priority,"clientSequence":V.clientSequence,"groupAtInfo":void 0,"cloudCustomData":Z,"onlineOnlyFlag":fe&&fe.isOnlineMessage(V,$)?1:0,"offlinePushInfo":X?{"pushFlag":!0===X.disablePush?1:0,"title":X.title||"","desc":X.description||"","ext":X.extension||"","apnsInfo":{"badgeMode":!0===X.ignoreIOSBadge?1:0},"androidInfo":{"OPPOChannelID":X.androidOPPOChannelID||""}}:void 0}}}}]),e}(),Xs={"ERR_SVR_COMM_SENSITIVE_TEXT":80001,"ERR_SVR_COMM_BODY_SIZE_LIMIT":80002,"ERR_SVR_MSG_PKG_PARSE_FAILED":20001,"ERR_SVR_MSG_INTERNAL_AUTH_FAILED":20002,"ERR_SVR_MSG_INVALID_ID":20003,"ERR_SVR_MSG_PUSH_DENY":20006,"ERR_SVR_MSG_IN_PEER_BLACKLIST":20007,"ERR_SVR_MSG_BOTH_NOT_FRIEND":20009,"ERR_SVR_MSG_NOT_PEER_FRIEND":20010,"ERR_SVR_MSG_NOT_SELF_FRIEND":20011,"ERR_SVR_MSG_SHUTUP_DENY":20012,"ERR_SVR_GROUP_INVALID_PARAMETERS":10004,"ERR_SVR_GROUP_PERMISSION_DENY":10007,"ERR_SVR_GROUP_NOT_FOUND":10010,"ERR_SVR_GROUP_INVALID_GROUPID":10015,"ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY":10016,"ERR_SVR_GROUP_SHUTUP_DENY":10017,"MESSAGE_SEND_FAIL":2100},Js=[Do.MESSAGE_ONPROGRESS_FUNCTION_ERROR,Do.MESSAGE_IMAGE_SELECT_FILE_FIRST,Do.MESSAGE_IMAGE_TYPES_LIMIT,Do.MESSAGE_FILE_IS_EMPTY,Do.MESSAGE_IMAGE_SIZE_LIMIT,Do.MESSAGE_FILE_SELECT_FILE_FIRST,Do.MESSAGE_FILE_SIZE_LIMIT,Do.MESSAGE_VIDEO_SIZE_LIMIT,Do.MESSAGE_VIDEO_TYPES_LIMIT,Do.MESSAGE_AUDIO_UPLOAD_FAIL,Do.MESSAGE_AUDIO_SIZE_LIMIT,Do.COS_UNDETECTED],Zs=function(V){i(n,V);var z=f(n);function n(V){var $;return o(this,n),($=z.call(this,V))._className="MessageModule",$._messageOptionsMap=new Map,$._mergerMessageHandler=new Ys(h($)),$}return s(n,[{"key":"createTextMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=new Si(V),X="string"==typeof V.payload?V.payload:V.payload.text,Z=new ya({"text":X}),ee=this._getNickAndAvatarByUserID($);return z.setElement(Z),z.setNickAndAvatar(ee),z.setNameCard(this._getNameCardByGroupID(z)),z}},{"key":"createImageMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=new Si(V);if(Mt){var X=V.payload.file;if(tn(X))return void Zt.warn("小程序环境下调用 createImageMessage 接口时,payload.file 不支持传入 File 对象");var Z=X.tempFilePaths[0],ee={"url":Z,"name":Z.slice(Z.lastIndexOf("/")+1),"size":X.tempFiles&&X.tempFiles[0].size||1,"type":Z.slice(Z.lastIndexOf(".")+1).toLowerCase()};V.payload.file=ee}else if(St)if(tn(V.payload.file)){var ae=V.payload.file;V.payload.file={"files":[ae]}}else if(an(V.payload.file)&&"undefined"!=typeof uni){var ie=V.payload.file.tempFiles[0];V.payload.file={"files":[ie]}}var ce=new wa({"imageFormat":_a.IMAGE_FORMAT.UNKNOWN,"uuid":this._generateUUID(),"file":V.payload.file}),le=this._getNickAndAvatarByUserID($);return z.setElement(ce),z.setNickAndAvatar(le),z.setNameCard(this._getNameCardByGroupID(z)),this._messageOptionsMap.set(z.ID,V),z}},{"key":"createAudioMessage","value":function value(V){if(Mt){var $=V.payload.file;if(Mt){var z={"url":$.tempFilePath,"name":$.tempFilePath.slice($.tempFilePath.lastIndexOf("/")+1),"size":$.fileSize,"second":parseInt($.duration)/1e3,"type":$.tempFilePath.slice($.tempFilePath.lastIndexOf(".")+1).toLowerCase()};V.payload.file=z}var X=this.getMyUserID();V.currentUser=X;var Z=new Si(V),ee=new Na({"second":Math.floor($.duration/1e3),"size":$.fileSize,"url":$.tempFilePath,"uuid":this._generateUUID()}),ae=this._getNickAndAvatarByUserID(X);return Z.setElement(ee),Z.setNickAndAvatar(ae),Z.setNameCard(this._getNameCardByGroupID(Z)),this._messageOptionsMap.set(Z.ID,V),Z}Zt.warn("createAudioMessage 目前只支持小程序环境下发语音消息")}},{"key":"createVideoMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$,V.payload.file.thumbUrl="https://web.sdk.qcloud.com/im/assets/images/transparent.png",V.payload.file.thumbSize=1668;var z={};if(Mt){if(bt)return void Zt.warn("createVideoMessage 不支持在支付宝小程序环境下使用");if(tn(V.payload.file))return void Zt.warn("小程序环境下调用 createVideoMessage 接口时,payload.file 不支持传入 File 对象");var X=V.payload.file;z.url=X.tempFilePath,z.name=X.tempFilePath.slice(X.tempFilePath.lastIndexOf("/")+1),z.size=X.size,z.second=X.duration,z.type=X.tempFilePath.slice(X.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(St){if(tn(V.payload.file)){var Z=V.payload.file;V.payload.file.files=[Z]}else if(an(V.payload.file)&&"undefined"!=typeof uni){var ee=V.payload.file.tempFile;V.payload.file.files=[ee]}var ae=V.payload.file;z.url=window.URL.createObjectURL(ae.files[0]),z.name=ae.files[0].name,z.size=ae.files[0].size,z.second=ae.files[0].duration||0,z.type=ae.files[0].type.split("/")[1]}V.payload.file.videoFile=z;var ie=new Si(V),ce=new Ha({"videoFormat":z.type,"videoSecond":_t(z.second,0),"videoSize":z.size,"remoteVideoUrl":"","videoUrl":z.url,"videoUUID":this._generateUUID(),"thumbUUID":this._generateUUID(),"thumbWidth":V.payload.file.width||200,"thumbHeight":V.payload.file.height||200,"thumbUrl":V.payload.file.thumbUrl,"thumbSize":V.payload.file.thumbSize,"thumbFormat":V.payload.file.thumbUrl.slice(V.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),le=this._getNickAndAvatarByUserID($);return ie.setElement(ce),ie.setNickAndAvatar(le),ie.setNameCard(this._getNameCardByGroupID(ie)),this._messageOptionsMap.set(ie.ID,V),ie}},{"key":"createCustomMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=new Si(V),X=new ja({"data":V.payload.data,"description":V.payload.description,"extension":V.payload.extension}),Z=this._getNickAndAvatarByUserID($);return z.setElement(X),z.setNickAndAvatar(Z),z.setNameCard(this._getNameCardByGroupID(z)),z}},{"key":"createFaceMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=new Si(V),X=new Da(V.payload),Z=this._getNickAndAvatarByUserID($);return z.setElement(X),z.setNickAndAvatar(Z),z.setNameCard(this._getNameCardByGroupID(z)),z}},{"key":"createMergerMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=this._getNickAndAvatarByUserID($),X=new Si(V),Z=new Ja(V.payload);return X.setElement(Z),X.setNickAndAvatar(z),X.setNameCard(this._getNameCardByGroupID(X)),X.setRelayFlag(!0),X}},{"key":"createForwardMessage","value":function value(V){var z=V.to,X=V.conversationType,Z=V.priority,ee=V.payload,ae=this.getMyUserID(),ie=this._getNickAndAvatarByUserID(ae);if(ee.type===$.MSG_GRP_TIP)return as(new ns({"code":Do.MESSAGE_FORWARD_TYPE_INVALID,"message":"选择的消息类型(如群提示消息)不可以转发"}));var ce={"to":z,"conversationType":X,"conversationID":"".concat(X).concat(z),"priority":Z,"isPlaceMessage":0,"status":Pn,"currentUser":ae,"cloudCustomData":V.cloudCustomData||ee.cloudCustomData||""},le=new Si(ce);return le.setElement(ee.getElements()[0]),le.setNickAndAvatar(ie),le.setNameCard(this._getNameCardByGroupID(ee)),le.setRelayFlag(!0),le}},{"key":"downloadMergerMessage","value":function value(V){return this._mergerMessageHandler.downloadMergerMessage(V)}},{"key":"createFileMessage","value":function value(V){if(!Mt){if(St)if(tn(V.payload.file)){var $=V.payload.file;V.payload.file={"files":[$]}}else if(an(V.payload.file)&&"undefined"!=typeof uni){var z=V.payload.file.tempFiles[0];V.payload.file={"files":[z]}}var X=this.getMyUserID();V.currentUser=X;var Z=new Si(V),ee=new Ba({"uuid":this._generateUUID(),"file":V.payload.file}),ae=this._getNickAndAvatarByUserID(X);return Z.setElement(ee),Z.setNickAndAvatar(ae),Z.setNameCard(this._getNameCardByGroupID(Z)),this._messageOptionsMap.set(Z.ID,V),Z}Zt.warn("小程序目前不支持选择文件, createFileMessage 接口不可用!")}},{"key":"createLocationMessage","value":function value(V){var $=this.getMyUserID();V.currentUser=$;var z=new Si(V),X=new $a(V.payload),Z=this._getNickAndAvatarByUserID($);return z.setElement(X),z.setNickAndAvatar(Z),z.setNameCard(this._getNameCardByGroupID(z)),this._messageOptionsMap.set(z.ID,V),z}},{"key":"_onCannotFindModule","value":function value(){return as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"sendMessageInstance","value":function value(V,z){var X,Z=this,ee=null;switch(V.conversationType){case $.CONV_C2C:if(!(ee=this.getModule(Xn)))return this._onCannotFindModule();break;case $.CONV_GROUP:if(!(ee=this.getModule(Jn)))return this._onCannotFindModule();break;default:return as({"code":Do.MESSAGE_SEND_INVALID_CONVERSATION_TYPE,"message":'Message.conversationType 只能为 "C2C" 或 "GROUP"'})}var ae=this.getModule(sr),ie=this.getModule(Jn);return ae.upload(V).then((function(){return Z._getSendMessageSpecifiedKey(V)===Xo&&Z.getModule(mr).addSuccessCount(Jo),ie.guardForAVChatRoom(V).then((function(){if(!V.isSendable())return as({"code":Do.MESSAGE_FILE_URL_IS_EMPTY,"message":"缺少必要的参数文件 URL"});Z._addSendMessageTotalCount(V),X=Date.now();var ae=function(V){var $="utf-8";St&&document&&($=document.charset.toLowerCase());var z,X,Z=0;if(X=V.length,"utf-8"===$||"utf8"===$)for(var ee=0;ee7e3?Z._mergerMessageHandler.uploadMergerMessage(V,ae).then((function($){var X=Z._mergerMessageHandler.createMergerMessagePack(V,z,$);return Z.request(X)})):(Z.getModule(tr).setMessageRandom(V),V.conversationType===$.CONV_C2C||V.conversationType===$.CONV_GROUP?ee.sendMessage(V,z):void 0)})).then((function(ae){var ie=ae.data,ce=ie.time,le=ie.sequence;Z._addSendMessageSuccessCount(V,X),Z._messageOptionsMap.delete(V.ID);var de=Z.getModule(tr);V.status=Rn,V.time=ce;var pe=!1;if(V.conversationType===$.CONV_GROUP)V.sequence=le,V.generateMessageID(Z.getMyUserID());else if(V.conversationType===$.CONV_C2C){var fe=de.getLatestMessageSentByMe(V.conversationID);if(fe){var ye=fe.nick,_e=fe.avatar;ye===V.nick&&_e===V.avatar||(pe=!0)}}return de.appendToMessageList(V),pe&&de.modifyMessageSentByMe({"conversationID":V.conversationID,"latestNick":V.nick,"latestAvatar":V.avatar}),ee.isOnlineMessage(V,z)?V.setOnlineOnlyFlag(!0):de.onMessageSent({"conversationOptionsList":[{"conversationID":V.conversationID,"unreadCount":0,"type":V.conversationType,"subType":V.conversationSubType,"lastMessage":V}]}),V.getRelayFlag()||"TIMImageElem"!==V.type||gt(V.payload.imageInfoArray),Ni({"message":V})}))})).catch((function($){return Z._onSendMessageFailed(V,$)}))}},{"key":"_onSendMessageFailed","value":function value(V,$){V.status=Ln,this.getModule(tr).deleteMessageRandom(V),this._addSendMessageFailCountOnUser(V,$);var z=new ca("sendMessage");return z.setMessage("tjg_id:".concat(this.generateTjgID(V)," type:").concat(V.type," from:").concat(V.from," to:").concat(V.to)),this.probeNetwork().then((function(V){var X=m(V,2),Z=X[0],ee=X[1];z.setError($,Z,ee).end()})),Zt.error("".concat(this._className,"._onSendMessageFailed error:"),$),as(new ns({"code":$&&$.code?$.code:Do.MESSAGE_SEND_FAIL,"message":$&&$.message?$.message:"消息发送失败","data":{"message":V}}))}},{"key":"_getSendMessageSpecifiedKey","value":function value(V){if([$.MSG_IMAGE,$.MSG_AUDIO,$.MSG_VIDEO,$.MSG_FILE].includes(V.type))return Xo;if(V.conversationType===$.CONV_C2C)return zo;if(V.conversationType===$.CONV_GROUP){var z=this.getModule(Jn).getLocalGroupProfile(V.to);if(!z)return;var X=z.type;return En(X)?Yo:Wo}}},{"key":"_addSendMessageTotalCount","value":function value(V){var $=this._getSendMessageSpecifiedKey(V);$&&this.getModule(mr).addTotalCount($)}},{"key":"_addSendMessageSuccessCount","value":function value(V,$){var z=Math.abs(Date.now()-$),X=this._getSendMessageSpecifiedKey(V);if(X){var Z=this.getModule(mr);Z.addSuccessCount(X),Z.addCost(X,z)}}},{"key":"_addSendMessageFailCountOnUser","value":function value(V,$){var z,X,Z=$.code,ee=void 0===Z?-1:Z,ae=this.getModule(mr),ie=this._getSendMessageSpecifiedKey(V);ie===Xo&&(z=ee,X=!1,Js.includes(z)&&(X=!0),X)?ae.addFailedCountOfUserSide(Jo):function(V){var $=!1;return Object.values(Xs).includes(V)&&($=!0),(V>=120001&&V<=13e4||V>=10100&&V<=10200)&&($=!0),$}(ee)&&ie&&ae.addFailedCountOfUserSide(ie)}},{"key":"resendMessage","value":function value(V){return V.isResend=!0,V.status=Pn,this.sendMessageInstance(V)}},{"key":"revokeMessage","value":function value(V){var z=this,X=null;if(V.conversationType===$.CONV_C2C){if(!(X=this.getModule(Xn)))return this._onCannotFindModule()}else if(V.conversationType===$.CONV_GROUP&&!(X=this.getModule(Jn)))return this._onCannotFindModule();var Z=new ca("revokeMessage");return Z.setMessage("tjg_id:".concat(this.generateTjgID(V)," type:").concat(V.type," from:").concat(V.from," to:").concat(V.to)),X.revokeMessage(V).then((function($){var X=$.data.recallRetList;if(!vt(X)&&0!==X[0].retCode){var ee=new ns({"code":X[0].retCode,"message":ts[X[0].retCode]||Po,"data":{"message":V}});return Z.setCode(ee.code).setMoreMessage(ee.message).end(),as(ee)}return Zt.info("".concat(z._className,".revokeMessage ok. ID:").concat(V.ID)),V.isRevoked=!0,Z.end(),z.getModule(tr).onMessageRevoked([V]),Ni({"message":V})})).catch((function($){z.probeNetwork().then((function(V){var z=m(V,2),X=z[0],ee=z[1];Z.setError($,X,ee).end()}));var X=new ns({"code":$&&$.code?$.code:Do.MESSAGE_REVOKE_FAIL,"message":$&&$.message?$.message:Po,"data":{"message":V}});return Zt.warn("".concat(z._className,".revokeMessage failed. error:"),$),as(X)}))}},{"key":"deleteMessage","value":function value(V){var z=this,X=null,Z=V[0],ee=Z.conversationID,ae="",ie=[],ce=[];if(Z.conversationType===$.CONV_C2C?(X=this.getModule(Xn),ae=ee.replace($.CONV_C2C,""),V.forEach((function(V){V&&V.status===Rn&&V.conversationID===ee&&(V.getOnlineOnlyFlag()||ie.push("".concat(V.sequence,"_").concat(V.random,"_").concat(V.time)),ce.push(V))}))):Z.conversationType===$.CONV_GROUP&&(X=this.getModule(Jn),ae=ee.replace($.CONV_GROUP,""),V.forEach((function(V){V&&V.status===Rn&&V.conversationID===ee&&(V.getOnlineOnlyFlag()||ie.push("".concat(V.sequence)),ce.push(V))}))),!X)return this._onCannotFindModule();if(0===ie.length)return this._onMessageDeleted(ce);ie.length>30&&(ie=ie.slice(0,30),ce=ce.slice(0,30));var le=new ca("deleteMessage");return le.setMessage("to:".concat(ae," count:").concat(ie.length)),X.deleteMessage({"to":ae,"keyList":ie}).then((function(V){return le.end(),Zt.info("".concat(z._className,".deleteMessage ok")),z._onMessageDeleted(ce)})).catch((function(V){z.probeNetwork().then((function($){var z=m($,2),X=z[0],Z=z[1];le.setError(V,X,Z).end()})),Zt.warn("".concat(z._className,".deleteMessage failed. error:"),V);var $=new ns({"code":V&&V.code?V.code:Do.MESSAGE_DELETE_FAIL,"message":V&&V.message?V.message:"消息删除失败"});return as($)}))}},{"key":"_onMessageDeleted","value":function value(V){return this.getModule(tr).onMessageDeleted(V),os({"messageList":V})}},{"key":"_generateUUID","value":function value(){var V=this.getModule(nr);return"".concat(V.getSDKAppID(),"-").concat(V.getUserID(),"-").concat(function(){for(var V="",$=32;$>0;--$)V+=bn[Math.floor(62*Math.random())];return V}())}},{"key":"getMessageOptionByID","value":function value(V){return this._messageOptionsMap.get(V)}},{"key":"_getNickAndAvatarByUserID","value":function value(V){return this.getModule(Yn).getNickAndAvatarByUserID(V)}},{"key":"_getNameCardByGroupID","value":function value(V){if(V.conversationType===$.CONV_GROUP){var z=this.getModule(Jn);if(z)return z.getMyNameCardByGroupID(V.to)}return""}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._messageOptionsMap.clear()}}]),n}(vr),eu=function(V){i(n,V);var $=f(n);function n(V){var z;return o(this,n),(z=$.call(this,V))._className="PluginModule",z.plugins={},z}return s(n,[{"key":"registerPlugin","value":function value(V){var $=this;Object.keys(V).forEach((function(z){$.plugins[z]=V[z]})),new ca("registerPlugin").setMessage("key=".concat(Object.keys(V))).end()}},{"key":"getPlugin","value":function value(V){return this.plugins[V]}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset"))}}]),n}(vr),tu=function(V){i(n,V);var $=f(n);function n(V){var z;return o(this,n),(z=$.call(this,V))._className="SyncUnreadMessageModule",z._cookie="",z._onlineSyncFlag=!1,z.getInnerEmitterInstance().on(us,z._onLoginSuccess,h(z)),z}return s(n,[{"key":"_onLoginSuccess","value":function value(V){this._startSync({"cookie":this._cookie,"syncFlag":0,"isOnlineSync":0})}},{"key":"_startSync","value":function value(V){var $=this,z=V.cookie,X=V.syncFlag,Z=V.isOnlineSync;Zt.log("".concat(this._className,"._startSync cookie:").concat(z," syncFlag:").concat(X," isOnlineSync:").concat(Z)),this.request({"protocolName":Ar,"requestData":{"cookie":z,"syncFlag":X,"isOnlineSync":Z}}).then((function(V){var z=V.data,X=z.cookie,Z=z.syncFlag,ee=z.eventArray,ae=z.messageList,ie=z.C2CRemainingUnreadList;$._cookie=X,vt(X)||(0===Z||1===Z?(ee&&$.getModule(lr).onMessage({"head":{},"body":{"eventArray":ee,"isInstantMessage":$._onlineSyncFlag,"isSyncingEnded":!1}}),$.getModule(Xn).onNewC2CMessage({"dataList":ae,"isInstantMessage":!1,"C2CRemainingUnreadList":ie}),$._startSync({"cookie":X,"syncFlag":Z,"isOnlineSync":0})):2===Z&&(ee&&$.getModule(lr).onMessage({"head":{},"body":{"eventArray":ee,"isInstantMessage":$._onlineSyncFlag,"isSyncingEnded":!0}}),$.getModule(Xn).onNewC2CMessage({"dataList":ae,"isInstantMessage":$._onlineSyncFlag,"C2CRemainingUnreadList":ie})))})).catch((function(V){Zt.error("".concat($._className,"._startSync failed. error:"),V)}))}},{"key":"startOnlineSync","value":function value(){Zt.log("".concat(this._className,".startOnlineSync")),this._onlineSyncFlag=!0,this._startSync({"cookie":this._cookie,"syncFlag":0,"isOnlineSync":1})}},{"key":"startSyncOnReconnected","value":function value(){Zt.log("".concat(this._className,".startSyncOnReconnected.")),this._onlineSyncFlag=!0,this._startSync({"cookie":this._cookie,"syncFlag":0,"isOnlineSync":0})}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._onlineSyncFlag=!1,this._cookie=""}}]),n}(vr),nu={"request":{"toAccount":"To_Account","fromAccount":"From_Account","to":"To_Account","from":"From_Account","groupID":"GroupId","groupAtUserID":"GroupAt_Account","extension":"Ext","data":"Data","description":"Desc","elements":"MsgBody","sizeType":"Type","downloadFlag":"Download_Flag","thumbUUID":"ThumbUUID","videoUUID":"VideoUUID","remoteAudioUrl":"Url","remoteVideoUrl":"VideoUrl","videoUrl":"","imageUrl":"URL","fileUrl":"Url","uuid":"UUID","priority":"MsgPriority","receiverUserID":"To_Account","receiverGroupID":"GroupId","messageSender":"SenderId","messageReceiver":"ReceiverId","nick":"From_AccountNick","avatar":"From_AccountHeadurl","messageNumber":"MsgNum","pbDownloadKey":"PbMsgKey","downloadKey":"JsonMsgKey","applicationType":"PendencyType","userIDList":"To_Account","groupNameList":"GroupName","userID":"To_Account","groupAttributeList":"GroupAttr","mainSequence":"AttrMainSeq","avChatRoomKey":"BytesKey","attributeControl":"AttrControl","sequence":"seq"},"response":{"MsgPriority":"priority","ThumbUUID":"thumbUUID","VideoUUID":"videoUUID","Download_Flag":"downloadFlag","GroupId":"groupID","Member_Account":"userID","MsgList":"messageList","SyncFlag":"syncFlag","To_Account":"to","From_Account":"from","MsgSeq":"sequence","MsgRandom":"random","MsgTime":"time","MsgTimeStamp":"time","MsgContent":"content","MsgBody":"elements","From_AccountNick":"nick","From_AccountHeadurl":"avatar","GroupWithdrawInfoArray":"revokedInfos","GroupReadInfoArray":"groupMessageReadNotice","LastReadMsgSeq":"lastMessageSeq","WithdrawC2cMsgNotify":"c2cMessageRevokedNotify","C2cWithdrawInfoArray":"revokedInfos","C2cReadedReceipt":"c2cMessageReadReceipt","ReadC2cMsgNotify":"c2cMessageReadNotice","LastReadTime":"peerReadTime","MsgRand":"random","MsgType":"type","MsgShow":"messageShow","NextMsgSeq":"nextMessageSeq","FaceUrl":"avatar","ProfileDataMod":"profileModify","Profile_Account":"userID","ValueBytes":"value","ValueNum":"value","NoticeSeq":"noticeSequence","NotifySeq":"notifySequence","MsgFrom_AccountExtraInfo":"messageFromAccountExtraInformation","Operator_Account":"operatorID","OpType":"operationType","ReportType":"operationType","UserId":"userID","User_Account":"userID","List_Account":"userIDList","MsgOperatorMemberExtraInfo":"operatorInfo","MsgMemberExtraInfo":"memberInfoList","ImageUrl":"avatar","NickName":"nick","MsgGroupNewInfo":"newGroupProfile","MsgAppDefinedData":"groupCustomField","Owner_Account":"ownerID","GroupFaceUrl":"avatar","GroupIntroduction":"introduction","GroupNotification":"notification","GroupApplyJoinOption":"joinOption","MsgKey":"messageKey","GroupInfo":"groupProfile","ShutupTime":"muteTime","Desc":"description","Ext":"extension","GroupAt_Account":"groupAtUserID","MsgNum":"messageNumber","PbMsgKey":"pbDownloadKey","JsonMsgKey":"downloadKey","MsgModifiedFlag":"isModified","PendencyItem":"applicationItem","PendencyType":"applicationType","AddTime":"time","AddSource":"source","AddWording":"wording","ProfileImImage":"avatar","PendencyAdd":"friendApplicationAdded","FrienPencydDel_Account":"friendApplicationDeletedUserIDList","Peer_Account":"userID","GroupAttr":"groupAttributeList","GroupAttrAry":"groupAttributeList","AttrMainSeq":"mainSequence","seq":"sequence","GroupAttrOption":"groupAttributeOption","BytesChangedKeys":"changedKeyList","GroupAttrInfo":"groupAttributeList","GroupAttrSeq":"mainSequence","PushChangedAttrValFlag":"hasChangedAttributeInfo","SubKeySeq":"sequence","Val":"value","MsgGroupFromCardName":"senderNameCard","MsgGroupFromNickName":"senderNick","C2cNick":"peerNick","C2cImage":"peerAvatar"},"ignoreKeyWord":["C2C","ID","USP"]};function $i(V,$){if("string"!=typeof V&&!Array.isArray(V))throw new TypeError("Expected the input to be `string | string[]`");var z;return $=Object.assign({"pascalCase":!1},$),0===(V=Array.isArray(V)?V.map((function(V){return V.trim()})).filter((function(V){return V.length})).join("-"):V.trim()).length?"":1===V.length?$.pascalCase?V.toUpperCase():V.toLowerCase():(V!==V.toLowerCase()&&(V=ru(V)),V=V.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(function(V,$){return $.toUpperCase()})).replace(/\d+(\w|$)/g,(function(V){return V.toUpperCase()})),z=V,$.pascalCase?z.charAt(0).toUpperCase()+z.slice(1):z)}var ru=function Wi(V){for(var $=!1,z=!1,X=!1,Z=0;Z=2e7&&V<3e7&&pe.HOST.setCurrent("SINGAPORE"),V>=3e7&&V<4e7&&pe.HOST.setCurrent("KOREA"),V>=4e7&&V<5e7&&pe.HOST.setCurrent("GERMANY")}},{"key":"_initConnection","value":function value(){un(pe.HOST.CURRENT.BACKUP)||""===this._url?this._url=pe.HOST.CURRENT.DEFAULT:this._url===pe.HOST.CURRENT.DEFAULT?this._url=pe.HOST.CURRENT.BACKUP:this._url===pe.HOST.CURRENT.BACKUP&&(this._url=pe.HOST.CURRENT.DEFAULT),this._connect(),this._nextPingTs=0}},{"key":"onCheckTimer","value":function value(V){V%1==0&&this._checkPromiseMap()}},{"key":"_checkPromiseMap","value":function value(){var V=this;0!==this._promiseMap.size&&this._promiseMap.forEach((function($,z){var X=$.reject,Z=$.timestamp;Date.now()-Z>=15e3&&(Zt.log("".concat(V._className,"._checkPromiseMap request timeout, delete requestID:").concat(z)),V._promiseMap.delete(z),X(new ns({"code":Do.NETWORK_TIMEOUT,"message":qo})),V._channelModule.onRequestTimeout(z))}))}},{"key":"onOpen","value":function value(V){this._onOpenTs=Date.now();var $=V.id;this._socketID=$,new ca("wsOnOpen").setMessage(z).setMessage("socketID:".concat($)).end();var z=Date.now()-this._startTs;Zt.log("".concat(this._className,"._onOpen cost ").concat(z," ms. socketID:").concat($)),V.id===this._socketID&&(this._readyState=su,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}},{"key":"onClose","value":function value(V){var $=new ca("wsOnClose"),z=V.id,X=V.e,Z="sourceSocketID:".concat(z," currentSocketID:").concat(this._socketID),ee=0;0!==this._onOpenTs&&(ee=Date.now()-this._onOpenTs),$.setMessage(ee).setMoreMessage(Z).setCode(X.code).end(),Zt.log("".concat(this._className,"._onClose code:").concat(X.code," reason:").concat(X.reason," ").concat(Z," onlineTime:").concat(ee)),z===this._socketID&&(this._readyState=cu,ee<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{"key":"onError","value":function value(V){var $=V.id,z=V.e,X="sourceSocketID:".concat($," currentSocketID:").concat(this._socketID);new ca("wsOnError").setMessage(z.errMsg||vn(z)).setMoreMessage(X).setLevel("error").end(),Zt.warn("".concat(this._className,"._onError"),z,X),$===this._socketID&&(this._readyState="",this._channelModule.onError())}},{"key":"onMessage","value":function value(V){var $;try{$=JSON.parse(V.data)}catch($){new ca("jsonParseError").setMessage(V.data).end()}if($&&$.head){var z=this._getRequestIDFromHead($.head),X=ht($.head),Z=zi($.body,this._getResponseKeyMap(X));if(Zt.debug("".concat(this._className,".onMessage ret:").concat(JSON.stringify(Z)," requestID:").concat(z," has:").concat(this._promiseMap.has(z))),this._setNextPingTs(),this._promiseMap.has(z)){var ee=this._promiseMap.get(z),ae=ee.resolve,ie=ee.reject,ce=ee.timestamp;return this._promiseMap.delete(z),this._calcRTT(ce),void(Z.errorCode&&0!==Z.errorCode?(this._channelModule.onErrorCodeNotZero(Z),ie(new ns({"code":Z.errorCode,"message":Z.errorInfo||""}))):ae(Ni(Z)))}this._channelModule.onMessage({"head":$.head,"body":Z})}}},{"key":"_calcRTT","value":function value(V){var $=Date.now()-V;this._channelModule.getModule(mr).addRTT($)}},{"key":"_connect","value":function value(){new ca("wsConnect").setMessage("url:".concat(this.getURL())).end(),Zt.log("".concat(this._className,"._connect url:").concat(this.getURL())),this._startTs=Date.now(),this._socket=new ou(this),this._socketID=this._socket.getID(),this._readyState=uu}},{"key":"getURL","value":function value(){var V=this._channelModule.getModule(nr);return"".concat(this._url,"/info?sdkappid=").concat(V.getSDKAppID(),"&instanceid=").concat(V.getInstanceID(),"&random=").concat(this._getRandom())}},{"key":"_closeConnection","value":function value(V){Zt.log("".concat(this._className,"._closeConnection")),this._socket&&(this._socket.close(V),this._socketID=-1,this._socket=null,this._readyState=cu)}},{"key":"_resend","value":function value(){var V=this;if(Zt.log("".concat(this._className,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach((function($,z){var X=$.uplinkData,Z=$.resolve,ee=$.reject;V._promiseMap.set(z,{"resolve":Z,"reject":ee,"timestamp":Date.now(),"uplinkData":X}),V._execute(z,X)})),this._simpleRequestMap.size>0){var $,z=k(this._simpleRequestMap);try{for(z.s();!($=z.n()).done;){var X=m($.value,2),Z=X[0],ee=X[1];this._execute(Z,ee)}}catch(V){z.e(V)}finally{z.f()}this._simpleRequestMap.clear()}}},{"key":"send","value":function value(V){var $=this;V.head.seq=this._getSequence(),V.head.reqtime=Math.floor(Date.now()/1e3),V.keyMap;var z=g(V,au),X=this._getRequestIDFromHead(V.head),Z=JSON.stringify(z);return new Promise((function(V,ee){$._promiseMap.set(X,{"resolve":V,"reject":ee,"timestamp":Date.now(),"uplinkData":Z}),Zt.debug("".concat($._className,".send uplinkData:").concat(JSON.stringify(z)," requestID:").concat(X," readyState:").concat($._readyState)),$._readyState!==su?$._reConnect():($._execute(X,Z),$._channelModule.getModule(mr).addRequestCount())}))}},{"key":"simplySend","value":function value(V){V.head.seq=this._getSequence(),V.head.reqtime=Math.floor(Date.now()/1e3),V.keyMap;var $=g(V,iu),z=this._getRequestIDFromHead(V.head),X=JSON.stringify($);this._readyState!==su?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(V)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{"key":"onErrorCodeNotZero","value":function value(V){this.getModule(lr).onErrorCodeNotZero(V)}},{"key":"onMessage","value":function value(V){this.getModule(lr).onMessage(V)}},{"key":"send","value":function value(V){return this._socketHandler?this._previousState!==$.NET_STATE_CONNECTED&&V.head.servcmd.includes(So)?this._sendLogViaHTTP(V):this._socketHandler.send(V):Promise.reject()}},{"key":"_sendLogViaHTTP","value":function value(V){return new Promise((function($,z){var X="https://webim.tim.qq.com/v4/imopenstat/tim_web_report_v2?sdkappid=".concat(V.head.sdkappid,"&reqtime=").concat(Date.now()),Z=JSON.stringify(V.body),ee="application/x-www-form-urlencoded;charset=UTF-8";if(Mt)Tt.request({"url":X,"data":Z,"method":"POST","timeout":3e3,"header":{"content-type":ee},"success":function success(){$()},"fail":function fail(){z(new ns({"code":Do.NETWORK_ERROR,"message":jo}))}});else{var ae=new XMLHttpRequest,ie=setTimeout((function(){ae.abort(),z(new ns({"code":Do.NETWORK_TIMEOUT,"message":qo}))}),3e3);ae.onreadystatechange=function(){4===ae.readyState&&(clearTimeout(ie),200===ae.status||304===ae.status?$():z(new ns({"code":Do.NETWORK_ERROR,"message":jo})))},ae.open("POST",X,!0),ae.setRequestHeader("Content-type",ee),ae.send(Z)}}))}},{"key":"simplySend","value":function value(V){return this._socketHandler?this._socketHandler.simplySend(V):Promise.reject()}},{"key":"onOpen","value":function value(){this._ping()}},{"key":"onClose","value":function value(){this.reConnect()}},{"key":"onError","value":function value(){Mt&&Zt.error("".concat(this._className,".onError 从v2.11.2起,SDK 支持了 WebSocket,如您未添加相关受信域名,请先添加!升级指引: https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-02-upgradeguideline.html"))}},{"key":"getKeyMap","value":function value(V){return this.getModule(lr).getKeyMap(V)}},{"key":"_onAppHide","value":function value(){this._isAppShowing=!1}},{"key":"_onAppShow","value":function value(){this._isAppShowing=!0}},{"key":"onRequestTimeout","value":function value(V){}},{"key":"onReconnected","value":function value(){Zt.log("".concat(this._className,".onReconnected")),this.getModule(lr).onReconnected(),this._emitNetStateChangeEvent($.NET_STATE_CONNECTED)}},{"key":"onReconnectFailed","value":function value(){Zt.log("".concat(this._className,".onReconnectFailed")),this._emitNetStateChangeEvent($.NET_STATE_DISCONNECTED)}},{"key":"reConnect","value":function value(){if(!this._fatalErrorFlag&&this._socketHandler){var V=this._socketHandler.getReconnectFlag();if(Zt.log("".concat(this._className,".reConnect previousState:").concat(this._previousState," reconnectFlag:").concat(V)),this._previousState===$.NET_STATE_CONNECTING&&V)return;this._socketHandler.forcedReconnect(),this._emitNetStateChangeEvent($.NET_STATE_CONNECTING)}}},{"key":"_emitNetStateChangeEvent","value":function value($){this._previousState!==$&&(this._previousState=$,this.emitOuterEvent(V.NET_STATE_CHANGE,{"state":$}))}},{"key":"_ping","value":function value(){var V=this;if(!0!==this._probing){this._probing=!0;var z=this.getModule(lr).getProtocolData({"protocolName":To});this.send(z).then((function(){V._probing=!1})).catch((function(z){if(Zt.warn("".concat(V._className,"._ping failed. error:"),z),V._probing=!1,z&&60002===z.code)return new ca(va).setMessage("code:".concat(z.code," message:").concat(z.message)).setNetworkType(V.getModule(ar).getNetworkType()).end(),V._fatalErrorFlag=!0,void V._emitNetStateChangeEvent($.NET_STATE_DISCONNECTED);V.probeNetwork().then((function(z){var X=m(z,2),Z=X[0],ee=X[1];Zt.log("".concat(V._className,"._ping failed. isAppShowing:").concat(V._isAppShowing," online:").concat(Z," networkType:").concat(ee)),Z?V.reConnect():V._emitNetStateChangeEvent($.NET_STATE_DISCONNECTED)}))}))}}},{"key":"_checkNextPing","value":function value(){this._socketHandler&&this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping()}},{"key":"dealloc","value":function value(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._previousState=$.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),n}(vr),pu=["a2","tinyid"],fu=["a2","tinyid"],hu=function(){function e(V){o(this,e),this._className="ProtocolHandler",this._sessionModule=V,this._configMap=new Map,this._fillConfigMap()}return s(e,[{"key":"_fillConfigMap","value":function value(){this._configMap.clear();var V=this._sessionModule.genCommonHead(),$=this._sessionModule.genCosSpecifiedHead(),z=this._sessionModule.genSSOReportHead();this._configMap.set(yr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_STATUS,".").concat(pe.CMD.LOGIN)}),"body":{"state":"Online"},"keyMap":{"response":{"TinyId":"tinyID","InstId":"instanceID","HelloInterval":"helloInterval"}}}}(V)),this._configMap.set(_r,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_STATUS,".").concat(pe.CMD.LOGOUT)}),"body":{"type":0},"keyMap":{"request":{"type":"wslogout_type"}}}}(V)),this._configMap.set(br,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_STATUS,".").concat(pe.CMD.HELLO)}),"body":{},"keyMap":{"response":{"NewInstInfo":"newInstanceInfo"}}}}(V)),this._configMap.set("cos",function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_COS_SIGN,".").concat(pe.CMD.COS_SIGN)}),"body":{"cmd":"open_im_cos_svc","subCmd":"get_cos_token","duration":300,"version":2},"keyMap":{"request":{"userSig":"usersig","subCmd":"sub_cmd","cmd":"cmd","duration":"duration","version":"version"},"response":{"expired_time":"expiredTime","bucket_name":"bucketName","session_token":"sessionToken","tmp_secret_id":"secretId","tmp_secret_key":"secretKey"}}}}($)),this._configMap.set(Mo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.CUSTOM_UPLOAD,".").concat(pe.CMD.COS_PRE_SIG)}),"body":{"fileType":void 0,"fileName":void 0,"uploadMethod":0,"duration":900},"keyMap":{"request":{"userSig":"usersig","fileType":"file_type","fileName":"file_name","uploadMethod":"upload_method"},"response":{"expired_time":"expiredTime","request_id":"requestId","head_url":"headUrl","upload_url":"uploadUrl","download_url":"downloadUrl","ci_url":"ciUrl"}}}}($)),this._configMap.set(Co,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.CLOUD_CONTROL,".").concat(pe.CMD.FETCH_CLOUD_CONTROL_CONFIG)}),"body":{"SDKAppID":0,"version":0},"keyMap":{"request":{"SDKAppID":"uint32_sdkappid","version":"uint64_version"},"response":{"int32_error_code":"errorCode","str_error_message":"errorMessage","str_json_config":"cloudControlConfig","uint32_expired_time":"expiredTime","uint32_sdkappid":"SDKAppID","uint64_version":"version"}}}}(V)),this._configMap.set(wo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.CLOUD_CONTROL,".").concat(pe.CMD.PUSHED_CLOUD_CONTROL_CONFIG)}),"body":{},"keyMap":{"response":{"int32_error_code":"errorCode","str_error_message":"errorMessage","str_json_config":"cloudControlConfig","uint32_expired_time":"expiredTime","uint32_sdkappid":"SDKAppID","uint64_version":"version"}}}}(V)),this._configMap.set(Ar,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.GET_MESSAGES)}),"body":{"cookie":"","syncFlag":0,"needAbstract":1,"isOnlineSync":0},"keyMap":{"request":{"fromAccount":"From_Account","toAccount":"To_Account","from":"From_Account","to":"To_Account","time":"MsgTimeStamp","sequence":"MsgSeq","random":"MsgRandom","elements":"MsgBody"},"response":{"MsgList":"messageList","SyncFlag":"syncFlag","To_Account":"to","From_Account":"from","ClientSeq":"clientSequence","MsgSeq":"sequence","NoticeSeq":"noticeSequence","NotifySeq":"notifySequence","MsgRandom":"random","MsgTimeStamp":"time","MsgContent":"content","ToGroupId":"groupID","MsgKey":"messageKey","GroupTips":"groupTips","MsgBody":"elements","MsgType":"type","C2CRemainingUnreadCount":"C2CRemainingUnreadList","C2CPairUnreadCount":"C2CPairUnreadList"}}}}(V)),this._configMap.set(Mr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.BIG_DATA_HALLWAY_AUTH_KEY)}),"body":{}}}(V)),this._configMap.set(Sr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.SEND_MESSAGE)}),"body":{"fromAccount":"","toAccount":"","msgTimeStamp":void 0,"msgSeq":0,"msgRandom":0,"msgBody":[],"cloudCustomData":void 0,"nick":"","avatar":"","msgLifeTime":void 0,"offlinePushInfo":{"pushFlag":0,"title":"","desc":"","ext":"","apnsInfo":{"badgeMode":0},"androidInfo":{"OPPOChannelID":""}}},"keyMap":{"request":{"fromAccount":"From_Account","toAccount":"To_Account","msgTimeStamp":"MsgTimeStamp","msgSeq":"MsgSeq","msgRandom":"MsgRandom","msgBody":"MsgBody","count":"MaxCnt","lastMessageTime":"LastMsgTime","messageKey":"MsgKey","peerAccount":"Peer_Account","data":"Data","description":"Desc","extension":"Ext","type":"MsgType","content":"MsgContent","sizeType":"Type","uuid":"UUID","url":"","imageUrl":"URL","fileUrl":"Url","remoteAudioUrl":"Url","remoteVideoUrl":"VideoUrl","thumbUUID":"ThumbUUID","videoUUID":"VideoUUID","videoUrl":"","downloadFlag":"Download_Flag","nick":"From_AccountNick","avatar":"From_AccountHeadurl","from":"From_Account","time":"MsgTimeStamp","messageRandom":"MsgRandom","messageSequence":"MsgSeq","elements":"MsgBody","clientSequence":"ClientSeq","payload":"MsgContent","messageList":"MsgList","messageNumber":"MsgNum","abstractList":"AbstractList","messageBody":"MsgBody"}}}}(V)),this._configMap.set(Tr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.SEND_GROUP_MESSAGE)}),"body":{"fromAccount":"","groupID":"","random":0,"clientSequence":0,"priority":"","msgBody":[],"cloudCustomData":void 0,"onlineOnlyFlag":0,"offlinePushInfo":{"pushFlag":0,"title":"","desc":"","ext":"","apnsInfo":{"badgeMode":0},"androidInfo":{"OPPOChannelID":""}},"groupAtInfo":[]},"keyMap":{"request":{"to":"GroupId","extension":"Ext","data":"Data","description":"Desc","random":"Random","sequence":"ReqMsgSeq","count":"ReqMsgNumber","type":"MsgType","priority":"MsgPriority","content":"MsgContent","elements":"MsgBody","sizeType":"Type","uuid":"UUID","url":"","imageUrl":"URL","fileUrl":"Url","remoteAudioUrl":"Url","remoteVideoUrl":"VideoUrl","thumbUUID":"ThumbUUID","videoUUID":"VideoUUID","videoUrl":"","downloadFlag":"Download_Flag","clientSequence":"ClientSeq","from":"From_Account","time":"MsgTimeStamp","messageRandom":"MsgRandom","messageSequence":"MsgSeq","payload":"MsgContent","messageList":"MsgList","messageNumber":"MsgNum","abstractList":"AbstractList","messageBody":"MsgBody"},"response":{"MsgTime":"time","MsgSeq":"sequence"}}}}(V)),this._configMap.set(Dr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.REVOKE_C2C_MESSAGE)}),"body":{"msgInfo":{"fromAccount":"","toAccount":"","msgTimeStamp":0,"msgSeq":0,"msgRandom":0}},"keyMap":{"request":{"msgInfo":"MsgInfo","msgTimeStamp":"MsgTimeStamp","msgSeq":"MsgSeq","msgRandom":"MsgRandom"}}}}(V)),this._configMap.set(to,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.REVOKE_GROUP_MESSAGE)}),"body":{"to":"","msgSeqList":void 0},"keyMap":{"request":{"to":"GroupId","msgSeqList":"MsgSeqList","msgSeq":"MsgSeq"}}}}(V)),this._configMap.set(Nr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.GET_C2C_ROAM_MESSAGES)}),"body":{"peerAccount":"","count":15,"lastMessageTime":0,"messageKey":"","withRecalledMessage":1},"keyMap":{"request":{"messageKey":"MsgKey","peerAccount":"Peer_Account","count":"MaxCnt","lastMessageTime":"LastMsgTime","withRecalledMessage":"WithRecalledMsg"},"response":{"LastMsgTime":"lastMessageTime"}}}}(V)),this._configMap.set(ro,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_GROUP_ROAM_MESSAGES)}),"body":{"withRecalledMsg":1,"groupID":"","count":15,"sequence":""},"keyMap":{"request":{"sequence":"ReqMsgSeq","count":"ReqMsgNumber","withRecalledMessage":"WithRecalledMsg"},"response":{"Random":"random","MsgTime":"time","MsgSeq":"sequence","ReqMsgSeq":"sequence","RspMsgList":"messageList","IsPlaceMsg":"isPlaceMessage","IsSystemMsg":"isSystemMessage","ToGroupId":"to","EnumFrom_AccountType":"fromAccountType","EnumTo_AccountType":"toAccountType","GroupCode":"groupCode","MsgPriority":"priority","MsgBody":"elements","MsgType":"type","MsgContent":"content","IsFinished":"complete","Download_Flag":"downloadFlag","ClientSeq":"clientSequence","ThumbUUID":"thumbUUID","VideoUUID":"videoUUID"}}}}(V)),this._configMap.set(Or,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.SET_C2C_MESSAGE_READ)}),"body":{"C2CMsgReaded":void 0},"keyMap":{"request":{"lastMessageTime":"LastedMsgTime"}}}}(V)),this._configMap.set(no,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.SET_GROUP_MESSAGE_READ)}),"body":{"groupID":void 0,"messageReadSeq":void 0},"keyMap":{"request":{"messageReadSeq":"MsgReadedSeq"}}}}(V)),this._configMap.set(Rr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.DELETE_C2C_MESSAGE)}),"body":{"fromAccount":"","to":"","keyList":void 0},"keyMap":{"request":{"keyList":"MsgKeyList"}}}}(V)),this._configMap.set(co,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.DELETE_GROUP_MESSAGE)}),"body":{"groupID":"","deleter":"","keyList":void 0},"keyMap":{"request":{"deleter":"Deleter_Account","keyList":"Seqs"}}}}(V)),this._configMap.set(Pr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.GET_PEER_READ_TIME)}),"body":{"userIDList":void 0},"keyMap":{"request":{"userIDList":"To_Account"},"response":{"ReadTime":"peerReadTimeList"}}}}(V)),this._configMap.set("get",function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.RECENT_CONTACT,".").concat(pe.CMD.GET_CONVERSATION_LIST)}),"body":{"fromAccount":void 0,"count":0},"keyMap":{"request":{},"response":{"SessionItem":"conversations","ToAccount":"groupID","To_Account":"userID","UnreadMsgCount":"unreadCount","MsgGroupReadedSeq":"messageReadSeq","C2cPeerReadTime":"c2cPeerReadTime"}}}}(V)),this._configMap.set(Gr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.RECENT_CONTACT,".").concat(pe.CMD.PAGING_GET_CONVERSATION_LIST)}),"body":{"fromAccount":void 0,"timeStamp":void 0,"startIndex":void 0,"pinnedTimeStamp":void 0,"pinnedStartIndex":void 0,"orderType":void 0,"messageAssistFlag":4,"assistFlag":7},"keyMap":{"request":{"messageAssistFlag":"MsgAssistFlags","assistFlag":"AssistFlags","pinnedTimeStamp":"TopTimeStamp","pinnedStartIndex":"TopStartIndex"},"response":{"SessionItem":"conversations","ToAccount":"groupID","To_Account":"userID","UnreadMsgCount":"unreadCount","MsgGroupReadedSeq":"messageReadSeq","C2cPeerReadTime":"c2cPeerReadTime","LastMsgFlags":"lastMessageFlag","TopFlags":"isPinned","TopTimeStamp":"pinnedTimeStamp","TopStartIndex":"pinnedStartIndex"}}}}(V)),this._configMap.set(xr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.RECENT_CONTACT,".").concat(pe.CMD.DELETE_CONVERSATION)}),"body":{"fromAccount":"","toAccount":void 0,"type":1,"toGroupID":void 0},"keyMap":{"request":{"toGroupID":"ToGroupid"}}}}(V)),this._configMap.set("top",function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.RECENT_CONTACT,".").concat(pe.CMD.PIN_CONVERSATION)}),"body":{"fromAccount":"","operationType":1,"itemList":void 0},"keyMap":{"request":{"itemList":"RecentContactItem"}}}}(V)),this._configMap.set(Ur,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.DELETE_GROUP_AT_TIPS)}),"body":{"messageListToDelete":void 0},"keyMap":{"request":{"messageListToDelete":"DelMsgList","messageSeq":"MsgSeq","messageRandom":"MsgRandom"}}}}(V)),this._configMap.set(Ir,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.PROFILE,".").concat(pe.CMD.PORTRAIT_GET)}),"body":{"fromAccount":"","userItem":[]},"keyMap":{"request":{"toAccount":"To_Account","standardSequence":"StandardSequence","customSequence":"CustomSequence"}}}}(V)),this._configMap.set(kr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.PROFILE,".").concat(pe.CMD.PORTRAIT_SET)}),"body":{"fromAccount":"","profileItem":[{"tag":ba.NICK,"value":""},{"tag":ba.GENDER,"value":""},{"tag":ba.ALLOWTYPE,"value":""},{"tag":ba.AVATAR,"value":""}]},"keyMap":{"request":{"toAccount":"To_Account","standardSequence":"StandardSequence","customSequence":"CustomSequence"}}}}(V)),this._configMap.set(Er,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.FRIEND,".").concat(pe.CMD.GET_BLACKLIST)}),"body":{"fromAccount":"","startIndex":0,"maxLimited":30,"lastSequence":0},"keyMap":{"response":{"CurruentSequence":"currentSequence"}}}}(V)),this._configMap.set(Cr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.FRIEND,".").concat(pe.CMD.ADD_BLACKLIST)}),"body":{"fromAccount":"","toAccount":[]}}}(V)),this._configMap.set(wr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.FRIEND,".").concat(pe.CMD.DELETE_BLACKLIST)}),"body":{"fromAccount":"","toAccount":[]}}}(V)),this._configMap.set(Br,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_JOINED_GROUPS)}),"body":{"memberAccount":"","limit":void 0,"offset":void 0,"groupType":void 0,"responseFilter":{"groupBaseInfoFilter":void 0,"selfInfoFilter":void 0}},"keyMap":{"request":{"memberAccount":"Member_Account"},"response":{"GroupIdList":"groups","MsgFlag":"messageRemindType"}}}}(V)),this._configMap.set(jr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_GROUP_INFO)}),"body":{"groupIDList":void 0,"responseFilter":{"groupBaseInfoFilter":["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],"groupCustomFieldFilter":void 0,"memberInfoFilter":void 0,"memberCustomFieldFilter":void 0}},"keyMap":{"request":{"groupIDList":"GroupIdList","groupCustomField":"AppDefinedData","memberCustomField":"AppMemberDefinedData","groupCustomFieldFilter":"AppDefinedDataFilter_Group","memberCustomFieldFilter":"AppDefinedDataFilter_GroupMember"},"response":{"GroupIdList":"groups","MsgFlag":"messageRemindType","AppDefinedData":"groupCustomField","AppMemberDefinedData":"memberCustomField","AppDefinedDataFilter_Group":"groupCustomFieldFilter","AppDefinedDataFilter_GroupMember":"memberCustomFieldFilter","InfoSeq":"infoSequence","MemberList":"members","GroupInfo":"groups","ShutUpUntil":"muteUntil","ShutUpAllMember":"muteAllMembers","ApplyJoinOption":"joinOption"}}}}(V)),this._configMap.set(Hr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.CREATE_GROUP)}),"body":{"type":void 0,"name":void 0,"groupID":void 0,"ownerID":void 0,"introduction":void 0,"notification":void 0,"maxMemberNum":void 0,"joinOption":void 0,"memberList":void 0,"groupCustomField":void 0,"memberCustomField":void 0,"webPushFlag":1,"avatar":"FaceUrl"},"keyMap":{"request":{"ownerID":"Owner_Account","userID":"Member_Account","avatar":"FaceUrl","maxMemberNum":"MaxMemberCount","joinOption":"ApplyJoinOption","groupCustomField":"AppDefinedData","memberCustomField":"AppMemberDefinedData"},"response":{"HugeGroupFlag":"avChatRoomFlag","OverJoinedGroupLimit_Account":"overLimitUserIDList"}}}}(V)),this._configMap.set(Kr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.DESTROY_GROUP)}),"body":{"groupID":void 0}}}(V)),this._configMap.set(Qr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.MODIFY_GROUP_INFO)}),"body":{"groupID":void 0,"name":void 0,"introduction":void 0,"notification":void 0,"avatar":void 0,"maxMemberNum":void 0,"joinOption":void 0,"groupCustomField":void 0,"muteAllMembers":void 0},"keyMap":{"request":{"maxMemberNum":"MaxMemberCount","groupCustomField":"AppDefinedData","muteAllMembers":"ShutUpAllMember","joinOption":"ApplyJoinOption","avatar":"FaceUrl"},"response":{"AppDefinedData":"groupCustomField","ShutUpAllMember":"muteAllMembers","ApplyJoinOption":"joinOption"}}}}(V)),this._configMap.set(zr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.APPLY_JOIN_GROUP)}),"body":{"groupID":void 0,"applyMessage":void 0,"userDefinedField":void 0,"webPushFlag":1},"keyMap":{"request":{"applyMessage":"ApplyMsg"},"response":{"HugeGroupFlag":"avChatRoomFlag","AVChatRoomKey":"avChatRoomKey"}}}}(V)),this._configMap.set(Wr,function(V){return V.a2,V.tinyid,{"head":t(t({},g(V,pu)),{},{"servcmd":"".concat(pe.NAME.BIG_GROUP_NO_AUTH,".").concat(pe.CMD.APPLY_JOIN_GROUP)}),"body":{"groupID":void 0,"applyMessage":void 0,"userDefinedField":void 0,"webPushFlag":1},"keyMap":{"request":{"applyMessage":"ApplyMsg"},"response":{"HugeGroupFlag":"avChatRoomFlag"}}}}(V)),this._configMap.set(Yr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.QUIT_GROUP)}),"body":{"groupID":void 0}}}(V)),this._configMap.set(Xr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.SEARCH_GROUP_BY_ID)}),"body":{"groupIDList":void 0,"responseFilter":{"groupBasePublicInfoFilter":["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption"]}},"keyMap":{"response":{"ApplyJoinOption":"joinOption"}}}}(V)),this._configMap.set(Jr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.CHANGE_GROUP_OWNER)}),"body":{"groupID":void 0,"newOwnerID":void 0},"keyMap":{"request":{"newOwnerID":"NewOwner_Account"}}}}(V)),this._configMap.set(Zr,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.HANDLE_APPLY_JOIN_GROUP)}),"body":{"groupID":void 0,"applicant":void 0,"handleAction":void 0,"handleMessage":void 0,"authentication":void 0,"messageKey":void 0,"userDefinedField":void 0},"keyMap":{"request":{"applicant":"Applicant_Account","handleAction":"HandleMsg","handleMessage":"ApprovalMsg","messageKey":"MsgKey"}}}}(V)),this._configMap.set(eo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.HANDLE_GROUP_INVITATION)}),"body":{"groupID":void 0,"inviter":void 0,"handleAction":void 0,"handleMessage":void 0,"authentication":void 0,"messageKey":void 0,"userDefinedField":void 0},"keyMap":{"request":{"inviter":"Inviter_Account","handleAction":"HandleMsg","handleMessage":"ApprovalMsg","messageKey":"MsgKey"}}}}(V)),this._configMap.set(oo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_GROUP_APPLICATION)}),"body":{"startTime":void 0,"limit":void 0,"handleAccount":void 0},"keyMap":{"request":{"handleAccount":"Handle_Account"}}}}(V)),this._configMap.set(ao,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.DELETE_GROUP_SYSTEM_MESSAGE)}),"body":{"messageListToDelete":void 0},"keyMap":{"request":{"messageListToDelete":"DelMsgList","messageSeq":"MsgSeq","messageRandom":"MsgRandom"}}}}(V)),this._configMap.set(io,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.BIG_GROUP_LONG_POLLING,".").concat(pe.CMD.AVCHATROOM_LONG_POLL)}),"body":{"USP":1,"startSeq":1,"holdTime":90,"key":void 0},"keyMap":{"request":{"USP":"USP"},"response":{"ToGroupId":"groupID"}}}}(V)),this._configMap.set(so,function(V){return V.a2,V.tinyid,{"head":t(t({},g(V,fu)),{},{"servcmd":"".concat(pe.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(pe.CMD.AVCHATROOM_LONG_POLL)}),"body":{"USP":1,"startSeq":1,"holdTime":90,"key":void 0},"keyMap":{"request":{"USP":"USP"},"response":{"ToGroupId":"groupID"}}}}(V)),this._configMap.set(uo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_ONLINE_MEMBER_NUM)}),"body":{"groupID":void 0}}}(V)),this._configMap.set(lo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.SET_GROUP_ATTRIBUTES)}),"body":{"groupID":void 0,"groupAttributeList":void 0,"mainSequence":void 0,"avChatRoomKey":void 0,"attributeControl":["RaceConflict"]},"keyMap":{"request":{"key":"key","value":"value"}}}}(V)),this._configMap.set(po,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.MODIFY_GROUP_ATTRIBUTES)}),"body":{"groupID":void 0,"groupAttributeList":void 0,"mainSequence":void 0,"avChatRoomKey":void 0,"attributeControl":["RaceConflict"]},"keyMap":{"request":{"key":"key","value":"value"}}}}(V)),this._configMap.set(fo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.DELETE_GROUP_ATTRIBUTES)}),"body":{"groupID":void 0,"groupAttributeList":void 0,"mainSequence":void 0,"avChatRoomKey":void 0,"attributeControl":["RaceConflict"]},"keyMap":{"request":{"key":"key"}}}}(V)),this._configMap.set(ho,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.CLEAR_GROUP_ATTRIBUTES)}),"body":{"groupID":void 0,"mainSequence":void 0,"avChatRoomKey":void 0,"attributeControl":["RaceConflict"]}}}(V)),this._configMap.set(mo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP_ATTR,".").concat(pe.CMD.GET_GROUP_ATTRIBUTES)}),"body":{"groupID":void 0,"avChatRoomKey":void 0,"groupType":1},"keyMap":{"request":{"avChatRoomKey":"Key","groupType":"GroupType"}}}}(V)),this._configMap.set(vo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_GROUP_MEMBER_LIST)}),"body":{"groupID":void 0,"limit":0,"offset":0,"memberRoleFilter":void 0,"memberInfoFilter":["Role","NameCard","ShutUpUntil","JoinTime"],"memberCustomFieldFilter":void 0},"keyMap":{"request":{"memberCustomFieldFilter":"AppDefinedDataFilter_GroupMember"},"response":{"AppMemberDefinedData":"memberCustomField","AppDefinedDataFilter_GroupMember":"memberCustomFieldFilter","MemberList":"members","ShutUpUntil":"muteUntil"}}}}(V)),this._configMap.set(yo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.GET_GROUP_MEMBER_INFO)}),"body":{"groupID":void 0,"userIDList":void 0,"memberInfoFilter":void 0,"memberCustomFieldFilter":void 0},"keyMap":{"request":{"userIDList":"Member_List_Account","memberCustomFieldFilter":"AppDefinedDataFilter_GroupMember"},"response":{"MemberList":"members","ShutUpUntil":"muteUntil","AppDefinedDataFilter_GroupMember":"memberCustomFieldFilter","AppMemberDefinedData":"memberCustomField"}}}}(V)),this._configMap.set(_o,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.ADD_GROUP_MEMBER)}),"body":{"groupID":void 0,"silence":void 0,"userIDList":void 0},"keyMap":{"request":{"userID":"Member_Account","userIDList":"MemberList"},"response":{"MemberList":"members"}}}}(V)),this._configMap.set(bo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.DELETE_GROUP_MEMBER)}),"body":{"groupID":void 0,"userIDList":void 0,"reason":void 0},"keyMap":{"request":{"userIDList":"MemberToDel_Account"}}}}(V)),this._configMap.set(Ao,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.GROUP,".").concat(pe.CMD.MODIFY_GROUP_MEMBER_INFO)}),"body":{"groupID":void 0,"userID":void 0,"messageRemindType":void 0,"nameCard":void 0,"role":void 0,"memberCustomField":void 0,"muteTime":void 0},"keyMap":{"request":{"userID":"Member_Account","memberCustomField":"AppMemberDefinedData","muteTime":"ShutUpTime","messageRemindType":"MsgFlag"}}}}(V)),this._configMap.set(So,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_STAT,".").concat(pe.CMD.TIM_WEB_REPORT_V2)}),"body":{"header":{},"event":[],"quality":[]},"keyMap":{"request":{"SDKType":"sdk_type","SDKVersion":"sdk_version","deviceType":"device_type","platform":"platform","instanceID":"instance_id","traceID":"trace_id","SDKAppID":"sdk_app_id","userID":"user_id","tinyID":"tiny_id","extension":"extension","timestamp":"timestamp","networkType":"network_type","eventType":"event_type","code":"error_code","message":"error_message","moreMessage":"more_message","duplicate":"duplicate","costTime":"cost_time","level":"level","qualityType":"quality_type","reportIndex":"report_index","wholePeriod":"whole_period","totalCount":"total_count","rttCount":"success_count_business","successRateOfRequest":"percent_business","countLessThan1Second":"success_count_business","percentOfCountLessThan1Second":"percent_business","countLessThan3Second":"success_count_platform","percentOfCountLessThan3Second":"percent_platform","successCountOfBusiness":"success_count_business","successRateOfBusiness":"percent_business","successCountOfPlatform":"success_count_platform","successRateOfPlatform":"percent_platform","successCountOfMessageReceived":"success_count_business","successRateOfMessageReceived":"percent_business","avgRTT":"average_value","avgDelay":"average_value","avgValue":"average_value"}}}}(z)),this._configMap.set(To,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.HEARTBEAT,".").concat(pe.CMD.ALIVE)}),"body":{}}}(V)),this._configMap.set("msg_push",function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_PUSH,".").concat(pe.CMD.MESSAGE_PUSH)}),"body":{},"keyMap":{"response":{"C2cMsgArray":"C2CMessageArray","GroupMsgArray":"groupMessageArray","GroupTips":"groupTips","C2cNotifyMsgArray":"C2CNotifyMessageArray","ClientSeq":"clientSequence","MsgPriority":"priority","NoticeSeq":"noticeSequence","MsgContent":"content","MsgType":"type","MsgBody":"elements","ToGroupId":"to","Desc":"description","Ext":"extension","IsSyncMsg":"isSyncMessage","Flag":"needSync","NeedAck":"needAck","PendencyAdd_Account":"userID","ProfileImNick":"nick","PendencyType":"applicationType"}}}}(V)),this._configMap.set(Io,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.OPEN_IM,".").concat(pe.CMD.MESSAGE_PUSH_ACK)}),"body":{"sessionData":void 0},"keyMap":{"request":{"sessionData":"SessionData"}}}}(V)),this._configMap.set("stat_forceoffline",function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_OPEN_STATUS,".").concat(pe.CMD.STATUS_FORCEOFFLINE)}),"body":{},"keyMap":{"response":{"C2cNotifyMsgArray":"C2CNotifyMessageArray","NoticeSeq":"noticeSequence","KickoutMsgNotify":"kickoutMsgNotify","NewInstInfo":"newInstanceInfo"}}}}(V)),this._configMap.set(Eo,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_LONG_MESSAGE,".").concat(pe.CMD.DOWNLOAD_MERGER_MESSAGE)}),"body":{"downloadKey":""},"keyMap":{"response":{"Data":"data","Desc":"description","Ext":"extension","Download_Flag":"downloadFlag","ThumbUUID":"thumbUUID","VideoUUID":"videoUUID"}}}}(V)),this._configMap.set(ko,function(V){return{"head":t(t({},V),{},{"servcmd":"".concat(pe.NAME.IM_LONG_MESSAGE,".").concat(pe.CMD.UPLOAD_MERGER_MESSAGE)}),"body":{"messageList":[]},"keyMap":{"request":{"fromAccount":"From_Account","toAccount":"To_Account","msgTimeStamp":"MsgTimeStamp","msgSeq":"MsgSeq","msgRandom":"MsgRandom","msgBody":"MsgBody","type":"MsgType","content":"MsgContent","data":"Data","description":"Desc","extension":"Ext","sizeType":"Type","uuid":"UUID","url":"","imageUrl":"URL","fileUrl":"Url","remoteAudioUrl":"Url","remoteVideoUrl":"VideoUrl","thumbUUID":"ThumbUUID","videoUUID":"VideoUUID","videoUrl":"","downloadFlag":"Download_Flag","from":"From_Account","time":"MsgTimeStamp","messageRandom":"MsgRandom","messageSequence":"MsgSeq","elements":"MsgBody","clientSequence":"ClientSeq","payload":"MsgContent","messageList":"MsgList","messageNumber":"MsgNum","abstractList":"AbstractList","messageBody":"MsgBody"}}}}(V))}},{"key":"has","value":function value(V){return this._configMap.has(V)}},{"key":"get","value":function value(V){return this._configMap.get(V)}},{"key":"update","value":function value(){this._fillConfigMap()}},{"key":"getKeyMap","value":function value(V){return this.has(V)?this.get(V).keyMap||{}:(Zt.warn("".concat(this._className,".getKeyMap unknown protocolName:").concat(V)),{})}},{"key":"getProtocolData","value":function value(V){var $=V.protocolName,z=V.requestData,X=this.get($),Z=null;if(z){var ee=this._simpleDeepCopy(X),ae=ee.body,ie=Object.create(null);for(var ce in ae)if(Object.prototype.hasOwnProperty.call(ae,ce)){if(ie[ce]=ae[ce],void 0===z[ce])continue;ie[ce]=z[ce]}ee.body=ie,Z=this._getUplinkData(ee)}else Z=this._getUplinkData(X);return Z}},{"key":"_getUplinkData","value":function value(V){var $=this._requestDataCleaner(V),z=ht($.head),X=function Yi(V,$){var z=0;return function e(V,$){if(++z>100)return z--,V;if(sn(V)){var X=V.map((function(V){return on(V)?e(V,$):V}));return z--,X}if(on(V)){var Z=(ee=V,ae=function i(V,z){if(!fn(z))return!1;if((Z=z)!==$i(Z))for(var X=0;X=this._expiredTime}},{"key":"fetchConfig","value":function value(){var V=this,$=this._canFetchConfig();if(Zt.log("".concat(this._className,".fetchConfig canFetchConfig:").concat($)),$){var z=new ca("fetchCloudControlConfig"),X=this.getModule(nr).getSDKAppID();this._isFetching=!0,this.request({"protocolName":Co,"requestData":{"SDKAppID":X,"version":this._version}}).then((function($){V._isFetching=!1,z.setMessage("version:".concat(V._version," newVersion:").concat($.data.version," config:").concat($.data.cloudControlConfig)).setNetworkType(V.getNetworkType()).end(),Zt.log("".concat(V._className,".fetchConfig ok")),V._parseCloudControlConfig($.data)})).catch((function($){V._isFetching=!1,V.probeNetwork().then((function(V){var X=m(V,2),Z=X[0],ee=X[1];z.setError($,Z,ee).end()})),Zt.log("".concat(V._className,".fetchConfig failed. error:"),$),V._setExpiredTimeOnResponseError(12e4)}))}}},{"key":"onPushedCloudControlConfig","value":function value(V){Zt.log("".concat(this._className,".onPushedCloudControlConfig")),new ca("pushedCloudControlConfig").setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(V.version," config:").concat(V.cloudControlConfig)).end(),this._parseCloudControlConfig(V)}},{"key":"onCheckTimer","value":function value(V){this._canFetchConfig()&&this.fetchConfig()}},{"key":"_parseCloudControlConfig","value":function value(V){var $=this,z="".concat(this._className,"._parseCloudControlConfig"),X=V.errorCode,Z=V.errorMessage,ee=V.cloudControlConfig,ae=V.version,ie=V.expiredTime;if(0===X){if(this._version!==ae){var ce=null;try{ce=JSON.parse(ee)}catch(V){Zt.error("".concat(z," JSON parse error:").concat(ee))}ce&&(this._cloudConfig.clear(),Object.keys(ce).forEach((function(V){$._cloudConfig.set(V,ce[V])})),this._version=ae,this.emitInnerEvent(cs))}this._expiredTime=Date.now()+1e3*ie}else un(X)?(Zt.log("".concat(z," failed. Invalid message format:"),V),this._setExpiredTimeOnResponseError(36e5)):(Zt.error("".concat(z," errorCode:").concat(X," errorMessage:").concat(Z)),this._setExpiredTimeOnResponseError(12e4))}},{"key":"_setExpiredTimeOnResponseError","value":function value(V){this._expiredTime=Date.now()+V}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(vr),bu=function(V){i(n,V);var z=f(n);function n(V){var $;return o(this,n),($=z.call(this,V))._className="PullGroupMessageModule",$._remoteLastMessageSequenceMap=new Map,$.PULL_LIMIT_COUNT=15,$}return s(n,[{"key":"startPull","value":function value(){var V=this,z=this._getNeedPullConversationList();this._getRemoteLastMessageSequenceList().then((function(){var X=V.getModule(tr);z.forEach((function(z){var Z=z.conversationID,ee=Z.replace($.CONV_GROUP,""),ae=X.getGroupLocalLastMessageSequence(Z),ie=V._remoteLastMessageSequenceMap.get(ee)||0,ce=ie-ae;Zt.log("".concat(V._className,".startPull groupID:").concat(ee," localLastMessageSequence:").concat(ae," ")+"remoteLastMessageSequence:".concat(ie," diff:").concat(ce)),ae>0&&ce>=1&&ce<300&&V._pullMissingMessage({"groupID":ee,"localLastMessageSequence":ae,"remoteLastMessageSequence":ie,"diff":ce})}))}))}},{"key":"_getNeedPullConversationList","value":function value(){return this.getModule(tr).getLocalConversationList().filter((function(V){return V.type===$.CONV_GROUP&&V.groupProfile.type!==$.GRP_AVCHATROOM}))}},{"key":"_getRemoteLastMessageSequenceList","value":function value(){var V=this;return this.getModule(Jn).getGroupList().then((function(z){for(var X=z.data.groupList,Z=void 0===X?[]:X,ee=0;eethis.PULL_LIMIT_COUNT?this.PULL_LIMIT_COUNT:Z,V.sequence=Z>this.PULL_LIMIT_COUNT?z+this.PULL_LIMIT_COUNT:z+Z,this._getGroupMissingMessage(V).then((function(ee){ee.length>0&&(ee[0].sequence+1<=X&&(V.localLastMessageSequence=z+$.PULL_LIMIT_COUNT,V.diff=Z-$.PULL_LIMIT_COUNT,$._pullMissingMessage(V)),$.getModule(Jn).onNewGroupMessage({"dataList":ee,"isInstantMessage":!1}))}))}},{"key":"_getGroupMissingMessage","value":function value(V){var $=this,z=new ca("getGroupMissingMessage");return this.request({"protocolName":ro,"requestData":{"groupID":V.groupID,"count":V.count,"sequence":V.sequence}}).then((function(X){var Z=X.data.messageList,ee=void 0===Z?[]:Z;return z.setNetworkType($.getNetworkType()).setMessage("groupID:".concat(V.groupID," count:").concat(V.count," sequence:").concat(V.sequence," messageList length:").concat(ee.length)).end(),ee})).catch((function(V){$.probeNetwork().then((function($){var X=m($,2),Z=X[0],ee=X[1];z.setError(V,Z,ee).end()}))}))}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._remoteLastMessageSequenceMap.clear()}}]),n}(vr),Au=function(){function e(){o(this,e),this._className="AvgE2EDelay",this._e2eDelayArray=[]}return s(e,[{"key":"addMessageDelay","value":function value(V){var $=_t(V.currentTime/1e3-V.time,2);this._e2eDelayArray.push($)}},{"key":"_calcAvg","value":function value(V,$){if(0===$)return 0;var z=0;return V.forEach((function(V){z+=V})),_t(z/$,1)}},{"key":"_calcTotalCount","value":function value(){return this._e2eDelayArray.length}},{"key":"_calcCountWithLimit","value":function value(V){var $=V.e2eDelayArray,z=V.min,X=V.max;return $.filter((function(V){return z100&&(z=100),z}},{"key":"_checkE2EDelayException","value":function value(V,$){var z=V.filter((function(V){return V>$}));if(z.length>0){var X=z.length,Z=Math.min.apply(Math,M(z)),ee=Math.max.apply(Math,M(z)),ae=this._calcAvg(z,X),ie=_t(X/V.length*100,2);new ca("messageE2EDelayException").setMessage("message e2e delay exception. count:".concat(X," min:").concat(Z," max:").concat(ee," avg:").concat(ae," percent:").concat(ie)).setLevel("warning").end()}}},{"key":"getStatResult","value":function value(){var V=this._calcTotalCount();if(0===V)return null;var $=M(this._e2eDelayArray),z=this._calcCountWithLimit({"e2eDelayArray":$,"min":0,"max":1}),X=this._calcCountWithLimit({"e2eDelayArray":$,"min":1,"max":3}),Z=this._calcPercent(z,V),ee=this._calcPercent(X,V),ae=this._calcAvg($,V);return this._checkE2EDelayException($,3),this.reset(),{"totalCount":V,"countLessThan1Second":z,"percentOfCountLessThan1Second":Z,"countLessThan3Second":X,"percentOfCountLessThan3Second":ee,"avgDelay":ae}}},{"key":"reset","value":function value(){this._e2eDelayArray.length=0}}]),e}(),Mu=function(){function e(){o(this,e),this._className="AvgRTT",this._requestCount=0,this._rttArray=[]}return s(e,[{"key":"addRequestCount","value":function value(){this._requestCount+=1}},{"key":"addRTT","value":function value(V){this._rttArray.push(V)}},{"key":"_calcTotalCount","value":function value(){return this._requestCount}},{"key":"_calcRTTCount","value":function value(V){return V.length}},{"key":"_calcSuccessRateOfRequest","value":function value(V,$){if(0===$)return 0;var z=_t(V/$*100,2);return z>100&&(z=100),z}},{"key":"_calcAvg","value":function value(V,$){if(0===$)return 0;var z=0;return V.forEach((function(V){z+=V})),parseInt(z/$)}},{"key":"_calcMax","value":function value(){return Math.max.apply(Math,M(this._rttArray))}},{"key":"_calcMin","value":function value(){return Math.min.apply(Math,M(this._rttArray))}},{"key":"getStatResult","value":function value(){var V=this._calcTotalCount(),$=M(this._rttArray);if(0===V)return null;var z=this._calcRTTCount($),X=this._calcSuccessRateOfRequest(z,V),Z=this._calcAvg($,z);return Zt.log("".concat(this._className,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(Z)),this.reset(),{"totalCount":V,"rttCount":z,"successRateOfRequest":X,"avgRTT":Z}}},{"key":"reset","value":function value(){this._requestCount=0,this._rttArray.length=0}}]),e}(),Su=function(){function e(){o(this,e),this._map=new Map}return s(e,[{"key":"initMap","value":function value(V){var $=this;V.forEach((function(V){$._map.set(V,{"totalCount":0,"successCount":0,"failedCountOfUserSide":0,"costArray":[],"fileSizeArray":[]})}))}},{"key":"addTotalCount","value":function value(V){return!(un(V)||!this._map.has(V)||(this._map.get(V).totalCount+=1,0))}},{"key":"addSuccessCount","value":function value(V){return!(un(V)||!this._map.has(V)||(this._map.get(V).successCount+=1,0))}},{"key":"addFailedCountOfUserSide","value":function value(V){return!(un(V)||!this._map.has(V)||(this._map.get(V).failedCountOfUserSide+=1,0))}},{"key":"addCost","value":function value(V,$){return!(un(V)||!this._map.has(V)||(this._map.get(V).costArray.push($),0))}},{"key":"addFileSize","value":function value(V,$){return!(un(V)||!this._map.has(V)||(this._map.get(V).fileSizeArray.push($),0))}},{"key":"_calcSuccessRateOfBusiness","value":function value(V){if(un(V)||!this._map.has(V))return-1;var $=this._map.get(V),z=_t($.successCount/$.totalCount*100,2);return z>100&&(z=100),z}},{"key":"_calcSuccessRateOfPlatform","value":function value(V){if(un(V)||!this._map.has(V))return-1;var $=this._map.get(V),z=this._calcSuccessCountOfPlatform(V)/$.totalCount*100;return(z=_t(z,2))>100&&(z=100),z}},{"key":"_calcTotalCount","value":function value(V){return un(V)||!this._map.has(V)?-1:this._map.get(V).totalCount}},{"key":"_calcSuccessCountOfBusiness","value":function value(V){return un(V)||!this._map.has(V)?-1:this._map.get(V).successCount}},{"key":"_calcSuccessCountOfPlatform","value":function value(V){if(un(V)||!this._map.has(V))return-1;var $=this._map.get(V);return $.successCount+$.failedCountOfUserSide}},{"key":"_calcAvg","value":function value(V){return un(V)||!this._map.has(V)?-1:V===Jo?this._calcAvgSpeed(V):this._calcAvgCost(V)}},{"key":"_calcAvgCost","value":function value(V){var $=this._map.get(V).costArray.length;if(0===$)return 0;var z=0;return this._map.get(V).costArray.forEach((function(V){z+=V})),parseInt(z/$)}},{"key":"_calcAvgSpeed","value":function value(V){var $=0,z=0;return this._map.get(V).costArray.forEach((function(V){$+=V})),this._map.get(V).fileSizeArray.forEach((function(V){z+=V})),parseInt(1e3*z/$)}},{"key":"getStatResult","value":function value(V){var $=this._calcTotalCount(V);if(0===$)return null;var z=this._calcSuccessCountOfBusiness(V),X=this._calcSuccessRateOfBusiness(V),Z=this._calcSuccessCountOfPlatform(V),ee=this._calcSuccessRateOfPlatform(V),ae=this._calcAvg(V);return this.reset(V),{"totalCount":$,"successCountOfBusiness":z,"successRateOfBusiness":X,"successCountOfPlatform":Z,"successRateOfPlatform":ee,"avgValue":ae}}},{"key":"reset","value":function value(V){un(V)?this._map.clear():this._map.set(V,{"totalCount":0,"successCount":0,"failedCountOfUserSide":0,"costArray":[],"fileSizeArray":[]})}}]),e}(),Tu=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return s(e,[{"key":"initMap","value":function value(V){var $=this;V.forEach((function(V){$._lastMap.set(V,new Map),$._currentMap.set(V,new Map)}))}},{"key":"addMessageSequence","value":function value(V){var z=V.key,X=V.message;if(un(z)||!this._lastMap.has(z)||!this._currentMap.has(z))return!1;var Z=X.conversationID,ee=X.sequence,ae=Z.replace($.CONV_GROUP,"");if(0===this._lastMap.get(z).size)this._addCurrentMap(V);else if(this._lastMap.get(z).has(ae)){var ie=this._lastMap.get(z).get(ae),ce=ie.length-1;ee>ie[0]&&ee100&&(X=100),this._copyData(V),{"totalCount":$,"successCountOfMessageReceived":z,"successRateOfMessageReceived":X}}},{"key":"reset","value":function value(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),Iu=function(V){i(a,V);var $=f(a);function a(V){var z;o(this,a),(z=$.call(this,V))._className="QualityStatModule",z.TAG="im-ssolog-quality-stat",z.reportIndex=0,z.wholePeriod=!1,z._qualityItems=[Ko,Qo,zo,Wo,Yo,Xo,Jo,Zo,ea,na],z._messageSentItems=[zo,Wo,Yo,Xo,Jo],z._messageReceivedItems=[Zo,ea,na],z.REPORT_INTERVAL=120,z.REPORT_SDKAPPID_BLACKLIST=[],z.REPORT_TINYID_WHITELIST=[],z._statInfoArr=[],z._avgRTT=new Mu,z._avgE2EDelay=new Au,z._rateMessageSent=new Su,z._rateMessageReceived=new Tu;var X=z.getInnerEmitterInstance();return X.on(us,z._onLoginSuccess,h(z)),X.on(cs,z._onCloudConfigUpdated,h(z)),z}return s(a,[{"key":"_onLoginSuccess","value":function value(){var V=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var $=this.getModule(rr),z=$.getItem(this.TAG,!1);!vt(z)&&ln(z.forEach)&&(Zt.log("".concat(this._className,"._onLoginSuccess.get quality stat log in storage, nums=").concat(z.length)),z.forEach((function($){V._statInfoArr.push($)})),$.removeItem(this.TAG,!1))}},{"key":"_onCloudConfigUpdated","value":function value(){var V=this.getCloudConfig("q_rpt_interval"),$=this.getCloudConfig("q_rpt_sdkappid_bl"),z=this.getCloudConfig("q_rpt_tinyid_wl");un(V)||(this.REPORT_INTERVAL=Number(V)),un($)||(this.REPORT_SDKAPPID_BLACKLIST=$.split(",").map((function(V){return Number(V)}))),un(z)||(this.REPORT_TINYID_WHITELIST=z.split(","))}},{"key":"onCheckTimer","value":function value(V){this.isLoggedIn()&&V%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{"key":"addRequestCount","value":function value(){this._avgRTT.addRequestCount()}},{"key":"addRTT","value":function value(V){this._avgRTT.addRTT(V)}},{"key":"addMessageDelay","value":function value(V){this._avgE2EDelay.addMessageDelay(V)}},{"key":"addTotalCount","value":function value(V){this._rateMessageSent.addTotalCount(V)||Zt.warn("".concat(this._className,".addTotalCount invalid key:"),V)}},{"key":"addSuccessCount","value":function value(V){this._rateMessageSent.addSuccessCount(V)||Zt.warn("".concat(this._className,".addSuccessCount invalid key:"),V)}},{"key":"addFailedCountOfUserSide","value":function value(V){this._rateMessageSent.addFailedCountOfUserSide(V)||Zt.warn("".concat(this._className,".addFailedCountOfUserSide invalid key:"),V)}},{"key":"addCost","value":function value(V,$){this._rateMessageSent.addCost(V,$)||Zt.warn("".concat(this._className,".addCost invalid key or cost:"),V,$)}},{"key":"addFileSize","value":function value(V,$){this._rateMessageSent.addFileSize(V,$)||Zt.warn("".concat(this._className,".addFileSize invalid key or size:"),V,$)}},{"key":"addMessageSequence","value":function value(V){this._rateMessageReceived.addMessageSequence(V)||Zt.warn("".concat(this._className,".addMessageSequence invalid key:"),V.key)}},{"key":"_getQualityItem","value":function value(V){var $={},z=ia[this.getNetworkType()];un(z)&&(z=8);var X={"qualityType":ra[V],"timestamp":Wt(),"networkType":z,"extension":""};switch(V){case Ko:$=this._avgRTT.getStatResult();break;case Qo:$=this._avgE2EDelay.getStatResult();break;case zo:case Wo:case Yo:case Xo:case Jo:$=this._rateMessageSent.getStatResult(V);break;case Zo:case ea:case na:$=this._rateMessageReceived.getStatResult(V)}return null===$?null:t(t({},X),$)}},{"key":"_report","value":function value(V){var $=this,z=[],X=null;un(V)?this._qualityItems.forEach((function(V){null!==(X=$._getQualityItem(V))&&(X.reportIndex=$.reportIndex,X.wholePeriod=$.wholePeriod,z.push(X))})):null!==(X=this._getQualityItem(V))&&(X.reportIndex=this.reportIndex,X.wholePeriod=this.wholePeriod,z.push(X)),Zt.debug("".concat(this._className,"._report"),z),this._statInfoArr.length>0&&(z=z.concat(this._statInfoArr),this._statInfoArr=[]);var Z=this.getModule(nr),ee=Z.getSDKAppID(),ae=Z.getTinyID();ft(this.REPORT_SDKAPPID_BLACKLIST,ee)&&!mt(this.REPORT_TINYID_WHITELIST,ae)&&(z=[]),z.length>0&&this._doReport(z)}},{"key":"_doReport","value":function value(V){var $=this,z={"header":js(this),"quality":V};this.request({"protocolName":So,"requestData":t({},z)}).then((function(){$.reportIndex++,$.wholePeriod=!1})).catch((function(z){Zt.warn("".concat($._className,"._doReport, online:").concat($.getNetworkType()," error:"),z),$._statInfoArr=$._statInfoArr.concat(V),$._flushAtOnce()}))}},{"key":"_flushAtOnce","value":function value(){var V=this.getModule(rr),$=V.getItem(this.TAG,!1),z=this._statInfoArr;if(vt($))Zt.log("".concat(this._className,"._flushAtOnce count:").concat(z.length)),V.setItem(this.TAG,z,!0,!1);else{var X=z.concat($);X.length>10&&(X=X.slice(0,10)),Zt.log("".concat(this.className,"._flushAtOnce count:").concat(X.length)),V.setItem(this.TAG,X,!0,!1)}this._statInfoArr=[]}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),a}(vr),ku=function(V){i(n,V);var $=f(n);function n(V){var z;return o(this,n),(z=$.call(this,V))._className="WorkerModule",z._isWorkerEnabled=!1,z._workerTimer=null,z._init(),z.getInnerEmitterInstance().on(cs,z._onCloudConfigUpdated,h(z)),z}return s(n,[{"key":"isWorkerEnabled","value":function value(){return this._isWorkerEnabled&&qt&&this._workerTimer}},{"key":"startWorkerTimer","value":function value(){Zt.log("".concat(this._className,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{"key":"stopWorkerTimer","value":function value(){Zt.log("".concat(this._className,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{"key":"_init","value":function value(){if(qt){var V=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000) } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{"type":"application/javascript; charset=utf-8"}));this._workerTimer=new Worker(V);var $=this;this._workerTimer.onmessage=function(){$._moduleManager.onCheckTimer()}}}},{"key":"_onCloudConfigUpdated","value":function value(){"1"===this.getCloudConfig("enable_worker")?!this._isWorkerEnabled&&qt&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._moduleManager.onWorkerTimerEnabled()):this._isWorkerEnabled&&qt&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._moduleManager.onWorkerTimerDisabled())}},{"key":"terminate","value":function value(){Zt.log("".concat(this._className,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null)}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset"))}}]),n}(vr),Eu=function(){function e(V){o(this,e);var $=new ca("sdkConstruct");this._className="ModuleManager",this._isReady=!1,this._startLoginTs=0,this._moduleMap=new Map,this._innerEmitter=null,this._outerEmitter=null,this._checkCount=0,this._checkTimer=-1,this._moduleMap.set(nr,new xs(this,V)),this._moduleMap.set(fr,new _u(this)),this._moduleMap.set(hr,new ku(this)),this._moduleMap.set(mr,new Iu(this)),this._moduleMap.set(dr,new du(this)),this._moduleMap.set(lr,new vu(this)),this._moduleMap.set(zn,new Fs(this)),this._moduleMap.set(Wn,new Zs(this)),this._moduleMap.set(Yn,new Gs(this)),this._moduleMap.set(Xn,new is(this)),this._moduleMap.set(tr,new As(this)),this._moduleMap.set(Jn,new Ds(this)),this._moduleMap.set(er,new Ns(this)),this._moduleMap.set(rr,new Us(this)),this._moduleMap.set(or,new qs(this)),this._moduleMap.set(ar,new $s(this)),this._moduleMap.set(ir,new Qs(this)),this._moduleMap.set(sr,new zs(this)),this._moduleMap.set(ur,new eu(this)),this._moduleMap.set(cr,new tu(this)),this._moduleMap.set(pr,new yu(this)),this._moduleMap.set(gr,new bu(this));var z=V.instanceID,X=V.oversea,Z=V.SDKAppID,ee="instanceID:".concat(z," oversea:").concat(X," workerAvailable:").concat(qt," host:").concat(dt()," ")+"inBrowser:".concat(St," inMiniApp:").concat(Mt," SDKAppID:").concat(Z," UserAgent:").concat(Ct);ca.bindEventStatModule(this._moduleMap.get(or)),$.setMessage("".concat(ee)).end(),Zt.info("SDK ".concat(ee)),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}return s(e,[{"key":"_startTimer","value":function value(){var V=this._moduleMap.get(hr).isWorkerEnabled();Zt.log("".concat(this._className,".startTimer isWorkerEnabled:").concat(V," seed:").concat(this._checkTimer)),V?this._moduleMap.get(hr).startWorkerTimer():this._startMainThreadTimer()}},{"key":"_startMainThreadTimer","value":function value(){Zt.log("".concat(this._className,"._startMainThreadTimer")),this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3))}},{"key":"stopTimer","value":function value(){var V=this._moduleMap.get(hr).isWorkerEnabled();Zt.log("".concat(this._className,".stopTimer isWorkerEnabled:").concat(V," seed:").concat(this._checkTimer)),V?this._moduleMap.get(hr).stopWorkerTimer():this._stopMainThreadTimer()}},{"key":"_stopMainThreadTimer","value":function value(){Zt.log("".concat(this._className,"._stopMainThreadTimer")),this._checkTimer>0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{"key":"onWorkerTimerEnabled","value":function value(){Zt.log("".concat(this._className,".onWorkerTimerEnabled, disable main thread timer")),this._stopMainThreadTimer()}},{"key":"onWorkerTimerDisabled","value":function value(){Zt.log("".concat(this._className,".onWorkerTimerDisabled, enable main thread timer")),this._startMainThreadTimer()}},{"key":"onCheckTimer","value":function value(){this._checkCount+=1;var V,$=k(this._moduleMap);try{for($.s();!(V=$.n()).done;){var z=m(V.value,2)[1];z.onCheckTimer&&z.onCheckTimer(this._checkCount)}}catch(V){$.e(V)}finally{$.f()}}},{"key":"_initReadyList","value":function value(){var V=this;this._readyList=[this._moduleMap.get(zn),this._moduleMap.get(tr)],this._readyList.forEach((function($){$.ready((function(){return V._onModuleReady()}))}))}},{"key":"_onModuleReady","value":function value(){var $=!0;if(this._readyList.forEach((function(V){V.isReady()||($=!1)})),$&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(V.SDK_READY);var z=Date.now()-this._startLoginTs;Zt.warn("SDK is ready. cost ".concat(z," ms")),this._startLoginTs=Date.now();var X=this._moduleMap.get(ar).getNetworkType(),Z=this._ssoLogForReady.getStartTs()+zt;this._ssoLogForReady.setNetworkType(X).setMessage(z).start(Z).end()}}},{"key":"login","value":function value(){0===this._startLoginTs&&(Yt(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(ar).start(),this._ssoLogForReady=new ca("sdkReady"))}},{"key":"onLoginFailed","value":function value(){this._startLoginTs=0}},{"key":"getOuterEmitterInstance","value":function value(){return null===this._outerEmitter&&(this._outerEmitter=new Ks,function Fr(V){rs=V}(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(V,$){var z=[arguments[0],{"name":arguments[0],"data":arguments[1]}];this._outerEmitter._emit.apply(this._outerEmitter,z)}.bind(this)),this._outerEmitter}},{"key":"getInnerEmitterInstance","value":function value(){return null===this._innerEmitter&&(this._innerEmitter=new Ks,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(V,$){var z;an(arguments[1])&&arguments[1].data?(Zt.warn("inner eventData has data property, please check!"),z=[V,{"name":arguments[0],"data":arguments[1].data}]):z=[V,{"name":arguments[0],"data":arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,z)}.bind(this)),this._innerEmitter}},{"key":"hasModule","value":function value(V){return this._moduleMap.has(V)}},{"key":"getModule","value":function value(V){return this._moduleMap.get(V)}},{"key":"isReady","value":function value(){return this._isReady}},{"key":"onError","value":function value($){Zt.warn("Oops! code:".concat($.code," message:").concat($.message)),new ca(va).setMessage("code:".concat($.code," message:").concat($.message)).setNetworkType(this.getModule(ar).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(V.ERROR,$)}},{"key":"reset","value":function value(){Zt.log("".concat(this._className,".reset")),Yt();var $,z=k(this._moduleMap);try{for(z.s();!($=z.n()).done;){var X=m($.value,2)[1];X.reset&&X.reset()}}catch(V){z.e(V)}finally{z.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(V.SDK_NOT_READY)}}]),e}(),Cu=function(){function e(){o(this,e),this._funcMap=new Map}return s(e,[{"key":"defense","value":function value(V,$){var z=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof V)return null;if(0===V.length)return null;if("function"!=typeof $)return null;if(this._funcMap.has(V)&&this._funcMap.get(V).has($))return this._funcMap.get(V).get($);this._funcMap.has(V)||this._funcMap.set(V,new Map);var X=null;return this._funcMap.get(V).has($)?X=this._funcMap.get(V).get($):(X=this._pack(V,$,z),this._funcMap.get(V).set($,X)),X}},{"key":"defenseOnce","value":function value(V,$){var z=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return"function"!=typeof $?null:this._pack(V,$,z)}},{"key":"find","value":function value(V,$){return"string"!=typeof V||0===V.length||"function"!=typeof $?null:this._funcMap.has(V)?this._funcMap.get(V).has($)?this._funcMap.get(V).get($):(Zt.log("SafetyCallback.find: 找不到 func —— ".concat(V,"/").concat(""!==$.name?$.name:"[anonymous]")),null):(Zt.log("SafetyCallback.find: 找不到 eventName-".concat(V," 对应的 func")),null)}},{"key":"delete","value":function value(V,$){return"function"==typeof $&&!!this._funcMap.has(V)&&!!this._funcMap.get(V).has($)&&(this._funcMap.get(V).delete($),0===this._funcMap.get(V).size&&this._funcMap.delete(V),!0)}},{"key":"_pack","value":function value($,z,X){return function(){try{z.apply(X,Array.from(arguments))}catch(z){var Z=Object.values(V).indexOf($);if(-1!==Z){var ee=Object.keys(V)[Z];Zt.warn("接入侧事件 TIM.EVENT.".concat(ee," 对应的回调函数逻辑存在问题,请检查!"),z)}new ca("callbackFunctionError").setMessage("eventName:".concat($)).setMoreMessage(z.message).end()}}}}]),e}(),wu=function(){function e(V){o(this,e);var $={"SDKAppID":V.SDKAppID,"unlimitedAVChatRoom":V.unlimitedAVChatRoom||!1,"scene":V.scene||"","oversea":V.oversea||!1,"instanceID":lt()};this._moduleManager=new Eu($),this._safetyCallbackFactory=new Cu}return s(e,[{"key":"isReady","value":function value(){return this._moduleManager.isReady()}},{"key":"onError","value":function value(V){this._moduleManager.onError(V)}},{"key":"login","value":function value(V){return this._moduleManager.login(),this._moduleManager.getModule(zn).login(V)}},{"key":"logout","value":function value(){var V=this;return this._moduleManager.getModule(zn).logout().then((function($){return V._moduleManager.reset(),$}))}},{"key":"destroy","value":function value(){var $=this;return this.logout().finally((function(){$._moduleManager.stopTimer(),$._moduleManager.getModule(hr).terminate(),$._moduleManager.getModule(dr).dealloc();var z=$._moduleManager.getOuterEmitterInstance(),X=$._moduleManager.getModule(nr);z.emit(V.SDK_DESTROY,{"SDKAppID":X.getSDKAppID()})}))}},{"key":"on","value":function value($,z,X){$===V.GROUP_SYSTEM_NOTICE_RECEIVED&&Zt.warn("!!!TIM.EVENT.GROUP_SYSTEM_NOTICE_RECEIVED v2.6.0起弃用,为了更好的体验,请在 TIM.EVENT.MESSAGE_RECEIVED 事件回调内接收处理群系统通知,详细请参考:https://web.sdk.qcloud.com/im/doc/zh-cn/Message.html#.GroupSystemNoticePayload"),Zt.debug("on","eventName:".concat($)),this._moduleManager.getOuterEmitterInstance().on($,this._safetyCallbackFactory.defense($,z,X),X)}},{"key":"once","value":function value(V,$,z){Zt.debug("once","eventName:".concat(V)),this._moduleManager.getOuterEmitterInstance().once(V,this._safetyCallbackFactory.defenseOnce(V,$,z),z||this)}},{"key":"off","value":function value(V,$,z,X){Zt.debug("off","eventName:".concat(V));var Z=this._safetyCallbackFactory.find(V,$);null!==Z&&(this._moduleManager.getOuterEmitterInstance().off(V,Z,z,X),this._safetyCallbackFactory.delete(V,$))}},{"key":"registerPlugin","value":function value(V){this._moduleManager.getModule(ur).registerPlugin(V)}},{"key":"setLogLevel","value":function value(V){V<=0&&(console.log([""," ________ ______ __ __ __ __ ________ _______","| \\| \\| \\ / \\| \\ _ | \\| \\| \\"," \\$$$$$$$$ \\$$$$$$| $$\\ / $$| $$ / \\ | $$| $$$$$$$$| $$$$$$$\\"," | $$ | $$ | $$$\\ / $$$| $$/ $\\| $$| $$__ | $$__/ $$"," | $$ | $$ | $$$$\\ $$$$| $$ $$$\\ $$| $$ \\ | $$ $$"," | $$ | $$ | $$\\$$ $$ $$| $$ $$\\$$\\$$| $$$$$ | $$$$$$$\\"," | $$ _| $$_ | $$ \\$$$| $$| $$$$ \\$$$$| $$_____ | $$__/ $$"," | $$ | $$ \\| $$ \\$ | $$| $$$ \\$$$| $$ \\| $$ $$"," \\$$ \\$$$$$$ \\$$ \\$$ \\$$ \\$$ \\$$$$$$$$ \\$$$$$$$","",""].join("\n")),console.log("%cIM 智能客服,随时随地解决您的问题 →_→ https://cloud.tencent.com/act/event/smarty-service?from=im-doc","color:#006eff"),console.log("%c从v2.11.2起,SDK 支持了 WebSocket,小程序需要添加受信域名!升级指引: https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-02-upgradeguideline.html","color:#ff0000"),console.log(["","参考以下文档,会更快解决问题哦!(#^.^#)\n","SDK 更新日志: https://cloud.tencent.com/document/product/269/38492\n","SDK 接口文档: https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html\n","常见问题: https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-01-faq.html\n","反馈问题?戳我提 issue: https://github.com/tencentyun/TIMSDK/issues\n","如果您需要在生产环境关闭上面的日志,请 tim.setLogLevel(1)\n"].join("\n"))),Zt.setLevel(V)}},{"key":"createTextMessage","value":function value(V){return this._moduleManager.getModule(Wn).createTextMessage(V)}},{"key":"createTextAtMessage","value":function value(V){return this._moduleManager.getModule(Wn).createTextMessage(V)}},{"key":"createImageMessage","value":function value(V){return this._moduleManager.getModule(Wn).createImageMessage(V)}},{"key":"createAudioMessage","value":function value(V){return this._moduleManager.getModule(Wn).createAudioMessage(V)}},{"key":"createVideoMessage","value":function value(V){return this._moduleManager.getModule(Wn).createVideoMessage(V)}},{"key":"createCustomMessage","value":function value(V){return this._moduleManager.getModule(Wn).createCustomMessage(V)}},{"key":"createFaceMessage","value":function value(V){return this._moduleManager.getModule(Wn).createFaceMessage(V)}},{"key":"createFileMessage","value":function value(V){return this._moduleManager.getModule(Wn).createFileMessage(V)}},{"key":"createLocationMessage","value":function value(V){return this._moduleManager.getModule(Wn).createLocationMessage(V)}},{"key":"createMergerMessage","value":function value(V){return this._moduleManager.getModule(Wn).createMergerMessage(V)}},{"key":"downloadMergerMessage","value":function value(V){return V.type!==$.MSG_MERGER?as(new ns({"code":Do.MESSAGE_MERGER_TYPE_INVALID,"message":"非合并消息"})):vt(V.payload.downloadKey)?as(new ns({"code":Do.MESSAGE_MERGER_KEY_INVALID,"message":"合并消息的 messageKey 无效"})):this._moduleManager.getModule(Wn).downloadMergerMessage(V).catch((function(V){return as(new ns({"code":Do.MESSAGE_MERGER_DOWNLOAD_FAIL,"message":"下载合并消息失败"}))}))}},{"key":"createForwardMessage","value":function value(V){return this._moduleManager.getModule(Wn).createForwardMessage(V)}},{"key":"sendMessage","value":function value(V,$){return V instanceof Si?this._moduleManager.getModule(Wn).sendMessageInstance(V,$):as(new ns({"code":Do.MESSAGE_SEND_NEED_MESSAGE_INSTANCE,"message":"需要 Message 的实例"}))}},{"key":"callExperimentalAPI","value":function value(V,$){return"handleGroupInvitation"===V?this._moduleManager.getModule(Jn).handleGroupInvitation($):as(new ns({"code":Do.INVALID_OPERATION,"message":"无效操作,如调用了未定义或者未实现的方法等"}))}},{"key":"revokeMessage","value":function value(V){return this._moduleManager.getModule(Wn).revokeMessage(V)}},{"key":"resendMessage","value":function value(V){return this._moduleManager.getModule(Wn).resendMessage(V)}},{"key":"deleteMessage","value":function value(V){return this._moduleManager.getModule(Wn).deleteMessage(V)}},{"key":"getMessageList","value":function value(V){return this._moduleManager.getModule(tr).getMessageList(V)}},{"key":"setMessageRead","value":function value(V){return this._moduleManager.getModule(tr).setMessageRead(V)}},{"key":"getConversationList","value":function value(V){return this._moduleManager.getModule(tr).getConversationList(V)}},{"key":"getConversationProfile","value":function value(V){return this._moduleManager.getModule(tr).getConversationProfile(V)}},{"key":"deleteConversation","value":function value(V){return this._moduleManager.getModule(tr).deleteConversation(V)}},{"key":"pinConversation","value":function value(V){return this._moduleManager.getModule(tr).pinConversation(V)}},{"key":"getMyProfile","value":function value(){return this._moduleManager.getModule(Yn).getMyProfile()}},{"key":"getUserProfile","value":function value(V){return this._moduleManager.getModule(Yn).getUserProfile(V)}},{"key":"updateMyProfile","value":function value(V){return this._moduleManager.getModule(Yn).updateMyProfile(V)}},{"key":"getBlacklist","value":function value(){return this._moduleManager.getModule(Yn).getLocalBlacklist()}},{"key":"addToBlacklist","value":function value(V){return this._moduleManager.getModule(Yn).addBlacklist(V)}},{"key":"removeFromBlacklist","value":function value(V){return this._moduleManager.getModule(Yn).deleteBlacklist(V)}},{"key":"getFriendList","value":function value(){var V=this._moduleManager.getModule(Zn);return V?V.getLocalFriendList():as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"addFriend","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.addFriend(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"deleteFriend","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.deleteFriend(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"checkFriend","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.checkFriend(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"getFriendProfile","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.getFriendProfile(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"updateFriend","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.updateFriend(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"getFriendApplicationList","value":function value(){var V=this._moduleManager.getModule(Zn);return V?V.getLocalFriendApplicationList():as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"acceptFriendApplication","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.acceptFriendApplication(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"refuseFriendApplication","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.refuseFriendApplication(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"deleteFriendApplication","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.deleteFriendApplication(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"setFriendApplicationRead","value":function value(){var V=this._moduleManager.getModule(Zn);return V?V.setFriendApplicationRead():as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"getFriendGroupList","value":function value(){var V=this._moduleManager.getModule(Zn);return V?V.getLocalFriendGroupList():as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"createFriendGroup","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.createFriendGroup(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"deleteFriendGroup","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.deleteFriendGroup(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"addToFriendGroup","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.addToFriendGroup(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"removeFromFriendGroup","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.removeFromFriendGroup(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"renameFriendGroup","value":function value(V){var $=this._moduleManager.getModule(Zn);return $?$.renameFriendGroup(V):as({"code":Do.CANNOT_FIND_MODULE,"message":Vo})}},{"key":"getGroupList","value":function value(V){return this._moduleManager.getModule(Jn).getGroupList(V)}},{"key":"getGroupProfile","value":function value(V){return this._moduleManager.getModule(Jn).getGroupProfile(V)}},{"key":"createGroup","value":function value(V){return this._moduleManager.getModule(Jn).createGroup(V)}},{"key":"dismissGroup","value":function value(V){return this._moduleManager.getModule(Jn).dismissGroup(V)}},{"key":"updateGroupProfile","value":function value(V){return this._moduleManager.getModule(Jn).updateGroupProfile(V)}},{"key":"joinGroup","value":function value(V){return this._moduleManager.getModule(Jn).joinGroup(V)}},{"key":"quitGroup","value":function value(V){return this._moduleManager.getModule(Jn).quitGroup(V)}},{"key":"searchGroupByID","value":function value(V){return this._moduleManager.getModule(Jn).searchGroupByID(V)}},{"key":"getGroupOnlineMemberCount","value":function value(V){return this._moduleManager.getModule(Jn).getGroupOnlineMemberCount(V)}},{"key":"changeGroupOwner","value":function value(V){return this._moduleManager.getModule(Jn).changeGroupOwner(V)}},{"key":"handleGroupApplication","value":function value(V){return this._moduleManager.getModule(Jn).handleGroupApplication(V)}},{"key":"initGroupAttributes","value":function value(V){return this._moduleManager.getModule(Jn).initGroupAttributes(V)}},{"key":"setGroupAttributes","value":function value(V){return this._moduleManager.getModule(Jn).setGroupAttributes(V)}},{"key":"deleteGroupAttributes","value":function value(V){return this._moduleManager.getModule(Jn).deleteGroupAttributes(V)}},{"key":"getGroupAttributes","value":function value(V){return this._moduleManager.getModule(Jn).getGroupAttributes(V)}},{"key":"getGroupMemberList","value":function value(V){return this._moduleManager.getModule(er).getGroupMemberList(V)}},{"key":"getGroupMemberProfile","value":function value(V){return this._moduleManager.getModule(er).getGroupMemberProfile(V)}},{"key":"addGroupMember","value":function value(V){return this._moduleManager.getModule(er).addGroupMember(V)}},{"key":"deleteGroupMember","value":function value(V){return this._moduleManager.getModule(er).deleteGroupMember(V)}},{"key":"setGroupMemberMuteTime","value":function value(V){return this._moduleManager.getModule(er).setGroupMemberMuteTime(V)}},{"key":"setGroupMemberRole","value":function value(V){return this._moduleManager.getModule(er).setGroupMemberRole(V)}},{"key":"setGroupMemberNameCard","value":function value(V){return this._moduleManager.getModule(er).setGroupMemberNameCard(V)}},{"key":"setGroupMemberCustomField","value":function value(V){return this._moduleManager.getModule(er).setGroupMemberCustomField(V)}},{"key":"setMessageRemindType","value":function value(V){return this._moduleManager.getModule(er).setMessageRemindType(V)}}]),e}(),Ou={"login":"login","logout":"logout","destroy":"destroy","on":"on","off":"off","ready":"ready","setLogLevel":"setLogLevel","joinGroup":"joinGroup","quitGroup":"quitGroup","registerPlugin":"registerPlugin","getGroupOnlineMemberCount":"getGroupOnlineMemberCount"},Nu={},Pu={"create":function($){var z=0;if(nn($.SDKAppID))z=$.SDKAppID;else if(Zt.warn("TIM.create SDKAppID 的类型应该为 Number,请修改!"),z=parseInt($.SDKAppID),isNaN(z))return Zt.error("TIM.create failed. 解析 SDKAppID 失败,请检查传参!"),null;if(z&&Nu[z])return Nu[z];Zt.log("TIM.create");var Z=new wu(t(t({},$),{},{"SDKAppID":z}));Z.on(V.SDK_DESTROY,(function(V){Nu[V.data.SDKAppID]=null,delete Nu[V.data.SDKAppID]}));var ae=function(V){var $=Object.create(null);return Object.keys(Qn).forEach((function(z){if(V[z]){var Z=Qn[z],ae=new X;$[Z]=function(){var $=Array.from(arguments);return ae.use((function($,X){return function Du(V,$){if(V.isReady()||void 0!==Ou[$])return!0;var z=new ns({"code":Do.SDK_IS_NOT_READY,"message":"".concat($," ").concat(Ho,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/module-EVENT.html#.SDK_READY")});return V.onError(z),!1}(V,z)?X():as(new ns({"code":Do.SDK_IS_NOT_READY,"message":"".concat(z," ").concat(Ho,"。")}))})).use((function(V,$){if(!0===function yt(V,$,z){if(void 0===$)return!0;var X=!0;if("object"===ee($).toLowerCase())Object.keys($).forEach((function(Z){var ee=1===V.length?V[0][Z]:void 0;X=!!It(ee,$[Z],z,Z)&&X}));else if("array"===ee($).toLowerCase())for(var Z=0;Z<$.length;Z++)X=!!It(V[Z],$[Z],z,$[Z].name)&&X;if(X)return X;throw new Error("Params validate failed.")}(V,Kn[z],Z))return $()})).use((function($,X){return V[z].apply(V,$)})),ae.run($)}}})),$}(Z);return Nu[z]=ae,Zt.log("TIM.create ok"),ae}};return Pu.TYPES=$,Pu.EVENT=V,Pu.VERSION="2.15.0",Zt.log("TIM.VERSION: ".concat(Pu.VERSION)),Pu},"object"==ae($)?V.exports=ee():void 0===(Z="function"==typeof(X=ee)?X.call($,z,$,V):X)||(V.exports=Z)},"3744":function(V,$,z){"use strict";z.d($,{"V":function(){return wt},"Z":function(){return Ot}});var X=z(9439),Z=z(4165),ee=z(5861),ae=z(7294),ie=z(7853),ce=z(2505),le=z(269),de=z(4371),pe=z(3099),fe=z(7690),ye=z(9575),_e=z(4186);function sha1(V){function rotate_left(V,$){return V<<$|V>>>32-$}function cvt_hex(V){var $,z="";for($=7;$>=0;$--)z+=(V>>>4*$&15).toString(16);return z}var $,z,X,Z,ee,ae,ie,ce,le,de=new Array(80),pe=1732584193,fe=4023233417,ye=2562383102,_e=271733878,Se=3285377520,Te=(V=function Utf8Encode(V){V=V.replace(/\r\n/g,"\n");for(var $="",z=0;z127&&X<2048?($+=String.fromCharCode(X>>6|192),$+=String.fromCharCode(63&X|128)):($+=String.fromCharCode(X>>12|224),$+=String.fromCharCode(X>>6&63|128),$+=String.fromCharCode(63&X|128))}return $}(V)).length,He=new Array;for(z=0;z>>29),He.push(Te<<3&4294967295),$=0;$1&&void 0!==Tt[1]?Tt[1]:{"method":"GET","data":{},"withAccessToken":!0,"gotoLogin":!0},z=!(Tt.length>2&&void 0!==Tt[2])||Tt[2],X=!(Tt.length>3&&void 0!==Tt[3])||Tt[3],ee={"Content-Type":"application/json"},ae=(new Date).getTime(),ce=sha1(_e.be+_e.il+ae).toString(),$.withAccessToken&&(ee["Safety-Token"]=ce,ee["Safety-Code"]=ae,ee["User-Token"]="".concat((0,ie.qu)("accessToken")),ee["api-platform"]="h5",ee["api-version"]="1.0.0",ee.version=(0,_e.i8)(),ee.source="wx-llt"),Z.prev=7,0==V.indexOf("/")&&(V=V.slice(1)),Z.next=11,(0,pe.WY)({"url":(0,_e.Nu)()+V,"method":$.method,"header":ee,"data":$.data,"responseType":"text","dataType":"text"});case 11:if(le=Z.sent,X&&"GET"!=$.method&&(0,de.Zk)(),Se=le.statusCode,Te=le.data,He=le.header,!(Se>=200&&Se<300)){Z.next=20;break}Qe={};try{Qe=JSON.parse(Te)}catch(V){}return Z.abrupt("return",{"header":He,"body":Qe});case 20:throw{"status":le.statusCode,"headers":JSON.parse(JSON.stringify(le.header))};case 21:Z.next=41;break;case 23:if(Z.prev=23,Z.t0=Z.catch(7),(0,de.Zk)(),401!=Z.t0.status){Z.next=36;break}if((0,ie.hq)("accessToken"),(0,ie.hq)("shopToken"),ze=(0,ie.qu)("isWindow"),console.log(ze),!ze){Z.next=33;break}return Z.abrupt("return");case 33:return(0,ie.Fj)("isWindow",!0),(0,de.K4)({"title":"温馨提示","content":"为了更好地为您服务\n该页面相关功能需要授权登录才能使用\n马上登录?","success":function success(V){V.confirm?((0,ie.hq)("isWindow"),"main/TelLogin/index"!=fe.ZP.getCurrentPages()[0].route&&$.gotoLogin&&fe.ZP.redirectTo({"url":"/main/TelLogin/index"})):V.cancel&&((0,ie.hq)("isWindow"),console.log("点击了取消"))}}),Z.abrupt("return");case 36:if(bt="",Z.t0.headers)try{Z.t0.headers.forEach((function(V,$){if("x-api-message"==$){var z=ye.Base64.decode(V);bt=decodeURIComponent(z)}}))}catch(V){for(At in Z.t0.headers)Mt=Z.t0.headers[At],"x-api-message"==At&&(St=ye.Base64.decode(Mt),bt=decodeURIComponent(St))}throw console.log(bt),z&&(0,de.CF)({"title":bt||"未知错误","icon":"none","duration":2e3}),new Error("网络请求错误");case 41:case"end":return Z.stop()}}),_callee,null,[[7,23]])})));return function($){return V.apply(this,arguments)}}(),Te=z(5893),He=Symbol();var Qe,ze,bt,At,Mt=z(5591),St=z(515),Tt=z(8460),kt=function init(){return new Promise((function(V,$){(0,ie.qu)("accessToken")&&((0,St.o)().then((function($){"10000"!=(0,ie.qu)("showBox")&&wt.get("member/cp-member-integral/task",{}).then((function(V){var $=V.body;0==$.joinGroupInfo?0==$.bindPetInfo?0==$.loginInfo?null!=wt.storeDispatch&&wt.storeDispatch({"type":"updateShowBox","showBox":1}):null!=wt.storeDispatch&&wt.storeDispatch({"type":"updateShowBox","showBox":2}):null!=wt.storeDispatch&&wt.storeDispatch({"type":"updateShowBox","showBox":3}):wt.storeDispatch({"type":"updateShowBox","showBox":1e4})})),V($.member_info.inviteCode)})),Se("setting/cp-api-setting/im/sig",{"method":"GET","data":{},"withAccessToken":!0,"gotoLogin":!1}).then((function(V){var $=V.body.sig,z=Number(V.body.key),X=(0,ie.qu)("userid");(0,Tt.bl)({"userID":(0,ie.qu)("userid"),"userSig":$,"SDKAppID":z,"onSdkNotReady":function onSdkNotReady(V){console.log("onSdkNotReady:%o",V),wt.imReady=!1,Tt.mj.off(Tt.FV.CONVERSATION_LIST_UPDATED,Tt.XT),Tt.mj.off(Tt.FV.MESSAGE_RECEIVED,Tt.Mh),(0,Tt.x4)(X,$)},"onKickedOut":function onKickedOut(V){console.log("onKickedOut:%o",V)},"onTIMError":function onTIMError(V){console.error("onTIMError:%o",V)},"onNetStateChange":function onNetStateChange(V){console.log("onNetStateChange:%o",V)},"onSDKReload":function onSDKReload(V){console.log("onSDKReload:%o",V)},"onSDKReady":function onSDKReady(V){console.log("onSDKReady:%o",V),console.log("apiIns.storeDispatch:%o",wt.storeDispatch),wt.imReady=!0,null!=wt.storeDispatch&&console.log("apiIns.imReady = true",wt.storeDispatch),wt.storeDispatch({"type":"updateShowBox","showBox":1e3})},"onImReady":function onImReady(V){console.log("onImReady:%o",V)}})})))}))},Ct=function(){var V=(0,ee.Z)((0,Z.Z)().mark((function _callee(){var V,$,z;return(0,Z.Z)().wrap((function _callee$(X){for(;;)switch(X.prev=X.next){case 0:document.querySelector(".loader-wrap").style.display="block",V=_e.pw,$=encodeURIComponent(window.location.protocol+"//"+window.location.host+window.location.pathname+"#/pages/WechatLoading/index"),z="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(V,"&redirect_uri=").concat($,"&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"),window.location=z;case 5:case"end":return X.stop()}}),_callee)})));return function weChatLogin(){return V.apply(this,arguments)}}(),wt={"wxInited":!1,"inviteCode":(0,ie.qu)("userInfo")?(0,ie.qu)("userInfo").info.inviteCode:"","imReady":!1,"taskId":"","storeDispatch":function storeDispatch(V){},"shareUri":function shareUri(){return window.location.protocol+"//"+window.location.host+window.location.pathname+"#/pages/Home/index"},"pageInit":function pageInit(){if(!(0,ie.qu)("openid")&&(0,Mt.Ku)())return(0,ie.Fj)("fromUri",window.location.href),void Ct();(0,ie.qu)("accessToken")&&((0,Mt.Ku)()?function wxInit(){return new Promise((function(V,$){Se("/wx/cp-member-wx/wxConfig",{"method":"GET","data":{"url":window.location.href.split("#")[0]},"withAccessToken":!0}).then((function($){window.wx.config({"debug":!1,"appId":$.body.appId,"timestamp":$.body.timestamp,"nonceStr":$.body.nonceStr,"signature":$.body.signature,"jsApiList":["chooseWXPay","updateAppMessageShareData","updateTimelineShareData","onMenuShareTimeline","onMenuShareAppMessage"]}),window.wx.ready((function(){kt().then((function($){var z="小它送福利啦",X=wt.shareUri()+"?invitCode="+$,Z="https://test.m.chongpar.com/static/img/share4.png";window.wx.updateAppMessageShareData({"title":z,"desc":"会员可获保险大礼,即刻享超值惊喜盲盒!为爱而来,为它发声!","link":X,"imgUrl":Z,"success":function success(){}})(window).wx.updateTimelineShareData({"title":z,"link":X,"imgUrl":Z,"success":function success(){}}),V($)}))})),window.wx.error((function(V){}))})).catch((function(){}))}))}().then((function(V){wt.wxInited=!0,wt.inviteCode=(0,ie.qu)("userInfo")?(0,ie.qu)("userInfo").info.inviteCode:""})):kt().then((function(V){wt.wxInited=!0,wt.inviteCode=(0,ie.qu)("userInfo")?(0,ie.qu)("userInfo").info.inviteCode:""}))),document.querySelector(".loader-wrap").style.display="none",document.querySelector(".loader-wrap").style.background="ffffffa8",(0,ce.w)({"scrollTop":0,"duration":100})},"imInit":function imInit(V){wt.pageInit(),wt.imReady?V():setTimeout((function(){wt.imInit(V)}),1e3)},"setToken":function setToken(V){(0,ie.Fj)("accessToken",V)},"islogin":function islogin(){return!!(0,ie.qu)("accessToken")},"getUri":function getUri(){return function getUri(){return(0,_e.Nu)()}()},"upFile":function upFile(V){var $=(new Date).getTime();return new Promise((function(z,X){(0,le.c)({"url":wt.getUri()+"file/cp-file/upload/v2","filePath":V,"header":{"Safety-Code":$,"Safety-Token":sha1(_e.be+_e.il+$).toString(),"User-Token":(0,ie.qu)("accessToken"),"api-platform":"h5","api-version":"1.0.0","version":(0,_e.i8)(),"source":"wx-llt"},"name":"file","success":function success(V){var $=V.data;try{var Z=JSON.parse($);z(Z)}catch(V){X(V)}},"fail":function fail(V){X(V)}})}))},"get":(At=(0,ee.Z)((0,Z.Z)().mark((function _callee2(V){var $,z,X=arguments;return(0,Z.Z)().wrap((function _callee2$(Z){for(;;)switch(Z.prev=Z.next){case 0:return $=X.length>1&&void 0!==X[1]?X[1]:{},z=!(X.length>3&&void 0!==X[3])||X[3],Z.abrupt("return",Se(V,{"method":"GET","data":$,"withAccessToken":!0,"gotoLogin":z}));case 4:case"end":return Z.stop()}}),_callee2)}))),function get(V){return At.apply(this,arguments)}),"post":(bt=(0,ee.Z)((0,Z.Z)().mark((function _callee3(V){var $,z,X,ee,ae=arguments;return(0,Z.Z)().wrap((function _callee3$(Z){for(;;)switch(Z.prev=Z.next){case 0:return $=ae.length>1&&void 0!==ae[1]?ae[1]:{},z=!(ae.length>3&&void 0!==ae[3])||ae[3],X=!(ae.length>4&&void 0!==ae[4])||ae[4],(ee=!(ae.length>5&&void 0!==ae[5])||ae[5])&&(0,de.QP)({"title":"数据提交中","mask":!0}),Z.abrupt("return",Se(V,{"method":"POST","data":$,"withAccessToken":!0,"gotoLogin":z},X,ee));case 7:case"end":return Z.stop()}}),_callee3)}))),function post(V){return bt.apply(this,arguments)}),"put":(ze=(0,ee.Z)((0,Z.Z)().mark((function _callee4(V){var $,z,X=arguments;return(0,Z.Z)().wrap((function _callee4$(Z){for(;;)switch(Z.prev=Z.next){case 0:return $=X.length>1&&void 0!==X[1]?X[1]:{},z=!(X.length>3&&void 0!==X[3])||X[3],(!(X.length>4&&void 0!==X[4])||X[4])&&(0,de.QP)({"title":"数据提交中","mask":!0}),Z.abrupt("return",Se(V,{"method":"PUT","data":$,"withAccessToken":!0,"gotoLogin":z}));case 6:case"end":return Z.stop()}}),_callee4)}))),function put(V){return ze.apply(this,arguments)}),"del":(Qe=(0,ee.Z)((0,Z.Z)().mark((function _callee5(V){var $,z,X=arguments;return(0,Z.Z)().wrap((function _callee5$(Z){for(;;)switch(Z.prev=Z.next){case 0:return $=X.length>1&&void 0!==X[1]?X[1]:{},z=!(X.length>3&&void 0!==X[3])||X[3],(!(X.length>4&&void 0!==X[4])||X[4])&&(0,de.QP)({"title":"数据提交中","mask":!0}),Z.abrupt("return",Se(V,{"method":"DELETE","data":$,"withAccessToken":!0,"gotoLogin":z}));case 6:case"end":return Z.stop()}}),_callee5)}))),function del(V){return Qe.apply(this,arguments)})},Ot=function createContainer(V){var $=ae.createContext(He);return{"Provider":function Provider(z){var X=V(z.initialState);return(0,Te.jsxs)($.Provider,{"value":X,"children":[" ",z.children," "]})},"useContainer":function useContainer(){var V=ae.useContext($);if(V===He)throw new Error("Component must be wrapped with ");return V}}}((function(){var V=(0,ae.useState)(wt),$=(0,X.Z)(V,2);return{"api":$[0],"setApi":$[1]}}))},"3645":function(V){"use strict";V.exports=function(V){var $=[];return $.toString=function toString(){return this.map((function($){var z="",X=void 0!==$[5];return $[4]&&(z+="@supports (".concat($[4],") {")),$[2]&&(z+="@media ".concat($[2]," {")),X&&(z+="@layer".concat($[5].length>0?" ".concat($[5]):""," {")),z+=V($),X&&(z+="}"),$[2]&&(z+="}"),$[4]&&(z+="}"),z})).join("")},$.i=function i(V,z,X,Z,ee){"string"==typeof V&&(V=[[null,V,void 0]]);var ae={};if(X)for(var ie=0;ie0?" ".concat(de[5]):""," {").concat(de[1],"}")),de[5]=ee),z&&(de[2]?(de[1]="@media ".concat(de[2]," {").concat(de[1],"}"),de[2]=z):de[2]=z),Z&&(de[4]?(de[1]="@supports (".concat(de[4],") {").concat(de[1],"}"),de[4]=Z):de[4]="".concat(Z)),$.push(de))}},$}},"1667":function(V){"use strict";V.exports=function(V,$){return $||($={}),V?(V=String(V.__esModule?V.default:V),/^['"].*['"]$/.test(V)&&(V=V.slice(1,-1)),$.hash&&(V+=$.hash),/["'() \t\n]|(%20)/.test(V)||$.needQuotes?'"'.concat(V.replace(/"/g,'\\"').replace(/\n/g,"\\n"),'"'):V):V}},"8081":function(V){"use strict";V.exports=function(V){return V[1]}},"4020":function(V){"use strict";var $="%[a-f0-9]{2}",z=new RegExp("("+$+")|([^%]+?)","gi"),X=new RegExp("("+$+")+","gi");function decodeComponents(V,$){try{return[decodeURIComponent(V.join(""))]}catch(V){}if(1===V.length)return V;$=$||1;var z=V.slice(0,$),X=V.slice($);return Array.prototype.concat.call([],decodeComponents(z),decodeComponents(X))}function decode(V){try{return decodeURIComponent(V)}catch(Z){for(var $=V.match(z)||[],X=1;X<$.length;X++)$=(V=decodeComponents($,X).join("")).match(z)||[];return V}}V.exports=function(V){if("string"!=typeof V)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof V+"`");try{return V=V.replace(/\+/g," "),decodeURIComponent(V)}catch($){return function customDecodeURIComponent(V){for(var $={"%FE%FF":"��","%FF%FE":"��"},z=X.exec(V);z;){try{$[z[0]]=decodeURIComponent(z[0])}catch(V){var Z=decode(z[0]);Z!==z[0]&&($[z[0]]=Z)}z=X.exec(V)}$["%C2"]="�";for(var ee=Object.keys($),ae=0;ae=0&&($.hash=V.substr(z),V=V.substr(0,z));var X=V.indexOf("?");X>=0&&($.search=V.substr(X),V=V.substr(0,X)),V&&($.pathname=V)}return $}},"9575":function(V,$,z){var X;!function(z,Z){V.exports=function(z){"use strict";z=z||{};var Z,ee=z.Base64,ae="2.6.4",ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ce=function(V){for(var $={},z=0,X=V.length;z>>6)+le(128|63&$):le(224|$>>>12&15)+le(128|$>>>6&63)+le(128|63&$);var $=65536+1024*(V.charCodeAt(0)-55296)+(V.charCodeAt(1)-56320);return le(240|$>>>18&7)+le(128|$>>>12&63)+le(128|$>>>6&63)+le(128|63&$)},de=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=function(V){return V.replace(de,cb_utob)},cb_encode=function(V){var $=[0,2,1][V.length%3],z=V.charCodeAt(0)<<16|(V.length>1?V.charCodeAt(1):0)<<8|(V.length>2?V.charCodeAt(2):0);return[ie.charAt(z>>>18),ie.charAt(z>>>12&63),$>=2?"=":ie.charAt(z>>>6&63),$>=1?"=":ie.charAt(63&z)].join("")},pe=z.btoa&&"function"==typeof z.btoa?function(V){return z.btoa(V)}:function(V){if(V.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return V.replace(/[\s\S]{1,3}/g,cb_encode)},_encode=function(V){return pe(utob(String(V)))},mkUriSafe=function(V){return V.replace(/[+\/]/g,(function(V){return"+"==V?"-":"_"})).replace(/=/g,"")},encode=function(V,$){return $?mkUriSafe(_encode(V)):_encode(V)},encodeURI=function(V){return encode(V,!0)};z.Uint8Array&&(Z=function(V,$){for(var z="",X=0,Z=V.length;X>>18)+ie.charAt(le>>>12&63)+(void 0!==ae?ie.charAt(le>>>6&63):"=")+(void 0!==ce?ie.charAt(63&le):"=")}return $?mkUriSafe(z):z});var fe,ye=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=function(V){switch(V.length){case 4:var $=((7&V.charCodeAt(0))<<18|(63&V.charCodeAt(1))<<12|(63&V.charCodeAt(2))<<6|63&V.charCodeAt(3))-65536;return le(55296+($>>>10))+le(56320+(1023&$));case 3:return le((15&V.charCodeAt(0))<<12|(63&V.charCodeAt(1))<<6|63&V.charCodeAt(2));default:return le((31&V.charCodeAt(0))<<6|63&V.charCodeAt(1))}},btou=function(V){return V.replace(ye,cb_btou)},cb_decode=function(V){var $=V.length,z=$%4,X=($>0?ce[V.charAt(0)]<<18:0)|($>1?ce[V.charAt(1)]<<12:0)|($>2?ce[V.charAt(2)]<<6:0)|($>3?ce[V.charAt(3)]:0),Z=[le(X>>>16),le(X>>>8&255),le(255&X)];return Z.length-=[0,0,2,1][z],Z.join("")},_e=z.atob&&"function"==typeof z.atob?function(V){return z.atob(V)}:function(V){return V.replace(/\S{1,4}/g,cb_decode)},atob=function(V){return _e(String(V).replace(/[^A-Za-z0-9\+\/]/g,""))},_decode=function(V){return btou(_e(V))},_fromURI=function(V){return String(V).replace(/[-_]/g,(function(V){return"-"==V?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},decode=function(V){return _decode(_fromURI(V))};z.Uint8Array&&(fe=function(V){return Uint8Array.from(atob(_fromURI(V)),(function(V){return V.charCodeAt(0)}))});var noConflict=function(){var V=z.Base64;return z.Base64=ee,V};if(z.Base64={"VERSION":ae,"atob":atob,"btoa":pe,"fromBase64":decode,"toBase64":encode,"utob":utob,"encode":encode,"encodeURI":encodeURI,"btou":btou,"decode":decode,"noConflict":noConflict,"fromUint8Array":Z,"toUint8Array":fe},"function"==typeof Object.defineProperty){var noEnum=function(V){return{"value":V,"enumerable":!1,"writable":!0,"configurable":!0}};z.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum((function(){return decode(this)}))),Object.defineProperty(String.prototype,"toBase64",noEnum((function(V){return encode(this,V)}))),Object.defineProperty(String.prototype,"toBase64URI",noEnum((function(){return encode(this,!0)})))}}z.Meteor&&(Base64=z.Base64);V.exports?V.exports.Base64=z.Base64:void 0===(X=function(){return z.Base64}.apply($,[]))||(V.exports=X);return{"Base64":z.Base64}}(z)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==z.g?z.g:this)},"6829":function(V,$,z){"use strict";var X=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var ae=function shouldUseNative(){try{if(!Object.assign)return!1;var V=new String("abc");if(V[5]="de","5"===Object.getOwnPropertyNames(V)[0])return!1;for(var $={},z=0;z<10;z++)$["_"+String.fromCharCode(z)]=z;if("0123456789"!==Object.getOwnPropertyNames($).map((function(V){return $[V]})).join(""))return!1;var X={};return"abcdefghijklmnopqrst".split("").forEach((function(V){X[V]=V})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},X)).join("")}catch(V){return!1}}()?Object.assign:function(V,$){for(var z,ae,ie=function toObject(V){if(null==V)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(V)}(V),ce=1;ce0?($.retryTimes--,fetchData(X,$,z)):!1===fallback(X,$,z)?z(new Error("Timeout and no data return")):void 0}),de)}function storeCheckFn(V,$,z){return!!(V&&$&&z)&&(V[$]&&V[$]===z)}function setDataToStore(V){var $=V.useStore,z=V.storeKey,X=V.data;($=!!$&&le.enabled)&&le.set(z,X)}function fallback(V,$,z){var X=$.backup;if(X){if("string"==typeof X)return delete $.backup,fetchData(generateJsonpUrlWithParams(X,$.params),$,z,{"backup":X});if(Array.isArray(X)&&X.length){var Z=X.shift();return fetchData(generateJsonpUrlWithParams(Z,$.params),$,z,{"backup":Z})}}var ee=function getDataFromStoreWithoutCheck(V){var $=V.useStore,z=V.storeKey,X=V.dataCheck;if($=!!$&&le.enabled){var Z=le.get(z);if(!X||Z&&X&&!1!==X(Z))return Z}return null}({"useStore":$.useStore,"storeKey":V,"dataCheck":$.dataCheck});return!!ee&&(z(null,ee),!0)}$.Z=function jsonp$1(V,$,z){if(isFunction(V)?(z=V,$={}):V&&"object"===(void 0===V?"undefined":pe(V))&&(z=$,V=($=V||{}).url),isFunction($)&&(z=$,$={}),$||($={}),$=ae({},ze,$),V=V||$.url,z=z||_e,!V||"string"!=typeof V)return z(new Error("Param url is needed!")),!jsonp$1.promiseClose&&ye?new Promise((function(V,$){return $(new Error("Param url is needed!"))})):void 0;var X=generateJsonpUrlWithParams(V,$.params),Z=function getDataFromStore(V){var $=V.useStore,z=V.storeKey,X=V.storeCheck,Z=V.storeCheckKey,ee=V.storeSign,ae=V.dataCheck;if($=!!$&&le.enabled){var ie=le.get(z);if((X=X||storeCheckFn)(ie,Z,ee)&&(!ae||ie&&ae&&!1!==ae(ie)))return ie}return null}({"useStore":$.useStore,"storeKey":X,"storeCheck":$.storeCheck,"storeCheckKey":$.storeCheckKey,"storeSign":$.storeSign,"dataCheck":$.dataCheck});return Z?(z(null,Z),!jsonp$1.promiseClose&&ye?new Promise((function(V){return V(Z)})):void 0):($.originalUrl=X,!jsonp$1.promiseClose&&ye?new Promise((function(V,Z){fetchData(X,$,(function($,X){if($)return z($),Z($);z(null,X),V(X)}))})):void fetchData(X,$,z))}},"2437":function(V,$,z){!function(V,$){V((function(){"use strict";var V,z={"mobileDetectRules":{"phones":{"iPhone":"\\biPhone\\b|\\biPod\\b","BlackBerry":"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+","Pixel":"; \\bPixel\\b","HTC":"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel","Nexus":"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6","Dell":"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b","Motorola":"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052","Samsung":"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F","LG":"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710","Sony":"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332","Asus":"Asus.*Galaxy|PadFone.*Mobile","Xiaomi":"^(?!.*\\bx11\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G","NokiaLumia":"Lumia [0-9]{3,4}","Micromax":"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b","Palm":"PalmSource|Palm","Vertu":"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature","Pantech":"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790","Fly":"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250","Wiko":"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM","iMobile":"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)","SimValley":"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b","Wolfgang":"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q","Alcatel":"Alcatel","Nintendo":"Nintendo (3DS|Switch)","Amoi":"Amoi","INQ":"INQ","OnePlus":"ONEPLUS","GenericPhone":"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},"tablets":{"iPad":"iPad|iPad.*Mobile","NexusTablet":"Android.*Nexus[\\s]+(7|9|10)","GoogleTablet":"Android.*Pixel C","SamsungTablet":"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860","Kindle":"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)","SurfaceTablet":"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)","HPTablet":"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10","AsusTablet":"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b","BlackBerryTablet":"PlayBook|RIM Tablet","HTCtablet":"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410","MotorolaTablet":"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617","NookTablet":"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2","AcerTablet":"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30|A3-A40","ToshibaTablet":"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO","LGTablet":"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b","FujitsuTablet":"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b","PrestigioTablet":"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002","LenovoTablet":"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L","DellTablet":"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7","YarvikTablet":"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b","MedionTablet":"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB","ArnovaTablet":"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2","IntensoTablet":"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004","IRUTablet":"M702pro","MegafonTablet":"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b","EbodaTablet":"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)","AllViewTablet":"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)","ArchosTablet":"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b","AinolTablet":"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark","NokiaLumiaTablet":"Lumia 2520","SonyTablet":"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712","PhilipsTablet":"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b","CubeTablet":"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT","CobyTablet":"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010","MIDTablet":"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10","MSITablet":"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b","SMiTTablet":"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)","RockChipTablet":"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A","FlyTablet":"IQ310|Fly Vision","bqTablet":"Android.*(bq)?.*\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\b|Maxwell.*Lite|Maxwell.*Plus","HuaweiTablet":"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19","NecTablet":"\\bN-06D|\\bN-08D","PantechTablet":"Pantech.*P4100","BronchoTablet":"Broncho.*(N701|N708|N802|a710)","VersusTablet":"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b","ZyncTablet":"z1000|Z99 2G|z930|z990|z909|Z919|z900","PositivoTablet":"TB07STA|TB10STA|TB07FTA|TB10FTA","NabiTablet":"Android.*\\bNabi","KoboTablet":"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build","DanewTablet":"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b","TexetTablet":"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE","PlaystationTablet":"Playstation.*(Portable|Vita)","TrekstorTablet":"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab","PyleAudioTablet":"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b","AdvanTablet":"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ","DanyTechTablet":"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1","GalapadTablet":"Android [0-9.]+; [a-z-]+; \\bG1\\b","MicromaxTablet":"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b","KarbonnTablet":"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b","AllFineTablet":"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide","PROSCANTablet":"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b","YONESTablet":"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026","ChangJiaTablet":"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503","GUTablet":"TX-A1301|TX-M9002|Q702|kf026","PointOfViewTablet":"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10","OvermaxTablet":"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027","HCLTablet":"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync","DPSTablet":"DPS Dream 9|DPS Dual 7","VistureTablet":"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10","CrestaTablet":"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989","MediatekTablet":"\\bMT8125|MT8389|MT8135|MT8377\\b","ConcordeTablet":"Concorde([ ]+)?Tab|ConCorde ReadMan","GoCleverTablet":"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042","ModecomTablet":"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003","VoninoTablet":"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b","ECSTablet":"V07OT2|TM105A|S10OT1|TR10CS1","StorexTablet":"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab","VodafoneTablet":"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400","EssentielBTablet":"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2","RossMoorTablet":"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711","iMobileTablet":"i-mobile i-note","TolinoTablet":"tolino tab [0-9.]+|tolino shine","AudioSonicTablet":"\\bC-22Q|T7-QC|T-17B|T-17P\\b","AMPETablet":"Android.* A78 ","SkkTablet":"Android.* (SKYPAD|PHOENIX|CYCLOPS)","TecnoTablet":"TECNO P9|TECNO DP8D","JXDTablet":"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b","iJoyTablet":"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)","FX2Tablet":"FX2 PAD7|FX2 PAD10","XoroTablet":"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151","ViewsonicTablet":"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a","VerizonTablet":"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1","OdysTablet":"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10","CaptivaTablet":"CAPTIVA PAD","IconbitTablet":"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S","TeclastTablet":"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi","OndaTablet":"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b","JaytechTablet":"TPC-PA762","BlaupunktTablet":"Endeavour 800NG|Endeavour 1010","DigmaTablet":"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b","EvolioTablet":"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b","LavaTablet":"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b","AocTablet":"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712","MpmanTablet":"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010","CelkonTablet":"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b","WolderTablet":"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b","MediacomTablet":"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA","MiTablet":"\\bMI PAD\\b|\\bHM NOTE 1W\\b","NibiruTablet":"Nibiru M1|Nibiru Jupiter One","NexoTablet":"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI","LeaderTablet":"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100","UbislateTablet":"UbiSlate[\\s]?7C","PocketBookTablet":"Pocketbook","KocasoTablet":"\\b(TB-1207)\\b","HisenseTablet":"\\b(F5281|E2371)\\b","Hudl":"Hudl HT7S3|Hudl 2","TelstraTablet":"T-Hub2","GenericTablet":"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"},"oss":{"AndroidOS":"Android","BlackBerryOS":"blackberry|\\bBB10\\b|rim tablet os","PalmOS":"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino","SymbianOS":"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b","WindowsMobileOS":"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;","WindowsPhoneOS":"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;","iOS":"\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia","iPadOS":"CPU OS 13","SailfishOS":"Sailfish","MeeGoOS":"MeeGo","MaemoOS":"Maemo","JavaOS":"J2ME/|\\bMIDP\\b|\\bCLDC\\b","webOS":"webOS|hpwOS","badaOS":"\\bBada\\b","BREWOS":"BREW"},"uas":{"Chrome":"\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?","Dolfin":"\\bDolfin\\b","Opera":"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+$|Coast/[0-9.]+","Skyfire":"Skyfire","Edge":"\\bEdgiOS\\b|Mobile Safari/[.0-9]* Edge","IE":"IEMobile|MSIEMobile","Firefox":"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS","Bolt":"bolt","TeaShark":"teashark","Blazer":"Blazer","Safari":"Version((?!\\bEdgiOS\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari","WeChat":"\\bMicroMessenger\\b","UCBrowser":"UC.*Browser|UCWEB","baiduboxapp":"baiduboxapp","baidubrowser":"baidubrowser","DiigoBrowser":"DiigoBrowser","Mercury":"\\bMercury\\b","ObigoBrowser":"Obigo","NetFront":"NF-Browser","GenericBrowser":"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger","PaleMoon":"Android.*PaleMoon|Mobile.*PaleMoon"},"props":{"Mobile":"Mobile/[VER]","Build":"Build/[VER]","Version":"Version/[VER]","VendorID":"VendorID/[VER]","iPad":"iPad.*CPU[a-z ]+[VER]","iPhone":"iPhone.*CPU[a-z ]+[VER]","iPod":"iPod.*CPU[a-z ]+[VER]","Kindle":"Kindle/[VER]","Chrome":["Chrome/[VER]","CriOS/[VER]","CrMo/[VER]"],"Coast":["Coast/[VER]"],"Dolfin":"Dolfin/[VER]","Firefox":["Firefox/[VER]","FxiOS/[VER]"],"Fennec":"Fennec/[VER]","Edge":"Edge/[VER]","IE":["IEMobile/[VER];","IEMobile [VER]","MSIE [VER];","Trident/[0-9.]+;.*rv:[VER]"],"NetFront":"NetFront/[VER]","NokiaBrowser":"NokiaBrowser/[VER]","Opera":[" OPR/[VER]","Opera Mini/[VER]","Version/[VER]"],"Opera Mini":"Opera Mini/[VER]","Opera Mobi":"Version/[VER]","UCBrowser":["UCWEB[VER]","UC.*Browser/[VER]"],"MQQBrowser":"MQQBrowser/[VER]","MicroMessenger":"MicroMessenger/[VER]","baiduboxapp":"baiduboxapp/[VER]","baidubrowser":"baidubrowser/[VER]","SamsungBrowser":"SamsungBrowser/[VER]","Iron":"Iron/[VER]","Safari":["Version/[VER]","Safari/[VER]"],"Skyfire":"Skyfire/[VER]","Tizen":"Tizen/[VER]","Webkit":"webkit[ /][VER]","PaleMoon":"PaleMoon/[VER]","SailfishBrowser":"SailfishBrowser/[VER]","Gecko":"Gecko/[VER]","Trident":"Trident/[VER]","Presto":"Presto/[VER]","Goanna":"Goanna/[VER]","iOS":" \\bi?OS\\b [VER][ ;]{1}","Android":"Android [VER]","Sailfish":"Sailfish [VER]","BlackBerry":["BlackBerry[\\w]+/[VER]","BlackBerry.*Version/[VER]","Version/[VER]"],"BREW":"BREW [VER]","Java":"Java/[VER]","Windows Phone OS":["Windows Phone OS [VER]","Windows Phone [VER]"],"Windows Phone":"Windows Phone [VER]","Windows CE":"Windows CE/[VER]","Windows NT":"Windows NT [VER]","Symbian":["SymbianOS/[VER]","Symbian/[VER]"],"webOS":["webOS/[VER]","hpwOS/[VER];"]},"utils":{"Bot":"Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot","MobileBot":"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2","DesktopMode":"WPDesktop","TV":"SonyDTV|HbbTV","WebKit":"(webkit)[ /]([\\w.]+)","Console":"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\b","Watch":"SM-V700"}},"detectMobileBrowsers":{"fullPattern":/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,"shortPattern":/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,"tabletPattern":/android|ipad|playbook|silk/i}},X=Object.prototype.hasOwnProperty;function equalIC(V,$){return null!=V&&null!=$&&V.toLowerCase()===$.toLowerCase()}function containsIC(V,$){var z,X,Z=V.length;if(!Z||!$)return!1;for(z=$.toLowerCase(),X=0;X=0&&(ee=ee.substring(0,ce)+"([\\w._\\+]+)"+ee.substring(ce+5)),Z[ae]=new RegExp(ee,"i");le.props[$]=Z}convertPropsToRegExp(le.oss),convertPropsToRegExp(le.phones),convertPropsToRegExp(le.tablets),convertPropsToRegExp(le.uas),convertPropsToRegExp(le.utils),le.oss0={"WindowsPhoneOS":le.oss.WindowsPhoneOS,"WindowsMobileOS":le.oss.WindowsMobileOS}}(),z.findMatch=function(V,$){for(var z in V)if(X.call(V,z)&&V[z].test($))return z;return null},z.findMatches=function(V,$){var z=[];for(var Z in V)X.call(V,Z)&&V[Z].test($)&&z.push(Z);return z},z.getVersionStr=function(V,$){var Z,ee,ae,ie,ce=z.mobileDetectRules.props;if(X.call(ce,V))for(ae=(Z=ce[V]).length,ee=0;ee1&&(V=$[0]+".",$.shift(),V+=$.join("")),Number(V)},z.isMobileFallback=function(V){return z.detectMobileBrowsers.fullPattern.test(V)||z.detectMobileBrowsers.shortPattern.test(V.substr(0,4))},z.isTabletFallback=function(V){return z.detectMobileBrowsers.tabletPattern.test(V)},z.prepareDetectionCache=function(V,X,Z){if(V.mobile===$){var ee,ae,ie;if(ae=z.findMatch(z.mobileDetectRules.tablets,X))return V.mobile=V.tablet=ae,void(V.phone=null);if(ee=z.findMatch(z.mobileDetectRules.phones,X))return V.mobile=V.phone=ee,void(V.tablet=null);z.isMobileFallback(X)?(ie=MobileDetect.isPhoneSized(Z))===$?(V.mobile=z.FALLBACK_MOBILE,V.tablet=V.phone=null):ie?(V.mobile=V.phone=z.FALLBACK_PHONE,V.tablet=null):(V.mobile=V.tablet=z.FALLBACK_TABLET,V.phone=null):z.isTabletFallback(X)?(V.mobile=V.tablet=z.FALLBACK_TABLET,V.phone=null):V.mobile=V.tablet=V.phone=null}},z.mobileGrade=function(V){var $=null!==V.mobile();return V.os("iOS")&&V.version("iPad")>=4.3||V.os("iOS")&&V.version("iPhone")>=3.1||V.os("iOS")&&V.version("iPod")>=3.1||V.version("Android")>2.1&&V.is("Webkit")||V.version("Windows Phone OS")>=7||V.is("BlackBerry")&&V.version("BlackBerry")>=6||V.match("Playbook.*Tablet")||V.version("webOS")>=1.4&&V.match("Palm|Pre|Pixi")||V.match("hp.*TouchPad")||V.is("Firefox")&&V.version("Firefox")>=12||V.is("Chrome")&&V.is("AndroidOS")&&V.version("Android")>=4||V.is("Skyfire")&&V.version("Skyfire")>=4.1&&V.is("AndroidOS")&&V.version("Android")>=2.3||V.is("Opera")&&V.version("Opera Mobi")>11&&V.is("AndroidOS")||V.is("MeeGoOS")||V.is("Tizen")||V.is("Dolfin")&&V.version("Bada")>=2||(V.is("UC Browser")||V.is("Dolfin"))&&V.version("Android")>=2.3||V.match("Kindle Fire")||V.is("Kindle")&&V.version("Kindle")>=3||V.is("AndroidOS")&&V.is("NookTablet")||V.version("Chrome")>=11&&!$||V.version("Safari")>=5&&!$||V.version("Firefox")>=4&&!$||V.version("MSIE")>=7&&!$||V.version("Opera")>=10&&!$?"A":V.os("iOS")&&V.version("iPad")<4.3||V.os("iOS")&&V.version("iPhone")<3.1||V.os("iOS")&&V.version("iPod")<3.1||V.is("Blackberry")&&V.version("BlackBerry")>=5&&V.version("BlackBerry")<6||V.version("Opera Mini")>=5&&V.version("Opera Mini")<=6.5&&(V.version("Android")>=2.3||V.is("iOS"))||V.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||V.version("Opera Mobi")>=11&&V.is("SymbianOS")?"B":(V.version("BlackBerry")<5||V.match("MSIEMobile|Windows CE.*Mobile")||V.version("Windows Mobile"),"C")},z.detectOS=function(V){return z.findMatch(z.mobileDetectRules.oss0,V)||z.findMatch(z.mobileDetectRules.oss,V)},z.getDeviceSmallerSide=function(){return window.screen.width-1)&&(Se=At,ce=ce.slice(0,bt))}ce&&(ee.push(ce),ce="",pe=!1);var Mt="+"===ze||"*"===ze,St="?"===ze||"*"===ze,Tt=He||Qe,kt=Se||le;ee.push({"name":Te||ae++,"prefix":Se,"delimiter":kt,"optional":St,"repeat":Mt,"pattern":Tt?escapeGroup(Tt):"[^"+escapeString(kt===le?kt:kt+le)+"]+?"})}}return(ce||ieNumber(V)-Number($))).map(($=>V[$])):V}function removeHash(V){const $=V.indexOf("#");return-1!==$&&(V=V.slice(0,$)),V}function extract(V){const $=(V=removeHash(V)).indexOf("?");return-1===$?"":V.slice($+1)}function parseValue(V,$){return $.parseNumbers&&!Number.isNaN(Number(V))&&"string"==typeof V&&""!==V.trim()?V=Number(V):!$.parseBooleans||null===V||"true"!==V.toLowerCase()&&"false"!==V.toLowerCase()||(V="true"===V.toLowerCase()),V}function parse(V,$){validateArrayFormatSeparator(($=Object.assign({"decode":!0,"sort":!0,"arrayFormat":"none","arrayFormatSeparator":",","parseNumbers":!1,"parseBooleans":!1},$)).arrayFormatSeparator);const z=function parserForArrayFormat(V){let $;switch(V.arrayFormat){case"index":return(V,z,X)=>{$=/\[(\d*)\]$/.exec(V),V=V.replace(/\[\d*\]$/,""),$?(void 0===X[V]&&(X[V]={}),X[V][$[1]]=z):X[V]=z};case"bracket":return(V,z,X)=>{$=/(\[\])$/.exec(V),V=V.replace(/\[\]$/,""),$?void 0!==X[V]?X[V]=[].concat(X[V],z):X[V]=[z]:X[V]=z};case"colon-list-separator":return(V,z,X)=>{$=/(:list)$/.exec(V),V=V.replace(/:list$/,""),$?void 0!==X[V]?X[V]=[].concat(X[V],z):X[V]=[z]:X[V]=z};case"comma":case"separator":return($,z,X)=>{const Z="string"==typeof z&&z.includes(V.arrayFormatSeparator),ee="string"==typeof z&&!Z&&decode(z,V).includes(V.arrayFormatSeparator);z=ee?decode(z,V):z;const ae=Z||ee?z.split(V.arrayFormatSeparator).map(($=>decode($,V))):null===z?z:decode(z,V);X[$]=ae};case"bracket-separator":return($,z,X)=>{const Z=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!Z)return void(X[$]=z?decode(z,V):z);const ee=null===z?[]:z.split(V.arrayFormatSeparator).map(($=>decode($,V)));void 0!==X[$]?X[$]=[].concat(X[$],ee):X[$]=ee};default:return(V,$,z)=>{void 0!==z[V]?z[V]=[].concat(z[V],$):z[V]=$}}}($),X=Object.create(null);if("string"!=typeof V)return X;if(!(V=V.trim().replace(/^[?#&]/,"")))return X;for(const Z of V.split("&")){if(""===Z)continue;let[V,ae]=ee($.decode?Z.replace(/\+/g," "):Z,"=");ae=void 0===ae?null:["comma","separator","bracket-separator"].includes($.arrayFormat)?ae:decode(ae,$),z(decode(V,$),ae,X)}for(const V of Object.keys(X)){const z=X[V];if("object"==typeof z&&null!==z)for(const V of Object.keys(z))z[V]=parseValue(z[V],$);else X[V]=parseValue(z,$)}return!1===$.sort?X:(!0===$.sort?Object.keys(X).sort():Object.keys(X).sort($.sort)).reduce(((V,$)=>{const z=X[$];return Boolean(z)&&"object"==typeof z&&!Array.isArray(z)?V[$]=keysSorter(z):V[$]=z,V}),Object.create(null))}$.extract=extract,$.parse=parse,$.stringify=(V,$)=>{if(!V)return"";validateArrayFormatSeparator(($=Object.assign({"encode":!0,"strict":!0,"arrayFormat":"none","arrayFormatSeparator":","},$)).arrayFormatSeparator);const shouldFilter=z=>$.skipNull&&null==V[z]||$.skipEmptyString&&""===V[z],z=function encoderForArrayFormat(V){switch(V.arrayFormat){case"index":return $=>(z,X)=>{const Z=z.length;return void 0===X||V.skipNull&&null===X||V.skipEmptyString&&""===X?z:null===X?[...z,[encode($,V),"[",Z,"]"].join("")]:[...z,[encode($,V),"[",encode(Z,V),"]=",encode(X,V)].join("")]};case"bracket":return $=>(z,X)=>void 0===X||V.skipNull&&null===X||V.skipEmptyString&&""===X?z:null===X?[...z,[encode($,V),"[]"].join("")]:[...z,[encode($,V),"[]=",encode(X,V)].join("")];case"colon-list-separator":return $=>(z,X)=>void 0===X||V.skipNull&&null===X||V.skipEmptyString&&""===X?z:null===X?[...z,[encode($,V),":list="].join("")]:[...z,[encode($,V),":list=",encode(X,V)].join("")];case"comma":case"separator":case"bracket-separator":{const $="bracket-separator"===V.arrayFormat?"[]=":"=";return z=>(X,Z)=>void 0===Z||V.skipNull&&null===Z||V.skipEmptyString&&""===Z?X:(Z=null===Z?"":Z,0===X.length?[[encode(z,V),$,encode(Z,V)].join("")]:[[X,encode(Z,V)].join(V.arrayFormatSeparator)])}default:return $=>(z,X)=>void 0===X||V.skipNull&&null===X||V.skipEmptyString&&""===X?z:null===X?[...z,encode($,V)]:[...z,[encode($,V),"=",encode(X,V)].join("")]}}($),X={};for(const $ of Object.keys(V))shouldFilter($)||(X[$]=V[$]);const Z=Object.keys(X);return!1!==$.sort&&Z.sort($.sort),Z.map((X=>{const Z=V[X];return void 0===Z?"":null===Z?encode(X,$):Array.isArray(Z)?0===Z.length&&"bracket-separator"===$.arrayFormat?encode(X,$)+"[]":Z.reduce(z(X),[]).join("&"):encode(X,$)+"="+encode(Z,$)})).filter((V=>V.length>0)).join("&")},$.parseUrl=(V,$)=>{$=Object.assign({"decode":!0},$);const[z,X]=ee(V,"#");return Object.assign({"url":z.split("?")[0]||"","query":parse(extract(V),$)},$&&$.parseFragmentIdentifier&&X?{"fragmentIdentifier":decode(X,$)}:{})},$.stringifyUrl=(V,z)=>{z=Object.assign({"encode":!0,"strict":!0,[ie]:!0},z);const X=removeHash(V.url).split("?")[0]||"",Z=$.extract(V.url),ee=$.parse(Z,{"sort":!1}),ae=Object.assign(ee,V.query);let ce=$.stringify(ae,z);ce&&(ce=`?${ce}`);let le=function getHash(V){let $="";const z=V.indexOf("#");return-1!==z&&($=V.slice(z)),$}(V.url);return V.fragmentIdentifier&&(le=`#${z[ie]?encode(V.fragmentIdentifier,z):V.fragmentIdentifier}`),`${X}${ce}${le}`},$.pick=(V,z,X)=>{X=Object.assign({"parseFragmentIdentifier":!0,[ie]:!1},X);const{"url":Z,"query":ee,"fragmentIdentifier":ce}=$.parseUrl(V,X);return $.stringifyUrl({"url":Z,"query":ae(ee,z),"fragmentIdentifier":ce},X)},$.exclude=(V,z,X)=>{const Z=Array.isArray(z)?V=>!z.includes(V):(V,$)=>!z(V,$);return $.pick(V,Z,X)}},"4448":function(V,$,z){"use strict";var X=z(7294),Z=z(3840);function p(V){for(var $="https://reactjs.org/docs/error-decoder.html?invariant="+V,z=1;z