!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("trtc-cloud-js-sdk"),require("@tencentcloud/chat")):"function"==typeof define&&define.amd?define(["trtc-cloud-js-sdk","@tencentcloud/chat"],e):"object"==typeof exports?exports["tuicall-engine-webrtc"]=e(require("trtc-cloud-js-sdk"),require("@tencentcloud/chat")):t["tuicall-engine-webrtc"]=e(t.TRTC_Cloud,t.ChatSDK)}(window,(function(t,e){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e,n){"use strict";n.r(e),n.d(e,"mainUrl",(function(){return a})),n.d(e,"backupUrl",(function(){return o})),n.d(e,"Mode",(function(){return s})),n.d(e,"Role",(function(){return l})),n.d(e,"VIDEO_STAT_BIT",(function(){return u})),n.d(e,"AUDIO_STAT_BIT",(function(){return c})),n.d(e,"AUDIO_MUTE_BIT",(function(){return d})),n.d(e,"VIDEO_MUTE_BIT",(function(){return p})),n.d(e,"VIDEO_MUTED_MASK",(function(){return h})),n.d(e,"AUX_VIDEO_MUTED_MASK",(function(){return _})),n.d(e,"AUDIO_MUTED_MASK",(function(){return f})),n.d(e,"MAIN_STREAM_MSID",(function(){return E})),n.d(e,"AUX_STREAM_MSID",(function(){return g})),n.d(e,"StreamType",(function(){return I})),n.d(e,"TRTC_QUALITY_UNKNOWN",(function(){return v})),n.d(e,"TRTC_QUALITY_EXCELLENT",(function(){return C})),n.d(e,"TRTC_QUALITY_GOOD",(function(){return T})),n.d(e,"TRTC_QUALITY_POOR",(function(){return R})),n.d(e,"TRTC_QUALITY_BAD",(function(){return m})),n.d(e,"TRTC_QUALITY_VBAD",(function(){return A})),n.d(e,"TRTC_QUALITY_DISCONNECTED",(function(){return y})),n.d(e,"DTLS_STATE_UNKNOWN",(function(){return L})),n.d(e,"SuccessRate",(function(){return S})),n.d(e,"MTA_API_PENDING",(function(){return D})),n.d(e,"MTA_API_SUCCESS",(function(){return N})),n.d(e,"ConnectionState",(function(){return O})),n.d(e,"UPLINK_RECONNECTION_COUNT",(function(){return b})),n.d(e,"DOWNLINK_RECONNECTION_COUNT",(function(){return w})),n.d(e,"SIGNAL_RECONNECTION_COUNT",(function(){return U})),n.d(e,"KIBANA_EVENT",(function(){return M})),n.d(e,"SIGNAL_PING_TIMEOUT",(function(){return P})),n.d(e,"SIGNAL_PING_PONG_INTERVAL",(function(){return V})),n.d(e,"INNER_EVENT",(function(){return x})),n.d(e,"AI_NOISE_REDUCE_ASSETS_PATH",(function(){return k})),n.d(e,"MAX_NUMBER_ROOM_ID",(function(){return G})),n.d(e,"NAME",(function(){return j})),n.d(e,"CUSTOM_STATUS_MAP",(function(){return B})),n.d(e,"VIDEO_ENCODER_MAP",(function(){return H})),n.d(e,"CONSOLE_DOMESTIC",(function(){return F})),n.d(e,"CONSOLE_FOREIGN",(function(){return K})),n.d(e,"BUY_ADDRESS_DOMESTIC",(function(){return Y})),n.d(e,"BUY_ADDRESS_FOREIGN",(function(){return W})),n.d(e,"REGION_CHINA",(function(){return q})),n.d(e,"REGION_SINGAPORE",(function(){return Q})),n.d(e,"REGION_FRANKFURT",(function(){return J})),n.d(e,"REGION_SEOUL",(function(){return $})),n.d(e,"REGION_BOMBAY",(function(){return X})),n.d(e,"REGION_SILICON",(function(){return z}));var i=n(6),r=n(14);const a="wss://qcloud.rtc.qq.com:8687",o="wss://bk.rtc.qq.com:8687",s={RTC:1,LIVE:2},l={HOST:20,AUDIENCE:21},u=1,c=8,d=64,p=16,h=1,_=2,f=4,E="5Y2wZK8nANNAoVw6dSAHVjNxrD1ObBM2kBPV",g="224d130c-7b5c-415b-aaa2-79c2eb5a6df2",I={NONE:0,AUDIO:1,MAIN:2,AUX:7},v=0,C=1,T=2,R=3,m=4,A=5,y=6,L="unknown",S={JOIN:"join",PUBLISH:"publish",UNPUBLISH:"unpublish",LOCAL_STREAM_INITIALIZE:"local_stream_initialize",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscibe",UPLINK_CONNECTION:"uplink_connection",UPLINK_RECONNECTION:"uplink_reconnection",DOWNLINK_CONNECTION:"downlink_connection",DOWNLINK_RECONNECTION:"downlink_reconnection",SIGNAL_CONNECTION:"signal_connection",SIGNAL_RECONNECTION:"signal_reconnection",UPDATE_STREAM:"update_stream"},D="pending",N="success",O={CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected"},b=30,w=30,U=30,M={SDK_CONSTRUCT:"sdkConstruct",SDK_LOGIN:"sdkLogin",DELTA_JOIN:"delta-join",REJOIN:"rejoin",LEAVE:"leave",DELTA_LEAVE:"delta-leave",PUBLISH:"publish",DELTA_PUBLISH:"delta-publish",UNPUBLISH:"unpublish",SUBSCRIBE:"subscribe",UNSUBSCRIBE:"unsubscribe",UPLINK_CONNECTION:"uplink-connection",UPLINK_RECONNECTION:"uplink-reconnection",DOWNLINK_CONNECTION:"downlink-connection",DOWNLINK_RECONNECTION:"downlink-reconnection",ON_TRACK:"ontrack",SET_LOCAL_DESCRIPTION:"setLocalDescription",SET_REMOTE_DESCRIPTION:"setRemoteDescription",ICE_CONNECTION_STATE:"iceConnectionState",LOCAL_STREAM_INITIALIZE:"stream-initialize",SIGNAL_CONNECTION:"websocketConnectionState",SIGNAL_RECONNECTION:"websocketReconnectionState",UPDATE_STREAM:"update-stream",RECOVER_SUBSCRIPTION:"recover-subscription"},P=6e3,V=1e4,x={SET_REMOTE_OFFER_FINISHED:"set-remote-offer-finished"},k="https://web.sdk.qcloud.com/trtc/webrtc/download/aiNoiseReduce/",G=2147483647,j={DEFAULT:"default",BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object",ARRAY:"array",FUNCTION:"function",FILE:"file",MAP:"map",SET:"set",UNDEFINED:"undefined",VIDEO:"video",AUDIO:"audio",ON_ERROR:"onError",MAIN:"main",RTC:"rtc",LIVE:"live",SMALL:"small",BIG:"big",AUXILIARY:"auxiliary",INVITER:"inviter",INVITEE:"invitee",VIDEO_INPUT:"videoinput",AUDIO_INPUT:"audioinput",LOCAL:"local",REMOTE:"remote",TRTC:"TRTC",WEB:"web",NORMAL:"normal",REJECT:"reject",IGNORE:"ignore",TIMEOUT:"timeout",RIC:"ric",RAF:"raf",INTERVAL:"interval",CANCEL:"cancel",BUSYLINE:"busyline",UNKNOWN:"unknown",SINGLE_CALL:"SingleCall",GROUP_CALL:"groupCall",CALLER:"caller",CALLEE:"callee",COVER:"cover",CONTAIN:"contain",FILL:"fill",AV_CALL:"av_call",CALLKIT_RECORDS_SVR:"callkit_records_svr",SINGLE:"single",GROUP:"group",START_CALL:"start_call",RECEIVE_CALL:"receive_call",CALL_ACCEPTED:"call_accepted",ACCEPT_CALL:"accept_call",CALL_MISSED:"call_missed",NOT_ANSWER_CALL:"not_answer_call",CALL_REJECTED:"call_rejected",REJECT_CALL:"reject_call",CALL_BUSY:"call_busy",IGNORE_CALL:"ignore_call",CANCEL_CALL:"cancel_call",CALL_CANCELED:"call_canceled",CALL_FAILED:"call_failed",CALL_END:"call_end",CALL_INTERRUPTED:"call_interrupted",INVITE_USER:"invite_user",JOIN_IN_GROUP_CALL:"join_in_group_call",EVENT_REPORT:"event_report",HEART_BEAT:"heartbeat",CALLING:"calling",BANNED:"banned",WAITING:"waiting",CONNECTED:"connected",MICROPHONE:"microphone",CAMERA:"camera",MICROPHONES:"microphones",SPEAKER:"speaker",ENABLE_VIRTUAL_BACKGROUND:"enableVirtualBackground",BLUR:"blur",IMAGE:"image"},B={"":i.CALL_STATUS.IDLE,call_wait:i.CALL_STATUS.CALLING,call_accept:i.CALL_STATUS.CONNECTED},H={"480p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_640_480,videoFps:15,videoBitrate:900},"720p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_1280_720,videoFps:15,videoBitrate:1500},"1080p":{videoResolution:r.TRTCVideoResolution.TRTCVideoResolution_1920_1080,videoFps:15,videoBitrate:2e3}},F="https://console.cloud.tencent.com/im/detail",K="https://console.intl.cloud.tencent.com/im/detail",Y="https://buy.cloud.tencent.com/avc?addRavLicense=1",W="https://buy.tencentcloud.com/avc?addRavLicense=1",q=1,Q=9,J=17,$=18,X=21,z=15},function(t,e,n){"use strict";n.r(e),n.d(e,"isMap",(function(){return o})),n.d(e,"isSet",(function(){return s})),n.d(e,"isFile",(function(){return l})),n.d(e,"isNumber",(function(){return u})),n.d(e,"isString",(function(){return c})),n.d(e,"isObject",(function(){return d})),n.d(e,"isBoolean",(function(){return p})),n.d(e,"isPlainObject",(function(){return h})),n.d(e,"isArray",(function(){return _})),n.d(e,"isUndefined",(function(){return f})),n.d(e,"isNativeClass",(function(){return g})),n.d(e,"isArrayOrObject",(function(){return I})),n.d(e,"isFunction",(function(){return v})),n.d(e,"isInstanceOfError",(function(){return C})),n.d(e,"getType",(function(){return T})),n.d(e,"TimeUtil",(function(){return m})),n.d(e,"stringifyError",(function(){return A})),n.d(e,"map2String",(function(){return y})),n.d(e,"randomString",(function(){return D})),n.d(e,"isValidType",(function(){return N})),n.d(e,"mapKeys",(function(){return O})),n.d(e,"mapValues",(function(){return b})),n.d(e,"generateRandomRoomID",(function(){return w})),n.d(e,"analyzeRoomId",(function(){return U})),n.d(e,"formatDuration",(function(){return P})),n.d(e,"compareVersion",(function(){return V})),n.d(e,"date2ISOString",(function(){return x})),n.d(e,"getHostType",(function(){return k})),n.d(e,"isCallSignaling",(function(){return G})),n.d(e,"performanceNow",(function(){return j})),n.d(e,"isDomesticSDKAppID",(function(){return B})),n.d(e,"getPurchaseAddress",(function(){return H})),n.d(e,"getRegionId",(function(){return F})),n.d(e,"timeoutForFun",(function(){return K})),n.d(e,"analyzeVideoRenderParams",(function(){return Y})),n.d(e,"getValueType",(function(){return W})),n.d(e,"safelyParse",(function(){return q})),n.d(e,"generateRandomString",(function(){return Q}));var i=n(5),r=n(9),a=n(0);const o=function(t){return T(t)===a.NAME.MAP},s=function(t){return T(t)===a.NAME.SET},l=function(t){return T(t)===a.NAME.FILE},u=function(t){return null!==t&&(typeof t===a.NAME.NUMBER&&!isNaN(t-0)||typeof t===a.NAME.OBJECT&&t.constructor===Number)},c=function(t){return typeof t===a.NAME.STRING},d=function(t){return null!==t&&typeof t===a.NAME.OBJECT},p=function(t){return typeof t===a.NAME.BOOLEAN},h=function(t){if(typeof t!==a.NAME.OBJECT||null===t)return!1;const e=Object.getPrototypeOf(t);if(null===e)return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},_=function(t){return typeof Array.isArray===a.NAME.FUNCTION?Array.isArray(t):T(t)===a.NAME.ARRAY},f=function(t){return typeof t===a.NAME.UNDEFINED},E=/^class\s/,g=function(t){return typeof t===a.NAME.FUNCTION&&E.test(t.toString())},I=function(t){return _(t)||d(t)},v=function(t){return typeof t===a.NAME.FUNCTION},C=function(t){return t instanceof Error},T=function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()};let R=0;Date.now||(Date.now=function(){return(new Date).getTime()});const m={now(){0===R&&(R=Date.now()-1);const t=Date.now()-R;return t>4294967295?(R+=4294967295,Date.now()-R):t},utc:()=>Math.round(Date.now()/1e3)},A=function(t){return JSON.stringify(t,["message","code"])},y=function(t){if(!o(t))return"not a map!!!";let e="";for(const[n,i]of t.entries()){if(o(i))return`[k=${n} -> ${y(i)}`;e+=`[k=${n} v=${i}] `}return e},L="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",S=L.length,D=function(){let t="";for(let e=32;e>0;--e)t+=L[Math.floor(Math.random()*S)];return t},N=function(t,e){for(const n in t)if(t[n]===e)return!0;return!1};function O(t,e){const n={};return Object.keys(t).forEach(i=>{n[e(t[i],i)]=t[i]}),n}function b(t,e){const n={};return Object.keys(t).forEach(i=>{n[i]=e(t[i],i)}),n}function w(){return Math.round(1e8*Math.random())}function U(t,e){return u(t)&&t>0?t:0===t&&e?e:w()}function M(t){return t<10?"0"+t:t}function P(t){if(t<60)return"00:00:"+M(t);if(t<3600){const e=parseInt(t/60),n=t-60*e;return`00:${M(e)}:${M(n)}`}const e=parseInt(t/3600),n=t-3600*e,i=parseInt(n/60),r=n-60*i;return`${M(e)}:${M(i)}:${M(r)}`}function V(t,e){t=t.split("."),e=e.split(".");const n=Math.max(t.length,e.length);for(;t.lengthr)return 1;if(n-10?"+0"+Math.abs(100*n):"+"+Math.abs(100*n):n>=10?"-"+100*n:"-0"+100*n,e.replace("Z",i)};function k(){let t="unknown";return i.IS_MAC&&(t="mac"),i.IS_WIN&&(t="windows"),i.IS_IOS&&(t="ios"),i.IS_ANDROID&&(t="android"),t}function G(t){return t===a.NAME.AV_CALL}function j(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function B(t){const e=String(t);return e.startsWith("14")||e.startsWith("16")||e.startsWith("17")}function H(t){return`${B(t)?a.BUY_ADDRESS_DOMESTIC:a.BUY_ADDRESS_FOREIGN}&position=${t}®ionId=${F(t)}`}function F(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?a.REGION_SINGAPORE:t>=3e7&&t<4e7||t>=173e7&&t<174e7?a.REGION_SEOUL:t>=4e7&&t<5e7||t>=174e7&&t<175e7?a.REGION_FRANKFURT:t>=5e7&&t<6e7||t>=175e7&&t<176e7?a.REGION_BOMBAY:t>=7e7&&t<8e7||t>=177e7&&t<178e7?a.REGION_SILICON:a.REGION_CHINA}async function K(t,e){return Promise.race([t(),new Promise((t,n)=>{setTimeout(()=>{t()},e)})])}function Y(t){const e={};return t.rotation&&(e.rotation=t.rotation),t.objectFit&&(t.objectFit===a.NAME.COVER?e.fillMode=r.TRTCVideoFillMode.TRTCVideoFillMode_Fill:e.fillMode=r.TRTCVideoFillMode.TRTCVideoFillMode_Fit),p(t.mirror)&&(e.mirrorType=t.mirror?r.TRTCVideoMirrorType.TRTCVideoMirrorType_Enable:r.TRTCVideoMirrorType.TRTCVideoMirrorType_Disable),e}function W(t){return Reflect.apply(Object.prototype.toString,t,[]).replace(/^\[object\s(\w+)\]$/,"$1").toLowerCase()}function q(t){if("string"!=typeof t)return t;let e;try{const n=JSON.parse(t);e="object"==typeof n&&n?n:t}catch(n){e=t}return e}function Q(t){t=t||32;const e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";let n="";for(let i=0;i ${e[0]}`;else{n=`${h()} <${t}> `;for(let t=0,{length:i}=e;ts,record(t,e){1100===_._length&&(_._data.splice(0,100),_._length=1e3),_._length++,_._data.push(`${t} [${e}] \n`)},getLog:()=>_._data};e.default=_},function(t,e,n){"use strict";var i=n(21),r=Object.prototype.toString;function a(t){return"[object Array]"===r.call(t)}function o(t){return void 0===t}function s(t){return null!==t&&"object"==typeof t}function l(t){if("[object Object]"!==r.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function u(t){return"[object Function]"===r.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),a(t))for(var n=0,i=t.length;n(()=>{"use strict";var t={902:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]{Object.defineProperty(e,"__esModule",{value:!0}),e.filterSdkappIdPipe=void 0,e.filterSdkappIdPipe=function(t){return function(e,n){try{var i=e.sdkappid,r=t.getBlackList();if(null==r?void 0:r.includes(String(i)))throw new Error("this sdkappid in blacklist");n(e)}catch(t){console.debug(t)}}}},793:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=void 0;var i=n(266);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,i.isPlainObject)(t[n]))try{e[n]=(0,i.stringifyPlus)(t[n])}catch(t){console.debug(t)}else"time"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+""})),{contents:e,time:t.time}})),source:""})}catch(t){console.debug(t)}}}},713:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatESLog=void 0;var i=n(266);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var r=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,i.isPlainObject)(t[n]))try{e[n]=(0,i.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]="level"===n?t[n]+"":"time"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:r})}catch(t){console.debug(t)}}}},882:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var i=n(793);Object.defineProperty(e,"formatClsLog",{enumerable:!0,get:function(){return i.formatClsLog}});var r=n(713);Object.defineProperty(e,"formatESLog",{enumerable:!0,get:function(){return r.formatESLog}})},402:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPipeline=void 0;var i=n(266);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError("createPipeline need at least one function param");return 1===t.length?function(e,n){t[0](e,n||i.noop)}:t.reduce((function(t,e){return function(n,r){return void 0===r&&(r=i.noop),t(n,(function(t){return null==e?void 0:e(t,r)}))}}))}},271:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var i=n(266);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var r=(t=t||{}).logs,a=void 0===r?[]:r;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,r=t.contents;return Object.keys(r).forEach((function(t){var e=r[t];try{e&&e.length>n&&(r[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug("size of content > limitSize"),r[t]=(0,i.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},884:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,i=[];return function(r,a){if(Array.isArray(r)?i=i.concat(r):i.push(r),e&&i.length>=e||t.sendNow&&i.length>0)return a(i.splice(0,i.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,i.length>0&&a(i.splice(0,i.length))}),t.delay||1e3)}}},466:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=s?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return l++,[4,new Promise((function(e,n){wx.request(i(i({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return l--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))};var o=n(640),s=2,l=0},377:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},r=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,i&&(r=2&s[0]?i.return:s[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;switch(i=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=s?[4,(0,o.startBlocking)()]:[3,2];case 1:return r.sent(),[3,0];case 2:return l++,i=n.method,d=n.headers,h=void 0===d?{}:d,_=n.responseType,f=void 0===_?"json":_,i=(i||"get").toUpperCase(),Object.assign(h,{"Content-type":"application/json"}),(E=new window.XMLHttpRequest).responseType=f,E.timeout=1e4,E.onreadystatechange=function(){4===E.readyState&&(200===E.status?c({data:E.response}):p({code:E.status,msg:E.statusText}))},E.ontimeout=function(t){p({code:E.status,msg:E.statusText})},E.onloadend=function(){E&&(u((function(t){c(t)}),(function(t){p(t)}),{status:E.status,statusText:E.statusText}),E=null)},E.onabort=function(){E&&(p(new Error("Request aborted")),E=null)},E.onerror=function(){p(new Error("Network Error")),E=null},"GET"===i?t="".concat(t).concat(-1===t.indexOf("?")?"?":"&").concat(a.default.stringify(e)):"POST"===i&&(e=JSON.stringify(e)),E.open(i,t,!0),Object.keys(h).forEach((function(t){E.setRequestHeader(t,h[t])})),E.send("POST"===i?e:null),[2]}}))}))}))];case 1:return[2,p.sent()];case 2:throw c=p.sent(),new Error(c);case 3:return l--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))};var a=n(383),o=n(640),s=2,l=0;function u(t,e,n){n.status?e(new Error("Request failed with status code "+n.status)):t(n)}},172:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RAINBOW_BLACK_LIST_API=void 0,e.RAINBOW_BLACK_LIST_API="https://jsonschema.qpic.cn/87084b1b6d263426b92926cfa5fa23af/18f29786d25587b5eb162d5e9f724b1e/blackList"},266:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var i=[];return Object.keys(n).forEach((function(t){var r=n[t];if(void 0!==r){if((0,e.isPlainObject)(r))try{r=JSON.stringify(r)}catch(t){}i.push("".concat(t,"=").concat(encodeURIComponent(r)))}})),i.length?(t.indexOf("?")>-1?"".concat(t,"&"):"".concat(t,"?"))+i.join("&"):t},e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&"undefined"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return"Error.message: ".concat(n.message," \n Error.stack: ").concat(n.stack);if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular ".concat(e||"root","]");t.add(n)}return n}};e.stringifyPlus=function(t){if("string"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||"undefined").replace(/"/gim,""):JSON.stringify(t,n())||"undefined"}catch(t){return"error happen when aegis stringify: \n ".concat(t.message," \n ").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),i=e.getTimezoneOffset()/60;return t=i<0?i>-10?"+0".concat(Math.abs(100*i)):"+".concat(Math.abs(100*i)):i>=10?"-".concat(100*i):"-0".concat(100*i),n.replace("Z",t)}},383:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var i=n(266);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,i.isPlainObject)(n))n=JSON.stringify(n);else{if("string"!=typeof n&&"number"!=typeof n)return"";n=+n}return encodeURIComponent(e)+"="+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join("&"):""}}},640:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,n),a.exports}var i={};return(()=>{var t=i;Object.defineProperty(t,"__esModule",{value:!0});var e=n(902),r=null;t.default=function(t){return r||(r=new e.default(t)),r}})(),i})(),t.exports=i()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TRTCQuality=e.DEVICE_TYPE=e.TRTCVideoMirrorType=e.TRTCVideoFillMode=e.TRTCVideoRotation=void 0,function(t){t[t.TRTCVideoRotation0=0]="TRTCVideoRotation0",t[t.TRTCVideoRotation90=1]="TRTCVideoRotation90",t[t.TRTCVideoRotation180=2]="TRTCVideoRotation180",t[t.TRTCVideoRotation270=3]="TRTCVideoRotation270"}(e.TRTCVideoRotation||(e.TRTCVideoRotation={})),function(t){t[t.TRTCVideoFillMode_Fill=0]="TRTCVideoFillMode_Fill",t[t.TRTCVideoFillMode_Fit=1]="TRTCVideoFillMode_Fit"}(e.TRTCVideoFillMode||(e.TRTCVideoFillMode={})),function(t){t[t.TRTCVideoMirrorType_Auto=0]="TRTCVideoMirrorType_Auto",t[t.TRTCVideoMirrorType_Enable=1]="TRTCVideoMirrorType_Enable",t[t.TRTCVideoMirrorType_Disable=2]="TRTCVideoMirrorType_Disable"}(e.TRTCVideoMirrorType||(e.TRTCVideoMirrorType={})),function(t){t.CAMERA="camera",t.SPEAKER="speaker",t.MICROPHONES="microphones",t.MICROPHONE="microphone",t.AUDIO="audio",t.VIDEO="video"}(e.DEVICE_TYPE||(e.DEVICE_TYPE={})),function(t){t[t.TRTCQuality_Unknown=0]="TRTCQuality_Unknown",t[t.TRTCQuality_Excellent=1]="TRTCQuality_Excellent",t[t.TRTCQuality_Good=2]="TRTCQuality_Good",t[t.TRTCQuality_Poor=3]="TRTCQuality_Poor",t[t.TRTCQuality_Bad=4]="TRTCQuality_Bad",t[t.TRTCQuality_Vbad=5]="TRTCQuality_Vbad",t[t.TRTCQuality_Down=6]="TRTCQuality_Down"}(e.TRTCQuality||(e.TRTCQuality={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,n=1,i=arguments.length;n{this._eventStatController.pushIn(this)},0)}setError(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(o.a.NO_NETWORK),this.setMessage(s.ERROR_MESSAGE.NO_NETWORK)),this}setCode(t){return"ECONNABORTED"===t&&(this.codeint=103),Object(i.isNumber)(t)?this.codeint=t:r.default.warn("SSOLogData.setCode value not a number, please check!",t,typeof t),this}setMessage(t){return Object(i.isString)(t)?(this.message=t,this):this}setText(t){return Object(i.isNumber)(t)?this.text=t.toString():Object(i.isString)(t)&&(this.text=t),this}setTalkTime(t){return this.talktime=t,this}setMessageType(t){return this.msgType=t,this}setCallType(t){return this.calltype=t,this}setNetworkType(t){return Object(i.isUndefined)(t)?r.default.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}e.default=l},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorMessageCN=e.ErrorMessage=e.getErrorMessage=void 0;var i=n(1),r=n(7),a=n(11);e.getErrorMessage=function(t){var n,a=t.code,o=t.params,s=t.enableDocLink,l=void 0!==s&&s,u=t.languageList,c=void 0===u?["en","zh-CN"]:u,d="",p=r.ErrorCodeDictionary[a];try{c.forEach((function(t){switch(t){case"en":n=e.ErrorMessage[p];break;case"zh-CN":n=e.ErrorMessageCN[p]}i.isFunction(n)?(d=d?d+" ":d,d+=n(o)):i.isString(n)&&(d=n)}))}catch(t){n=e.ErrorMessage.UNKNOWN_ERROR}return l&&(d+=" doc:"),d},e.ErrorMessage={ERROR_INIT_FAIL:function(t){return t.fnName+": "+a.ERROR_MESSAGE.ERROR_INIT_FAIL+"."},ERROR_SCENE_NOT_SUPPORTED:function(t){return t.fnName+": "+a.ERROR_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"."},ERROR_REQUEST_REFUSED:function(t){var e=t.value;return a.ERROR_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+e+"."},ERROR_PARAM_INVALID:function(t){return"the parameters of the '"+t.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(t){var e=t.key,n=t.rule,i=t.fnName,r=t.value;return"'"+(e||n.name)+"' is a required param when calling "+i+"(), received: "+r+"."},INVALID_PARAMETER_TYPE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return"'"+(""+(e||n.name))+"' must be type of "+(Array.isArray(n.type)?n.type.join("|"):n.type)+" when calling "+r+"(), received type: "+i.getValueType(a)+"."},INVALID_PARAMETER_EMPTY:function(t){var e=t.key,n=t.rule,i=t.fnName;return"'"+(e||n.name)+"' cannot be empty when calling "+i+"()."},INVALID_PARAMETER_RANGE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return i.isArray(n.values)?"'"+(e||n.name)+"' must be one of "+n.values.join("|")+" when calling "+r+"(), received: "+a+".":i.isString(n.values)&&-1!==n.values.indexOf("~")?"'"+(e||n.name)+"' must be the range of "+n.values+" when calling "+r+"(), received: "+a+".":void 0},ERROR_REQUEST_REPEATED:function(t){var e=t.fnName;return"you are already "+e+"(), cannot repeated call '"+e+"'."},ERROR_HTTP:function(){return a.ERROR_MESSAGE.ERROR_HTTP+"."},ERROR_TIM_VERSION_OUTDATED:function(){return a.ERROR_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2."},ERROR_PACKAGE_NOT_SUPPORTED:function(){return a.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"."},FAILURE_SWITCH_TO_AUDIO:function(){return a.ERROR_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"."},NOT_MICROPHONE_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError, no microphone detected, please check your device and the configuration on '"+e+"'"+(n?", error: "+n.toString()+".":".")},NOT_CAMERA_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError, no camera detected, please check your device and the configuration on '"+e+"'"+(n?", error: "+n.toString()+".":".")},ERROR_PERMISSION_DENIED:function(t){var e=t.fnName,n=t.error;return"NotAllowedError, you have disabled camera/microphone access, please allow the current application "+e+" to use the camera/microphone. "+(n?", error: "+n.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return a.ERROR_MESSAGE.ERROR_INVALID_SEND_FAIL+"."},UNKNOWN_ERROR:function(t){var e=t.fnName,n=t.error;return"'"+e+"' throw unknown exception"+(n?", error: "+n.toString()+".":".")}},e.ErrorMessageCN={ERROR_INIT_FAIL:function(t){return t.fnName+": "+a.ERROR_CN_MESSAGE.ERROR_INIT_FAIL+"。"},ERROR_SCENE_NOT_SUPPORTED:function(t){return t.fnName+": "+a.ERROR_CN_MESSAGE.ERROR_SCENE_NOT_SUPPORTED+"。"},ERROR_REQUEST_REFUSED:function(t){var e=t.value;return a.ERROR_CN_MESSAGE.ERROR_REQUEST_REFUSED+". customStatus: "+e+"。"},ERROR_PARAM_INVALID:function(t){return"the parameters of the '"+t.fnName+"' you called does not meet the requirements, please check the API documentation."},INVALID_PARAMETER_REQUIRED:function(t){var e=t.key,n=t.rule,i=t.fnName,r=t.value;return"调用 "+i+"() 方法的时候 '"+(e||n.name)+"' 是必须的参数, 收到的值为: "+r+"。"},INVALID_PARAMETER_TYPE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return"调用 "+r+"() 方法的时候 '"+(""+(e||n.name))+"' 必须是 "+(Array.isArray(n.type)?n.type.join("|"):n.type)+" 类型, 收到的类型是: "+i.getValueType(a)+"。"},INVALID_PARAMETER_EMPTY:function(t){var e=t.key,n=t.rule,i=t.fnName;t.value;return"调用 "+i+"() 的时候 '"+(e||n.name)+"' 不能是空。"},INVALID_PARAMETER_RANGE:function(t){var e=t.key,n=t.rule,r=t.fnName,a=t.value;return i.isArray(n.values)?"调用 "+r+"() 的时候 '"+(e||n.name)+"' 必须是 "+n.values.join("|")+" 的其中一种, 收到的是: "+a+"。":i.isString(n.values)&&-1!==n.values.indexOf("~")?"调用 "+r+"() 的时候 '"+(e||n.name)+"' 范围是 "+n.values+", 收到的是: "+a+"。":void 0},ERROR_REQUEST_REPEATED:function(t){var e=t.fnName;return"你已经调用 "+e+"(), 请勿重复调用 '"+e+"'。"},ERROR_HTTP:function(){return a.ERROR_CN_MESSAGE.ERROR_HTTP+"。"},ERROR_TIM_VERSION_OUTDATED:function(){return a.ERROR_CN_MESSAGE.ERROR_TIM_VERSION_OUTDATED+" >= 2.21.2。"},ERROR_PACKAGE_NOT_SUPPORTED:function(){return a.ERROR_CN_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED+"。"},FAILURE_SWITCH_TO_AUDIO:function(){return a.ERROR_CN_MESSAGE.FAILURE_SWITCH_TO_AUDIO+"。"},NOT_MICROPHONE_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError,未检测到麦克风设备,请检查您的设备和麦克风上的配置 '"+e+"'"+(n?", error: "+n.toString()+".":".")},NOT_CAMERA_LIST:function(t){var e=t.fnName,n=t.error;return"NotFoundError,未检测到摄像头设备,请检查您的设备和摄像头上的配置 '"+e+"'"+(n?", error: "+n.toString()+".":".")},ERROR_PERMISSION_DENIED:function(t){t.fnName;var e=t.error;return"NotAllowedError, 您已禁用摄像头/麦克风访问权限,请允许当前应用程序使用摄像头/麦克风。"+(e?", error: "+e.toString()+".":".")},ERROR_INVALID_SEND_FAIL:function(){return a.ERROR_CN_MESSAGE.ERROR_INVALID_SEND_FAIL+"."}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TUICallEvent=void 0,e.TUICallEvent={ERROR:"onError",SDK_READY:"sdkReady",ON_CALL_BEGIN:"onCallBegin",INVITED:"onInvited",ON_CALL_RECEIVED:"onCallReceived",USER_ACCEPT:"onUserAccept",USER_ENTER:"onUserEnter",USER_LEAVE:"onUserLeave",REJECT:"onReject",NO_RESP:"onNoResp",LINE_BUSY:"onLineBusy",CALLING_CANCEL:"onCallingCancel",ON_CALL_CANCELED:"onCallCanceled",KICKED_OUT:"onKickedOut",CALLING_TIMEOUT:"onCallingTimeout",CALL_END:"onCallEnd",CALLING_END:"onCallEnd",USER_VIDEO_AVAILABLE:"onUserVideoAvailable",USER_AUDIO_AVAILABLE:"onUserAudioAvailable",USER_VOICE_VOLUME:"onUserVoiceVolume",GROUP_CALL_INVITEE_LIST_UPDATE:"onGroupCallInviteeListUpdate",CALL_TYPE_CHANGED:"onCallTypeChanged",DEVICED_UPDATED:"onDeviceUpdated",ON_USER_NETWORK_QUALITY_CHANGED:"onUserNetworkQualityChanged",MESSAGE_SENT_BY_ME:"onMessageSentByMe",CALL_MESSAGE:"CALL_MESSAGE"}},function(t,e,n){"use strict";(function(e){var i=n(3),r=n(46),a=n(23),o={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!i.isUndefined(t)&&i.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var l,u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==e&&"[object process]"===Object.prototype.toString.call(e))&&(l=n(24)),l),transformRequest:[function(t,e){return r(e,"Accept"),r(e,"Content-Type"),i.isFormData(t)||i.isArrayBuffer(t)||i.isBuffer(t)||i.isStream(t)||i.isFile(t)||i.isBlob(t)?t:i.isArrayBufferView(t)?t.buffer:i.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):i.isObject(t)||e&&"application/json"===e["Content-Type"]?(s(e,"application/json"),function(t,e,n){if(i.isString(t))try{return(e||JSON.parse)(t),i.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){var e=this.transitional,n=e&&e.silentJSONParsing,r=e&&e.forcedJSONParsing,o=!n&&"json"===this.responseType;if(o||r&&i.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(o){if("SyntaxError"===t.name)throw a(t,this,"E_JSON_PARSE");throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},i.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){u.headers[t]=i.merge(o)})),t.exports=u}).call(this,n(45))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return _}));var i=n(2),r=n(1);class a{constructor(){this._table="timweb-trtccalling",this._report=[]}pushIn(t){i.default.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}backfill(t){Object(r.isArray)(t)&&0!==t.length&&(i.default.debug("SSOLogBody.backfill",this._report.length,t.length),this._report.unshift(...t))}getLogsNumInMemory(){return this._report.length}isEmpty(){return 0===this._report.length}_reset(){this._report.length=0,this._report=[]}getTable(){return this._table}getLogsInMemory(){const t=this._report.slice();return this._reset(),t}}var o=n(13),s=n(19),l=n(31),u=n.n(l);const c={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"},OVERSEA_PRODUCTION:{COMMON:"https://api.im.qcloud.com"},SANDBOX:{COMMON:"https://events.tim.qq.com"},TEST:{COMMON:"https://test.tim.qq.com"}},d={IM_OPEN_STAT:"imopenstat"},p={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},h={imopenstat:"v4"};class _{constructor(){this.TAG="trtccalling-ssolog-event",this._reportBody=new a,this._version=s.version||"",this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}reportAtOnce(){i.default.debug("EventStatController.reportAtOnce"),this._report()}pushIn(t){t instanceof o.default&&(t.setCommonInfo({SDKAppID:Number(sessionStorage.getItem("sdkAppId")),version:this._version,userID:sessionStorage.getItem("userId")}),this._reportBody.pushIn(t),this._report())}_resetLastReportTime(){this._lastReportTime=Date.now()}_startReportTimer(){this._timerID=setInterval(()=>{Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}_report(){if(this._reportBody.isEmpty())return;const t=Math.ceil(+new Date/1e3),e=sessionStorage.getItem("sdkAppId"),n=this._reportBody.getLogsInMemory(),a={table:this._reportBody.getTable(),report:n},o=`${c.CURRENT.COMMON}/${h.imopenstat}/${d.IM_OPEN_STAT}/${p.TIM_WEB_TRTCCALLING_REPORT}/?sdkappid=${e}&reqtime=${t}`;u.a.post(o,JSON.stringify(a)).then(()=>{this._resetLastReportTime(),this._retryCount>0&&(i.default.debug("EventStatController.report retry success"),this._retryCount=0)}).catch(t=>{i.default.warn("EventStatController.report, error:"+Object(r.stringifyError)(t)),this._reportBody.backfill(n);this._reportBody.getLogsNumInMemory()>this.MAX_THRESHOLD||this._retryCount===this.MAX_RETRY_COUNT||0===this._timerID?this._retryCount=0:this._retryCount+=1})}reset(){i.default.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}},function(t){t.exports=JSON.parse('{"name":"tuicall-engine-webrtc","version":"3.1.5","description":"腾讯云 tuicall-engine-webrtc","main":"index","private":true,"dependencies":{"@tencentcloud/chat":"latest","axios":"^0.21.0","EventEmitter":"^1.0.0","rtc-ai-denoiser":"latest","trtc-cloud-js-sdk":"^2.4.0","trtc-js-sdk":"latest","tuikit-logger":"latest"},"devDependencies":{"@babel/preset-typescript":"^7.12.7","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0","docdash-blue":"^1.1.9","eslint":"^7.27.0","eslint-config-google":"^0.14.0","eslint-plugin-prettier":"^4.0.0","fs-extra":"^9.0.1","jsdoc":"^3.6.11","prettier":"^2.5.0","pretty":"^2.0.0","replace":"^1.2.2","rimraf":"^4.1.2","ts-loader":"^8.4.0","typescript":"^3.9.7","watch":"^1.0.2","webpack":"^4.44.1","webpack-cli":"^3.3.12"},"scripts":{"watch":"watch \'npm run build_withcopy4\' src","dev":"npm run watch","build":"webpack --config webpack.config.js","build_withcopy":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../../github/TUICalling/Web/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy2":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ../sdk/trtc-calling-webrtc-demo/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_withcopy3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example-js/tuicall-engine-webrtc.js","build_withcopy4":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./example/node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build_demo3":"npm run build && cp dist/npm/tuicall-engine-webrtc.js ./examples/call-engine-demo-vue3//node_modules/tuicall-engine-webrtc/tuicall-engine-webrtc.js","build:package":"node build/package-bundle.js","lint":"./node_modules/.bin/eslint ./src; exit 0","fix":"./node_modules/.bin/eslint --fix ./src; exit 0","prerelease":"npm run lint && npm run build && npm run doc && npm run build:package","doc":"npm run doc:clean && tsc --target ESNEXT && npm run doc:build","doc:build":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","doc-en":"npm run doc:clean && tsc --target ESNEXT && npm run doc:build-en","doc:build-en":"npm run changelog && npm run main && ./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc-en.json && node ./build/jsdoc/fix-doc-en.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/20-CHANGELOG.md","main":"cp README.md build/jsdoc/main.md"},"repository":{"type":"git","url":"https://github.com/tencentyun/TUICallKit/tree/main/Web"},"author":"Tencent Cloud Terminal R&D Center","license":"ISC"}')},function(t,n){t.exports=e},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),i=0;i=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,n,o):r(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o},a=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},o=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(r=o.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]: failed "+g.message,code:g.code});case 11:return[2]}}))}))},t.prototype.reportLog=function(t){var e,n;try{if(d.isObject(t)){var i=t||{},r=i.name,a=void 0===r?"":r,o=i.data,s=i.error,l=i.type,u=void 0===l?"api":l,c=i.level,p=void 0===c?"info":c,h="error"===p?{error:s,data:o}:{data:o};null===(n=null===(e=this._logger)||void 0===e?void 0:e[p])||void 0===n||n.call(e,a,{text:h,type:u})}}catch(s){console.debug("reportLog fail: ",s)}},t.prototype.addAudioVideoSwitchIdList=function(t){t&&this._audioVideoSwitchIdList.push(t)},t.prototype.getAudioVideoSwitchIdList=function(){return this._audioVideoSwitchIdList||[]},t.prototype.addInviterInviteId=function(t,e){0!==e.length&&(0===(this._inviterInviteID[t]||[]).length?this._inviterInviteID[t]=e:this._inviterInviteID[t]=l(this._inviterInviteID[t],e))},t.prototype.getInviterInviteIdList=function(){return Object.keys(this._inviterInviteID||{})},t.prototype.getTotalInviterInviteIdList=function(){var t=this.getInviterInviteIdList();return l(this._audioVideoSwitchIdList,t)},t.prototype.getInviterInviteIdUserList=function(t){var e=this,n=[];return t?n=this._inviterInviteID[t]||[]:this.getInviterInviteIdList().forEach((function(t){n=l(n,e.getInviterInviteIdUserList(t))})),n},t.prototype.getInviterID=function(){return this._inviterID},t.prototype.setInviterID=function(t){this._inviterID=t},t.prototype.groupCall=function(t){var e,n;return o(this,void 0,void 0,(function(){var r,a,o,u,c,p,h,_,f,E,g,I;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("groupCall.start",{text:{data:t},type:"api"}),T.default.debug("groupCall - params:",t),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((r=s.sent())!==R.CALL_STATUS.IDLE)throw this._logger.error("groupCall.failed",{text:{data:{params:t,customStatus:r}},type:"api"}),new A.default({code:y.default.ERROR_REQUEST_REFUSED,messageParams:{value:r},fnName:"groupCall"});return[4,null===(e=this._trtcClient)||void 0===e?void 0:e.getMediaDevicesAuth({audio:!0})];case 2:if(s.sent(),a=t.userIDList,o=t.type,u=t.groupID,c=t.offlinePushInfo,p=t.roomID,h=t.strRoomID,_=t.timeout,f=t.userData,-1!==(a=l(a)).indexOf(this.getUserId()))throw T.default.error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+a),new Error("groupCall failed. Called list can't contain yourself. userId:"+this.getUserId()+", inviteeIdList:"+a);this._callStatus=R.CALL_STATUS.CALLING,this._callType=o,this._isInviter=!0,this._isGroupCall=!0,this._inviterID=this._userID,this.setGroupId(u||""),this.setInviteeList(a),this.setHandledInviteeList([this._userID]),this.setUnHandledInviteeList(a),this.analyzeAndSetRoomId(p,h),this._callTimeout=d.isUndefined(_)?this._callTimeout:_,this._callDataReport.setCallScene(S.NAME.GROUP_CALL),E={callType:S.NAME.GROUP,mediaType:o,inviteeList:a},s.label=3;case 3:return s.trys.push([3,9,,11]),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return s.sent(),this._tsignalingClient.setTSignalingIsJoined(!0),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:a,type:o,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,offlinePushInfo:c,userData:f})];case 5:return g=s.sent(),T.default.log("groupCall res",g),u?0!==g.code?[3,6]:(this.addInviterInviteId(g.inviteID,l([this._userID],a)),this.setInitialCallId(g.inviteID),this._callRecordUpload(i({eventType:S.NAME.START_CALL},E)),this._callRecordReport.startHeartbeat(),[3,8]):[3,8];case 6:return this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},E)),this._logger.error("inviteInGroup.fail",{text:{data:g},type:"api"}),[4,this._resetTUICallEngine()];case 7:s.sent(),s.label=8;case 8:return[2,g];case 9:return I=s.sent(),this._callRecordUpload(i({eventType:S.NAME.CALL_FAILED},E)),this._logger.error("groupCall.fail",{text:{error:I},type:"api"}),[4,this._resetTUICallEngine()];case 10:throw s.sent(),new A.default({message:": failed "+I.message,code:I.code});case 11:return[2]}}))}))},t.prototype.joinInGroupCall=function(t){var e,n;return o(this,void 0,void 0,(function(){var i,r,a,o,l,u,c;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("joinInGroupCall.start",{text:{data:t},type:"api"}),[4,this.getSelfIMCallStatus([this.getUserId()])];case 1:if((i=s.sent())!==R.CALL_STATUS.IDLE)throw this._logger.error("joinInGroupCall.failed",{text:{data:{params:t,customStatus:i}},type:"api"}),new A.default({code:y.default.ERROR_REQUEST_REFUSED,messageParams:{value:i},fnName:"joinInGroupCall"});return[4,null===(e=this._trtcClient)||void 0===e?void 0:e.getMediaDevicesAuth({audio:!0})];case 2:s.sent(),s.label=3;case 3:return s.trys.push([3,6,,8]),r=t.roomID,a=t.strRoomID,o=t.type,l=t.groupID,this._callType=o,this.setGroupId(l||""),this.analyzeAndSetRoomId(r,a),this._isGroupCall=!0,this._isInviter=!1,this.addHandledInviteeList([this.getUserId()]),this.changeCallStatus(R.CALL_STATUS.CALLING),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 4:return s.sent(),[4,this.setSelfIMCallStatus(R.CALL_STATUS.CONNECTED)];case 5:return s.sent(),this.changeCallStatus(R.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(R.CALL_STATUS.CONNECTED),T.default.log("joinInGroupCall roomID:"+r+",type:"+o+",userID:"+this.getUserId()),u={eventType:S.NAME.JOIN_IN_GROUP_CALL,callType:S.NAME.GROUP,mediaType:this._callType},this._callRecordUpload(u),this._callRecordReport.startHeartbeat(),[3,8];case 6:return c=s.sent(),this._logger.error("joinInGroupCall.fail",{text:{error:c},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw s.sent(),new Error("joinInGroupCall failed error: "+c);case 8:return[2]}}))}))},t.prototype.inviteUser=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,a,o,u,c,d,p,h,_=this;return s(this,(function(s){switch(s.label){case 0:if(this._logger.info("inviteUser.start",{text:{data:t},type:"api"}),!this.isGroupCall())throw this._logger.error("inviteUser.fail",{text:{error:"inviteUser failed",data:t},type:"api"}),T.default.error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType),new Error("inviteUser failed - groupID:"+this.getGroupId()+", roomID:"+this.getRoomId()+", type:"+this._callType);if(!this.isInviter()&&this._callStatus!==R.CALL_STATUS.CONNECTED)throw this._logger.error("inviteUser.fail",{text:{error:"current status:"+this._callStatus+" not support"},type:"api"}),T.default.error("inviteUser failed - current status:"+this._callStatus+" not support"),new Error("inviteUser failed - current status:"+this._callStatus+" not support");if(e=t.userIDList,n=void 0===e?[]:e,i=t.offlinePushInfo,0===n.length)throw this._logger.error("inviteUser.fail",{text:{error:"userIDList is empty"},type:"api"}),T.default.error("inviteUser failed - userIDList is empty"),new Error("inviteUser failed - userIDList is empty");if(r=this.getHandledInviteeList(),a=this.getUnHandledInviteeList(),o=l(r,a),0===(u=n.filter((function(t){return-1===o.indexOf(t)}))).length)return this._logger.error("inviteUser.fail",{text:{error:"userIDList in call list",data:{userIDList:n,totalUserList:o}},type:"api"}),T.default.error("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(n)+", call list:"+JSON.stringify(o)),[2,Promise.reject("inviteUser failed - userIDList in call list. userIDList:"+JSON.stringify(n)+", call list:"+JSON.stringify(o))];n=u,s.label=1;case 1:return s.trys.push([1,3,,4]),c=this._handledInviteeList.filter((function(t){return t!==_._userID})),[4,this._tsignalingClient.inviteInGroup({groupID:this.getGroupId(),userIDList:n,type:this._callType,roomId:this.getRoomId(),strRoomId:this.getStrRoomId(),timeout:this._callTimeout,inCallUserIDs:l(this._unHandledInviteeList,c),offlinePushInfo:i,initialCallId:this.getInitialCallId()})];case 2:return d=s.sent(),T.default.log("inviteUser res",d),0===d.code?(this.addUnHandledInviteeList(n),this.addInviterInviteId(d.inviteID,l([this._userID],n)),p={eventType:S.NAME.INVITE_USER,callType:S.NAME.GROUP,mediaType:this._callType,inviteeList:n},this._callRecordUpload(p)):this._logger.error("inviteUser.fail",{type:"api"}),[2,d];case 3:throw h=s.sent(),new Error("inviteUser failed, userId:"+this.getUserId()+", inviteeIdList:"+n+", error: "+h);case 4:return[2]}}))}))},t.prototype.accept=function(){var t,e;return o(this,void 0,void 0,(function(){var n,r,a,o,l,u,c,d,p;return s(this,(function(s){switch(s.label){case 0:return this._logger.info("accept.start",{text:{data:{callStatus:this.getCallStatus(),inviteData:this._tsignalingClient.getInviteData()},type:"api"}}),T.default.debug("accept"),this.getCallStatus()===R.CALL_STATUS.CONNECTED?(this._logger.error("accept.fail",{text:{error:"already connected, avoid repeat accept"},type:"api"}),T.default.warn("accept - already connected, avoid repeat accept"),[2]):this._tsignalingClient.getInviteData()?(this._callDataReport.setCallAcceptTime((new Date).getTime()),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.getMediaDevicesAuth({audio:!0})]):(this._logger.error("accept.fail",{text:{error:"there are no calls to accept"},type:"api"}),T.default.warn("accept - there are no calls to accept"),[2]);case 1:return s.sent().audio?[3,3]:[4,this._resetTUICallEngine()];case 2:s.sent(),s.label=3;case 3:n=this._tsignalingClient.getInviteData(),r=n.inviteID,a=n.inviteData,o=a.roomID,l=a.callType,T.default.debug("accept - params","inviteID: "+r+",callType: "+l+",roomID: "+o+"."),this._callType=l,this._callStatus=R.CALL_STATUS.CALLING,console.log("accept roomId: "+o),u={},s.label=4;case 4:return s.trys.push([4,6,,8]),this._callDataReport.setEnterRoomTime((new Date).getTime()),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.enterRoom({roomId:this.getRoomId(),strRoomId:this.getStrRoomId()})];case 5:return s.sent(),this.addHandledInviteeList([this.getUserId()]),this.deleteUnHandledInviteeList([this.getUserId()]),this.addAcceptedUserList(r,[this.getUserId()]),this._tsignalingClient.setInviteData(null),this.changeCallStatus(R.CALL_STATUS.CONNECTED),this.getCallRecordReport().setBodyStatus(R.CALL_STATUS.CONNECTED),[3,8];case 6:return c=s.sent(),this.isGroupCall()||(c.getCode?this._callDataReport.setCodeAndMessage(c.getCode(),c.message):this._callDataReport.setCodeAndMessage(y.default.UNKNOWN,JSON.stringify(c)),this._callDataReport.uploadToKibana()),this._logger.error("accept.join.fail",{text:{error:c},type:"api"}),[4,this._resetTUICallEngine()];case 7:throw s.sent(),new Error("accept failed, error: "+c);case 8:u={roomID:o,callType:l},s.label=9;case 9:return s.trys.push([9,13,,15]),[4,this.modifyInvitation(r)];case 10:return s.sent(),[4,this._tsignalingClient.accept({inviteID:r,callType:l})];case 11:return d=s.sent(),[4,this.setSelfIMCallStatus(R.CALL_STATUS.CONNECTED)];case 12:return s.sent(),this._callRecordUpload({eventType:S.NAME.ACCEPT_CALL}),[3,15];case 13:return p=s.sent(),this._logger.error("accept.fail",{text:{error:p},type:"api"}),T.default.error(p),[4,this._resetTUICallEngine()];case 14:throw s.sent(),this.isGroupCall()||(this._callDataReport.setCodeAndMessage(y.default.UNKNOWN,JSON.stringify(p)),this._callDataReport.uploadToKibana()),new A.default({message:": failed "+p.message,code:p.code});case 15:return[2,i(i({},u),d)]}}))}))},t.prototype.reject=function(){return o(this,void 0,void 0,(function(){var t,e,n,r,a,o,l,u;return s(this,(function(s){switch(s.label){case 0:if(this._logger.info("reject.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus},type:"api"}}),!this._tsignalingClient.getInviteData())return T.default.warn("reject - there are no calls to reject"),[2];t=this._callStatus===R.CALL_STATUS.CONNECTED,e=this._tsignalingClient.getInviteData(),n=e.inviteID,r=e.inviteData,a=r.callType,T.default.warn("reject - params","inviteID: "+n+",callType: "+a+",isBusy: "+t+"."),s.label=1;case 1:return s.trys.push([1,5,,6]),[4,this._tsignalingClient.reject({inviteID:n,callType:a,isBusy:t})];case 2:return o=s.sent(),this._callRecordUpload({eventType:S.NAME.REJECT_CALL}),t?[3,4]:(l=this.generateEventData(),[4,this._resetTUICallEngine()]);case 3:s.sent(),this._delegate.onCallingCancel(i(i({userID:this._userID},l),{reason:S.NAME.REJECT})),s.label=4;case 4:return[2,o];case 5:throw u=s.sent(),this._logger.error("reject.fail",{text:{error:u},type:"api"}),new A.default({message:": failed "+u.message,code:u.code});case 6:return[2]}}))}))},t.prototype.hangup=function(){var t;return o(this,void 0,void 0,(function(){var e,n,r,a,o,u,c,d,p,h,_,f,E,g,I,v,C,m,A,y;return s(this,(function(L){switch(L.label){case 0:if(this._logger.info("hangup.start",{text:{data:{inviteData:this._tsignalingClient.getInviteData(),callStatus:this._callStatus,inviterInviteID:this._acceptedUserObject,inviteIdList:this.getInviterInviteIdList(),isInviter:this.isInviter(),isGroupCall:this.isGroupCall(),callType:this.getCallType(),currentUserID:this.getUserId()}},type:"api"}),T.default.warn(" - callStatus:"+this._callStatus+" _inviterInviteID:"+JSON.stringify(this._acceptedUserObject)),this._callStatus===R.CALL_STATUS.IDLE)throw this._logger.error("hangup.fail",{text:{error:"current status:"+this._callStatus,type:"api"}}),new Error("hangup failed. current status:"+this._callStatus);if(this._callStatus===R.CALL_STATUS.CALLING&&0===this.getInviterInviteIdList().length)throw this._logger.error("hangup.fail",{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("call/groupCall incomplete。please wait cancel");if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserId(),a=this.generateCallTotalTime(),o=this.getCallType(),c=this.getInviterInviteIdList(),this._callStatus!==R.CALL_STATUS.CONNECTED)return[3,7];L.label=1;case 1:return L.trys.push([1,5,,7]),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.exitRoom()];case 2:return L.sent(),0!==c.length?[3,4]:(f=this.generateCallEndData({callMediaType:o,totalTime:a}),this._delegate.onCallEnd(f),[4,this._resetTUICallEngine()]);case 3:L.sent(),L.label=4;case 4:return[3,7];case 5:return d=L.sent(),this._logger.error("hangup.fail",{text:{error:d},type:"api"}),[4,this._resetTUICallEngine()];case 6:throw L.sent(),new Error(d);case 7:p=this.getHandledInviteeList(),h=this.getUnHandledInviteeList(),_=this.generateEventData(),L.label=8;case 8:return L.trys.push([8,30,,31]),e?[3,15]:(f=this.generateCallEndData(),n?1!==h.length?[3,10]:[4,this._cancel()]:[3,12]);case 9:return u=L.sent(),this._delegate.onCallingCancel(i(i({userID:r},_),{reason:S.NAME.NORMAL})),[3,11];case 10:this._delegate.onCallEnd(f),L.label=11;case 11:return[3,13];case 12:this._delegate.onCallEnd(f),L.label=13;case 13:return[4,this._resetTUICallEngine()];case 14:return L.sent(),[3,29];case 15:return E=this.getCallStatus(),g={callType:o,userIDList:l(p.filter((function(t){return t!==r})),h),callEnd:a},n?E!==R.CALL_STATUS.CALLING?[3,18]:[4,this._cancel(this.getInviterInviteIdList())]:[3,23];case 16:return u=L.sent(),[4,this._resetTUICallEngine()];case 17:L.sent(),this._delegate.onCallingCancel(i(i({userID:r},_),{reason:S.NAME.NORMAL})),L.label=18;case 18:if(E!==R.CALL_STATUS.CONNECTED)return[3,22];I=function(t){var e,n,i,a,o,d;return s(this,(function(s){switch(s.label){case 0:return e=c[t],n=v.getInviterInviteIdUserList(e),(i=v.getAcceptedUserList(e)).length>0?(a=i.filter((function(t){return-1!==p.indexOf(t)})),o=n.filter((function(t){return-1!==h.indexOf(t)})),g.userIDList=l(a,o).filter((function(t){return t!==r})),T.default.warn("inviter emit hangup signal, notify userIDList:"+JSON.stringify(g.userIDList)),0===g.userIDList.length?[3,2]:[4,v._tsignalingClient.hangup(g)]):[3,5];case 1:return u=s.sent(),[3,4];case 2:return p.length>1?(g.userIDList=p.filter((function(t){return t!==r})),[4,v._tsignalingClient.hangup(g)]):[3,4];case 3:u=s.sent(),s.label=4;case 4:return[3,7];case 5:return d=v.getUnHandledInviteeList(),n.filter((function(t){return-1!==d.indexOf(t)})).length>0?(T.default.warn("inviter emit cancel signal, userIdList:"+n),[4,v._cancel([e])]):[3,7];case 6:u=s.sent(),s.label=7;case 7:return[2]}}))},v=this,A=0,L.label=19;case 19:return A0?(d=i.filter((function(t){return-1!==p.indexOf(t)})),_=n.filter((function(t){return-1!==h.indexOf(t)})),g.userIDList=l(d,_).filter((function(t){return t!==r})),T.default.warn("invitee emit hangup signal, notify userIDList:"+JSON.stringify(g.userIDList)),0!==g.userIDList.length?[3,1]:(f=m.generateCallEndData({callMediaType:o,totalTime:a}),m._delegate.onCallEnd(f),[3,3])):[3,4];case 1:return p.length>1&&(g.userIDList=p.filter((function(t){return t!==r}))),[4,m._tsignalingClient.hangup(g)];case 2:u=s.sent(),s.label=3;case 3:return[3,6];case 4:return E=m.getUnHandledInviteeList(),n.filter((function(t){return-1!==E.indexOf(t)})).length>0?(T.default.warn("invitee emit cancel signal, inviteID:"+e),[4,m._cancel([e])]):[3,6];case 5:u=s.sent(),s.label=6;case 6:return[2]}}))},m=this,A=0,L.label=24;case 24:return A: failed "+a.message,code:a.code});case 8:return o="cancel "+JSON.stringify(e)+" succeeded",T.default.log("_cancel "+o),[2,e]}}))}))},t.prototype.startRemoteView=function(t){var e;return o(this,void 0,void 0,(function(){var n,i,r,a;return s(this,(function(o){return this._logger.info("startRemoteView.start",{text:{data:t},type:"api"}),T.default.info("startRemoteView - params:",t),n=t.userID,i=t.videoViewDomID,(r=t.options)&&(a=d.analyzeVideoRenderParams(r),this.setRemotePlayOptions(a)),[2,null===(e=this._trtcClient)||void 0===e?void 0:e.startRemoteView({userId:n,videoViewDomId:i,options:r})]}))}))},t.prototype.stopRemoteView=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){return this._logger.info("stopRemoteView.start",{text:{data:t},type:"api"}),T.default.debug("stopRemoteView - params:",t),[2,null===(e=this._trtcClient)||void 0===e?void 0:e.stopRemoteView({userId:t.userID})]}))}))},t.prototype.startLocalView=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(t){return T.default.warn("startLocalView interface is deprecated after v3.0.0"),[2]}))}))},t.prototype.stopLocalView=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(t){return T.default.warn("stopLocalView interface is deprecated after v3.0.0"),[2]}))}))},t.prototype.openCamera=function(t,e){var n,i;return o(this,void 0,void 0,(function(){var r;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this._logger.info("openCamera.start",{text:{data:{videoViewDomID:t,isFrontCamera:e}},type:"api"}),[4,null===(n=this._trtcClient)||void 0===n?void 0:n.getMediaDevicesAuth({video:!0})];case 1:return a.sent(),[4,null===(i=this._trtcClient)||void 0===i?void 0:i.startLocalPreview(t,e)];case 2:return a.sent(),[3,4];case 3:throw r=a.sent(),this._logger.error("openCamera.fail",{text:{error:r},type:"api"}),T.default.error("openCamera failed. error: "+r),new Error("openCamera failed. error: "+r);case 4:return[2]}}))}))},t.prototype.closeCamera=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){try{return this._logger.info("closeCamera.start",{type:"api"}),[2,null===(t=this._trtcClient)||void 0===t?void 0:t.stopLocalPreview()]}catch(t){throw new Error("closeCamera failed. error: "+t)}return[2]}))}))},t.prototype.openMicrophone=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("openMicrophone.start",{type:"api"}),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.unMuteLocalAudio()];case 1:return e.sent(),[2]}}))}))},t.prototype.closeMicrophone=function(){var t;return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("closeMicrophone.start",{type:"api"}),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.muteLocalAudio()];case 1:return e.sent(),[2]}}))}))},t.prototype.setVideoQuality=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this._logger.info("setVideoQuality.start",{text:{data:{profile:t,currentProfile:this.getVideoQuality(),hasTrtcClient:!!this._trtcClient}},type:"api"}),T.default.debug("setVideoQuality - quality:"+JSON.stringify(t)),t===this.getVideoQuality()?(T.default.warn("setVideoQuality failed - profile not change"),[2]):(this._quality=t,[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVideoEncoderParam(t)]);case 1:return n.sent(),[2]}}))}))},t.prototype.getVideoQuality=function(){return this._quality},t.prototype.setVideoRenderParams=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return this._logger.info("setVideoRenderParams.start",{text:{data:{params:t,hasTRTCClient:!!this._trtcClient}},type:"api"}),console.warn("setVideoRenderParams params: "+JSON.stringify(t)),n=d.analyzeVideoRenderParams(t),t.userID===this.getUserId()?(this.setLocalPlayOptions(n),n=this.getLocalPlayOptions()):(this.setRemotePlayOptions(n),n=this.getRemotePlayOptions()),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVideoRenderParams(i({userId:t.userID},n))];case 1:return r.sent(),[2]}}))}))},t.prototype.switchCallMediaType=function(t){return o(this,void 0,void 0,(function(){var e,n;return s(this,(function(i){switch(i.label){case 0:if(this._logger.info("switchCallMediaType.start",{text:{data:{newMediaType:t,currentCallType:this._callType}},type:"api"}),this._callType===t)throw this._logger.error("switchCallMediaType.fail",{text:{error:L.ERROR_MESSAGE.ERROR_REQUEST_REPEATED_SWITCH},type:"api"}),new A.default({message:": "+L.ERROR_MESSAGE.ERROR_REQUEST_REPEATED_SWITCH,code:y.default.ERROR_REQUEST_REPEATED});if(!this._switchCallModeStatus)throw this._logger.error("switchCallMediaType.fail",{text:{error:"audio and video call switching"},type:"api"}),new Error("audio and video call switching.");T.default.info("switchCallMediaType",this._inviterID,this._inviteeID),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this._tsignalingClient.switchCallMode({userID:this._isInviter?this._inviteeID:this._inviterID,callType:this._callType,roomID:this.getRoomId(),timeout:this._callTimeout,mode:t===R.CALL_TYPE.AUDIO_CALL?R.MODE_TYPE.AUDIO:R.MODE_TYPE.VIDEO})];case 2:return e=i.sent(),this.setSwitchCallModeStatus(!1),[2,e];case 3:throw n=i.sent(),this._logger.error("switchCallMediaType.fail",{text:{error:n},type:"api"}),new Error("switchCallMediaType failed, error: "+n);case 4:return[2]}}))}))},t.prototype.setSwitchCallModeStatus=function(t){this._switchCallModeStatus=t},t.prototype.getSwitchCallModeStatus=function(){return this._switchCallModeStatus},t.prototype.getDeviceList=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this._logger.info("getDeviceList.start",{text:{data:{deviceType:t}},type:"api"}),(t=t===m.DEVICE_TYPE.MICROPHONES?m.DEVICE_TYPE.MICROPHONE:t)!==m.DEVICE_TYPE.MICROPHONE&&t!==m.DEVICE_TYPE.SPEAKER?[3,2]:[4,this._trtcClient.getMediaDevicesAuth({audio:!0})];case 1:e.sent(),e.label=2;case 2:return t!==m.DEVICE_TYPE.CAMERA?[3,4]:[4,this._trtcClient.getMediaDevicesAuth({video:!0,isThrowVideoError:!0})];case 3:e.sent(),e.label=4;case 4:return[4,this._trtcClient.getDeviceList(t)];case 5:return[2,e.sent()]}}))}))},t.prototype.getCurrentDevice=function(t){return this._trtcClient.getCurrentDevice(t)},t.prototype.switchCamera=function(t){return o(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:this._logger.info("switchCamera.start",{text:{data:{cameraPosition:t}},type:"api"}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this._trtcClient.switchCamera(t)];case 2:return e.sent(),[3,4];case 3:throw e.sent();case 4:return[2]}}))}))},t.prototype.switchDevice=function(t){var e;return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(r){switch(r.label){case 0:return this._logger.info("switchDevice.start",{text:{data:{params:t}},type:"api"}),n=t.deviceType,i=t.deviceId,n===m.DEVICE_TYPE.VIDEO&&(n=m.DEVICE_TYPE.CAMERA),n!==m.DEVICE_TYPE.AUDIO&&n!==m.DEVICE_TYPE.MICROPHONES||(n=m.DEVICE_TYPE.MICROPHONE),T.default.debug("switchDevice - params: deviceType:"+n+",deviceID:"+i),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.switchDevice(n,i)];case 1:return[2,r.sent()]}}))}))},t.prototype.setSelfInfo=function(t){return o(this,void 0,void 0,(function(){var e,n,i;return s(this,(function(r){return this._logger.info("setSelfInfo.start",{text:{data:{params:t}},type:"api"}),e=t.nickName,n=t.avatar,i={nick:e,avatar:n},!e&&delete i.nick,!n&&delete i.avatar,T.default.info("setSelfInfo -params: nickName:"+i.nick+",avatar:"+i.avatar),[2,this.tim.updateMyProfile(i)]}))}))},t.prototype.generateCallEndData=function(t){var e=t||{},n=e.roomId,i=e.callMediaType,r=e.callRole,a=e.totalTime,o=e.userId;return n=n||this.getRoomId(),i=i||this.getCallType(),r||(r=this.isInviter()?R.CALL_ROLE.INVITER:R.CALL_ROLE.INVITEE),a=d.isUndefined(a)?this.generateCallTotalTime():a,o=o||this.getUserId(),{roomID:n,strRoomID:this.getStrRoomId(),callMediaType:i,callRole:r,totalTime:a,userID:o}},t.prototype.generateEventData=function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomId(),strRoomID:this.getStrRoomId(),callRole:this._isInviter?S.NAME.INVITER:S.NAME.INVITEE,callMediaType:this._callType}},t.prototype.enableMultiDeviceAbility=function(t){this._logger.info("enableMultiDeviceAbility.start",{text:{data:{enable:t}},type:"api"}),this.setIsEnableMultiDeviceAbility(t)},t.prototype.enableAIVoice=function(t){var e;return o(this,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return this._logger.info("enableAIVoice.start",{text:{data:{enable:t}},type:"api"}),this._trtcClient?[4,null===(e=this._trtcClient)||void 0===e?void 0:e.enableAIVoice(t)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))},t.prototype.setBlurBackground=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._logger.info("setBlurBackground.start",{type:"api",text:{data:{blurLevel:t}}}),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVirtualBackground({enable:0!==t,type:S.NAME.BLUR,blurLevel:t})];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),this._logger.error("setBlurBackground.fail",{text:{error:n},type:"api"}),n;case 3:return[2]}}))}))},t.prototype.setVirtualBackground=function(t){var e;return o(this,void 0,void 0,(function(){var n;return s(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this._logger.info("setVirtualBackground.start",{type:"api",text:{data:{imagePath:t}}}),[4,null===(e=this._trtcClient)||void 0===e?void 0:e.setVirtualBackground({enable:!!t,type:S.NAME.IMAGE,imagePath:t})];case 1:return i.sent(),[3,3];case 2:throw n=i.sent(),this._logger.error("setVirtualBackground.fail",{text:{error:n},type:"api"}),n;case 3:return[2]}}))}))},t.prototype.getTRTCCloudInstance=function(){var t;return null===(t=this._trtcClient)||void 0===t?void 0:t.getTRTCCloud()},t.prototype._resetTUICallEngine=function(){var t;return o(this,void 0,void 0,(function(){var e;return s(this,(function(n){switch(n.label){case 0:return this.getCallStatus()===R.CALL_STATUS.IDLE?[3,2]:(this._callStatus=R.CALL_STATUS.IDLE,this.getIsLogin()?[4,this.setSelfIMCallStatus(R.CALL_STATUS.IDLE)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return T.default.debug("_resetTUICallEngine"),this._roomID=0,this._strRoomId="",this._isInviter=!1,this._isGroupCall=!1,this.setSwitchCallModeStatus(!0),this._groupID="",this._inviteeList=[],this._unHandledInviteeList=[],this._handledInviteeList=[],this._inviterInviteID={},this._initialInviteData={},this._audioVideoSwitchIdList=[],this._acceptedUserObject={},this._connectStartTime=0,this._switchCallModeStatus=!0,this._initialCallId="",this._callTimeout=30,this.setIsEnableMultiDeviceAbility(!1),[4,null===(t=this._trtcClient)||void 0===t?void 0:t.resetTRTCClient()];case 3:return n.sent(),this._tsignalingClient.setInviteData(null),this._tsignalingClient.resetJoined(),(e=document.getElementById("_trtc_calling_layer"))&&(e.innerHTML=""),[2]}}))}))},t.prototype.getCallStatus=function(){return this._callStatus},t.prototype.changeCallStatus=function(t){this._callStatus!==t&&(this._logger.info("changeCallStatus.start",{text:{data:{newCallStatus:t,currentStatus:this._callStatus}},type:"api"}),T.default.debug("changeCallStatus from "+this._callStatus+" to "+t),this._callStatus=t)},t.prototype.setInitialInviteData=function(t){this._initialInviteData=t},t.prototype.modifyInvitation=function(t){return o(this,void 0,void 0,(function(){var e,n;return s(this,(function(r){switch(r.label){case 0:if(this.isGroupCall())return[2];e=i(i({},this._initialInviteData.data),{consumed:!0}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.tim.modifyInvitation({inviteID:t,data:JSON.stringify(i(i({},this._initialInviteData),{data:e}))})];case 2:return r.sent(),[3,4];case 3:return n=r.sent(),T.default.error("modifyInvitation fail "+n),[3,4];case 4:return[2]}}))}))},t.prototype._callRecordUpload=function(t){var e=i(i({},t),{callRole:this.isInviter()?S.NAME.INVITER:S.NAME.INVITEE,userID:this.getUserId(),roomID:this.getRoomId(),inviteID:this.getInitialCallId(),strRoomId:this.getStrRoomId(),groupId:this.getGroupId()});this._callRecordReport.eventUpload(e)},t.prototype.extractCallingInfoFromMessage=function(t){if(!t)return"";if("TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(T.default.debug("extractCallingInfoFromMessage - signalingData:",t.payload.data),e.businessID!==R.BUSINESS_ID.SIGNAL)return"";switch(e.actionType){case R.ACTION_TYPE.INVITE:var n=JSON.parse(e.data);return n.call_end>0?"结束通话,通话时长:"+d.formatDuration(n.call_end):0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case R.ACTION_TYPE.CANCEL_INVITE:return"取消通话";case R.ACTION_TYPE.ACCEPT_INVITE:return"已接听";case R.ACTION_TYPE.REJECT_INVITE:return"拒绝通话";case R.ACTION_TYPE.INVITE_TIMEOUT:return"无应答";default:return""}},t.prototype.setInitialCallId=function(t){this._initialCallId=t},t.prototype.getInitialCallId=function(){return this._initialCallId},t.prototype.setIsEnableMultiDeviceAbility=function(t){this._isEnableMultiDeviceAbility=!!t},t.prototype.getIsEnableMultiDeviceAbility=function(){return this._isEnableMultiDeviceAbility},t.prototype.generateCallTotalTime=function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)},t.prototype.setSelfIMCallStatus=function(t){var e;return o(this,void 0,void 0,(function(){var n,i;return s(this,(function(r){switch(r.label){case 0:if(this._logger.info("setSelfIMCallStatus.start",{text:{data:{callStatus:t,isEnableMultiDeviceAbility:this.getIsEnableMultiDeviceAbility()}},type:"api"}),!this.getIsEnableMultiDeviceAbility())return[2];if(!this.tim||!t||!this.getIsLogin())return[2];n=R.USER_CUSTOM_STATUS.NULL,r.label=1;case 1:switch(r.trys.push([1,3,,4]),t){case R.CALL_STATUS.CALLING:n=R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT;break;case R.CALL_STATUS.CONNECTED:n=R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT}return[4,null===(e=this.tim)||void 0===e?void 0:e.setSelfStatus({customStatus:n})];case 2:return r.sent(),[3,4];case 3:return i=r.sent(),this._logger.error("setSelfIMCallStatus.fail",{text:{error:i},type:"api"}),[3,4];case 4:return[2]}}))}))},t.prototype.getSelfIMCallStatus=function(t){var e;return void 0===t&&(t=[]),o(this,void 0,void 0,(function(){var n,i,r,a;return s(this,(function(o){switch(o.label){case 0:if(n=R.CALL_STATUS.IDLE,!this.getIsEnableMultiDeviceAbility())return[2,n];o.label=1;case 1:return o.trys.push([1,3,,4]),this._logger.info("getSelfIMCallStatus.start",{text:{data:t},type:"api"}),this.tim&&0!==t.length&&this.getIsLogin()?[4,null===(e=this.tim)||void 0===e?void 0:e.getUserStatus({userIDList:t})]:[2,n];case 2:if(0===(i=o.sent()).code)switch(r=(i.data||{}).successUserList,((void 0===r?[]:r)[0]||{}).customStatus){case R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_WAIT:n=R.CALL_STATUS.CALLING;break;case R.USER_CUSTOM_STATUS.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT:n=R.CALL_STATUS.CONNECTED}return[3,4];case 3:return a=o.sent(),this._logger.error("getSelfIMCallStatus.fail",{text:{error:a},type:"api"}),[3,4];case 4:return[2,n]}}))}))},t.prototype.setSdkAppId=function(t){this._sdkAppID=t},t.prototype.getSdkAppId=function(){return this._sdkAppID},t.prototype.setUserId=function(t){this._userID=t},t.prototype.getUserId=function(){return this._userID},t.prototype.setRoomId=function(t){this._roomID=t},t.prototype.getRoomId=function(){return this._roomID},t.prototype.setStrRoomId=function(t){this._strRoomId=t},t.prototype.getStrRoomId=function(){return this._strRoomId},t.prototype.analyzeAndSetRoomId=function(t,e){var n=d.analyzeRoomId(t,e);d.isNumber(n)&&this.setRoomId(n),e&&this.setStrRoomId(e)},t.prototype.setUserSig=function(t){this._userSig=t},t.prototype.getUserSig=function(){return this._userSig},t.prototype.getLanguage=function(){return this._language},t.prototype.setComponent=function(t){this._component=t},t.prototype.getComponent=function(){return this._component},t.prototype.getDevicePermission=function(){var t;(null===(t=this._trtcClient)||void 0===t?void 0:t._getDevicePermission)&&this._trtcClient._getDevicePermission()},t.prototype.callExperimentalAPI=function(t){return o(this,void 0,void 0,(function(){var e,n,i,r,a,o;return s(this,(function(s){if(this._logger.info("callExperimentalAPI",{text:{data:t},type:"api"}),(e=d.safelyParse(t))===t)return[2];if(n=e.api,i=e.params,r=void 0===i?{}:i,!n||!r)return[2];try{switch(n){case"setExcludeFromHistoryMessage":a=r.excludeFromHistoryMessage,o=void 0!==a&&a,this._excludeFromHistoryMessage=o}}catch(t){throw t}return[2]}))}))},t.CALL_TYPE=R.CALL_TYPE,r([D.paramValidate(D.VALIDATE_PARAMS.login),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"init",null),r([D.paramValidate(D.VALIDATE_PARAMS.login),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"login",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.call),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.BASE),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"call",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.groupCall),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"groupCall",null),r([D.paramValidate(D.VALIDATE_PARAMS.joinInGroupCall),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.IDLE]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"joinInGroupCall",null),r([D.paramValidate(D.VALIDATE_PARAMS.inviteUser),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"inviteUser",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"accept",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"reject",null),r([D.avoidRepeatedCall(),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"hangup",null),r([D.paramValidate(D.VALIDATE_PARAMS.startRemoteView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"startRemoteView",null),r([D.paramValidate(D.VALIDATE_PARAMS.stopRemoteView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"stopRemoteView",null),r([D.paramValidate(D.VALIDATE_PARAMS.startLocalView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"startLocalView",null),r([D.paramValidate(D.VALIDATE_PARAMS.stopLocalView),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),D.apiCallQueue(),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"stopLocalView",null),r([D.paramValidate(D.VALIDATE_PARAMS.openCamera),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[String,Boolean]),a("design:returntype",Promise)],t.prototype,"openCamera",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"closeCamera",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"openMicrophone",null),r([D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[]),a("design:returntype",Promise)],t.prototype,"closeMicrophone",null),r([D.paramValidate(D.VALIDATE_PARAMS.setVideoQuality),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"setVideoQuality",null),r([D.paramValidate(D.VALIDATE_PARAMS.setVideoRenderParams),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"setVideoRenderParams",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchCallMediaType),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CONNECTED,R.CALL_STATUS.CALLING],scene:!0}),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"switchCallMediaType",null),r([D.paramValidate(D.VALIDATE_PARAMS.getDeviceList),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"getDeviceList",null),r([D.paramValidate(D.VALIDATE_PARAMS.getCurrentDevice),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",void 0)],t.prototype,"getCurrentDevice",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchCamera),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"switchCamera",null),r([D.paramValidate(D.VALIDATE_PARAMS.switchDevice),D.statusValidate({init:!0,callStatus:[R.CALL_STATUS.CALLING,R.CALL_STATUS.CONNECTED]}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"switchDevice",null),r([D.paramValidate(D.VALIDATE_PARAMS.setSelfInfo),D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",Promise)],t.prototype,"setSelfInfo",null),r([D.avoidRepeatedCall(),D.paramValidate(D.VALIDATE_PARAMS.enableMultiDeviceAbility),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.PRO),a("design:type",Function),a("design:paramtypes",[Boolean]),a("design:returntype",void 0)],t.prototype,"enableMultiDeviceAbility",null),r([D.statusValidate({init:!0}),a("design:type",Function),a("design:paramtypes",[Boolean]),a("design:returntype",Promise)],t.prototype,"enableAIVoice",null),r([D.statusValidate({init:!0}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),a("design:type",Function),a("design:paramtypes",[Number]),a("design:returntype",Promise)],t.prototype,"setBlurBackground",null),r([D.statusValidate({init:!0}),D.businessValidate(R.CALL_EXPERMENTEL_API_TYPE.ULTIMATE),a("design:type",Function),a("design:paramtypes",[String]),a("design:returntype",Promise)],t.prototype,"setVirtualBackground",null),r([D.paramValidate(D.VALIDATE_PARAMS.createInstance),a("design:type",Function),a("design:paramtypes",[Object]),a("design:returntype",void 0)],t,"createInstance",null),t}();e.default=M},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return o}));const i=Function.prototype.apply,r=new WeakMap;function a(t){return r.has(t)||r.set(t,{}),r.get(t)}class o{constructor(t=null,e=console){const n=a(this);return n._events=new Set,n._callbacks={},n._console=e,n._maxListeners=null===t?null:parseInt(t,10),this}_addCallback(t,e,n,i){return this._getCallbacks(t).push({callback:e,context:n,weight:i}),this._getCallbacks(t).sort((t,e)=>t.weight>e.weight),this}_getCallbacks(t){return a(this)._callbacks[t]}_getCallbackIndex(t,e){return this._has(t)?this._getCallbacks(t).findIndex(t=>t.callback===e):null}_achieveMaxListener(t){return null!==a(this)._maxListeners&&a(this)._maxListeners<=this.listenersNumber(t)}_callbackIsExists(t,e,n){const i=this._getCallbackIndex(t,e),r=-1!==i?this._getCallbacks(t)[i]:void 0;return-1!==i&&r&&r.context===n}_has(t){return a(this)._events.has(t)}on(t,e,n=null,i=1){const r=a(this);if("function"!=typeof e)throw new TypeError(e+" is not a function");return this._has(t)?(this._achieveMaxListener(t)&&r._console.warn(`Max listeners (${r._maxListeners}) for event "${t}" is reached!`),this._callbackIsExists(...arguments)&&r._console.warn(`Event "${t}" already has the callback ${e}.`)):(r._events.add(t),r._callbacks[t]=[]),this._addCallback(...arguments),this}once(t,e,n=null,r=1){const a=(...r)=>(this.off(t,a),i.call(e,n,r));return this.on(t,a,n,r)}off(t,e=null){const n=a(this);let i;return this._has(t)&&(null===e?(n._events.delete(t),n._callbacks[t]=null):(i=this._getCallbackIndex(t,e),-1!==i&&(n._callbacks[t].splice(i,1),this.off(...arguments)))),this}emit(t,...e){return this._has(t)&&this._getCallbacks(t).forEach(t=>i.call(t.callback,t.context,e)),this}clear(){const t=a(this);return t._events.clear(),t._callbacks={},this}listenersNumber(t){return this._has(t)?this._getCallbacks(t).length:null}}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0?[4,this._trtcCloud.startLocalAudio()]:[3,5];case 1:return n.sent(),this._tuiCallEngine.isInviter()?[4,this._tuiCallEngine.setSelfIMCallStatus(f.CALL_STATUS.CALLING)]:[3,4];case 2:return n.sent(),[4,this.muteLocalAudio()];case 3:return n.sent(),[3,5];case 4:this.setIsVideoPublish(!0),this.setIsAudioPublish(!0),e=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(e),n.label=5;case 5:return[2]}}))}))})),null===(e=this._trtcCloud)||void 0===e||e.on("onExitRoom",(function(t){return r(v,void 0,void 0,(function(){var e,n;return a(this,(function(r){switch(r.label){case 0:return u.default.warn("退房, reason = "+t),0===t?[3,4]:(u.default.warn("leave room, reason: "+t),this._tuiCallEngine.getCallStatus()===f.CALL_STATUS.CONNECTED&&(e=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(e)),this._tuiCallEngine.getCallStatus()!==f.CALL_STATUS.CALLING?[3,2]:(n=i(i({},this._tuiCallEngine.generateEventData()),{reason:t}),this._tuiCallEngine._delegate.onCallingCancel(i({userID:this._tuiCallEngine.getUserId()},n)),[4,this._tuiCallEngine._cancel()]));case 1:r.sent(),r.label=2;case 2:return[4,this._tuiCallEngine._resetTUICallEngine()];case 3:r.sent(),r.label=4;case 4:return[2]}}))}))})),null===(n=this._trtcCloud)||void 0===n||n.on("onRemoteUserEnterRoom",(function(t){return r(v,void 0,void 0,(function(){var e,n;return a(this,(function(i){switch(i.label){case 0:return u.default.info(T+".onRemoteUserEnterRoom userId = "+t),this._tuiCallEngine.getConnectStartTime()||(this._tuiCallEngine.setConnectStartTime(Date.now()),this._openAudioVolumeEvaluation()),this._tuiCallEngine._delegate.onUserEnter(t),this._tuiCallEngine.addHandledInviteeList([t]),this._tuiCallEngine.deleteUnHandledInviteeList([t]),this._tuiCallEngine.addAcceptedUserList(null,[t]),this._tuiCallEngine.getCallStatus()!==f.CALL_STATUS.CALLING?[3,6]:(this._tuiCallEngine.changeCallStatus(f.CALL_STATUS.CONNECTED),this._tuiCallEngine.isInviter()?(e=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(e),!this.getIsVideoPublish()?[4,this.muteLocalVideo(!1)]:[3,2]):[3,6]);case 1:i.sent(),i.label=2;case 2:return!this.getIsAudioPublish()?[4,this.unMuteLocalAudio()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,this._tuiCallEngine.setSelfIMCallStatus(f.CALL_STATUS.CONNECTED)];case 5:i.sent(),i.label=6;case 6:return this._tuiCallEngine.isGroupCall()&&(n=this._tuiCallEngine.getHandledInviteeList(),this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(n)),[2]}}))}))})),null===(l=this._trtcCloud)||void 0===l||l.on("onRemoteUserLeaveRoom",(function(t,e){return r(v,void 0,void 0,(function(){var n,i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return u.default.info(T+".onRemoteUserLeaveRoom userId = "+t+", reason = "+e),this._tuiCallEngine.getCallStatus()===f.CALL_STATUS.IDLE?[2]:(n=this._tuiCallEngine.isGroupCall(),this._tuiCallEngine.deleteHandledInviteeList([t]),this._tuiCallEngine._delegate.onUserLeave(t),i=this._tuiCallEngine.getHandledInviteeList(),n?(r=this._tuiCallEngine.getUnHandledInviteeList(),0!==i.length&&this._tuiCallEngine._delegate.onGroupCallInviteeListUpdate(i),o=this._tuiCallEngine.getUserId(),1!==i.length||i[0]!==o||0!==r.length?[3,2]:(s=this._tuiCallEngine.generateCallEndData(),this._tuiCallEngine._delegate.onCallEnd(s),[4,this._tuiCallEngine._resetTUICallEngine()])):[3,3]);case 1:a.sent(),a.label=2;case 2:return[3,6];case 3:return l={callType:this._tuiCallEngine.getCallType(),userIDList:[t],callEnd:this._tuiCallEngine.generateCallTotalTime()},1!==i.length?[3,6]:[4,this._tuiCallEngine._tsignalingClient.hangup(l)];case 4:return a.sent(),[4,this._tuiCallEngine._resetTUICallEngine()];case 5:a.sent(),a.label=6;case 6:return[2]}}))}))})),null===(c=this._trtcCloud)||void 0===c||c.on("onUserVideoAvailable",(function(t,e){v._tuiCallEngine._delegate.onUserVideoAvailable({userID:t,isVideoAvailable:e})})),null===(d=this._trtcCloud)||void 0===d||d.on("onUserAudioAvailable",(function(t,e){v._tuiCallEngine._delegate.onUserAudioAvailable({userID:t,isAudioAvailable:e})})),null===(p=this._trtcCloud)||void 0===p||p.on("onUserVoiceVolume",(function(t){t=t.map((function(t){return{userId:""===t.userId?v._tuiCallEngine.getUserId():t.userId,audioVolume:t.volume}})),v._tuiCallEngine._delegate.onUserVoiceVolume(t)})),null===(h=this._trtcCloud)||void 0===h||h.on("onDeviceChange",(function(t,e,n){return r(v,void 0,void 0,(function(){var t,n;return a(this,(function(i){switch(i.label){case 0:return(n={})[s.TRTCDeviceType.TRTCDeviceTypeMi]=E.DEVICE_TYPE.MICROPHONE,n[s.TRTCDeviceType.TRTCDeviceTypeSpeaker]=E.DEVICE_TYPE.SPEAKER,n[s.TRTCDeviceType.TRTCDeviceTypeCamera]=E.DEVICE_TYPE.CAMERA,t=n,[4,this.getDeviceList(t[e])];case 1:return i.sent(),this._updateCurrentDevice(),this._tuiCallEngine._delegate.onDeviceUpdated(this._devices,this._currentDevices),[2]}}))}))})),null===(_=this._trtcCloud)||void 0===_||_.on("onNetworkQuality",(function(t,e){return r(v,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this._tuiCallEngine.getUserId(),this._tuiCallEngine._delegate.onUserNetworkQualityChanged(o([i(i({},t),{userId:n})],e)),[2]}))}))})),null===(g=this._trtcCloud)||void 0===g||g.on("onError",(function(t,e){u.default.error(T+".onError, code = "+t+", message = "+e),v._tuiCallEngine._delegate.onError(t,e)})),null===(I=this._trtcCloud)||void 0===I||I.on("onWarning",(function(t){var e=t.code;if(10000003===e||10000006===e){var n="Insufficient device performance causes high latency, please turn off the virtual background";v._logger.info("setVirtualBackground.error",{text:{data:{code:e,message:n}},type:"api"}),v._tuiCallEngine._delegate.onError(e,n)}}))},t.prototype.removeTRTCEvents=function(){var t;null===(t=this._trtcCloud)||void 0===t||t.removeAllListeners()},t.prototype.getTRTCCloud=function(){return this._trtcCloud},t.prototype.setIsVideoPublish=function(t){this._isVideoPublish=t},t.prototype.getIsVideoPublish=function(){return this._isVideoPublish},t.prototype.setIsAudioPublish=function(t){this._isAudioPublish=t},t.prototype.getIsAudioPublish=function(){return this._isAudioPublish},t.prototype.setIsEnterRoom=function(t){this._isEnterRoom=t},t.prototype.getIsEnterRoom=function(){return this._isEnterRoom},t.prototype.setVideoStreamType=function(t){this._videoStreamType=t||this._videoStreamType},t.prototype.getVideoStreamType=function(){return this._videoStreamType},t.prototype.enableAIVoice=function(t){},t.prototype._setDevice=function(t,e){this._devices[t]=e},t.prototype._getDevicePermission=function(){return this._permission},t.prototype._setDevicePermission=function(t,e){this._permission[t]=e},t.prototype.setIsRegisterVirtualBackgroundModelFile=function(t){this._isRegisterVirtualBackgroundModelFile=t},t.prototype.getIsRegisterVirtualBackgroundModelFile=function(){return this._isRegisterVirtualBackgroundModelFile},t}();e.default=R},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isHttpProtocols=void 0,e.isHttpProtocols=function(){if(!window)return!1;if(!window.location)return!1;var t=window.location,e=t.protocol,n=t.hostname;return"http:"===e&&"localhost"!==n&&"127.0.0.1"!==n}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]1)return[2];return u=this._tuiCallEngine.generateCallEndData({totalTime:n.call_end||0}),s?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()];case 1:return a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),[3,10];case 2:return this._tuiCallEngine.deleteHandledInviteeList([e]),c=this._tuiCallEngine.getHandledInviteeList(),_=this._tuiCallEngine.getUnHandledInviteeList(),l?1!==c.length||0!==_.length?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,5];case 3:a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),a.label=4;case 4:return[3,10];case 5:return r!==d.CALL_STATUS.CALLING?[3,8]:(-1!==o.indexOf(this._tuiCallEngine.getUserId())&&this._tuiCallEngine._delegate.onUserLeave(e),0!==c.length||1!==_.length?[3,7]:(f=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]));case 6:a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i(i({userID:e},f),{reason:h.NAME.NORMAL})),a.label=7;case 7:return[3,10];case 8:return 1!==c.length||0!==_.length?[3,10]:[4,this._tuiCallEngine._resetTUICallEngine()];case 9:a.sent(),this._tuiCallEngine._delegate.onCallEnd(u),a.label=10;case 10:return[2]}}))}))},t.prototype.handleInvitedSignal=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,l,u,c,_,f,E,g,I,v,C,T,R,m;return a(this,(function(a){switch(a.label){case 0:this._logger.info(p+".handleInvitedSignal",{text:{data:i(i({},t),{isInviter:this._tuiCallEngine.isInviter(),isGroupCall:this._tuiCallEngine.isGroupCall()})},type:"event"}),e=t.inviter,n=t.inviteeList,r=t.isGroupCall,o=t.groupID,l=t.inviteID,u=t.inviteData,c=t.inCallUserIDs,_=void 0===c?[]:c,f=t.initialCallId,E=void 0===f?"":f,this._tuiCallEngine.changeCallStatus(d.CALL_STATUS.CALLING),this._tuiCallEngine.setInviterID(e),this._tuiCallEngine.setInviteeList(n),this._tuiCallEngine.setRoomId(u.room_id),this._tuiCallEngine.setStrRoomId(u.str_room_id||u.data.str_room_id),this._tuiCallEngine.setCallType(u.call_type),this._tuiCallEngine.addUnHandledInviteeList(s(n,_)),this._tuiCallEngine.addHandledInviteeList([e]),this._tuiCallEngine.addAcceptedUserList(l,[e]),this._tuiCallEngine.setInitialCallId(E),r&&(this._tuiCallEngine.setIsGroupCall(r),this._tuiCallEngine.setGroupId(o)),this._tuiCallEngine.addInviterInviteId(l,s([e],n)),g=_.filter((function(t){return-1===n.indexOf(t)})),this._newInvitationData={sponsor:e,userIDList:s(n,g),isFromGroup:r,inviteID:l,groupID:o,inviteData:{version:u.version,callType:u.call_type,roomID:u.room_id},userData:u.userData,calleeIdList:n},I=this._tuiCallEngine.getCallDataReport().getCallData(),I=i(i({},I),{roomID:u.room_id,inviteID:l,callRole:d.CALL_ROLE.INVITEE,callType:u.call_type,inviteeList:n,callScene:o?h.NAME.GROUP_CALL:h.NAME.SINGLE_CALL}),v=this._tuiCallEngine.generateEventData()||{},this._tuiCallEngine.getCallDataReport().setCallData(I),C={eventType:h.NAME.RECEIVE_CALL,callType:o?h.NAME.GROUP:h.NAME.SINGLE,mediaType:u.call_type,callRole:h.NAME.INVITEE,userID:this._tuiCallEngine.getUserId(),roomID:u.room_id,inviteID:E||l,strRoomId:this._tuiCallEngine.getStrRoomId(),groupId:this._tuiCallEngine.getGroupId()},this._tuiCallEngine.getCallRecordReport().eventUpload(C),this._tuiCallEngine._delegate.onInvited(i(i({},v),this._newInvitationData)),T=(new Date).getTime(),R=T,a.label=1;case 1:return R-T<100?[4,new Promise((function(t){return setTimeout(t,10)}))]:[3,5];case 2:return a.sent(),-1!==this._tuiCallEngine.getInviterInviteIdList().indexOf(l)?[3,4]:(this._logger.warn(p+".onNewInvitationReceived border case",{text:{data:{handleParams:t}},type:"api"}),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return a.sent(),[2];case 4:return R=(new Date).getTime(),[3,1];case 5:return[4,this._tuiCallEngine.getSelfIMCallStatus([this._tuiCallEngine.getUserId()])];case 6:return(m=a.sent())!==d.CALL_STATUS.IDLE?(this._logger.error(p+".onNewInvitationReceived",{text:{data:{handleParams:t,customStatus:m}},type:"event"}),[2]):[4,this._tuiCallEngine.setSelfIMCallStatus(d.CALL_STATUS.CALLING)];case 7:return a.sent(),[2]}}))}))},t.prototype.getInviteData=function(){return this._newInvitationData},t.prototype.setInviteData=function(t){this._newInvitationData=t},t.prototype.handleSwitchCallMode=function(t,e){return r(this,void 0,void 0,(function(){var n,i,r,o;return a(this,(function(a){switch(a.label){case 0:return n={inviteID:t,callType:e.call_type,switch_to_audio_call:null},i={cmd:d.CMD_TYPE.SWITCH_TO_VIDEO},e.call_type===d.CALL_TYPE.VIDEO_CALL?(n.switch_to_audio_call=d.CMD_TYPE.SWITCH_TO_AUDIO_CALL,i.cmd=d.CMD_TYPE.SWITCH_TO_AUDIO):delete n.switch_to_audio_call,r=this._tuiCallEngine.getCallStatus(),this.accept(n,i),r!==d.CALL_STATUS.CALLING?[3,1]:(o=e.call_type===d.CALL_TYPE.VIDEO_CALL?d.CALL_TYPE.AUDIO_CALL:d.CALL_TYPE.VIDEO_CALL,this._tuiCallEngine._delegate.onCallTypeChanged(e.call_type,o),this._newInvitationData.inviteData.callType=o,this._tuiCallEngine.setSwitchCallModeStatus(!1),[3,3]);case 1:return r!==d.CALL_STATUS.CONNECTED?[3,3]:(this._tuiCallEngine.setSwitchCallModeStatus(!1),[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]);case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},t.prototype.judgeSwitchCallMode=function(t){var e=t.switch_to_audio_call&&t.switch_to_audio_call===d.CMD_TYPE.SWITCH_TO_AUDIO_CALL||t.data&&t.data.cmd===d.CMD_TYPE.SWITCH_TO_AUDIO||t.data&&t.data.cmd===d.CMD_TYPE.SWITCH_TO_VIDEO;return c.default.info(p+".switchCallMode:",t,"isSwitchCallMode-"+e),e},t.prototype.onInviteeAccepted=function(t){return r(this,void 0,void 0,(function(){var e,n,r,o,s;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onInviteeAccepted",{text:{data:t},type:"event"}),c.default.info(p+".onInviteeAccepted - params:",t),e=JSON.parse(t.data.data),_.isCallSignaling(null==e?void 0:e.businessID)?(n=t.data.invitee,r=t.data.inviteID,-1===this._tuiCallEngine.getTotalInviterInviteIdList().indexOf(r)?[2]:this._tuiCallEngine.isGroupCall()||!this.judgeSwitchCallMode(e)||this._tuiCallEngine.getSwitchCallModeStatus()?[3,2]:[4,this._tuiCallEngine._trtcClient.switchCallMode(this._tuiCallEngine.getCallType())]):[2];case 1:return a.sent(),[2];case 2:return o=this._tuiCallEngine.getCallStatus(),n!==this._tuiCallEngine.getUserId()||o!==d.CALL_STATUS.CALLING?[3,4]:(s=this._tuiCallEngine.generateEventData(),[4,this._tuiCallEngine._resetTUICallEngine()]);case 3:return a.sent(),this._tuiCallEngine._delegate.onCallingCancel(i({userID:n},s)),[2];case 4:return o===d.CALL_STATUS.CALLING&&this._tuiCallEngine.isInviter()?(s=this._tuiCallEngine.generateEventData(),this._tuiCallEngine._delegate.onCallBegin(s),!this._tuiCallEngine._trtcClient.getIsVideoPublish()?[4,this._tuiCallEngine._trtcClient.muteLocalVideo(!1)]:[3,6]):[3,9];case 5:a.sent(),a.label=6;case 6:return!this._tuiCallEngine._trtcClient.getIsAudioPublish()?[4,this._tuiCallEngine._trtcClient.unMuteLocalAudio()]:[3,8];case 7:a.sent(),a.label=8;case 8:a.label=9;case 9:return this._tuiCallEngine.isInviter()&&this._tuiCallEngine.changeCallStatus(d.CALL_STATUS.CONNECTED),this._tuiCallEngine._delegate.onUserAccept(n),this._tuiCallEngine.addHandledInviteeList([n]),this._tuiCallEngine.deleteUnHandledInviteeList([n]),this._tuiCallEngine.addAcceptedUserList(r,[n]),[2]}}))}))},t.prototype.onInviteeRejected=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o,s,l,u,f,E,g,I,v,C,T,R,m,A,y,L;return a(this,(function(a){switch(a.label){case 0:return this._logger.info(p+".onInviteeRejected",{text:{data:i(i({},t),{currentUserID:this._tuiCallEngine.getUserId(),currentCallStatus:this._tuiCallEngine.getCallStatus(),inviteeList:this._tuiCallEngine.getInviterInviteIdList()})},type:"event"}),c.default.info(p+".onInviteeRejected - params:",t),n=t.data.inviteID,r=JSON.parse(t.data.data),_.isCallSignaling(null==r?void 0:r.businessID)?this._tuiCallEngine.isGroupCall()||this._tuiCallEngine.getSwitchCallModeStatus()||-1===this._tuiCallEngine.getAudioVideoSwitchIdList().indexOf(n)?(o=t.data.invitee,s=t.data.inviter,l=this._tuiCallEngine.getUserId(),(u=this._tuiCallEngine.getCallStatus())===d.CALL_STATUS.IDLE?[2]:-1===this._tuiCallEngine.getInviterInviteIdList().indexOf(n)?(this._tuiCallEngine.isInviter()&&-1!==this._tuiCallEngine.getInviterInviteIdUserList().indexOf(o)||this._tuiCallEngine.deleteUnHandledInviteeList([o]),[2]):(f=this._tuiCallEngine.generateEventData(),E=i({userID:o},f),l!==o||u!==d.CALL_STATUS.CALLING?[3,2]:[4,this._tuiCallEngine._resetTUICallEngine()])):(c.default.info(p+".onInviteeRejected - Audio and video switching is not available"),this._tuiCallEngine.setSwitchCallModeStatus(!0),[2]):[2];case 1:return a.sent(),this._tuiCallEngine._delegate.onCallingCancel(E),[2];case 2:return g=this._tuiCallEngine.isGroupCall(),I=this._tuiCallEngine.isInviter(),this._tuiCallEngine.deleteUnHandledInviteeList([o]),v=this._tuiCallEngine.getUnHandledInviteeList(),C=this._tuiCallEngine.getHandledInviteeList(),u===d.CALL_STATUS.CONNECTED&&-1!==C.indexOf(o)?[2]:"line_busy"===r.line_busy||""===r.line_busy||(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.message)&&"lineBusy"===r.data.message?g?[3,4]:[4,this._tuiCallEngine._resetTUICallEngine()]:[3,7];case 3:return a.sent(),I&&this._tuiCallEngine._delegate.onLineBusy(o),this._tuiCallEngine._delegate.onCallingCancel(i(i({},E),{reason:h.NAME.BUSYLINE})),[3,6];case 4:if(s===l)this._tuiCallEngine._delegate.onLineBusy(o);else{for(T=(T=this._tuiCallEngine.getInviterInviteIdList()||[]).filter((function(t){return t!==n})),R=!0,m=function(t){var e=A._tuiCallEngine.getInviterInviteIdUserList(T[t]);if([l,o].every((function(t){return-1===e.indexOf(t)})))return R=!1,"break"},A=this,y=0;y1)for(var n=1;n=0)return;o[e]="set-cookie"===e?(o[e]?o[e]:[]).concat([n]):o[e]?o[e]+", "+n:n}})),o):o}},function(t,e,n){"use strict";var i=n(3);t.exports=i.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(t){var i=t;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=r(window.location.href),function(e){var n=i.isString(e)?r(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var i=n(55),r={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){r[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}}));var a={},o=i.version.split(".");function s(t,e){for(var n=e?e.split("."):o,i=t.split("."),r=0;r<3;r++){if(n[r]>i[r])return!0;if(n[r]0;){var a=i[r],o=e[a];if(o){var s=t[a],l=void 0===s||o(s,a,t);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==n)throw Error("Unknown option "+a)}},validators:r}},function(t){t.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')},function(t,e,n){"use strict";var i=n(28);function r(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var n=this;t((function(t){n.reason||(n.reason=new i(t),e(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var t;return{token:new r((function(e){t=e})),cancel:t}},t.exports=r},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";t.exports=function(t){return"object"==typeof t&&!0===t.isAxiosError}},function(t,e,n){"use strict";n.r(e);var i=n(2);const r="none",a="online",o=function(){let t=window.location.protocol;return["http:","https:"].indexOf(t)<0&&(t="http:"),t};e.default=class{constructor(){this._networkType="",this.maxWaitTime=3e3}start(){this._networkType=a}_onNetworkStatusChange(t){this._networkType=t.networkType,t.isConnected?i.default.info("NetMonitor networkType:"+t.networkType):i.default.warn("NetMonitor no network, please check!")}probe(){return new Promise(t=>{if(window&&window.fetch)fetch(`${o()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`).then(e=>{e.ok?t([!0,a]):t([!1,r])}).catch(()=>{t([!1,r])});else{const e=new XMLHttpRequest,n=setTimeout(()=>{i.default.warn("NetMonitor fetch timeout. Probably no network, please check!"),e.abort(),this._networkType=r,t([!1,r])},this.maxWaitTime);e.onreadystatechange=function(){4===e.readyState&&(clearTimeout(n),200===e.status||304===e.status?(this._networkType=a,t([!0,a])):(i.default.warn(`NetMonitor fetch status:${e.status}. Probably no network, please check!`),this._networkType=r,t([!1,r])))},e.open("GET",`${o()}//webim-1252463788.file.myqcloud.com/assets/test/speed.xml?random=${Math.random()}`),e.send()}})}getNetworkType(){return this._networkType}reset(){this._networkType=""}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.apiCallQueue=e.avoidRepeatedCall=e.statusValidate=e.businessValidate=e.paramValidate=e.VALIDATE_PARAMS=void 0;var i=n(61);Object.defineProperty(e,"VALIDATE_PARAMS",{enumerable:!0,get:function(){return i.VALIDATE_PARAMS}});var r=n(62);Object.defineProperty(e,"paramValidate",{enumerable:!0,get:function(){return r.paramValidate}});var a=n(63);Object.defineProperty(e,"businessValidate",{enumerable:!0,get:function(){return a.businessValidate}});var o=n(64);Object.defineProperty(e,"statusValidate",{enumerable:!0,get:function(){return o.statusValidate}});var s=n(65);Object.defineProperty(e,"avoidRepeatedCall",{enumerable:!0,get:function(){return s.avoidRepeatedCall}});var l=n(66);Object.defineProperty(e,"apiCallQueue",{enumerable:!0,get:function(){return l.apiCallQueue}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VALIDATE_PARAMS=void 0;var i=n(12),r=n(0);e.VALIDATE_PARAMS={createInstance:{SDKAppID:{required:!0,rules:[r.NAME.NUMBER],allowEmpty:!1},tim:{required:!1,rules:[r.NAME.OBJECT],allowEmpty:!0}},login:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},userSig:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},call:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},roomID:{required:!1,rules:[r.NAME.NUMBER],range:"0~"+r.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[r.NAME.NUMBER],allowEmpty:!1}},groupCall:{userIDList:{required:!0,rules:[r.NAME.ARRAY],allowEmpty:!1},type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},roomID:{required:!1,rules:[r.NAME.NUMBER],range:"0~"+r.MAX_NUMBER_ROOM_ID,allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0},timeout:{required:!1,rules:[r.NAME.NUMBER],allowEmpty:!1}},joinInGroupCall:{type:{required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1},groupID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},roomID:{required:!0,rules:[r.NAME.NUMBER],allowEmpty:!1},strRoomID:{required:!1,rules:[r.NAME.STRING],allowEmpty:!0}},inviteUser:{userIDList:{required:!0,rules:[r.NAME.ARRAY],allowEmpty:!1}},openCamera:[{key:"videoViewDomID",required:!0,rules:[r.NAME.STRING],allowEmpty:!1}],startRemoteView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},stopRemoteView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},startLocalView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},videoViewDomID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},stopLocalView:{userID:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},switchCamera:[{key:"cameraPosition",required:!0,rules:[r.NAME.NUMBER],range:[i.TUICallCameraPosition.FRONT,i.TUICallCameraPosition.BACK],allowEmpty:!1}],switchDevice:{deviceType:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1},deviceId:{required:!0,rules:[r.NAME.STRING],allowEmpty:!1}},setVideoQuality:[{key:"profile",required:!0,rules:[r.NAME.STRING,r.NAME.OBJECT],range:Object.keys(i.TUICommonDefine.VideoEncoderParams),allowEmpty:!1}],switchCallMediaType:[{key:"newMediaType",required:!0,rules:[r.NAME.NUMBER],range:[1,2],allowEmpty:!1}],getDeviceList:[{key:"deviceType",required:!0,rules:[r.NAME.STRING],range:["camera","microphones","speaker","microphone"],allowEmpty:!1}],getCurrentDevice:[{key:"deviceType",required:!0,rules:[r.NAME.STRING],range:["camera","speaker","microphone"],allowEmpty:!1}],setSelfInfo:{nickName:{required:!1,rules:[r.NAME.STRING],allowEmpty:!1},avatar:{required:!1,rules:[r.NAME.STRING],allowEmpty:!1}},setVideoRenderParams:{objectFit:{require:!1,rules:[r.NAME.STRING],range:[r.NAME.CONTAIN,r.NAME.COVER,r.NAME.FILL],allowEmpty:!1},muted:{require:!1,rules:[r.NAME.BOOLEAN],allowEmpty:!1},mirror:{require:!1,rules:[r.NAME.BOOLEAN],allowEmpty:!1}},enableMultiDeviceAbility:[{key:"enable",required:!0,rules:[r.NAME.BOOLEAN],allowEmpty:!1}]}},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n+E[1]||a.isNumber(r)&&Number.isNaN(r)){p=l.getErrorMessage({code:s.default.INVALID_PARAMETER_RANGE,params:{key:d,rule:{values:i},value:r,fnName:c}});throw new o.default({code:s.default.ERROR_PARAM_INVALID,message:p})}}}}e.paramValidate=function(t){return function(e,n,i){var r=i.value;return i.value=function(){for(var e=[],i=0;i0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]":(i=s.default.ERROR_PACKAGE_NOT_PURCHASED,r=d(n)+" "),new o.default({code:i,message:r})}function h(t,e,n){return i(this,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.tim.callExperimentalAPI("isCommercialAbilityEnabled",t)];case 1:if(i.sent().data.enabled)return[2,e.apply(this,n)];try{t===u.CALL_EXPERMENTEL_API_TYPE.BASE&&(this._callDataReport.setCodeAndMessage(s.default.ERROR_PACKAGE_NOT_SUPPORTED,l.ERROR_MESSAGE.ERROR_PACKAGE_NOT_SUPPORTED),this._callDataReport.uploadToKibana())}catch(t){console.warn("base ability check failed, userId:"+this.getUserId()+", error: "+t)}throw new o.default({code:s.default.ERROR_PACKAGE_NOT_SUPPORTED});case 2:return p(i.sent(),t,this._sdkAppID),[3,3];case 3:return[2]}}))}))}e.businessValidate=function(t){return function(e,n,a){var o=a.value;return a.value=function(){for(var e=[],n=0;n",new o.default({code:s.default.ERROR_PACKAGE_NOT_PURCHASED,message:a});case 2:return p(r.sent(),e,n),[3,3];case 3:return[2]}}))}))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.statusValidate=void 0;var i=n(8),r=n(10),a=n(7),o=n(15);function s(t,e,n){var s,l=i.default();if((null==t?void 0:t.init)&&!this._isLogin){var u=o.getErrorMessage({code:a.default.ERROR_INIT_FAIL,params:{fnName:n},languageList:["en"]});throw l.error("statusValidate.fail",{text:{error:""+u}}),new r.default({code:a.default.ERROR_INIT_FAIL,fnName:n})}if(-1===(null===(s=null==t?void 0:t.callStatus)||void 0===s?void 0:s.indexOf(this._callStatus))){u=o.getErrorMessage({code:a.default.INVALID_PARAMETER_RANGE,params:{key:"callStatus",rule:{values:t.callStatus},value:this._callStatus,fnName:n}});throw l.error("statusValidate.fail",{text:{error:u}}),new r.default({code:a.default.ERROR_REQUEST_REFUSED,message:u})}if((null==t?void 0:t.scene)&&this._isGroupCall){u=o.getErrorMessage({code:a.default.ERROR_SCENE_NOT_SUPPORTED,params:{fnName:n},languageList:["en"]});throw l.error("statusValidate.fail",{text:{error:""+u}}),new r.default({code:a.default.ERROR_SCENE_NOT_SUPPORTED,fnName:n})}}e.statusValidate=function(t){return function(e,n,i){var r=i.value;return i.value=function(){for(var e=[],i=0;i0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]t<=0?"":function(t){const e=new Date(t);return`${e.getFullYear()}-${(e.getMonth()+1).toString().padStart(2,"0")}-${e.getDate().toString().padStart(2,"0")} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}`}(t)},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]0?(this._setRoomID(""+d),this._setRoomIdType(1)):0===d&&u.isString(g)&&g.length>0&&(this._setRoomID(g),this._setRoomIdType(2)),this._setEventType(n),this._setInviteeList(v),this._setSeq(),C=this.getCallRecordData(),T=C.head,R=C.body,m={head:i(i({},T),{role:h.callRoleMapping(T.role)}),body:R},A=i(i({},_),{data:JSON.stringify(m)}),[4,null===(e=null==this?void 0:this._tim)||void 0===e?void 0:e.callExperimentalAPI("sendTRTCCustomData",A)]):[2];case 1:return a.sent(),[3,3];case 2:return y=a.sent(),console.warn("eventUpload failed. error: "+JSON.stringify(y)),[3,3];case 3:return[2]}}))}))},t.prototype.eventUploadNotSave=function(t){var e;return r(this,void 0,void 0,(function(){var n,r,o,s,l,u,c,d,p,f,E,g,I,v,C,T;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),n=t.eventType,r=t.callType,o=t.mediaType,s=t.callRole,l=t.roomID,u=t.groupId,c=t.strRoomId,d=void 0===c?"":c,p=t.inviteID,this._setSeq(),f=this.getCallRecordData(),E=f.head,g=f.body,I=E.room_id_type,l>0&&(I=1),0===l&&d&&(I=2),v={head:i(i({},E),{role:h.callRoleMapping(s),call_id:p,call_type:r,media_type:h.callTypeMapping(o),room_id:1===I?""+l:d,client_ts:Math.floor(Date.now()/1e3),group_id:u||this._getGroupId(),room_id_type:I}),body:i(i({},g),{event_type:n})},C=i(i({},_),{data:JSON.stringify(v)}),[4,null===(e=null==this?void 0:this._tim)||void 0===e?void 0:e.callExperimentalAPI("sendTRTCCustomData",C)];case 1:return a.sent(),[3,3];case 2:return T=a.sent(),console.warn("eventUploadNotSave failed. error: "+JSON.stringify(T)),[3,3];case 3:return[2]}}))}))},t.prototype.heartBeatUpload=function(){var t;return r(this,void 0,void 0,(function(){var e,n,r,o;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),this._setSeq(),e=this._callRecordData.head,n={head:i(i({},e),{role:h.callRoleMapping(e.role),clientTs:Date.now(),command:l.NAME.HEART_BEAT}),body:{status:this._bodyStatus}},r=i(i({},_),{data:n}),[4,null===(t=null==this?void 0:this._tim)||void 0===t?void 0:t.callExperimentalAPI("sendTRTCCustomData",r)];case 1:return a.sent(),[3,3];case 2:return o=a.sent(),console.warn("heartBeatUpload failed. error: "+JSON.stringify(o)),[3,3];case 3:return[2]}}))}))},t.prototype.startHeartbeat=function(){-1===this._heartbeat&&(c.default.info("start heart beat..."),this.heartBeatUpload(),this._heartbeat=d.default.run(l.NAME.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))},t.prototype.stopHeartbeat=function(){-1!==this._heartbeat&&(c.default.info("stop heart beat"),d.default.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=l.NAME.WAITING)},t.prototype.doHeartbeat=function(){return r(this,void 0,void 0,(function(){var t;return a(this,(function(e){return this.heartBeatUpload(),t=Date.now(),this._lastHeartBeatTime>0&&t-this._lastHeartBeatTime>1e4&&c.default.warn("heartbeat took "+(t-this._lastHeartBeatTime)),this._lastHeartBeatTime=t,[2]}))}))},t}();e.CallRecordReport=f;var E=function(){function t(t,e){this._eventEmitter=t,this._callRecordDataReport=e,this._isCallAccepted=!1,this.registerListener()}return t.prototype.registerListener=function(){this._eventEmitter.on(s.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(s.TUICallEvent.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(s.TUICallEvent.CALLING_END,this.onCallEnd.bind(this)),this._eventEmitter.on(s.TUICallEvent.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(s.TUICallEvent.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(s.TUICallEvent.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(s.TUICallEvent.REJECT,this.onReject.bind(this))},t.prototype.removeLister=function(){this._eventEmitter.off(s.TUICallEvent.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(s.TUICallEvent.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(s.TUICallEvent.CALLING_END,this.onCallEnd),this._eventEmitter.off(s.TUICallEvent.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(s.TUICallEvent.NO_RESP,this.onNoResponse),this._eventEmitter.off(s.TUICallEvent.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(s.TUICallEvent.REJECT,this.onReject)},t.prototype.onCallReceived=function(){this._callRecordDataReport.startHeartbeat()},t.prototype.onCallAccepted=function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===l.NAME.INVITER){if(this._isCallAccepted&&t.call_type===l.NAME.GROUP)return;this._isCallAccepted=!0;var e={eventType:l.NAME.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(o.CALL_STATUS.CONNECTED)}},t.prototype.onCallEnd=function(){var t={eventType:l.NAME.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()},t.prototype.onCallingCancel=function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===l.NAME.INVITER?l.NAME.CANCEL_CALL:l.NAME.CALL_CANCELED;this._isCallAccepted=!1;var i=(t||{}).reason;((void 0===i?"":i)===l.NAME.NORMAL||e.role===l.NAME.INVITER&&e.call_type===l.NAME.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()},t.prototype.onNoResponse=function(){this._uploadInC2C(l.NAME.TIMEOUT)},t.prototype.onLineBusy=function(){this._uploadInC2C(l.NAME.BUSYLINE)},t.prototype.onReject=function(){this._uploadInC2C(l.NAME.REJECT)},t.prototype._uploadInC2C=function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===l.NAME.SINGLE){var n="";switch(t){case l.NAME.TIMEOUT:n=e.role===l.NAME.INVITER?l.NAME.CALL_MISSED:l.NAME.NOT_ANSWER_CALL;break;case l.NAME.REJECT:n=e.role===l.NAME.INVITER&&l.NAME.CALL_REJECTED;break;case l.NAME.BUSYLINE:n=e.role===l.NAME.INVITER?l.NAME.CALL_BUSY:l.NAME.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}},t}();e.TUICallEngineRecordObserver=E},function(t,e,n){"use strict";var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=t.delay&&(i=r.performanceNow()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(a)};if(t.rafID=requestAnimationFrame(a),t.backgroundTask){var o=function(){if(document.hidden){var e=r.performanceNow()-i;e>=t.delay?a():t.timeoutID=setTimeout(a,t.delay-e)}};document.addEventListener("visibilitychange",o),t.onVisibilitychange=o,document.hidden&&o()}return t.taskID},t.hasTask=function(t){return this.taskMap.has(t)},t.clearTask=function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,i=e.timeoutID,r=e.rafID,a=e.onVisibilitychange;return n&&clearInterval(n),i&&clearTimeout(i),r&&o(r),a&&document.removeEventListener("visibilitychange",a),this.taskMap.delete(t),!0},t.isBreakLoop=function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)},t.taskMap=new Map,t.currentTaskID=1,t}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ES_TABLE=e.ES_URL=e.CLS_TOPIC_ID=e.CLS_ENDPOINT=void 0,e.CLS_ENDPOINT="https://ap-nanjing.cls.tencentcs.com",e.CLS_TOPIC_ID="a1310e66-a3f5-4572-a1c3-7a327a27496d",e.ES_URL="https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report",e.ES_TABLE="timweb-trtccalling"}]).default}));