8892 lines
537 KiB
JavaScript
Raw Permalink Normal View History

2025-03-19 15:35:09 +08:00
(function(){"use strict";try{if(typeof document!="undefined"){var t=document.createElement("style");t.appendChild(document.createTextNode(".tk-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box;width:100%}.tk-col{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.tk-loading_dot-container{display:flex;justify-content:space-between;align-items:center;height:100%}.tk-loading_dot-container .tk-loading_dot:nth-child(1){opacity:0;animation-duration:.8s;animation-delay:0s;animation-play-state:running}.tk-loading_dot-container .tk-loading_dot:nth-child(2){opacity:.083;animation-duration:.8s;animation-delay:.2666666667s;animation-play-state:running}.tk-loading_dot-container .tk-loading_dot:nth-child(3){opacity:.1667;animation-duration:.8s;animation-delay:.5333333333s;animation-play-state:running}.tk-loading_dot-container .tk-loading_dot{width:20%;height:20%;border-radius:50%;background-color:#fff;animation-duration:1.8s;animation-name:dotting;animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both}@keyframes dotting{0%{opacity:.15}1%{opacity:.8}33%{opacity:.8}34%{opacity:.15}to{opacity:.15}}.tk-loading_circle-container{height:100%;border:2px solid;border-radius:50%;border-top-color:transparent;border-right-color:transparent;border-bottom-color:#fff;border-left-color:#fff;background:0 0;vertical-align:middle;box-sizing:border-box;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.tk-loading{display:flex;align-items:center;flex-direction:column}.tk-loading .tk-loading_text{margin:10px}.tk-image{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;vertical-align:middle;width:300px;height:225px}.tk-image .tk-image_inner{width:100%;height:100%}.tk-button{display:inline-flex;align-items:center;justify-content:center}.tk-button.tk-button--small{height:24px}.tk-button.tk-button--middle{height:32px}.tk-button.tk-button--large{height:40px}.tk-button .tk-button--content{color:#606266;font-size:14px;font-weight:500}.tk-button.tk-circle.tk-button--small{width:24px}.tk-button.tk-circle.tk-button--default{width:32px}.tk-button.tk-circle.tk-button--large{width:40px}.btn-content[data-v-135d060f],.btn-content[data-v-f92abf93]{display:flex;flex-direction:column;align-items:center}.tk-text{display:inline-block;overflow:hidden;text-align:center;line-height:normal;white-space:nowrap;font-weight:400;font-size:14px;color:#303133}.tk-text.tk-text--line-clamp{display:-webkit-inline-box;-webkit-box-orient:vertical;white-space:normal}.btn-content[data-v-7c062dcf]{display:flex;flex-direction:column;align-items:center}.top-bar-container[data-v-b040a138]{position:absolute;z-index:2;width:100%;height:5.8%;display:flex;align-items:center}.tk-overlay{position:fixed;left:0;top:0;bottom:0;width:100%}.tk-overlay .tk-overlay_mask-container{width:100%;height:100%;z-index:0;position:absolute}.tk-overlay .tk-overlay_mask{position:absolute;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:1}.tk-overlay .tk-overlay_slot{position:absolute;left:0;right:0;top:0;bottom:0;z-index:1;display:flex;justify-content:center}.tk-avatar{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:#fff;background:#c0c4cc;width:40px;height:40px;font-size:14px}.tk-avatar.tk-avatar--square{border-radius:4px}.tk-avatar.tk-avatar--circle{border-radius:100%}.tk-avatar .tk-avatar_img,.tk-avatar .tk-avatar_image{width:100%;height:100%}.mic-container[data-v-ea062939]{position:relative;width:24px;height:24px}.mic-container .mic-level-container[data-v-ea062939]{position:absolute;left:6px;width:8px;height:14px;display:flex;flex-wrap:wrap;border-radius:4px;overflow:hidden;flex-direction:column-reverse;justify-content:space-between}.mic-container .mic-level-container .mic-level[data-v-ea062939]{width:100%;background-color:#27c39f;transition:height .2s}.overlay-stream-container.mobile .overlay-stream-content-container[data-v-34807212]{width:100%;top:26%;position:
import { TUICallEvent as P, TUICallEngine as zo } from "tuicall-engine-webrtc";
import { TUICore as fe, TUIConstants as IA, TUILogin as bo } from "@tencentcloud/tui-core";
import Pt from "@tencentcloud/chat";
import { inject as zA, ref as L, onMounted as yA, onUnmounted as LA, toRefs as G, watch as cA, computed as f, version as ct, defineComponent as z, provide as EA, openBlock as I, createElementBlock as h, normalizeClass as V, unref as n, normalizeStyle as AA, renderSlot as H, createElementVNode as T, createBlock as E, toDisplayString as B, createCommentVNode as w, Fragment as RA, createVNode as S, withCtx as v, createTextVNode as MA, watchEffect as Se, renderList as ue, toRef as ut, resolveComponent as aa, Teleport as Uo, withDirectives as lA, vShow as sA, withModifiers as Le, nextTick as Oo, mergeProps as xt, normalizeProps as Vo, withKeys as Po, render as be, Transition as xo, reactive as Be } from "vue";
var u = /* @__PURE__ */ ((a) => (a.CALL = "call", a.CUSTOM = "custom", a))(u || {}), _ = /* @__PURE__ */ ((a) => (a[a.UNKNOWN = 0] = "UNKNOWN", a[a.AUDIO = 1] = "AUDIO", a[a.VIDEO = 2] = "VIDEO", a))(_ || {}), gA = /* @__PURE__ */ ((a) => (a.UNKNOWN = "unknown", a.CALLEE = "callee", a.CALLER = "caller", a))(gA || {}), x = /* @__PURE__ */ ((a) => (a.IDLE = "idle", a.CALLING = "calling", a.CONNECTED = "connected", a))(x || {}), Ue = /* @__PURE__ */ ((a) => (a.CONTAIN = "contain", a.COVER = "cover", a.FILL = "fill", a))(Ue || {}), Oe = /* @__PURE__ */ ((a) => (a.RESOLUTION_480P = "480p", a.RESOLUTION_720P = "720p", a.RESOLUTION_1080P = "1080p", a))(Oe || {}), oa = /* @__PURE__ */ ((a) => (a.EN = "en", a["ZH-CN"] = "zh-cn", a.JA_JP = "ja_JP", a))(oa || {});
const fA = {
IDLE: "idle",
BE_INVITED: "be-invited",
DIALING_C2C: "dialing-c2c",
DIALING_GROUP: "dialing-group",
CALLING_C2C_AUDIO: "calling-c2c-audio",
CALLING_C2C_VIDEO: "calling-c2c-video",
CALLING_GROUP_AUDIO: "calling-group-audio",
CALLING_GROUP_VIDEO: "calling-group-video"
}, Bo = {
unknown: 0,
audio: 1,
video: 2
/* VIDEO */
};
var ve = /* @__PURE__ */ ((a) => (a.EAR = "ear", a.SPEAKER = "speaker", a))(ve || {}), mA = /* @__PURE__ */ ((a) => (a.MICROPHONE = "microphone", a.CAMERA = "camera", a.SPEAKER = "speaker", a))(mA || {}), ie = /* @__PURE__ */ ((a) => (a[a.FRONT = 0] = "FRONT", a[a.BACK = 1] = "BACK", a))(ie || {}), _A = /* @__PURE__ */ ((a) => (a.Camera = "camera", a.Microphone = "microphone", a.SwitchCamera = "switchCamera", a.InviteUser = "inviteUser", a))(_A || {}), Ce = /* @__PURE__ */ ((a) => (a.Open = "open", a.Close = "close", a))(Ce || {}), qA = /* @__PURE__ */ ((a) => (a.LOCAL = "local", a.REMOTE = "remote", a))(qA || {}), Fe = /* @__PURE__ */ ((a) => (a.LocalInLargeView = "local", a.RemoteInLargeView = "remote", a))(Fe || {}), Me = /* @__PURE__ */ ((a) => (a[a.INVITE = 1] = "INVITE", a[a.CANCEL_INVITE = 2] = "CANCEL_INVITE", a[a.ACCEPT_INVITE = 3] = "ACCEPT_INVITE", a[a.REJECT_INVITE = 4] = "REJECT_INVITE", a[a.INVITE_TIMEOUT = 5] = "INVITE_TIMEOUT", a))(Me || {});
const Bt = {
SWITCH_TO_AUDIO_CALL_FAILED: 60001,
SWITCH_TO_VIDEO_CALL_FAILED: 60002,
MICROPHONE_UNAVAILABLE: 60003,
CAMERA_UNAVAILABLE: 60004,
BAN_DEVICE: 60005,
NOT_SUPPORTED_WEBRTC: 60006,
ERROR_BLACKLIST: 20007
}, Rt = {
SWITCH_TO_AUDIO_CALL_FAILED: "switchToAudioCall-call-failed",
SWITCH_TO_VIDEO_CALL_FAILED: "switchToVideoCall-call-failed",
MICROPHONE_UNAVAILABLE: "microphone-unavailable",
CAMERA_UNAVAILABLE: "camera-unavailable",
BAN_DEVICE: "ban-device",
NOT_SUPPORTED_WEBRTC: "not-supported-webrtc",
ERROR_BLACKLIST: "blacklist-user-tips"
};
var na = /* @__PURE__ */ ((a) => (a[a.NORMAL = 0] = "NORMAL", a[a.RELEASE = 1] = "RELEASE", a[a.WARNING = 2] = "WARNING", a[a.ERROR = 3] = "ERROR", a[a.NONE = 4] = "NONE", a))(na || {});
const Xe = {
CALL_STATUS: "callStatus",
CALL_ROLE: "callRole",
CALL_MEDIA_TYPE: "callMediaType",
LOCAL_USER_INFO: "localUserInfo",
LOCAL_USER_INFO_EXCLUDE_VOLUMN: "localUserInfoExcludeVolume",
REMOTE_USER_INFO_LIST: "remoteUserInfoList",
REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST: "remoteUserInfoExcludeVolumeList",
CALLER_USER_INFO: "callerUserInfo",
IS_GROUP: "isGroup",
CALL_DURATION: "callDuration",
CALL_TIPS: "callTips",
TOAST_INFO: "toastInfo",
IS_MINIMIZED: "isMinimized",
ENABLE_FLOAT_WINDOW: "enableFloatWindow",
BIG_SCREEN_USER_ID: "bigScreenUserId",
LANGUAGE: "language",
IS_CLICKABLE: "isClickable",
DISPLAY_MODE: "displayMode",
VIDEO_RESOLUTION: "videoResolution",
PUSHER: "pusher",
PLAYER: "player",
IS_EAR_PHONE: "isEarPhone",
IS_MUTE_SPEAKER: "isMuteSpeaker",
SHOW_PERMISSION_TIP: "SHOW_PERMISSION_TIP",
NETWORK_STATUS: "NetWorkStatus",
GROUP_ID: "groupID",
ROOM_ID: "roomID",
ROOM_ID_TYPE: "roomIdType",
SHOW_SELECT_USER: "showSelectUser",
IS_SHOW_ENABLE_VIRTUAL_BACKGROUND: "isShowEnableVirtualBackground",
ENABLE_VIRTUAL_BACKGROUND: "enableVirtualBackground",
GROUP_CALL_MEMBERS: "groupCallMembers",
PUSHER_ID: "pusherId"
}, Ro = {
INNER_ATTR_KIT_INFO: "inner_attr_kit_info"
}, Go = {
INITIAL_PUSHER: "initialPusher",
NEW_PUSHER: "newPusher"
}, l = {
PREFIX: "【CallService】",
AUDIO: "audio",
VIDEO: "video",
LOCAL_VIDEO: "localVideo",
ERROR: "error",
TIMEOUT: "timeout",
RAF: "raf",
INTERVAL: "interval",
DEFAULT: "default",
BOOLEAN: "boolean",
STRING: "string",
NUMBER: "number",
OBJECT: "object",
ARRAY: "array",
FUNCTION: "function",
UNDEFINED: "undefined",
UNKNOWN: "unknown",
ALL: "all",
MYSELF: "myself",
DEVICE_LIST: "deviceList",
CAMERA_POSITION: "cameraPosition",
CUSTOM_UI_CONFIG: "customUIConfig",
TRANSLATE: "translate",
...Go,
...Xe,
...Ro
}, ko = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png", qo = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg", Gt = 2147483647, Wo = 3, Xo = 4;
var Ct = /* @__PURE__ */ ((a) => (a.MAC = "mac", a.WIN = "win", a))(Ct || {}), Tt = /* @__PURE__ */ ((a) => (a[a.TUI_CALL_KIT = 14] = "TUI_CALL_KIT", a[a.TIM_CALL_KIT = 15] = "TIM_CALL_KIT", a))(Tt || {}), Lt = /* @__PURE__ */ ((a) => (a[a.NUMBER_ROOM_ID = 1] = "NUMBER_ROOM_ID", a[a.STRING_ROOM_ID = 2] = "STRING_ROOM_ID", a))(Lt || {});
async function Qo(a) {
if (!a)
return !1;
try {
const A = await new Promise((e, t) => {
const o = new XMLHttpRequest();
o.open("HEAD", a, !0), o.onload = () => e(o), o.onerror = () => t(o), o.send();
});
return A.status === 200 && A.getResponseHeader("Content-Type") === "audio/mpeg";
} catch (A) {
return console.warn(A), !1;
}
}
function Ze(a) {
if (typeof a != "object" || a === null)
return a;
let A = Array.isArray(a) ? [] : {};
for (let e in a)
a.hasOwnProperty(e) && (A[e] = Ze(a[e]));
return A;
}
const Fo = {
// 按钮文案
hangup: "挂断",
reject: "拒绝",
accept: "接受",
camera: "摄像头",
microphone: "麦克风",
speaker: "扬声器",
"open camera": "打开摄像头",
"close camera": "关闭摄像头",
"open microphone": "打开麦克风",
"close microphone": "关闭麦克风",
"video-to-audio": "转语音通话",
"virtual-background": "模糊背景",
// 通话结果
"other side reject call": "对方已拒绝",
"reject call": "{{ userList }} 拒绝通话",
cancel: "取消通话",
"other side line busy": "对方忙线",
"in busy": "{{ userList }} 正在忙",
"call timeout": "呼叫超时",
"end call": "{{ userList }} 结束通话",
// 通话提示语
"caller calling message": "等待对方接受邀请",
"callee calling video message": "邀请你视频通话",
"callee calling audio message": "邀请你语音通话",
"no microphone access": "没有麦克风权限",
"no camera access": "没有摄像头权限",
"invite member": "邀请成员",
"Invited group call": "邀请你加入多人通话",
"Those involved": "参与通话的有:",
waiting: "等待接听...",
me: "(我)",
// 弹出层文案
"browser-authorization": "浏览器授权",
"mac-privacy": "系统偏好设置 -> 安全与隐私 -> 隐私",
"win-privacy": "设置 -> 隐私和安全性 -> 应用权限",
"mac-preferences": "打开系统偏好设置",
"win-preferences": "打开系统设置",
"Please enter userID": "请输入 userID",
"View more": "查看更多",
"people selected": "人已选中",
"Select all": "全选",
Cancel: "取消",
Done: "完成",
"exist group call": "当前群组中已经存在群组通话",
// UI3.0 新增
"camera enabled": "摄像头已开",
"camera disabled": "摄像头已关",
"microphone enabled": "麦克风已开",
"microphone disabled": "麦克风已关",
"speaker enabled": "扬声器已开",
"speaker disabled": "扬声器已关",
"open speaker": "开启扬声器",
"close speaker": "关闭扬声器",
"wait to be called": "等待接听",
answered: "已接通",
"people in the call": "人参与通话",
"failed to obtain speakers": "无法获取扬声器",
"you have a new call": "您有一个新的通话",
"switch camera": "翻转",
join: "加入",
"people on the call": "人正在通话",
"Supports a maximum of 9 people for simultaneous calls": "最多支持9人同时通话",
you: "(你)",
"The network is poor during your current call": "当前通话你的网络不佳",
"The other user network is poor during the current call": "当前通话对方网络不佳",
"TUICallKit init is not complete": "TUICallKit 初始化登录未完成,需要在 init 完成后使用此 API",
// combine chat
"Video call": "发起视频通话",
"Voice call": "发起语音通话",
"Call End": "通话结束",
"Switch voice call": "切换语音通话",
"Switch video call": "切换视频通话",
"Call duration": "通话时长",
"Call Cancel": "已取消",
"Other Side Cancel": "对方已取消",
Decline: "已拒绝",
"Other Side Decline": "对方已拒绝",
"No answer": "超时无应答",
"Other Side No Answer": "对方无应答",
Answered: "已接听",
"Other Side Line Busy": "对方忙线中",
"Line Busy": "忙线无应答",
// 待废弃文案
timeout: "{{ userList }} 超时",
"kick out": "被踢",
call: "通话",
"video-call": "视频通话",
"audio-call": "音频通话",
search: "搜索",
"search-result": "搜索结果",
"Wechat scan right QR code": "微信扫右二维码",
"Use-phone-and-computer": "用手机与电脑互打体验视频通话",
"Scan the QR code above": "扫描上方二维码",
"no-user": "未搜索到用户",
"member-not-added": "未添加成员",
"not-login": "未登录",
"login-status-expire": "登录状态已失效,请刷新网页重试",
"experience-multi-call": "体验多人通话请下载全功能demo:",
"not-support-multi-call": "多人通话接口未开放",
"input-phone-userID": "请输入手机号/用户ID",
userID: "用户ID",
"already-enter": "已经进入当前通话",
"image-resolution": "分辨率",
"default-image-resolution": "默认分辨率",
"invited-person": "添加成员",
"be-rejected": "对方已拒绝,",
"be-no-response": "对方无应答,",
"be-line-busy": "对方忙线中,",
"be-canceled": "对方已取消",
"voice-call-end": "语音通话结束",
"video-call-end": "视频通话结束",
"method-call-failed": "同步操作失败",
"failed-to-obtain-permission": "权限获取失败",
"environment-detection-failed": "环境检测失败",
"switchToAudioCall-call-failed": "切语音调用失败",
"switchToVideoCall-call-failed": "切视频调用失败",
"microphone-unavailable": "没有可用的麦克风设备",
"camera-unavailable": "没有可用的摄像头设备",
"ban-device": "用户禁止使用设备",
"not-supported-webrtc": "当前环境不支持 WebRTC",
"blacklist-user-tips": "发起通话失败,被对方拉入黑名单,禁止发起!",
"is-already-calling": "TUICallKit 已在通话状态",
"need-init": "TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功",
"can't call yourself": "不能呼叫自己",
// eslint-disable-line
"accept-error": "接通失败",
"accept-device-error": "接通失败,通话设备获取失败",
"call-error": "发起通话失败"
}, Zo = {
// 按钮文案
hangup: "Hang up",
reject: "Decline",
accept: "Accept",
camera: "Camera",
microphone: "Microphone",
speaker: "speaker",
"open camera": "Open Camera",
"close camera": "Close Camera",
"open microphone": "Open Microphone",
"close microphone": "Close Microphone",
"video-to-audio": "Switch to audio",
"virtual-background": "Blur Background",
// 通话结果
"other side reject call": "other side reject call",
"reject call": "{{ userList }} Reject Call",
cancel: "Cancel Call",
"other side line busy": "other side line busy",
"in busy": "{{ userList }} in busy",
"call timeout": "call timeout",
"no response from the other side": "no response from the other side",
"end call": "{{ userList }} end call",
// 通话提示语
"caller calling message": "Awaiting response",
"callee calling video message": "invites you to a video call",
"callee calling audio message": "invites you to a voice call",
"no microphone access": "no microphone access",
"no camera access": "no camera access",
"invite member": "Invite Member",
"Invited group call": "invites you to a group call",
waiting: "Calling...",
me: "(me)",
// 弹出层文案
"browser-authorization": "Browser authorization",
"mac-privacy": "System Preferences -> Security and Privacy -> Privacy",
"win-privacy": "Setting -> Privacy and Security -> App permissions",
"mac-preferences": "Open System Preferences",
"win-preferences": "Open Setting",
"Please enter userID": "Please enter userID",
"View more": "View more",
"people selected": "people selected",
"Select all": "Select all",
Cancel: "Cancel",
Done: "Done",
"exist group call": "A group call already exists in the current group",
// UI3.0 新增
"camera enabled": "Camera On",
"camera disabled": "Camera Off",
"microphone enabled": "Unmuted",
"microphone disabled": "Muted",
"speaker enabled": "Speaker On",
"speaker disabled": "Speaker Off",
"open speaker": "Turn on speaker",
"close speaker": "Turn off speaker",
"wait to be called": "Waiting",
answered: "Connected",
"people in the call": " other(s) in the call",
"failed to obtain speakers": "failed to obtain speakers",
"you have a new call": "You have a new call",
"switch camera": "Switch",
join: "Join",
"people on the call": "people on the call",
"Supports a maximum of 9 people for simultaneous calls": "Supports a maximum of 9 people for simultaneous calls",
you: "(you)",
"The network is poor during your current call": "The network is poor during your current call",
"The other user network is poor during the current call": "The other party's network is poor during the current call",
"TUICallKit init is not complete": "TUICallKit init is not complete. You need to use this API after the init API is finished.",
// combine chat
"Video call": "Video call",
"Voice call": "Voice call",
"Call End": "Call End",
"Switch voice call": "Switch voice call",
"Switch video call": "Switch video call",
"Call duration": "Duration",
"Call Cancel": "Canceled",
"Other Side Cancel": "Call canceled by caller",
Decline: "Declined",
"Other Side Decline": "Call declined by user",
"No answer": "Call not answered",
"Other Side No Answer": "Call wasn't answered",
Answered: "Answered",
"Other Side Line Busy": "Line busy",
"Line Busy": "Line busy. Call not received.",
// 待废弃文案
"Those involved": "Those involved in the call are",
call: "call",
"video-call": "video call",
"audio-call": "audio call",
search: "search",
"search-result": "search result",
"no-user": "user not found",
"member-not-added": "member not added",
"input-phone-userID": "phone number or userID",
"not-login": "not logged in",
"login-status-expire": "login status is invalid, please refresh the page and try again",
"experience-multi-call": "experience multi-person calls, please download the full-featured demo: ",
"not-support-multi-call": "multi-person call interface is not open",
userID: "userID",
"already-enter": "entered the call",
"camera-opened": "Camera on",
"camera-closed": "Camera off",
"microphone-opened": "Mic on",
"microphone-closed": "Mic off",
timeout: "{{ userList }} timeout",
"kick out": "kick out",
"image-resolution": "Resolution",
"default-image-resolution": "Default",
"invited-person": "Invite",
"be-rejected": "Call declined, ",
"be-no-response": "No response, ",
"be-line-busy": "Line busy, ",
"be-canceled": "The call is canceled, ",
"voice-call-end": "Voice call ended",
"video-call-end": "Video call ended",
"method-call-failed": "Failed to sync the operation",
"failed-to-obtain-permission": "Failed to obtain permissions",
"environment-detection-failed": "Failed to check the environment",
"switchToAudioCall-call-failed": "switch to audio call method failed",
"switchToVideoCall-call-failed": "switch to video call method failed",
"microphone-unavailable": "No mic found",
"camera-unavailable": "No camera found",
"ban-device": "Device access denied",
"not-supported-webrtc": "Your current environment does not support WebRTC",
"blacklist-user-tips": "The identifier is in blacklist. Failed to send this message!",
"is-already-calling": "TUICallKit is already on a call",
"need-init": "Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ",
"can't call yourself": "Can't call yourself",
// eslint-disable-line
"Use-phone-and-computer": "Use your mobile phone and computer to experience video calls",
"Wechat scan right QR code": "Wechat scan right QR code",
"Scan the QR code above": "Scan the QR code above",
"accept-error": "Accept failed",
"accept-device-error": "Accept failed, unable to auth calling device",
"call-error": "Start call failed"
}, Yo = {
// 按钮文案
hangup: "通話終了",
reject: "拒否",
accept: "応答",
camera: "カメラ",
microphone: "マイク",
speaker: "スピーカー",
"virtual-background": "ボケ背景",
// 通话结果
"other side reject call": "通話が拒否されました",
"reject call": "{{ userList }} 通話拒否",
cancel: "通話をキャンセル",
"other side line busy": "相手が通話中です",
"in busy": "{{ userList }} 通話中",
"call timeout": "呼び出しタイムアウト",
"end call": "{{ userList }} 通話終了",
// 通话提示语
"caller calling message": "応答を待っています",
"callee calling video message": "ビデオ通話に招待されました",
"callee calling audio message": "音声通話に招待されました",
"no microphone access": "マイクにアクセスできません",
"no camera access": "カメラにアクセスできません",
"invite member": "メンバーを招待する",
// 弹出层文案
"browser-authorization": "ブラウザ認証",
"mac-privacy": "システム環境設定 -> セキュリティとプライバシー ->プライバシー",
"win-privacy": "設定 -> セキュリティとプライバシー ->アプリのアクセス許可",
"mac-preferences": "システム環境設定を開く",
"win-preferences": "システム設定を開く",
"Please enter userID": "ユーザーIDを入力してください",
"View more": "もっと見る",
"people selected": "人が選択されました",
"Select all": "すべて選択",
Cancel: "キャンセル",
Done: "完了",
"exist group call": "現在のグループには既にグループ通話が存在しています",
// combine chat
"Video call": "ビデオ通話を開始",
"Voice call": "音声通話を開始",
"Call End": "通話終了",
"Switch audio call": "音声通話に切り替える",
"Switch video call": "ビデオ通話に切り替える",
"Call duration": "通話時間",
"Call Cancel": "通話をキャンセルする",
"Other Side Cancel": "相手がキャンセルしました",
Decline: "通話を拒否する",
"Other Side Decline": "相手が拒否しました",
"No answer": "無応答",
"Other Side No Answer": "相手からの返答はありません",
Answered: "応答しました",
"Other Side Line Busy": "相手は現在忙しくて対応できません",
"Line Busy": "忙しいので応答できません",
// UI3.0文案
"open camera": "オープンカメラ",
"close camera": "カメラを閉じる",
"open microphone": "オープンマイク",
"close microphone": "マイクを閉じる",
"camera enabled": "カメラオン",
"camera disabled": "カメラオフ",
"microphone enabled": "マイクオン",
"microphone disabled": "マイクオフ",
"speaker enabled": "スピーカーオン",
"speaker disabled": "スピーカーオフ",
"open speaker": "スピーカーをオンにする",
"close speaker": "スピーカーの電源を切ります",
"wait to be called": "待機中",
answered: "接続済み",
"people in the call": "通話に参加している人たち",
"failed to obtain speakers": "スピーカーが見つかりません",
"you have a new call": "新しい通話があります",
"switch camera": "切り替え",
join: "参加する",
"people on the call": "人が通話中です",
"Supports a maximum of 9 people for simultaneous calls": "最大で9人まで同時通話が可能です",
you: "(あなた)",
"The network is poor during your current call": "現在の通話で、あなたのネットワークは不良です",
"The other user network is poor during the current call": "現在の通話で、相手側のネットワークが不良です",
"TUICallKit init is not complete": "TUICallKitの初期化ログインが完了していません。init が完了した後にこのAPIを使用する必要があります。",
// 待废弃文案
timeout: "{{ userList }} タイムアウト",
"kick out": "キックアウトされました",
"Invited group call": "グループ通話に招待されました。",
"Those involved": "参加者:",
call: "通話",
"video-call": "ビデオ通話",
"audio-call": "音声通話",
search: "検索",
"search-result": "検索結果",
"Wechat scan right QR code": "WeChatで右側にあるQRコードを読み取ります。",
"Use-phone-and-computer": "携帯電話とコンピュータを使用してビデオ通話を体験してください",
"Scan the QR code above": "上のQRコードを読み取ります。",
"no-user": "ユーザーが見つかりませんでした",
"member-not-added": "メンバーが追加されていません",
"not-login": "ログインしていません",
"login-status-expire": "ログインの有効期限が過ぎています。ページを更新してもう一度お試しください",
"experience-multi-call": "複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください",
"not-support-multi-call": "グループ通話インターフェイスが開いていません",
"input-phone-userID": "携帯電話番号/ユーザーIDを入力してください",
userID: "ユーザーID",
"already-enter": "すでに通話に参加しています",
waiting: "応答を待っています...",
"camera-opened": "カメラがオンになっています",
"camera-closed": "カメラがオフになっています",
"microphone-opened": "マイクがオンになっています",
"microphone-closed": "マイクがオフになっています",
"image-resolution": "解像度",
"default-image-resolution": "デフォルト解像度",
"invited-person": "メンバーを招待",
"video-to-audio": "音声通話に切り替えます",
me: "(自分)",
"be-rejected": "通話が拒否されました, ",
"be-no-response": "応答なし, ",
"be-line-busy": "相手が通話中です, ",
"be-canceled": "相手が通話をキャンセルしました",
"voice-call-end": "音声通話が終了しました",
"video-call-end": "ビデオ通話が終了しました",
"method-call-failed": "操作の同期に失敗しました",
"failed-to-obtain-permission": "権限の取得に失敗しました",
"environment-detection-failed": "環境の検出に失敗しました",
"switchToAudioCall-call-failed": "音声通話に切り替えることはできません",
"switchToVideoCall-call-failed": "ビデオ通話に切り替えることはできません",
"microphone-unavailable": "使用できるマイクがありません",
"camera-unavailable": "使用できるカメラがありません",
"ban-device": "デバイスへのアクセスが拒否されました",
"not-supported-webrtc": "現在の環境はWebRTCをサポートしていません",
"blacklist-user-tips": "ユーザーはブラックリストに登録され、通話が開始できませんでした",
"is-already-calling": "TUICallKit はすでに通話中です",
"need-init": "TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。",
"can't call yourself": "自分に電話をかけることができません",
"accept-error": "接続できませんでした",
"accept-device-error": "接続できませんでした。発信側デバイスを認証できません",
"call-error": "通話が開始できませんでした"
}, Ye = typeof wx < "u" && typeof wx.getSystemInfoSync == "function" && !!wx.getSystemInfoSync().fontSizeSetting, ia = typeof uni < "u" && typeof uni > "u", kt = Ye || ia, la = typeof uni < "u", sa = function() {
return (typeof uni < "u" || typeof window < "u") && !kt;
}(), Ho = function() {
return Ye ? wx : la ? uni : window;
}(), $A = sa && window && window.navigator && window.navigator.userAgent || "", Ko = /Android/i.test($A), Jo = /(?:Windows Phone)/.test($A), _o = /(?:SymbianOS)/.test($A), $o = /iPad/i.test($A) || /iPhone/i.test($A) || /iPod/i.test($A), ra = Ko || Jo || _o || $o, vt = sa && !ra, An = vt && $A.includes("Windows NT"), en = vt && $A.includes("Mac");
let ca = class De {
constructor() {
this.global = Ho, this.isPC = !1, this.isH5 = !1, this.isWeChat = !1, this.isApp = !1, this.isUniPlatform = !1, this.isOfficial = !1, this.isWIN = !1, this.isMAC = !1, this.initEnv();
}
/**
* 获取 TUIGlobal 实例
* @returns {TUIGlobal}
*/
static getInstance() {
return De.instance || (De.instance = new De()), De.instance;
}
initEnv() {
this.isPC = vt, this.isH5 = ra, this.isWeChat = Ye, this.isApp = ia && !Ye, this.isUniPlatform = la, this.isWIN = An, this.isMAC = en;
}
initOfficial(A) {
this.isOfficial = A === 1400187352 || A === 1400188366;
}
};
const et = function(a) {
return typeof a === l.UNDEFINED;
}, Dt = function(a) {
if (typeof a !== l.OBJECT || a === null)
return !1;
const A = Object.getPrototypeOf(a);
if (A === null)
return !0;
let e = A;
for (; Object.getPrototypeOf(e) !== null; )
e = Object.getPrototypeOf(e);
return A === e;
}, ua = function(a) {
return typeof Array.isArray === l.FUNCTION ? Array.isArray(a) : Object.prototype.toString.call(a).match(/^\[object (.*)\]$/)[1].toLowerCase() === l.ARRAY;
}, He = function(a) {
return typeof a === l.STRING;
}, tn = function(a) {
return typeof a === l.BOOLEAN;
}, da = function(a) {
return (
// eslint-disable-next-line
a !== null && (typeof a === l.NUMBER && !isNaN(a - 0) || typeof a === l.OBJECT && a.constructor === Number)
);
};
function Ia(a) {
const A = Math.floor(a / 3600), e = Math.floor(a % 3600 / 60), t = Math.floor(a % 60);
let o = A > 9 ? `${A}` : `0${A}`;
return o += e > 9 ? `:${e}` : `:0${e}`, o += t > 9 ? `:${t}` : `:0${t}`, o;
}
function an(a) {
if (typeof a === l.STRING)
try {
return !!JSON.parse(a);
} catch (A) {
return console.debug(A), !1;
}
return !1;
}
const Re = function(a) {
return !a || !an(a) ? a : JSON.parse(a);
};
function qt(a) {
return (a == null ? void 0 : a.message.indexOf("is ongoing, please avoid repeated calls")) !== -1;
}
function on(a) {
const { message: A } = a;
return A.indexOf("NotAllowedError: Permission denied") !== -1;
}
function dt() {
return Date.now();
}
const Qe = function(a) {
return typeof a === l.FUNCTION;
}, nn = () => {
if (ca.getInstance().isWeChat)
return "zh-cn";
const a = ((navigator == null ? void 0 : navigator.language) || (navigator == null ? void 0 : navigator.userLanguage) || "").substr(0, 2);
let A = "en";
switch (a) {
case "zh":
A = "zh-cn";
break;
case "ja":
A = "ja_JP";
break;
default:
A = "en";
}
return A;
};
function ln(a) {
}
const sn = function(a) {
return Object.prototype.toString.call(a).match(/^\[object (.*)\]$/)[1].toLowerCase();
};
function rn(a, A, e) {
if (!a.hasOwnProperty(A))
return a;
const t = {};
return Object.keys(a).forEach((o) => {
o === A ? t[e] = a[o] : t[o] = a[o];
}), t;
}
function cn(a, A) {
return a.replace(/{{\s*(\w+)(\s*,\s*[^}]+)?\s*}}/g, (e, t) => {
const o = t.trim();
return A[o] !== void 0 ? String(A[o]) : e;
});
}
const DA = {
OTHER_SIDE: "other side",
CANCEL: "cancel",
OTHER_SIDE_REJECT_CALL: "other side reject call",
REJECT_CALL: "reject call",
OTHER_SIDE_LINE_BUSY: "other side line busy",
IN_BUSY: "in busy",
CALL_TIMEOUT: "call timeout",
END_CALL: "end call",
TIMEOUT: "timeout",
KICK_OUT: "kick out",
CALLER_CALLING_MSG: "caller calling message",
CALLER_GROUP_CALLING_MSG: "wait to be called",
CALLEE_CALLING_VIDEO_MSG: "callee calling video message",
CALLEE_CALLING_AUDIO_MSG: "callee calling audio message",
NO_MICROPHONE_DEVICE_PERMISSION: "no microphone access",
NO_CAMERA_DEVICE_PERMISSION: "no camera access",
EXIST_GROUP_CALL: "exist group call",
LOCAL_NETWORK_IS_POOR: "The network is poor during your current call",
REMOTE_NETWORK_IS_POOR: "The other user network is poor during the current call"
}, ge = {
"zh-cn": Fo,
en: Zo,
ja_JP: Yo
};
function de(a) {
var t, o;
const A = M.getData(u.CALL, l.LANGUAGE);
let e = "";
if (He(a))
e = ((t = ge == null ? void 0 : ge[A]) == null ? void 0 : t[a]) || "";
else if (Dt(a)) {
const { key: i, options: s } = a;
e = ((o = ge == null ? void 0 : ge[A]) == null ? void 0 : o[i]) || "", e = cn(e, s);
}
return e;
}
const un = "data:audio/mpeg;base64,SUQzAwAAAAAAGFRYWFgAAAAOAAAAVFhYWABpc29taXNvMv/zNGQAAqwAvnihCAADQAF4CUAQAFYAg3Lh8u+XUD5///wx//wQOAhKAgb/////xOoH4g8Hz4Pq8RoAbdTgMsMt9hcb990EP//zNGQQBPDjEgDItAAFWcIoAYoQAN9P/03QQ//umn//91SXL5uXP+pf8WYTvzgJPAQ+p/7f///1//6f///WH///F4BtJhNFkP/zNGQGA/jjNADHiAAEQDJcAYkQAGWrn6vw6ljfPtj/////////9Pv9sL/mL/QezSepgwrimv07//////y3u602OiyhOYb+LP/zNGQIBKTBKADoCACDoCZMAckAAKHKCUIAFsqGZXtSZ/////////Sn/Vy3nVUOJBqSX2UAkQxBddzv//////yq3lcgaTmTQ//zNGQHA9SrJgA8AliD4C5IAApYAKh3FKlMunKHm8H/2//77vkdqB2xfsXaHiDKBGtFKqONF3/////Z9VXClT5ND+syHkjBq//zNGQLBITJIAA8AmQEiDI4AAjSAGa1Vffm3ff/1/0//11tvZpAaIw3dBiIrjJgHQrGVWmdBU1f/////oDqEKrV1OpBUTjQtv/zNGQHAsjDKAAwAl4D0Co8AAmCBHIQNtld6fm0+/VigZzuMnGZlkAMLMJFv/////33UIWeFQkKsaceBsangecHzYXKI//////zNGQUA4QjKAA3CAID8CpEABMCBPfuStx4FQVHYMgKcO6jIJh//////9uIlspQkGQ2YyZscAV83Bv/////ncL6BEiWHyA2K//zNEQbAogfJgAx5hAEwDJcCAsEBtICgF3/////WJaIuuqMCCVGucgkrtwiwBO//////pW4YFRWQhaRRhZZnVwGhf////+ocv/zNEQmApgVJAANjwAFkC5YCApeAolD4kQb+EQJYNKwLWGmc6sqMBwJvf////6tDEOWDgFJk1VywKMGoM2f////+N1JmgJuPv/zNGQuA4AbJAAl5hIDwC48AAIGBEho7wTL5b6kSO7IUAA5uDABYNNjGDBSJEN//////xtQsszVy27IcWBbQkLgzv7YmZYW///zNGQ2AqzFNAgcA1+D8CZIAAhMAP/3/rozCAsBjIqCY/DBWMfQZp1f/////0F6phXSNisgAJjo6icT2vpvM/Vf9v///97eu//zNGRDA4gdJgBhghIDwCZAABGMAFVWERbCda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YFAHH4AoHK/UjViBLV//63AJjdI0XtwGkifICyqmi//zNGRIBSw7btwFgyMD6ALqWAhETu2ZOWicEhAiswV/hPFBGEqauoaRW3V54HwcFxIkk6KAAcADyHB0AIv/9dYcMzfqHQ111v/zNGRCBcxXZSwV4yID0Iq6YAGEQckgAG2n4fkUQuw23aCbLDMdqFwtlXh63MmhYuoS17LCLjXNAUUAfACgdZy78phH///11f/zNGQ3BOQxfywBJgcDwALuWAAEAmgxd7v9LaPcBg1L81hTvD0CHIluDY0XFot+LevrYw7WIAQBcKdMOj136pAOA48FlaCiKP/zNGQzA/wdi3wgJhED2DKmQABUAFsyYl7gxBmYOtXykChn+aEhu72l/8Ysza/SIQAB6KABLXByn9drV1/Q3Z+v+1to0Exr8//zNGQ2A5wvYMQLAiADwDKyWABOAOAYUtUAgZPn19TSzma6m/p90nQUCACboP6YFq/o98Z4CSkYi23WySBvXAHAVZ1SRY5U1//zNGQ9A8AbiywIJhEDgIq9wBAGacvvqgOV6a1LfZXW/iMWDACgS2qwzv9VuB2ttwgg0C3bhahyHlma
class dn {
constructor() {
this._bellContext = null, this._isMuteBell = !1, this._calleeBellFilePath = Wt, this._callRole = gA.UNKNOWN, this._callStatus = x.IDLE, this._bellContext = new Audio(), this._bellContext.loop = !0;
}
setBellSrc() {
try {
let A = un;
this._callRole === gA.CALLEE && (A = this._calleeBellFilePath || Wt), this._bellContext.src = A;
} catch (A) {
console.warn(`${l.PREFIX}Failed to setBellSrc, ${A}`);
}
}
setBellProperties(A) {
this._callRole = A.callRole || this._callRole, this._callStatus = A.callStatus || this._callStatus, this._calleeBellFilePath = A.calleeBellFilePath || this._calleeBellFilePath, this._isMuteBell = et(A.isMuteBell) ? this._isMuteBell : A.isMuteBell;
}
async play() {
try {
if (this._callStatus !== x.CALLING)
return;
this.setBellSrc(), this._callRole === gA.CALLEE && !this._isMuteBell && await this._bellContext.play(), this._callRole === gA.CALLER && await this._bellContext.play();
} catch (A) {
console.warn(`${l.PREFIX}Failed to play audio file, ${A}`);
}
}
async stop() {
try {
await this._bellContext.pause();
} catch (A) {
console.warn(`${l.PREFIX}Failed to stop audio file, ${A}`);
}
}
async setBellMute(A) {
this._callStatus !== x.CALLING && this._callRole !== gA.CALLEE || (A ? await this.stop() : await this.play());
}
destroy() {
try {
this._isMuteBell = !1, this._calleeBellFilePath = "", this._callRole = gA.UNKNOWN, this._callStatus = x.IDLE, this._bellContext.pause(), this._bellContext = null;
} catch (A) {
console.warn(`${l.PREFIX}Failed to destroy, ${A}`);
}
}
}
function NA() {
return function(a, A, e) {
const t = e.value, o = /* @__PURE__ */ new Set();
return e.value = async function(...i) {
var s, c;
if (o.has(this)) {
console.warn(`${l.PREFIX}previous ${A}() is ongoing, please avoid repeated calls`), (c = (s = this == null ? void 0 : this.getTUICallEngineInstance()) == null ? void 0 : s.reportLog) == null || c.call(s, {
name: "TUICallKit.avoidRepeatedCall.fail",
data: { name: A },
error: `previous ${A}() is ongoing`
});
return;
}
try {
o.add(this);
const r = await t.apply(this, i);
return o.delete(this), r;
} catch (r) {
throw o.delete(this), r;
}
}, e;
};
}
const me = l.PREFIX + "API";
function bA(a) {
return function(A, e, t) {
let o = t.value;
return t.value = function(...i) {
return In.call(this, a, i, e), o.apply(this, i);
}, t;
};
}
function In(a, A, e) {
try {
if (A[0].SDKAppID || (a = rn(a, "SDKAppID", "sdkAppID")), ua(a))
for (let t = 0; t < a.length; t++)
Xt.call(this, {
...a[t],
value: A[t],
name: e
});
else
for (const t in a)
a.hasOwnProperty(t) && Xt.call(this, {
...a[t],
value: A[0][t],
name: e,
key: t
});
} catch (t) {
throw console.error(t), t;
}
}
function Xt({ required: a, rules: A, range: e, value: t, allowEmpty: o, name: i, key: s }) {
if (et(t)) {
if (a)
throw new Error(`${me}<${i}>: ${s} is required.`);
return;
}
const c = A.some((d) => d === sn(t));
let r = "";
if (!c) {
for (let d = 0; d < A.length; d++) {
let g = A[d];
g = g.replace(g[0], g[0].toUpperCase()), r += `${g}/`;
}
throw r = r.substring(0, r.length - 1), new Error(`${me}<${i}>: ${s} must be ${r}, current ${s} is ${typeof t}.`);
}
if (o === !1 && He(t) && t.trim() === "")
throw new Error(`${me}<${i}>: ${s} is blank.`);
if (ua(e) && e && e.indexOf(t) === -1)
throw new Error(`${me}<${i}>: ${s} error, only be ${e}, current ${s} is ${t}.`);
if (He(e) && e.indexOf("~") !== -1) {
const d = e.split("~");
if (t < +d[0] || t > +d[1] || da(t) && Number.isNaN(t))
throw new Error(`${me}<${i}>: ${s} error, only be ${e}, current ${s} is ${t}.`);
}
}
const UA = {
init: {
SDKAppID: {
required: !0,
rules: [l.NUMBER],
allowEmpty: !1
},
userID: {
required: !0,
rules: [l.STRING],
allowEmpty: !1
},
userSig: {
required: !0,
rules: [l.STRING],
allowEmpty: !1
},
tim: {
required: !1,
rules: [l.OBJECT]
}
},
call: {
userID: {
required: !0,
rules: [l.STRING],
allowEmpty: !1
},
type: {
required: !0,
rules: [l.NUMBER],
range: [1, 2],
allowEmpty: !1
},
roomID: {
required: !1,
rules: [l.NUMBER],
// 仅支持数字房间号, 后续会支持字符串房间号
range: `0~${Gt}`,
allowEmpty: !1
},
strRoomID: {
required: !1,
rules: [l.STRING],
allowEmpty: !0
},
userData: {
required: !1,
rules: [l.STRING],
allowEmpty: !1
},
timeout: {
required: !1,
rules: [l.NUMBER],
allowEmpty: !1
}
},
groupCall: {
userIDList: {
required: !0,
rules: [l.ARRAY],
allowEmpty: !1
},
type: {
required: !0,
rules: [l.NUMBER],
range: [1, 2],
allowEmpty: !1
},
groupID: {
required: !0,
rules: [l.STRING],
allowEmpty: !1
},
roomID: {
required: !1,
rules: [l.NUMBER],
// 仅支持数字房间号, 后续会支持字符串房间号
range: `0~${Gt}`,
allowEmpty: !1
},
strRoomID: {
required: !1,
rules: [l.STRING],
allowEmpty: !0
},
timeout: {
required: !1,
rules: [l.NUMBER],
allowEmpty: !1
},
userData: {
required: !1,
rules: [l.STRING],
allowEmpty: !1
},
offlinePushInfo: {
required: !1,
rules: [l.OBJECT],
allowEmpty: !1
}
},
joinInGroupCall: {
type: {
required: !0,
rules: [l.NUMBER],
range: [1, 2],
allowEmpty: !1
},
groupID: {
required: !0,
rules: [l.STRING],
allowEmpty: !1
},
roomID: {
required: !0,
rules: [l.NUMBER],
allowEmpty: !1
},
strRoomID: {
required: !1,
rules: [l.STRING],
allowEmpty: !0
}
},
inviteUser: {
userIDList: {
required: !0,
rules: [l.ARRAY],
allowEmpty: !1
}
},
setSelfInfo: {
nickName: {
required: !1,
rules: [l.STRING],
allowEmpty: !1
},
avatar: {
required: !1,
rules: [l.STRING],
allowEmpty: !1
}
},
enableFloatWindow: [
{
key: "enable",
required: !1,
rules: [l.BOOLEAN],
allowEmpty: !1
}
],
enableAIVoice: [
{
key: "enable",
required: !0,
rules: [l.BOOLEAN],
allowEmpty: !1
}
],
enableMuteMode: [
{
key: "enable",
required: !0,
rules: [l.BOOLEAN],
allowEmpty: !1
}
],
setCallingBell: [
{
key: "filePath",
required: !1,
rules: [l.STRING],
allowEmpty: !0
}
],
setLanguage: [
{
key: "language",
required: !0,
rules: [l.STRING],
allowEmpty: !1
}
],
setVideoDisplayMode: [
{
key: "displayMode",
required: !0,
rules: [l.STRING],
range: [Ue.CONTAIN, Ue.COVER, Ue.FILL],
allowEmpty: !1
}
],
setVideoResolution: [
{
key: "resolution",
required: !0,
rules: [l.STRING],
range: [Oe.RESOLUTION_1080P, Oe.RESOLUTION_480P, Oe.RESOLUTION_720P],
allowEmpty: !1
}
]
};
function tt(a) {
return function(A, e, t) {
let o = t.value;
return t.value = function(...i) {
return gn.call(this, a, i, e), o.apply(this, i);
}, t;
};
}
function gn(a) {
if (a != null && a.engineInstance && !this._tuiCallEngine) {
const A = `${l.PREFIX} ${de("TUICallKit init is not complete")}`;
throw console.error(A), A;
}
}
class Mn {
constructor() {
this.defaultStore = {
callStatus: x.IDLE,
callRole: gA.UNKNOWN,
callMediaType: _.UNKNOWN,
localUserInfo: { userId: "" },
localUserInfoExcludeVolume: { userId: "" },
remoteUserInfoList: [],
remoteUserInfoExcludeVolumeList: [],
callerUserInfo: { userId: "" },
isGroup: !1,
callDuration: "00:00:00",
// 通话时长
callTips: "",
// 通话提示的信息. 例如: '等待谁接听', 'xxx 拒绝通话', 'xxx 挂断通话'
toastInfo: { text: "" },
// 远端用户挂断、拒绝、超时、忙线等的 toast 提示信息
isMinimized: !1,
// 用来记录当前是否悬浮窗模式
enableFloatWindow: !1,
// 开启/关闭悬浮窗功能设置为false通话界面左上角的悬浮窗按钮会隐藏
bigScreenUserId: "",
// 当前大屏幕显示的 userID 用户
language: nn(),
// en, zh-cn
isClickable: !1,
// 是否可点击, 用于按钮增加 loading 效果,不可点击
deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} },
showPermissionTip: !1,
netWorkQualityList: [],
// 显示网络状态差的提示
isMuteSpeaker: !1,
groupID: "",
roomID: 0,
roomIdType: 0,
cameraPosition: ie.FRONT,
// 前置或后置值为front, back
groupCallMembers: [],
// chat 群会话在的通话中的成员
// TUICallKit 组件上的属性
displayMode: Ue.COVER,
// 设置预览远端的画面显示模式
videoResolution: Oe.RESOLUTION_480P,
showSelectUser: !1,
// 小程序相关属性
pusher: {},
player: [],
isEarPhone: !1,
// 是否是听筒, 默认: false
pusherId: l.INITIAL_PUSHER,
// 重新渲染 live-Pusher 的标识位
// 是否开启虚拟背景, 目前仅 web 支持
isShowEnableVirtualBackground: !1,
// 是否显示虚拟背景图标, 默认: false
enableVirtualBackground: !1,
// 是否开启虚拟背景, 默认: false
// customUIConfig
customUIConfig: {
button: {},
viewBackground: {},
layoutMode: Fe.RemoteInLargeView
},
// translate function
translate: de
}, this.store = Ze(this.defaultStore), this.prevStore = Ze(this.defaultStore);
}
update(A, e) {
switch (A) {
case l.CALL_TIPS:
const t = this.getData(A);
this.prevStore[A] = t;
default:
this.store[A] = e;
}
}
getPrevData(A) {
return A ? this.prevStore[A] : this.prevStore;
}
getData(A) {
return A ? this.store[A] : this.store;
}
// reset call store
reset(A = []) {
A.length === 0 && (A = Object.keys(this.store));
const e = A.reduce((t, o) => ({ ...t, [o]: this.defaultStore[o] }), {});
this.store = {
...this.defaultStore,
...this.store,
...e
};
}
}
let at = class we {
constructor() {
this.timerId = -1, this.storeMap = {
[u.CALL]: new Mn()
}, this.task = {};
}
/**
* 获取 TUIStore 实例
* @returns {TUIStore}
*/
static getInstance() {
return we.instance || (we.instance = new we()), we.instance;
}
/**
* UI 组件注册监听回调
* @param {StoreName} storeName store 名称
* @param {IOptions} options 监听信息
* @param {Object} params 扩展参数
* @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知
*/
watch(A, e, t) {
this.task[A] || (this.task[A] = {});
const o = this.task[A];
Object.keys(e).forEach((i) => {
const s = e[i];
o[i] || (o[i] = /* @__PURE__ */ new Map()), o[i].set(s, 1);
const { notifyRangeWhenWatch: c } = t || {};
if (c === l.ALL && this.notify(A, i), c === l.MYSELF) {
const r = this.getData(A, i);
s.call(this, r);
}
});
}
/**
* UI 取消组件监听回调
* @param {StoreName} storeName store 名称
* @param {IOptions} options 监听信息,包含需要取消的回掉等
*/
unwatch(A, e) {
if (!this.task[A])
return;
const t = this.task[A];
Object.keys(e).forEach((o) => {
t[o].delete(e[o]);
});
}
/**
* 通用 store 数据更新messageList 的变更需要单独处理
* @param {StoreName} storeName store 名称
* @param {string} key 变更的 key
* @param {unknown} data 变更的数据
*/
update(A, e, t) {
var o;
(He(t) || da(t) || tn(t)) && this.storeMap[A].store[e] === t || ((o = this.storeMap[A]) == null || o.update(e, t), this.notify(A, e));
}
/**
* 获取 Store 的上一个状态值
* @param {StoreName} storeName store 名称
* @param {string} key 待获取的 key
* @returns {Any}
*/
getPrevData(A, e) {
var t;
return (t = this.storeMap[A]) == null ? void 0 : t.getPrevData(e);
}
/**
* 获取 Store 数据
* @param {StoreName} storeName store 名称
* @param {string} key 待获取的 key
* @returns {Any}
*/
getData(A, e) {
var t;
return (t = this.storeMap[A]) == null ? void 0 : t.getData(e);
}
/**
* UI 组件注册监听回调
* @param {StoreName} storeName store 名称
* @param {string} key 变更的 key
*/
notify(A, e) {
if (!this.task[A])
return;
const t = this.task[A];
if (t[e]) {
const o = t[e], i = this.getData(A, e);
for (const [s] of o.entries())
s.call(this, i);
}
}
reset(A, e = [], t = !1) {
if (A in this.storeMap) {
const o = this.storeMap[A];
e.length === 0 && (e = Object.keys(o == null ? void 0 : o.store)), o.reset(e), t && e.forEach((i) => {
this.notify(A, i);
});
}
}
// 批量修改多个 key-value
updateStore(A, e) {
const t = e || u.CALL;
Object.keys(A).forEach((o) => {
this.update(t, o, A[o]);
});
}
};
const eA = at.getInstance();
function ht(a, A) {
const e = {
userId: a,
nick: "",
avatar: "",
remark: "",
displayUserInfo: "",
isAudioAvailable: !1,
isVideoAvailable: !1,
isEnter: !1,
domId: A || a
};
return A ? e : { ...e, isEnter: !1 };
}
async function pn(a, A) {
var t, o, i, s, c;
let e = ht(a, l.LOCAL_VIDEO);
try {
if (!A)
return e;
const r = await A.getMyProfile(), d = eA == null ? void 0 : eA.getData(u.CALL, l.LOCAL_USER_INFO);
return (r == null ? void 0 : r.code) === 0 && (e = {
...e,
...d,
userId: (t = r == null ? void 0 : r.data) == null ? void 0 : t.userID,
nick: (o = r == null ? void 0 : r.data) == null ? void 0 : o.nick,
avatar: (i = r == null ? void 0 : r.data) == null ? void 0 : i.avatar,
displayUserInfo: ((s = r == null ? void 0 : r.data) == null ? void 0 : s.nick) || ((c = r == null ? void 0 : r.data) == null ? void 0 : c.userID)
}), e;
} catch (r) {
return console.error(`${l.PREFIX}getMyProfile failed, error: ${r}.`), e;
}
}
async function Ve(a, A) {
let e = a.map((t) => ht(t));
try {
if (!A)
return e;
const t = await A.getFriendProfile({ userIDList: a });
if (t.code === 0) {
const { friendList: o = [], failureUserIDList: i = [] } = t.data;
let s = i.map((g) => g.userID);
if (i.length > 0) {
const g = await A.getUserProfile({ userIDList: i.map((N) => N.userID) });
(g == null ? void 0 : g.code) === 0 && (s = (g == null ? void 0 : g.data) || []);
}
const c = eA == null ? void 0 : eA.getData(u.CALL, l.REMOTE_USER_INFO_LIST), r = o.map((g) => g.userID), d = s.map((g) => g.userID);
e = a.map((g) => {
var q, b, Q, R, Z, K, dA;
const N = ht(g), C = r.indexOf(g), p = d.indexOf(g);
let y = "", m = "", D = "", j = "";
C !== -1 && (y = ((q = o[C]) == null ? void 0 : q.remark) || "", m = ((Q = (b = o[C]) == null ? void 0 : b.profile) == null ? void 0 : Q.nick) || "", D = y || m || N.userId || "", j = ((Z = (R = o[C]) == null ? void 0 : R.profile) == null ? void 0 : Z.avatar) || ""), p !== -1 && (m = ((K = s[p]) == null ? void 0 : K.nick) || "", D = m || N.userId || "", j = ((dA = s[p]) == null ? void 0 : dA.avatar) || "");
const k = c.find((vA) => vA.userId === g) || {};
return { ...N, ...k, remark: y, nick: m, displayUserInfo: D, avatar: j };
});
}
return e;
} catch (t) {
return console.error(`${l.PREFIX}getRemoteUserProfile failed, error: ${t}.`), e;
}
}
function Ge() {
const a = eA.getData(u.CALL, l.CALL_STATUS);
if (a === x.IDLE)
return fA.IDLE;
const A = eA.getData(u.CALL, l.IS_GROUP);
if (a === x.CALLING)
return A ? fA.DIALING_GROUP : fA.DIALING_C2C;
const e = eA.getData(u.CALL, l.CALL_MEDIA_TYPE);
return A ? e === _.AUDIO ? fA.CALLING_GROUP_AUDIO : fA.CALLING_GROUP_VIDEO : e === _.AUDIO ? fA.CALLING_C2C_AUDIO : fA.CALLING_C2C_VIDEO;
}
async function Nn(a, A, e, t) {
let o = [];
try {
const i = await A.getGroupMemberList({ groupID: a, count: e, offset: t });
if (i.code === 0)
return i.data.memberList || o;
} catch (i) {
return console.error(`${l.PREFIX}getGroupMember failed, error: ${i}.`), o;
}
}
async function Cn(a, A) {
let e = {};
try {
return (await A.getGroupProfile({ groupID: a })).data.group || e;
} catch (t) {
return console.warn(`${l.PREFIX}getGroupProfile failed, error: ${t}.`), e;
}
}
function ga(a, A) {
a === 0 && A ? (eA.update(u.CALL, l.ROOM_ID, A), eA.update(u.CALL, l.ROOM_ID_TYPE, Lt.STRING_ROOM_ID)) : (eA.update(u.CALL, l.ROOM_ID, a), eA.update(u.CALL, l.ROOM_ID_TYPE, Lt.NUMBER_ROOM_ID));
}
function PA(a) {
return a || {};
}
function It(a) {
if (a.length === 0)
return;
let A = eA.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
a.forEach((e) => {
A = A.filter((t) => t.userId !== e);
}), eA.update(u.CALL, l.REMOTE_USER_INFO_LIST, A), eA.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, A);
}
function gt(a) {
a == null || a.getDeviceList("speaker").then((e) => {
const t = eA.getData(u.CALL, l.DEVICE_LIST), o = (e == null ? void 0 : e[0]) || {};
eA.update(
u.CALL,
l.DEVICE_LIST,
{ ...t, speakerList: e, currentSpeaker: o }
);
}).catch((e) => {
console.error(`${l.PREFIX}updateSpeakerList failed, error: ${JSON.stringify(e)}.`);
}), eA.getData(u.CALL, l.CALL_MEDIA_TYPE) === _.VIDEO && (a == null || a.getDeviceList("camera").then((e) => {
const t = eA.getData(u.CALL, l.DEVICE_LIST), o = (e == null ? void 0 : e[0]) || {};
eA.update(
u.CALL,
l.DEVICE_LIST,
{ ...t, cameraList: e, currentCamera: o }
);
}).catch((e) => {
console.error(`${l.PREFIX}updateCameraList failed, error: ${e}.`);
})), a == null || a.getDeviceList("microphones").then((e) => {
const t = eA.getData(u.CALL, l.DEVICE_LIST), o = (e == null ? void 0 : e[0]) || {};
eA.update(
u.CALL,
l.DEVICE_LIST,
{ ...t, microphoneList: e, currentMicrophone: o }
);
}).catch((e) => {
console.error(`${l.PREFIX}updateMicrophoneList failed, error: ${e}.`);
});
}
function Mt(a, A, e) {
let t = "";
if (on(a)) {
A === _.AUDIO && (t = DA.NO_MICROPHONE_DEVICE_PERMISSION), A === _.VIDEO && (t = DA.NO_CAMERA_DEVICE_PERMISSION);
const o = e == null ? void 0 : e.getDevicePermission();
o != null && o.audio || eA.update(u.CALL, l.SHOW_PERMISSION_TIP, !0), t && eA.update(u.CALL, l.TOAST_INFO, { content: t, type: l.ERROR }), console.error(`${l.PREFIX}call failed, error: ${a.message}.`);
}
}
function ne(a, A) {
let e = eA.getData(u.CALL, l.LOCAL_USER_INFO);
A === l.AUDIO && (e = { ...e, isAudioAvailable: a }), A === l.VIDEO && (e = { ...e, isVideoAvailable: a }), eA.update(u.CALL, l.LOCAL_USER_INFO, e), eA.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, e);
}
class Ke {
static generateTaskID() {
return this.currentTaskID++;
}
/**
*
* @param {string} taskName 'interval' 'timeout'
* @param {function} callback
* @param {object} options include:
* @param {number} options.delay millisecond
* @param {number} options.count 定时器回调执行次数0 无限次 or n次
* @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器
*/
static run(A = l.TIMEOUT, e, t) {
A === l.INTERVAL ? t = { delay: 2e3, count: 0, backgroundTask: !0, ...t } : t = { delay: 2e3, count: 0, backgroundTask: !0, ...t }, Dt(e) && (t = { ...t, ...e }), Qe(A) && (e = A, A = l.TIMEOUT);
const o = {
taskID: this.generateTaskID(),
loopCount: 0,
intervalID: null,
timeoutID: null,
taskName: A,
callback: e,
...t
};
return this.taskMap.set(o.taskID, o), A === l.INTERNAL ? this.interval(o) : this.timeout(o), o.taskID;
}
/**
* 定时循环执行回调函数
* 可以指定循环的时间间隔
* 可以指定循环次数
* @param {object} taskItem
* @param {function} callback
* @param {*} delay
* @param {*} count
* @returns ID
*/
static interval(A) {
const e = () => {
A.callback(), A.loopCount += 1, this.isBreakLoop(A);
};
return A.intervalID = setInterval(e, A.delay);
}
/**
* 延迟执行回调
* count = 0,循环
* count = n, 执行n次
* @param {object} taskItem
*
*/
static timeout(A) {
const e = () => {
if (A.callback(), A.loopCount += 1, !this.isBreakLoop(A))
return A.timeoutID = setTimeout(e, A.delay);
};
return A.timeoutID = setTimeout(e, A.delay);
}
static hasTask(A) {
return this.taskMap.has(A);
}
static clearTask(A) {
if (!this.taskMap.has(A))
return !0;
const { intervalID: e, timeoutID: t, onVisibilitychange: o } = this.taskMap.get(A);
return e && clearInterval(e), t && clearTimeout(t), o && document.removeEventListener("visibilitychange", o), this.taskMap.delete(A), !0;
}
/**
* 1. 如果已移除出定时队列退出当前任务
* 2. 如果当前任务已满足次数限制则退出当前任务
* @param {object} taskItem
* @returns
*/
static isBreakLoop(A) {
return this.taskMap.has(A.taskID) ? A.count !== 0 && A.loopCount >= A.count ? (this.clearTask(A.taskID), !0) : !1 : !0;
}
}
Ke.taskMap = /* @__PURE__ */ new Map();
Ke.currentTaskID = 1;
const Ln = function(a) {
if (a === null || typeof a > "u")
return !0;
if (typeof a == "boolean")
return !1;
if (typeof a == "number")
return a === 0;
if (typeof a == "string" || typeof a == "function" || Array.isArray(a))
return a.length === 0;
if (a instanceof Error)
return a.message === "";
if (Dt(a)) {
for (const A in a)
if (Object.prototype.hasOwnProperty.call(a, A))
return !1;
return !0;
}
return !1;
}, pt = "_local_user_id";
class re {
constructor() {
this._viewConfig = {
viewBackground: {
local: {},
remote: {}
}
}, this._isSetViewBackgroundConfig = { remote: !1, local: !1 }, this._tuiCallEngine = null, this._tuiStore = null;
}
static getInstance() {
return re.instance || (re.instance = new re()), re.instance;
}
_updateViewBackground() {
var t, o, i;
const A = (t = this._tuiStore) == null ? void 0 : t.getData(u.CALL, l.CUSTOM_UI_CONFIG), { userId: e } = (o = this._tuiStore) == null ? void 0 : o.getData(u.CALL, l.LOCAL_USER_INFO);
Object.keys(this._viewConfig.viewBackground.remote).includes(e) && delete this._viewConfig.viewBackground.remote[e], (i = this._tuiStore) == null || i.update(
u.CALL,
l.CUSTOM_UI_CONFIG,
{
...A,
viewBackground: {
...this._viewConfig.viewBackground.remote,
...this._viewConfig.viewBackground.local
}
}
);
}
setEngineInstance(A) {
this._tuiCallEngine = A;
}
setTUIStore(A) {
this._tuiStore = A;
}
updateViewBackgroundUserId(A) {
var e, t;
if (A === "local") {
const { userId: o } = (e = this._tuiStore) == null ? void 0 : e.getData(u.CALL, l.LOCAL_USER_INFO);
if (Object.keys(this._viewConfig.viewBackground.remote).includes(o) && (delete this._viewConfig.viewBackground.remote[o], this._updateViewBackground()), !this._isSetViewBackgroundConfig.local)
return;
const i = this._viewConfig.viewBackground.local, s = i[o] || i[pt];
i[o] = i[pt], this._viewConfig.viewBackground.local = { [o]: s }, this._updateViewBackground();
} else {
let o = this._viewConfig.viewBackground.remote;
this._isSetViewBackgroundConfig.remote && Object.keys(o).includes("*") && (((t = this._tuiStore) == null ? void 0 : t.getData(u.CALL, l.REMOTE_USER_INFO_LIST)).map((c) => c.userId).forEach((c) => {
Object.keys(o).includes(c) || (o[c] = o["*"]);
}), this._viewConfig.viewBackground.remote = o, this._updateViewBackground());
}
}
hideFeatureButton(A) {
var t, o, i, s, c;
(o = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.hideFeatureButton.start",
data: { buttonName: A }
});
const e = (i = this._tuiStore) == null ? void 0 : i.getData(u.CALL, l.CUSTOM_UI_CONFIG);
(c = this._tuiStore) == null || c.update(
u.CALL,
l.CUSTOM_UI_CONFIG,
{
...e,
button: {
...e.button,
[A]: { ...((s = e.button) == null ? void 0 : s[A]) || {}, show: !1 }
}
}
);
}
setLocalViewBackgroundImage(A) {
var t, o, i;
(o = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.setLocalViewBackgroundImage.start",
data: { url: A }
}), this._isSetViewBackgroundConfig.local = !0;
let { userId: e } = (i = this._tuiStore) == null ? void 0 : i.getData(u.CALL, l.LOCAL_USER_INFO);
Ln(e) && (e = pt), this._viewConfig.viewBackground.local = { [e]: A }, this._updateViewBackground();
}
setRemoteViewBackgroundImage(A, e) {
var t, o;
(o = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.setRemoteViewBackgroundImage.start",
data: { userId: A, url: e }
}), this._isSetViewBackgroundConfig.remote = !0, A === "*" && (this._viewConfig.viewBackground.remote = {}), this._viewConfig.viewBackground.remote[A] = e, this._updateViewBackground();
}
setLayoutMode(A) {
var t, o;
(o = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.setLayoutMode.start",
data: { layoutMode: A }
});
const e = this._tuiStore.getData(u.CALL, l.CUSTOM_UI_CONFIG);
this._tuiStore.update(
u.CALL,
l.CUSTOM_UI_CONFIG,
{
...e,
layoutMode: A
}
);
}
setCameraDefaultState(A) {
var t, o;
(o = (t = this._tuiCallEngine) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.setCameraDefaultState.start",
data: { isOpen: A }
});
const e = Ze(this._tuiStore.getData(u.CALL, l.CUSTOM_UI_CONFIG));
Object.keys(e.button).includes(_A.Camera) || (e.button[_A.Camera] = {}), e.button[_A.Camera].state = A ? Ce.Open : Ce.Close, this._tuiStore.update(u.CALL, l.CUSTOM_UI_CONFIG, e);
}
}
const ke = at.getInstance(), xA = {
audioCall: () => "Voice call",
videoCall: () => "Video call",
switchToAudio: () => "Switch audio call",
switchToVideo: () => "Switch video call",
hangup: ({ callDuration: a }) => `${de("Call duration")}${a}`
};
class Ne {
constructor(A) {
var e, t, o;
this._callService = A.callService, fe.registerEvent(IA.TUILogin.EVENT.LOGIN_STATE_CHANGED, IA.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this), (e = IA.TUIChat) != null && e.EVENT && fe.registerEvent((t = IA.TUIChat.EVENT) == null ? void 0 : t.CHAT_STATE_CHANGED, (o = IA.TUIChat.EVENT_SUB_KEY) == null ? void 0 : o.CHAT_OPENED, this), fe.registerService(IA.TUICalling.SERVICE.NAME, this), fe.registerExtension(IA.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this);
}
static getInstance(A) {
return Ne.instance || (Ne.instance = new Ne(A)), Ne.instance;
}
// ================ 【】 ================
/**
* message on screen
* @param {Any} params Parameters for message up-screening
*/
callTUIService(A) {
const { message: e } = A || {};
fe.callService({
serviceName: IA.TUIChat.SERVICE.NAME,
method: IA.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST,
params: { message: e }
});
}
/**
* tuicore getExtension
* @param {String} extensionID extension id
* @param {Any} params tuicore pass parameters
* @returns {Any[]} return extension
*/
onGetExtension(A, e) {
var t, o;
if (A === IA.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) {
if ((o = (t = this._callService.getTUICallEngineInstance()) == null ? void 0 : t.reportLog) == null || o.call(t, { name: "TUICallKit.onGetExtension", data: { extensionID: A, params: e } }), et(e))
return [];
if ([IA.TUIChat.TYPE.ROOM, IA.TUIChat.TYPE.CUSTOMER_SERVICE].includes(e.chatType))
return [];
let i = [];
const s = {
weight: 1e3,
text: "语音通话",
icon: ko,
data: {
name: "voiceCall"
},
listener: {
onClicked: async (r) => await this._handleTUICoreOnClick(r, r.type || _.AUDIO)
}
}, c = {
weight: 900,
text: "视频通话",
icon: qo,
data: {
name: "videoCall"
},
listener: {
onClicked: async (r) => await this._handleTUICoreOnClick(r, r.type || _.VIDEO)
}
};
return e != null && e.chatType ? i = [s, c] : (!(e != null && e.filterVoice) && i.push(s), !(e != null && e.filterVideo) && i.push(c)), i;
}
}
async onCall(A, e) {
A === IA.TUICalling.SERVICE.METHOD.START_CALL && await this._handleTUICoreOnClick(e, e.type);
}
/**
* tuicore notify event manager
* @param {String} eventName event name
* @param {String} subKey sub key
* @param {Any} options tuicore event parameters
*/
async onNotifyEvent(A, e, t) {
var o, i, s, c, r, d, g, N;
try {
if (A === IA.TUILogin.EVENT.LOGIN_STATE_CHANGED)
if (e === IA.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) {
const { chat: C, userID: p, userSig: y, SDKAppID: m } = bo.getContext();
await ((o = this._callService) == null ? void 0 : o.init({ tim: C, userID: p, userSig: y, sdkAppID: m, isFromChat: !0, component: Tt.TIM_CALL_KIT })), (i = this._callService) == null || i.setIsFromChat(!0), (s = this._callService) == null || s.setLogLevel(na.NORMAL), this._addListenChatEvent();
} else
e === IA.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS && (this._removeListenChatEvent(), await ((c = this._callService) == null ? void 0 : c.destroyed()));
if ((r = IA.TUIChat) != null && r.EVENT && A === IA.TUIChat.EVENT.CHAT_STATE_CHANGED && e === IA.TUIChat.EVENT_SUB_KEY.CHAT_OPENED) {
if ((d = this._callService) == null || d.setCurrentGroupId((t == null ? void 0 : t.groupID) || ""), ke.getData(u.CALL, l.CALL_STATUS) !== x.IDLE)
return;
const C = (g = this._callService) == null ? void 0 : g.getCurrentGroupId(), p = C ? await this.getGroupAttributes((N = this._callService) == null ? void 0 : N.getTim(), C) : {};
await this.updateStoreBasedOnGroupAttributes(p);
}
} catch (C) {
console.error(`${l.PREFIX}TUICore onNotifyEvent failed, error: ${C}.`);
}
}
// Handling the chat+call scenario, data required for the joinInGroupCall API: update store / clear relevant store data
async updateStoreBasedOnGroupAttributes(A) {
var e, t, o, i;
(o = (t = (e = this._callService) == null ? void 0 : e.getTUICallEngineInstance()) == null ? void 0 : t.reportLog) == null || o.call(t, {
name: "TUICallKit.getJoinGroupCallInfo.success",
data: { groupAttributes: A }
});
try {
const {
group_id: s = "",
room_id: c = 0,
room_id_type: r = 0,
call_media_type: d = l.UNKNOWN,
// @ts-ignore
user_list: g
// The default value of the user list returned by the background is null
} = A[l.INNER_ATTR_KIT_INFO] ? JSON.parse(A[l.INNER_ATTR_KIT_INFO]) : {};
let N = (g || []).map((p) => p.userid);
N = N.length && await Ve(N, (i = this._callService) == null ? void 0 : i.getTim());
const C = {
[l.GROUP_ID]: s,
[l.GROUP_CALL_MEMBERS]: N,
[l.ROOM_ID]: c,
[l.CALL_MEDIA_TYPE]: Bo[d],
[l.ROOM_ID_TYPE]: r
};
ke.updateStore(C, u.CALL);
} catch (s) {
console.warn(`${l.PREFIX}updateStoreBasedOnGroupAttributes fail, error: ${s}`);
}
}
// Get group attribute
async getGroupAttributes(A, e) {
if (!e)
return {};
try {
const { data: t } = await A.getGroupAttributes({
groupID: e,
keyList: []
});
return (t == null ? void 0 : t.groupAttributes) || {};
} catch (t) {
return console.warn(`${l.PREFIX}getGroupAttributes fail: ${t}`), {};
}
}
isLineBusy(A) {
var o;
const e = Re(A.payload.data), t = Re(e == null ? void 0 : e.data);
return (t == null ? void 0 : t.line_busy) === "line_busy" || (t == null ? void 0 : t.line_busy) === "" || ((o = t == null ? void 0 : t.data) == null ? void 0 : o.message) === "lineBusy";
}
async getCallKitMessage(A, e) {
var C, p, y, m;
const t = Re(A.payload.data);
if ((t == null ? void 0 : t.businessID) !== 1)
return {};
let o = "";
const i = Re(t == null ? void 0 : t.data), s = i.call_type, c = t.inviteeList, r = (C = i == null ? void 0 : i.data) == null ? void 0 : C.inviter, d = ke.getData(u.CALL, l.LOCAL_USER_INFO).userId, g = r === d, N = (p = i == null ? void 0 : i.data) == null ? void 0 : p.cmd;
switch (t == null ? void 0 : t.actionType) {
case Me.INVITE: {
o = xA[N]({ callDuration: Ia(i == null ? void 0 : i.call_end) });
break;
}
case Me.CANCEL_INVITE:
o = g ? "Call Cancel" : "Other Side Cancel";
break;
case Me.ACCEPT_INVITE:
["switchToAudio", "switchToVideo"].includes(N) ? o = (y = xA == null ? void 0 : xA[N]) == null ? void 0 : y.call(xA) : o = de("Answered");
break;
case Me.REJECT_INVITE:
this.isLineBusy(A) ? o = g ? "Line Busy" : "Other Side Line Busy" : o = g ? "Other Side Decline" : "Decline";
break;
case Me.INVITE_TIMEOUT:
["switchToAudio", "switchToVideo"].includes(N) ? o = (m = xA == null ? void 0 : xA[N]) == null ? void 0 : m.call(xA) : o = g ? "Other Side No Answer" : "No answer";
break;
}
return { messageCardContent: o, callMediaType: s, inviteeList: c };
}
// =========================【chat: event listening】=========================
_addListenChatEvent() {
var A, e;
if (!((A = this._callService) != null && A.getTim())) {
console.warn(`${l.PREFIX}add tim event listener failed, tim is empty.`);
return;
}
(e = this._callService) == null || e.getTim().on(Pt.EVENT.GROUP_ATTRIBUTES_UPDATED, this._handleGroupAttributesUpdated, this);
}
_removeListenChatEvent() {
var A, e;
if (!((A = this._callService) != null && A.getTim())) {
console.warn(`${l.PREFIX}remove tim event listener failed, tim is empty.`);
return;
}
(e = this._callService) == null || e.getTim().off(Pt.EVENT.GROUP_ATTRIBUTES_UPDATED, this._handleGroupAttributesUpdated, this);
}
/**
* chat start audio/video call via click
* @param {Any} options Parameters passed in when clicking on an audio/video call from chat
* @param {CallMediaType} type call media type. 0 - audio; 1 - video.
*/
async _handleTUICoreOnClick(A, e) {
var t, o;
try {
const { groupID: i, userIDList: s = [], ...c } = A;
i ? await ((t = this._callService) == null ? void 0 : t.groupCall({ groupID: i, userIDList: s, type: e, ...c })) : s.length === 1 && await ((o = this._callService) == null ? void 0 : o.call({ userID: s[0], type: e, ...c }));
} catch (i) {
console.debug(i);
}
}
async _handleGroupAttributesUpdated(A) {
var i;
if (ke.getData(u.CALL, l.CALL_STATUS) !== x.IDLE)
return;
const e = (A == null ? void 0 : A.data) || {}, { groupID: t = "", groupAttributes: o = {} } = e;
t === ((i = this._callService) == null ? void 0 : i.getCurrentGroupId()) && await this.updateStoreBasedOnGroupAttributes(o);
}
}
const hn = 0, Sn = 1, Qt = 2;
function yn({ retryFunction: a, settings: A, onError: e, onRetrying: t, onRetryFailed: o, context: i }) {
return function(...s) {
const c = A.retries || 5;
let r = 0, d = -1, g = hn;
const N = async (C, p) => {
const y = i || this;
try {
const m = await a.apply(y, s);
r = 0, C(m);
} catch (m) {
const D = () => {
clearTimeout(d), r = 0, g = Qt, p(m);
}, j = () => {
g !== Qt && r < c ? (r++, g = Sn, Qe(t) && t.call(y, r, D), d = setTimeout(
() => {
d = -1, N(C, p);
},
et(A.timeout) ? 1e3 : A.timeout
)) : (D(), Qe(o) && o.call(y, m));
};
Qe(e) ? e.call(y, m, j, p, s) : j();
}
};
return new Promise(N);
};
}
function fn(a) {
return function(A, e, t) {
const { retries: o = 5, timeout: i = 2e3, onError: s, onRetrying: c, onRetryFailed: r } = a, d = yn({
retryFunction: t.value,
settings: { retries: o, timeout: i },
onError: s,
onRetrying: c,
onRetryFailed: r,
context: null
});
return t.value = function(...g) {
return d.apply(this, g);
}, t;
};
}
var mn = Object.defineProperty, Tn = Object.getOwnPropertyDescriptor, vn = (a, A, e, t) => {
for (var o = t > 1 ? void 0 : t ? Tn(A, e) : A, i = a.length - 1, s; i >= 0; i--)
(s = a[i]) && (o = (t ? s(A, e, o) : s(o)) || o);
return t && o && mn(A, e, o), o;
};
const Y = at.getInstance(), Dn = re.getInstance(), Ma = class Ee {
constructor(A) {
this._callService = A.callService;
}
static getInstance(A) {
return Ee.instance || (Ee.instance = new Ee(A)), Ee.instance;
}
addListenTuiCallEngineEvent() {
var e;
const A = (e = this._callService) == null ? void 0 : e.getTUICallEngineInstance();
if (!A) {
console.warn(`${l.PREFIX}add engine event listener failed, engine is empty.`);
return;
}
A.on(P.ERROR, this._handleError, this), A.on(P.INVITED, this._handleNewInvitationReceived, this), A.on(P.USER_ACCEPT, this._handleUserAccept, this), A.on(P.USER_ENTER, this._handleUserEnter, this), A.on(P.USER_LEAVE, this._handleUserLeave, this), A.on(P.REJECT, this._handleInviteeReject, this), A.on(P.NO_RESP, this._handleNoResponse, this), A.on(P.LINE_BUSY, this._handleLineBusy, this), A.on(P.CALLING_CANCEL, this._handleCallingCancel, this), A.on(P.SDK_READY, this._handleSDKReady, this), A.on(P.KICKED_OUT, this._handleKickedOut, this), A.on(P.MESSAGE_SENT_BY_ME, this._messageSentByMe, this), P.CALL_MESSAGE && A.on(P.CALL_MESSAGE, this._handleCallMessage, this), P.ON_USER_NETWORK_QUALITY_CHANGED && A.on(P.ON_USER_NETWORK_QUALITY_CHANGED, this._handleNetworkQuality, this), A.on(P.CALLING_END, this._handleCallingEnd, this), A.on(P.CALL_TYPE_CHANGED, this._handleCallTypeChange, this), A.on(P.USER_VIDEO_AVAILABLE, this._handleUserVideoAvailable, this), A.on(P.USER_AUDIO_AVAILABLE, this._handleUserAudioAvailable, this), A.on(P.USER_VOICE_VOLUME, this._handleUserVoiceVolume, this), A.on(P.DEVICED_UPDATED, this._handleDeviceUpdate, this);
}
removeListenTuiCallEngineEvent() {
var e;
const A = (e = this._callService) == null ? void 0 : e.getTUICallEngineInstance();
A.off(P.ERROR, this._handleError, this), A.off(P.INVITED, this._handleNewInvitationReceived, this), A.off(P.USER_ACCEPT, this._handleUserAccept, this), A.off(P.USER_ENTER, this._handleUserEnter, this), A.off(P.USER_LEAVE, this._handleUserLeave, this), A.off(P.REJECT, this._handleInviteeReject, this), A.off(P.NO_RESP, this._handleNoResponse, this), A.off(P.LINE_BUSY, this._handleLineBusy, this), A.off(P.CALLING_CANCEL, this._handleCallingCancel, this), A.off(P.SDK_READY, this._handleSDKReady, this), A.off(P.KICKED_OUT, this._handleKickedOut, this), A.off(P.MESSAGE_SENT_BY_ME, this._messageSentByMe, this), P.ON_USER_NETWORK_QUALITY_CHANGED && A.off(P.ON_USER_NETWORK_QUALITY_CHANGED, this._handleNetworkQuality, this), A.off(P.CALLING_END, this._handleCallingEnd, this), A.off(P.CALL_TYPE_CHANGED, this._handleCallTypeChange, this), A.off(P.USER_VIDEO_AVAILABLE, this._handleUserVideoAvailable, this), A.off(P.USER_AUDIO_AVAILABLE, this._handleUserAudioAvailable, this), A.off(P.USER_VOICE_VOLUME, this._handleUserVoiceVolume, this), A.off(P.DEVICED_UPDATED, this._handleDeviceUpdate, this);
}
_callerChangeToConnected() {
var t;
const A = Y.getData(u.CALL, l.CALL_ROLE);
Y.getData(u.CALL, l.CALL_STATUS) === x.CALLING && A === gA.CALLER && (Y.update(u.CALL, l.CALL_STATUS, x.CONNECTED), (t = this._callService) == null || t.startTimer());
}
_unNormalEventsManager(A, e) {
var i;
console.log(`${l.PREFIX}${e} event data: ${JSON.stringify(A)}.`);
const t = Y.getData(u.CALL, l.IS_GROUP), o = Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
switch (e) {
case P.REJECT:
case P.LINE_BUSY: {
const { userID: s } = PA(A);
let c = e === P.REJECT ? DA.OTHER_SIDE_REJECT_CALL : DA.OTHER_SIDE_LINE_BUSY, r = "";
t && (r = (o.find((d) => d.userId === s) || {}).displayUserInfo || s, c = e === P.REJECT ? DA.REJECT_CALL : DA.IN_BUSY), Y.update(u.CALL, l.TOAST_INFO, { content: { key: c, options: { userList: r } } }), s && It([s]);
break;
}
case P.NO_RESP: {
const { userIDList: s = [] } = PA(A), c = t ? DA.TIMEOUT : DA.CALL_TIMEOUT, r = s.map((d) => (o.find((N) => N.userId === d) || {}).displayUserInfo || d);
Y.update(u.CALL, l.TOAST_INFO, { content: { key: c, options: { userList: r.join() } } }), s.length > 0 && It(s);
break;
}
case P.CALLING_CANCEL: {
(i = this._callService) == null || i._resetCallStore();
break;
}
}
}
_handleError(A) {
var s;
const { code: e, message: t } = A || {}, o = Object.values(Bt).indexOf(e);
let i = "";
if (o !== -1) {
const c = Object.keys(Bt)[o];
i = de(Rt[c]), i && Y.update(u.CALL, l.TOAST_INFO, { content: Rt[c], type: l.ERROR });
}
(s = this._callService) == null || s.executeExternalAfterCalling(), console.error(`${l.PREFIX}_handleError, errorCode: ${e}; errorMessage: ${i || t}.`);
}
async _handleNewInvitationReceived(A) {
var j, k, q, b;
console.log(`${l.PREFIX}onCallReceived event data: ${JSON.stringify(A)}.`);
const { sponsor: e = "", isFromGroup: t, callMediaType: o, inviteData: i = {}, calleeIdList: s = [], groupID: c = "", roomID: r, strRoomID: d } = PA(A), g = Y.getData(u.CALL, l.LOCAL_USER_INFO), N = [e, ...s.filter((Q) => Q !== g.userId)], C = o || i.callType, p = C === _.AUDIO ? DA.CALLEE_CALLING_AUDIO_MSG : DA.CALLEE_CALLING_VIDEO_MSG;
let y = {
[l.CALL_ROLE]: gA.CALLEE,
[l.IS_GROUP]: t,
[l.CALL_STATUS]: x.CALLING,
[l.CALL_MEDIA_TYPE]: C,
[l.CALL_TIPS]: p,
[l.CALLER_USER_INFO]: { userId: e },
[l.GROUP_ID]: c
};
ga(r, d), Y.updateStore(y, u.CALL), (j = this._callService) == null || j.executeExternalBeforeCalling(), (k = this._callService) != null && k.statusChanged && ((q = this._callService) == null || q.statusChanged({ oldStatus: fA.IDLE, newStatus: fA.BE_INVITED }));
const m = await Ve(N, (b = this._callService) == null ? void 0 : b.getTim()), [D] = m.filter((Q) => Q.userId === e);
m.length > 0 && Y.updateStore({
[l.REMOTE_USER_INFO_LIST]: m,
[l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: m,
[l.CALLER_USER_INFO]: {
userId: e,
nick: (D == null ? void 0 : D.nick) || "",
avatar: (D == null ? void 0 : D.avatar) || "",
displayUserInfo: (D == null ? void 0 : D.remark) || (D == null ? void 0 : D.nick) || e
}
}, u.CALL);
}
_handleUserAccept(A) {
this._callerChangeToConnected(), Y.update(u.CALL, l.CALL_TIPS, { text: "answered", duration: 2e3 }), console.log(`${l.PREFIX}accept event data: ${JSON.stringify(A)}.`);
}
async _handleUserEnter(A) {
var s;
this._callerChangeToConnected();
const { userID: e, data: t } = PA(A);
let o = Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
if (!o.find((c) => (c == null ? void 0 : c.userId) === e)) {
o.push({ userId: e }), o.length > 0 && (Y.update(u.CALL, l.REMOTE_USER_INFO_LIST, o), Y.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, o));
const [c] = await Ve([e], (s = this._callService) == null ? void 0 : s.getTim());
o = Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST), o.forEach((r) => {
(r == null ? void 0 : r.userId) === e && (r = Object.assign(r, c));
});
}
o = o.map((c) => (c.userId === e && (c.isEnter = !0), c)), o.length > 0 && (Y.update(u.CALL, l.REMOTE_USER_INFO_LIST, o), Y.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, o), Dn.updateViewBackgroundUserId("remote")), console.log(`${l.PREFIX}userEnter event data: ${JSON.stringify(A)}.`);
}
_handleUserLeave(A) {
console.log(`${l.PREFIX}userLeave event data: ${JSON.stringify(A)}.`);
const { data: e, userID: t } = PA(A);
if (Y.getData(u.CALL, l.IS_GROUP)) {
const i = (Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST).find((s) => s.userId === t) || {}).displayUserInfo || t;
Y.update(u.CALL, l.TOAST_INFO, { content: { key: DA.END_CALL, options: { userList: i } } });
}
t && It([t]);
}
_handleInviteeReject(A) {
this._unNormalEventsManager(A, P.REJECT);
}
_handleNoResponse(A) {
this._unNormalEventsManager(A, P.NO_RESP);
}
_handleLineBusy(A) {
this._unNormalEventsManager(A, P.LINE_BUSY);
}
_handleCallingCancel(A) {
var e;
(e = this._callService) == null || e.executeExternalAfterCalling(), this._unNormalEventsManager(A, P.CALLING_CANCEL);
}
_handleCallingEnd(A) {
var e, t;
console.log(`${l.PREFIX}callEnd event data: ${JSON.stringify(A)}.`), (e = this._callService) == null || e.executeExternalAfterCalling(), (t = this._callService) == null || t._resetCallStore();
}
// SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY
async _handleSDKReady(A) {
var t;
let e = Y.getData(u.CALL, l.LOCAL_USER_INFO);
e = await pn(e.userId, (t = this._callService) == null ? void 0 : t.getTim()), Y.update(u.CALL, l.LOCAL_USER_INFO, e), Y.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, e);
}
_handleKickedOut(A) {
var e, t, o;
console.log(`${l.PREFIX}kickOut event data: ${JSON.stringify(A)}.`), (e = this._callService) != null && e.kickedOut && ((t = this._callService) == null || t.kickedOut(A)), Y.update(u.CALL, l.CALL_TIPS, DA.KICK_OUT), (o = this._callService) == null || o._resetCallStore();
}
_messageSentByMe(A) {
var t, o;
const e = A == null ? void 0 : A.data;
(t = this._callService) != null && t.onMessageSentByMe && ((o = this._callService) == null || o.onMessageSentByMe(e));
}
_handleCallMessage(A) {
const e = PA(A);
this._callService._chatCombine.callTUIService({ message: e });
}
_handleCallTypeChange(A) {
const { newCallType: e, type: t } = PA(A);
Y.update(u.CALL, l.CALL_MEDIA_TYPE, e || t);
}
_handleNetworkQuality(A) {
const { networkQualityList: e = [] } = PA(A);
Y.update(u.CALL, l.NETWORK_STATUS, e);
const t = Y.getData(u.CALL, l.IS_GROUP), o = Y.getData(u.CALL, l.LOCAL_USER_INFO);
if (Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST), !t && e.find((s) => (o == null ? void 0 : o.userId) === (s == null ? void 0 : s.userId) && (s == null ? void 0 : s.quality) >= Xo)) {
Y.update(u.CALL, l.CALL_TIPS, DA.LOCAL_NETWORK_IS_POOR);
return;
}
}
async _startRemoteView(A) {
var e;
if (!A) {
console.warn(`${l.PREFIX}_startRemoteView userID is empty`);
return;
}
if (!document.getElementById(A))
return console.warn(`${l.PREFIX}_startRemoteView can't find HTMLElement sid: ${A}`), Promise.reject();
try {
const t = Y.getData(u.CALL, l.DISPLAY_MODE);
await ((e = this._callService) == null ? void 0 : e.getTUICallEngineInstance().startRemoteView({ userID: A, videoViewDomID: A, options: { objectFit: t } }));
} catch (t) {
return console.error(`${l.PREFIX}_startRemoteView error: ${t}.`), Promise.reject(t);
}
}
_setRemoteUserInfoAudioVideoAvailable(A, e, t) {
let o = Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
o = o.map((i) => {
if (i.userId === t) {
if (e === l.AUDIO)
return { ...i, isAudioAvailable: A };
if (e === l.VIDEO)
return { ...i, isVideoAvailable: A };
}
return i;
}), o.length > 0 && (Y.update(u.CALL, l.REMOTE_USER_INFO_LIST, o), Y.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, o));
}
async _handleUserVideoAvailable(A) {
const { userID: e, isVideoAvailable: t } = PA(A);
console.log(`${l.PREFIX}_handleUserVideoAvailable event data: ${JSON.stringify(A)}.`);
try {
t && await this._startRemoteView(e);
} catch (o) {
console.error(`${l.PREFIX}_startRemoteView failed, error: ${o}.`);
}
this._setRemoteUserInfoAudioVideoAvailable(t, l.VIDEO, e);
}
_handleUserAudioAvailable(A) {
const { userID: e, isAudioAvailable: t } = PA(A);
console.log(`${l.PREFIX}_handleUserAudioAvailable event data: ${JSON.stringify(A)}.`), this._setRemoteUserInfoAudioVideoAvailable(t, l.AUDIO, e);
}
_handleUserVoiceVolume(A) {
try {
const { volumeMap: e } = PA(A);
if ((e || []).length === 0)
return;
const t = Y.getData(u.CALL, l.LOCAL_USER_INFO);
let o = Y.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
const [i] = e.filter((r) => r.userId === t.userId), s = e.reduce((r, d) => d.userId !== t.userId ? { ...r, [d.userId]: d.audioVolume } : r, {});
t.volume = i.audioVolume, o = o.map((r) => ({ ...r, volume: s[r.userId] }));
const c = {
[l.LOCAL_USER_INFO]: t,
[l.REMOTE_USER_INFO_LIST]: o
};
Y.updateStore(c, u.CALL);
} catch (e) {
console.debug(e);
}
}
_handleDeviceUpdate(A) {
const { cameraList: e, microphoneList: t, speakerList: o, currentCamera: i, currentMicrophone: s, currentSpeaker: c } = A;
Y.update(u.CALL, l.DEVICE_LIST, { cameraList: e, microphoneList: t, speakerList: o, currentCamera: i, currentMicrophone: s, currentSpeaker: c });
}
};
vn([
fn({
retries: 5,
timeout: 200,
onRetrying(a) {
console.warn(`${l.PREFIX}_startRemoteView, retrying [${a}]`);
}
})
], Ma.prototype, "_startRemoteView", 1);
let wn = Ma;
var En = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, aA = (a, A, e, t) => {
for (var o = t > 1 ? void 0 : t ? jn(A, e) : A, i = a.length - 1, s; i >= 0; i--)
(s = a[i]) && (o = (t ? s(A, e, o) : s(o)) || o);
return t && o && En(A, e, o), o;
};
const O = ca.getInstance(), M = at.getInstance(), ZA = re.getInstance();
ZA.setTUIStore(M);
const Ft = "3.3.9", zn = "vue3", tA = class je {
constructor() {
this._tim = null, this._TUICore = null, this._timerId = -1, this._startTimeStamp = dt(), this._bellContext = null, this._isFromChat = !1, this._currentGroupId = "", this._offlinePushInfo = null, this._permissionCheckTimer = null, this._chatCombine = null, this._engineEventHandler = null, this._handleCallStatusChange = async (A) => {
var e, t, o, i;
try {
const s = {
callRole: M.getData(u.CALL, l.CALL_ROLE),
callStatus: M.getData(u.CALL, l.CALL_STATUS)
};
if (this._bellContext.setBellProperties(s), A === x.CALLING)
await ((e = this == null ? void 0 : this._bellContext) == null ? void 0 : e.play());
else {
if (A === x.CONNECTED) {
const c = M.getData(u.CALL, l.IS_GROUP), r = M.getData(u.CALL, l.CALL_MEDIA_TYPE), d = M.getData(u.CALL, l.REMOTE_USER_INFO_LIST), g = c ? fA.DIALING_GROUP : fA.DIALING_C2C;
M.update(u.CALL, l.CALL_TIPS, ""), this.statusChanged && this.statusChanged({ oldStatus: g, newStatus: Ge() }), !c && r === _.VIDEO && this.switchScreen(d[0].domId);
}
if (A === x.IDLE && this._isFromChat) {
const c = this._currentGroupId ? await ((t = this._chatCombine) == null ? void 0 : t.getGroupAttributes(this._tim, this._currentGroupId)) : {};
await ((o = this._chatCombine) == null ? void 0 : o.updateStoreBasedOnGroupAttributes(c, M, this));
}
await ((i = this == null ? void 0 : this._bellContext) == null ? void 0 : i.stop());
}
} catch (s) {
console.warn(`${l.PREFIX}handleCallStatusChange, ${s}.`);
}
}, console.log(`${l.PREFIX}version: ${Ft}`), this._watchTUIStore(), this._engineEventHandler = wn.getInstance({ callService: this }), this._chatCombine = Ne.getInstance({ callService: this });
}
static getInstance() {
return je.instance || (je.instance = new je()), je.instance;
}
async init(A) {
var e, t;
try {
if (this._tuiCallEngine)
return;
let { userID: o, tim: i, userSig: s, sdkAppID: c, SDKAppID: r, isFromChat: d, component: g = Tt.TUI_CALL_KIT } = A;
this._TUICore && (c = this._TUICore.SDKAppID, i = this._TUICore.tim), this._tim = i, console.log(`${l.PREFIX}init sdkAppId: ${c || r}, userId: ${o}`), this._tuiCallEngine = zo.createInstance({
tim: i,
SDKAppID: c || r,
// 兼容传入 SDKAppID 的问题
// @ts-ignore
frameWork: zn,
language: 6,
callkitVersion: Ft,
chat: d || !1,
component: g
}), ZA.setEngineInstance(this._tuiCallEngine), this._addListenTuiCallEngineEvent(), this._bellContext = new dn(), M.update(u.CALL, l.LOCAL_USER_INFO, { userId: o }), M.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { userId: o }), ZA.updateViewBackgroundUserId("local"), await this._tuiCallEngine.login({ userID: o, userSig: s, assetsPath: "" });
const N = M.getData(u.CALL, l.CUSTOM_UI_CONFIG);
(t = (e = this._tuiCallEngine) == null ? void 0 : e.reportLog) == null || t.call(e, {
name: "TUICallkit.init",
data: {
uiConfig: N
}
});
} catch (o) {
throw console.error(`${l.PREFIX}init failed, error: ${o}.`), o;
}
}
// component destroy
async destroyed() {
var A;
try {
const e = M.getData(u.CALL, l.CALL_STATUS);
if (e !== x.IDLE)
throw new Error(`please destroyed when status is idle, current status: ${e}`);
this._tuiCallEngine && (this._removeListenTuiCallEngineEvent(), await this._tuiCallEngine.destroyInstance(), this._tuiCallEngine = null), (A = this._bellContext) == null || A.destroy(), this._bellContext = null;
} catch (e) {
throw console.error(`${l.PREFIX}destroyed failed, error: ${e}.`), e;
}
}
async call(A) {
if (M.getData(u.CALL, l.CALL_STATUS) === x.IDLE)
try {
const { type: e, userID: t, offlinePushInfo: o } = A;
if (M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE)
return;
await this._updateCallStoreBeforeCall(e, [{ userId: t }]), this.executeExternalBeforeCalling(), A.offlinePushInfo = { ...this.getDefaultOfflinePushInfo(), ...o };
const i = await this._tuiCallEngine.call(A);
await this._updateCallStoreAfterCall([t], i);
} catch (e) {
this._handleCallError(e, "call");
}
}
async groupCall(A) {
if (M.getData(u.CALL, l.CALL_STATUS) === x.IDLE)
try {
const { userIDList: e, type: t, groupID: o, offlinePushInfo: i } = A;
if (M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE)
return;
const s = e.map((r) => ({ userId: r }));
await this._updateCallStoreBeforeCall(t, s, o), this.executeExternalBeforeCalling(), A.offlinePushInfo = { ...this.getDefaultOfflinePushInfo(), ...i };
const c = await this._tuiCallEngine.groupCall(A);
await this._updateCallStoreAfterCall(e, c);
} catch (e) {
this._handleCallError(e, "groupCall");
}
}
async inviteUser(A) {
if (M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE)
try {
const { userIDList: e } = A;
let t = await Ve(e, this.getTim());
const o = M.getData(u.CALL, l.REMOTE_USER_INFO_LIST);
if (e.filter((s) => !o.some((c) => c.userId === s)).length === 0)
return;
M.update(u.CALL, l.REMOTE_USER_INFO_LIST, [...o, ...t]), M.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, [...o, ...t]), this._tuiCallEngine && await this._tuiCallEngine.inviteUser(A);
} catch (e) {
console.error(`${l.PREFIX}inviteUser failed, error: ${e}.`);
}
}
async joinInGroupCall(A) {
if (M.getData(u.CALL, l.CALL_STATUS) !== x.CONNECTED)
try {
const e = {
[l.CALL_ROLE]: gA.CALLEE,
[l.IS_GROUP]: !0,
[l.CALL_STATUS]: x.CONNECTED,
[l.CALL_MEDIA_TYPE]: A.type,
[l.GROUP_ID]: A.groupID,
[l.ROOM_ID]: A.roomID
};
M.updateStore(e, u.CALL);
const t = await this._tuiCallEngine.joinInGroupCall(A), o = this._getFeatureButtonDefaultState(_A.Camera) === Ce.Close;
A.type === _.VIDEO && !o && await this.openCamera(l.LOCAL_VIDEO), M.update(u.CALL, l.IS_CLICKABLE, !0), this.startTimer(), gt(this._tuiCallEngine), await this._tuiCallEngine.setVideoQuality(M.getData(u.CALL, l.VIDEO_RESOLUTION));
const i = M.getData(u.CALL, l.LOCAL_USER_INFO);
M.update(u.CALL, l.LOCAL_USER_INFO, { ...i, isEnter: !0 }), M.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...i, isEnter: !0 }), ne(!0, l.AUDIO);
} catch (e) {
this._handleCallError(e, "joinInGroupCall");
}
}
// ===============================【其它对外接口】===============================
getTUICallEngineInstance() {
return (this == null ? void 0 : this._tuiCallEngine) || null;
}
setLogLevel(A) {
var e;
(e = this == null ? void 0 : this._tuiCallEngine) == null || e.setLogLevel(A);
}
setLanguage(A) {
A && Object.values(oa).includes(A) && (M.update(u.CALL, l.LANGUAGE, A), M.update(u.CALL, l.TRANSLATE, de.bind(null)));
}
enableFloatWindow(A) {
M.update(u.CALL, l.ENABLE_FLOAT_WINDOW, A);
}
async setSelfInfo(A) {
const { nickName: e, avatar: t } = A;
try {
await this._tuiCallEngine.setSelfInfo({ nickName: e, avatar: t });
} catch (o) {
console.error(`${l.PREFIX}setSelfInfo failed, error: ${o}.`);
}
}
async enableVirtualBackground(A) {
M.update(u.CALL, l.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND, A);
}
async enableAIVoice(A) {
try {
await this._tuiCallEngine.enableAIVoice(A), console.log(`${l.PREFIX}enableAIVoice: ${A}.`);
} catch (e) {
throw console.error(`${l.PREFIX}enableAIVoice failed, error: ${e}.`), e;
}
}
async setCallingBell(A) {
let e = !0;
if (e = await Qo(A), !e) {
console.warn(`${l.PREFIX}setCallingBell failed, filePath: ${A}.`);
return;
}
const t = { calleeBellFilePath: A };
this._bellContext.setBellProperties(t);
}
async enableMuteMode(A) {
try {
const e = { isMuteBell: A };
this._bellContext.setBellProperties(e), await this._bellContext.setBellMute(A);
} catch (e) {
console.warn(`${l.PREFIX}enableMuteMode failed, error: ${e}.`);
}
}
hideFeatureButton(A) {
ZA.hideFeatureButton(A);
}
setLocalViewBackgroundImage(A) {
ZA.setLocalViewBackgroundImage(A);
}
setRemoteViewBackgroundImage(A, e) {
ZA.setRemoteViewBackgroundImage(A, e);
}
setLayoutMode(A) {
ZA.setLayoutMode(A);
}
setCameraDefaultState(A) {
ZA.setCameraDefaultState(A);
}
async accept() {
var e, t, o, i, s, c;
const A = M.getData(u.CALL, l.CALL_STATUS);
if ((t = (e = this._tuiCallEngine) == null ? void 0 : e.reportLog) == null || t.call(e, {
name: "TUICallKit.accept.start",
data: { callStatus: A }
}), A !== x.CONNECTED)
try {
M.update(u.CALL, l.CALL_STATUS, x.CONNECTED), gt(this._tuiCallEngine);
const r = await this._tuiCallEngine.accept();
if (r) {
(i = this._chatCombine) == null || i.callTUIService({ message: (o = r == null ? void 0 : r.data) == null ? void 0 : o.message }), M.update(u.CALL, l.IS_CLICKABLE, !0), this.startTimer();
const d = M.getData(u.CALL, l.CALL_MEDIA_TYPE), g = this._getFeatureButtonDefaultState(_A.Camera) === Ce.Close;
d === _.VIDEO && !g && await this.openCamera(l.LOCAL_VIDEO), await this._tuiCallEngine.setVideoQuality(M.getData(u.CALL, l.VIDEO_RESOLUTION));
const N = M.getData(u.CALL, l.LOCAL_USER_INFO);
M.update(u.CALL, l.LOCAL_USER_INFO, { ...N, isEnter: !0 }), M.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...N, isEnter: !0 }), ne(!0, l.AUDIO);
}
} catch (r) {
if ((c = (s = this._tuiCallEngine) == null ? void 0 : s.reportLog) == null || c.call(s, {
name: "TUICallKit.accept.fail",
level: "error",
error: r
}), qt(r))
return;
Mt(r, _.AUDIO, this._tuiCallEngine), this._resetCallStore();
}
}
async hangup() {
if (M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE) {
try {
const A = await this._tuiCallEngine.hangup();
A == null || A.forEach((e) => {
var t, o;
(e == null ? void 0 : e.code) === 0 && ((o = this._chatCombine) == null || o.callTUIService({ message: (t = e == null ? void 0 : e.data) == null ? void 0 : t.message }));
});
} catch (A) {
console.debug(A);
}
this._resetCallStore();
}
}
async reject() {
var A, e;
if (M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE) {
try {
const t = await this._tuiCallEngine.reject();
(t == null ? void 0 : t.code) === 0 && ((e = this._chatCombine) == null || e.callTUIService({ message: (A = t == null ? void 0 : t.data) == null ? void 0 : A.message }));
} catch (t) {
console.debug(t);
}
this._resetCallStore();
}
}
async openCamera(A) {
try {
if (O.isH5) {
const t = M.getData(u.CALL, l.CAMERA_POSITION) === ie.FRONT;
await this._tuiCallEngine.openCamera(A, t);
} else
await this._tuiCallEngine.openCamera(A);
ne(!0, l.VIDEO);
} catch (e) {
Mt(e, _.VIDEO, this._tuiCallEngine), console.error(`${l.PREFIX}openCamera error: ${e}.`);
}
}
async closeCamera() {
try {
await this._tuiCallEngine.closeCamera(), ne(!1, l.VIDEO);
} catch (A) {
console.error(`${l.PREFIX}closeCamera error: ${A}.`);
}
}
async openMicrophone() {
try {
await this._tuiCallEngine.openMicrophone(), ne(!0, l.AUDIO);
} catch (A) {
console.error(`${l.PREFIX}openMicrophone failed, error: ${A}.`);
}
}
async closeMicrophone() {
try {
await this._tuiCallEngine.closeMicrophone(), ne(!1, l.AUDIO);
} catch (A) {
console.error(`${l.PREFIX}closeMicrophone failed, error: ${A}.`);
}
}
unMuteSpeaker() {
var A, e;
try {
const t = (e = (A = this._tuiCallEngine) == null ? void 0 : A.getTRTCCloudInstance) == null ? void 0 : e.call(A);
t && (t.muteAllRemoteAudio(!1), M.update(u.CALL, l.IS_MUTE_SPEAKER, !1));
} catch (t) {
console.error(`${l.PREFIX}unMuteSpeaker failed, error: ${t}.`);
}
}
muteSpeaker() {
var A, e;
try {
const t = (e = (A = this._tuiCallEngine) == null ? void 0 : A.getTRTCCloudInstance) == null ? void 0 : e.call(A);
t && (t.muteAllRemoteAudio(!0), M.update(u.CALL, l.IS_MUTE_SPEAKER, !0));
} catch (t) {
console.error(`${l.PREFIX}muteSpeaker failed, error: ${t}.`);
}
}
switchScreen(A) {
A && M.update(u.CALL, l.BIG_SCREEN_USER_ID, A);
}
async switchCallMediaType() {
var A, e;
try {
const t = M.getData(u.CALL, l.CALL_MEDIA_TYPE);
if (t === _.AUDIO) {
console.warn(`${l.PREFIX}switchCallMediaType failed, ${t} not support.`);
return;
}
const o = await this._tuiCallEngine.switchCallMediaType(_.AUDIO);
(o == null ? void 0 : o.code) === 0 && ((e = this._chatCombine) == null || e.callTUIService({ message: (A = o == null ? void 0 : o.data) == null ? void 0 : A.message })), M.update(u.CALL, l.CALL_MEDIA_TYPE, _.AUDIO);
const s = M.getData(u.CALL, l.IS_GROUP) ? fA.CALLING_GROUP_VIDEO : fA.CALLING_C2C_VIDEO, c = Ge();
this.statusChanged && this.statusChanged({ oldStatus: s, newStatus: c });
} catch (t) {
console.error(`${l.PREFIX}switchCallMediaType failed, error: ${t}.`);
}
}
async switchCamera() {
const e = M.getData(u.CALL, l.CAMERA_POSITION) === ie.BACK ? ie.FRONT : ie.BACK;
try {
await this._tuiCallEngine.switchCamera(e), M.update(u.CALL, l.CAMERA_POSITION, e);
} catch (t) {
console.error(`${l.PREFIX}_switchCamera failed, error: ${t}.`);
}
}
async setBlurBackground(A) {
try {
await this._tuiCallEngine.setBlurBackground(A ? Wo : 0), M.update(u.CALL, l.ENABLE_VIRTUAL_BACKGROUND, A);
} catch (e) {
console.error(`${l.PREFIX}_setBlurBackground failed, error: ${e}.`);
}
}
async switchDevice(A) {
try {
await this._tuiCallEngine.switchDevice(A);
} catch (e) {
console.error(`${l.PREFIX}_switchDevice failed, error: ${e}.`);
}
}
async getDeviceList(A) {
try {
return await this._tuiCallEngine.getDeviceList(A);
} catch (e) {
this._handleCallError(e, "call");
}
}
// ==========================【TUICallEngine 事件处理】==========================
_addListenTuiCallEngineEvent() {
this._engineEventHandler.addListenTuiCallEngineEvent();
}
_removeListenTuiCallEngineEvent() {
this._engineEventHandler.removeListenTuiCallEngineEvent();
}
setCallback(A) {
const { beforeCalling: e, afterCalling: t, onMinimized: o, onMessageSentByMe: i, kickedOut: s, statusChanged: c } = A;
e && (this.beforeCalling = e), t && (this.afterCalling = t), o && (this.onMinimized = o), i && (this.onMessageSentByMe = i), s && (this.kickedOut = s), c && (this.statusChanged = c);
}
toggleMinimize() {
const A = M.getData(u.CALL, l.IS_MINIMIZED);
M.update(u.CALL, l.IS_MINIMIZED, !A), console.log(`${l.PREFIX}toggleMinimize: ${A} -> ${!A}.`), this.onMinimized && this.onMinimized(A, !A);
}
executeExternalBeforeCalling() {
this.beforeCalling && this.beforeCalling();
}
executeExternalAfterCalling() {
this.afterCalling && this.afterCalling();
}
setVideoDisplayMode(A) {
M.update(u.CALL, l.DISPLAY_MODE, A);
}
async setVideoResolution(A) {
var e;
try {
if (!A)
return;
M.update(u.CALL, l.VIDEO_RESOLUTION, A), await ((e = this._tuiCallEngine) == null ? void 0 : e.setVideoQuality(A));
} catch (t) {
console.warn(`${l.PREFIX}setVideoResolution failed, error: ${t}.`);
}
}
// 通话时长更新
startTimer() {
this._timerId === -1 && (this._startTimeStamp = dt(), this._timerId = Ke.run(l.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1e3 }));
}
// =========================【private methods for service use】=========================
// 处理 “呼叫” 抛出的异常
_handleCallError(A, e) {
if (this._permissionCheckTimer && clearInterval(this._permissionCheckTimer), !qt(A))
throw Mt(A, _.AUDIO, this._tuiCallEngine), console.error(`${l.PREFIX}${e} failed, error: ${A}.`), this._resetCallStore(), A;
}
async _updateCallStoreBeforeCall(A, e, t) {
const o = t || M.getData(u.CALL, l.IS_MINIMIZED) ? DA.CALLER_GROUP_CALLING_MSG : DA.CALLER_CALLING_MSG;
let i = {
[l.CALL_MEDIA_TYPE]: A,
[l.CALL_ROLE]: gA.CALLER,
[l.REMOTE_USER_INFO_LIST]: e,
[l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: e,
[l.IS_GROUP]: !!t,
[l.CALL_TIPS]: o,
[l.GROUP_ID]: t
};
M.updateStore({ ...i, [l.CALL_STATUS]: x.CALLING }, u.CALL), this.statusChanged && this.statusChanged({
oldStatus: fA.IDLE,
newStatus: t ? fA.DIALING_GROUP : fA.DIALING_C2C
}), gt(this._tuiCallEngine);
const s = await Ve(e.map((c) => c.userId), this.getTim());
s.length > 0 && (M.update(u.CALL, l.REMOTE_USER_INFO_LIST, s), M.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, s));
}
async _updateCallStoreAfterCall(A, e) {
var t, o;
if (e) {
M.update(u.CALL, l.IS_CLICKABLE, !0), ga(e == null ? void 0 : e.roomID, e == null ? void 0 : e.strRoomID);
const i = M.getData(u.CALL, l.CALL_MEDIA_TYPE);
if (e.code === 0) {
(o = this._chatCombine) == null || o.callTUIService({ message: (t = e == null ? void 0 : e.data) == null ? void 0 : t.message });
try {
await this._tuiCallEngine.setVideoQuality(M.getData(u.CALL, l.VIDEO_RESOLUTION));
} catch (r) {
console.warn(`${l.PREFIX}setVideoQuality failed, error: ${r}.`);
}
} else {
this._resetCallStore();
return;
}
const s = this._getFeatureButtonDefaultState(_A.Camera) === Ce.Close;
i === _.VIDEO && !s && await this.openCamera(l.LOCAL_VIDEO);
const c = M.getData(u.CALL, l.LOCAL_USER_INFO);
M.update(u.CALL, l.LOCAL_USER_INFO, { ...c, isEnter: !0 }), M.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, { ...c, isEnter: !0 }), ne(!0, l.AUDIO);
} else
this._permissionCheckTimer && clearInterval(this._permissionCheckTimer), this._permissionCheckTimer = null, this._resetCallStore();
}
_getFeatureButtonDefaultState(A) {
var t;
const { button: e } = M.getData(u.CALL, l.CUSTOM_UI_CONFIG);
return (t = e == null ? void 0 : e[A]) == null ? void 0 : t.state;
}
_updateCallDuration() {
const A = Math.round((dt() - this._startTimeStamp) / 1e3), e = Ia(A);
M.update(u.CALL, l.CALL_DURATION, e);
}
_stopTimer() {
this._timerId !== -1 && (Ke.clearTask(this._timerId), this._timerId = -1);
}
_resetCallStore() {
const A = Ge();
this._stopTimer();
let e = Object.keys(Xe).filter((i) => {
switch (Xe[i]) {
case l.CALL_STATUS:
case l.LANGUAGE:
case l.IS_GROUP:
case l.DISPLAY_MODE:
case l.VIDEO_RESOLUTION:
case l.ENABLE_FLOAT_WINDOW:
case l.LOCAL_USER_INFO:
case l.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND:
case l.LOCAL_USER_INFO_EXCLUDE_VOLUMN:
return !1;
default:
return !0;
}
});
e = e.map((i) => Xe[i]), M.reset(u.CALL, e), M.getData(u.CALL, l.CALL_STATUS) !== x.IDLE && M.reset(u.CALL, [l.CALL_STATUS], !0), M.reset(u.CALL, [l.IS_MINIMIZED], !0), M.reset(u.CALL, [l.IS_EAR_PHONE], !0), M.reset(u.CALL, [l.ENABLE_VIRTUAL_BACKGROUND], !0), M.reset(u.CALL, [l.IS_MUTE_SPEAKER], !0), M.update(u.CALL, l.LOCAL_USER_INFO, {
...M.getData(u.CALL, l.LOCAL_USER_INFO),
isVideoAvailable: !1,
isAudioAvailable: !1
}), M.update(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN, {
...M.getData(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN),
isVideoAvailable: !1,
isAudioAvailable: !1
}), M.update(u.CALL, l.REMOTE_USER_INFO_LIST, []), M.update(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST, []), M.update(u.CALL, l.CAMERA_POSITION, ie.FRONT);
const o = Ge();
A !== o && this.statusChanged && this.statusChanged({ oldStatus: A, newStatus: o });
}
// =========================【Calling the Chat SDK APi】=========================
// 获取群成员
async getGroupMemberList(A, e) {
const t = M.getData(u.CALL, l.GROUP_ID);
return await Nn(t, this.getTim(), A, e);
}
// 获取群信息
async getGroupProfile() {
const A = M.getData(u.CALL, l.GROUP_ID);
return await Cn(A, this.getTim());
}
_watchTUIStore() {
M == null || M.watch(u.CALL, {
[l.CALL_STATUS]: this._handleCallStatusChange
});
}
_unwatchTUIStore() {
M == null || M.unwatch(u.CALL, {
[l.CALL_STATUS]: this._handleCallStatusChange
});
}
// =========================【融合 chat 】=========================
bindTUICore(A) {
this._TUICore = A;
}
// =========================【set、get methods】=========================
getTim() {
var A, e;
return this._tim ? this._tim : this._tuiCallEngine ? ((A = this._tuiCallEngine) == null ? void 0 : A.tim) || ((e = this._tuiCallEngine) == null ? void 0 : e.getTim()) : (console.warn(`${l.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`), null);
}
setIsFromChat(A) {
this._isFromChat = A;
}
setCurrentGroupId(A) {
this._currentGroupId = A;
}
getCurrentGroupId() {
return this._currentGroupId;
}
setDefaultOfflinePushInfo(A) {
this._offlinePushInfo = A;
}
getDefaultOfflinePushInfo() {
const A = M.getData(u.CALL, l.LOCAL_USER_INFO);
return this._offlinePushInfo ? this._offlinePushInfo : {
title: (A == null ? void 0 : A.displayUserInfo) || "",
description: de("you have a new call")
};
}
async getCallMessage(A) {
return await this._chatCombine.getCallKitMessage(A, this.getTim());
}
};
aA([
NA(),
bA(UA.init)
], tA.prototype, "init", 1);
aA([
NA(),
bA(UA.call),
tt({ engineInstance: !0 })
], tA.prototype, "call", 1);
aA([
NA(),
bA(UA.groupCall),
tt({ engineInstance: !0 })
], tA.prototype, "groupCall", 1);
aA([
NA(),
bA(UA.inviteUser),
tt({ engineInstance: !0 })
], tA.prototype, "inviteUser", 1);
aA([
NA(),
bA(UA.joinInGroupCall),
tt({ engineInstance: !0 })
], tA.prototype, "joinInGroupCall", 1);
aA([
bA(UA.setLanguage)
], tA.prototype, "setLanguage", 1);
aA([
bA(UA.enableFloatWindow)
], tA.prototype, "enableFloatWindow", 1);
aA([
bA(UA.setSelfInfo)
], tA.prototype, "setSelfInfo", 1);
aA([
bA(UA.enableAIVoice)
], tA.prototype, "enableAIVoice", 1);
aA([
bA(UA.setCallingBell)
], tA.prototype, "setCallingBell", 1);
aA([
bA(UA.enableMuteMode)
], tA.prototype, "enableMuteMode", 1);
aA([
NA()
], tA.prototype, "accept", 1);
aA([
NA()
], tA.prototype, "hangup", 1);
aA([
NA()
], tA.prototype, "reject", 1);
aA([
NA()
], tA.prototype, "openCamera", 1);
aA([
NA()
], tA.prototype, "closeCamera", 1);
aA([
NA()
], tA.prototype, "openMicrophone", 1);
aA([
NA()
], tA.prototype, "closeMicrophone", 1);
aA([
NA()
], tA.prototype, "unMuteSpeaker", 1);
aA([
NA()
], tA.prototype, "muteSpeaker", 1);
aA([
NA()
], tA.prototype, "switchScreen", 1);
aA([
NA()
], tA.prototype, "switchCallMediaType", 1);
aA([
NA()
], tA.prototype, "switchCamera", 1);
aA([
NA()
], tA.prototype, "setBlurBackground", 1);
aA([
NA()
], tA.prototype, "switchDevice", 1);
aA([
bA(UA.setVideoDisplayMode)
], tA.prototype, "setVideoDisplayMode", 1);
aA([
bA(UA.setVideoResolution)
], tA.prototype, "setVideoResolution", 1);
let bn = tA;
const W = bn.getInstance(), pa = "CallInfoContextKey", Na = "CallerUserInfoContextKey", Ca = "UserInfoExcludeVolumeContextKey", La = "FocusContextKey", ha = "ButtonPanelContextKey", Sa = "FloatWindowContextKey", ya = "IsClickableContextKey", fa = "PopoverContextKey", ma = "CustomUIConfigContextKey", Ta = "translateContextKey";
function Un() {
return zA(Na);
}
function rA() {
return zA(pa);
}
function ot(a) {
const A = L([]), e = L(""), t = (i) => {
var s, c, r;
switch (a) {
case mA.CAMERA:
A.value = (i == null ? void 0 : i.cameraList) || [], e.value = ((s = i == null ? void 0 : i.currentCamera) == null ? void 0 : s.deviceId) || "";
break;
case mA.MICROPHONE:
A.value = (i == null ? void 0 : i.microphoneList) || [], e.value = ((c = i == null ? void 0 : i.currentMicrophone) == null ? void 0 : c.deviceId) || "";
break;
case mA.SPEAKER:
A.value = (i == null ? void 0 : i.speakerList) || [], e.value = ((r = i == null ? void 0 : i.currentSpeaker) == null ? void 0 : r.deviceId) || "";
break;
}
}, o = (i) => {
e.value = i;
};
return yA(() => {
M.watch(
u.CALL,
{
[l.DEVICE_LIST]: t
},
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, {
[l.DEVICE_LIST]: t
});
}), [{ deviceList: A, currentDeviceId: e }, { updateCurrentDeviceId: o }];
}
const Zt = (a) => typeof a == "object" && a !== null, va = (a, A) => {
if (!Zt(a) || !Zt(A))
return a === A;
if (a === A)
return !0;
const e = Object.keys(a), t = Object.keys(A);
if (e.length !== t.length)
return !1;
for (let o in a)
if (!va(a[o], A[o]))
return !1;
return !0;
};
function On(a) {
const A = document.getElementById(a);
!document.fullscreenElement && A ? A.requestFullscreen().catch((e) => {
console.error(`Error attempting to enable fullscreen mode: ${e.message} (${e.name})`);
}) : document.exitFullscreen();
}
function nt(a) {
if (typeof a != "object" || a === null)
return a;
let A = Array.isArray(a) ? [] : {};
for (let e in a)
a.hasOwnProperty(e) && (A[e] = nt(a[e]));
return A;
}
const Vn = 500;
function wt(a, A) {
if (typeof a != "function" || A != null && typeof A != "function")
throw new TypeError("Expected a function");
const e = function(...t) {
const o = A ? A.apply(this, t) : t[0], i = e.cache;
if (i.has(o))
return i.get(o);
const s = a.apply(this, t);
return e.cache = i.set(o, s) || i, s;
};
return e.cache = new (wt.Cache || Map)(), e;
}
wt.Cache = Map;
function Pn(a) {
const A = wt(a, (e) => {
const { cache: t } = A;
return t.size === Vn && t.clear(), e;
});
return A;
}
const xn = ".".charCodeAt(0), Bn = /\\(\\)?/g, Rn = RegExp(
// Match anything that isn't a dot or bracket.
`[^.[\\]]+|\\[(?:([^"'][^[]*)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))`,
"g"
), Da = Pn((a) => {
const A = [];
return a.charCodeAt(0) === xn && A.push(""), a.replace(Rn, (e, t, o, i) => {
let s = e;
o ? s = i.replace(Bn, "$1") : t && (s = t.trim()), A.push(s);
}), A;
});
function le(a, A, e) {
if (typeof a != "object" || !A)
return;
const t = Da(A);
let o = a;
for (let i = 0; i < t.length; i++) {
if (o == null)
return;
const s = t[i];
i !== t.length - 1 ? o = o == null ? void 0 : o[s] : Object.assign(o, { [s]: e });
}
}
function Te(a, A, e) {
if (typeof a != "object")
return;
const t = Da(A);
let o = a;
for (let i = 0; i < t.length; i++) {
if (o == null)
return;
const s = t[i];
i !== t.length - 1 ? o = o == null ? void 0 : o[s] : Array.isArray(o) && o.splice(s, 0, e);
}
}
function wa(a) {
return a == null || typeof a == "string" && a.trim().length === 0 ? !0 : Array.isArray(a) || typeof a == "object" ? Object.keys(a).length === 0 : !1;
}
function St(a, A, e, t, o) {
Object.keys(a).forEach((i) => {
const s = a[i], c = wa(e) ? i : `${e}.${i}`;
if (typeof s == "object")
if (Array.isArray(s))
for (let r = 0; r < s.length; r++) {
const d = `${c}.${r}`;
St(s[r], A, d, t, o);
}
else
St(s, A, c, t, o);
else if (A(s)) {
const r = typeof o == "function" ? o({ key: s, value: c }) : c;
t.push(r);
}
});
}
function Ea() {
const a = L(), A = L(M.getData(u.CALL, l.REMOTE_USER_INFO_LIST)), e = (i) => {
(O.isWeChat ? i.enableMic : i.isAudioAvailable) && (a.value = { ...a.value, localVideo: i.volume });
}, t = (i) => {
const s = {};
(i.length !== A.value.length || !va(i, A.value)) && (A.value = i, A.value.forEach((c) => {
if (O.isWeChat ? c.hasAudio : c.isAudioAvailable) {
const d = O.isWeChat ? c.userID : c.domId;
s[d] = c.volume;
}
}), a.value = { ...a.value, ...s });
};
let o = {
[l.LOCAL_USER_INFO]: e,
[l.REMOTE_USER_INFO_LIST]: t
};
return O.isUniPlatform && (o = {
[l.PUSHER]: e,
[l.PLAYER]: t
}), yA(() => {
M.watch(
u.CALL,
o,
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, o);
}), a;
}
function Gn() {
const a = L(""), A = L(!0), e = L(0), t = (o) => {
typeof o == "object" ? (a.value = o.text, e.value = o.duration || 0) : a.value = o;
};
return yA(() => {
M.watch(
u.CALL,
{
[l.CALL_TIPS]: t
},
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(
u.CALL,
{
[l.CALL_TIPS]: t
}
);
}), { tip: a, show: A, duration: e };
}
function kn() {
const a = L(M.getData(u.CALL, l.NETWORK_STATUS)), A = (e) => {
a.value = e;
};
return yA(() => {
M.watch(
u.CALL,
{
[l.NETWORK_STATUS]: A
},
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, {
[l.NETWORK_STATUS]: A
});
}), { netWorkQualityList: a };
}
function ja() {
const a = L(M.getData(u.CALL, l.PLAYER)), A = (t) => {
a.value = t == null ? void 0 : t.map((o) => {
const { userID: i, hasVideo: s, hasAudio: c } = o;
return { userID: i, hasVideo: s, hasAudio: c };
});
}, e = {
[l.PLAYER]: A
};
return yA(() => {
M.watch(
u.CALL,
e,
{ notifyRangeWhenWatch: l.MYSELF }
);
}), LA(() => {
M.unwatch(u.CALL, e);
}), a;
}
function OA() {
return zA(Ca);
}
function Et() {
const a = L(M.getData(u.CALL, l.CALL_DURATION)), A = (e) => {
a.value = e;
};
return yA(() => {
M.watch(
u.CALL,
{
[l.CALL_DURATION]: A
},
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(
u.CALL,
{
[l.CALL_DURATION]: A
}
);
}), { callDuration: a };
}
function Pe() {
return zA(ha, { status: L("open") });
}
function za() {
return zA(La, L("open"));
}
function GA() {
return zA(Sa);
}
function qn() {
return zA(ya);
}
function it() {
return zA(fa);
}
const Wn = (a, A) => {
const e = [{
i: 0,
x: 0,
y: 0,
w: A,
h: A
}];
for (let t = 1; t < a; t++) {
const o = e[t - 1].x + A === 12;
e[t] = {
i: t,
x: e[t - 1].x + A === 12 ? 0 : e[t - 1].x + A,
y: e[t - 1].y + (o ? A : 0),
w: A,
h: A
};
}
return a === 3 && (e[a - 1].x += 3), a > 3 && O.isPC && a % 3 === 2 && (e[a - 1].x += 2, e[a - 2].x += 2), e;
};
function Xn(a, A) {
const { isFloatWindow: e } = G(GA()), t = L();
return cA([a, A, e], () => {
if (e.value) {
const d = [];
for (let g = 0; g < A.value; g++)
d[g] = {
i: g,
x: 0,
y: 0,
w: 12,
h: 12
};
t.value = d;
return;
}
const o = Object.keys(Array.from({ length: A.value })), i = A.value <= 4 ? 6 : 4, s = Wn(A.value, i);
t.value = s;
let c, r;
if (a.value !== null) {
if (o.length < 5) {
const d = o.concat();
d.splice(a.value, 1), d.unshift(a.value);
} else
r = a.value % 3, c = Math.floor(a.value / 3);
if (o.length < 5) {
const d = s.findIndex((g) => g.i === a.value);
if (d !== -1) {
const g = s[0];
s[0] = s[d], s[d] = g;
for (let N = 0; N < s.length; N++) {
const C = s[N];
N === 0 ? (C.w += 6, C.h += 6, C.x = 0, C.y = 0) : (C.x = (N - 1) * 4, C.y = 12, C.w = 4, C.h = 4);
}
}
} else {
let d;
r === 0 ? (s[a.value + 1] && (s[a.value + 1].x += 4), s[a.value + 2] && (s[a.value + 2].y += 4), d = {
i: a.value,
x: 0,
y: c * 4,
w: 8,
h: 8
}) : r === 2 ? (d = {
i: a.value,
x: 4,
y: c * 4,
w: 8,
h: 8
}, s[a.value - 1].x = 0, s[a.value - 1].y += 4) : r === 1 && (d = {
i: a.value,
x: 4,
y: c * 4,
w: 8,
h: 8
}, s[a.value + 1] && (s[a.value + 1].x = 0, s[a.value + 1].y += 4));
const g = 3 - r;
for (let N = a.value + g; N < s.length; N++) {
const C = s[N];
C.y += 4;
}
s[a.value] = d;
}
t.value = s;
}
}, {
immediate: !0
}), t;
}
function xe() {
return zA(ma);
}
const Qn = {
calling: [[
{ name: "switchCamera", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "virtualBackground" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
], [
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{}
]],
accept: [[
{ name: "switchCamera", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "virtualBackground" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
], [
{ name: "reject", customStyle: { paddingTop: "6vh", justifyContent: "center" } },
{},
{ name: "accept", customStyle: { paddingTop: "6vh", justifyContent: "center" } }
]],
connected: [[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
], [
{ name: "virtualBackground", customStyle: { justifyContent: "center", paddingTop: "6vh" }, props: {} },
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{ name: "switchCamera", customStyle: { justifyContent: "center", paddingTop: "6vh" }, props: {} }
]]
}, Fn = {
singleCall: {
video: {
calling: [
[],
[
{},
{ name: "hangup" },
{}
]
],
accept: [
[],
[
{ name: "reject", customStyle: { justifyContent: "flex-end" } },
{},
{ name: "accept", customStyle: { justifyContent: "flex-start" } }
]
],
connected: [
[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
],
[
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{ name: "switchCamera", customStyle: { justifyContent: "center", paddingTop: "6vh" }, props: {} }
]
]
},
audio: {
calling: [
[],
[
{},
{ name: "hangup" },
{}
]
],
accept: [
[],
[
{ name: "reject", customStyle: { justifyContent: "flex-end" } },
{},
{ name: "accept", customStyle: { justifyContent: "flex-start" } }
]
],
connected: [
[],
[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "hangup" },
{ name: "speaker", customStyle: { justifyContent: "flex-end" } }
]
]
}
},
groupCall: {
video: {
calling: [[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
], [
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{}
]],
accept: [
[],
[
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
],
[
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{}
]
],
close_calling: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "camera", props: {} },
{ name: "hangup" }
]
],
close_connected: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "camera", props: {} },
{ name: "hangup" }
]
]
},
audio: {
calling: [[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
], [
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{}
]],
accept: [
[],
[
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "microphone", customStyle: { justifyContent: "flex-start" }, props: {} },
{ name: "speaker" },
{ name: "camera", customStyle: { justifyContent: "flex-end" }, props: {} }
],
[
{},
{ name: "hangup", customStyle: { paddingTop: "6vh" } },
{}
]
],
close_calling: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "camera", props: {} },
{ name: "hangup" }
]
],
close_connected: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "camera", props: {} },
{ name: "hangup" }
]
]
}
}
}, Zn = {
singleCall: {
video: {
calling: [
[
{ name: "camera", props: {} },
{ name: "microphone", props: {} },
{ name: "hangup" }
]
],
accept: [
[
{ name: "camera", props: {} },
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "camera", props: {} },
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "hangup" }
]
]
},
audio: {
calling: [
[
{ name: "microphone", props: {} },
{ name: "hangup" }
]
],
accept: [
[
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "hangup" }
]
]
}
},
groupCall: {
video: {
calling: [[
{ name: "camera", props: {} },
{ name: "microphone", props: {} },
{ name: "inviteUser", props: {} },
{ name: "hangup" }
]],
accept: [
[
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "camera", props: {} },
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "inviteUser", props: {} },
{ name: "hangup" }
]
]
},
audio: {
calling: [
[
{ name: "microphone", props: {} },
{ name: "hangup" }
]
],
accept: [
[
{ name: "reject" },
{ name: "accept" }
]
],
connected: [
[
{ name: "microphone", props: {} },
{ name: "speaker" },
{ name: "inviteUser", props: {} },
{ name: "hangup" }
]
]
}
}
}, Yt = {
pc: Zn,
mobile: Fn
};
function ba(a) {
const A = nt(a);
return le(A, "mobile.singleCall.video", Qn), Te(A, "pc.singleCall.video.calling[0][2]", { name: "virtualBackground", props: {} }), Te(A, "pc.singleCall.video.accept[0][1]", { name: "virtualBackground", props: {} }), Te(A, "pc.singleCall.video.connected[0][3]", { name: "virtualBackground", props: {} }), Te(A, "pc.groupCall.video.calling[0][3]", { name: "virtualBackground", props: {} }), Te(A, "pc.groupCall.video.connected[0][4]", { name: "virtualBackground", props: {} }), A;
}
function Yn(a, A, e) {
let t = nt(a);
return A ? (le(t, "mobile.singleCall.video.connected[1][2].props.show", !0), e && ba(t)) : (le(t, "mobile.singleCall.video.connected[1][2].props.show", !1), e && (le(t, "mobile.singleCall.video.connected[1][0].props.show", !1), le(t, "pc.singleCall.video.connected[0][3].props.show", !1), le(t, "pc.groupCall.video.connected[0][4].props.show", !1))), t;
}
function Hn() {
const { isShowEnableVirtualBackground: a, callStatus: A } = G(rA()), e = xe(), { localUserInfoExcludeVolume: t } = G(OA()), o = f(() => (t == null ? void 0 : t.value.isVideoAvailable) || !1), i = f(() => a.value && !O.isH5), s = L([]);
return cA([e, a, o], () => {
let c = nt(Yt);
i.value && (c = ba(Yt)), A.value === x.CONNECTED && (c = Yn(c, o.value, i.value));
const { button: r } = e.value, d = [];
function g(C) {
return Object.keys(r).includes(C);
}
function N({ key: C, value: p }) {
var k;
const y = p.split(".");
let m = y.slice(0, y.length - 1);
const D = y.slice(0, y.length - 2);
if (D[D.length - 1] === "0")
for (let q = 0; q < 3; q++) {
let b = D.slice();
b.push(q), b.push("customStyle"), b.push("justifyContent"), b = b.join("."), d.push({ path: b, value: "center" });
}
return m.push("props"), m.push("show"), m = m.join("."), {
path: m,
value: (k = r == null ? void 0 : r[C]) == null ? void 0 : k.show
};
}
St(c, g, "", d, N), d == null || d.forEach((C) => {
le(c, C.path, C.value);
}), s.value = c;
}, {
immediate: !0
}), s;
}
function Ua() {
const a = xe(), A = L(a.value.viewBackground);
return cA(a, () => {
A.value = a.value.viewBackground;
}), A;
}
function Kn() {
const a = L(M.getData(u.CALL, l.ROOM_ID)), A = L(M.getData(u.CALL, l.ROOM_ID_TYPE)), e = L(M.getData(u.CALL, l.GROUP_ID)), t = L(M.getData(u.CALL, l.CALL_MEDIA_TYPE)), o = L(M.getData(u.CALL, l.GROUP_CALL_MEMBERS)), i = L(M.getData(u.CALL, l.CALL_STATUS)), s = (p) => {
a.value = p;
}, c = (p) => {
e.value = p;
}, r = (p) => {
t.value = p;
}, d = (p) => {
o.value = p;
}, g = (p) => {
i.value = p;
}, N = (p) => {
A.value = p;
}, C = {
[l.ROOM_ID]: s,
[l.GROUP_ID]: c,
[l.CALL_MEDIA_TYPE]: r,
[l.GROUP_CALL_MEMBERS]: d,
[l.CALL_STATUS]: g,
[l.ROOM_ID_TYPE]: N
};
return yA(() => {
M.watch(
u.CALL,
C,
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, C);
}), {
roomId: a,
roomIdType: A,
groupId: e,
callMediaType: t,
groupCallMembers: o,
callStatus: i
};
}
function uA() {
return zA(Ta, L(ln));
}
const Jn = {
customStyle: {
type: Object
},
customClass: {
type: String
}
}, _n = ["start", "center", "end", "space-around", "space-between", "space-evenly"], $n = ["top", "middle", "bottom"], Ai = {
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: _n,
default: "start"
},
align: {
type: String,
values: $n,
default: "top"
},
customStyle: {
type: Object,
default: () => {
}
}
};
function iA(...a) {
const A = [], e = {}.hasOwnProperty;
for (let t = 0; t < a.length; t++) {
const o = a[t];
if (!o)
continue;
const i = typeof o;
if (i === "string" || i === "number")
A.push(o);
else if (Array.isArray(o)) {
if (o.length) {
const s = iA.apply(null, o);
s && A.push(s);
}
} else if (i === "object") {
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]")) {
A.push(o.toString());
continue;
}
for (const s in o)
e.call(o, s) && o[s] && A.push(s);
}
}
return A.join(" ");
}
const ce = typeof wx < "u" && typeof wx.getSystemInfoSync == "function" && !!wx.getSystemInfoSync().fontSizeSetting, ei = typeof uni < "u" && typeof uni > "u", yt = ce || ei, ti = typeof uni < "u", Oa = function() {
return (typeof uni < "u" || typeof window < "u") && !yt;
}();
(function() {
return ce ? wx : ti ? uni : window;
})();
const Ae = Oa && window && window.navigator && window.navigator.userAgent || "", ai = /Android/i.test(Ae), oi = /(?:Windows Phone)/.test(Ae), ni = /(?:SymbianOS)/.test(Ae), ii = /iPad/i.test(Ae) || /iPhone/i.test(Ae) || /iPod/i.test(Ae), Va = ai || oi || ni || ii, Ie = Oa && !Va;
Ie && Ae.includes("Windows NT");
Ie && Ae.includes("Mac");
function Je(a) {
const A = {};
for (const e in a)
Object.prototype.hasOwnProperty.call(a, e) && a[e] !== void 0 && (A[e] = a[e]);
return A;
}
function li() {
let a = "unknow";
return typeof ct == "string" && (a = ct.split(".")[0]), { version: ct, majorVersion: a };
}
function Ht(a, A) {
const { key: e, value: t } = A;
return a.find((o) => o[e] === t);
}
const Pa = "RowContextKey", F = "tk", ze = {
SUCCESS: "success",
INFO: "info",
WARNING: "warning",
ERROR: "error"
}, si = {
options: {
virtualHost: !0
}
}, se = /* @__PURE__ */ z({
...si,
__name: "Row",
props: Ai,
setup(a) {
const A = a, e = f(() => A.gutter);
EA(Pa, {
gutter: e
});
const t = iA([
`${F}-row`,
`${F}-justify-${A.justify}`,
`${F}-align-${A.align}`
]);
return (o, i) => (I(), h("div", {
class: V(n(t)),
style: AA([o.customStyle])
}, [
H(o.$slots, "default")
], 6));
}
});
const ri = ["start", "center", "end", "space-around", "space-between", "space-evenly"], ci = ["top", "middle", "bottom"], ui = {
span: {
type: Number,
default: 24
},
justify: {
type: String,
values: ri,
default: "start"
},
align: {
type: String,
values: ci,
default: "middle"
},
offset: {
type: Number,
default: 0
}
}, di = {
options: {
virtualHost: !0
}
}, SA = /* @__PURE__ */ z({
...di,
__name: "Col",
props: ui,
setup(a) {
const A = a, { gutter: e } = zA(Pa, { gutter: f(() => 0) }), t = iA([
`${F}-col`,
`${F}-justify-${A.justify}`,
`${F}-align-${A.align}`
]), o = f(() => `${A.span / 24 * 100}%`), i = f(() => `${A.offset / 24 * 100}%`), s = f(() => `${e.value / 2}px`), c = s;
return (r, d) => (I(), h("div", {
class: V(n(t)),
style: AA({
width: n(o),
marginLeft: n(i),
paddingLeft: n(s),
paddingRight: n(c)
})
}, [
H(r.$slots, "default")
], 6));
}
});
const Ii = {
width: {
type: String,
default: "40px"
},
height: {
type: String,
default: "40px"
},
color: {
type: String
}
}, gi = {
options: {
virtualHost: !0
}
}, Mi = /* @__PURE__ */ z({
...gi,
__name: "Dot",
props: Ii,
setup(a) {
const A = a, e = `${F}-loading_dot-container`, t = `${F}-loading_dot`, o = f(() => ({
width: A.width,
height: A.height
})), i = f(() => {
const s = {};
return A.color && (s.backgroundColor = A.color), s;
});
return (s, c) => (I(), h("div", {
class: V(e),
style: AA([n(o)])
}, [
T("div", {
class: V(t),
style: AA([n(i)])
}, null, 4),
T("div", {
class: V(t),
style: AA([n(i)])
}, null, 4),
T("div", {
class: V(t),
style: AA([n(i)])
}, null, 4)
], 4));
}
});
const pi = {
width: {
type: String,
default: "40px"
},
height: {
type: String,
default: "40px"
},
color: {
type: String
}
}, Ni = {
options: {
virtualHost: !0
}
}, Ci = /* @__PURE__ */ z({
...Ni,
__name: "Circle",
props: pi,
setup(a) {
const A = a, e = f(() => {
const o = {
width: A.width,
height: A.height
};
return A.color && (o["--tk-loading-primary-color"] = A.color), o;
}), t = `${F}-loading_circle-container`;
return (o, i) => (I(), h("div", {
class: V(t),
style: AA([n(e)])
}, null, 4));
}
});
const Li = ["circle", "dot"], hi = ["row", "column"], Si = {
mode: {
type: String,
values: Li,
default: "circle"
},
loadingWidth: {
type: String,
default: "40px"
},
loadingHeight: {
type: String,
default: "40px"
},
color: {
type: String
},
text: {
type: String
},
layout: {
type: String,
values: hi,
default: "column"
}
}, yi = {
options: {
virtualHost: !0
}
}, jt = /* @__PURE__ */ z({
...yi,
__name: "Loading",
props: Si,
setup(a) {
const A = a, e = `${F}-loading ${F}-loading--${A.mode}`, t = `${F}-loading_text`, o = f(() => ({
flexDirection: A.layout
}));
return (i, s) => (I(), h("div", {
class: V(e),
style: AA([n(o)])
}, [
i.mode === "dot" ? (I(), E(Mi, {
key: 0,
width: i.loadingWidth,
height: i.loadingHeight,
color: i.color
}, null, 8, ["width", "height", "color"])) : (I(), E(Ci, {
key: 1,
width: i.loadingWidth,
height: i.loadingHeight,
color: i.color
}, null, 8, ["width", "height", "color"])),
i.text ? (I(), h("div", {
key: 2,
class: V(t)
}, B(i.text), 1)) : w("", !0)
], 4));
}
});
const fi = {
src: {
type: String
},
size: {
type: Number,
default: 20
}
}, mi = ["fill", "contain", "cover"], Kt = {
fill: "scaleToFill",
contain: "aspectFit",
cover: "aspectFill"
}, Ti = {
width: {
type: String,
default: "320px"
},
height: {
type: String,
default: "240px"
},
src: {
type: String
},
fit: {
type: String,
values: mi,
default: "fill"
},
customStyle: {
type: Object
},
defaultSrc: {
type: String
}
}, vi = {
error: (a) => a
}, Di = ["src"], wi = ["src", "mode"], Ei = {
options: {
virtualHost: !0
}
}, TA = /* @__PURE__ */ z({
...Ei,
__name: "TKImage",
props: Ti,
emits: vi,
setup(a, { emit: A }) {
const e = a, t = A, o = L(!1), i = L(e.src);
cA(() => e.src, () => {
o.value = !1, i.value = e.src;
});
const s = f(() => iA([`${F}-image`])), c = f(() => ({
width: e.width,
height: e.height,
...e.customStyle
})), r = f(() => iA([
`${F}-image_inner`
])), d = f(() => ce ? Kt[e.fit] || Kt.cover : e.fit);
function g(N) {
o.value = !0, i.value = e.defaultSrc, t("error", N);
}
return (N, C) => (I(), h("div", {
class: V(n(s)),
style: AA([n(c)])
}, [
n(o) && !N.defaultSrc ? H(N.$slots, "error", { key: 0 }) : (I(), h(RA, { key: 1 }, [
n(ce) ? w("", !0) : (I(), h("img", {
key: 0,
class: V(n(r)),
src: n(i),
style: AA({ objectFit: n(d) }),
onError: g
}, null, 46, Di)),
n(ce) ? (I(), h("image", {
key: 1,
class: V(n(r)),
src: n(i),
mode: n(d),
onError: g
}, null, 42, wi)) : w("", !0)
], 64))
], 6));
}
});
const ji = {
options: {
virtualHost: !0
}
}, he = /* @__PURE__ */ z({
...ji,
__name: "Icon",
props: fi,
setup(a) {
const A = a, e = f(() => `${A.size}px`), t = f(() => `${A.size}px`);
return (o, i) => (I(), E(TA, {
src: o.src,
width: n(e),
height: n(t)
}, null, 8, ["src", "width", "height"]));
}
}), zi = ["small", "middle", "large"], bi = ["row", "column"], Ui = ["circle", "round"], Oi = {
iconSrc: {
type: String
},
iconSize: {
type: Number
},
text: {
type: String
},
loading: {
type: Boolean,
default: !1
},
loadingColor: {
type: String,
default: "#fff"
},
loadingWidth: {
type: String,
default: "40px"
},
loadingHeight: {
type: String,
default: "40px"
},
size: {
type: String,
values: zi,
default: "middle"
},
width: {
type: String
},
height: {
type: String
},
color: {
type: String
},
direction: {
type: String,
values: bi,
default: "row"
},
shape: {
type: String,
values: Ui
},
buttonStyle: {
type: Object
},
buttonTextStyle: {
type: Object
}
}, Vi = {
options: {
virtualHost: !0
}
}, wA = /* @__PURE__ */ z({
...Vi,
__name: "Button",
props: Oi,
emits: ["click"],
setup(a, { emit: A }) {
const e = a, t = `${F}-button--content`, o = f(() => ({
width: e.width,
height: e.height,
backgroundColor: e.color,
flexDirection: e.direction,
cursor: Ie ? "pointer" : "auto",
...e.buttonStyle
})), i = iA([
`${F}-button`,
{ [`${F}-${e.shape}`]: e.shape },
`${F}-button--${e.size}`
]), s = A, c = (r) => {
!e.loading && s("click", r);
};
return (r, d) => (I(), h("div", {
style: AA([n(o)]),
class: V(n(i)),
onClick: c
}, [
r.loading ? (I(), E(jt, {
key: 0,
loadingWidth: r.loadingWidth,
loadingHeight: r.loadingHeight,
color: r.loadingColor
}, null, 8, ["loadingWidth", "loadingHeight", "color"])) : w("", !0),
r.iconSrc && !r.loading ? (I(), E(he, {
key: 1,
size: r.iconSize,
src: r.iconSrc
}, null, 8, ["size", "src"])) : w("", !0),
r.text ? (I(), h("div", {
key: 2,
style: AA([r.buttonTextStyle]),
class: V(t)
}, B(r.text), 5)) : w("", !0)
], 6));
}
});
const ft = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTMwIDE2LjA1YzAtMi4yMzUtMS4yMjgtNC4zMy0zLjMxNC01LjEzNUEzMi40MjMgMzIuNDIzIDAgMCAwIDE1IDguNzUxYy00LjEyIDAtOC4wNi43NjYtMTEuNjg1IDIuMTY0QzEuMjI4IDExLjcxOSAwIDEzLjgxNSAwIDE2LjA1MXYzLjU5N2ExLjUgMS41IDAgMCAwIDEuNiAxLjQ5Nmw2LjM3NS0uNDI1YTEuNSAxLjUgMCAwIDAgMS40LTEuNDk2di0zLjAxNGMwLS4zNTMuMjQ1LS42NTkuNTkxLS43MjZBMjYuMzgyIDI2LjM4MiAwIDAgMSAxNSAxNS4wMDFjMS43MjIgMCAzLjQwNC4xNjYgNS4wMzQuNDgyYS43MzYuNzM2IDAgMCAxIC41OTEuNzI2djMuMDE0YTEuNSAxLjUgMCAwIDAgMS40IDEuNDk2bDYuMzc1LjQyNWExLjUgMS41IDAgMCAwIDEuNi0xLjQ5NlYxNi4wNXoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=", xa = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjYiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdG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4LS41MTctLjI0MS0xLjQzNyAzLjA4em0tMS41NTk
let Wa = ki, Xa = qi;
CA || (Wa = Ri, Xa = Gi);
const $ = {
width: CA ? "60px" : "40px",
height: CA ? "60px" : "40px",
shape: "circle",
iconSize: CA ? 30 : 20,
showText: !0,
textColor: "#D5E0F2",
textSize: "12px",
textStyle: {
marginTop: "5px"
}
}, U = {
accept: {
basicConfig: {
...$,
color: "#51C271",
iconSrc: xi
},
loadingConfig: {
...$,
color: "#51C271",
loadingWidth: CA ? "30px" : "20px",
loadingHeight: CA ? "30px" : "20px"
}
},
hangup: {
basicConfig: {
...$,
color: "#ED4651",
iconSrc: ft
},
loadingConfig: {
...$,
color: "#ED4651",
loadingWidth: CA ? "30px" : "20px",
loadingHeight: CA ? "30px" : "20px"
}
},
reject: {
basicConfig: {
...$,
color: "#ED4651",
iconSrc: ft
}
},
camera: {
basicConfig: {
...$,
color: "#FFFFFF",
iconSrc: xa,
shape: "circle"
},
closedConfig: {
...$,
color: "#6b758a4d",
iconSrc: Ba
},
loadingConfig: {
...$,
color: "#6b758a4d",
loadingWidth: CA ? "30px" : "20px",
loadingHeight: CA ? "30px" : "20px"
}
},
microphone: {
basicConfig: {
...$,
color: "#FFFFFF",
iconSrc: Ra
},
closedConfig: {
...$,
color: "#6b758a4d",
iconSrc: Ga
}
},
speaker: {
basicConfig: {
...$,
color: "#FFFFFF",
iconSrc: ka
},
closedConfig: {
...$,
color: "#6b758a4d",
iconSrc: qa
}
},
fullScreen: {
basicConfig: {
iconSize: 20,
iconSrc: Bi
}
},
minimize: {
basicConfig: {
iconSize: CA ? 24 : 20,
iconSrc: Wa
}
},
switchCamera: {
basicConfig: {
...$,
color: "transparent",
iconSrc: HA,
shape: "circle"
}
},
inviteUser: {
basicConfig: {
...$,
color: CA ? "" : "#6b758a4d",
width: CA ? "24px" : "40px",
height: CA ? "24px" : "40px",
shape: CA ? "" : "circle",
iconSize: CA ? 24 : 20,
iconSrc: Xa
}
},
toggleButtonPanel: {
basicConfig: {
color: "transparent",
width: "40px",
height: "40px",
shape: "circle",
iconSize: 40,
iconSrc: Wi
}
},
virtualBackground: {
basicConfig: {
...$,
color: "#6b758a4d",
iconSrc: JA,
shape: "circle"
},
closedConfig: {
...$,
color: "#FFFFFF",
iconSrc: mt
},
loadingConfig: {
...$,
color: "#6b758a4d",
loadingWidth: CA ? "30px" : "20px",
loadingHeight: CA ? "30px" : "20px"
},
disableConfig: {
...$,
color: "#6b758a4d",
iconSrc: JA,
buttonStyle: {
opacity: 0.6
}
}
}
}, YA = {
singleCall: {
video: {
calling: {
...U,
switchCamera: {
basicConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle",
showText: !0
},
disableConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle",
showText: !0,
buttonStyle: {
opacity: 0.6
}
}
},
hangup: {
basicConfig: {
...U.hangup.basicConfig
},
loadingConfig: {
...U.hangup.loadingConfig
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
accept: {
...U,
switchCamera: {
basicConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle"
},
disableConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle",
showText: !0,
buttonStyle: {
opacity: 0.6
}
}
},
accept: {
basicConfig: {
...U.accept.basicConfig,
showText: !1
},
loadingConfig: {
...U.accept.loadingConfig,
showText: !1
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
connected: {
...U,
virtualBackground: {
basicConfig: {
...$,
color: "transparent",
iconSrc: JA,
shape: "circle",
showText: !1
},
closedConfig: {
...$,
color: "transparent",
iconSrc: JA,
showText: !1
},
disableConfig: {
...$,
color: "transparent",
iconSrc: JA,
showText: !1,
buttonStyle: {
opacity: 0.6
}
}
},
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
switchCamera: {
basicConfig: {
...U.switchCamera.basicConfig,
showText: !1
},
disableConfig: {
...U.switchCamera.basicConfig,
showText: !1,
buttonStyle: {
opacity: 0.6
}
}
}
}
},
audio: {
calling: U,
accept: U,
connected: U
}
},
groupCall: {
video: {
calling: {
...U,
switchCamera: {
basicConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle"
}
},
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
accept: {
basicConfig: {
...U.accept.basicConfig,
showText: !1
},
loadingConfig: {
...U.accept.loadingConfig,
showText: !1
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
accept: {
...U,
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
accept: {
basicConfig: {
...U.accept.basicConfig,
showText: !1
},
loadingConfig: {
...U.accept.loadingConfig,
showText: !1
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
connected: {
...U,
virtualBackground: {
basicConfig: {
...$,
color: "transparent",
iconSrc: JA,
shape: "circle",
showText: !1
},
closedConfig: {
...$,
color: "transparent",
iconSrc: mt,
showText: !1
}
},
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
}
}
},
audio: {
calling: {
...U,
switchCamera: {
basicConfig: {
...$,
color: "#6b758a4d",
iconSrc: HA,
shape: "circle"
}
},
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
accept: {
basicConfig: {
...U.accept.basicConfig,
showText: !1
},
loadingConfig: {
...U.accept.loadingConfig,
showText: !1
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
accept: {
...U,
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
accept: {
basicConfig: {
...U.accept.basicConfig,
showText: !1
},
loadingConfig: {
...U.accept.loadingConfig,
showText: !1
}
},
reject: {
basicConfig: {
...U.reject.basicConfig,
showText: !1
}
}
},
connected: {
...U,
hangup: {
basicConfig: {
...U.hangup.basicConfig,
showText: !1
},
loadingConfig: {
...U.hangup.loadingConfig,
showText: !1
}
},
virtualBackground: {
basicConfig: {
...$,
color: "transparent",
iconSrc: JA,
shape: "circle"
},
closedConfig: {
...$,
color: "transparent",
iconSrc: mt
}
}
}
}
}
}, Xi = {
singleCall: {
video: {
calling: U,
accept: U,
connected: U
},
audio: {
calling: U,
accept: U,
connected: U
}
},
groupCall: {
video: {
calling: U,
accept: U,
connected: U
},
audio: {
calling: U,
accept: U,
connected: U
}
}
}, Qi = {
pc: Xi,
mobile: YA
}, FA = {
width: "40px",
height: "40px",
shape: "circle",
iconSize: 20,
textColor: "#D5E0F2"
}, qe = {
microphone: {
basicConfig: {
...FA,
color: "#FFFFFF",
iconSrc: Ra
},
closedConfig: {
...FA,
color: "#6b758a4d",
iconSrc: Ga
}
},
speaker: {
basicConfig: {
...FA,
color: "#FFFFFF",
iconSrc: ka
},
closedConfig: {
...FA,
color: "#6b758a4d",
iconSrc: qa
}
},
camera: {
basicConfig: {
...FA,
color: "#FFFFFF",
iconSrc: xa
},
closedConfig: {
...FA,
color: "#6b758a4d",
iconSrc: Ba
}
},
hangup: {
basicConfig: {
...FA,
color: "#ED4651",
iconSrc: ft
},
loadingConfig: {
...FA,
color: "#ED4651",
loadingWidth: "20px",
loadingHeight: "20px"
}
},
toggleButtonPanel: {
basicConfig: {
color: "transparent",
width: "40px",
height: "40px",
shape: "circle",
iconSize: 40,
iconSrc: Pi
}
}
}, Fi = {
mobile: {
...YA,
groupCall: {
video: {
...YA.groupCall.video,
calling: {
...YA.groupCall.video.calling,
...qe
},
connected: {
...YA.groupCall.video.connected,
...qe
}
},
audio: {
...YA.groupCall.audio,
calling: {
...YA.groupCall.audio.calling,
...qe
},
connected: {
...YA.groupCall.audio.connected,
...qe
}
}
}
}
}, jA = (a, A) => {
var d;
const e = O.isPC ? "pc" : "mobile", { status: t } = Pe(), { callStatus: o, callRole: i, isGroupCall: s, callType: c } = G(rA()), r = L((d = U == null ? void 0 : U[a]) == null ? void 0 : d[A.value]);
return cA(
[A, t, o, s, c],
() => {
var y, m, D, j, k;
const g = s.value ? "groupCall" : "singleCall", N = c.value === _.AUDIO ? "audio" : "video";
let C = "";
o.value === x.CALLING ? C = i.value === gA.CALLER ? "calling" : "accept" : o.value === x.CONNECTED && (C = "connected");
let p = Qi;
t.value === "close" && (p = Fi), r.value = ((k = (j = (D = (m = (y = p == null ? void 0 : p[e]) == null ? void 0 : y[g]) == null ? void 0 : m[N]) == null ? void 0 : D[C]) == null ? void 0 : j[a]) == null ? void 0 : k[A.value]) || {};
},
{ immediate: !0 }
), r;
}, Zi = {
options: {
virtualHost: !0
}
}, Yi = /* @__PURE__ */ z({
...Zi,
__name: "Minimize",
setup(a) {
const A = jA("minimize", L("basicConfig")), e = async () => {
if (document != null && document.fullscreenElement)
try {
document == null || document.exitFullscreen();
} catch (t) {
console.debug(t);
}
await W.toggleMinimize();
};
return (t, o) => (I(), E(wA, {
iconSrc: n(A).iconSrc,
iconSize: n(A).iconSize,
onClick: e
}, null, 8, ["iconSrc", "iconSize"]));
}
});
const X = (a, A) => {
const e = a.__vccOpts || a;
for (const [t, o] of A)
e[t] = o;
return e;
}, Jt = /* @__PURE__ */ X(Yi, [["__scopeId", "data-v-135d060f"]]), Hi = {
options: {
virtualHost: !0
}
}, Ki = /* @__PURE__ */ z({
...Hi,
__name: "FullScreen",
setup(a) {
const A = jA("fullScreen", L("basicConfig")), e = async () => {
await On("tuicallkit-id");
};
return (t, o) => (I(), E(wA, {
iconSrc: n(A).iconSrc,
iconSize: n(A).iconSize,
onClick: e
}, null, 8, ["iconSrc", "iconSize"]));
}
});
const Ji = /* @__PURE__ */ X(Ki, [["__scopeId", "data-v-f92abf93"]]), _i = {
width: {
type: String
},
color: {
type: String
},
size: {
type: String
},
weight: {
type: Number
},
truncated: {
type: Boolean,
default: !1
},
lineClamp: {
type: Number
},
textStyle: {
type: Object
}
}, $i = {
options: {
virtualHost: !0
}
}, pA = /* @__PURE__ */ z({
...$i,
__name: "TKText",
props: _i,
emits: ["click"],
setup(a, { emit: A }) {
const e = a, t = A, o = iA([
`${F}-text`,
{ [`${F}-text--line-clamp`]: e.lineClamp }
]), i = f(() => Je({
maxWidth: e.width,
fontSize: e.size,
fontWeight: e.weight,
color: e.color,
textOverflow: e.truncated ? "ellipsis" : "auto",
"-webkit-line-clamp": e.lineClamp,
...e.textStyle
})), s = () => {
t("click");
};
return (c, r) => (I(), h("span", {
class: V(n(o)),
style: AA([n(i)]),
onClick: s
}, [
H(c.$slots, "default")
], 6));
}
});
const XA = {
width: {
type: String
},
height: {
type: String
},
showText: {
type: Boolean,
default: !0
},
iconSize: {
type: String
}
}, Al = { class: "btn-content" }, el = {
options: {
virtualHost: !0
}
}, tl = /* @__PURE__ */ z({
...el,
__name: "InviteUser",
props: XA,
setup(a) {
const A = a, e = jA("inviteUser", L("basicConfig")), t = uA(), o = async () => {
M.update(u.CALL, l.SHOW_SELECT_USER, !0);
};
return (i, s) => (I(), h("div", Al, [
S(wA, {
iconSrc: n(e).iconSrc,
color: n(e).color,
iconSize: n(e).iconSize,
width: A.width || n(e).width,
height: A.height || n(e).height,
shape: n(e).shape,
onClick: o
}, null, 8, ["iconSrc", "color", "iconSize", "width", "height", "shape"]),
i.showText ? (I(), E(pA, {
key: 0,
textStyle: n(e).textStyle,
color: n(e).textColor,
size: n(e).textSize
}, {
default: v(() => [
MA(B(n(t)("invite member")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const Qa = /* @__PURE__ */ X(tl, [["__scopeId", "data-v-7c062dcf"]]), al = {
color: {
type: String,
default: "#FFF"
},
callDuration: {
type: String,
default: ""
},
fontSize: {
type: String,
default: "16px"
}
}, ol = {
options: {
virtualHost: !0
}
}, _e = /* @__PURE__ */ z({
...ol,
__name: "Timer",
props: al,
setup(a) {
const A = a, e = f(() => ({
color: A.color,
fontSize: A.fontSize
}));
return (t, o) => (I(), h("span", {
style: AA([n(e)])
}, B(t.callDuration), 5));
}
}), nl = {
options: {
virtualHost: !0
}
}, il = /* @__PURE__ */ z({
...nl,
__name: "TopBar",
props: Jn,
setup(a) {
const A = O.isPC, { callStatus: e, isGroupCall: t, callRole: o, allowedFullScreen: i } = G(rA()), { callDuration: s } = Et(), c = xe(), r = f(() => e.value === x.CONNECTED), d = L(M.getData(u.CALL, l.ENABLE_FLOAT_WINDOW)), g = f(() => {
var p, y;
return !t.value || ((y = (p = c.value.button) == null ? void 0 : p[_A.InviteUser]) == null ? void 0 : y.show) === !1 ? !1 : e.value === x.CALLING ? o.value === gA.CALLER : !0;
});
function N(p) {
d.value = p;
}
const C = {
[l.ENABLE_FLOAT_WINDOW]: N
};
return yA(() => {
M.watch(
u.CALL,
C,
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, {
...C
});
}), (p, y) => (I(), h("div", {
style: AA(p.customStyle),
class: "top-bar-container"
}, [
n(A) ? (I(), E(se, { key: 0 }, {
default: v(() => [
S(SA, { span: 8 }),
S(SA, {
span: 8,
justify: "center",
align: "center"
}, {
default: v(() => [
n(r) ? (I(), E(_e, {
key: 0,
"call-duration": n(s)
}, null, 8, ["call-duration"])) : w("", !0)
]),
_: 1
}),
S(SA, {
span: 8,
justify: "end",
align: "center"
}, {
default: v(() => [
S(se, null, {
default: v(() => [
S(SA, { span: 18 }),
S(SA, {
span: 3,
justify: "center"
}, {
default: v(() => [
n(d) ? (I(), E(Jt, { key: 0 })) : w("", !0)
]),
_: 1
}),
S(SA, {
span: 3,
justify: "center"
}, {
default: v(() => [
n(i) ? (I(), E(Ji, { key: 0 })) : w("", !0)
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})) : w("", !0),
n(A) ? w("", !0) : (I(), E(se, { key: 1 }, {
default: v(() => [
S(SA, {
span: 8,
align: "center"
}, {
default: v(() => [
S(se, null, {
default: v(() => [
S(SA, {
span: 8,
justify: "center"
}, {
default: v(() => [
!n(A) && n(d) ? (I(), E(Jt, { key: 0 })) : w("", !0)
]),
_: 1
}),
S(SA, { span: 16 })
]),
_: 1
})
]),
_: 1
}),
S(SA, {
span: 8,
justify: "center",
align: "center"
}, {
default: v(() => [
n(r) ? (I(), E(_e, {
key: 0,
"call-duration": n(s)
}, null, 8, ["call-duration"])) : w("", !0)
]),
_: 1
}),
S(SA, {
span: 8,
justify: "end",
align: "center"
}, {
default: v(() => [
S(se, null, {
default: v(() => [
S(SA, { span: 16 }),
S(SA, {
span: 8,
justify: "center"
}, {
default: v(() => [
n(g) ? (I(), E(Qa, {
key: 0,
"show-text": n(A)
}, null, 8, ["show-text"])) : w("", !0)
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}))
], 4));
}
});
const Fa = /* @__PURE__ */ X(il, [["__scopeId", "data-v-b040a138"]]), ll = {
show: {
type: Boolean,
default: !0
},
showMask: {
type: Boolean,
default: !0
},
showBackgroundImage: {
type: Boolean,
default: !0
},
blur: {
type: Boolean,
default: !0
},
bgColor: {
type: String
},
bgImage: {
type: String
},
zIndex: {
type: Number,
default: 11e3
},
customClass: {
type: String
},
customStyle: {
type: Object
},
customMaskStyle: {
type: Object
},
fit: {
type: String,
default: "cover"
},
defaultSrc: {
type: String
}
}, sl = ["click", "error"], rl = {
options: {
virtualHost: !0
}
}, Za = /* @__PURE__ */ z({
...rl,
__name: "Overlay",
props: ll,
emits: sl,
setup(a, { emit: A }) {
const e = a, t = A, o = iA([
`${F}-overlay`,
e.customClass
]), i = `${F}-overlay_mask-container`, s = f(() => iA([
`${F}-overlay_mask`,
{ [`${F}-blur`]: e.blur }
])), c = `${F}-overlay_slot`, r = f(() => ({ zIndex: e.zIndex, ...e.customStyle })), d = f(() => ({
backgroundColor: e.bgColor,
...e.customMaskStyle
}));
function g() {
t("click");
}
const N = (C) => {
t("error", C);
};
return (C, p) => C.show ? (I(), h("div", {
key: 0,
class: V(n(o)),
style: AA([n(r)]),
onClick: g
}, [
T("div", {
class: V(i)
}, [
C.showMask ? (I(), h("div", {
key: 0,
class: V(n(s)),
style: AA([n(d)])
}, null, 6)) : w("", !0),
C.showBackgroundImage ? (I(), E(TA, {
key: 1,
fit: C.fit,
src: C.bgImage,
width: "100%",
height: "100%",
defaultSrc: C.defaultSrc,
onError: N
}, null, 8, ["fit", "src", "defaultSrc"])) : w("", !0)
]),
T("div", {
class: V(c)
}, [
H(C.$slots, "default")
])
], 6)) : w("", !0);
}
});
const cl = ["fill", "contain", "cover"], ul = ["circle", "square"], dl = {
icon: {
type: String
},
size: {
type: [Number, String],
default: 100
},
shape: {
type: String,
values: ul,
default: "square"
},
src: {
type: String
},
defaultSrc: {
type: String
},
text: {
type: String
},
fit: {
type: String,
values: cl,
default: "cover"
},
customClass: {
type: String
}
}, Il = {
options: {
virtualHost: !0
}
}, Ya = /* @__PURE__ */ z({
...Il,
__name: "Avatar",
props: dl,
setup(a) {
const A = a, e = L("");
cA(() => A.src, () => {
e.value = A.src;
}, {
immediate: !0
});
const t = f(() => iA([
`${F}-avatar`,
`${F}-avatar--${A.shape}`,
`${F}-avatar--${A.size}`,
A.customClass
])), o = f(() => typeof A.size == "number" ? `${A.size}px` : A.size), i = f(() => typeof A.size == "number" ? `${A.size}px` : A.size), s = f(() => ({ width: o.value, height: i.value }));
function c(r) {
console.error(r), A.defaultSrc && (e.value = A.defaultSrc);
}
return (r, d) => (I(), h("div", {
class: V(n(t)),
style: AA([n(s)])
}, [
n(e) ? (I(), E(TA, {
key: 0,
fit: r.fit,
width: n(o),
height: n(i),
src: n(e),
onError: c
}, null, 8, ["fit", "width", "height", "src"])) : H(r.$slots, "default", { key: 1 })
], 6));
}
});
const gl = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL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C4yNjY3IDQuNDYzNzEiIHN0cm9rZT0iI0VENDE0RCIgc3R5bGU9InN0cm9rZTojRUQ0MTREO3N0cm9rZTpjb2xvcihkaXNwbGF5LXAzIDAuOTI5MiAwLjI1NTUgMC4zMDA0KTtzdHJva2Utb3BhY2l0eToxOyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4KCg==", pl = {
isMuted: {
type: Boolean,
default: !1
},
volume: {
type: Number,
default: 0
}
}, Nl = { class: "mic-container" }, Cl = { class: "mic-level-container" }, Ll = {
options: {
virtualHost: !0
}
}, hl = /* @__PURE__ */ z({
...Ll,
__name: "MicrophoneVolume",
props: pl,
setup(a) {
const A = a, e = f(() => A.isMuted ? Ml : gl), t = f(() => A.isMuted || !A.volume ? "" : `height: ${A.volume * 4}%`);
return (o, i) => (I(), h("div", Nl, [
T("div", Cl, [
T("div", {
class: "mic-level",
style: AA(n(t))
}, null, 4)
]),
S(he, { src: n(e) }, null, 8, ["src"])
]));
}
});
const Ha = /* @__PURE__ */ X(hl, [["__scopeId", "data-v-ea062939"]]), WA = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSJ1cmwoI2EpIiBkPSJNLTUtNWgxMTB2MTEwSC01eiIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjUgNzEuNWMwLTEwLjI2NCA3LjkzLTE4LjY3NiAxNy45OTgtMTkuNDQzLjQ5Ni0uMDM4Ljk5Ny0uMDU3IDEuNTAyLS4wNTdoMTNjLjUwNSAwIDEuMDA2LjAyIDEuNTAxLjA1N0M2OS4wNyA1Mi44MjQgNzcgNjEuMjM2IDc3IDcxLjV2Ni43ODNIMjVWNzEuNXpNNDQuNSA0NS42MDVhMTQuMDc1IDE0LjA3NSAwIDAgMS0uMjA1LS4xMDRjLTQuNzA0LTIuNDMxLTcuOTItNy4zNC03LjkyLTEzLjAwMSAwLTguMDc3IDYuNTQ4LTE0LjYyNSAxNC42MjUtMTQuNjI1UzY1LjYyNSAyNC40MjMgNjUuNjI1IDMyLjVjMCA1LjY2LTMuMjE2IDEwLjU3LTcuOTIgMTMtLjA2OC4wMzYtLjEzNi4wNy0uMjA1LjEwNWExNC41NjUgMTQuNTY1IDAgMCAxLTYuNSAxLjUyYy0yLjMzNSAwLTQuNTQyLS41NDctNi41LTEuNTJ6IiBmaWxsPSIjRDVFMEYyIi8+PGRlZnM+PGxpbmVhckdyYWRpZW50IGlkPSJhIiB4MT0iNzMuNSIgeTE9Ii01IiB4Mj0iNSIgeTI9Ijk4LjUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjN0M4NTlCIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjNzQ3QzkwIi8+PC9saW5lYXJHcmFkaWVudD48L2RlZnM+PC9zdmc+", Sl = {
// ============== OverlayStream 业务组件 =================
showOverlayStream: {
type: Boolean,
default: !0
},
customClass: {
type: String
},
customStyle: {
type: Object
},
isSmallWindow: {
type: Boolean,
default: !1
},
tip: {
type: String,
default: null
},
// ============== Overlay 基础组件 =================
showOverlay: {
type: Boolean,
default: !0
},
showMask: {
type: Boolean,
default: !0
},
showBackgroundImage: {
type: Boolean,
default: !0
},
blur: {
type: Boolean,
default: !0
},
bgColor: {
type: String
},
bgImage: {
type: String,
default: WA
},
overlayZIndex: {
type: Number
},
customOverlayClass: {
type: String
},
fit: {
type: String
},
// ============== Loading 基础组件 =================
showLoading: {
type: Boolean,
default: !1
},
// ============== Avatar 基础组件 =================
showAvatar: {
type: Boolean,
default: !0
},
avatar: {
type: String,
default: WA
},
// ============== Text(username) 基础组件 =================
showUserName: {
type: Boolean,
default: !0
},
username: {
type: String
},
color: {
type: String,
default: "#FFF"
},
// ============== MicrophoneVolume 业务组件 =================
showMicVolume: {
type: Boolean,
default: !1
},
isMuted: {
type: Boolean,
default: !1
},
volume: {
type: Number,
default: 0
},
// ============== Tip 业务组件 =================
showTip: {
type: Boolean,
default: !0
}
}, yl = ["error"], fl = { class: "overlay-stream-content-container" }, ml = { class: "overlay-stream-content" }, Tl = { class: "overlay-stream-avatar" }, vl = { class: "overlay-stream-info" }, Dl = { class: "overlay-stream-tip" }, wl = { key: 0 }, El = {
options: {
virtualHost: !0
}
}, jl = /* @__PURE__ */ z({
...El,
__name: "OverlayStream",
props: Sl,
emits: yl,
setup(a, { emit: A }) {
const e = A, t = a, o = L(100), { isFloatWindow: i } = G(GA()), s = O.isPC ? "40px" : "20px";
cA([() => t.isSmallWindow, i], () => {
i.value ? o.value = t.isSmallWindow ? 20 : 40 : o.value = t.isSmallWindow ? 40 : 100;
}, {
immediate: !0
});
const c = f(() => iA([
"overlay-stream-container",
{
pc: O.isPC,
mobile: !O.isPC,
float: i.value
}
])), r = (d) => {
e("error", d);
};
return (d, g) => d.showOverlayStream ? (I(), h("div", {
key: 0,
class: V(n(c)),
style: AA([d.customStyle])
}, [
S(Za, {
show: d.showOverlay,
"show-background-image": d.showBackgroundImage,
"show-mask": d.showMask,
blur: d.blur,
zIndex: d.overlayZIndex,
bgColor: d.bgColor,
bgImage: d.bgImage || n(WA),
fit: d.fit,
defaultSrc: n(WA),
customStyle: { position: "absolute", width: "100%", height: "100%" },
"custom-mask-style": { "backdrop-filter": "blur(12px)", "-webkit-backdrop-filter": "blur(12px)" },
customClass: d.customOverlayClass,
onError: r
}, {
default: v(() => [
T("div", fl, [
T("div", ml, [
d.showLoading ? (I(), E(jt, {
key: 0,
mode: "dot"
})) : w("", !0),
T("div", Tl, [
d.showAvatar ? (I(), E(Ya, {
key: 0,
src: d.avatar || n(WA),
size: n(o)
}, null, 8, ["src", "size"])) : w("", !0)
]),
T("div", vl, [
d.showUserName ? (I(), E(pA, {
key: 0,
truncated: !0,
size: n(s),
color: d.color,
width: "200px",
weight: 500
}, {
default: v(() => [
MA(B(d.username), 1)
]),
_: 1
}, 8, ["size", "color"])) : w("", !0),
d.showMicVolume ? (I(), E(Ha, {
key: 1,
isMuted: d.isMuted,
volume: d.volume
}, null, 8, ["isMuted", "volume"])) : w("", !0)
]),
T("div", Dl, [
d.showTip && d.tip ? (I(), h("div", wl, B(d.tip), 1)) : w("", !0)
])
]),
H(d.$slots, "default", {}, void 0, !0)
])
]),
_: 3
}, 8, ["show", "show-background-image", "show-mask", "blur", "zIndex", "bgColor", "bgImage", "fit", "defaultSrc", "customClass"])
], 6)) : w("", !0);
}
});
const Ka = /* @__PURE__ */ X(jl, [["__scopeId", "data-v-34807212"]]), zl = { class: "waiting-container" }, bl = {
key: 0,
class: "groupcall-info"
}, Ul = { class: "tip" }, Ol = { class: "avatar-group" }, Vl = { class: "avatar-item" }, Pl = /* @__PURE__ */ z({
__name: "Waiting",
setup(a) {
const { localUserInfoExcludeVolume: A, remoteUserListExcludeVolume: e } = G(OA()), { callerUserInfo: t } = G(Un()), { isGroupCall: o } = G(rA()), i = Ua(), s = uA(), c = f(() => {
var D, j;
return o.value ? t.value.displayUserInfo : (j = (D = e.value) == null ? void 0 : D[0]) == null ? void 0 : j.displayUserInfo;
}), r = f(() => {
var D, j;
return o.value ? t.value.avatar : (j = (D = e.value) == null ? void 0 : D[0]) == null ? void 0 : j.avatar;
}), d = f(() => o.value ? !0 : !A.value.isVideoAvailable), g = f(() => o.value ? s.value("Invited group call") : null), N = f(() => {
var D, j;
return o.value ? i.value[t.value.userId] || r.value : i.value[(j = (D = e.value) == null ? void 0 : D[0]) == null ? void 0 : j.userId] || r.value;
}), C = L(!1), p = L("fill");
let y = L(!1);
Se(() => {
var D, j, k, q;
if (y.value) {
C.value = o.value ? !0 : !A.value.isVideoAvailable, p.value = "cover";
return;
}
o.value ? (C.value = !i.value[t.value.userId], p.value = i.value[t.value.userId] ? "fill" : "cover") : (C.value = !A.value.isVideoAvailable && !i.value[(j = (D = e.value) == null ? void 0 : D[0]) == null ? void 0 : j.userId], p.value = i.value[(q = (k = e.value) == null ? void 0 : k[0]) == null ? void 0 : q.userId] ? "fill" : "cover");
});
const m = () => {
y.value = !0;
};
return (D, j) => (I(), h("div", zl, [
S(Ka, {
username: n(c),
avatar: n(r),
"bg-image": n(N),
"show-avatar": !n(O).isPC,
"show-loading": !1,
"bg-color": "#22262ed9",
"show-mask": n(C),
"show-background-image": n(d),
tip: n(g),
fit: n(p),
onError: m
}, {
default: v(() => [
!n(O).isPC && n(o) ? (I(), h("div", bl, [
T("div", Ul, [
S(pA, { color: "#FFF" }, {
default: v(() => [
MA(B(n(e).length) + B(n(s)("people in the call")), 1)
]),
_: 1
})
]),
T("div", Ol, [
(I(!0), h(RA, null, ue(n(e), (k) => (I(), h("div", Vl, [
S(Ya, {
size: "100%",
src: k.avatar || n(WA)
}, null, 8, ["src"])
]))), 256))
])
])) : w("", !0)
]),
_: 1
}, 8, ["username", "avatar", "bg-image", "show-avatar", "show-mask", "show-background-image", "tip", "fit"])
]));
}
});
const Ja = /* @__PURE__ */ X(Pl, [["__scopeId", "data-v-8dc3669f"]]), xl = {
bigWindow: {
type: String
},
showSmallWindow: {
type: Boolean,
default: !0
},
smallWindowWidth: {
type: String,
default: "30%"
},
smallWindowHeight: {
type: String,
default: "30%"
}
}, Bl = ["toggle"], _a = "ToggleWindowContextKey", Rl = {
options: {
virtualHost: !0
}
}, Gl = /* @__PURE__ */ z({
...Rl,
__name: "ToggleWindow",
props: xl,
emits: Bl,
setup(a, { emit: A }) {
const e = a, t = A, o = L(e.bigWindow), i = `${F}-toggle-window`, s = (c) => {
o.value = c, t("toggle", c);
};
return cA(() => e.bigWindow, () => {
o.value = e.bigWindow;
}), EA(_a, {
bigWindow: o,
toggleWindow: s,
smallWindowWidth: ut(e, "smallWindowWidth"),
smallWindowHeight: ut(e, "smallWindowHeight"),
showSmallWindow: ut(e, "showSmallWindow")
}), (c, r) => (I(), h("div", {
class: V(i)
}, [
H(c.$slots, "default")
]));
}
});
const kl = {
options: {
virtualHost: !0
}
}, ql = /* @__PURE__ */ z({
...kl,
__name: "Portal",
props: ["disabled"],
setup(a) {
return (A, e) => {
const t = aa("root-portal");
return I(), E(t, {
enable: !a.disabled
}, {
default: v(() => [
H(A.$slots, "default")
]),
_: 3
}, 8, ["enable"]);
};
}
}), Wl = {
name: "teleport",
props: {
to: {
type: String,
required: !0
},
source: {
type: String,
required: !0
},
disabled: {
type: Boolean,
required: !0
}
},
mounted() {
if (this.disabled)
return;
const a = document.querySelector(this.to);
a && a.appendChild(this.$el);
},
watch: {
disabled: {
immediate: !0,
handler() {
var a, A;
this.disabled ? (A = document.querySelector(this.source)) == null || A.appendChild(this.$el) : (a = document.querySelector(this.to)) == null || a.appendChild(this.$el);
}
}
},
destroyed() {
const a = document.querySelector(this.to);
if (a)
try {
a.removeChild(this.$el);
} catch (A) {
console.debug(A);
}
}
};
function Xl(a, A, e, t, o, i) {
return I(), h("div", null, [
H(a.$slots, "default")
]);
}
const Ql = /* @__PURE__ */ X(Wl, [["render", Xl]]), Fl = {
options: {
virtualHost: !0
}
}, Zl = /* @__PURE__ */ z({
...Fl,
__name: "Portal",
props: ["disabled", "to"],
setup(a) {
return (A, e) => (I(), E(Uo, {
disabled: a.disabled,
to: a.to
}, [
H(A.$slots, "default")
], 8, ["disabled", "to"]));
}
}), Yl = {
disabled: {
type: Boolean,
default: !1
},
to: {
type: String,
default: "body"
},
source: {
type: String,
default: "body"
}
}, $a = /* @__PURE__ */ z({
__name: "Portal",
props: Yl,
setup(a) {
const { majorVersion: A } = li();
f(() => A === "3");
const e = f(() => A === "2");
return (t, o) => (I(), h("div", null, [
n(yt) ? (I(), E(ql, {
key: 0,
disabled: t.disabled
}, {
default: v(() => [
H(t.$slots, "default")
]),
_: 3
}, 8, ["disabled"])) : n(e) ? (I(), E(Ql, {
key: 1,
disabled: t.disabled,
to: t.to,
source: t.source
}, {
default: v(() => [
H(t.$slots, "default")
]),
_: 3
}, 8, ["disabled", "to", "source"])) : (I(), E(Zl, {
key: 2,
disabled: t.disabled,
to: t.to
}, {
default: v(() => [
H(t.$slots, "default")
]),
_: 3
}, 8, ["disabled", "to"]))
]));
}
}), Hl = {
value: {
type: String
}
}, Kl = {
options: {
virtualHost: !0
}
}, _t = /* @__PURE__ */ z({
...Kl,
__name: "ToggleWindowItem",
props: Hl,
setup(a) {
const A = a, {
bigWindow: e,
toggleWindow: t,
smallWindowWidth: o,
smallWindowHeight: i,
showSmallWindow: s
} = zA(_a), c = f(() => iA([
`${F}-toggle-window-item`,
`${F}-toggle-window-item--${e.value === A.value ? "big" : "small"}`,
{
pc: Ie,
mobile: !Ie
}
])), r = f(() => {
let d = {};
return e.value !== A.value && (d = { width: o.value, height: i.value }, s.value ? d.visibility = "" : d.visibility = "hidden"), d;
});
return (d, g) => (I(), h("div", {
class: V(n(c)),
style: AA([n(r)]),
onClick: g[0] || (g[0] = () => n(t)(d.value))
}, [
H(d.$slots, "default")
], 6));
}
});
const zt = {
nickName: {
type: String,
default: ""
},
isSelf: {
type: Boolean,
default: !1
},
isMuted: {
type: Boolean,
default: !1
},
volume: {
type: Number,
default: 0
},
showNickName: {
type: Boolean,
default: !1
},
showSwitchCameraButton: {
type: Boolean,
default: !1
},
showVirtualBackgroundButton: {
type: Boolean,
default: !1
},
showNetWorkStatus: {
type: Boolean,
default: !1
}
}, Ao = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAABXCAMAAABGFileAAAA7VBMVEUAAAAVFRUiIiIGBgYQEBAMDAwJCQkKCgoHBwf7+/uYmJj29vbn5+fExMT9/f1ra2vb29vr6+vR0dH4+Pjz8/Ph4eHw8PDs7Ozj4+Ovr6/v7+/f39+xsbHt7e21tbW0tLT////bIUrcJU3//PzdKVD87O/74+nfNFr99Pb52eDocIrmY4D1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87oMwtWGv5AZI+TgaBDa2nuyRyP7adUOvUCp6m5T/bIGI66aJTMYazPnKv6nziBoc6aapY8yi3sVzIs1lhbjPpgXQzVDZSb3RkNlj9Rdap6co7mG74JFBmb5fcFg+lDYE+6gS2m+M7+DbFY2eojnzZOQwdX9EqP0iQdUex3KvK/LEbdE5c79cHViBq3xNXJBG3FoHZPSJ95kJDyYarimlyouJe4PXzLytprcDFGcpum6aUwC2mwymYSzc4MSiPcdWFeZ6jp9l+C4AzWQHXVUVIioT6K+ztQyQIxD1Lnn6kX08rMj+npcEAzZGhLJXWHlAEFibjK02ss9N1JpQ4OIofFernZHzHmiU9K13s99Tqy2xBulwDTiOZubmrJFEXEBZBkx3OTkfpMEbC9UYoANz+H2LB7Ll97SizceDvlWkndpDG3HsR9QW1gsFnEyUXMqoI0A6pVMoQhx3V7iWUMC+fawuhUb0el0Yq6FwhVQuMhhtmIjfneH3bs2ahaBPqFwsbXBlL4Ow916LwEh9z7q0Z/JHTKH1zBr8msdy7LCsdE34jMICCiHGkojD3gU0JD6OzxplB1yNQ94O8CwAxPtjlGN4U7U1Dy6ekWbztlL/CbU4EVw4jmMubifeWU7XkSFi8ylnxuxcxftZ82tOdfxc6PsAynIf6ZiTj5Ag8eey0Eqlg1mR8s896xVD8Q2FTJaEizIB553tXiY7wD4IC8aXyUR5Dy0h1LekKtlHgoYlhVyLQ/5TCGCZd1eyExytaxItISx70Uq7/fci7Rc6rE3LpKLblAidaG8jKgHkwUPXayXm6VCSCw0P9Q+8ZLMuMJho4EowuCaTCmS92SnoYF3q4fu9TjuP76G/M/0B8VegI7RmyTSAAAAAElFTkSuQmCC", Jl = { class: "stream-userInfo" }, _l = { class: "nickname" }, $l = { key: 0 }, As = {
options: {
virtualHost: !0
}
}, es = /* @__PURE__ */ z({
...As,
__name: "StreamInfoPC",
props: zt,
setup(a) {
const A = uA();
return (e, t) => (I(), E(se, null, {
default: v(() => [
S(SA, {
span: 12,
justify: "start",
align: "center"
}, {
default: v(() => [
T("div", Jl, [
S(Ha, {
class: "mic-volume",
"is-muted": e.isMuted,
volume: e.volume
}, null, 8, ["is-muted", "volume"]),
T("div", _l, [
S(pA, {
color: "#fff",
truncated: !0,
width: "80px",
size: "14px"
}, {
default: v(() => [
MA(B(e.nickName), 1)
]),
_: 1
}),
lA(S(pA, {
color: "#fff",
size: "14px"
}, {
default: v(() => [
MA(B(n(A)("me")), 1)
]),
_: 1
}, 512), [
[sA, e.isSelf]
])
])
])
]),
_: 1
}),
S(SA, {
span: 12,
justify: "center"
}, {
default: v(() => [
e.showNetWorkStatus ? (I(), h("div", $l, [
S(TA, {
width: "24px",
height: "24px",
src: n(Ao)
}, null, 8, ["src"])
])) : w("", !0)
]),
_: 1
})
]),
_: 1
}));
}
});
const ts = /* @__PURE__ */ X(es, [["__scopeId", "data-v-73beaeef"]]), as = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsdGVyPSJ1cmwoI2EpIj48Y2lyY2xlIGN4PSIxNCIgY3k9IjE0IiByPSIxMiIgZmlsbD0iI2ZmZiIvPjwvZz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjgxMiAyMi41MzhjNC43MTYtNC43MTUgNC43MTYtMTIuMzYgMC0xNy4wNzZsLTEuNzY3IDEuNzY3YTkuNTc1IDkuNTc1IDAgMCAxIDAgMTMuNTQxbDEuNzY3IDEuNzY4eiIgZmlsbD0iIzFDNjZFNSIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMTg4IDE5LjEzNmE3LjI2NCA3LjI2NCAwIDAgMCAwLTEwLjI3M2wtMS43NjggMS43NjhhNC43NjQgNC43NjQgMCAwIDEgMCA2LjczN2wx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jaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz48ZmVPZmZzZXQvPjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjEiLz48ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz48ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjUgMCIvPjxmZUJsZW5kIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd18xNzQxXzEwNjc4Ii8+PGZlQmxlbmQgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzE3NDFfMTA2NzgiIHJlc3VsdD0ic2hhcGUiLz48L2ZpbHRlcj48L2RlZnM+PC9zdmc+", ns = { key: 0 }, is = {
options: {
virtualHost: !0
}
}, ls = /* @__PURE__ */ z({
...is,
__name: "StreamInfoMobile",
props: zt,
setup(a) {
const { enableVirtualBackground: A } = G(rA()), e = async () => {
await W.switchCamera();
}, t = async () => {
await W.setBlurBackground(!A.value);
};
return (o, i) => (I(), E(se, { "custom-style": { padding: "2px 5px" } }, {
default: v(() => [
S(SA, {
span: 12,
justify: "start",
align: "center"
}, {
default: v(() => [
o.showNickName ? (I(), E(pA, {
key: 0,
width: "100px",
truncated: !0,
color: "#FFF"
}, {
default: v(() => [
MA(B(o.nickName), 1)
]),
_: 1
})) : w("", !0),
lA(T("div", null, [
S(he, {
size: 24,
src: n(as)
}, null, 8, ["src"])
], 512), [
[sA, !o.isMuted && o.volume]
]),
lA(T("div", null, [
S(he, {
size: 24,
src: n(os)
}, null, 8, ["src"])
], 512), [
[sA, o.isMuted]
])
]),
_: 1
}),
S(SA, {
span: 12,
justify: "end",
align: "center"
}, {
default: v(() => [
o.showNetWorkStatus ? (I(), h("div", ns, [
S(TA, {
width: "24px",
height: "24px",
src: n(Ao)
}, null, 8, ["src"])
])) : w("", !0),
o.showSwitchCameraButton ? (I(), h("div", {
key: 1,
class: "switch-camera stream-icon",
onClick: Le(e, ["stop"])
}, [
S(TA, {
width: "15px",
height: "15px",
src: n(HA)
}, null, 8, ["src"])
])) : w("", !0),
o.showVirtualBackgroundButton ? (I(), h("div", {
key: 2,
class: "stream-icon",
onClick: Le(t, ["stop"])
}, [
S(TA, {
width: "15px",
height: "15px",
src: n(JA)
}, null, 8, ["src"])
])) : w("", !0)
]),
_: 1
})
]),
_: 1
}));
}
});
const ss = /* @__PURE__ */ X(ls, [["__scopeId", "data-v-b2b7ff75"]]), rs = {
options: {
virtualHost: !0
}
}, $e = /* @__PURE__ */ z({
...rs,
__name: "TKStreamInfo",
props: zt,
setup(a) {
const { isGroupCall: A } = rA(), e = O.isPC;
return (t, o) => (I(), h("div", null, [
n(e) ? (I(), E(ts, {
key: 0,
nickName: t.nickName,
isSelf: t.isSelf,
isMuted: t.isMuted,
volume: t.volume,
showNetWorkStatus: t.showNetWorkStatus
}, null, 8, ["nickName", "isSelf", "isMuted", "volume", "showNetWorkStatus"])) : w("", !0),
n(A) && !n(e) ? (I(), E(ss, {
key: 1,
showSwitchCameraButton: t.showSwitchCameraButton,
showVirtualBackgroundButton: t.showVirtualBackgroundButton,
showNetWorkStatus: t.showNetWorkStatus,
nickName: t.nickName,
showNickName: t.showNickName,
isSelf: t.isSelf,
isMuted: t.isMuted,
volume: t.volume
}, null, 8, ["showSwitchCameraButton", "showVirtualBackgroundButton", "showNetWorkStatus", "nickName", "showNickName", "isSelf", "isMuted", "volume"])) : w("", !0)
]));
}
}), cs = {
show: {
type: Boolean,
default: !0
},
domId: {
type: String
},
loading: {
type: Boolean
},
showStreamInfo: {
type: Boolean
},
showAudioStream: {
type: Boolean
}
}, us = ["id"], ds = { class: "audio-stream-container" }, Is = {
options: {
virtualHost: !0
}
}, gs = /* @__PURE__ */ z({
...Is,
__name: "Pusher",
props: cs,
setup(a) {
const A = L(M.getData(u.CALL, l.PUSHER_ID)), e = iA([
"stream-info-container",
{ mobile: !O.isPC }
]), t = (i) => {
A.value = i;
}, o = {
[l.PUSHER_ID]: t
};
return yA(() => {
M.watch(u.CALL, o, { notifyRangeWhenWatch: l.MYSELF });
}), LA(() => {
M.unwatch(u.CALL, o);
}), (i, s) => lA((I(), h("div", {
id: i.domId,
class: "pusher-container"
}, [
lA(T("div", ds, [
H(i.$slots, "audio-stream", {}, void 0, !0)
], 512), [
[sA, i.showAudioStream]
]),
H(i.$slots, "loading", {}, void 0, !0),
T("div", {
class: V(n(e))
}, [
H(i.$slots, "stream-info", {}, void 0, !0)
], 2)
], 8, us)), [
[sA, i.show]
]);
}
});
const eo = /* @__PURE__ */ X(gs, [["__scopeId", "data-v-8cf5d7b3"]]), Ms = {
options: {
virtualHost: !0
}
}, ps = /* @__PURE__ */ z({
...Ms,
__name: "weChatPlayer",
props: {
remoteClass: {
type: String,
required: !0
},
domId: {
type: String
}
},
setup(a) {
const A = L(M.getData(u.CALL, l.PLAYER)), e = L(M.getData(u.CALL, l.CALL_STATUS)), t = L(M.getData(u.CALL, l.IS_EAR_PHONE) ? ve.EAR : ve.SPEAKER), o = a, i = (y) => {
A.value = JSON.parse(JSON.stringify(y));
}, s = f(() => {
var y;
return (y = A.value) == null ? void 0 : y.find((m) => (m == null ? void 0 : m.userID) === o.domId);
}), c = (y) => {
e.value = y;
}, r = (y) => {
t.value = y ? ve.EAR : ve.SPEAKER;
}, d = {
[l.PLAYER]: i,
[l.CALL_STATUS]: c,
[l.IS_EAR_PHONE]: r
};
yA(() => {
M.watch(u.CALL, d, { notifyRangeWhenWatch: l.MYSELF });
}), LA(() => {
M.unwatch(u.CALL, d);
});
function g(y) {
W._tuiCallEngine._playerStateChange(y);
}
function N(y) {
}
function C(y) {
W._tuiCallEngine._playNetStatus(y);
}
function p(y) {
W._tuiCallEngine._playerAudioVolumeNotify(y);
}
return (y, m) => {
const D = aa("live-player");
return I(), h("div", {
class: V(a.remoteClass)
}, [
n(s) && (n(s).hasAudio || n(s).hasVideo) ? (I(), E(D, {
key: 0,
class: "stream",
id: n(s).id,
"data-userid": n(s).userID,
"data-streamid": n(s).streamID,
"data-streamtype": n(s).streamType,
src: n(s).src,
mode: "RTC",
autoplay: n(s).autoplay,
"mute-audio": n(s).muteAudio,
"mute-video": n(s).muteVideo,
orientation: n(s).orientation,
"object-fit": n(s).objectFit,
"background-mute": n(s).enableBackgroundMute,
"min-cache": n(s).minCache,
"max-cache": n(s).maxCache,
"sound-mode": n(t),
"enable-recv-message": n(s).enableRecvMessage,
"auto-pause-if-navigate": n(s).autoPauseIfNavigate,
"auto-pause-if-open-native": n(s).autoPauseIfOpenNative,
onStatechange: g,
onFullscreenchange: N,
onNetstatus: C,
onAudiovolumenotify: p
}, null, 8, ["id", "data-userid", "data-streamid", "data-streamtype", "src", "autoplay", "mute-audio", "mute-video", "orientation", "object-fit", "background-mute", "min-cache", "max-cache", "sound-mode", "enable-recv-message", "auto-pause-if-navigate", "auto-pause-if-open-native"])) : w("", !0)
], 2);
};
}
});
const Ns = /* @__PURE__ */ X(ps, [["__scopeId", "data-v-b0aae39e"]]), Cs = {
show: {
type: Boolean,
default: !0
},
domId: {
type: String
},
loading: {
type: Boolean
},
showStreamInfo: {
type: Boolean
},
showAudioStream: {
type: Boolean
}
}, Ls = ["id"], hs = { class: "audio-stream-container" }, Ss = {
options: {
virtualHost: !0
}
}, ys = /* @__PURE__ */ z({
...Ss,
__name: "Player",
props: Cs,
setup(a) {
const A = iA([
"stream-info-container",
{ mobile: !O.isPC }
]);
return (e, t) => lA((I(), h("div", {
id: e.domId,
class: "player-container"
}, [
lA(T("div", hs, [
H(e.$slots, "audio-stream", {}, void 0, !0)
], 512), [
[sA, e.showAudioStream]
]),
H(e.$slots, "loading", {}, void 0, !0),
T("div", {
class: V(n(A))
}, [
H(e.$slots, "stream-info", {}, void 0, !0)
], 2),
n(O).isWeChat ? (I(), E(Ns, {
key: 0,
"dom-id": e.domId,
remoteClass: "small-view"
}, null, 8, ["dom-id"])) : w("", !0)
], 8, Ls)), [
[sA, e.show]
]);
}
});
const to = /* @__PURE__ */ X(ys, [["__scopeId", "data-v-8e509e0d"]]), fs = {
avatar: {
type: String
},
username: {
type: String
},
isVideoAvailable: {
type: Boolean
},
showStreamInfo: {
type: Boolean
},
isSmallWindow: {
type: Boolean,
default: !1
},
isMuted: {
type: Boolean,
default: !0
},
volume: {
type: Number,
default: 0
},
userId: {
type: String
}
}, ms = {
options: {
virtualHost: !0
}
}, At = /* @__PURE__ */ z({
...ms,
__name: "AudioStream",
props: fs,
setup(a) {
const A = a, e = Ua(), { callType: t, isGroupCall: o } = G(rA()), { isFloatWindow: i } = G(GA()), s = f(() => !o.value && !O.isPC), c = f(() => o.value ? O.isPC : t.value === _.AUDIO), r = f(() => !o.value && O.isPC && t.value === _.AUDIO), d = f(() => ({ zIndex: 1 })), g = f(() => e.value[A.userId] || A.avatar), N = L(!e.value[A.userId]), C = L(e.value[A.userId] ? "fill" : "cover");
cA([() => A.userId, e], () => {
e.value[A.userId] ? (C.value = "fill", N.value = !1) : (C.value = "cover", N.value = !0);
}, {
immediate: !0
});
const p = () => {
N.value = !0, C.value = "cover";
};
return (y, m) => (I(), E(Ka, {
avatar: y.avatar,
"bg-image": n(g),
"show-avatar": n(s),
username: y.username,
"show-user-name": n(c),
"show-mask": !n(o) && n(N),
fit: n(C),
blur: !n(o),
"show-mic-volume": n(r),
"show-tip": !n(o) && !n(i),
"custom-style": n(d),
"is-small-window": y.isSmallWindow,
"is-muted": y.isMuted,
volume: y.volume,
"bg-color": "rgba(0, 0, 0, 0.5)",
onError: p
}, null, 8, ["avatar", "bg-image", "show-avatar", "username", "show-user-name", "show-mask", "fit", "blur", "show-mic-volume", "show-tip", "custom-style", "is-small-window", "is-muted", "volume"]));
}
}), Ts = "data:image/svg+xml;base64,IDxzdmcgd2lkdGg9IjI2IiBoZWlnaHQ9IjI2IiB2aWV3Qm94PSIwIDAgMjYgMjYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICAgICAgPHBhdGggZD0iTTE4LjQ0MzcgMTIuNDQ5QzE4LjQ0MzcgMTQuMTE0MiAxOC4yMzM2IDE1LjM1MTUgMjEuNTA4OSAxNS43MTI2QzI0Ljc4NzUgMTYuMDczNyAyNC4zNjY2IDEzLjY3OTQgMjQuMzY2MiAxMi4wNjY5QzI0LjM2NDkgMTAuMjA2MSAyMC4wNjAyIDcuNjE4OTUgMTMuMjcyNiA3LjYxNzNDNi40ODY2MiA3LjYxNzM1IDIuMTc4OSAxMC4yMDUgMi4xNzg4OCAxMi4wNjdDMi4xNzg4NyAxMy42OCAxLjc1NjIxIDE2LjA3MjYgNS4wMzMxNSAxNS43MTIzQzguMzEwMDkgMTUuMzUzNyA4LjEwMDA1IDE0LjExNTUgOC4wOTgzNyAxMi40NDk1QzguMTAxMzQgMTEuMjg2MiAxMC43NTg3IDExLjAzMTYgMTMuMjcyNSAxMS4wMjk4QzE1Ljc4NjMgMTEuMDI4MSAxOC40NDU0IDExLjI4NDQgMTguNDQzNyAxMi40NDlaIiBmaWxsPSIjRkUzQzQ0Ii8+CiAgICA8L3N2Zz4=", vs = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02LjY2NjY2IDQuMTY2NjhDNi42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Role: e, callStatus: t } = G(rA()), { isFloatWindow: o } = G(GA());
function i() {
W.toggleMinimize();
}
async function s() {
e.value === gA.CALLEE && t.value === x.CALLING ? await W.reject() : await W.hangup();
}
async function c() {
A.value.isAudioAvailable ? await W.closeMicrophone() : await W.openMicrophone();
}
return (r, d) => (I(), h("div", Es, [
lA(T("div", js, [
T("div", zs, [
T("div", {
class: "float-control-item-icon-container",
onClick: s
}, [
T("img", { src: n(Ts) }, null, 8, bs)
])
]),
lA(T("div", Us, [
T("div", {
class: "float-control-item-icon-container",
onClick: c
}, [
n(A).isAudioAvailable ? (I(), h("img", {
key: 0,
src: n(vs)
}, null, 8, Os)) : (I(), h("img", {
key: 1,
src: n(Ds)
}, null, 8, Vs))
])
], 512), [
[sA, n(o)]
]),
lA(T("div", Ps, [
T("div", {
class: "float-control-item-icon-container",
onClick: i
}, [
T("img", { src: n(ws) }, null, 8, xs)
])
], 512), [
[sA, n(o)]
])
], 512), [
[sA, n(o)]
]),
lA(T("div", null, [
H(r.$slots, "default", {}, void 0, !0)
], 512), [
[sA, !n(o)]
])
]));
}
});
const Gs = /* @__PURE__ */ X(Rs, [["__scopeId", "data-v-63373c5d"]]), ao = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTS43NjEgOS4zMzJDLjAwMSA3LjEzNC45NjMgNC43NzMgMi44MzMgMy4zOSA0LjI1MiAyLjM0MyA1LjY3NiAxLjI4NSA2LjQ5LjY4MWEuOTEyLjkxMiAwIDAgMSAxLjI0LjE0MWw0LjQyOSA1LjIxYy4yOS4zNC4yOS44NDEgMCAxLjE4MmwtMi43MTYgMy4xOThhLjg5My44OTMgMCAwIDAtLjA5MyAxLjAzNCAxOS45NDYgMTkuOTQ2IDAgMCAwIDMuMTUxIDQuMDQ4IDE5LjYyIDE5LjYyIDAgMCAwIDQuMDY0IDMuMTM3Ljg5NS44OTUgMCAwIDAgMS4wMzMtLjA5NGwzLjE4Ni0yLjcwMmEuOTEzLjkxMyAwIDAgMSAxLjE4MSAwbDUuMjE0IDQuNDMxYy4zNjYuMzExLjQyOS44NTIuMTQzIDEuMjM4bC0yLjcyNyAzLjY5Yy0xLjM3MiAxLjg1NS0zLjcxNCAyLjc5OC01Ljg5NSAyLjA0N2EyOC44NjUgMjguODY1IDAgMCAxLTExLjA0LTYuOTA4QTI4Ljg1NSAyOC44NTUgMCAwIDEgLjc2MSA5LjMzMnoiIGZpbGw9IiMxMkI5NjkiLz48L3N2Zz4=", ks = { class: "float-window-tip-container" }, qs = {
options: {
virtualHost: !0
}
}, Ws = /* @__PURE__ */ z({
...qs,
__name: "FloatWindowSingleCall",
setup(a) {
const { callType: A, callStatus: e } = G(rA()), { isFloatWindow: t } = G(GA()), { callDuration: o } = Et(), i = uA(), s = f(() => iA([
"float-window-container",
{
"singlecall-video-float": A.value === _.VIDEO && t.value,
"singlecall-audio-float": A.value === _.AUDIO && t.value
}
]));
function c() {
t.value && W.toggleMinimize();
}
return (r, d) => (I(), h("div", {
class: V(n(s))
}, [
lA(T("div", {
class: "singlecall-video-float-content",
onClick: c
}, [
H(r.$slots, "default", {}, void 0, !0),
T("div", ks, [
n(e) === n(x).CALLING && n(t) ? (I(), E(pA, {
key: 0,
color: "#FFF",
size: "12px"
}, {
default: v(() => [
MA(B(n(i)("wait to be called")), 1)
]),
_: 1
})) : w("", !0)
])
], 512), [
[sA, !(n(t) && n(A) === n(_).AUDIO)]
]),
lA(T("div", {
class: "singlecall-audio-float-content",
onClick: c
}, [
S(TA, {
width: "36px",
height: "36px",
src: n(ao)
}, null, 8, ["src"]),
n(e) === n(x).CONNECTED ? (I(), E(_e, {
key: 0,
fontSize: "12px",
callDuration: n(o),
color: "#12b969"
}, null, 8, ["callDuration"])) : w("", !0),
n(e) === n(x).CALLING && n(t) ? (I(), E(pA, {
key: 1,
color: "#12b969",
size: "12px"
}, {
default: v(() => [
MA(B(n(i)("wait to be called")), 1)
]),
_: 1
})) : w("", !0)
], 512), [
[sA, n(t) && n(A) === n(_).AUDIO]
])
], 2));
}
});
const Xs = /* @__PURE__ */ X(Ws, [["__scopeId", "data-v-ea53b7e0"]]), Qs = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjkxNyA3LjU3di0uNzMxaDEuNXYuNzNhNC41ODMgNC41ODMgMCAxIDAgOS4xNjYgMHYtLjczaDEuNXYuNzNhNi4wODQgNi4wODQgMCAwIDEtNS4zMzMgNi4wMzh2MS4zMDJoLTEuNXYtMS4zMDJhNi4wODQgNi4wODQgMCAwIDEtNS4zMzMtNi4wMzh6IiBmaWxsPSIjMTJCOTY5Ii8+PHJlY3QgeD0iNC42NjciIHk9IjEuMDkxIiB3aWR0aD0iNi42NjciIGhlaWdodD0iOS44OTciIHJ4PSIzLjMzMyIgZmlsbD0iIzEyQjk2OSIvPjwvc3ZnPg==", Fs = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi42NzIgNi4xMTdhLjYuNiAwIDAgMC0uMzMxLjUzNnYyLjY5M2EuNi42IDAgMCAwIC4zMy41MzdsMi44MDMgMS40MDVhLjIuMiAwIDAgMCAuMjktLjE3OFY0Ljg5YS4yLjIgMCAwIDAtLjI5LS4xNzlsLTIuODAyIDEuNDA2eiIgZmlsbD0iIzEyQjk2OSIv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mlhdGlvbj0iNCIvPjxmZUNvbXBvc2l0ZSBpbjI9IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iaW4iIHJlc3VsdD0iZWZmZWN0MV9iYWNrZ3JvdW5kQmx1cl8xMzFfMTQ0OSIvPjxmZUJsZW5kIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfYmFja2dyb3VuZEJsdXJfMTMxXzE0NDkiIHJlc3VsdD0ic2hhcGUiLz48L2ZpbHRlcj48L2RlZnM+PC9zdmc+", Hs = { class: "stream-container" }, Ks = { class: "video" }, Js = { class: "audio" }, _s = { class: "device-status" }, $s = {
options: {
virtualHost: !0
}
}, Ar = /* @__PURE__ */ z({
...$s,
__name: "FloatWindowGroupCall",
setup(a) {
const { isFloatWindow: A } = G(GA()), { callDuration: e } = Et(), { localUserInfoExcludeVolume: t } = G(OA()), { callStatus: o } = G(rA()), i = uA(), s = f(() => t.value.isAudioAvailable ? Qs : Zs), c = f(() => t.value.isVideoAvailable ? Fs : Ys), r = f(() => iA([
"groupcall-video-float",
{
"not-float": !A.value,
float: A.value
}
]));
function d() {
A.value && W.toggleMinimize();
}
return (g, N) => (I(), h("div", {
class: V(n(r))
}, [
n(A) ? (I(), h("div", {
key: 0,
class: "click-container",
onClickCapture: Le(d, ["stop"])
}, null, 32)) : w("", !0),
T("div", Hs, [
T("div", Ks, [
H(g.$slots, "default", {}, void 0, !0)
]),
lA(T("div", Js, [
S(TA, {
width: "36px",
height: "36px",
src: n(ao)
}, null, 8, ["src"]),
n(o) === n(x).CONNECTED ? (I(), E(_e, {
key: 0,
fontSize: "12px",
callDuration: n(e),
color: "#12b969"
}, null, 8, ["callDuration"])) : w("", !0),
n(o) === n(x).CALLING ? (I(), E(pA, {
key: 1,
size: "12px",
color: "#12b969"
}, {
default: v(() => [
MA(B(n(i)("wait to be called")), 1)
]),
_: 1
})) : w("", !0)
], 512), [
[sA, n(A)]
])
]),
lA(T("div", _s, [
S(TA, {
width: "16px",
height: "16px",
src: n(s)
}, null, 8, ["src"]),
S(TA, {
width: "16px",
height: "16px",
src: n(c)
}, null, 8, ["src"])
], 512), [
[sA, n(A)]
])
], 2));
}
});
const er = /* @__PURE__ */ X(Ar, [["__scopeId", "data-v-0dfe3ae0"]]), tr = { id: "float-window-id" }, ar = {
options: {
virtualHost: !0
}
}, or = /* @__PURE__ */ z({
...ar,
__name: "FloatWindow",
setup(a) {
const { isGroupCall: A } = G(rA());
return (e, t) => (I(), h("div", tr, [
n(A) ? (I(), E(er, { key: 1 }, {
default: v(() => [
H(e.$slots, "default")
]),
_: 3
})) : (I(), E(Xs, { key: 0 }, {
default: v(() => [
H(e.$slots, "default")
]),
_: 3
}))
]));
}
}), nr = {
options: {
virtualHost: !0
}
}, ir = /* @__PURE__ */ z({
...nr,
__name: "FloatWindow",
setup(a) {
const { isFloatWindow: A } = G(GA()), e = f(() => iA([
"float-window-container",
{
float: A.value,
"not-float": !A.value,
pc: O.isPC,
mobile: !O.isPC
}
]));
return (t, o) => (I(), h("div", {
class: V(n(e))
}, [
n(O).isPC ? (I(), E(Gs, { key: 0 }, {
default: v(() => [
H(t.$slots, "default", {}, void 0, !0)
]),
_: 3
})) : w("", !0),
n(O).isPC ? w("", !0) : (I(), E(or, { key: 1 }, {
default: v(() => [
H(t.$slots, "default", {}, void 0, !0)
]),
_: 3
}))
], 2));
}
});
const oo = /* @__PURE__ */ X(ir, [["__scopeId", "data-v-794f0a9b"]]);
function lr() {
const a = xe(), { callStatus: A } = G(rA()), e = L(qA.LOCAL), { remoteUserListExcludeVolume: t } = G(OA());
return cA([t, a, A], () => {
var s, c, r, d;
if (A.value === x.CALLING)
return;
const o = [Fe.RemoteInLargeView, Fe.LocalInLargeView], i = (s = a.value) == null ? void 0 : s.layoutMode;
if (o.includes(i)) {
e.value = (c = a.value) == null ? void 0 : c.layoutMode;
return;
}
(d = (r = t.value) == null ? void 0 : r[0]) != null && d.isEnter && (e.value = qA.REMOTE);
}, {
immediate: !0
}), e;
}
const sr = {
options: {
virtualHost: !0
}
}, rr = /* @__PURE__ */ z({
...sr,
__name: "MediaContainer",
setup(a) {
const A = lr(), e = L(!0), { isFloatWindow: t } = G(GA()), { localUserInfoExcludeVolume: o, remoteUserListExcludeVolume: i } = G(OA()), s = Ea(), { callType: c, callStatus: r } = G(rA()), d = ja(), g = f(
() => {
var m, D, j, k;
return O.isWeChat ? (D = (m = d.value) == null ? void 0 : m.find((q) => {
var b, Q;
return (q == null ? void 0 : q.userID) === ((Q = (b = i.value) == null ? void 0 : b[0]) == null ? void 0 : Q.userId);
})) == null ? void 0 : D.hasVideo : (k = (j = i.value) == null ? void 0 : j[0]) == null ? void 0 : k.isVideoAvailable;
}
), N = f(() => {
var m, D;
return (D = (m = i.value) == null ? void 0 : m[0]) == null ? void 0 : D.domId;
}), C = f(() => {
var m, D, j;
return (j = s.value) == null ? void 0 : j[(D = (m = i.value) == null ? void 0 : m[0]) == null ? void 0 : D.domId];
});
cA([c, r], () => {
c.value === _.AUDIO || r.value === x.CALLING ? e.value = !1 : e.value = !0;
}, {
immediate: !0
});
const p = f(() => iA([
"singlecall-media-container",
{
mobile: !O.isPC,
pc: O.isPC,
float: t.value
}
]));
function y(m) {
A.value = m;
}
return (m, D) => (I(), E($a, {
id: "source",
disabled: !n(t),
source: "#source",
to: "body"
}, {
default: v(() => [
S(oo, null, {
default: v(() => [
T("div", {
class: V(n(p))
}, [
S(Gl, {
"big-window": n(A),
"show-small-window": n(e),
onToggle: y
}, {
default: v(() => [
(I(), E(_t, {
value: n(qA).LOCAL,
key: n(qA).LOCAL
}, {
default: v(() => [
S(eo, {
domId: n(o).domId,
"show-audio-stream": !n(o).isVideoAvailable
}, {
"audio-stream": v(() => [
S(At, {
userId: n(o).userId,
username: n(o).displayUserInfo,
avatar: n(o).avatar,
"is-video-available": n(o).isVideoAvailable,
"is-small-window": n(A) !== n(qA).LOCAL,
"is-muted": !n(o).isAudioAvailable,
volume: n(s) && n(s)[n(o).domId]
}, null, 8, ["userId", "username", "avatar", "is-video-available", "is-small-window", "is-muted", "volume"])
]),
"stream-info": v(() => [
n(c) === n(_).VIDEO ? (I(), E($e, {
key: 0,
"nick-name": n(o).displayUserInfo,
"is-self": !0,
"is-muted": !n(o).isAudioAvailable,
volume: n(s) && n(s)[n(o).domId]
}, null, 8, ["nick-name", "is-muted", "volume"])) : w("", !0)
]),
_: 1
}, 8, ["domId", "show-audio-stream"])
]),
_: 1
}, 8, ["value"])),
(I(), E(_t, {
value: n(qA).REMOTE,
key: n(qA).REMOTE
}, {
default: v(() => [
S(to, {
"dom-id": n(N),
"show-audio-stream": !n(g)
}, {
"audio-stream": v(() => [
S(At, {
userId: n(i)[0] && n(i)[0].userId,
username: n(i)[0] && n(i)[0].displayUserInfo,
avatar: n(i)[0] && n(i)[0].avatar,
"is-video-available": n(g),
"is-small-window": n(A) !== n(qA).REMOTE,
"is-muted": n(i)[0] && !n(i)[0].isAudioAvailable,
volume: n(C)
}, null, 8, ["userId", "username", "avatar", "is-video-available", "is-small-window", "is-muted", "volume"])
]),
"stream-info": v(() => [
n(c) === n(_).VIDEO ? (I(), E($e, {
key: 0,
"nick-name": n(i)[0] && n(i)[0].displayUserInfo,
"is-muted": n(i)[0] && !n(i)[0].isAudioAvailable,
volume: n(C)
}, null, 8, ["nick-name", "is-muted", "volume"])) : w("", !0)
]),
_: 1
}, 8, ["dom-id", "show-audio-stream"])
]),
_: 1
}, 8, ["value"]))
]),
_: 1
}, 8, ["big-window", "show-small-window"])
], 2)
]),
_: 1
})
]),
_: 1
}, 8, ["disabled"]));
}
});
const cr = /* @__PURE__ */ X(rr, [["__scopeId", "data-v-670a78d8"]]), ur = [ze.SUCCESS, ze.INFO, ze.WARNING, ze.ERROR], pe = {
isShow: {
type: Boolean,
default: !1
},
message: {
type: String,
default: ""
},
type: {
type: String,
values: ur,
default: ze.INFO
},
duration: {
type: Number,
default: 3e3
},
offset: {
type: Number,
default: 16
},
showClose: {
type: Boolean,
default: !1
},
showIcon: {
type: Boolean,
default: !0
},
customClass: {
type: String
},
customStyle: {
type: Object
}
}, dr = {
onClose: null
};
function Ir(a, A) {
const e = L((a == null ? void 0 : a.message) || pe.message.default), t = L((a == null ? void 0 : a.duration) || pe.duration.default), o = L((a == null ? void 0 : a.type) || pe.type.default), i = L((a == null ? void 0 : a.offset) || pe.offset.default), s = L((a == null ? void 0 : a.showClose) || pe.showClose.default), c = L(!1);
let r = -1;
const d = (C) => {
r > -1 && (clearTimeout(r), r = -1), c.value = !0, N(C || {}), t.value && (r = setTimeout(() => {
g();
}, t.value));
}, g = () => {
c.value = !1, r > -1 && (clearTimeout(r), r = -1);
}, N = (C) => {
const {
message: p = e.value,
type: y = o.value,
offset: m = i.value,
duration: D = t.value,
showClose: j = s.value
} = C;
t.value = (a == null ? void 0 : a.duration) === 0 ? a == null ? void 0 : a.duration : D, e.value = p, o.value = y, i.value = m, s.value = j;
};
return cA(
() => a == null ? void 0 : a.isShow,
(C) => {
C && d();
},
{ immediate: !0 }
), cA(c, (C) => {
C || A("onClose");
}), {
messageContent: e,
messageDuration: t,
messageType: o,
messageOffset: i,
isShowCloseIcon: s,
visible: c,
show: d,
close: g
};
}
const gr = "data:image/svg+xml;base64,PHN2ZyB0PSIxNzAwMTIzMzQ5NzM4IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjYzMDAiIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiI+PHBhdGggZD0iTTUxMiA5Ny41MjM4MWMyMjguOTEyNzYyIDAgNDE0LjQ3NjE5IDE4NS41NjM0MjkgNDE0LjQ3NjE5IDQxNC40NzYxOXMtMTg1LjU2MzQyOSA0MTQuNDc2MTktNDE0LjQ3NjE5IDQxNC40NzYxOVM5Ny41MjM4MSA3NDAuOTEyNzYyIDk3LjUyMzgxIDUxMiAyODMuMDg3MjM4IDk3LjUyM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MTIuNSAxMi41LTMyLjggMC00NS4yTDU1Ny4yIDUxMnoiIHAtaWQ9IjYzMDEiIGZpbGw9IiM3Mzc2N2EiPjwvcGF0aD4KPC9zdmc+Cg==", Lr = {
options: {
virtualHost: !0
}
}, no = /* @__PURE__ */ z({
...Lr,
__name: "Message",
props: pe,
emits: dr,
setup(a, { expose: A, emit: e }) {
const t = a, o = e, { messageContent: i, messageType: s, messageOffset: c, isShowCloseIcon: r, visible: d, show: g, close: N } = Ir(t, o), C = f(() => iA([
`${F}-message`,
`${F}-message--${s.value}`,
t.customClass
])), p = f(() => iA([`${F}-message_icon`])), y = f(() => iA([`${F}-message_close`])), m = f(() => `${c.value}px`), D = f(() => ({ top: m.value, ...t.customStyle })), j = {
info: Nr,
waring: pr,
success: Mr,
error: gr
};
return A({
show: g,
close: N
}), (k, q) => n(d) ? (I(), h("div", {
key: 0,
class: V(n(C)),
style: AA([n(D)])
}, [
lA(T("div", {
class: V(n(p))
}, [
S(he, {
src: j[n(s)]
}, null, 8, ["src"])
], 2), [
[sA, k.showIcon]
]),
T("span", null, B(n(i)), 1),
lA(T("div", {
class: V(n(y)),
onClick: q[0] || (q[0] = //@ts-ignore
(...b) => n(N) && n(N)(...b))
}, [
S(he, { src: n(Cr) }, null, 8, ["src"])
], 2), [
[sA, n(r)]
])
], 6)) : w("", !0);
}
});
const hr = {
customClass: {
type: String
}
}, Sr = {
options: {
virtualHost: !0,
styleIsolation: "shared"
}
}, io = /* @__PURE__ */ z({
...Sr,
__name: "Tip",
props: hr,
setup(a) {
const { isFloatWindow: A } = G(GA()), { tip: e, duration: t } = Gn(), o = uA(), { isGroupCall: i } = G(rA()), s = L(null), c = a, r = O.isPC, d = f(() => [c.customClass]), g = f(
() => Je({
color: "white",
background: "none",
position: "absolute",
"z-index": 4,
"align-items": "center",
left: "50%",
top: `${r ? "60%" : "70%"}`,
transform: "translate(-50%, -50%)",
"font-size": A.value ? "12px" : void 0
})
), N = f(
() => Je({
color: "white",
background: "none",
position: "static",
transform: "none",
"font-size": A.value ? "12px" : void 0
})
), C = f(() => i.value ? N.value : g.value);
return cA([e, o, t], () => {
var p;
(p = s.value) == null || p.show({
message: o.value(e.value),
duration: t.value,
offset: 0
});
}), (p, y) => (I(), h("div", null, [
S(no, {
showIcon: !1,
class: V(n(d)),
ref_key: "message",
ref: s,
customStyle: n(C)
}, null, 8, ["class", "customStyle"])
]));
}
}), yr = ["%", "vw"], fr = {
length: {
type: Number,
default: 0
},
unit: {
type: String,
values: yr,
default: "%"
},
enableFocus: {
type: Boolean,
default: !1
},
layout: {
type: Array
},
focus: {
type: [String, Number]
}
}, mr = ["change", "toggle"], lo = "GridContextKey", Tr = { style: { height: "100%" } }, vr = {
options: {
virtualHost: !0
}
}, so = /* @__PURE__ */ z({
...vr,
__name: "Grid",
props: fr,
emits: mr,
setup(a, { emit: A }) {
const e = a, t = L(e.focus), o = L(e.layout), i = L(e.unit), s = A;
function c(r) {
s("toggle", r);
}
return cA(() => e.focus, () => t.value = e.focus), cA(() => e.layout, () => o.value = e.layout), cA(() => e.unit, () => i.value = e.unit), EA(lo, {
layout: o,
enableFocus: e.enableFocus,
handleFocusChange: c,
focus: t,
unit: i
}), (r, d) => (I(), h("div", Tr, [
H(r.$slots, "default")
]));
}
}), Dr = {
options: {
virtualHost: !0
}
}, BA = /* @__PURE__ */ z({
...Dr,
__name: "GridItem",
props: ["index", "height", "customStyle"],
setup(a) {
const A = a, {
layout: e,
enableFocus: t,
handleFocusChange: o,
focus: i,
unit: s
} = zA(lo), c = 100 / 12, r = c, d = L({}), g = iA([
`${F}-grid-item`,
{
pc: Ie,
mobile: !Ie,
h5: Va
}
]), N = () => {
const p = String(A.index) === String(i.value) ? null : A.index;
t && o(p);
}, C = f(() => !!Ht(e.value, { key: "i", value: A.index }));
return Se(() => {
const p = Ht(e.value, { key: "i", value: A.index });
if (!p)
return;
const { x: y, y: m, w: D, h: j, customStyle: k, customProps: q } = p;
d.value = {
width: D * c + s.value,
height: A.height || j * r + s.value,
left: y * c + s.value,
top: m * r + s.value,
position: "absolute",
visibility: (q == null ? void 0 : q.show) === !1 ? "hidden" : "",
...A.customStyle,
...k
};
}), LA(() => {
String(A.index) === String(i.value) && t && o(null);
}), (p, y) => n(C) ? (I(), h("div", {
key: 0,
class: V(n(g)),
style: AA([n(d)]),
onClick: N
}, [
H(p.$slots, "default")
], 6)) : w("", !0);
}
});
function wr() {
const a = L([]), A = L([]), { callStatus: e, isGroupCall: t, callType: o, callRole: i } = G(rA()), { status: s } = Pe() || {}, c = Hn();
return cA(
[e, t, o, i, s, c],
() => {
var j, k, q;
let r = c.value;
const d = O.isPC ? "pc" : "mobile", g = t.value ? "groupCall" : "singleCall", N = o.value === _.AUDIO ? "audio" : "video";
let C = e.value === x.CALLING ? i.value === gA.CALLER ? "calling" : "accept" : e.value;
t && (s == null ? void 0 : s.value) === "close" && (C = "close_" + C);
const p = ((q = (k = (j = r == null ? void 0 : r[d]) == null ? void 0 : j[g]) == null ? void 0 : k[N]) == null ? void 0 : q[C]) || [];
A.value = p;
const y = [];
let m = 0;
for (let b = 0; b < p.length; b++) {
const Q = b === 0 ? p[b].filter((K) => {
var dA;
return ((dA = K == null ? void 0 : K.props) == null ? void 0 : dA.show) !== !1;
}) : p[b];
p[b] = Q;
const R = 12 / Q.length, Z = 3;
for (let K = 0; K < Q.length; K++)
y[m++] = {
i: Q[K].name,
x: K * R,
y: b * R,
w: R,
h: Z,
// @ts-ignore
customStyle: Q[K].customStyle,
customProps: Q[K].props
};
}
m = 0;
let D = [];
for (let b = 0; b < p.flat().length; b++)
D[b] = y[m++];
D = D.filter((b) => b.i), a.value = D;
},
{
immediate: !0
}
), { layout: a, config: A };
}
function Er(...a) {
let A = window == null ? void 0 : window.document, e = "", t = () => {
}, o = {};
if (typeof a[0] == "string" ? [e, t, o] = a : [A, e, t, o] = a, !!A)
return A == null || A.addEventListener(e, t, o), () => {
A == null || A.removeEventListener(e, t, o);
};
}
function jr(a, A) {
let e = () => {
};
yA(() => {
e = Er("click", (o) => {
const i = a.map((r) => n(r)), s = o.composedPath(), c = [];
for (let r = 0; r < i.length; r++)
c[r] = s.includes(i[r]);
c.every((r) => !r) && A();
}, { passive: !0 });
}), LA(() => {
e == null || e();
});
}
const zr = (a, A, e, t, o) => {
const i = e.isShowArrow ? e.arrowSize : 0, s = `${a.width / 2 - A.width / 2}px`, c = `${a.height / 2 - A.height / 2}px`, r = `${i}px solid ${e.color}`, d = { ...t }, g = { ...o };
switch (e.placement) {
case "top":
d.left = s, d.top = `-${A.height + i + e.arrowDistance}px`, g.borderTop = r, g.left = `${a.width / 2 - i / 2}px`, g.top = `-${i + e.arrowDistance}px`;
break;
case "bottom":
d.left = s, d.top = `${a.height + i + e.arrowDistance}px`, g.borderBottom = r, g.left = `${a.width / 2 - i / 2}px`, g.top = `${a.height + e.arrowDistance - i}px`;
break;
case "left":
d.left = `-${A.width + i + e.arrowDistance}px`, d.top = c, g.borderLeft = r, g.left = `-${i * 2 - e.arrowDistance}px`, g.top = `${a.height / 2 - i / 2}px`;
break;
case "right":
d.left = `${a.width + i + e.arrowDistance}px`, d.top = c, g.borderRight = r, g.left = `${a.width + i * 2 - e.arrowDistance}px`, g.top = `${a.height / 2 - i / 2}px`;
break;
}
return {
finalContentStyle: d,
finalArrowStyle: g
};
}, br = ["click", "hover"], Ur = ["top", "bottom", "left", "right"], ro = {
trigger: {
type: String,
values: br,
default: "click"
},
placement: {
type: String,
values: Ur,
default: "top"
},
color: {
type: String
},
isShowArrow: {
type: Boolean,
default: !0
},
arrowSize: {
type: Number,
default: 5
},
arrowDistance: {
type: Number,
default: 5
},
show: {
type: Boolean
},
autoClose: {
type: Number,
default: 300
}
}, Or = {
options: {
virtualHost: !0
}
}, Vr = /* @__PURE__ */ z({
...Or,
__name: "PopoverWeb",
props: ro,
emits: ["hover"],
setup(a, { emit: A }) {
const e = a, t = `${F}-popover`, o = `${F}-popover_content`, i = `${F}-popover_arrow`, s = `${F}-popover_trigger`, c = L(), r = L(), d = L(), g = L(!1), N = L(null), C = f(() => g.value && e.isShowArrow && e.show), p = Je({ left: "0px", top: "0px", backgroundColor: e.color }), y = L(p), m = `${e.arrowSize}px solid transparent`, D = {
borderLeft: m,
borderRight: m,
borderTop: m,
borderBottom: m,
top: "0px",
left: "0px"
}, j = L(D), k = A, q = () => {
Oo(() => {
var ee, te, ae, QA;
if (!g.value || !e.show)
return;
const K = (te = (ee = r.value).getBoundingClientRect) == null ? void 0 : te.call(ee), dA = (QA = (ae = d.value).getBoundingClientRect) == null ? void 0 : QA.call(ae), { finalContentStyle: vA, finalArrowStyle: ye } = zr(K, dA, e, p, D);
y.value = { ...p, ...vA }, j.value = { ...D, ...ye };
});
}, b = () => {
clearTimeout(N.value);
}, Q = () => {
e.trigger === "click" && (g.value = !g.value, q());
}, R = () => {
e.trigger === "hover" && (k("hover"), b(), g.value = !0, q());
}, Z = () => {
e.trigger === "hover" && (N.value = setTimeout(() => {
g.value = !1, q();
}, 1e3));
};
return jr([c], () => {
g.value = !1;
}), (K, dA) => (I(), h("div", {
class: V(t),
ref_key: "popoverRef",
ref: c
}, [
n(g) && K.show ? (I(), h("div", {
key: 0,
ref_key: "contentRef",
ref: d,
onMouseenter: b,
onMouseleave: Z,
class: V(o),
style: AA([n(y)])
}, [
H(K.$slots, "content")
], 36)) : w("", !0),
n(C) ? (I(), h("div", {
key: 1,
style: AA([n(j)]),
class: V(i)
}, null, 4)) : w("", !0),
T("div", {
ref_key: "triggerRef",
ref: r,
class: V(s),
onClick: Q,
onMouseenter: R,
onMouseleave: Z
}, [
H(K.$slots, "trigger")
], 544)
], 512));
}
});
const Pr = {
options: {
virtualHost: !0
}
};
function xr(a, A, e, t, o, i) {
return null;
}
const Br = /* @__PURE__ */ X(Pr, [["render", xr]]), Rr = {
options: {
virtualHost: !0
}
}, bt = /* @__PURE__ */ z({
...Rr,
__name: "Popover",
props: ro,
emits: ["hover"],
setup(a, { emit: A }) {
const e = A, t = () => {
e("hover");
};
return (o, i) => (I(), h(RA, null, [
n(ce) ? w("", !0) : (I(), E(Vr, xt({
key: 0,
onHover: t
}, o.$props), {
trigger: v(() => [
H(o.$slots, "trigger")
]),
content: v(() => [
H(o.$slots, "content")
]),
_: 3
}, 16)),
n(ce) ? (I(), E(Br, Vo(xt({ key: 1 }, o.$props)), {
trigger: v(() => [
H(o.$slots, "trigger")
]),
content: v(() => [
H(o.$slots, "content")
]),
_: 3
}, 16)) : w("", !0)
], 64));
}
}), Gr = {
deviceType: {
type: String
},
isShowControlBtn: {
type: Boolean,
default: !1
}
}, kr = { class: "device-selector-container" }, qr = { class: "scroll-container" }, Wr = { class: "scroll-content" }, Xr = {
options: {
virtualHost: !0
}
}, Qr = /* @__PURE__ */ z({
...Xr,
__name: "DeviceSelect",
props: Gr,
setup(a) {
const A = a, [{ deviceList: e, currentDeviceId: t }, { updateCurrentDeviceId: o }] = ot(A.deviceType), { localUserInfoExcludeVolume: i } = G(OA()), { isMuteSpeaker: s } = G(rA()), c = it(), r = uA(), d = async (p) => {
try {
C(), await W.switchDevice({
deviceType: A.deviceType,
deviceId: p
}), o(p);
} catch (y) {
console.debug(y);
}
}, g = async () => {
var p, y;
C(), A.deviceType === mA.CAMERA && ((p = i.value) != null && p.isVideoAvailable ? await W.closeCamera() : await W.openCamera("localVideo")), A.deviceType === mA.MICROPHONE && ((y = i.value) != null && y.isAudioAvailable ? await W.closeMicrophone() : await W.openMicrophone()), A.deviceType === mA.SPEAKER && (s.value ? await W.unMuteSpeaker() : await W.muteSpeaker());
}, N = f(() => {
var p;
if (A.deviceType === mA.CAMERA)
return i != null && i.value.isVideoAvailable ? r.value("close camera") : r.value("open camera");
if (A.deviceType === mA.MICROPHONE)
return (p = i == null ? void 0 : i.value) != null && p.isAudioAvailable ? r.value("close microphone") : r.value("open microphone");
if (A.deviceType === mA.SPEAKER)
return s.value ? r.value("open speaker") : r.value("close speaker");
}), C = () => {
c.value = "close";
};
return (p, y) => (I(), h("div", kr, [
T("div", qr, [
T("div", Wr, [
(I(!0), h(RA, null, ue(n(e), (m) => (I(), h("div", {
key: m.deviceId
}, [
S(pA, {
width: "100%",
color: "#ffff",
truncated: !0,
size: "14px",
class: V(["device-item", { select: n(t) === m.deviceId }]),
onClick: () => d(m.deviceId)
}, {
default: v(() => [
MA(B(m.label), 1)
]),
_: 2
}, 1032, ["class", "onClick"])
]))), 128))
])
]),
y[0] || (y[0] = T("div", { class: "control-item" }, null, -1)),
p.isShowControlBtn ? (I(), E(pA, {
key: 0,
width: "100%",
color: "#ffff",
truncated: !0,
size: "14px",
class: "device-item",
onClick: g
}, {
default: v(() => [
MA(B(n(N)), 1)
]),
_: 1
})) : w("", !0)
]));
}
});
const Ut = /* @__PURE__ */ X(Qr, [["__scopeId", "data-v-406bc3d4"]]), Fr = { class: "btn-content" }, Zr = {
options: {
virtualHost: !0
}
}, Yr = /* @__PURE__ */ z({
...Zr,
__name: "Camera",
props: XA,
setup(a) {
const A = uA(), e = a, t = L(!0), o = O.isPC, { localUserInfoExcludeVolume: i } = G(OA()), s = L(i == null ? void 0 : i.value.isVideoAvailable), c = f(() => i == null ? void 0 : i.value.isVideoAvailable), r = it(), [{ deviceList: d }] = ot(mA.CAMERA), g = f(() => {
var D;
return ((D = d.value) == null ? void 0 : D.length) > 0 && r.value === "camera";
}), N = f(() => t.value ? c.value ? "basicConfig" : "closedConfig" : "loadingConfig"), C = f(() => i != null && i.value.isVideoAvailable ? A.value("camera enabled") : A.value("camera disabled")), p = jA("camera", N), y = async () => {
t.value = !1, s.value = !c.value, c.value ? await W.closeCamera() : await W.openCamera("localVideo"), t.value = !0;
}, m = () => {
r.value = "camera";
};
return (D, j) => (I(), h("div", Fr, [
n(o) ? (I(), E(bt, {
key: 0,
color: "rgba(107, 117, 138, 0.5)",
show: n(g),
onHover: m,
trigger: "hover"
}, {
content: v(() => [
S(Ut, {
isShowControlBtn: !0,
deviceType: n(mA).CAMERA
}, null, 8, ["deviceType"])
]),
trigger: v(() => [
S(wA, {
loading: !n(t),
iconSrc: n(p).iconSrc,
color: n(p).color,
iconSize: n(p).iconSize,
width: e.width || n(p).width,
height: e.height || n(p).height,
loadingWidth: n(p).loadingWidth,
loadingHeight: n(p).loadingHeight,
shape: n(p).shape,
onClick: y
}, null, 8, ["loading", "iconSrc", "color", "iconSize", "width", "height", "loadingWidth", "loadingHeight", "shape"])
]),
_: 1
}, 8, ["show"])) : w("", !0),
n(o) ? w("", !0) : (I(), E(wA, {
key: 1,
loading: !n(t),
iconSrc: n(p).iconSrc,
color: n(p).color,
iconSize: e.iconSize || n(p).iconSize,
width: e.width || n(p).width,
height: e.height || n(p).height,
loadingWidth: n(p).loadingWidth,
loadingHeight: n(p).loadingHeight,
shape: "circle",
onClick: y
}, null, 8, ["loading", "iconSrc", "color", "iconSize", "width", "height", "loadingWidth", "loadingHeight"])),
n(p).showText ? (I(), E(pA, {
key: 2,
textStyle: n(p).textStyle,
color: n(p).textColor,
size: n(p).textSize
}, {
default: v(() => [
MA(B(n(C)), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const Hr = /* @__PURE__ */ X(Yr, [["__scopeId", "data-v-24aa342a"]]), Kr = { class: "btn-content" }, Jr = {
options: {
virtualHost: !0
}
}, _r = /* @__PURE__ */ z({
...Jr,
__name: "Hangup",
props: XA,
setup(a) {
const A = a, e = qn(), t = f(() => e.value ? "basicConfig" : "loadingConfig"), o = jA("hangup", t), i = uA(), s = async () => {
await W.hangup();
};
return (c, r) => (I(), h("div", Kr, [
S(wA, {
loading: !n(e),
loadingWidth: n(o).loadingWidth,
loadingHeight: n(o).loadingHeight,
iconSrc: n(o).iconSrc,
color: n(o).color,
iconSize: A.iconSize || n(o).iconSize,
width: A.width || n(o).width,
height: A.height || n(o).height,
shape: n(o).shape,
onClick: s
}, null, 8, ["loading", "loadingWidth", "loadingHeight", "iconSrc", "color", "iconSize", "width", "height", "shape"]),
n(o).showText ? (I(), E(pA, {
key: 0,
textStyle: n(o).textStyle,
color: n(o).textColor,
size: n(o).textSize
}, {
default: v(() => [
MA(B(n(i)("hangup")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const $r = /* @__PURE__ */ X(_r, [["__scopeId", "data-v-e75a102a"]]), Ac = { class: "btn-content" }, ec = {
options: {
virtualHost: !0
}
}, tc = /* @__PURE__ */ z({
...ec,
__name: "Accept",
props: XA,
setup(a) {
const A = L(!0), e = a, t = f(() => A.value ? "basicConfig" : "loadingConfig"), o = jA("accept", t), i = uA(), s = async () => {
A.value = !1, await W.accept(), A.value = !0;
};
return (c, r) => (I(), h("div", Ac, [
S(wA, {
iconSrc: n(o).iconSrc,
color: n(o).color,
iconSize: e.iconSize || n(o).iconSize,
width: e.width || n(o).width,
height: e.height || n(o).height,
shape: n(o).shape,
loading: !n(A),
loadingWidth: n(o).loadingWidth,
loadingHeight: n(o).loadingHeight,
onClick: s
}, null, 8, ["iconSrc", "color", "iconSize", "width", "height", "shape", "loading", "loadingWidth", "loadingHeight"]),
n(o).showText ? (I(), E(pA, {
key: 0,
textStyle: n(o).textStyle,
color: n(o).textColor,
size: n(o).textSize
}, {
default: v(() => [
MA(B(n(i)("accept")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const ac = /* @__PURE__ */ X(tc, [["__scopeId", "data-v-e1377967"]]), oc = { class: "btn-content" }, nc = {
options: {
virtualHost: !0
}
}, ic = /* @__PURE__ */ z({
...nc,
__name: "Microphone",
props: XA,
setup(a) {
const A = O.isPC, e = L(!0), { localUserInfoExcludeVolume: t } = G(OA()), o = it(), [{ deviceList: i }] = ot(mA.MICROPHONE), s = f(() => {
var p;
return ((p = i.value) == null ? void 0 : p.length) > 0 && o.value === "microphone";
}), c = f(() => e.value ? t != null && t.value.isAudioAvailable ? "basicConfig" : "closedConfig" : "loadingConfig"), r = jA("microphone", c), d = uA(), g = f(() => t != null && t.value.isAudioAvailable ? d.value("microphone enabled") : d.value("microphone disabled")), N = async () => {
t != null && t.value.isAudioAvailable ? await W.closeMicrophone() : await W.openMicrophone();
}, C = () => {
o.value = "microphone";
};
return (p, y) => (I(), h("div", oc, [
n(A) ? (I(), E(bt, {
key: 0,
color: "rgba(107, 117, 138, 0.5)",
show: n(s),
onHover: C,
trigger: "hover"
}, {
content: v(() => [
S(Ut, {
isShowControlBtn: !0,
deviceType: n(mA).MICROPHONE
}, null, 8, ["deviceType"])
]),
trigger: v(() => [
S(wA, {
loading: !n(e),
iconSrc: n(r).iconSrc,
color: n(r).color,
iconSize: n(r).iconSize,
width: n(r).width,
height: n(r).height,
loadingWidth: n(r).loadingWidth,
loadingHeight: n(r).loadingHeight,
shape: n(r).shape,
onClick: N
}, null, 8, ["loading", "iconSrc", "color", "iconSize", "width", "height", "loadingWidth", "loadingHeight", "shape"])
]),
_: 1
}, 8, ["show"])) : w("", !0),
n(A) ? w("", !0) : (I(), E(wA, {
key: 1,
loading: !n(e),
iconSrc: n(r).iconSrc,
color: n(r).color,
iconSize: n(r).iconSize,
width: n(r).width,
height: n(r).height,
loadingWidth: n(r).loadingWidth,
loadingHeight: n(r).loadingHeight,
shape: n(r).shape,
onClick: N
}, null, 8, ["loading", "iconSrc", "color", "iconSize", "width", "height", "loadingWidth", "loadingHeight", "shape"])),
n(r).showText ? (I(), E(pA, {
key: 2,
textStyle: n(r).textStyle,
color: n(r).textColor,
size: n(r).textSize
}, {
default: v(() => [
MA(B(n(g)), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const lc = /* @__PURE__ */ X(ic, [["__scopeId", "data-v-1a5a5781"]]), sc = { class: "btn-content" }, rc = {
options: {
virtualHost: !0
}
}, cc = /* @__PURE__ */ z({
...rc,
__name: "Reject",
props: XA,
setup(a) {
const A = a, e = jA("reject", L("basicConfig")), t = uA(), o = async () => {
await W.reject();
};
return (i, s) => (I(), h("div", sc, [
S(wA, {
iconSrc: n(e).iconSrc,
color: n(e).color,
iconSize: n(e).iconSize,
width: A.width || n(e).width,
height: A.height || n(e).height,
shape: n(e).shape,
onClick: o
}, null, 8, ["iconSrc", "color", "iconSize", "width", "height", "shape"]),
n(e).showText ? (I(), E(pA, {
key: 0,
textStyle: n(e).textStyle,
color: n(e).textColor,
size: n(e).textSize
}, {
default: v(() => [
MA(B(n(t)("reject")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const uc = /* @__PURE__ */ X(cc, [["__scopeId", "data-v-cc016de6"]]), dc = { class: "btn-content" }, Ic = {
options: {
virtualHost: !0
}
}, gc = /* @__PURE__ */ z({
...Ic,
__name: "Speaker",
props: XA,
setup(a) {
const A = O.isWeChat, e = O.isPC, t = a, { isEarPhone: o, isMuteSpeaker: i } = G(rA()), s = it(), c = uA(), r = f(() => o.value ? "closedConfig" : "basicConfig"), d = f(() => i.value ? "closedConfig" : "basicConfig"), [{ deviceList: g, currentDeviceId: N }] = ot(mA.SPEAKER), C = f(() => {
var j;
return ((j = g.value) == null ? void 0 : j.length) > 0 && s.value === "speaker" && e;
}), p = A ? jA("speaker", r) : jA("speaker", d);
f(() => o.value ? c.value("speaker disabled") : c.value("speaker enabled"));
const y = async () => {
i.value ? await W.unMuteSpeaker() : await W.muteSpeaker();
}, m = () => {
if (e) {
const j = g.value.find((k) => k.deviceId === N.value);
return j ? j.label : c.value("speaker enabled");
} else
return i.value ? c.value("speaker disabled") : c.value("speaker enabled");
}, D = () => {
s.value = "speaker";
};
return (j, k) => (I(), h("div", dc, [
S(bt, {
color: "rgba(107, 117, 138, 0.5)",
show: n(C),
onHover: D,
trigger: "hover"
}, {
content: v(() => [
S(Ut, {
isShowControlBtn: !0,
deviceType: n(mA).SPEAKER
}, null, 8, ["deviceType"])
]),
trigger: v(() => [
S(wA, {
iconSrc: n(p).iconSrc,
color: n(p).color,
iconSize: t.iconSize || n(p).iconSize,
width: t.width || n(p).width,
height: t.height || n(p).height,
shape: n(p).shape,
onClick: y
}, null, 8, ["iconSrc", "color", "iconSize", "width", "height", "shape"])
]),
_: 1
}, 8, ["show"]),
n(p).showText ? (I(), E(pA, {
key: 0,
width: "60px",
truncated: !0,
textStyle: n(p).textStyle,
color: n(p).textColor,
size: n(p).textSize,
lineClamp: 2
}, {
default: v(() => [
MA(B(m()), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const Mc = /* @__PURE__ */ X(gc, [["__scopeId", "data-v-44a3def7"]]), pc = { class: "btn-content" }, Nc = {
options: {
virtualHost: !0
}
}, Cc = /* @__PURE__ */ z({
...Nc,
__name: "SwitchCamera",
setup(a) {
const { localUserInfoExcludeVolume: A } = G(OA()), e = f(() => A == null ? void 0 : A.value.isVideoAvailable), t = f(() => e.value ? "basicConfig" : "disableConfig"), o = jA("switchCamera", t), i = uA(), s = async () => {
e.value && await W.switchCamera();
};
return (c, r) => (I(), h("div", pc, [
S(wA, {
iconSrc: n(o).iconSrc,
iconSize: n(o).iconSize,
color: n(o).color,
width: n(o).width,
height: n(o).height,
buttonStyle: n(o).buttonStyle,
shape: "circle",
onClick: s
}, null, 8, ["iconSrc", "iconSize", "color", "width", "height", "buttonStyle"]),
n(o).showText ? (I(), E(pA, {
key: 0,
textStyle: n(o).textStyle,
color: n(o).textColor,
size: n(o).textSize
}, {
default: v(() => [
MA(B(n(i)("switch camera")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const Lc = /* @__PURE__ */ X(Cc, [["__scopeId", "data-v-df69c038"]]), hc = { class: "btn-content" }, Sc = {
options: {
virtualHost: !0
}
}, yc = /* @__PURE__ */ z({
...Sc,
__name: "VirtualBackground",
props: XA,
setup(a) {
const A = a, e = L(!0), { localUserInfoExcludeVolume: t } = G(OA()), o = f(() => t == null ? void 0 : t.value.isVideoAvailable), { enableVirtualBackground: i } = G(rA()), s = f(() => e.value ? i.value ? "closedConfig" : o.value ? "basicConfig" : "disableConfig" : "loadingConfig"), c = jA("virtualBackground", s), r = uA(), d = async () => {
o.value && (e.value = !1, await W.setBlurBackground(!i.value), e.value = !0);
};
return (g, N) => (I(), h("div", hc, [
S(wA, {
loading: !n(e),
iconSrc: n(c).iconSrc,
color: n(c).color,
iconSize: A.iconSize || n(c).iconSize,
width: A.width || n(c).width,
height: A.height || n(c).height,
shape: n(c).shape,
loadingWidth: n(c).loadingWidth,
loadingHeight: n(c).loadingHeight,
buttonStyle: n(c).buttonStyle,
onClick: d
}, null, 8, ["loading", "iconSrc", "color", "iconSize", "width", "height", "shape", "loadingWidth", "loadingHeight", "buttonStyle"]),
n(c).showText ? (I(), E(pA, {
key: 0,
width: "70px",
lineClamp: 2,
textStyle: n(c).textStyle,
color: n(c).textColor,
size: n(c).textSize
}, {
default: v(() => [
MA(B(n(r)("virtual-background")), 1)
]),
_: 1
}, 8, ["textStyle", "color", "size"])) : w("", !0)
]));
}
});
const fc = /* @__PURE__ */ X(yc, [["__scopeId", "data-v-f29c2e7a"]]), mc = { class: "btn-content" }, Tc = {
options: {
virtualHost: !0
}
}, vc = /* @__PURE__ */ z({
...Tc,
__name: "ToggleButtonPanel",
props: XA,
setup(a) {
const { status: A } = Pe(), e = a, t = jA("toggleButtonPanel", L("basicConfig")), o = async () => {
A.value = A.value === "close" ? "open" : "close";
};
return (i, s) => (I(), h("div", mc, [
S(wA, {
iconSrc: n(t).iconSrc,
color: n(t).color,
iconSize: e.iconSize || n(t).iconSize,
width: e.width || n(t).width,
height: e.height || n(t).height,
shape: n(t).shape,
onClick: o
}, null, 8, ["iconSrc", "color", "iconSize", "width", "height", "shape"])
]));
}
});
const Dc = /* @__PURE__ */ X(vc, [["__scopeId", "data-v-f7839a20"]]), wc = { class: "button-group" }, Ec = {
options: {
virtualHost: !0
}
}, jc = /* @__PURE__ */ z({
...Ec,
__name: "ButtonPanel",
setup(a) {
const A = L(null), e = L({}), { isGroupCall: t } = G(rA()), { status: o } = Pe() || {}, i = L(!1), s = L(!1), c = L(""), r = za();
Se(() => {
i.value || (t.value && !O.isPC && r.value !== null ? i.value = !0 : i.value = !1);
});
const d = f(() => iA([
"button-panel-container",
{
pc: O.isPC,
mobile: !O.isPC,
h5: O.isH5,
groupCall: t.value,
singleCall: !t.value,
close: (o == null ? void 0 : o.value) === "close",
open: (o == null ? void 0 : o.value) === "open",
showBackGround: i.value
}
])), g = iA([
"toggle-button-container",
{ h5: O.isH5 }
]), N = O.isH5 ? {
transitionProperty: "width,height,left,top",
transitionDuration: "0.3s",
transitionTimingFunction: "ease-in"
} : {};
function C(j) {
A.value = j;
}
const { layout: p, config: y } = wr();
cA(y, () => {
const j = {}, k = y.value.flat();
for (let q of k) {
const { name: b, props: Q = {} } = q;
Q.showText !== !1 && (Q.showText = !0), j[b] = Q;
}
e.value = j;
}, { immediate: !0 });
function m(j) {
s.value = j;
}
const D = {
[l.IS_CLICKABLE]: m
};
return yA(() => {
M.watch(
u.CALL,
D,
{
notifyRangeWhenWatch: l.MYSELF
}
);
}), LA(() => {
M.unwatch(u.CALL, D);
}), EA(ya, s), EA(fa, c), (j, k) => (I(), h("div", {
class: V(n(d))
}, [
T("div", wc, [
S(so, {
unit: "%",
onToggle: C,
layout: n(p),
focus: n(A)
}, {
default: v(() => [
S(BA, {
index: "accept",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(ac)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "reject",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(uc)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "microphone",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(lc)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "hangup",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S($r)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "speaker",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(Mc)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "camera",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(Hr)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "virtualBackground",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(fc)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "switchCamera",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(Lc)
]),
_: 1
}, 8, ["customStyle"]),
S(BA, {
index: "inviteUser",
height: "auto",
customStyle: n(N)
}, {
default: v(() => [
S(Qa)
]),
_: 1
}, 8, ["customStyle"])
]),
_: 1
}, 8, ["layout", "focus"])
]),
n(i) ? (I(), h("div", {
key: 0,
class: V(n(g))
}, [
S(Dc)
], 2)) : w("", !0)
], 2));
}
});
const co = /* @__PURE__ */ X(jc, [["__scopeId", "data-v-6582c17d"]]), zc = { class: "singlecall-container" }, bc = /* @__PURE__ */ z({
__name: "SingleCall",
setup(a) {
const { callStatus: A } = G(rA());
return (e, t) => (I(), h("div", zc, [
S(Fa),
n(A) === n(x).CALLING ? (I(), E(Ja, { key: 0 })) : w("", !0),
S(cr),
S(io),
S(co)
]));
}
});
const Uc = /* @__PURE__ */ X(bc, [["__scopeId", "data-v-317c1d41"]]), Oc = { class: "stream-loading-container" }, Vc = /* @__PURE__ */ z({
__name: "StreamLoading",
setup(a) {
return (A, e) => (I(), h("div", Oc, [
S(jt, {
mode: "dot",
color: "#FFF",
loadingWidth: "50px",
loadingHeight: "50px"
})
]));
}
});
const $t = /* @__PURE__ */ X(Vc, [["__scopeId", "data-v-56b8bc56"]]), Pc = {
options: {
virtualHost: !0
}
}, xc = /* @__PURE__ */ z({
...Pc,
__name: "MediaContainer",
setup(a) {
const A = L("local"), e = L(null), t = L(!1);
xe();
const { localUserInfoExcludeVolume: o, remoteUserListExcludeVolume: i } = G(OA()), { callStatus: s, callType: c, isShowEnableVirtualBackground: r, callRole: d } = G(rA()), { netWorkQualityList: g } = kn(), N = f(() => i.value.length + 1), C = ja(), p = Xn(e, N), y = Ea(), { isFloatWindow: m } = G(GA()), D = za(), { status: j } = Pe() || {}, k = !O.isPC, q = f(() => String(e.value) === "0"), b = f(() => !O.isPC && q.value && o.value.isVideoAvailable), Q = f(() => b.value), R = f(() => b.value && r.value && O.isWeChat), Z = f(() => O.isPC || q.value), K = f(() => O.isPC || m.value ? "%" : "vw"), dA = f(() => [o.value, ...i.value].map((oA) => {
var hA;
if (m.value) {
if (((hA = y.value) == null ? void 0 : hA[oA.domId]) >= 10)
return oA.domId;
} else
return oA.domId;
})), vA = f(() => !(d.value === gA.CALLEE && s.value === x.CALLING && !m.value)), ye = f(() => {
let oA = "";
return d.value === gA.CALLEE && s.value === x.CALLING && !m.value && (oA = "hidden"), {
visibility: oA
};
});
function ee(oA) {
e.value = oA, D.value = oA, j.value = oA !== null ? "close" : "open";
}
function te(oA) {
var hA, nA;
return O.isWeChat ? !((nA = (hA = C.value) == null ? void 0 : hA.find((kA) => kA.userID === oA.userId)) != null && nA.hasVideo) : !oA.isVideoAvailable;
}
function ae(oA) {
var hA, nA;
return O.isWeChat ? !((nA = (hA = C.value) == null ? void 0 : hA.find((kA) => kA.userID === oA.userId)) != null && nA.hasAudio) : !oA.isAudioAvailable;
}
function QA(oA) {
if (!g.value)
return;
const hA = oA !== o.value.userId;
if (!O.isWeChat && hA)
return;
const nA = g.value.find((kA) => kA.userId === oA);
return nA && (nA == null ? void 0 : nA.quality) >= 4;
}
cA([i, c], () => {
var oA, hA;
(hA = (oA = i.value) == null ? void 0 : oA[0]) != null && hA.isEnter && (A.value = "remote"), c.value === _.AUDIO ? t.value = !1 : t.value = !0;
});
const st = f(() => iA([
"groupcall-media-container",
{
mobile: !O.isPC,
pc: O.isPC,
"two-layout": N.value === 2 && e.value === null,
float: m.value
}
])), rt = f(() => s.value === x.CALLING && (c.value === _.AUDIO && !o.value.isAudioAvailable || c.value === _.VIDEO && !o.value.isVideoAvailable));
return (oA, hA) => (I(), E($a, {
id: "source",
disabled: !n(m),
source: "#source",
to: "body"
}, {
default: v(() => [
S(oo, null, {
default: v(() => [
T("div", {
class: V(n(st)),
style: AA([n(ye)])
}, [
S(so, {
unit: n(K),
"enable-focus": k,
focus: n(e),
length: n(N),
layout: n(p),
onToggle: ee
}, {
default: v(() => [
(I(), E(BA, {
index: 0,
key: n(o).userId
}, {
default: v(() => [
S(eo, {
domId: n(o).domId,
"show-audio-stream": !n(o).isVideoAvailable,
show: n(dA).includes(n(o).domId) && n(vA)
}, {
"audio-stream": v(() => [
S(At, {
"user-id": n(o).userId,
username: n(o).displayUserInfo,
avatar: n(o).avatar,
"is-video-available": n(o).isVideoAvailable
}, null, 8, ["user-id", "username", "avatar", "is-video-available"])
]),
loading: v(() => [
n(rt) ? (I(), E($t, { key: 0 })) : w("", !0)
]),
"stream-info": v(() => [
n(m) ? w("", !0) : (I(), E($e, {
key: 0,
"is-self": !0,
"show-nick-name": n(Z),
showSwitchCameraButton: n(Q),
showVirtualBackgroundButton: n(R),
showNetWorkStatus: QA(n(o).userId),
nickName: n(o).displayUserInfo,
isMuted: !n(o).isAudioAvailable,
volume: n(y) && n(y)[n(o).domId]
}, null, 8, ["show-nick-name", "showSwitchCameraButton", "showVirtualBackgroundButton", "showNetWorkStatus", "nickName", "isMuted", "volume"]))
]),
_: 1
}, 8, ["domId", "show-audio-stream", "show"])
]),
_: 1
})),
(I(!0), h(RA, null, ue(n(i), (nA, kA) => (I(), E(BA, {
key: nA.userId,
index: kA + 1
}, {
default: v(() => [
S(to, {
domId: nA.domId,
"show-audio-stream": te(nA),
show: n(dA).includes(nA.domId) && n(vA)
}, {
"audio-stream": v(() => [
S(At, {
"user-id": nA.userId,
username: nA.displayUserInfo,
avatar: nA.avatar
}, null, 8, ["user-id", "username", "avatar"])
]),
loading: v(() => [
nA.isEnter ? w("", !0) : (I(), E($t, { key: 0 }))
]),
"stream-info": v(() => [
n(m) ? w("", !0) : (I(), E($e, {
key: 0,
"show-nick-name": n(O).isPC || String(n(e)) === String(kA + 1),
"show-control-button": !1,
showNetWorkStatus: QA(nA.userId),
nickName: nA.displayUserInfo,
"is-muted": ae(nA),
volume: n(y) && n(y)[nA.domId]
}, null, 8, ["show-nick-name", "showNetWorkStatus", "nickName", "is-muted", "volume"]))
]),
_: 2
}, 1032, ["domId", "show-audio-stream", "show"])
]),
_: 2
}, 1032, ["index"]))), 128))
]),
_: 1
}, 8, ["unit", "focus", "length", "layout"])
], 6)
]),
_: 1
})
]),
_: 1
}, 8, ["disabled"]));
}
});
const Bc = /* @__PURE__ */ X(xc, [["__scopeId", "data-v-0629f0d8"]]), Rc = {
key: 0,
class: "dialog-main-header"
}, Gc = { class: "dialog-main-title" }, kc = {
key: 1,
class: "dialog-main-footer"
}, qc = /* @__PURE__ */ z({
__name: "TDialog",
props: {
isHeaderShow: {
type: Boolean,
default: !0
},
isFooterShow: {
type: Boolean,
default: !0
},
background: {
type: Boolean,
default: !0
},
title: {
type: String,
default: ""
},
center: {
type: Boolean,
default: !1
},
isH5: {
type: Boolean,
default: !1
}
},
emits: ["cancel", "submit"],
setup(a, { emit: A }) {
const e = {
OUTSIDE: "outside",
INSIDE: "inside"
}, t = a, o = L(!0), i = L(!0), s = L(!0), c = L(""), r = uA();
Se(() => {
c.value = t.title, o.value = t.isHeaderShow, i.value = t.isFooterShow, s.value = t.background;
});
const d = A, g = (p) => {
p === e.OUTSIDE && N();
}, N = () => {
d("cancel");
}, C = () => {
d("submit");
};
return (p, y) => (I(), h("div", {
class: V(["dialog", [t.isH5 ? "dialog-h5" : "", a.center ? "center" : ""]]),
onClick: y[1] || (y[1] = Le((m) => g(e.OUTSIDE), ["stop", "prevent"]))
}, [
T("main", {
class: V(["dialog-main", [n(s) ? "" : "dialog-main-back"]]),
onClick: y[0] || (y[0] = Le((m) => g(e.INSIDE), ["stop", "prevent"]))
}, [
n(o) ? (I(), h("header", Rc, [
T("h1", Gc, B(n(c)), 1),
T("i", {
class: "icon icon-close",
onClick: N
})
])) : w("", !0),
T("div", {
class: V(["dialog-main-content", [t.isH5 ? "dialog-main-content-uniapp" : ""]])
}, [
H(p.$slots, "default", {}, void 0, !0)
], 2),
n(i) ? (I(), h("footer", kc, [
T("button", {
class: "btn btn-cancel",
onClick: N
}, B(n(r)("Cancel")), 1),
T("button", {
class: "btn btn-default",
onClick: C
}, B(n(r)("Done")), 1)
])) : w("", !0)
], 2)
], 2));
}
});
const Wc = /* @__PURE__ */ X(qc, [["__scopeId", "data-v-26735e82"]]), Xc = ["src"], Qc = ["src"], Fc = /* @__PURE__ */ z({
__name: "TIcon",
props: {
file: {
type: String,
default: ""
},
width: {
type: String,
default: "20px"
},
height: {
type: String,
default: "20px"
},
isApp: {
type: Boolean,
default: !1
}
},
emits: ["click"],
setup(a, { emit: A }) {
const e = A, t = a, o = () => {
e("click");
};
return (i, s) => (I(), h("div", {
class: "icon",
onClick: o
}, [
t.isApp ? (I(), h("image", {
key: 0,
class: "icon",
src: t.file,
style: AA({ width: t.width, height: t.height })
}, null, 12, Xc)) : (I(), h("img", {
key: 1,
class: "icon",
src: t.file,
style: AA({ width: t.width, height: t.height })
}, null, 12, Qc))
]));
}
});
const We = /* @__PURE__ */ X(Fc, [["__scopeId", "data-v-b989a330"]]), Aa = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTZweCIgaGVpZ2h0PSIxNnB4IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHZlcnNpb249IjEuMSI+CiAgPHRpdGxlPue8lue7hCAxNDwvdGl0bGU+CiAgPGRlZnM+CiAgICA8ZmlsdGVyIHg9Ii0xMC42JSIgeT0iLTUuNCUiIHdpZHRoPSIxMjEuMiUiIGhlaWdodD0iMTEwLjklIiBmaWx0ZXJVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIGlkPSJmaWx0ZXItMSI+CiAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk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MS42MjQwMzQ0LDYuNDg1NDg2MzQgMjEuNjI0ODEzOCw2LjQ4NjIzMDk3IDIxLjYyNTU5MTUsNi40ODY5Nzc0MSBMMjMuNDk3MzE4Nyw4LjI4MzU1NTI0IEMyMy43NzUzMTY4LDguNTUwMzkxNzUgMjMuNzg1Mzc4LDguOTkxNzMxMTQgMjMuNTE5ODI4Niw5LjI3MDk1ODkzIEw5LjUxMjMxMDcxLDI0IEw5LjUxMjMxMDcxLDI0IFoiIGlkPSJQYXRoLTIiPjwvcGF0aD4KICAgICAgICAgIDwvZz4KICAgICAgICAgIDxyZWN0IGlkPSLnn6
key: 1,
class: "icon-unselected"
}, ou = { class: "select-all" }, nu = ["onClick"], iu = ["src"], lu = { class: "name" }, su = { key: 0 }, ru = { class: "right" }, cu = {
key: 0,
class: "transfer-header"
}, uu = {
key: 1,
class: "transfer-list"
}, du = {
key: 0,
class: "transfer-text"
}, Iu = { class: "transfer-list-item-content" }, gu = ["src"], Mu = {
key: 0,
class: "name"
}, pu = ["onClick"], Nu = { class: "transfer-right-footer" }, Cu = /* @__PURE__ */ z({
__name: "TTransfer",
props: {
list: {
type: Array,
default: () => []
},
selectedList: {
type: Array,
default: () => []
},
isSearch: {
type: Boolean,
default: !0
},
isRadio: {
type: Boolean,
default: !1
},
isCustomItem: {
type: Boolean,
default: !1
},
title: {
type: String,
default: ""
},
type: {
type: String,
default: ""
},
resultShow: {
type: Boolean,
default: !0
},
total: {
type: Number,
default: 0
},
isH5: {
type: Boolean,
default: !1
}
},
emits: ["search", "submit", "cancel", "getMore"],
setup(a, { emit: A }) {
const e = a, t = A, o = L(""), i = L([]), s = L(0), c = L([]), r = L(!0), d = L(!1), g = L(""), N = L(""), C = uA();
Se(() => {
const { list: b, isCustomItem: Q, isSearch: R, title: Z, total: K, selectedList: dA } = e;
if (Q)
for (let vA = 0; vA < b.length; vA++)
b[vA].conversationID.indexOf("@TIM#SYSTEM") > -1 && b.splice(vA, 1), i.value = b;
else
i.value = b;
s.value = K || b.length, c.value = dA && dA.length > 0 ? dA : c.value, r.value = R, d.value = Q, g.value = Z, o.value = e.type;
});
const p = f(
() => i.value.filter((b) => !b.isDisabled)
), y = (b) => {
N.value = b.target.value, t("search", b.target.value);
}, m = (b) => {
if (b.isDisabled)
return;
let Q = c.value;
const R = Q.indexOf(b);
if (R > -1)
return c.value.splice(R, 1);
e.isRadio && (Q = []), Q.push(b), c.value = Q;
}, D = () => {
c.value.length === p.value.length ? c.value = [] : c.value = [...p.value];
}, j = () => {
t("submit", c.value), N.value = "", c.value = [];
}, k = () => {
t("cancel"), N.value = "", c.value = [];
}, q = () => {
t("getMore");
};
return (b, Q) => (I(), h("div", {
class: V(["transfer", [e.isH5 ? "transfer-h5" : ""]])
}, [
e.isH5 ? (I(), h("header", {
key: 0,
class: "transfer-header transfer-h5-header",
onClick: k
}, [
S(We, {
class: "icon",
file: n(Zc),
width: "18px",
height: "18px"
}, null, 8, ["file"]),
T("span", Hc, B(n(g)), 1),
Q[0] || (Q[0] = T("span", { class: "space" }, null, -1))
])) : w("", !0),
T("main", Kc, [
T("div", Jc, [
T("header", _c, [
!e.isH5 && n(r) ? (I(), h("input", {
key: 0,
type: "text",
value: n(N),
onKeyup: Po(y, ["enter"]),
placeholder: n(C)("Please enter userID"),
enterkeyhint: "search",
class: V([e.isH5 ? "left-uniapp-input" : ""])
}, null, 42, $c)) : w("", !0),
e.isH5 && n(r) ? (I(), h("input", {
key: 1,
type: "text",
onBlur: y,
onConfirm: y,
placeholder: n(C)("Please enter userID"),
enterkeyhint: "search",
value: n(N),
class: V([e.isH5 ? "left-uniapp-input" : ""])
}, null, 42, Au)) : w("", !0)
]),
T("main", eu, [
T("ul", tu, [
n(p).length > 1 && !a.isRadio ? (I(), h("li", {
key: 0,
class: "transfer-list-item",
onClick: D
}, [
n(c).length === n(p).length ? (I(), E(We, {
key: 0,
file: n(Aa),
width: "18px",
height: "18px"
}, null, 8, ["file"])) : (I(), h("i", au)),
T("span", ou, B(n(C)("Select all")), 1)
])) : w("", !0),
(I(!0), h(RA, null, ue(n(i), (R) => (I(), h("li", {
class: "transfer-list-item",
key: R.userID,
onClick: (Z) => m(R)
}, [
n(c).indexOf(R) > -1 ? (I(), E(We, {
key: 0,
file: n(Aa),
class: V([R.isDisabled && "disabled"]),
width: "18px",
height: "18px"
}, null, 8, ["file", "class"])) : (I(), h("i", {
key: 1,
class: V([R.isDisabled && "disabled", "icon-unselected"])
}, null, 2)),
n(d) ? H(b.$slots, "left", {
key: 3,
data: R
}, void 0, !0) : (I(), h(RA, { key: 2 }, [
T("img", {
class: "avatar",
src: R.avatar || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",
onerror: "this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"
}, null, 8, iu),
T("span", lu, B(R.nick || R.userID), 1),
R.isDisabled ? (I(), h("span", su)) : w("", !0)
], 64))
], 8, nu))), 128)),
n(s) > n(i).length ? (I(), h("li", {
key: 1,
class: "transfer-list-item more",
onClick: q
}, B(n(C)("View more")), 1)) : w("", !0)
])
])
]),
T("div", ru, [
e.isH5 ? w("", !0) : (I(), h("header", cu, B(n(g)), 1)),
a.resultShow ? (I(), h("ul", uu, [
n(c).length > 0 && !e.isH5 ? (I(), h("p", du, B(n(c).length) + " " + B(n(C)("people selected")), 1)) : w("", !0),
(I(!0), h(RA, null, ue(n(c), (R, Z) => (I(), h("li", {
class: "transfer-list-item space-between",
key: Z
}, [
T("aside", Iu, [
n(d) ? H(b.$slots, "right", {
key: 1,
data: R
}, void 0, !0) : (I(), h(RA, { key: 0 }, [
T("img", {
class: "avatar",
src: R.avatar || "https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png",
onerror: "this.src='https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_21.png'"
}, null, 8, gu),
e.isH5 ? w("", !0) : (I(), h("span", Mu, B(R.nick || R.userID), 1))
], 64))
]),
e.isH5 ? w("", !0) : (I(), h("span", {
key: 0,
onClick: (K) => m(R)
}, [
S(We, {
file: n(Yc),
width: "18px",
height: "18px"
}, null, 8, ["file"])
], 8, pu))
]))), 128))
])) : w("", !0),
T("footer", Nu, [
T("button", {
class: "btn btn-cancel",
onClick: k
}, B(n(C)("Cancel")), 1),
n(c).length > 0 ? (I(), h("button", {
key: 0,
class: "btn",
onClick: j
}, B(n(C)("Done")), 1)) : (I(), h("button", {
key: 1,
class: "btn btn-no",
onClick: j
}, B(n(C)("Done")), 1))
])
])
])
], 2));
}
});
const Lu = /* @__PURE__ */ X(Cu, [["__scopeId", "data-v-cc0325fc"]]), hu = /* @__PURE__ */ z({
__name: "SelectUser",
props: {
isRadio: {
type: Boolean,
default: !1
},
isNeedSearch: {
type: Boolean,
default: !1
},
title: {
type: String,
default: ""
},
userList: {
type: Array,
default: () => []
},
total: {
type: Number,
default: 0
},
isPC: {
type: Boolean,
default: !0
}
},
emits: ["confirm", "cancel", "search", "getMore"],
setup(a, { emit: A }) {
const e = A, t = a, o = () => {
e("cancel");
}, i = (r) => {
e("confirm", r);
}, s = (r) => {
e("search", r);
}, c = () => {
e("getMore");
};
return (r, d) => (I(), E(Wc, {
isH5: !a.isPC,
isHeaderShow: !1,
isFooterShow: !1,
background: !1,
onCancel: o
}, {
default: v(() => [
S(Lu, {
isSearch: t.isNeedSearch,
title: t.title,
list: t.userList,
isH5: !a.isPC,
isRadio: t.isRadio,
total: t.total,
onGetMore: c,
onSearch: s,
onSubmit: i,
onCancel: o
}, null, 8, ["isSearch", "title", "list", "isH5", "isRadio", "total"])
]),
_: 1
}, 8, ["isH5"]));
}
}), Su = {
options: {
virtualHost: !0
}
}, yu = /* @__PURE__ */ z({
...Su,
__name: "BackGround",
setup(a) {
return (A, e) => (I(), E(Za, {
bgColor: "#22262ed9",
bgImage: n(WA),
customStyle: { position: "absolute", zIndex: 0 }
}, null, 8, ["bgImage"]));
}
}), fu = { class: "groupcall-container" }, ea = 30, mu = /* @__PURE__ */ z({
__name: "GroupCall",
setup(a) {
const A = L(null), e = L("open"), t = L(!1), o = L(0), i = L([]), s = L([]), c = L(0), r = A, d = { status: e }, { callRole: g, callStatus: N } = G(rA()), { isFloatWindow: C } = G(GA()), { localUserInfoExcludeVolume: p, remoteUserListExcludeVolume: y } = G(OA()), m = async (R) => {
if (t.value = R, t.value) {
await k();
const Z = await W.getGroupProfile();
o.value = Z.memberCount;
}
}, D = () => {
t.value = !1, M.update(u.CALL, l.SHOW_SELECT_USER, !1), c.value = 0, i.value = [];
}, j = async () => {
c.value += ea, await k();
}, k = async () => {
const R = await W.getGroupMemberList(ea, c.value), Z = [...y.value, p.value].map((K) => K.userId);
i.value.push(...R), i.value = i.value.map((K) => (Z.includes(K.userID) && (K = { ...K, isDisabled: !0 }), K)), s.value = i.value;
}, q = async (R) => {
try {
if (R.length <= 0)
return;
t.value = !1, M.update(u.CALL, l.SHOW_SELECT_USER, !1), c.value = 0;
const Z = R.map((K) => K.userID);
await W.inviteUser({ userIDList: Z }), i.value = [];
} catch (Z) {
console.debug(Z);
}
}, b = (R) => {
R ? i.value = i.value.filter((Z) => Z.userID.includes(R) || Z.nick.includes(R)) : i.value = s.value;
}, Q = {
[l.SHOW_SELECT_USER]: m
};
return yA(() => {
M.watch(u.CALL, Q, { notifyRangeWhenWatch: l.MYSELF });
}), LA(() => {
M.unwatch(u.CALL, Q);
}), d.status = L("open"), r.value = null, EA(ha, d), EA(La, r), (R, Z) => (I(), h("div", fu, [
S(Fa),
n(N) === n(x).CALLING && n(g) === n(gA).CALLEE && !n(C) ? (I(), E(Ja, { key: 0 })) : w("", !0),
S(Bc),
S(io),
S(co),
S(yu),
n(t) ? (I(), E(hu, {
key: 1,
isNeedSearch: !0,
userList: n(i),
isPC: n(O).isPC,
total: n(o),
onConfirm: q,
onCancel: D,
onGetMore: j,
onSearch: b
}, null, 8, ["userList", "isPC", "total"])) : w("", !0)
]));
}
});
const Tu = /* @__PURE__ */ X(mu, [["__scopeId", "data-v-aa4e300f"]]), vu = {}, Du = {
viewBox: "0 0 1024 1024",
xmlns: "http://www.w3.org/2000/svg",
"data-v-ea893728": ""
};
function wu(a, A) {
return I(), h("svg", Du, A[0] || (A[0] = [
T("path", {
fill: "currentColor",
d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
}, null, -1)
]));
}
const Eu = /* @__PURE__ */ X(vu, [["render", wu]]), ta = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAMAAYAAD/2wBDABYPEBMQDhYTEhMYFxYaIDYjIB4eIEIvMic2TkVSUU1FTEpWYXxpVlx1XUpMbJNtdYCEi4yLVGiZo5eHonyIi4b/2wBDARcYGCAcID8jIz+GWUxZhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhob/wAARCAOABTgDASIAAhEBAxEB/8QAGwABAAIDAQEAAAAAAAAAAAAAAAECAwQFBgf/xABOEAABAwICBQcIBwYFAwQCAwEAAQIDBBEFEhMhMVFSFBUyQZGS0RYiU1RhcaLhNDVkcoGxwQYjM0JzoSSCg8LwQ2KTJWN0siY2RFXxlP/EABkBAQADAQEAAAAAAAAAAAAAAAABAwQCBf/EACsRAQABAwQBAwQDAQEBAQAAAAABAgNRERMUUhIEMUEhMlNxM0JhIjSBof/aAAwDAQACEQMRAD8A4OHYfPiVSkMKe1zl2NTeexoP2eoKNqZoknk63ypf+2xCf2coko8Ljdb95Mmkevv2f2OodTLqZVaxjOgxrfc2xe67yAcoTdd4uu8gATdd4uu8gATdd4uu8gATdd4uu8gATdRdSABN13i6kACbqLqQAJuoupAAm6i6kACbqLqQAJuoupAAm6i6kACbqLqQAJuoupAAm6i6kACbqLqQAJuoupAAm6i6kACbqLqQAJuoupAAm6i6kACbqLqQAJuoupAAm6i6kACbqLqQ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body" }, Vu = { class: "card-wrapper" }, Pu = { class: "title" }, xu = { class: "button" }, Bu = { class: "allow" }, Ru = { class: "image-wrapper" }, Gu = ["src"], ku = /* @__PURE__ */ z({
__name: "SystemPermitTip",
props: {
platform: {},
language: {}
},
setup(a) {
const A = {
mac: {
"zh-cn": ta,
en: ju
},
win: {
"zh-cn": zu,
en: bu
}
}, e = a, t = f(() => e.platform === "mac" ? "mac-privacy" : "win-privacy"), o = f(() => e.platform === "mac" ? "mac-preferences" : "win-preferences"), i = L(ta), s = L(!0), c = uA(), r = (g) => {
g && O.isPC && (s.value = !0);
}, d = () => {
s.value = !1;
};
return cA(() => e.language, () => {
i.value = A[e.platform][e.language];
}, {
immediate: !0
}), yA(() => {
M.watch(u.CALL, {
[l.SHOW_PERMISSION_TIP]: r
}, {
notifyRangeWhenWatch: l.MYSELF
});
}), LA(() => {
M.unwatch(u.CALL, {
[l.SHOW_PERMISSION_TIP]: r
});
}), (g, N) => n(s) ? (I(), h("div", Uu, [
T("div", Ou, [
T("div", {
class: "close",
onClick: d
}, [
S(Eu)
]),
T("div", Vu, [
T("div", Pu, B(n(c)("browser-authorization")), 1),
T("div", xu, B(n(c)(n(o))), 1),
T("div", Bu, B(n(c)(n(t))), 1),
T("div", Ru, [
T("img", {
src: n(i),
class: "image",
alt: "system permit"
}, null, 8, Gu)
])
])
])
])) : w("", !0);
}
});
const qu = /* @__PURE__ */ X(ku, [["__scopeId", "data-v-9982fa76"]]), Wu = { class: "tip" }, Xu = { class: "card" }, Qu = /* @__PURE__ */ z({
__name: "PermitTip",
setup(a) {
const A = f(() => O.isMAC ? Ct.MAC : Ct.WIN), e = L(M.getData(u.CALL, l.LANGUAGE)), t = (o) => e.value = o;
return yA(() => {
M.watch(u.CALL, {
[l.LANGUAGE]: t
}, {
notifyRangeWhenWatch: l.MYSELF
});
}), LA(() => {
M.unwatch(u.CALL, {
[l.LANGUAGE]: t
});
}), (o, i) => (I(), h("div", Wu, [
T("div", Xu, [
S(qu, {
platform: n(A),
language: n(e)
}, null, 8, ["platform", "language"])
])
]));
}
});
const Fu = /* @__PURE__ */ X(Qu, [["__scopeId", "data-v-cd63c32e"]]), uo = {};
let Nt = null, Zu = 1;
const Yu = () => {
const a = document.body, A = document.createElement("div");
Nt && (a.removeChild(Nt.el), be(null, A));
const e = S(Fu, {
index: `permit-item-${Zu++}`,
// eslint-disable-line
destroy() {
be(null, A);
}
});
be(e, A), a.appendChild(A.firstElementChild), Nt = e;
};
uo.show = () => Yu();
const Hu = { class: "toast-content" }, Ku = /* @__PURE__ */ z({
__name: "Toast",
props: {
type: {},
duration: {},
message: {},
index: {},
showClose: { type: Boolean },
destroy: { type: Function },
close: { type: Function }
},
setup(a) {
const A = a, e = L(!1), t = L(null), o = f(() => `toast-container ${A.type}`), i = () => {
A.destroy();
}, s = () => {
A.close(), e.value = !1;
}, c = () => {
t.value && clearTimeout(t.value), A.duration && (t.value = setTimeout(() => {
s();
}, A.duration));
};
return yA(() => {
e.value = !0, c();
}), LA(() => {
t.value && clearTimeout(t.value);
}), (r, d) => (I(), E(xo, {
name: "slide-up",
onAfterLeave: i
}, {
default: v(() => [
lA((I(), h("div", {
key: r.index,
class: V(n(o))
}, [
T("div", Hu, B(r.message), 1),
lA(T("i", {
onClick: s,
class: "toast-close-icon"
}, null, 512), [
[sA, r.showClose]
])
], 2)), [
[sA, n(e)]
])
]),
_: 1
}));
}
});
const Ju = /* @__PURE__ */ X(Ku, [["__scopeId", "data-v-27fc22c5"]]), KA = {}, VA = [];
let _u = 1;
function $u() {
var A, e, t;
const a = VA.length;
return a > 0 ? (t = (e = (A = VA[a - 1]) == null ? void 0 : A.el) == null ? void 0 : e.style) == null ? void 0 : t.top : "30px";
}
function Ad() {
var A, e;
const a = VA.length;
return a > 0 ? (e = (A = VA[a - 1]) == null ? void 0 : A.el) == null ? void 0 : e.offsetHeight : 0;
}
const Io = (a) => {
const { type: A, duration: e = 3e3, message: t, showClose: o = !1, onClose: i } = a, s = document.body, c = document.createElement("div"), r = S(Ju, {
type: A,
duration: e,
message: t,
showClose: o,
index: `toast-item-${_u++}`,
// eslint-disable-line
close() {
var p, y, m, D;
const N = VA.findIndex((j) => j === r);
console.log((y = (p = VA[N]) == null ? void 0 : p.el) == null ? void 0 : y.offsetHeight);
const C = parseInt((D = (m = VA[N]) == null ? void 0 : m.el) == null ? void 0 : D.offsetHeight) + 20;
for (let j = 0; j < VA.length; j++)
j < N || (VA[j].el.style.top = parseInt(VA[j].el.style.top) - C + "px");
VA.splice(N, 1);
},
destroy() {
be(null, c);
}
});
be(r, c), s.appendChild(c.firstElementChild);
const d = $u(), g = Ad();
r.el.style.top = parseInt(d) + parseInt(g) + 20 + "px", VA.push(r);
};
["info", "waring", "error", "success"].forEach((a) => {
let A = {};
KA[a] = (e) => {
typeof e == "string" ? A.message = e : A = e, Io({ type: a, ...A });
};
});
KA.show = (a) => {
let A = {};
return typeof a == "string" ? (A.message = a, A.type = "info") : A = a, Io({ type: "info", ...A });
};
const lt = /* @__PURE__ */ z({
__name: "TUICallKit",
props: {
beforeCalling: {},
afterCalling: {},
onMinimized: {},
onMessageSentByMe: {},
kickedOut: {},
statusChanged: {},
allowedMinimized: { type: Boolean, default: !1 },
allowedFullScreen: { type: Boolean, default: !0 },
videoDisplayMode: { default: "cover" },
videoResolution: { default: "480p" }
},
setup(a) {
const A = !O.isPC, e = A ? "TUICallKit-mobile transition-animation" : "TUICallKit-desktop", t = L(""), o = L(""), i = L(""), s = L(!1), c = a, r = L(M.getData(u.CALL, l.CALL_STATUS)), d = L(M.getData(u.CALL, l.CALL_ROLE)), g = L(M.getData(u.CALL, l.CALL_MEDIA_TYPE)), N = L(M.getData(u.CALL, l.IS_GROUP)), C = L(M.getData(u.CALL, l.IS_EAR_PHONE)), p = L(null), y = L(M.getData(u.CALL, l.LOCAL_USER_INFO_EXCLUDE_VOLUMN)), m = L(M.getData(u.CALL, l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST)), D = L(M.getData(u.CALL, l.CALLER_USER_INFO)), j = L(M.getData(u.CALL, l.IS_MINIMIZED)), k = L(M.getData(u.CALL, l.ENABLE_VIRTUAL_BACKGROUND)), q = L(M.getData(u.CALL, l.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND)), b = L(M.getData(u.CALL, l.CUSTOM_UI_CONFIG)), Q = L(M.getData(u.CALL, l.IS_MUTE_SPEAKER)), R = L(M.getData(u.CALL, l.TRANSLATE)), Z = Be({
callStatus: r,
callRole: d,
callType: g,
isGroupCall: N,
isEarPhone: C,
focusElement: p,
allowedFullScreen: c.allowedFullScreen,
enableVirtualBackground: k,
isShowEnableVirtualBackground: q,
isMuteSpeaker: Q
}), K = Be({ callerUserInfo: D }), dA = Be({
localUserInfoExcludeVolume: y,
remoteUserListExcludeVolume: m
}), vA = Be({ isFloatWindow: j }), ye = L(R), {
beforeCalling: ee,
afterCalling: te,
onMinimized: ae,
onMessageSentByMe: QA,
videoDisplayMode: st,
videoResolution: rt,
kickedOut: oA,
statusChanged: hA,
allowedMinimized: nA
} = G(c), kA = (J) => {
Z.callStatus = J;
}, Mo = (J) => {
Z.isGroupCall = J;
}, po = (J) => {
if (typeof J == "object") {
const { content: oe, type: jo = "info" } = J;
!wa(oe) && Eo(R.value(oe), jo);
}
}, No = (J) => {
Z.callType = J, A && s.value && (i.value = "miniMized-mobile-audio", o.value = ""), A && !s.value && (o.value = "mobile-audio");
}, Ot = (J) => {
vA.isFloatWindow = J, J ? A ? Z.callType === _.AUDIO ? o.value = "miniMized-mobile-audio" : i.value = "miniMized-mobile-video" : t.value = "miniMized" : (o.value = "mobile-audio", t.value = "", i.value = "");
}, Co = (J) => {
if (J && O.isPC)
try {
uo.show();
} catch (oe) {
console.debug(oe);
}
}, Lo = (J) => {
Z.callRole = J;
}, ho = (J) => {
dA.localUserInfoExcludeVolume = J;
}, So = (J) => {
dA.remoteUserListExcludeVolume = J;
}, yo = (J) => {
K.callerUserInfo = J;
}, fo = (J) => {
Z.isEarPhone = J;
}, mo = (J) => {
Z.enableVirtualBackground = J;
}, To = (J) => {
Z.isShowEnableVirtualBackground = J;
}, vo = (J) => {
b.value = J;
}, Do = (J) => {
Z.isMuteSpeaker = J;
}, wo = (J) => {
R.value = J;
};
Se(() => {
W.setCallback({
beforeCalling: ee && ee.value,
afterCalling: te && te.value,
onMinimized: ae && ae.value,
onMessageSentByMe: QA && QA.value,
kickedOut: oA && oA.value,
statusChanged: hA && hA.value
});
});
const Vt = {
[l.CALL_STATUS]: kA,
[l.IS_GROUP]: Mo,
[l.TOAST_INFO]: po,
[l.CALL_MEDIA_TYPE]: No,
[l.SHOW_PERMISSION_TIP]: Co,
[l.CALL_ROLE]: Lo,
[l.LOCAL_USER_INFO_EXCLUDE_VOLUMN]: ho,
[l.REMOTE_USER_INFO_EXCLUDE_VOLUMN_LIST]: So,
[l.CALLER_USER_INFO]: yo,
[l.IS_EAR_PHONE]: fo,
[l.ENABLE_VIRTUAL_BACKGROUND]: mo,
[l.IS_SHOW_ENABLE_VIRTUAL_BACKGROUND]: To,
[l.CUSTOM_UI_CONFIG]: vo,
[l.IS_MUTE_SPEAKER]: Do,
[l.TRANSLATE]: wo
};
yA(() => {
nA.value && W.enableFloatWindow(nA.value), W.setVideoDisplayMode(st.value), W.setVideoResolution(rt.value), M.watch(
u.CALL,
Vt,
{
notifyRangeWhenWatch: l.MYSELF
}
), M.watch(u.CALL, {
[l.IS_MINIMIZED]: Ot
});
});
function Eo(J, oe) {
switch (oe) {
case "info":
KA == null || KA.info(J);
break;
case "error":
KA == null || KA.error(J);
break;
}
}
return LA(async () => {
M.unwatch(u.CALL, {
...Vt,
[l.IS_MINIMIZED]: Ot
});
}), EA(pa, Z), EA(Na, K), EA(Ca, dA), EA(Sa, vA), EA(ma, b), EA(Ta, ye), (J, oe) => n(Z).callStatus !== n(x).IDLE ? (I(), h("div", {
key: 0,
style: AA([{ visibility: n(vA).isFloatWindow ? "hidden" : "" }]),
id: "tuicallkit-id",
class: V([n(e), n(t), n(i), n(o)])
},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lsLjY4Ny4zMmEuMzU2LjM1NiAwIDAgMCAuNTA2LS4zMjJ2LTIuNzNjMC0uMjYtLjI3LS40MzItLjUwNi0uMzIybC0uNjg3LjMyYS4zMi4zMiAwIDAgMS0uNDU1LS4yOVYyLjQ5YS4zNTYuMzU2IDAgMCAwLS4zNTUtLjM1Nkg4Ljg4OXoiIGZpbGw9IiMxQzY2RTUiLz48L3N2Zz4=", ed = { class: "banner-pc" }, td = { class: "text" }, ad = { class: "content" }, od = { class: "avatar-box" }, nd = /* @__PURE__ */ z({
__name: "JoinGroupCard",
props: {
userListInfo: {
type: Array,
default: []
}
},
emits: ["joinGroupCall"],
setup(a, { emit: A }) {
const e = A, t = L(!1), o = uA(), i = () => {
e("joinGroupCall"), t.value = !1;
}, s = () => {
t.value = !t.value;
};
return (c, r) => (I(), h("div", ed, [
T("div", {
class: "top",
onClick: s
}, [
S(TA, {
class: "call-icon",
src: n(go),
width: "16px",
height: "16px"
}, null, 8, ["src"]),
T("span", td, B(a.userListInfo.length) + " " + B(n(o)("people on the call")), 1)
]),
lA(T("div", ad, [
r[0] || (r[0] = T("div", { class: "content-arrows" }, null, -1)),
T("div", od, [
(I(!0), h(RA, null, ue(a.userListInfo, (d) => (I(), E(TA, {
class: "avatar",
src: d == null ? void 0 : d.avatar,
defaultSrc: n(WA),
fit: "cover",
width: "32px",
height: "32px"
}, null, 8, ["src", "defaultSrc"]))), 256))
]),
T("div", {
class: "btn",
onClick: i
}, B(n(o)("join")), 1)
], 512), [
[sA, n(t)]
])
]));
}
});
const id = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTkuNSAwIDUgMy43NS41IDB2MS41NjJsNC4xMTYgMy40My4zODQuMzIuMzg0LS4zMkw5LjUgMS41NjJWMHoiIGZpbGw9IiM2NjYiLz48L3N2Zz4=", ld = { class: "banner-h5" }, sd = { class: "left" }, rd = { class: "text" }, cd = { class: "content-box" }, ud = { class: "content" }, dd = { class: "avatar-box" }, Id = /* @__PURE__ */ z({
__name: "JoinGroupCard",
props: {
userListInfo: {
type: Array,
default: []
}
},
emits: ["joinGroupCall"],
setup(a, { emit: A }) {
const e = uA(), t = L({ margin: "8px 10px 8px 0px" }), o = L({
margin: "6px",
borderRadius: "4px"
}), i = L(!1), s = A, c = () => {
s("joinGroupCall"), i.value = !1;
}, r = () => {
i.value = !i.value;
};
return (d, g) => (I(), h("div", ld, [
T("div", {
class: "top",
onClick: r
}, [
T("div", sd, [
S(TA, {
class: "call-icon",
src: n(go),
width: "16px",
height: "16px",
customStyle: n(t)
}, null, 8, ["src", "customStyle"]),
T("span", rd, B(a.userListInfo.length) + " " + B(n(e)("people on the call")), 1)
]),
S(TA, {
src: n(id),
width: "9px",
height: "9px"
}, null, 8, ["src"])
]),
lA(T("div", cd, [
T("div", ud, [
T("div", dd, [
(I(!0), h(RA, null, ue(a.userListInfo, (N) => (I(), E(TA, {
src: N == null ? void 0 : N.avatar,
customStyle: n(o),
defaultSrc: n(WA),
fit: "cover",
width: "50px",
height: "50px"
}, null, 8, ["src", "customStyle", "defaultSrc"]))), 256))
]),
T("div", {
class: "btn",
onClick: Le(c, ["stop"])
}, B(n(e)("join")), 1)
])
], 512), [
[sA, n(i)]
])
]));
}
});
const gd = /* @__PURE__ */ z({
__name: "JoinGroupCard",
setup(a) {
const A = L(O.isPC), e = L(null), { groupId: t, roomId: o, roomIdType: i, callMediaType: s, groupCallMembers: c, callStatus: r } = G(Kn()), d = f(() => t && (r == null ? void 0 : r.value) === x.IDLE && c.value.length), g = async () => {
if (c.value.length > 9) {
e.value.show({
message: "Supports a maximum of 9 people for simultaneous calls",
type: "success"
});
return;
}
const N = {
type: s.value,
groupID: t.value,
roomID: i.value === 1 ? Number(o.value) : 0,
strRoomID: String(o.value)
};
try {
await W.joinInGroupCall(N);
} catch (C) {
console.error(`${l.PREFIX}joinInGroupCall fail: ${C}`);
}
};
return (N, C) => lA((I(), h("div", null, [
n(A) ? (I(), E(nd, {
key: 0,
userListInfo: n(c),
onJoinGroupCall: g
}, null, 8, ["userListInfo"])) : (I(), E(Id, {
key: 1,
userListInfo: n(c),
onJoinGroupCall: g
}, null, 8, ["userListInfo"])),
S(no, {
ref_key: "message",
ref: e
}, null, 512)
], 512)), [
[sA, n(d)]
]);
}
}), Md = (a) => (a.component("TUICallKit", { server: W }), W.bindTUICore(a), lt), pd = (a) => {
a.component("TUICallKit", lt).component("JoinGroupCard", gd), console.log("TUICallKit&mini installed", a);
};
lt.plugin = Md;
lt.install = pd;
const Sd = {
AUDIO_CALL: 1,
VIDEO_CALL: 2
}, yd = "3.3.9";
export {
_ as CallMediaType,
gA as CallRole,
_A as FeatureButton,
gd as JoinGroupCard,
Fe as LayoutMode,
l as NAME,
fA as STATUS,
u as StoreName,
lt as TUICallKit,
W as TUICallKitServer,
Sd as TUICallType,
O as TUIGlobal,
M as TUIStore,
yd as Version,
Ue as VideoDisplayMode,
Oe as VideoResolution,
pd as install,
Md as plugin,
de as t,
ZA as uiDesign
};