vue-parley 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +276 -0
- package/dist/chat.css +3223 -0
- package/dist/chunks/Call-CTIujxDi.cjs +818 -0
- package/dist/chunks/Call-CTIujxDi.cjs.map +1 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs +818 -0
- package/dist/chunks/Call-Dwuyd-Ut.mjs.map +1 -0
- package/dist/chunks/index-D50Yn7q4.cjs +7031 -0
- package/dist/chunks/index-D50Yn7q4.cjs.map +1 -0
- package/dist/chunks/index-JU_JZkSC.mjs +7010 -0
- package/dist/chunks/index-JU_JZkSC.mjs.map +1 -0
- package/dist/chunks/session-B3KIrj3_.mjs +711 -0
- package/dist/chunks/session-B3KIrj3_.mjs.map +1 -0
- package/dist/chunks/session-BOfkV8PJ.cjs +711 -0
- package/dist/chunks/session-BOfkV8PJ.cjs.map +1 -0
- package/dist/fakes.cjs +335 -0
- package/dist/fakes.cjs.map +1 -0
- package/dist/fakes.mjs +335 -0
- package/dist/fakes.mjs.map +1 -0
- package/dist/index.cjs +24 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/app/components/ChatPage.vue.d.ts +60 -0
- package/dist/types/app/components/ChatPage.vue.d.ts.map +1 -0
- package/dist/types/app/components/call/Call.vue.d.ts +8 -0
- package/dist/types/app/components/call/Call.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts +64 -0
- package/dist/types/app/components/chat/ChatBubble.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts +60 -0
- package/dist/types/app/components/chat/ChatInput.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts +45 -0
- package/dist/types/app/components/chat/ChatMessages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts +50 -0
- package/dist/types/app/components/chat/ChatPageBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts +11 -0
- package/dist/types/app/components/chat/ChatProfileOverview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts +244 -0
- package/dist/types/app/components/chat/ChatView.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleDivider.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleImages.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts +11 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleMeta.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts +16 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleOptions.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleRequest.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleSelectionMark.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts +7 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts +25 -0
- package/dist/types/app/components/chat/chat-bubbles/BubbleVideo.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-bubbles/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts +14 -0
- package/dist/types/app/components/chat/chat-bubbles/ImageGroupDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/ReplyPreview.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts +10 -0
- package/dist/types/app/components/chat/chat-bubbles/UploadProgressOverlay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-bubbles/VoiceDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/AttachementFileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts +13 -0
- package/dist/types/app/components/chat/chat-input/InputActionBar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts +18 -0
- package/dist/types/app/components/chat/chat-input/InputAttachement.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts +8 -0
- package/dist/types/app/components/chat/chat-input/PermissionPopup.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts +27 -0
- package/dist/types/app/components/chat/chat-input/RecordButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts +12 -0
- package/dist/types/app/components/chat/chat-input/RecordingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts +26 -0
- package/dist/types/app/components/chat/chat-input/VideoRecordDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts +8 -0
- package/dist/types/app/components/chat/contact/ChatContactDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts +5 -0
- package/dist/types/app/components/chat/contact/ChatList.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts +16 -0
- package/dist/types/app/components/chat/contact/ChatListSearch.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts +10 -0
- package/dist/types/app/components/chat/contact/ContactAvatar.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts +3 -0
- package/dist/types/app/components/chat/contact/ContactSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts +9 -0
- package/dist/types/app/components/chat/messages/FloatingDateHeader.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts +8 -0
- package/dist/types/app/components/chat/messages/MessagesSkeleton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts +11 -0
- package/dist/types/app/components/chat/messages/ScrollToBottomButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts +9 -0
- package/dist/types/app/components/chat/profile/FileDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts +21 -0
- package/dist/types/app/components/general/ConfirmModal.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts +16 -0
- package/dist/types/app/components/general/FileFormatDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts +13 -0
- package/dist/types/app/components/general/IconButton.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts +16 -0
- package/dist/types/app/components/general/LoadingStatus.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts +30 -0
- package/dist/types/app/components/general/MediaImage.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts +7 -0
- package/dist/types/app/components/general/NoDataDisplay.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts +28 -0
- package/dist/types/app/components/general/ResponsiveDialog.vue.d.ts.map +1 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts +10 -0
- package/dist/types/app/components/general/SafeEmojiText.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts +8 -0
- package/dist/types/app/components/global/BEmojiPicker.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts +11 -0
- package/dist/types/app/components/global/BIcon.vue.d.ts.map +1 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts +30 -0
- package/dist/types/app/components/global/BVirtualVerticalList.vue.d.ts.map +1 -0
- package/dist/types/app/composables/call/media.d.ts +204 -0
- package/dist/types/app/composables/call/media.d.ts.map +1 -0
- package/dist/types/app/composables/call/peer.d.ts +39 -0
- package/dist/types/app/composables/call/peer.d.ts.map +1 -0
- package/dist/types/app/composables/call/peers.d.ts +54 -0
- package/dist/types/app/composables/call/peers.d.ts.map +1 -0
- package/dist/types/app/composables/call/session.d.ts +284 -0
- package/dist/types/app/composables/call/session.d.ts.map +1 -0
- package/dist/types/app/composables/call/signaling.d.ts +36 -0
- package/dist/types/app/composables/call/signaling.d.ts.map +1 -0
- package/dist/types/app/composables/call/useCallUi.d.ts +27 -0
- package/dist/types/app/composables/call/useCallUi.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts +75 -0
- package/dist/types/app/composables/chat/useChatRecording.d.ts.map +1 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts +14 -0
- package/dist/types/app/composables/chat/useInputDraft.d.ts.map +1 -0
- package/dist/types/app/composables/useAppPermissions.d.ts +25 -0
- package/dist/types/app/composables/useAppPermissions.d.ts.map +1 -0
- package/dist/types/app/composables/useAppToast.d.ts +13 -0
- package/dist/types/app/composables/useAppToast.d.ts.map +1 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts +18 -0
- package/dist/types/app/composables/useAttachmentPicker.d.ts.map +1 -0
- package/dist/types/app/composables/useCall.d.ts +91 -0
- package/dist/types/app/composables/useCall.d.ts.map +1 -0
- package/dist/types/app/composables/useChatMessageList.d.ts +18 -0
- package/dist/types/app/composables/useChatMessageList.d.ts.map +1 -0
- package/dist/types/app/composables/useDate.d.ts +7 -0
- package/dist/types/app/composables/useDate.d.ts.map +1 -0
- package/dist/types/app/composables/useDevice.d.ts +32 -0
- package/dist/types/app/composables/useDevice.d.ts.map +1 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts +22 -0
- package/dist/types/app/composables/useFlippedVirtualScroll.d.ts.map +1 -0
- package/dist/types/app/composables/useHostI18n.d.ts +15 -0
- package/dist/types/app/composables/useHostI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLocalI18n.d.ts +5 -0
- package/dist/types/app/composables/useLocalI18n.d.ts.map +1 -0
- package/dist/types/app/composables/useLongPress.d.ts +6 -0
- package/dist/types/app/composables/useLongPress.d.ts.map +1 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts +12 -0
- package/dist/types/app/composables/useRichTextEditor.d.ts.map +1 -0
- package/dist/types/app/directives/loading.d.ts +6 -0
- package/dist/types/app/directives/loading.d.ts.map +1 -0
- package/dist/types/app/index.d.ts +31 -0
- package/dist/types/app/index.d.ts.map +1 -0
- package/dist/types/app/plugin.d.ts +28 -0
- package/dist/types/app/plugin.d.ts.map +1 -0
- package/dist/types/app/provider/callProvider.d.ts +7 -0
- package/dist/types/app/provider/callProvider.d.ts.map +1 -0
- package/dist/types/app/stores/callStore.d.ts +1626 -0
- package/dist/types/app/stores/callStore.d.ts.map +1 -0
- package/dist/types/app/stores/chatStore.d.ts +126 -0
- package/dist/types/app/stores/chatStore.d.ts.map +1 -0
- package/dist/types/app/stores/mediaStore.d.ts +18 -0
- package/dist/types/app/stores/mediaStore.d.ts.map +1 -0
- package/dist/types/app/stores/messageStores.d.ts +2460 -0
- package/dist/types/app/stores/messageStores.d.ts.map +1 -0
- package/dist/types/app/stores/profileStore.d.ts +102 -0
- package/dist/types/app/stores/profileStore.d.ts.map +1 -0
- package/dist/types/app/types/components/chat-input.d.ts +4 -0
- package/dist/types/app/types/components/chat-input.d.ts.map +1 -0
- package/dist/types/app/types/components/menu-options.d.ts +7 -0
- package/dist/types/app/types/components/menu-options.d.ts.map +1 -0
- package/dist/types/app/types/components/modal.d.ts +17 -0
- package/dist/types/app/types/components/modal.d.ts.map +1 -0
- package/dist/types/app/types/index.d.ts +257 -0
- package/dist/types/app/types/index.d.ts.map +1 -0
- package/dist/types/app/utils/emojiParser.d.ts +5 -0
- package/dist/types/app/utils/emojiParser.d.ts.map +1 -0
- package/dist/types/app/utils/format.d.ts +4 -0
- package/dist/types/app/utils/format.d.ts.map +1 -0
- package/dist/types/fakes/backend.d.ts +25 -0
- package/dist/types/fakes/backend.d.ts.map +1 -0
- package/dist/types/fakes/call.d.ts +7 -0
- package/dist/types/fakes/call.d.ts.map +1 -0
- package/dist/types/fakes/data.d.ts +13 -0
- package/dist/types/fakes/data.d.ts.map +1 -0
- package/dist/types/fakes/index.d.ts +7 -0
- package/dist/types/fakes/index.d.ts.map +1 -0
- package/dist/types/fakes.d.ts +2 -0
- package/dist/types/i18n/locales/index.d.ts +3557 -0
- package/dist/types/i18n/locales/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +98 -0
|
@@ -0,0 +1,818 @@
|
|
|
1
|
+
import { u as useCallStore, a as useLocalI18n, c as chat, b as useDirection, _ as _sfc_main$1, d as _sfc_main$2, e as _sfc_main$3 } from "./index-JU_JZkSC.mjs";
|
|
2
|
+
import { ref, onMounted, onUnmounted, watch, nextTick, defineComponent, computed, openBlock, createElementBlock, Fragment, unref, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createVNode, withModifiers, withCtx, createCommentVNode, withDirectives, mergeProps, vShow, renderList, createBlock } from "vue";
|
|
3
|
+
import { useWindowSize, useDraggable } from "@vueuse/core";
|
|
4
|
+
import Button from "primevue/button";
|
|
5
|
+
import Listbox from "primevue/listbox";
|
|
6
|
+
const CONTROLS_HIDE_AFTER_MS = 3e3;
|
|
7
|
+
function useCallUi(opts) {
|
|
8
|
+
const { localStream, screenStream, remoteVideos, remoteScreens } = opts;
|
|
9
|
+
const localVideo = ref(null);
|
|
10
|
+
const localScreen = ref(null);
|
|
11
|
+
const remoteRefs = ref({});
|
|
12
|
+
const remoteScreenRefs = ref({});
|
|
13
|
+
const remoteParents = ref({});
|
|
14
|
+
const showControls = ref(true);
|
|
15
|
+
let controlsTimeout;
|
|
16
|
+
function resetControlsTimeout() {
|
|
17
|
+
showControls.value = true;
|
|
18
|
+
clearTimeout(controlsTimeout);
|
|
19
|
+
controlsTimeout = setTimeout(
|
|
20
|
+
() => showControls.value = false,
|
|
21
|
+
CONTROLS_HIDE_AFTER_MS
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const inputEvents = ["mousemove", "click", "keydown"];
|
|
25
|
+
onMounted(() => {
|
|
26
|
+
resetControlsTimeout();
|
|
27
|
+
inputEvents.forEach((e) => document.addEventListener(e, resetControlsTimeout));
|
|
28
|
+
});
|
|
29
|
+
onUnmounted(() => {
|
|
30
|
+
inputEvents.forEach((e) => document.removeEventListener(e, resetControlsTimeout));
|
|
31
|
+
clearTimeout(controlsTimeout);
|
|
32
|
+
detachAll();
|
|
33
|
+
});
|
|
34
|
+
const isFullscreen = ref(false);
|
|
35
|
+
function toggleFullscreen(target = document.documentElement) {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!document.fullscreenElement) {
|
|
38
|
+
void ((_a = target.requestFullscreen) == null ? void 0 : _a.call(target));
|
|
39
|
+
isFullscreen.value = true;
|
|
40
|
+
} else {
|
|
41
|
+
void document.exitFullscreen();
|
|
42
|
+
isFullscreen.value = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const toggleRemote = (tileId, el) => {
|
|
46
|
+
const container = el ?? remoteParents.value[tileId];
|
|
47
|
+
if (container) toggleFullscreen(container);
|
|
48
|
+
};
|
|
49
|
+
const videoPaused = ref({});
|
|
50
|
+
function toggleVideoPause(tileId, el) {
|
|
51
|
+
if (!(el instanceof HTMLVideoElement)) return;
|
|
52
|
+
if (videoPaused.value[tileId]) void el.play();
|
|
53
|
+
else el.pause();
|
|
54
|
+
videoPaused.value[tileId] = !videoPaused.value[tileId];
|
|
55
|
+
}
|
|
56
|
+
const attach = (el, stream) => {
|
|
57
|
+
if (!el) return;
|
|
58
|
+
if (el.srcObject !== stream) el.srcObject = stream;
|
|
59
|
+
el.play().catch(() => {
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
watch(
|
|
63
|
+
[localStream, opts.isMinimized],
|
|
64
|
+
async () => {
|
|
65
|
+
await nextTick();
|
|
66
|
+
if (localStream.value && localVideo.value)
|
|
67
|
+
localVideo.value.srcObject = localStream.value;
|
|
68
|
+
},
|
|
69
|
+
{ immediate: true }
|
|
70
|
+
);
|
|
71
|
+
watch(
|
|
72
|
+
[screenStream, opts.isMinimized],
|
|
73
|
+
async () => {
|
|
74
|
+
await nextTick();
|
|
75
|
+
if (localScreen.value) localScreen.value.srcObject = screenStream.value;
|
|
76
|
+
},
|
|
77
|
+
{ immediate: true }
|
|
78
|
+
);
|
|
79
|
+
watch(
|
|
80
|
+
[() => ({ ...remoteVideos.value }), opts.isMinimized],
|
|
81
|
+
async () => {
|
|
82
|
+
await nextTick();
|
|
83
|
+
for (const [id, { stream }] of Object.entries(remoteVideos.value))
|
|
84
|
+
attach(remoteRefs.value[id], stream);
|
|
85
|
+
},
|
|
86
|
+
{ immediate: true }
|
|
87
|
+
);
|
|
88
|
+
watch(
|
|
89
|
+
[() => ({ ...remoteScreens.value }), opts.isMinimized],
|
|
90
|
+
async () => {
|
|
91
|
+
await nextTick();
|
|
92
|
+
for (const [id, { stream }] of Object.entries(remoteScreens.value))
|
|
93
|
+
attach(remoteScreenRefs.value[id], stream);
|
|
94
|
+
},
|
|
95
|
+
{ immediate: true }
|
|
96
|
+
);
|
|
97
|
+
function detachAll() {
|
|
98
|
+
const all = [
|
|
99
|
+
localVideo.value,
|
|
100
|
+
localScreen.value,
|
|
101
|
+
...Object.values(remoteRefs.value),
|
|
102
|
+
...Object.values(remoteScreenRefs.value)
|
|
103
|
+
];
|
|
104
|
+
for (const el of all) if (el) el.srcObject = null;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
localVideo,
|
|
108
|
+
localScreen,
|
|
109
|
+
remoteRefs,
|
|
110
|
+
remoteScreenRefs,
|
|
111
|
+
remoteParents,
|
|
112
|
+
showControls,
|
|
113
|
+
resetControlsTimeout,
|
|
114
|
+
isFullscreen,
|
|
115
|
+
toggleFullscreen: () => toggleFullscreen(),
|
|
116
|
+
toggleRemote,
|
|
117
|
+
videoPaused,
|
|
118
|
+
toggleVideoPause,
|
|
119
|
+
detachAll
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function useCall() {
|
|
123
|
+
const callStore = useCallStore();
|
|
124
|
+
const session = callStore.session;
|
|
125
|
+
if (!session) {
|
|
126
|
+
throw new Error("[vue-chat] useCall() needs a running call: callStore.startCall() first");
|
|
127
|
+
}
|
|
128
|
+
const { media, peers } = session;
|
|
129
|
+
const ui = useCallUi({
|
|
130
|
+
localStream: media.localStream,
|
|
131
|
+
screenStream: media.screenStream,
|
|
132
|
+
remoteVideos: peers.remoteVideos,
|
|
133
|
+
remoteScreens: peers.remoteScreens,
|
|
134
|
+
isMinimized: () => callStore.isMinimized
|
|
135
|
+
});
|
|
136
|
+
async function switchCamera(deviceId) {
|
|
137
|
+
const stream = await session.switchCamera(deviceId);
|
|
138
|
+
if (stream && ui.localVideo.value) ui.localVideo.value.srcObject = stream;
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
// Call state
|
|
142
|
+
participantCount: session.participantCount,
|
|
143
|
+
tileCount: session.tileCount,
|
|
144
|
+
localStream: media.localStream,
|
|
145
|
+
remoteVideos: peers.remoteVideos,
|
|
146
|
+
remoteScreens: peers.remoteScreens,
|
|
147
|
+
// Local media
|
|
148
|
+
cameras: media.cameras,
|
|
149
|
+
isAudioOn: media.isAudioOn,
|
|
150
|
+
isVideoOn: media.isVideoOn,
|
|
151
|
+
isScreenSharing: media.isScreenSharing,
|
|
152
|
+
isFlashlightOn: media.isFlashlightOn,
|
|
153
|
+
isFlashlightSupported: media.isFlashlightSupported,
|
|
154
|
+
toggleAudio: media.toggleAudio,
|
|
155
|
+
toggleVideo: media.toggleVideo,
|
|
156
|
+
toggleFlashlight: media.toggleFlashlight,
|
|
157
|
+
toggleScreenShare: session.toggleScreenShare,
|
|
158
|
+
switchCamera,
|
|
159
|
+
endCall: callStore.endCall,
|
|
160
|
+
// View
|
|
161
|
+
showCameraModal: ref(false),
|
|
162
|
+
showControls: ui.showControls,
|
|
163
|
+
resetControlsTimeout: ui.resetControlsTimeout,
|
|
164
|
+
isFullscreen: ui.isFullscreen,
|
|
165
|
+
toggleFullscreen: ui.toggleFullscreen,
|
|
166
|
+
toggleRemote: ui.toggleRemote,
|
|
167
|
+
videoPaused: ui.videoPaused,
|
|
168
|
+
toggleVideoPause: ui.toggleVideoPause,
|
|
169
|
+
localVideo: ui.localVideo,
|
|
170
|
+
localScreen: ui.localScreen,
|
|
171
|
+
remoteRefs: ui.remoteRefs,
|
|
172
|
+
remoteScreenRefs: ui.remoteScreenRefs,
|
|
173
|
+
remoteParents: ui.remoteParents
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const _hoisted_1 = { class: "relative h-full w-full" };
|
|
177
|
+
const _hoisted_2 = { class: "absolute top-3 right-3 left-3 z-10 flex items-center justify-between" };
|
|
178
|
+
const _hoisted_3 = { class: "flex items-center gap-x-2 rounded-full bg-black/40 px-3 py-1.5 backdrop-blur-sm" };
|
|
179
|
+
const _hoisted_4 = { class: "text-label-sm text-white/90 select-none" };
|
|
180
|
+
const _hoisted_5 = { class: "absolute right-3 bottom-3 left-3 z-10 flex items-center justify-between" };
|
|
181
|
+
const _hoisted_6 = { class: "flex items-center gap-2" };
|
|
182
|
+
const _hoisted_7 = {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "flex gap-1"
|
|
185
|
+
};
|
|
186
|
+
const _hoisted_8 = {
|
|
187
|
+
key: 0,
|
|
188
|
+
class: "flex h-7 w-7 items-center justify-center rounded-full bg-diamond-error"
|
|
189
|
+
};
|
|
190
|
+
const _hoisted_9 = {
|
|
191
|
+
key: 1,
|
|
192
|
+
class: "flex h-7 w-7 items-center justify-center rounded-full bg-diamond-error"
|
|
193
|
+
};
|
|
194
|
+
const _hoisted_10 = {
|
|
195
|
+
"data-testid": "call-view",
|
|
196
|
+
class: "vue-chat fixed inset-0 z-[60] flex h-full w-full flex-col bg-diamond-black"
|
|
197
|
+
};
|
|
198
|
+
const _hoisted_11 = { class: "flex items-center gap-x-4" };
|
|
199
|
+
const _hoisted_12 = { class: "hidden select-none text-label-lg text-white md:block" };
|
|
200
|
+
const _hoisted_13 = { class: "flex items-center gap-x-2 text-white text-body-sm" };
|
|
201
|
+
const _hoisted_14 = { "data-testid": "call-participants" };
|
|
202
|
+
const _hoisted_15 = { class: "flex items-center gap-x-4.5" };
|
|
203
|
+
const _hoisted_16 = { class: "flex h-6 items-center justify-center rounded-full bg-diamond-error px-2 text-white select-none" };
|
|
204
|
+
const _hoisted_17 = { class: "text-body-sm" };
|
|
205
|
+
const _hoisted_18 = { class: "grid h-full min-h-0 w-full min-w-0 grid-cols-1 gap-4 md:grid-cols-[repeat(auto-fit,minmax(300px,1fr))]" };
|
|
206
|
+
const _hoisted_19 = { class: "absolute bottom-3 left-3 z-20 flex items-center gap-x-2" };
|
|
207
|
+
const _hoisted_20 = { class: "rounded bg-black-500 px-2 py-1 text-label-sm text-white select-none" };
|
|
208
|
+
const _hoisted_21 = { class: "flex h-10 w-10 items-center justify-center rounded-full bg-black-500" };
|
|
209
|
+
const _hoisted_22 = { class: "absolute bottom-2 left-2 z-20 flex items-center gap-x-1" };
|
|
210
|
+
const _hoisted_23 = { class: "rounded bg-black-500 px-1.5 py-0.5 text-label-sm text-white select-none" };
|
|
211
|
+
const _hoisted_24 = { class: "absolute bottom-3 left-3 z-20 flex items-center gap-x-2" };
|
|
212
|
+
const _hoisted_25 = { class: "rounded bg-black-500 px-2 py-1 text-label-sm text-white select-none" };
|
|
213
|
+
const _hoisted_26 = { class: "flex h-10 w-10 items-center justify-center rounded-full bg-black-500" };
|
|
214
|
+
const _hoisted_27 = { class: "absolute bottom-3 left-3 z-20 flex items-center gap-x-2" };
|
|
215
|
+
const _hoisted_28 = { class: "rounded bg-black-500 px-2 py-1 text-label-sm text-white select-none" };
|
|
216
|
+
const _hoisted_29 = {
|
|
217
|
+
key: 0,
|
|
218
|
+
class: "flex h-7 w-7 items-center justify-center rounded-full bg-diamond-error"
|
|
219
|
+
};
|
|
220
|
+
const _hoisted_30 = {
|
|
221
|
+
key: 0,
|
|
222
|
+
class: "absolute inset-0 flex items-center justify-center bg-black-600"
|
|
223
|
+
};
|
|
224
|
+
const _hoisted_31 = { class: "text-center text-white" };
|
|
225
|
+
const _hoisted_32 = { class: "mx-auto mb-2 flex h-16 w-16 items-center justify-center rounded-full bg-chat-primary" };
|
|
226
|
+
const _hoisted_33 = { class: "text-title-lg font-semibold" };
|
|
227
|
+
const _hoisted_34 = { class: "text-label-md" };
|
|
228
|
+
const PIP_WIDTH = 280;
|
|
229
|
+
const PIP_HEIGHT = 160;
|
|
230
|
+
const PADDING = 16;
|
|
231
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
232
|
+
__name: "Call",
|
|
233
|
+
setup(__props) {
|
|
234
|
+
const callStore = useCallStore();
|
|
235
|
+
const minimizedRef = ref(null);
|
|
236
|
+
const bodyRef = ref(null);
|
|
237
|
+
const cameraPickerOpen = ref(false);
|
|
238
|
+
const { t, locale } = useLocalI18n(chat);
|
|
239
|
+
const { dir } = useDirection();
|
|
240
|
+
const {
|
|
241
|
+
toggleVideoPause,
|
|
242
|
+
toggleRemote,
|
|
243
|
+
participantCount,
|
|
244
|
+
endCall,
|
|
245
|
+
toggleFullscreen,
|
|
246
|
+
toggleFlashlight,
|
|
247
|
+
toggleScreenShare,
|
|
248
|
+
toggleAudio,
|
|
249
|
+
toggleVideo,
|
|
250
|
+
switchCamera,
|
|
251
|
+
isFlashlightSupported,
|
|
252
|
+
tileCount,
|
|
253
|
+
isAudioOn,
|
|
254
|
+
isVideoOn,
|
|
255
|
+
isFlashlightOn,
|
|
256
|
+
isFullscreen,
|
|
257
|
+
isScreenSharing,
|
|
258
|
+
showControls,
|
|
259
|
+
resetControlsTimeout,
|
|
260
|
+
cameras,
|
|
261
|
+
videoPaused,
|
|
262
|
+
localStream,
|
|
263
|
+
localVideo,
|
|
264
|
+
localScreen,
|
|
265
|
+
remoteParents,
|
|
266
|
+
remoteRefs,
|
|
267
|
+
remoteScreens,
|
|
268
|
+
remoteScreenRefs,
|
|
269
|
+
remoteVideos
|
|
270
|
+
} = useCall();
|
|
271
|
+
const pickCamera = (deviceId) => {
|
|
272
|
+
cameraPickerOpen.value = false;
|
|
273
|
+
switchCamera(deviceId);
|
|
274
|
+
};
|
|
275
|
+
const translucent = {
|
|
276
|
+
background: "rgb(255 255 255 / 0.12)",
|
|
277
|
+
hoverBackground: "rgb(255 255 255 / 0.2)",
|
|
278
|
+
activeBackground: "rgb(255 255 255 / 0.28)",
|
|
279
|
+
borderColor: "transparent",
|
|
280
|
+
hoverBorderColor: "transparent",
|
|
281
|
+
activeBorderColor: "transparent",
|
|
282
|
+
color: "#ffffff",
|
|
283
|
+
hoverColor: "#ffffff",
|
|
284
|
+
activeColor: "#ffffff"
|
|
285
|
+
};
|
|
286
|
+
const lit = {
|
|
287
|
+
background: "#ffffff",
|
|
288
|
+
hoverBackground: "rgb(255 255 255 / 0.9)",
|
|
289
|
+
activeBackground: "rgb(255 255 255 / 0.8)",
|
|
290
|
+
borderColor: "#ffffff",
|
|
291
|
+
hoverBorderColor: "#ffffff",
|
|
292
|
+
activeBorderColor: "#ffffff",
|
|
293
|
+
color: "#151823",
|
|
294
|
+
hoverColor: "#151823",
|
|
295
|
+
activeColor: "#151823"
|
|
296
|
+
};
|
|
297
|
+
const callScheme = { root: { secondary: translucent, contrast: lit } };
|
|
298
|
+
const callButtonDt = { colorScheme: { light: callScheme, dark: callScheme } };
|
|
299
|
+
const footerButton = {
|
|
300
|
+
dt: callButtonDt,
|
|
301
|
+
text: false,
|
|
302
|
+
size: "large",
|
|
303
|
+
iconClass: "size-6"
|
|
304
|
+
};
|
|
305
|
+
const pipVideoRef = ref(null);
|
|
306
|
+
const activeRemoteIndex = ref(0);
|
|
307
|
+
const remoteVideoEntries = computed(() => Object.entries(remoteVideos.value));
|
|
308
|
+
const hasRemoteVideos = computed(() => remoteVideoEntries.value.length > 0);
|
|
309
|
+
const activeRemoteUserId = computed(() => {
|
|
310
|
+
const entries = remoteVideoEntries.value;
|
|
311
|
+
if (entries.length === 0) return null;
|
|
312
|
+
return entries[activeRemoteIndex.value % entries.length][0];
|
|
313
|
+
});
|
|
314
|
+
const pipStream = computed(() => {
|
|
315
|
+
var _a;
|
|
316
|
+
if (hasRemoteVideos.value) {
|
|
317
|
+
const id = activeRemoteUserId.value;
|
|
318
|
+
return id ? ((_a = remoteVideos.value[id]) == null ? void 0 : _a.stream) ?? null : null;
|
|
319
|
+
}
|
|
320
|
+
return localStream.value ?? null;
|
|
321
|
+
});
|
|
322
|
+
function cycleRemote() {
|
|
323
|
+
const count = remoteVideoEntries.value.length;
|
|
324
|
+
if (count === 0) return;
|
|
325
|
+
activeRemoteIndex.value = (activeRemoteIndex.value + 1) % count;
|
|
326
|
+
}
|
|
327
|
+
watch(
|
|
328
|
+
[pipStream, () => callStore.isMinimized],
|
|
329
|
+
async () => {
|
|
330
|
+
await nextTick();
|
|
331
|
+
const el = pipVideoRef.value;
|
|
332
|
+
if (!el) return;
|
|
333
|
+
const stream = pipStream.value;
|
|
334
|
+
if (stream && el.srcObject !== stream) {
|
|
335
|
+
el.srcObject = stream;
|
|
336
|
+
el.play().catch(() => {
|
|
337
|
+
});
|
|
338
|
+
} else if (!stream && el.srcObject) {
|
|
339
|
+
el.srcObject = null;
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
{ immediate: true }
|
|
343
|
+
);
|
|
344
|
+
onMounted(() => {
|
|
345
|
+
bodyRef.value = document.body;
|
|
346
|
+
});
|
|
347
|
+
const { width: windowWidth, height: windowHeight } = useWindowSize();
|
|
348
|
+
const { x, y, isDragging } = useDraggable(minimizedRef, {
|
|
349
|
+
initialValue: {
|
|
350
|
+
x: typeof window !== "undefined" ? window.innerWidth - PIP_WIDTH - PADDING : PADDING,
|
|
351
|
+
y: typeof window !== "undefined" ? window.innerHeight - PIP_HEIGHT - PADDING : PADDING
|
|
352
|
+
},
|
|
353
|
+
// غیرفعال کردن درگ در صورتی که کامپوننت مینیمایز نباشد
|
|
354
|
+
disabled: computed(() => !callStore.isMinimized)
|
|
355
|
+
});
|
|
356
|
+
watch(isDragging, (dragging) => {
|
|
357
|
+
if (!dragging && callStore.isMinimized) {
|
|
358
|
+
const maxX = windowWidth.value - PIP_WIDTH - PADDING;
|
|
359
|
+
const maxY = windowHeight.value - PIP_HEIGHT - PADDING;
|
|
360
|
+
dir.value === "rtl";
|
|
361
|
+
const targetX = x.value < windowWidth.value / 2 ? PADDING : maxX;
|
|
362
|
+
const targetY = y.value < windowHeight.value / 2 ? PADDING : maxY;
|
|
363
|
+
x.value = targetX;
|
|
364
|
+
y.value = targetY;
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
watch(
|
|
368
|
+
() => callStore.isMinimized,
|
|
369
|
+
(isMinimized) => {
|
|
370
|
+
if (isMinimized) {
|
|
371
|
+
nextTick(() => {
|
|
372
|
+
const isRtl = dir.value === "rtl";
|
|
373
|
+
x.value = isRtl ? PADDING : windowWidth.value - PIP_WIDTH - PADDING;
|
|
374
|
+
y.value = windowHeight.value - PIP_HEIGHT - PADDING;
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
{ immediate: true }
|
|
379
|
+
);
|
|
380
|
+
const clampedStyle = computed(() => {
|
|
381
|
+
if (!callStore.isMinimized) return {};
|
|
382
|
+
const maxX = windowWidth.value - PIP_WIDTH - PADDING;
|
|
383
|
+
const maxY = windowHeight.value - PIP_HEIGHT - PADDING;
|
|
384
|
+
const safeX = Math.max(PADDING, Math.min(x.value, maxX));
|
|
385
|
+
const safeY = Math.max(PADDING, Math.min(y.value, maxY));
|
|
386
|
+
return {
|
|
387
|
+
left: `${safeX}px`,
|
|
388
|
+
top: `${safeY}px`
|
|
389
|
+
};
|
|
390
|
+
});
|
|
391
|
+
return (_ctx, _cache) => {
|
|
392
|
+
const _component_BIcon = _sfc_main$2;
|
|
393
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
394
|
+
unref(callStore).isActive && unref(callStore).isMinimized ? (openBlock(), createElementBlock("div", {
|
|
395
|
+
key: 0,
|
|
396
|
+
ref_key: "minimizedRef",
|
|
397
|
+
ref: minimizedRef,
|
|
398
|
+
"data-testid": "call-pip",
|
|
399
|
+
style: normalizeStyle(clampedStyle.value),
|
|
400
|
+
class: normalizeClass(["vue-chat fixed w-70 h-40 bg-black-600 rounded-2xl shadow-floating z-9999 overflow-hidden border border-white/10 flex flex-col items-center justify-center cursor-move touch-none", [!unref(isDragging) ? "transition-all duration-300 ease-out" : ""]])
|
|
401
|
+
}, [
|
|
402
|
+
createElementVNode("video", {
|
|
403
|
+
ref_key: "pipVideoRef",
|
|
404
|
+
ref: pipVideoRef,
|
|
405
|
+
muted: "",
|
|
406
|
+
autoplay: "",
|
|
407
|
+
playsinline: "",
|
|
408
|
+
class: "pointer-events-none absolute inset-0 z-0 h-full w-full object-cover"
|
|
409
|
+
}, null, 512),
|
|
410
|
+
_cache[18] || (_cache[18] = createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-br from-blue-500/5 via-purple-500/5 to-pink-500/5 opacity-0 transition-opacity duration-500 group-hover:opacity-100" }, null, -1)),
|
|
411
|
+
_cache[19] || (_cache[19] = createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/50 via-transparent to-black/20" }, null, -1)),
|
|
412
|
+
createElementVNode("div", _hoisted_1, [
|
|
413
|
+
createElementVNode("div", _hoisted_2, [
|
|
414
|
+
createElementVNode("div", _hoisted_3, [
|
|
415
|
+
_cache[16] || (_cache[16] = createElementVNode("div", { class: "relative" }, [
|
|
416
|
+
createElementVNode("div", { class: "h-2.5 w-2.5 animate-pulse rounded-full bg-diamond-error" }),
|
|
417
|
+
createElementVNode("div", { class: "absolute inset-0 h-2.5 w-2.5 animate-ping rounded-full bg-diamond-error/30" })
|
|
418
|
+
], -1)),
|
|
419
|
+
createElementVNode("span", _hoisted_4, toDisplayString(unref(t)("Call active")), 1),
|
|
420
|
+
_cache[17] || (_cache[17] = createElementVNode("div", { class: "flex -space-x-1" }, [
|
|
421
|
+
createElementVNode("div", {
|
|
422
|
+
class: "h-1.5 w-1.5 animate-pulse rounded-full bg-green-400",
|
|
423
|
+
style: { "animation-delay": "0s" }
|
|
424
|
+
}),
|
|
425
|
+
createElementVNode("div", {
|
|
426
|
+
class: "h-1.5 w-1.5 animate-pulse rounded-full bg-green-400",
|
|
427
|
+
style: { "animation-delay": "0.2s" }
|
|
428
|
+
}),
|
|
429
|
+
createElementVNode("div", {
|
|
430
|
+
class: "h-1.5 w-1.5 animate-pulse rounded-full bg-green-400",
|
|
431
|
+
style: { "animation-delay": "0.4s" }
|
|
432
|
+
})
|
|
433
|
+
], -1))
|
|
434
|
+
]),
|
|
435
|
+
createVNode(_sfc_main$1, {
|
|
436
|
+
icon: "PhPhoneX",
|
|
437
|
+
label: unref(t)("chat.call.controls.endCall"),
|
|
438
|
+
severity: "danger",
|
|
439
|
+
text: false,
|
|
440
|
+
"icon-class": "size-4",
|
|
441
|
+
"data-testid": "call-pip-end",
|
|
442
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
443
|
+
}, ["stop"])),
|
|
444
|
+
onClick: withModifiers(unref(endCall), ["stop"])
|
|
445
|
+
}, null, 8, ["label", "onClick"])
|
|
446
|
+
]),
|
|
447
|
+
createElementVNode("div", _hoisted_5, [
|
|
448
|
+
createElementVNode("div", _hoisted_6, [
|
|
449
|
+
createVNode(unref(Button), {
|
|
450
|
+
label: String(unref(participantCount)),
|
|
451
|
+
"aria-label": unref(t)("chat.call.controls.nextParticipant"),
|
|
452
|
+
disabled: !hasRemoteVideos.value,
|
|
453
|
+
dt: callButtonDt,
|
|
454
|
+
severity: "secondary",
|
|
455
|
+
size: "small",
|
|
456
|
+
rounded: "",
|
|
457
|
+
onPointerdown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
458
|
+
}, ["stop"])),
|
|
459
|
+
onClick: withModifiers(cycleRemote, ["stop"])
|
|
460
|
+
}, {
|
|
461
|
+
icon: withCtx(() => [
|
|
462
|
+
createVNode(_component_BIcon, {
|
|
463
|
+
icon: "PhUsers",
|
|
464
|
+
class: "size-3"
|
|
465
|
+
})
|
|
466
|
+
]),
|
|
467
|
+
_: 1
|
|
468
|
+
}, 8, ["label", "aria-label", "disabled"]),
|
|
469
|
+
!unref(isAudioOn) || !unref(isVideoOn) ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
470
|
+
!unref(isAudioOn) ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
471
|
+
createVNode(_component_BIcon, {
|
|
472
|
+
icon: "PhMicrophoneSlash",
|
|
473
|
+
class: "h-3 w-3 fill-white"
|
|
474
|
+
})
|
|
475
|
+
])) : createCommentVNode("", true),
|
|
476
|
+
!unref(isVideoOn) ? (openBlock(), createElementBlock("div", _hoisted_9, [
|
|
477
|
+
createVNode(_component_BIcon, {
|
|
478
|
+
icon: "PhVideoCameraSlash",
|
|
479
|
+
class: "h-3 w-3 fill-white"
|
|
480
|
+
})
|
|
481
|
+
])) : createCommentVNode("", true)
|
|
482
|
+
])) : createCommentVNode("", true)
|
|
483
|
+
]),
|
|
484
|
+
createVNode(_sfc_main$1, {
|
|
485
|
+
icon: "PhResize",
|
|
486
|
+
label: unref(t)("chat.call.controls.maximize"),
|
|
487
|
+
dt: callButtonDt,
|
|
488
|
+
text: false,
|
|
489
|
+
"icon-class": "size-4",
|
|
490
|
+
"data-testid": "call-maximize",
|
|
491
|
+
onPointerdown: _cache[2] || (_cache[2] = withModifiers(() => {
|
|
492
|
+
}, ["stop"])),
|
|
493
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => unref(callStore).maximize(), ["stop"]))
|
|
494
|
+
}, null, 8, ["label"])
|
|
495
|
+
])
|
|
496
|
+
])
|
|
497
|
+
], 6)) : createCommentVNode("", true),
|
|
498
|
+
withDirectives(createElementVNode("div", _hoisted_10, [
|
|
499
|
+
!unref(callStore).isMinimized ? (openBlock(), createElementBlock("div", {
|
|
500
|
+
key: 0,
|
|
501
|
+
class: normalizeClass(["flex h-16 items-center justify-between px-4 transition-all duration-300 sm:h-20", unref(showControls) ? "opacity-100" : "opacity-0"]),
|
|
502
|
+
onMouseenter: _cache[4] || (_cache[4] = //@ts-ignore
|
|
503
|
+
(...args) => unref(resetControlsTimeout) && unref(resetControlsTimeout)(...args)),
|
|
504
|
+
onMousemove: _cache[5] || (_cache[5] = //@ts-ignore
|
|
505
|
+
(...args) => unref(resetControlsTimeout) && unref(resetControlsTimeout)(...args))
|
|
506
|
+
}, [
|
|
507
|
+
createElementVNode("div", _hoisted_11, [
|
|
508
|
+
createElementVNode("div", _hoisted_12, toDisplayString(unref(t)("Behayand Meeting")), 1),
|
|
509
|
+
createElementVNode("div", _hoisted_13, [
|
|
510
|
+
createVNode(_component_BIcon, {
|
|
511
|
+
icon: "PhUsers",
|
|
512
|
+
class: "h-4 w-4 fill-white"
|
|
513
|
+
}),
|
|
514
|
+
createElementVNode("span", _hoisted_14, toDisplayString(unref(participantCount)) + " " + toDisplayString(unref(participantCount) > 1 ? unref(t)("participants") : unref(t)("participant")), 1)
|
|
515
|
+
])
|
|
516
|
+
]),
|
|
517
|
+
createElementVNode("div", _hoisted_15, [
|
|
518
|
+
createElementVNode("div", _hoisted_16, [
|
|
519
|
+
createElementVNode("div", _hoisted_17, toDisplayString((/* @__PURE__ */ new Date()).toLocaleTimeString(unref(locale), {
|
|
520
|
+
hour: "2-digit",
|
|
521
|
+
minute: "2-digit",
|
|
522
|
+
hour12: true
|
|
523
|
+
})), 1)
|
|
524
|
+
]),
|
|
525
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
526
|
+
icon: "PhCaretDown",
|
|
527
|
+
label: unref(t)("chat.call.controls.minimize")
|
|
528
|
+
}, footerButton, {
|
|
529
|
+
"data-testid": "call-minimize",
|
|
530
|
+
onClick: unref(callStore).minimize
|
|
531
|
+
}), null, 16, ["label", "onClick"])
|
|
532
|
+
])
|
|
533
|
+
], 34)) : createCommentVNode("", true),
|
|
534
|
+
createElementVNode("div", {
|
|
535
|
+
class: normalizeClass(["relative grid w-full overflow-hidden", unref(callStore).isMinimized ? "h-full p-0" : "h-full p-4"]),
|
|
536
|
+
onMousemove: _cache[10] || (_cache[10] = //@ts-ignore
|
|
537
|
+
(...args) => unref(resetControlsTimeout) && unref(resetControlsTimeout)(...args))
|
|
538
|
+
}, [
|
|
539
|
+
withDirectives(createElementVNode("div", _hoisted_18, [
|
|
540
|
+
withDirectives(createElementVNode("div", {
|
|
541
|
+
ref: (el) => unref(remoteParents)[`self_screen`] = el,
|
|
542
|
+
class: "group relative flex aspect-video h-full w-full flex-col items-center justify-center overflow-hidden rounded-2xl border-2 border-chat-primary/0 bg-black-600 p-2"
|
|
543
|
+
}, [
|
|
544
|
+
createElementVNode("video", {
|
|
545
|
+
ref_key: "localScreen",
|
|
546
|
+
ref: localScreen,
|
|
547
|
+
autoplay: "",
|
|
548
|
+
muted: "",
|
|
549
|
+
playsinline: "",
|
|
550
|
+
class: "absolute inset-0 z-0 h-full w-full object-cover"
|
|
551
|
+
}, null, 512),
|
|
552
|
+
createElementVNode("div", _hoisted_19, [
|
|
553
|
+
createElementVNode("div", _hoisted_20, toDisplayString(unref(t)("Your Presentation")), 1),
|
|
554
|
+
createElementVNode("div", _hoisted_21, [
|
|
555
|
+
createVNode(_component_BIcon, {
|
|
556
|
+
icon: "PhMonitor",
|
|
557
|
+
class: "h-4 w-4 fill-white"
|
|
558
|
+
})
|
|
559
|
+
]),
|
|
560
|
+
createVNode(_sfc_main$1, {
|
|
561
|
+
icon: unref(videoPaused)["self_screen"] ? "PhPlay" : "PhPause",
|
|
562
|
+
label: unref(videoPaused)["self_screen"] ? unref(t)("chat.call.controls.playVideo") : unref(t)("chat.call.controls.pauseVideo"),
|
|
563
|
+
dt: callButtonDt,
|
|
564
|
+
text: false,
|
|
565
|
+
"icon-class": "size-4",
|
|
566
|
+
onClick: _cache[6] || (_cache[6] = ($event) => unref(toggleVideoPause)("self_screen", unref(localScreen)))
|
|
567
|
+
}, null, 8, ["icon", "label"]),
|
|
568
|
+
createVNode(_sfc_main$1, {
|
|
569
|
+
icon: unref(isFullscreen) ? "PhCornersIn" : "PhFrameCorners",
|
|
570
|
+
label: unref(isFullscreen) ? unref(t)("chat.call.controls.exitFullscreen") : unref(t)("chat.call.controls.fullscreen"),
|
|
571
|
+
dt: callButtonDt,
|
|
572
|
+
text: false,
|
|
573
|
+
"icon-class": "size-4",
|
|
574
|
+
onClick: _cache[7] || (_cache[7] = ($event) => unref(toggleRemote)(`self_screen`))
|
|
575
|
+
}, null, 8, ["icon", "label"])
|
|
576
|
+
])
|
|
577
|
+
], 512), [
|
|
578
|
+
[vShow, unref(isScreenSharing)]
|
|
579
|
+
]),
|
|
580
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(remoteVideos), (stream, remoteUserId) => {
|
|
581
|
+
return openBlock(), createElementBlock("div", {
|
|
582
|
+
key: `remote-${remoteUserId}`,
|
|
583
|
+
"data-testid": "call-remote-video",
|
|
584
|
+
ref_for: true,
|
|
585
|
+
ref: (el) => unref(remoteParents)[`remote_video_${remoteUserId}`] = el,
|
|
586
|
+
class: "group relative flex aspect-video h-full w-full flex-col items-center justify-center overflow-hidden rounded-2xl border-2 border-chat-primary/0 bg-black-600 p-2"
|
|
587
|
+
}, [
|
|
588
|
+
createElementVNode("video", {
|
|
589
|
+
ref_for: true,
|
|
590
|
+
ref: (el) => {
|
|
591
|
+
if (el) unref(remoteRefs)[remoteUserId] = el;
|
|
592
|
+
},
|
|
593
|
+
autoplay: "",
|
|
594
|
+
playsinline: "",
|
|
595
|
+
class: "absolute inset-0 z-0 h-full w-full object-cover"
|
|
596
|
+
}, null, 512),
|
|
597
|
+
createElementVNode("div", _hoisted_22, [
|
|
598
|
+
createElementVNode("div", _hoisted_23, toDisplayString(stream.name.slice(0, 15)), 1),
|
|
599
|
+
createVNode(_sfc_main$1, {
|
|
600
|
+
icon: unref(videoPaused)[`remote_video_${remoteUserId}`] ? "PhPlay" : "PhPause",
|
|
601
|
+
label: unref(videoPaused)[`remote_video_${remoteUserId}`] ? unref(t)("chat.call.controls.playVideo") : unref(t)("chat.call.controls.pauseVideo"),
|
|
602
|
+
dt: callButtonDt,
|
|
603
|
+
text: false,
|
|
604
|
+
"icon-class": "size-4",
|
|
605
|
+
onClick: ($event) => unref(toggleVideoPause)(
|
|
606
|
+
`remote_video_${remoteUserId}`,
|
|
607
|
+
unref(remoteRefs)[remoteUserId]
|
|
608
|
+
)
|
|
609
|
+
}, null, 8, ["icon", "label", "onClick"]),
|
|
610
|
+
createVNode(_sfc_main$1, {
|
|
611
|
+
icon: unref(isFullscreen) ? "PhCornersIn" : "PhFrameCorners",
|
|
612
|
+
label: unref(isFullscreen) ? unref(t)("chat.call.controls.exitFullscreen") : unref(t)("chat.call.controls.fullscreen"),
|
|
613
|
+
dt: callButtonDt,
|
|
614
|
+
text: false,
|
|
615
|
+
"icon-class": "size-4",
|
|
616
|
+
onClick: ($event) => unref(toggleRemote)(`remote_video_${remoteUserId}`)
|
|
617
|
+
}, null, 8, ["icon", "label", "onClick"])
|
|
618
|
+
])
|
|
619
|
+
]);
|
|
620
|
+
}), 128)),
|
|
621
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(remoteScreens), (stream, remoteUserId) => {
|
|
622
|
+
return openBlock(), createElementBlock("div", {
|
|
623
|
+
key: `remote-screen-${remoteUserId}`,
|
|
624
|
+
"data-testid": "call-remote-screen",
|
|
625
|
+
ref_for: true,
|
|
626
|
+
ref: (el) => unref(remoteParents)[`remote_screen_${remoteUserId}`] = el,
|
|
627
|
+
class: "group relative flex aspect-video h-full w-full flex-col items-center justify-center overflow-hidden rounded-2xl border-2 border-chat-primary/0 bg-black-600 p-2"
|
|
628
|
+
}, [
|
|
629
|
+
createElementVNode("video", {
|
|
630
|
+
ref_for: true,
|
|
631
|
+
ref: (el) => {
|
|
632
|
+
if (el) unref(remoteScreenRefs)[remoteUserId] = el;
|
|
633
|
+
},
|
|
634
|
+
autoplay: "",
|
|
635
|
+
muted: "",
|
|
636
|
+
playsinline: "",
|
|
637
|
+
class: "absolute inset-0 z-0 h-full w-full object-cover"
|
|
638
|
+
}, null, 512),
|
|
639
|
+
createElementVNode("div", _hoisted_24, [
|
|
640
|
+
createElementVNode("div", _hoisted_25, toDisplayString(unref(t)("Presentation of")) + " " + toDisplayString(stream.name.slice(0, 15)), 1),
|
|
641
|
+
createElementVNode("div", _hoisted_26, [
|
|
642
|
+
createVNode(_component_BIcon, {
|
|
643
|
+
icon: "PhMonitor",
|
|
644
|
+
class: "h-4 w-4 fill-white"
|
|
645
|
+
})
|
|
646
|
+
]),
|
|
647
|
+
createVNode(_sfc_main$1, {
|
|
648
|
+
icon: unref(videoPaused)[`remote_screen_${remoteUserId}`] ? "PhPlay" : "PhPause",
|
|
649
|
+
label: unref(videoPaused)[`remote_screen_${remoteUserId}`] ? unref(t)("chat.call.controls.playVideo") : unref(t)("chat.call.controls.pauseVideo"),
|
|
650
|
+
dt: callButtonDt,
|
|
651
|
+
text: false,
|
|
652
|
+
"icon-class": "size-4",
|
|
653
|
+
onClick: ($event) => unref(toggleVideoPause)(
|
|
654
|
+
`remote_screen_${remoteUserId}`,
|
|
655
|
+
unref(remoteScreenRefs)[remoteUserId] || null
|
|
656
|
+
)
|
|
657
|
+
}, null, 8, ["icon", "label", "onClick"]),
|
|
658
|
+
createVNode(_sfc_main$1, {
|
|
659
|
+
icon: unref(isFullscreen) ? "PhCornersIn" : "PhFrameCorners",
|
|
660
|
+
label: unref(isFullscreen) ? unref(t)("chat.call.controls.exitFullscreen") : unref(t)("chat.call.controls.fullscreen"),
|
|
661
|
+
dt: callButtonDt,
|
|
662
|
+
text: false,
|
|
663
|
+
"icon-class": "size-4",
|
|
664
|
+
onClick: ($event) => unref(toggleRemote)(`remote_screen_${remoteUserId}`)
|
|
665
|
+
}, null, 8, ["icon", "label", "onClick"])
|
|
666
|
+
])
|
|
667
|
+
]);
|
|
668
|
+
}), 128))
|
|
669
|
+
], 512), [
|
|
670
|
+
[vShow, unref(tileCount)]
|
|
671
|
+
]),
|
|
672
|
+
createElementVNode("div", {
|
|
673
|
+
class: normalizeClass(["flex min-h-0", [unref(tileCount) && "absolute inset-0 m-4"]])
|
|
674
|
+
}, [
|
|
675
|
+
!unref(callStore).isMinimized ? (openBlock(), createElementBlock("div", {
|
|
676
|
+
key: 0,
|
|
677
|
+
class: normalizeClass(["relative flex flex-col items-center justify-center overflow-hidden rounded-2xl border-2 border-chat-primary/0 bg-black-600 p-2", [
|
|
678
|
+
unref(tileCount) ? "absolute z-10 h-[132px] w-[236px]" : "h-full w-full"
|
|
679
|
+
]])
|
|
680
|
+
}, [
|
|
681
|
+
createElementVNode("video", {
|
|
682
|
+
ref_key: "localVideo",
|
|
683
|
+
ref: localVideo,
|
|
684
|
+
"data-testid": "call-local-video",
|
|
685
|
+
autoplay: "",
|
|
686
|
+
muted: "",
|
|
687
|
+
playsinline: "",
|
|
688
|
+
class: "pointer-events-none absolute inset-0 z-0 h-full w-full object-cover"
|
|
689
|
+
}, null, 512),
|
|
690
|
+
_cache[20] || (_cache[20] = createElementVNode("div", { class: "pointer-events-none absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent" }, null, -1)),
|
|
691
|
+
createElementVNode("div", _hoisted_27, [
|
|
692
|
+
createElementVNode("div", _hoisted_28, toDisplayString(unref(t)("You")), 1),
|
|
693
|
+
!unref(isAudioOn) ? (openBlock(), createElementBlock("div", _hoisted_29, [
|
|
694
|
+
createVNode(_component_BIcon, {
|
|
695
|
+
icon: "PhMicrophoneSlash",
|
|
696
|
+
class: "h-3 w-3 fill-white"
|
|
697
|
+
})
|
|
698
|
+
])) : createCommentVNode("", true),
|
|
699
|
+
createVNode(_sfc_main$1, {
|
|
700
|
+
icon: unref(videoPaused)["self_cam"] ? "PhPlay" : "PhPause",
|
|
701
|
+
label: unref(videoPaused)["self_cam"] ? unref(t)("chat.call.controls.playVideo") : unref(t)("chat.call.controls.pauseVideo"),
|
|
702
|
+
dt: callButtonDt,
|
|
703
|
+
text: false,
|
|
704
|
+
"icon-class": "size-4",
|
|
705
|
+
onClick: _cache[8] || (_cache[8] = ($event) => unref(toggleVideoPause)("self_cam", unref(localVideo)))
|
|
706
|
+
}, null, 8, ["icon", "label"]),
|
|
707
|
+
createVNode(_sfc_main$1, {
|
|
708
|
+
icon: unref(isFullscreen) ? "PhCornersIn" : "PhFrameCorners",
|
|
709
|
+
label: unref(isFullscreen) ? unref(t)("chat.call.controls.exitFullscreen") : unref(t)("chat.call.controls.fullscreen"),
|
|
710
|
+
dt: callButtonDt,
|
|
711
|
+
text: false,
|
|
712
|
+
"icon-class": "size-4",
|
|
713
|
+
onClick: _cache[9] || (_cache[9] = ($event) => unref(toggleRemote)("self_cam"))
|
|
714
|
+
}, null, 8, ["icon", "label"])
|
|
715
|
+
]),
|
|
716
|
+
!unref(isVideoOn) ? (openBlock(), createElementBlock("div", _hoisted_30, [
|
|
717
|
+
createElementVNode("div", _hoisted_31, [
|
|
718
|
+
createElementVNode("div", _hoisted_32, [
|
|
719
|
+
createElementVNode("span", _hoisted_33, toDisplayString(unref(t)("You")), 1)
|
|
720
|
+
]),
|
|
721
|
+
createElementVNode("p", _hoisted_34, toDisplayString(unref(t)("Camera is off")), 1)
|
|
722
|
+
])
|
|
723
|
+
])) : createCommentVNode("", true)
|
|
724
|
+
], 2)) : createCommentVNode("", true)
|
|
725
|
+
], 2)
|
|
726
|
+
], 34),
|
|
727
|
+
!unref(callStore).isMinimized ? (openBlock(), createElementBlock("div", {
|
|
728
|
+
key: 1,
|
|
729
|
+
class: normalizeClass(["flex h-21 w-full items-center justify-center gap-x-1.5 border-t border-t-[#2C2C2E] bg-black-600 transition-all duration-300 sm:gap-x-3", unref(showControls) ? "opacity-100" : "opacity-0"]),
|
|
730
|
+
onMouseenter: _cache[14] || (_cache[14] = //@ts-ignore
|
|
731
|
+
(...args) => unref(resetControlsTimeout) && unref(resetControlsTimeout)(...args)),
|
|
732
|
+
onMousemove: _cache[15] || (_cache[15] = //@ts-ignore
|
|
733
|
+
(...args) => unref(resetControlsTimeout) && unref(resetControlsTimeout)(...args))
|
|
734
|
+
}, [
|
|
735
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
736
|
+
icon: unref(isAudioOn) ? "PhMicrophone" : "PhMicrophoneSlash",
|
|
737
|
+
label: unref(isAudioOn) ? unref(t)("chat.call.controls.mute") : unref(t)("chat.call.controls.unmute"),
|
|
738
|
+
severity: unref(isAudioOn) ? "secondary" : "contrast"
|
|
739
|
+
}, footerButton, {
|
|
740
|
+
"data-testid": "call-toggle-audio",
|
|
741
|
+
"data-active": unref(isAudioOn),
|
|
742
|
+
onClick: unref(toggleAudio)
|
|
743
|
+
}), null, 16, ["icon", "label", "severity", "data-active", "onClick"]),
|
|
744
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
745
|
+
icon: unref(isVideoOn) ? "PhVideo" : "PhVideoCameraSlash",
|
|
746
|
+
label: unref(isVideoOn) ? unref(t)("chat.call.controls.cameraOff") : unref(t)("chat.call.controls.cameraOn"),
|
|
747
|
+
severity: unref(isVideoOn) ? "secondary" : "contrast"
|
|
748
|
+
}, footerButton, {
|
|
749
|
+
"data-testid": "call-toggle-video",
|
|
750
|
+
"data-active": unref(isVideoOn),
|
|
751
|
+
onClick: unref(toggleVideo)
|
|
752
|
+
}), null, 16, ["icon", "label", "severity", "data-active", "onClick"]),
|
|
753
|
+
unref(cameras).length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
754
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
755
|
+
icon: "PhCaretUp",
|
|
756
|
+
label: unref(t)("chat.call.controls.chooseCamera")
|
|
757
|
+
}, footerButton, {
|
|
758
|
+
onClick: _cache[11] || (_cache[11] = ($event) => cameraPickerOpen.value = true)
|
|
759
|
+
}), null, 16, ["label"]),
|
|
760
|
+
createVNode(_sfc_main$3, {
|
|
761
|
+
visible: cameraPickerOpen.value,
|
|
762
|
+
"onUpdate:visible": _cache[13] || (_cache[13] = ($event) => cameraPickerOpen.value = $event),
|
|
763
|
+
header: unref(t)("chat.call.controls.cameras"),
|
|
764
|
+
width: "24rem"
|
|
765
|
+
}, {
|
|
766
|
+
default: withCtx(() => [
|
|
767
|
+
createVNode(unref(Listbox), {
|
|
768
|
+
options: unref(cameras),
|
|
769
|
+
"option-value": "deviceId",
|
|
770
|
+
"option-label": (camera) => camera.label || `Camera ${camera.deviceId}`,
|
|
771
|
+
class: "w-full",
|
|
772
|
+
onChange: _cache[12] || (_cache[12] = (event) => pickCamera(event.value))
|
|
773
|
+
}, null, 8, ["options", "option-label"])
|
|
774
|
+
]),
|
|
775
|
+
_: 1
|
|
776
|
+
}, 8, ["visible", "header"])
|
|
777
|
+
], 64)) : createCommentVNode("", true),
|
|
778
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
779
|
+
icon: "PhMonitorArrowUp",
|
|
780
|
+
label: unref(isScreenSharing) ? unref(t)("chat.call.controls.stopSharing") : unref(t)("chat.call.controls.shareScreen"),
|
|
781
|
+
severity: unref(isScreenSharing) ? "contrast" : "secondary"
|
|
782
|
+
}, footerButton, {
|
|
783
|
+
"data-testid": "call-toggle-screen",
|
|
784
|
+
"data-active": unref(isScreenSharing),
|
|
785
|
+
onClick: unref(toggleScreenShare)
|
|
786
|
+
}), null, 16, ["label", "severity", "data-active", "onClick"]),
|
|
787
|
+
createVNode(_sfc_main$1, mergeProps({
|
|
788
|
+
icon: unref(isFullscreen) ? "PhCornersIn" : "PhFrameCorners",
|
|
789
|
+
label: unref(isFullscreen) ? unref(t)("chat.call.controls.exitFullscreen") : unref(t)("chat.call.controls.fullscreen")
|
|
790
|
+
}, footerButton, { onClick: unref(toggleFullscreen) }), null, 16, ["icon", "label", "onClick"]),
|
|
791
|
+
unref(isFlashlightSupported) ? (openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
792
|
+
key: 1,
|
|
793
|
+
icon: unref(isFlashlightOn) ? "PhLightning" : "PhLightningSlash",
|
|
794
|
+
label: unref(t)("chat.call.controls.flashlight"),
|
|
795
|
+
severity: unref(isFlashlightOn) ? "contrast" : "secondary"
|
|
796
|
+
}, footerButton, { onClick: unref(toggleFlashlight) }), null, 16, ["icon", "label", "severity", "onClick"])) : createCommentVNode("", true),
|
|
797
|
+
createVNode(_sfc_main$1, {
|
|
798
|
+
icon: "PhPhoneX",
|
|
799
|
+
label: unref(t)("chat.call.controls.endCall"),
|
|
800
|
+
severity: "danger",
|
|
801
|
+
text: false,
|
|
802
|
+
size: "large",
|
|
803
|
+
"icon-class": "size-6",
|
|
804
|
+
"data-testid": "call-end",
|
|
805
|
+
onClick: unref(endCall)
|
|
806
|
+
}, null, 8, ["label", "onClick"])
|
|
807
|
+
], 34)) : createCommentVNode("", true)
|
|
808
|
+
], 512), [
|
|
809
|
+
[vShow, unref(callStore).isActive && !unref(callStore).isMinimized]
|
|
810
|
+
])
|
|
811
|
+
], 64);
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
export {
|
|
816
|
+
_sfc_main as default
|
|
817
|
+
};
|
|
818
|
+
//# sourceMappingURL=Call-Dwuyd-Ut.mjs.map
|