UNPKG

tuicall-engine-webrtc

Version:
1 lines 250 kB
!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.length<n;)t.push("0");for(;e.length<n;)e.push("0");for(let i=0;i<n;i++){const n=parseInt(t[i]),r=parseInt(e[i]);if(n>r)return 1;if(n<r)return-1}return 0}const x=function(){const t=new Date,e=t.toISOString(),n=t.getTimezoneOffset()/60;let i="";return i=n<0?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}&regionId=${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<t;i++)n+=e.charAt(Math.floor(Math.random()*e.length));return n}},function(t,e,n){"use strict";n.r(e),n.d(e,"LOGLEVEL_INFO",(function(){return o}));var i=n(4),r=n(1),a=n(5);const o=1;let s=0;const l=new Map,u="%cCallEngine%c%s",c="padding: 1px 4px;border-radius: 3px;color: #fff;background: #444;",d="display: inline",p=!(a.IS_IOS||a.IS_ANDROID||a.IS_HEADLESS_CHROME);function h(){const t=new Date;return`[${t.toLocaleTimeString("en-US",{hour12:!1})}.${function(t){let e;switch(t.toString().length){case 1:e="00"+t;break;case 2:e="0"+t;break;default:e=t}return e}(t.getMilliseconds())}]`}const _={_data:[],_length:0,_visible:!1,arguments2String(t,e){let n;if(1===e.length)n=`${h()} <${t}> ${e[0]}`;else{n=`${h()} <${t}> `;for(let t=0,{length:i}=e;t<i;t++)Object(r.isArrayOrObject)(e[t])?Object(r.isInstanceOfError)(e[t])?n+=Object(r.stringifyError)(e[t]):n+=JSON.stringify(e[t]):n+=e[t],n+=" "}return n},debug(){if(s<=-1){const t=this.arguments2String("DEBUG",arguments);_.record(t,"debug"),p?i.a.debug(u,c,d,t):i.a.debug(t)}},log(){if(s<=0){const t=this.arguments2String("LOG",arguments);_.record(t,"log"),p?i.a.log(u,c,d,t):i.a.log(t)}},info(){if(s<=o){const t=this.arguments2String("INFO",arguments);_.record(t,"info"),p?i.a.info(u,c,d,t):i.a.info(t)}},warn(){if(s<=2){const t=this.arguments2String("WARN",arguments);_.record(t,"warn"),p?i.a.warn(u,c,d,t):i.a.warn(t)}},error(){if(s<=3){const t=this.arguments2String("ERROR",arguments);_.record(t,"error"),p?i.a.error(u,c,d,t):i.a.error(t)}},time(t){l.set(t,r.TimeUtil.now())},timeEnd(t){if(l.has(t)){const e=r.TimeUtil.now()-l.get(t);return l.delete(t),e}return i.a.warn(`未找到对应label: ${t}, 请在调用 logger.timeEnd 前,调用 logger.time`),0},setLevel(t){t<4&&i.a.log(`${h()}set level from ${s} to ${t}`),s=t},getLevel:()=>s,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<i;n++)e.call(null,t[n],n,t);else for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.call(null,t[r],r,t)}t.exports={isArray:a,isArrayBuffer:function(t){return"[object ArrayBuffer]"===r.call(t)},isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isPlainObject:l,isUndefined:o,isDate:function(t){return"[object Date]"===r.call(t)},isFile:function(t){return"[object File]"===r.call(t)},isBlob:function(t){return"[object Blob]"===r.call(t)},isFunction:u,isStream:function(t){return s(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:c,merge:function t(){var e={};function n(n,i){l(e[i])&&l(n)?e[i]=t(e[i],n):l(n)?e[i]=t({},n):a(n)?e[i]=n.slice():e[i]=n}for(var i=0,r=arguments.length;i<r;i++)c(arguments[i],n);return e},extend:function(t,e,n){return c(e,(function(e,r){t[r]=n&&"function"==typeof e?i(e,n):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,n){"use strict";(function(t){let n,i;n="undefined"!=typeof console?console:void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};const r=function(){},a=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"];let{length:o}=a;for(;o--;)i=a[o],console[i]||(n[i]=r);n.methods=a,e.a=n}).call(this,n(36))},function(t,e,n){"use strict";n.r(e),n.d(e,"IN_Browser",(function(){return i})),n.d(e,"IN_WXMiniProgram",(function(){return r})),n.d(e,"USER_AGENT",(function(){return a})),n.d(e,"IS_IPAD",(function(){return l})),n.d(e,"IS_IPHONE",(function(){return u})),n.d(e,"IS_IPOD",(function(){return c})),n.d(e,"IS_IOS",(function(){return d})),n.d(e,"IOS_VERSION",(function(){return p})),n.d(e,"IS_ANDROID",(function(){return h})),n.d(e,"ANDROID_VERSION",(function(){return _})),n.d(e,"IS_OLD_ANDROID",(function(){return f})),n.d(e,"IS_NATIVE_ANDROID",(function(){return E})),n.d(e,"IS_FIREFOX",(function(){return g})),n.d(e,"FIREFOX_VERSION",(function(){return I})),n.d(e,"IS_EDGE",(function(){return v})),n.d(e,"EDGE_VERSION",(function(){return C})),n.d(e,"IS_EDG",(function(){return T})),n.d(e,"EDG_VERSION",(function(){return R})),n.d(e,"IS_CHROME",(function(){return m})),n.d(e,"CHROME_MAJOR_VERSION",(function(){return A})),n.d(e,"CHROME_VERSION",(function(){return y})),n.d(e,"IS_IE8",(function(){return L})),n.d(e,"IE_VERSION",(function(){return S})),n.d(e,"IS_SAFARI",(function(){return D})),n.d(e,"IS_ANY_SAFARI",(function(){return N})),n.d(e,"SAFARI_VERSION",(function(){return O})),n.d(e,"IS_TBS",(function(){return b})),n.d(e,"TBS_VERSION",(function(){return w})),n.d(e,"IS_X5MQQB",(function(){return U})),n.d(e,"IS_MQQB",(function(){return M})),n.d(e,"MQQB_VERSION",(function(){return P})),n.d(e,"IS_QQB",(function(){return V})),n.d(e,"IS_WECHAT",(function(){return x})),n.d(e,"WECHAT_VERSION",(function(){return k})),n.d(e,"IS_WIN",(function(){return G})),n.d(e,"IS_MAC",(function(){return j})),n.d(e,"IS_LINUX",(function(){return B})),n.d(e,"IS_WX",(function(){return H})),n.d(e,"IS_UCBROWSER",(function(){return F})),n.d(e,"IS_MIUIBROWSER",(function(){return K})),n.d(e,"IS_HUAWEIBROWSER",(function(){return Y})),n.d(e,"HUAWEI_VERSION",(function(){return W})),n.d(e,"BROWSER_VERSION",(function(){return q})),n.d(e,"IS_LOCAL",(function(){return Q})),n.d(e,"IS_HEADLESS_CHROME",(function(){return J})),n.d(e,"getBrowserInfo",(function(){return X})),n.d(e,"getOsInfo",(function(){return z})),n.d(e,"isMobile",(function(){return Z}));const i="undefined"!=typeof window,r="undefined"!=typeof wx,a=window.navigator&&window.navigator.userAgent||"",o=/AppleWebKit\/([\d.]+)/i.exec(a),s=o?parseFloat(o.pop()):null,l=/iPad/i.test(a),u=/iPhone/i.test(a)&&!l,c=/iPod/i.test(a),d=u||l||c,p=function(){const t=a.match(/OS (\d+)_/i);return t&&t[1]?t[1]:null}(),h=/Android/i.test(a),_=function(){const t=a.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!t)return null;const e=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return e&&n?parseFloat(`${t[1]}.${t[2]}`):e||null}(),f=h&&/webkit/i.test(a)&&_<2.3,E=h&&_<5&&s<537,g=/Firefox/i.test(a),I=function(){const t=a.match(/Firefox\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),v=/Edge\//i.test(a),C=v&&function(){const t=a.match(/Edge\/(\d+)/i);if(t&&t[1])return t[1]}(),T=/Edg\//i.test(a),R=function(){const t=a.match(/Edg\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),m=!v&&/Chrome/i.test(a),A=function(){const t=a.match(/Chrome\/(\d+)/);return t&&t[1]?parseFloat(t[1]):null}(),y=function(){const t=a.match(/Chrome\/([\d.]+)/);return t&&t[1]?t[1]:null}(),L=/MSIE\s8\.0/.test(a),S=function(){const t=/MSIE\s(\d+)\.\d/.exec(a);let e=t&&parseFloat(t[1]);return!e&&/Trident\/7.0/i.test(a)&&/rv:11.0/.test(a)&&(e=11),e}(),D=/Safari/i.test(a)&&!m&&!h&&!v,N=D||d,O=function(){const t=a.match(/Version\/([\d.]+)/);return t&&t[1]?t[1]:null}(),b=/TBS\/\d+/i.test(a),w=function(){const t=a.match(/TBS\/(\d+)/i);if(t&&t[1])return t[1]}(),U=!b&&/MQQBrowser\/\d+/i.test(a)&&/COVC\/\d+/i.test(a),M=!b&&/MQQBrowser\/\d+/i.test(a),P=(M||U)&&function(){const t=a.match(/ MQQBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),V=!b&&/ QQBrowser\/\d+/i.test(a),x=/(micromessenger|webbrowser)/i.test(a),k=x&&function(){const t=a.match(/MicroMessenger\/(\d+)/i);if(t&&t[1])return t[1]}(),G=/Windows/i.test(a),j=/MAC OS X/i.test(a),B=/Linux/i.test(a),H=/MicroMessenger/i.test(a),F=/UCBrowser/i.test(a),K=/MiuiBrowser/i.test(a),Y=/HuaweiBrowser/i.test(a),W=Y&&function(){const t=a.match(/HuaweiBrowser\/([\d.]+)/);return t&&t[1]?t[1]:null}(),q=m?"Chrome/"+y:D?"Safari/"+O:"NotSupportedBrowser",Q="file:"===location.protocol||"localhost"===location.hostname||/^\d+\.\d+\.\d+\.\d+$/.test(location.hostname),J=new RegExp("HeadlessChrome","i").test(a);const $=new Map([[g,["Firefox",I]],[T,["Edg",R]],[m,["Chrome",y]],[D,["Safari",O]],[b,["TBS",w]],[x&&u,["WeChat",k]],[M,["QQ(Mobile)",P]],[U,["QQ(Mobile X5)",P]],[Y,["HW",W]],[v,["EDGE",C]]]);function X(){let t="unknown",e="unknown";return $.get(!0)&&(t=$.get(!0)[0],e=$.get(!0)[1]),{name:t,version:e}}function z(){let t="unknown";return j&&(t="mac"),G&&(t="windows"),h&&(t="android"),d&&(t="iOS"),{name:t}}function Z(){return h||u||l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.USER_CUSTOM_STATUS=e.CALL_EXPERMENTEL_API_TYPE=e.LOG_LEVEL=e.MODE_TYPE=e.VALID_VIDEO_PROFILE_LIST=e.BUSINESS_ID=e.ACTION_TYPE=e.CALL_ROLE=e.CALL_STATUS=e.CMD_TYPE=e.CMD_TYPE_LIST=e.CALL_TYPE=e.IOSOfflinePushType=void 0;var i=n(12);!function(t){t[t.APNs=0]="APNs",t[t.VoIP=1]="VoIP"}(e.IOSOfflinePushType||(e.IOSOfflinePushType={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.AUDIO_CALL=1]="AUDIO_CALL",t[t.VIDEO_CALL=2]="VIDEO_CALL"}(e.CALL_TYPE||(e.CALL_TYPE={})),e.CMD_TYPE_LIST=["","audioCall","videoCall"],function(t){t.AUDIO_CALL="audioCall",t.VIDEO_CALL="videoCall",t.HANG_UP="hangup",t.SWITCH_TO_AUDIO="switchToAudio",t.SWITCH_TO_AUDIO_CALL="switch_to_audio_call",t.SWITCH_TO_VIDEO="switchToVideo"}(e.CMD_TYPE||(e.CMD_TYPE={})),function(t){t.IDLE="idle",t.CALLING="calling",t.CONNECTED="connected"}(e.CALL_STATUS||(e.CALL_STATUS={})),function(t){t.UNKNOWN="",t.INVITER="inviter",t.INVITEE="invitee"}(e.CALL_ROLE||(e.CALL_ROLE={})),function(t){t[t.INVITE=1]="INVITE",t[t.CANCEL_INVITE=2]="CANCEL_INVITE",t[t.ACCEPT_INVITE=3]="ACCEPT_INVITE",t[t.REJECT_INVITE=4]="REJECT_INVITE",t[t.INVITE_TIMEOUT=5]="INVITE_TIMEOUT"}(e.ACTION_TYPE||(e.ACTION_TYPE={})),function(t){t[t.SIGNAL=1]="SIGNAL"}(e.BUSINESS_ID||(e.BUSINESS_ID={})),e.VALID_VIDEO_PROFILE_LIST=Object.keys(i.TUICommonDefine.VideoEncoderParams),function(t){t.AUDIO="audio",t.VIDEO="video"}(e.MODE_TYPE||(e.MODE_TYPE={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.RELEASE=1]="RELEASE",t[t.WARNING=2]="WARNING",t[t.ERROR=3]="ERROR",t[t.NONE=4]="NONE"}(e.LOG_LEVEL||(e.LOG_LEVEL={})),function(t){t[t.BASE=Math.pow(2,16)]="BASE",t[t.PRO=Math.pow(2,17)]="PRO",t[t.ULTIMATE=Math.pow(2,18)]="ULTIMATE"}(e.CALL_EXPERMENTEL_API_TYPE||(e.CALL_EXPERMENTEL_API_TYPE={})),function(t){t.NULL="",t.CALLING_USER_CUSTOM_STATUS_CALL_WAIT="call_wait",t.CALLING_USER_CUSTOM_STATUS_CALL_ACCEPT="call_accept"}(e.USER_CUSTOM_STATUS||(e.USER_CUSTOM_STATUS={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorCodeDictionary=void 0;!function(t){t[t.UNKNOWN=65535]="UNKNOWN",t[t.NO_NETWORK=2805]="NO_NETWORK",t[t.FAILURE_SWITCH_TO_AUDIO=60001]="FAILURE_SWITCH_TO_AUDIO",t[t.FAILURE_SWITCH_TO_VIDEO=60002]="FAILURE_SWITCH_TO_VIDEO",t[t.NOT_MICROPHONE_LIST=60003]="NOT_MICROPHONE_LIST",t[t.NOT_CAMERA_LIST=60004]="NOT_CAMERA_LIST",t[t.NOT_SUPPORT=60006]="NOT_SUPPORT",t[t.ERROR_PACKAGE_NOT_PURCHASED=-1001]="ERROR_PACKAGE_NOT_PURCHASED",t[t.ERROR_PACKAGE_NOT_SUPPORTED=-1002]="ERROR_PACKAGE_NOT_SUPPORTED",t[t.ERROR_TIM_VERSION_OUTDATED=-1003]="ERROR_TIM_VERSION_OUTDATED",t[t.ERROR_PERMISSION_DENIED=-1101]="ERROR_PERMISSION_DENIED",t[t.ERROR_GET_DEVICE_LIST_FAIL=-1102]="ERROR_GET_DEVICE_LIST_FAIL",t[t.ERROR_INIT_FAIL=-1201]="ERROR_INIT_FAIL",t[t.ERROR_PARAM_INVALID=-1202]="ERROR_PARAM_INVALID",t[t.ERROR_REQUEST_REFUSED=-1203]="ERROR_REQUEST_REFUSED",t[t.ERROR_REQUEST_REPEATED=-1204]="ERROR_REQUEST_REPEATED",t[t.ERROR_SCENE_NOT_SUPPORTED=-1205]="ERROR_SCENE_NOT_SUPPORTED",t[t.INVALID_PARAMETER_REQUIRED=-120200]="INVALID_PARAMETER_REQUIRED",t[t.INVALID_PARAMETER_TYPE=-120201]="INVALID_PARAMETER_TYPE",t[t.INVALID_PARAMETER_EMPTY=-120202]="INVALID_PARAMETER_EMPTY",t[t.INVALID_PARAMETER_RANGE=-120203]="INVALID_PARAMETER_RANGE",t[t.ERROR_SIGNALING_SEND_FAIL=-1401]="ERROR_SIGNALING_SEND_FAIL",t[t.ERROR_INVALID_INVITEID=8010]="ERROR_INVALID_INVITEID",t[t.ERROR_INVALID_SEND_FAIL=8021]="ERROR_INVALID_SEND_FAIL",t[t.ERROR_HTTP=3e4]="ERROR_HTTP",t[t.ERROR_BLACKLIST=20007]="ERROR_BLACKLIST"}(e.ErrorCodeDictionary||(e.ErrorCodeDictionary={})),e.default={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,NOT_MICROPHONE_LIST:60003,NOT_CAMERA_LIST:60004,NOT_SUPPORT:60006,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,INVALID_PARAMETER_REQUIRED:-120200,INVALID_PARAMETER_TYPE:-120201,INVALID_PARAMETER_EMPTY:-120202,INVALID_PARAMETER_RANGE:-120203,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:8021,ERROR_HTTP:3e4,ERROR_BLACKLIST:20007}},function(t,e,n){var i;self,i=()=>(()=>{"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;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=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())}))},a=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]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0});var o,s=n(266),l=n(466),u=n(402),c=n(882),d=n(271),p=n(884),h=n(900),_=n(172);!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARING=2]="WARING",t[t.ERROR=3]="ERROR"}(o||(o={}));var f={metric:!0,context:!0},E=function(t,e,n){return void 0===n&&(n=0),(0,s.isPlainObject)(t)?(0,s.isPlainObject)(e)?(Object.keys(e).forEach((function(i){var r=t[i],a=e[i];t[i]=f[i]&&0===n?E(r,a,1):a})),t):t:(0,s.isPlainObject)(e)?e:{}},g={clsConfig:{endpoint:"",topicId:""}},I=function(){function t(t){var e=this;this.url="",this.uploadChannel="",this.sendClsPipe=null,this.sendEsPipe=null,this._logLevel=o.INFO,this._getReportDataList=[],this._blacklist=[];var n=t||g,i=n.clsConfig,s=n.esConfig,l=i.endpoint,_=i.topicId;this.esConfig=s,this.endpoint=l,this.topicId=_;var f=this.buildUploadUrl();this.url=f,this.initPageUnloadMonitor(),f&&(this.sendClsPipe=(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(this),(0,p.createThrottlePipe)(this,5),(0,c.formatClsLog)(),(0,d.limitLengthPipe)(),function(t){return r(e,void 0,void 0,(function(){var e,n,i=this;return a(this,(function(o){return e=0,(n=function(){return r(i,void 0,void 0,(function(){var i;return a(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.send({url:f,data:t})];case 1:return r.sent(),[3,3];case 2:return i=r.sent(),e<=2?(e++,setTimeout((function(){n()}),1e3)):console.debug(i),[3,3];case 3:return[2]}}))}))})(),[2]}))}))}])),this.updateBlacklist()}return t.prototype.initPageUnloadMonitor=function(){var t=this,e=this;!(0,s.isMiniProgram)()&&document&&"function"==typeof document.addEventListener&&document.addEventListener("visibilitychange",(function(){if("hidden"===document.visibilityState){var n=t.getCommonReportData(),i=E(n,{level:o.WARING,method:"PAGE_UNLOAD",type:"event"});if(e.esConfig)try{var s=e.esConfig,l=s.url,_=s.table;(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(e),(0,p.createThrottlePipe)(e,1),(0,c.formatESLog)({table:_}),(0,d.limitLengthPipe)(),function(e){return r(t,void 0,void 0,(function(){var t;return a(this,(function(n){try{t=new Blob([JSON.stringify(e)],{type:"application/x-www-form-urlencoded"}),null===navigator||void 0===navigator||navigator.sendBeacon(l,t)}catch(t){console.debug(t)}return[2]}))}))}])(i)}catch(t){console.debug(t)}}}))},t.prototype.updateEsConfig=function(t){var e=this;try{if(t){this.esConfig=t;var n=t.url,i=t.table;n&&i&&(this.uploadChannel=n,this.sendEsPipe=(0,u.createPipeline)([(0,h.filterSdkappIdPipe)(this),(0,p.createThrottlePipe)(this,5),(0,c.formatESLog)({table:i}),(0,d.limitLengthPipe)(),function(t){return r(e,void 0,void 0,(function(){var e,i,o=this;return a(this,(function(s){return e=0,(i=function(){return r(o,void 0,void 0,(function(){var r;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.send({url:n,data:t})];case 1:return a.sent(),[3,3];case 2:return r=a.sent(),e<=2?(e++,setTimeout((function(){i()}),1e3)):console.debug(r),[3,3];case 3:return[2]}}))}))})(),[2]}))}))}]))}}catch(t){console.debug(t)}},t.prototype.updateGetReportData=function(t){"function"==typeof t&&this._getReportDataList.push(t)},t.prototype.updateBlacklist=function(){return r(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,(0,l.request)({url:_.RAINBOW_BLACK_LIST_API})];case 1:return t=i.sent().data,"string"==typeof(e=null==t?void 0:t.blackList)&&(this._blacklist=e.split(",")),[3,3];case 2:return n=i.sent(),console.debug("update blacklist fail",n),[3,3];case 3:return[2]}}))}))},t.prototype.getBlackList=function(){return this._blacklist},t.prototype.setLogLevel=function(t){"number"!=typeof t&&(t=o.INFO),this._logLevel=t},t.prototype.createLogFunc=function(t){var e=this;return function(n,i){e.log(n,i,{level:t})}},t.prototype.buildUploadUrl=function(){return this.endpoint&&this.topicId?"".concat(this.endpoint,"/tracklog?topic_id=").concat(this.topicId):""},t.prototype.sendPipe=function(t){"function"==typeof this.sendClsPipe&&this.sendClsPipe(t),"function"==typeof this.sendEsPipe&&this.sendEsPipe(t)},t.prototype.info=function(t,e){this.log(t,e,{level:o.INFO})},t.prototype.debug=function(t,e){this.log(t,e,{level:o.DEBUG})},t.prototype.warn=function(t,e){this.log(t,e,{level:o.WARING})},t.prototype.error=function(t,e){this.log(t,e,{level:o.ERROR})},t.prototype.log=function(t,e,n){try{var r=n||{},a=r.level;if(r.topicId,this._logLevel<=a){var o=this.getCommonReportData(),s=E(o,i({level:a,method:t},e));this.sendPipe(s)}}catch(t){console.debug(t)}},t.prototype.getCommonReportData=function(){for(var t={},e=0;e<this._getReportDataList.length;e++)t=E(t,this._getReportDataList[e]());return t},t.prototype.send=function(t){return r(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(a){switch(a.label){case 0:n=(e=t||{}).url,i=e.data,a.label=1;case 1:return a.trys.push([1,4,,5]),n?[4,(0,l.request)({url:n,data:i,method:"post"})]:[3,3];case 2:a.sent(),a.label=3;case 3:return[3,5];case 4:throw r=a.sent(),console.debug(r),new Error(r);case 5:return[2]}}))}))},t}();e.default=I},900:(t,e)=>{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;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=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())}))},a=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]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}},o=this&&this.__rest||function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),e.request=void 0;var s=n(732),l=n(377),u=n(266);e.request=function(t){return r(void 0,void 0,void 0,(function(){var e=t.url,n=t.data,r=t.header,c=void 0===r?{}:r,d=t.method,p=void 0===d?"GET":d,h=t.dataType,_=t.responseType,f=o(t,["url","data","header","method","dataType","responseType"]);return a(this,(function(t){return(0,u.isBrowser)()?[2,(0,l.requestXHR)(e,n,{headers:c,method:p,responseType:_,dataType:h})]:(0,u.isMiniProgram)()?[2,(0,s.requestWeapp)(i({url:e,data:n,header:c,method:p,dataType:h,responseType:_},f))]:(console.debug("unsupport env"),[2])}))}))}},732:function(t,e,n){var i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},r=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())}))},a=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]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.requestWeapp=function(t){return r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:n.trys.push([0,5,6,7]),n.label=1;case 1:return l>=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]<r[3])){o.label=s[1];break}if(6===s[0]&&o.label<r[1]){o.label=r[1],r=s;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(s);break}r[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],i=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=u,e.requestXHR=function(t){return i(this,arguments,void 0,(function(t,e,n){var c,d=this;return void 0===e&&(e={}),void 0===n&&(n={}),r(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,3,4]),[4,new Promise((function(c,p){return i(d,void 0,void 0,(function(){var i,d,h,_,f,E;return r(this,(function(r){switch(r.label){case 0:return l>=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(){re