@tencentcloud/tuiroom-engine-uniapp-app
Version:
TUIRoomEngine UniApp(App) SDK
1 lines • 801 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TUIRoomEngine={})}(this,function(e){function t(e,t,n,o){var i,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,o);else for(var r=e.length-1;r>=0;r--)(i=e[r])&&(a=(s<3?i(a):s>3?i(t,n,a):i(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function n(e,t,n,o){return new(n||(n=Promise))(function(i,s){function a(e){try{c(o.next(e))}catch(t){s(t)}}function r(e){try{c(o.throw(e))}catch(t){s(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,r)}c((o=o.apply(e,t||[])).next())})}var o,i,s,a,r,c,u,l,d,p,_,g,h,f,m,v,y,I,M,C,T,E,R,D,S,L,A,k,O;"function"==typeof SuppressedError&&SuppressedError,e.TUIErrorCode=void 0,(o=e.TUIErrorCode||(e.TUIErrorCode={}))[o.ERR_SUCC=0]="ERR_SUCC",o[o.ERR_FAILED=-1]="ERR_FAILED",o[o.ERR_FREQ_LIMIT=-2]="ERR_FREQ_LIMIT",o[o.ERR_REPEAT_OPERATION=-3]="ERR_REPEAT_OPERATION",o[o.ERR_SDKAPPID_NOT_FOUND=-1e3]="ERR_SDKAPPID_NOT_FOUND",o[o.ERR_INVALID_PARAMETER=-1001]="ERR_INVALID_PARAMETER",o[o.ERR_SDK_NOT_INITIALIZED=-1002]="ERR_SDK_NOT_INITIALIZED",o[o.ERR_PERMISSION_DENIED=-1003]="ERR_PERMISSION_DENIED",o[o.ERR_REQUIRE_PAYMENT=-1004]="ERR_REQUIRE_PAYMENT",o[o.ERR_CAMERA_START_FAILED=-1100]="ERR_CAMERA_START_FAILED",o[o.ERR_CAMERA_NOT_AUTHORIZED=-1101]="ERR_CAMERA_NOT_AUTHORIZED",o[o.ERR_CAMERA_OCCUPIED=-1102]="ERR_CAMERA_OCCUPIED",o[o.ERR_CAMERA_DEVICE_EMPTY=-1103]="ERR_CAMERA_DEVICE_EMPTY",o[o.ERR_MICROPHONE_START_FAILED=-1104]="ERR_MICROPHONE_START_FAILED",o[o.ERR_MICROPHONE_NOT_AUTHORIZED=-1105]="ERR_MICROPHONE_NOT_AUTHORIZED",o[o.ERR_MICROPHONE_OCCUPIED=-1106]="ERR_MICROPHONE_OCCUPIED",o[o.ERR_MICROPHONE_DEVICE_EMPTY=-1107]="ERR_MICROPHONE_DEVICE_EMPTY",o[o.ERR_GET_SCREEN_SHARING_TARGET_FAILED=-1108]="ERR_GET_SCREEN_SHARING_TARGET_FAILED",o[o.ERR_START_SCREEN_SHARING_FAILED=-1109]="ERR_START_SCREEN_SHARING_FAILED",o[o.ERR_ROOM_ID_NOT_EXIST=-2100]="ERR_ROOM_ID_NOT_EXIST",o[o.ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM=-2101]="ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM",o[o.ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER=-2102]="ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER",o[o.ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE=-2103]="ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE",o[o.ERR_ROOM_ID_INVALID=-2105]="ERR_ROOM_ID_INVALID",o[o.ERR_ROOM_ID_OCCUPIED=-2106]="ERR_ROOM_ID_OCCUPIED",o[o.ERR_ROOM_NAME_INVALID=-2107]="ERR_ROOM_NAME_INVALID",o[o.ERR_ALREADY_IN_OTHER_ROOM=-2108]="ERR_ALREADY_IN_OTHER_ROOM",o[o.ERR_NEED_PASSWORD=-2109]="ERR_NEED_PASSWORD",o[o.ERR_WRONG_PASSWORD=-2110]="ERR_WRONG_PASSWORD",o[o.ERR_ROOM_USER_FULL=-2111]="ERR_ROOM_USER_FULL",o[o.ERR_USER_NOT_EXIST=-2200]="ERR_USER_NOT_EXIST",o[o.ERR_USER_NOT_ENTERED=-2201]="ERR_USER_NOT_ENTERED",o[o.ERR_NEED_OWNER_PERMISSION=-2300]="ERR_NEED_OWNER_PERMISSION",o[o.ERR_NEED_ADMIN_PERMISSION=-2301]="ERR_NEED_ADMIN_PERMISSION",o[o.ERR_REQUEST_NO_PERMISSION=-2310]="ERR_REQUEST_NO_PERMISSION",o[o.ERR_REQUEST_ID_INVALID=-2311]="ERR_REQUEST_ID_INVALID",o[o.ERR_REQUEST_ID_REPEAT=-2312]="ERR_REQUEST_ID_REPEAT",o[o.ERR_REQUEST_ID_CONFLICT=-2313]="ERR_REQUEST_ID_CONFLICT",o[o.ERR_MAX_SEAT_COUNT_LIMIT=-2340]="ERR_MAX_SEAT_COUNT_LIMIT",o[o.ERR_ALREADY_IN_SEAT=-2341]="ERR_ALREADY_IN_SEAT",o[o.ERR_SEAT_OCCUPIED=-2342]="ERR_SEAT_OCCUPIED",o[o.ERR_SEAT_LOCKED=-2343]="ERR_SEAT_LOCKED",o[o.ERR_SEAT_INDEX_NOT_EXIST=-2344]="ERR_SEAT_INDEX_NOT_EXIST",o[o.ERR_USER_NOT_IN_SEAT=-2345]="ERR_USER_NOT_IN_SEAT",o[o.ERR_ALL_SEAT_OCCUPIED=-2346]="ERR_ALL_SEAT_OCCUPIED",o[o.ERR_SEAT_NOT_SUPPORT_LINK_MIC=-2347]="ERR_SEAT_NOT_SUPPORT_LINK_MIC",o[o.ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK=-2360]="ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN=-2361]="ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK=-2370]="ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN=-2371]="ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK=-2372]="ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK",o[o.ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN=-2373]="ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN",o[o.ERR_SEND_MESSAGE_DISABLED_FOR_ALL=-2380]="ERR_SEND_MESSAGE_DISABLED_FOR_ALL",o[o.ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT=-2381]="ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT",e.TUIRole=void 0,(i=e.TUIRole||(e.TUIRole={}))[i.kRoomOwner=0]="kRoomOwner",i[i.kAdministrator=1]="kAdministrator",i[i.kGeneralUser=2]="kGeneralUser",e.TUIVideoQuality=void 0,(s=e.TUIVideoQuality||(e.TUIVideoQuality={}))[s.kVideoQuality_360p=1]="kVideoQuality_360p",s[s.kVideoQuality_540p=2]="kVideoQuality_540p",s[s.kVideoQuality_720p=3]="kVideoQuality_720p",s[s.kVideoQuality_1080p=4]="kVideoQuality_1080p",e.TUIAudioQuality=void 0,(a=e.TUIAudioQuality||(e.TUIAudioQuality={}))[a.kAudioProfileSpeech=0]="kAudioProfileSpeech",a[a.kAudioProfileDefault=1]="kAudioProfileDefault",a[a.kAudioProfileMusic=2]="kAudioProfileMusic",e.TUIVideoStreamType=void 0,(r=e.TUIVideoStreamType||(e.TUIVideoStreamType={}))[r.kCameraStream=0]="kCameraStream",r[r.kScreenStream=1]="kScreenStream",r[r.kCameraStreamLow=2]="kCameraStreamLow",e.TUINetworkQuality=void 0,(c=e.TUINetworkQuality||(e.TUINetworkQuality={}))[c.kQualityUnknown=0]="kQualityUnknown",c[c.kQualityExcellent=1]="kQualityExcellent",c[c.kQualityGood=2]="kQualityGood",c[c.kQualityPoor=3]="kQualityPoor",c[c.kQualityBad=4]="kQualityBad",c[c.kQualityVeryBad=5]="kQualityVeryBad",c[c.kQualityDown=6]="kQualityDown",e.TUIRoomType=void 0,(u=e.TUIRoomType||(e.TUIRoomType={}))[u.kConference=1]="kConference",u[u.kLive=2]="kLive",e.TUISeatMode=void 0,(l=e.TUISeatMode||(e.TUISeatMode={}))[l.kFreeToTake=1]="kFreeToTake",l[l.kApplyToTake=2]="kApplyToTake",e.TUIMediaDevice=void 0,(d=e.TUIMediaDevice||(e.TUIMediaDevice={}))[d.kMicrophone=1]="kMicrophone",d[d.kCamera=2]="kCamera",d[d.kScreen=3]="kScreen",e.TUICaptureSourceType=void 0,(p=e.TUICaptureSourceType||(e.TUICaptureSourceType={}))[p.kWindow=0]="kWindow",p[p.kScreen=1]="kScreen",e.TUIChangeReason=void 0,(_=e.TUIChangeReason||(e.TUIChangeReason={}))[_.kChangedBySelf=0]="kChangedBySelf",_[_.kChangedByAdmin=1]="kChangedByAdmin",e.TUIKickedOutOfRoomReason=void 0,(g=e.TUIKickedOutOfRoomReason||(e.TUIKickedOutOfRoomReason={}))[g.kKickedByAdmin=0]="kKickedByAdmin",g[g.kKickedByLoggedOnOtherDevice=1]="kKickedByLoggedOnOtherDevice",g[g.kKickedByServer=2]="kKickedByServer",e.TUIRequestAction=void 0,(h=e.TUIRequestAction||(e.TUIRequestAction={}))[h.kInvalidAction=0]="kInvalidAction",h[h.kRequestToOpenRemoteCamera=1]="kRequestToOpenRemoteCamera",h[h.kRequestToOpenRemoteMicrophone=2]="kRequestToOpenRemoteMicrophone",h[h.kRequestToConnectOtherRoom=3]="kRequestToConnectOtherRoom",h[h.kRequestToTakeSeat=4]="kRequestToTakeSeat",h[h.kRequestRemoteUserOnSeat=5]="kRequestRemoteUserOnSeat",h[h.kApplyToAdminToOpenLocalCamera=6]="kApplyToAdminToOpenLocalCamera",h[h.kApplyToAdminToOpenLocalMicrophone=7]="kApplyToAdminToOpenLocalMicrophone",h[h.kApplyToAdminToOpenLocalScreenShare=8]="kApplyToAdminToOpenLocalScreenShare",e.TUIRequestCallbackType=void 0,(f=e.TUIRequestCallbackType||(e.TUIRequestCallbackType={}))[f.kRequestAccepted=0]="kRequestAccepted",f[f.kRequestRejected=1]="kRequestRejected",f[f.kRequestCancelled=2]="kRequestCancelled",f[f.kRequestTimeout=3]="kRequestTimeout",f[f.kRequestError=4]="kRequestError",f[f.kRequestId=5]="kRequestId",e.TRTCRole=void 0,(m=e.TRTCRole||(e.TRTCRole={}))[m.kAnchor=0]="kAnchor",m[m.kAudience=1]="kAudience",e.TUIResolutionMode=void 0,(v=e.TUIResolutionMode||(e.TUIResolutionMode={}))[v.kResolutionMode_Landscape=0]="kResolutionMode_Landscape",v[v.kResolutionMode_Portrait=1]="kResolutionMode_Portrait",e.TUIMediaDeviceType=void 0,(y=e.TUIMediaDeviceType||(e.TUIMediaDeviceType={}))[y.kMediaDeviceTypeUnknown=-1]="kMediaDeviceTypeUnknown",y[y.kMediaDeviceTypeAudioInput=0]="kMediaDeviceTypeAudioInput",y[y.kMediaDeviceTypeAudioOutput=1]="kMediaDeviceTypeAudioOutput",y[y.kMediaDeviceTypeVideoCamera=2]="kMediaDeviceTypeVideoCamera",e.TUIMediaDeviceState=void 0,(I=e.TUIMediaDeviceState||(e.TUIMediaDeviceState={}))[I.kMediaDeviceStateAdd=0]="kMediaDeviceStateAdd",I[I.kMediaDeviceStateRemove=1]="kMediaDeviceStateRemove",I[I.kMediaDeviceStateActive=2]="kMediaDeviceStateActive",e.TUIAudioRoute=void 0,(M=e.TUIAudioRoute||(e.TUIAudioRoute={}))[M.kAudioRouteSpeakerphone=0]="kAudioRouteSpeakerphone",M[M.kAudioRouteEarpiece=1]="kAudioRouteEarpiece",e.TUIConferenceStatus=void 0,(C=e.TUIConferenceStatus||(e.TUIConferenceStatus={}))[C.kConferenceStatusNone=0]="kConferenceStatusNone",C[C.kConferenceStatusNotStarted=1]="kConferenceStatusNotStarted",C[C.kConferenceStatusRunning=2]="kConferenceStatusRunning",e.TUIConferenceCancelReason=void 0,(T=e.TUIConferenceCancelReason||(e.TUIConferenceCancelReason={}))[T.kConferenceCancelReasonCancelledByAdmin=0]="kConferenceCancelReasonCancelledByAdmin",T[T.kConferenceCancelReasonRemovedFromAttendees=1]="kConferenceCancelReasonRemovedFromAttendees",e.TUIInvitationStatus=void 0,(E=e.TUIInvitationStatus||(e.TUIInvitationStatus={}))[E.kNone=0]="kNone",E[E.kPending=1]="kPending",E[E.kTimeout=2]="kTimeout",E[E.kAccepted=3]="kAccepted",E[E.kRejected=4]="kRejected",e.TUIInvitationCode=void 0,(R=e.TUIInvitationCode||(e.TUIInvitationCode={}))[R.kSuccess=0]="kSuccess",R[R.kAlreadyInInvitationList=1]="kAlreadyInInvitationList",R[R.kAlreadyInConference=2]="kAlreadyInConference",e.TUIInvitationRejectedReason=void 0,(D=e.TUIInvitationRejectedReason||(e.TUIInvitationRejectedReason={}))[D.kRejectToEnter=0]="kRejectToEnter",D[D.kInOtherConference=1]="kInOtherConference",e.TUIRoomEvents=void 0,(S=e.TUIRoomEvents||(e.TUIRoomEvents={})).onError="onError",S.onKickedOutOfRoom="onKickedOutOfRoom",S.onKickedOffLine="onKickedOffLine",S.onUserSigExpired="onUserSigExpired",S.onRoomDismissed="onRoomDismissed",S.onRoomNameChanged="onRoomNameChanged",S.onRoomSeatModeChanged="onRoomSeatModeChanged",S.onAllUserCameraDisableChanged="onAllUserCameraDisableChanged",S.onAllUserMicrophoneDisableChanged="onAllUserMicrophoneDisableChanged",S.onScreenShareForAllUserDisableChanged="onScreenShareForAllUserDisableChanged",S.onSendMessageForAllUserDisableChanged="onSendMessageForAllUserDisableChanged",S.onRemoteUserEnterRoom="onRemoteUserEnterRoom",S.onRemoteUserLeaveRoom="onRemoteUserLeaveRoom",S.onUserInfoChanged="onUserInfoChanged",S.onUserRoleChanged="onUserRoleChanged",S.onUserVideoStateChanged="onUserVideoStateChanged",S.onUserAudioStateChanged="onUserAudioStateChanged",S.onSendMessageForUserDisableChanged="onSendMessageForUserDisableChanged",S.onUserVoiceVolumeChanged="onUserVoiceVolumeChanged",S.onUserNetworkQualityChanged="onUserNetworkQualityChanged",S.onSeatListChanged="onSeatListChanged",S.onKickedOffSeat="onKickedOffSeat",S.onRequestReceived="onRequestReceived",S.onRequestCancelled="onRequestCancelled",S.onRequestProcessed="onRequestProcessed",S.onReceiveTextMessage="onReceiveTextMessage",S.onReceiveCustomMessage="onReceiveCustomMessage",S.onDeviceChange="onDeviceChange",S.onUserScreenCaptureStopped="onUserScreenCaptureStopped",S.onUserScreenCapturePaused="onUserScreenCapturePaused",S.onUserScreenCaptureResumed="onUserScreenCaptureResumed",e.TUIRoomDeviceMangerEvents=void 0,(L=e.TUIRoomDeviceMangerEvents||(e.TUIRoomDeviceMangerEvents={})).onDeviceChanged="onDeviceChanged",L.onTestMicVolume="onTestMicVolume",L.onTestSpeakerVolume="onTestSpeakerVolume",e.TUIConferenceListManagerEvents=void 0,(A=e.TUIConferenceListManagerEvents||(e.TUIConferenceListManagerEvents={})).onConferenceScheduled="onConferenceScheduled",A.onConferenceWillStart="onConferenceWillStart",A.onConferenceCancelled="onConferenceCancelled",A.onConferenceInfoChanged="onConferenceInfoChanged",A.onScheduleAttendeesChanged="onScheduleAttendeesChanged",A.onConferenceStatusChanged="onConferenceStatusChanged",e.TUIConferenceInvitationManagerEvents=void 0,(k=e.TUIConferenceInvitationManagerEvents||(e.TUIConferenceInvitationManagerEvents={})).onReceiveInvitation="onReceiveInvitation",k.onInvitationHandledByOtherDevice="onInvitationHandledByOtherDevice",k.onInvitationCancelled="onInvitationCancelled",k.onInvitationAccepted="onInvitationAccepted",k.onInvitationRejected="onInvitationRejected",k.onInvitationTimeout="onInvitationTimeout",k.onInvitationRevokedByAdmin="onInvitationRevokedByAdmin",k.onInvitationAdded="onInvitationAdded",k.onInvitationRemoved="onInvitationRemoved",k.onInvitationStatusChanged="onInvitationStatusChanged",e.TXAudioEffectManagerEvents=void 0,(O=e.TXAudioEffectManagerEvents||(e.TXAudioEffectManagerEvents={})).onStart="onStart",O.onPlayProgress="onPlayProgress",O.onComplete="onComplete";const N=e=>"function"==typeof e,P=e=>void 0===e,G=e=>"string"==typeof e,U=e=>"number"==typeof e;function b(e){return Reflect.apply(Object.prototype.toString,e,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}const w=function(e){if(!e||"object"!=typeof e||"[object Object]"!=Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Function.prototype.toString.call(n)===Function.prototype.toString.call(Object)};function F(e){if("string"!=typeof e)return e;let t;try{const n=JSON.parse(e);t="object"==typeof n&&n?n:e}catch(n){t=e}return t}class q extends Error{constructor(e){const{code:t,message:n,name:o}=e;super(n),this.code=t,this.message=n,this.name=o||""}}const V="INVALID_PARAMETER_REQUIRED",x="INVALID_PARAMETER_TYPE",B="INVALID_PARAMETER_EMPTY",H="INVALID_PARAMETER_INSTANCE",K="INVALID_PARAMETER_RANGE",W="CANNOT_LESS_THAN_ZERO",Y={INVALID_PARAMETER_REQUIRED:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' is a required param when calling ${o}(), received: ${i}.`},INVALID_PARAMETER_TYPE:e=>{const{key:t,rule:n,fnName:o,value:i}=e,s=`${t||n.name}`;let a="";return a=Array.isArray(n.type)?n.type.join("|"):n.type,`'${s}' must be type of ${a} when calling ${o}(), received type: ${b(i)}.`},INVALID_PARAMETER_EMPTY:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' cannot be '${i}' when calling ${o}().`},INVALID_PARAMETER_INSTANCE:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${`${t||n.name}`}' must be instanceof ${`${n.instanceOf.name||n.instanceOf}`} when calling ${o}(), received type: ${b(i)}.`},INVALID_PARAMETER_RANGE:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' must be one of ${n.values.join("|")} when calling ${o}(), received: ${i}.`},CANNOT_LESS_THAN_ZERO:e=>{const{key:t,rule:n,fnName:o,value:i}=e;return`'${t||n.name}' cannot be less than 0 when calling ${o}().`},xxx:"lajfl "};function j(e){const{key:t,data:n}=e;return Y[t]?N(Y[t])?Y[t](n):G(Y[t])?Y[t]:"":""}function J(...e){return function(t,n,o){const i=o.value;return o.value=function(...t){return X.call(this,e,t,n,this.className),i.apply(this,t)},o}}function z(...e){return function(t,o,i){const s=i.value;return i.value=function(...t){return n(this,void 0,void 0,function*(){return X.call(this,e,t,o,this.className),s.apply(this,t)})},i}}function X(e,t,n,o){try{for(let i=0;i<e.length;i++)Q.call(this,{rule:e[i],value:t[i],key:e[i].name,fnName:n,className:o})}catch(i){throw console.error(i,i.code,i.message),i}}function Q(t){const{rule:n,value:o,key:i,fnName:s,className:a}=t;if(P(o)){if(n.required)throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:V,data:{key:i,rule:n,fnName:s,value:o}})});return}if(Array.isArray(n.type)){if(!n.type.map(e=>e.toLowerCase()).includes(b(o)))throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:x,data:{key:i,rule:n,fnName:s,value:o}})})}else if(!P(n.type)&&b(o)!==n.type)throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:x,data:{key:i,rule:n,fnName:s,value:o}})});if(!1===n.allowEmpty){const t=U(o)&&(0===o||Number.isNaN(o)),a=G(o)&&""===o.trim();if(t||a)throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:B,data:{key:i,rule:n,fnName:s,value:o}})})}if(n.notLessThanZero&&U(o)&&o<0)throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:W,data:{key:i,rule:n,fnName:s,value:o}})});if(G(n.instanceOf)){if(!o||o.name_!==n.instanceOf)throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:H,data:{key:i,rule:n,fnName:s,value:o}})})}else if(N(n.instanceOf)&&!(o instanceof n.instanceOf))throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:H,data:{key:i,rule:n,fnName:s,value:o}})});if(n.values&&!n.values.includes(o))throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:j({key:K,data:{key:i,rule:n,fnName:s,value:o}})});const{properties:r}=n;w(r)&&"object"===b(o)&&Object.keys(r).forEach(e=>{Q.call(this,{rule:r[e],value:o&&o[e],key:`${i}.${e}`,fnName:s,className:a})});const{arrayItem:c}=n;w(c)&&(e=>"array"===b(e))(o)&&o.forEach((e,t)=>{Q.call(this,{rule:c,value:e,key:`${i}[${t}]`,fnName:s,className:a})}),N(n.validate)&&n.validate.call(this,o,i,s,a,this)}const Z=new WeakMap;function $(){return function(e,t,n){const o=n.value,i=e=>{const{fn:t,args:n,context:o,resolve:s,reject:a}=e;t.apply(o,n).then(s,a).finally(()=>{const e=Z.get(o);e&&(e.shift(),e[0]&&i(Object.assign({},e[0])))})};return n.value=function(...e){return new Promise((n,s)=>{if(Z.has(this)){const a=Z.get(this),{length:r}=a;a.push({fn:o,args:e,context:this,resolve:n,reject:s,name:t}),0===r&&i({fn:o,args:e,context:this,resolve:n,reject:s})}else Z.set(this,[{fn:o,args:e,context:this,resolve:n,reject:s,name:t}]),i({fn:o,args:e,context:this,resolve:n,reject:s})})},n}}const ee="string",te="number",ne="boolean",oe="array",ie="object",se="null",ae="uniapp",re=1,ce={login:{name:"options",required:!0,type:ie,properties:{sdkAppId:{required:!0,type:te,allowEmpty:!1},userId:{required:!0,type:ee,allowEmpty:!1},userSig:{required:!0,type:ee,allowEmpty:!1}}},setSelfInfo:{name:"options",required:!0,type:ie,properties:{userName:{required:!0,type:ee},avatarUrl:{required:!0,type:ee},customInfo:{required:!1,type:ie,allowEmpty:!1}}},createRoom:{name:"options",required:!0,type:ie,properties:{roomId:{required:!0,type:ee,allowEmpty:!1},roomName:{type:ee,allowEmpty:!1},roomType:{instanceof:e.TUIRoomType},isMicrophoneDisableForAllUser:{type:ne},isScreenShareDisableForAllUser:{type:ne},isCameraDisableForAllUser:{type:ne},isMessageDisableForAllUser:{type:ne},maxSeatCount:{type:te},password:{type:ee}}},enterRoom:{name:"options",required:!0,type:ie,properties:{roomId:{required:!0,type:ee,allowEmpty:!1},roomType:{instanceof:e.TUIRoomType},options:{type:ie,properties:{password:{type:ee}}}}},updateRoomNameByAdmin:{name:"options",require:!0,type:ie,properties:{roomName:{require:!0,type:ee,allowEmpty:!1}}},setRoomMaxSeatCount:{name:"options",require:!0,type:ie,properties:{maxSeatCount:{require:!0,type:te}}},getUserList:{name:"options",required:!1,type:ie,properties:{nextSequence:{type:ee}}},getUserInfo:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1}}},setCustomInfoForUser:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},customInfo:{required:!0,type:ie,allowEmpty:!1}}},takeSeat:{name:"options",required:!0,type:ie,properties:{seatIndex:{required:!0,type:te},timeout:{required:!0,type:te},requestCallback:{instanceof:Function}}},getSeatList:{},openRemoteDeviceByAdmin:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},timeout:{required:!0,type:te},device:{require:!0,instanceof:e.TUIMediaDevice}}},closeRemoteDeviceByAdmin:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},device:{required:!0,instanceof:e.TUIMediaDevice}}},takeUserOnSeatByAdmin:{name:"options",required:!0,type:ie,properties:{seatIndex:{required:!0,type:te},userId:{required:!0,type:ee,allowEmpty:!1},timeout:{required:!0,type:te},requestCallback:{instanceof:Function}}},kickUserOffSeatByAdmin:{name:"options",required:!0,type:ie,properties:{seatIndex:{required:!0,type:te},userId:{required:!0,type:ee,allowEmpty:!1}}},cancelRequest:{name:"options",required:!0,type:ie,properties:{requestId:{required:!0,type:ee,allowEmpty:!1}}},responseRemoteRequest:{name:"options",required:!0,type:ie,properties:{requestId:{required:!0,type:ee,allowEmpty:!1},agree:{required:!0,type:ne}}},setLocalVideoView:{name:"options",required:!1,type:ie,properties:{view:{required:!1,type:[ee,oe,se],allowEmpty:!1,validate:t=>{if(t instanceof Array){if(t.some(e=>null===e))throw new q({code:e.TUIErrorCode.ERR_INVALID_PARAMETER,message:"When calling the setLocalVideoView interface with the view parameter as an array, the array content cannot contain null."})}}}}},openLocalCamera:{name:"options",type:ie,properties:{isFrontCamera:{type:ne,allowEmpty:!1}}},closeLocalCamera:{},openLocalMicrophone:{},closeLocalMicrophone:{},setVideoResolutionMode:{name:"options",required:!0,type:ie,properties:{streamType:{required:!0,instanceof:e.TUIVideoStreamType},resolutionMode:{required:!0,instanceof:e.TUIResolutionMode}}},updateVideoQuality:{name:"options",required:!0,type:ie,properties:{quality:{required:!0,instanceof:e.TUIVideoQuality}}},updateVideoQualityEx:{name:"options",required:!0,type:ie,properties:{streamType:{required:!0,instanceof:e.TUIVideoStreamType},encoderParams:{required:!0,properties:{quality:{instanceof:e.TUIVideoQuality},fps:{type:te},bitrate:{type:te},resolutionMode:{instanceof:e.TUIResolutionMode}}}}},updateAudioQuality:{name:"options",required:!0,type:ie,properties:{quality:{required:!0,instanceof:e.TUIAudioQuality}}},muteRemoteAudioStream:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},isMute:{required:!0,type:ne}}},startPushLocalVideo:{},stopPushLocalVideo:{},startPushLocalAudio:{},stopPushLocalAudio:{},setRemoteVideoView:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType},view:{required:!0,type:[ee,oe],allowEmpty:!1}}},startPlayRemoteVideo:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType}}},stopPlayRemoteVideo:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},streamType:{required:!0,instanceof:e.TUIVideoStreamType}}},changeUserRole:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},userRole:{required:!0,instanceof:e.TUIRole}}},changeUserNameCard:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1},nameCard:{required:!0,type:ee}}},kickRemoteUserOutOfRoom:{name:"options",required:!0,type:ie,properties:{userId:{required:!0,type:ee,allowEmpty:!1}}},sendTextMessage:{name:"options",required:!0,type:ie,properties:{messageText:{require:!0,type:ee,allowEmpty:!1}}},sendCustomMessage:{name:"options",required:!0,type:ie,properties:{messageText:{require:!0,type:ee,allowEmpty:!1}}},startScreenSharing:{name:"options",type:ie,properties:{screenAudio:{type:ne},view:{type:ee}}},enableSystemAudioSharing:{name:"options",required:!0,type:ie,properties:{enable:{required:!0,type:ne}}},stopScreenSharing:{},startScreenSharingElectron:{name:"options",required:!0,type:[ie,"string"],properties:{targetId:{require:!0,type:ee},view:{type:ee}}},selectScreenSharingTarget:{name:"options",required:!0,type:[ie,"string"],properties:{targetId:{require:!0,type:ee}}},setCurrentCameraDevice:{name:"options",required:!0,type:ie,properties:{deviceId:{require:!0,type:ee}}},setCurrentMicDevice:{name:"options",required:!0,type:ie,properties:{deviceId:{require:!0,type:ee}}},setCurrentSpeakerDevice:{name:"options",required:!0,type:ie,properties:{deviceId:{require:!0,type:ee}}},disableDeviceForAllUserByAdmin:{name:"options",required:!0,type:ie,properties:{isDisable:{require:!0,type:ne},device:{require:!0,instanceof:e.TUIMediaDevice}}},disableSendingMessageForAllUser:{name:"options",required:!0,type:ie,properties:{isDisable:{require:!0,type:ne}}},disableSendingMessageByAdmin:{name:"options",required:!0,type:ie,properties:{userId:{require:!0,instanceof:ee},isDisable:{require:!0,type:ne}}},updateRoomSeatModeByAdmin:{name:"options",required:!0,type:ie,properties:{seatMode:{require:!0,instanceof:e.TUISeatMode}}},updateRoomPasswordByAdmin:{name:"options",required:!0,type:ie,properties:{password:{required:!0,type:ee,allowEmpty:!1}}},applyToAdminToOpenLocalDevice:{name:"options",required:!0,type:ie,properties:{timeout:{required:!0,type:te},device:{require:!0,instanceof:e.TUIMediaDevice}}},setMaxSeatCount:{name:"options",required:!0,type:ie,properties:{maxSeatCount:{require:!0,type:te}}},lockSeatByAdmin:{name:"options",required:!0,type:ie,properties:{seatIndex:{required:!0,type:te},lockParams:{require:!0,type:ie,properties:{lockSeat:{require:!0,type:ne},lockVideo:{require:!0,type:ne},lockAudio:{require:!0,type:ne}}}}}},ue="iOS"===plus.os.name;var le={judgeIosPermission:function(e){return"location"==e?function(){let e=!1;const t=plus.ios.import("CLLocationManager");return e=2!=t.authorizationStatus(),console.log(`定位权限开启:${e}`),plus.ios.deleteObject(t),e}():"camera"==e?function(){let e=!1;const t=plus.ios.import("AVCaptureDevice"),n=t.authorizationStatusForMediaType("vide");return console.log(`authStatus:${n}`),3==n?(e=!0,console.log("相机权限已经开启")):console.log("相机权限没有开启"),plus.ios.deleteObject(t),e}():"photoLibrary"==e?function(){let e=!1;const t=plus.ios.import("PHPhotoLibrary"),n=t.authorizationStatus();return console.log(`authStatus:${n}`),3==n?(e=!0,console.log("相册权限已经开启")):console.log("相册权限没有开启"),plus.ios.deleteObject(t),e}():"record"==e?function(){let e=!1;const t=plus.ios.import("AVAudioSession"),n=t.sharedInstance().recordPermission();return console.log(`permissionStatus:${n}`),1684369017==n||1970168948==n?console.log("麦克风权限没有开启"):(e=!0,console.log("麦克风权限已经开启")),plus.ios.deleteObject(t),e}():"push"==e?function(){let e=!1;const t=plus.ios.import("UIApplication"),n=t.sharedApplication();let o=0;if(n.currentUserNotificationSettings){const t=n.currentUserNotificationSettings();o=t.plusGetAttribute("types"),console.log(`enabledTypes1:${o}`),0==o?console.log("推送权限没有开启"):(e=!0,console.log("已经开启推送功能!")),plus.ios.deleteObject(t)}else o=n.enabledRemoteNotificationTypes(),0==o?console.log("推送权限没有开启!"):(e=!0,console.log("已经开启推送功能!")),console.log(`enabledTypes2:${o}`);return plus.ios.deleteObject(n),plus.ios.deleteObject(t),e}():"contact"==e?function(){let e=!1;const t=plus.ios.import("CNContactStore");return 3==t.authorizationStatusForEntityType(0)?(e=!0,console.log("通讯录权限已经开启")):console.log("通讯录权限没有开启"),plus.ios.deleteObject(t),e}():"calendar"==e?function(){let e=!1;const t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(0)?(e=!0,console.log("日历权限已经开启")):console.log("日历权限没有开启"),plus.ios.deleteObject(t),e}():"memo"==e&&function(){let e=!1;const t=plus.ios.import("EKEventStore");return 3==t.authorizationStatusForEntityType(1)?(e=!0,console.log("备忘录权限已经开启")):console.log("备忘录权限没有开启"),plus.ios.deleteObject(t),e}()},requestAndroidPermission:function(e){return new Promise((t,n)=>{plus.android.requestPermissions([e],e=>{let n=0;for(let t=0;t<e.granted.length;t++){const o=e.granted[t];console.log(`已获取的权限:${o}`),n=1}for(let t=0;t<e.deniedPresent.length;t++){const o=e.deniedPresent[t];console.log(`拒绝本次申请的权限:${o}`),n=0}for(let t=0;t<e.deniedAlways.length;t++){const o=e.deniedAlways[t];console.log(`永久拒绝申请的权限:${o}`),n=-1}t(n)},e=>{console.log(`申请权限错误:${e.code} = ${e.message}`),t({code:e.code,message:e.message})})})},checkSystemEnableLocation:function(){if(ue){let e=!1;const t=plus.ios.import("CLLocationManager");return e=t.locationServicesEnabled(),console.log(`系统定位开启:${e}`),plus.ios.deleteObject(t),e}const e=plus.android.importClass("android.content.Context"),t=plus.android.importClass("android.location.LocationManager"),n=plus.android.runtimeMainActivity().getSystemService(e.LOCATION_SERVICE).isProviderEnabled(t.GPS_PROVIDER);return console.log(`系统定位开启:${n}`),n},gotoAppPermissionSetting:function(){if(ue){const e=plus.ios.import("UIApplication").sharedApplication(),t=plus.ios.import("NSURL"),n=t.URLWithString("app-settings:");e.openURL(n),plus.ios.deleteObject(n),plus.ios.deleteObject(t),plus.ios.deleteObject(e)}else{const e=plus.android.importClass("android.content.Intent"),t=plus.android.importClass("android.provider.Settings"),n=plus.android.importClass("android.net.Uri"),o=plus.android.runtimeMainActivity(),i=new e;i.setAction(t.ACTION_APPLICATION_DETAILS_SETTINGS);const s=n.fromParts("package",o.getPackageName(),null);i.setData(s),o.startActivity(i)}}},de="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},pe={};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,o,s,a){if("function"!=typeof o)throw new TypeError("The listener must be a function");var r=new i(o,s||e,a),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],r]:e._events[c].push(r):(e._events[c]=r,e._eventsCount++),e}function a(e,t){0===--e._eventsCount?e._events=new o:delete e._events[t]}function r(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),r.prototype.eventNames=function(){var e,o,i=[];if(0===this._eventsCount)return i;for(o in e=this._events)t.call(e,o)&&i.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},r.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var i=0,s=o.length,a=new Array(s);i<s;i++)a[i]=o[i].fn;return a},r.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},r.prototype.emit=function(e,t,o,i,s,a){var r=n?n+e:e;if(!this._events[r])return!1;var c,u,l=this._events[r],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,o),!0;case 4:return l.fn.call(l.context,t,o,i),!0;case 5:return l.fn.call(l.context,t,o,i,s),!0;case 6:return l.fn.call(l.context,t,o,i,s,a),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var p,_=l.length;for(u=0;u<_;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,o);break;case 4:l[u].fn.call(l[u].context,t,o,i);break;default:if(!c)for(p=1,c=new Array(d-1);p<d;p++)c[p-1]=arguments[p];l[u].fn.apply(l[u].context,c)}}return!0},r.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},r.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},r.prototype.removeListener=function(e,t,o,i){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var r=this._events[s];if(r.fn)r.fn!==t||i&&!r.once||o&&r.context!==o||a(this,s);else{for(var c=0,u=[],l=r.length;c<l;c++)(r[c].fn!==t||i&&!r[c].once||o&&r[c].context!==o)&&u.push(r[c]);u.length?this._events[s]=1===u.length?u[0]:u:a(this,s)}return this},r.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new o,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prefixed=n,r.EventEmitter=r,e.exports=r}({get exports(){return pe},set exports(e){pe=e}});var _e=pe;class ge{constructor(e){const{Module:t,logger:n}=e;this.deviceManager||(this.logger=n,this.deviceManager=t)}static getInstance(e){return ge.instance||(ge.instance=new ge(e)),ge.instance}JSCallNativeFunctionSync(e,t){return this.deviceManager[e](t)}switchCamera(e){return n(this,void 0,void 0,function*(){this.logger.info("deviceManager.switchCamera with options: ",e);const{isFrontCamera:t}=e,n={frontCamera:t};yield this.JSCallNativeFunctionSync("switchCamera",n)})}}class he{constructor(e){const{Module:t,logger:n}=e;this.trtcCloud||(this.logger=n,this.trtcCloud=t)}static getInstance(e){return he.instance||(he.instance=new he(e)),he.instance}JSCallNativeFunctionSync(e,t){return this.trtcCloud[e](t)}setLocalRenderParams(e){return n(this,void 0,void 0,function*(){this.logger.info("trtcCloud.setLocalRenderParams with options: ",e),yield this.JSCallNativeFunctionSync("setLocalRenderParams",e)})}}var fe={};!function(e){e.exports=function(){function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function t(e){if(Array.isArray(e))return e}function n(e,t,n){t=c(t);var o=e;if(!(t=l()?Reflect.construct(t,n||[],c(e).constructor):t.apply(e,n))||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=o))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,y(o.key),o)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t){var n,o,i,s,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(o=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return o=e.done,e},e:function(e){i=!0,n=e},f:function(){try{o||null==a.return||a.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(a=M(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),s=0,{s:t=function(){},n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:t};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 r(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function d(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function p(){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 _(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){if(null==e)return{};var n,o=function(e,t){if(null==e)return{};var n,o={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(0<=t.indexOf(n))continue;o[n]=e[n]}return o}(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),s=0;s<i.length;s++)n=i[s],0<=t.indexOf(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function m(e,n){return t(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,s,a,r=[],c=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=s.call(n)).done)&&(r.push(o.value),r.length!==t);c=!0);}catch(e){u=!0,i=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return r}}(e,n)||M(e,n)||p()}function v(t){return function(t){if(Array.isArray(t))return e(t)}(t)||d(t)||M(t)||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 y(e){return e=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);if("object"!=typeof(t=t.call(e,"string")))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),"symbol"==typeof e?e:e+""}function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function M(t,n){var o;if(t)return"string"==typeof t?e(t,n):"Map"===(o="Object"===(o={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:o)||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?e(t,n):void 0}function C(e){var t="function"==typeof Map?new Map:void 0;return function(e){if(null===e||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){var o;return l()?Reflect.construct.apply(null,arguments):((o=[null]).push.apply(o,t),t=new(e.bind.apply(e,o)),n&&f(t,n.prototype),t)}(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),f(n,e)}(e)}var T={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",MY_FOLLOWERS_LIST_UPDATED:"onMyFollowersListUpdated",MY_FOLLOWING_LIST_UPDATED:"onMyFollowingListUpdated",MUTUAL_FOLLOWERS_LIST_UPDATED:"onMutualFollowersListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",ALL_RECEIVE_MESSAGE_OPT_UPDATED:"onAllReceiveMessageOptUpdated",SERVER_CONFIG_UPDATED:"onServerConfigUpdated",PINNED_GROUP_MESSAGE_UPDATED:"onPinnedGroupMessageUpdated"},E={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_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_ROOM:"Room",GRP_LIVE:"Live",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",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,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",RECEIVE_WITH_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_OFFLINE_PUSH_EXCEPT_AT:"AcceptNotNotifyExceptAt",NOT_RECEIVE_MSG_EXCEPT_AT:"NotReceiveMsgExceptAt",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",KICKED_OUT_REST_API:"REST_API_Kick",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",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",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_INVITE_OPTION:"inviteOption",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__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3,IOS_OFFLINE_PUSH_NO_SOUND:"push.no_sound",IOS_OFFLINE_PUSH_DEFAULT_SOUND:"default"},R={NEW_INVITATION_RECEIVED:"newInvitationReceived",INVITEE_ACCEPTED:"ts_invitee_accepted",INVITEE_REJECTED:"ts_invitee_rejected",INVITATION_CANCELLED:"ts_invitation_cancelled",INVITATION_TIMEOUT:"ts_invitation_timeout",INVITATION_MODIFIED:"ts_invitation_modified",ACTION_TYPE_UNKNOWN:0,ACTION_TYPE_INVITE:1,ACTION_TYPE_CANCEL_INVITE:2,ACTION_TYPE_ACCEPT_INVITE:3,ACTION_TYPE_REJECT_INVITE:4,ACTION_TYPE_INVITE_TIMEOUT:5},D=s(function e(){o(this,e),this.cache=[],this.options=null},[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&0<this.middlewares.length)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map(function(e){return e}),this.options=e,this.next()}}]),S=s(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n},[{key:"equal",value:function(e){return null!==e&&this.low===e.low&&this.high===e.high}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),L={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"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",BACKUP_WEB:"wss://*w4s.my-cpaas.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",BACKUP_WEB:"wss://*w4k.my-cpaas.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",BACKUP_WEB:"wss://*w4g.my-cpaas.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",BACKUP_WEB:"wss://*w4i.my-cpaas.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com",ANYCAST:"wss://162.14.13.254"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",BACKUP_WEB:"wss://*w4u.my-cpaas.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},A={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},k="1.7.3",O=537048168,N="CHINA",P={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){this.CURRENT=L.PRODUCTION[0<arguments.length&&void 0!==arguments[0]?arguments[0]:N]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_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_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},G={SEARCH_GRP_SNS:new S(0,Math.pow(2,1)).toString(),AV_HISTORY_MSG:new S(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new S(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new S(0,Math.pow(2,4)).toString(),AV_MBR_LIST:new S(0,Math.pow(2,6)).toString(),USER_STATUS:new S(0,Math.pow(2,7)).toString(),CONV_MARK:new S(0,Math.pow(2,9)).toString(),CONV_GROUP:new S(0,Math.pow(2,10)).toString(),AV_BAN_MBR:new S(0,Math.pow(2,11)).toString(),MSG_EXT:new S(0,