@acorex-platform/module-conversation-client 0.0.30 → 0.0.32
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/fesm2022/{acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs → acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-BP8QEicz.mjs} +8059 -6966
- package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-BP8QEicz.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-CmDyRc1Y.mjs → acorex-platform-module-conversation-client-after-message-sent.command-CpMGuSU1.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-after-message-sent.command-CmDyRc1Y.mjs.map → acorex-platform-module-conversation-client-after-message-sent.command-CpMGuSU1.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-CgXdPrQH.mjs → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-Dgs6fpN3.mjs} +6 -6
- package/fesm2022/{acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-CgXdPrQH.mjs.map → acorex-platform-module-conversation-client-assist-delegated-agent-detail-popup.component-Dgs6fpN3.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-assist-tool-detail-popup.component-GC58B_n0.mjs → acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BRW1cHN6.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-conversation-client-assist-tool-detail-popup.component-GC58B_n0.mjs.map → acorex-platform-module-conversation-client-assist-tool-detail-popup.component-BRW1cHN6.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-BStKnruT.mjs +1379 -0
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-BStKnruT.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-start-popup.component-CjDlRcZn.mjs → acorex-platform-module-conversation-client-chat-call-start-popup.component-eKYhjy91.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-conversation-client-chat-call-start-popup.component-CjDlRcZn.mjs.map → acorex-platform-module-conversation-client-chat-call-start-popup.component-eKYhjy91.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-BVJdVPke.mjs → acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-DLYtqFLi.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-BVJdVPke.mjs.map → acorex-platform-module-conversation-client-chat-conversation-info-media-view.component-DLYtqFLi.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-panel.component-CE40xbl9.mjs +472 -0
- package/fesm2022/acorex-platform-module-conversation-client-chat-conversation-info-panel.component-CE40xbl9.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-5wGD4EjK.mjs → acorex-platform-module-conversation-client-comments-page.component-VOuN3y_8.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-comments-page.component-5wGD4EjK.mjs.map → acorex-platform-module-conversation-client-comments-page.component-VOuN3y_8.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-contracts.mjs +39 -6
- package/fesm2022/acorex-platform-module-conversation-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-xUnxBY_Y.mjs → acorex-platform-module-conversation-client-mark-conversation-unread.command-9tbWXMsa.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-mark-conversation-unread.command-xUnxBY_Y.mjs.map → acorex-platform-module-conversation-client-mark-conversation-unread.command-9tbWXMsa.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs → acorex-platform-module-conversation-client-open-chat.command-CdMsYHwG.mjs} +16 -1
- package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-CdMsYHwG.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-CPpgvLKH.mjs → acorex-platform-module-conversation-client-retry-assist-response.command-DvOeezMD.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-conversation-client-retry-assist-response.command-CPpgvLKH.mjs.map → acorex-platform-module-conversation-client-retry-assist-response.command-DvOeezMD.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-CmJAjrZb.mjs +50 -0
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-CmJAjrZb.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-conversation-client.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-platform-module-conversation-client-contracts.d.ts +28 -18
- package/types/acorex-platform-module-conversation-client.d.ts +149 -74
- package/fesm2022/acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-C8b3D66q.mjs +0 -871
- package/fesm2022/acorex-platform-module-conversation-client-chat-call-session-page.component-C8b3D66q.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs +0 -142
- package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-chat-call-session-page.component-C8b3D66q.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-controls.component.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-controls.component.html","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-ringer.service.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-signal.client.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-sidebar.component.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-sidebar.component.html","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-video-attach.directive.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-session-page.component.ts","../../../../libs/modules/conversation/client/src/lib/features/chat/plugins/call/chat-call-session-page.component.html"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, output, signal } from '@angular/core';\n\nimport type { AXMChatCallPhase } from './chat-call-session.types';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport type AXMChatCallDeviceKind = 'audioinput' | 'videoinput';\n\nexport interface AXMChatCallDeviceChoice {\n kind: AXMChatCallDeviceKind;\n deviceId: string;\n}\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-chat-call-controls',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXTranslationModule, AsyncPipe],\n templateUrl: './chat-call-controls.component.html',\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n }\n\n .axm-chat-call-controls {\n position: relative;\n display: flex;\n align-items: flex-start;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1.25rem;\n padding: 0.75rem 1rem 1.25rem;\n }\n\n .axm-chat-call-controls__item {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .axm-chat-call-controls__action {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.5rem;\n min-width: 4.5rem;\n padding: 0;\n border: 0;\n background: transparent;\n color: #ffffff;\n cursor: pointer;\n }\n\n .axm-chat-call-controls__action:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.45);\n outline-offset: 4px;\n border-radius: 0.5rem;\n }\n\n .axm-chat-call-controls__circle {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 3.25rem;\n height: 3.25rem;\n border-radius: 9999px;\n background: #3a3d41;\n color: #ffffff;\n font-size: 1.125rem;\n }\n\n .axm-chat-call-controls__circle--danger {\n background: #e53935;\n }\n\n .axm-chat-call-controls__circle--success {\n background: #4caf50;\n }\n\n .axm-chat-call-controls__circle--light {\n background: #f2f2f2;\n color: #1a1c1e;\n }\n\n .axm-chat-call-controls__chevron {\n position: absolute;\n top: -0.15rem;\n inset-inline-end: 0.35rem;\n z-index: 2;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.15rem;\n height: 1.15rem;\n padding: 0;\n border-radius: 9999px;\n background: #2b2e32;\n border: 1px solid rgba(255, 255, 255, 0.2);\n font-size: 0.55rem;\n color: #ffffff;\n cursor: pointer;\n }\n\n .axm-chat-call-controls__label {\n font-size: 0.75rem;\n line-height: 1.2;\n color: #ffffff;\n white-space: nowrap;\n }\n\n .axm-chat-call-controls__hangup {\n transform: rotate(135deg);\n }\n\n .axm-chat-call-controls__menu-backdrop {\n position: fixed;\n inset: 0;\n z-index: 20;\n border: 0;\n background: transparent;\n cursor: default;\n }\n\n .axm-chat-call-controls__menu {\n position: absolute;\n bottom: calc(100% + 0.5rem);\n inset-inline-start: 50%;\n z-index: 21;\n min-width: 12rem;\n max-width: 18rem;\n margin: 0;\n padding: 0.35rem;\n list-style: none;\n border-radius: 0.75rem;\n background: #2b2e32;\n border: 1px solid rgba(255, 255, 255, 0.12);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);\n transform: translateX(-50%);\n }\n\n .axm-chat-call-controls__menu-empty,\n .axm-chat-call-controls__menu-item {\n display: block;\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: #ffffff;\n font-size: 0.8125rem;\n text-align: start;\n }\n\n .axm-chat-call-controls__menu-item {\n cursor: pointer;\n }\n\n .axm-chat-call-controls__menu-item:hover,\n .axm-chat-call-controls__menu-item--active {\n background: rgba(255, 255, 255, 0.1);\n }\n `,\n ],\n})\nexport class AXMChatCallControlsComponent {\n //#region ----- Inputs / Outputs -----\n\n readonly phase = input<AXMChatCallPhase>('outgoing-waiting');\n readonly videoEnabled = input(false);\n readonly micMuted = input(false);\n readonly showAddPeople = input(false);\n readonly showScreencast = input(true);\n readonly audioDevices = input<MediaDeviceInfo[]>([]);\n readonly videoDevices = input<MediaDeviceInfo[]>([]);\n readonly selectedAudioDeviceId = input<string | null>(null);\n readonly selectedVideoDeviceId = input<string | null>(null);\n\n readonly screencast = output<void>();\n readonly toggleVideo = output<void>();\n readonly toggleMute = output<void>();\n readonly endCall = output<void>();\n readonly accept = output<void>();\n readonly decline = output<void>();\n readonly addPeople = output<void>();\n readonly pickDevice = output<AXMChatCallDeviceChoice>();\n readonly requestDevices = output<AXMChatCallDeviceKind>();\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly openMenu = signal<AXMChatCallDeviceKind | null>(null);\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly isIncoming = computed(() => this.phase() === 'incoming');\n\n protected readonly hangupLabelKey = computed(() =>\n this.phase() === 'active'\n ? '@conversation:chat.call.end-call'\n : '@conversation:chat.call.cancel',\n );\n\n protected readonly videoLabelKey = computed(() =>\n this.videoEnabled()\n ? '@conversation:chat.call.stop-video'\n : '@conversation:chat.call.start-video',\n );\n\n protected readonly muteLabelKey = computed(() =>\n this.micMuted() ? '@conversation:chat.call.unmute' : '@conversation:chat.call.mute',\n );\n\n protected readonly menuDevices = computed(() => {\n const kind = this.openMenu();\n if (kind === 'audioinput') {\n return this.audioDevices();\n }\n if (kind === 'videoinput') {\n return this.videoDevices();\n }\n return [];\n });\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onOpenDeviceMenu(event: Event, kind: AXMChatCallDeviceKind): void {\n event.preventDefault();\n event.stopPropagation();\n this.openMenu.set(this.openMenu() === kind ? null : kind);\n this.requestDevices.emit(kind);\n }\n\n protected onCloseDeviceMenu(): void {\n this.openMenu.set(null);\n }\n\n protected onSelectDevice(kind: AXMChatCallDeviceKind, deviceId: string): void {\n this.pickDevice.emit({ kind, deviceId });\n this.openMenu.set(null);\n }\n\n protected selectedDeviceId(kind: AXMChatCallDeviceKind): string | null {\n return kind === 'audioinput' ? this.selectedAudioDeviceId() : this.selectedVideoDeviceId();\n }\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"axm-chat-call-controls\">\n <!-- ----- Incoming: camera before decline/accept ----- -->\n @if (isIncoming()) {\n <div class=\"axm-chat-call-controls__item\">\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"toggleVideo.emit()\">\n <span class=\"axm-chat-call-controls__circle\" [class.axm-chat-call-controls__circle--light]=\"videoEnabled()\">\n <i class=\"fa-solid\" [class.fa-video]=\"videoEnabled()\" [class.fa-video-slash]=\"!videoEnabled()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ videoLabelKey() | translate | async }}</span>\n </button>\n <button\n type=\"button\"\n class=\"axm-chat-call-controls__chevron\"\n (click)=\"onOpenDeviceMenu($event, 'videoinput')\"\n [attr.aria-label]=\"'@conversation:chat.call.devices.camera' | translate | async\"\n >\n <i class=\"fa-solid fa-chevron-up\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"decline.emit()\">\n <span class=\"axm-chat-call-controls__circle axm-chat-call-controls__circle--danger\">\n <i class=\"fa-solid fa-phone axm-chat-call-controls__hangup\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ '@conversation:chat.call.decline' | translate | async }}</span>\n </button>\n\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"accept.emit()\">\n <span class=\"axm-chat-call-controls__circle axm-chat-call-controls__circle--success\">\n <i class=\"fa-solid fa-phone\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ '@conversation:chat.call.accept' | translate | async }}</span>\n </button>\n\n <div class=\"axm-chat-call-controls__item\">\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"toggleMute.emit()\">\n <span class=\"axm-chat-call-controls__circle\" [class.axm-chat-call-controls__circle--light]=\"!micMuted()\">\n <i class=\"fa-solid\" [class.fa-microphone]=\"!micMuted()\" [class.fa-microphone-slash]=\"micMuted()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ muteLabelKey() | translate | async }}</span>\n </button>\n <button\n type=\"button\"\n class=\"axm-chat-call-controls__chevron\"\n (click)=\"onOpenDeviceMenu($event, 'audioinput')\"\n [attr.aria-label]=\"'@conversation:chat.call.devices.microphone' | translate | async\"\n >\n <i class=\"fa-solid fa-chevron-up\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n <!-- ----- Outgoing / active controls ----- -->\n @else {\n <!-- ----- Screencast only during an active call ----- -->\n @if (showScreencast()) {\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"screencast.emit()\">\n <span class=\"axm-chat-call-controls__circle axm-chat-call-controls__circle--light\">\n <i class=\"fa-solid fa-desktop\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ '@conversation:chat.call.screencast' | translate | async }}</span>\n </button>\n }\n\n <div class=\"axm-chat-call-controls__item\">\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"toggleVideo.emit()\">\n <span class=\"axm-chat-call-controls__circle\" [class.axm-chat-call-controls__circle--light]=\"videoEnabled()\">\n <i class=\"fa-solid\" [class.fa-video]=\"videoEnabled()\" [class.fa-video-slash]=\"!videoEnabled()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ videoLabelKey() | translate | async }}</span>\n </button>\n <button\n type=\"button\"\n class=\"axm-chat-call-controls__chevron\"\n (click)=\"onOpenDeviceMenu($event, 'videoinput')\"\n [attr.aria-label]=\"'@conversation:chat.call.devices.camera' | translate | async\"\n >\n <i class=\"fa-solid fa-chevron-up\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"endCall.emit()\">\n <span class=\"axm-chat-call-controls__circle axm-chat-call-controls__circle--danger\">\n <i class=\"fa-solid fa-phone axm-chat-call-controls__hangup\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ hangupLabelKey() | translate | async }}</span>\n </button>\n\n <div class=\"axm-chat-call-controls__item\">\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"toggleMute.emit()\">\n <span class=\"axm-chat-call-controls__circle\" [class.axm-chat-call-controls__circle--light]=\"!micMuted()\">\n <i class=\"fa-solid\" [class.fa-microphone]=\"!micMuted()\" [class.fa-microphone-slash]=\"micMuted()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ muteLabelKey() | translate | async }}</span>\n </button>\n <button\n type=\"button\"\n class=\"axm-chat-call-controls__chevron\"\n (click)=\"onOpenDeviceMenu($event, 'audioinput')\"\n [attr.aria-label]=\"'@conversation:chat.call.devices.microphone' | translate | async\"\n >\n <i class=\"fa-solid fa-chevron-up\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n <!-- ----- Add people on an active group call ----- -->\n @if (showAddPeople()) {\n <button type=\"button\" class=\"axm-chat-call-controls__action\" (click)=\"addPeople.emit()\">\n <span class=\"axm-chat-call-controls__circle axm-chat-call-controls__circle--light\">\n <i class=\"fa-solid fa-user-plus\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"axm-chat-call-controls__label\">{{ '@conversation:chat.call.add-people' | translate | async }}</span>\n </button>\n }\n }\n\n <!-- ----- Device switcher ----- -->\n @if (openMenu(); as kind) {\n <button type=\"button\" class=\"axm-chat-call-controls__menu-backdrop\" (click)=\"onCloseDeviceMenu()\"></button>\n <ul class=\"axm-chat-call-controls__menu\" role=\"listbox\">\n @if (menuDevices().length === 0) {\n <li class=\"axm-chat-call-controls__menu-empty\">\n {{ '@conversation:chat.call.devices.empty' | translate | async }}\n </li>\n }\n @for (device of menuDevices(); track device.deviceId) {\n <li>\n <button\n type=\"button\"\n class=\"axm-chat-call-controls__menu-item\"\n [class.axm-chat-call-controls__menu-item--active]=\"device.deviceId === selectedDeviceId(kind)\"\n (click)=\"onSelectDevice(kind, device.deviceId)\"\n >\n {{ device.label || device.deviceId }}\n </button>\n </li>\n }\n </ul>\n }\n</div>\n","//#region ----- Imports -----\n\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst CHAT_CALL_INCOMING_RING_SRC = 'assets/sounds/ring.mp3';\nconst CHAT_CALL_OUTGOING_RING_SRC = 'assets/sounds/phone-call.mp3';\nconst CHAT_CALL_OUTGOING_GAP_MS = 2500;\n\n//#endregion\n\n//#region ----- Service -----\n\n/**\n * Plays call audio: looping ringtone for the callee, spaced ringback for the caller.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMChatCallRingerService {\n //#region ----- Private State -----\n\n private audio: HTMLAudioElement | null = null;\n private gapTimer: ReturnType<typeof setTimeout> | null = null;\n private playing = false;\n\n //#endregion\n\n //#region ----- Playback -----\n\n playIncoming(): void {\n this.#playLooped(CHAT_CALL_INCOMING_RING_SRC);\n }\n\n playOutgoing(): void {\n this.#playWithGap(CHAT_CALL_OUTGOING_RING_SRC, CHAT_CALL_OUTGOING_GAP_MS);\n }\n\n stop(): void {\n this.playing = false;\n this.#clearGapTimer();\n const audio = this.audio;\n this.audio = null;\n if (!audio) {\n return;\n }\n audio.pause();\n audio.removeAttribute('src');\n audio.load();\n }\n\n #playLooped(src: string): void {\n this.stop();\n if (typeof Audio === 'undefined') {\n return;\n }\n this.playing = true;\n const audio = new Audio(src);\n audio.loop = true;\n void audio.play().catch(() => {\n // Autoplay may be blocked until a user gesture; the call UI still shows.\n });\n this.audio = audio;\n }\n\n #playWithGap(src: string, gapMs: number): void {\n this.stop();\n if (typeof Audio === 'undefined') {\n return;\n }\n this.playing = true;\n this.#playOutgoingClip(src, gapMs);\n }\n\n #playOutgoingClip(src: string, gapMs: number): void {\n if (!this.playing) {\n return;\n }\n const previous = this.audio;\n this.audio = null;\n if (previous) {\n previous.pause();\n previous.removeAttribute('src');\n previous.load();\n }\n\n const audio = new Audio(src);\n audio.loop = false;\n audio.addEventListener(\n 'ended',\n () => {\n if (!this.playing) {\n return;\n }\n this.#clearGapTimer();\n this.gapTimer = setTimeout(() => {\n this.gapTimer = null;\n this.#playOutgoingClip(src, gapMs);\n }, gapMs);\n },\n { once: true },\n );\n void audio.play().catch(() => {\n // Autoplay may be blocked until a user gesture; the call UI still shows.\n });\n this.audio = audio;\n }\n\n #clearGapTimer(): void {\n if (this.gapTimer == null) {\n return;\n }\n clearTimeout(this.gapTimer);\n this.gapTimer = null;\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { AXP_ROOT_CONFIG_TOKEN } from '@acorex-platform/framework-client/common';\nimport type {\n AXPRealtimeConversationCallAction,\n AXPRealtimeConversationCallMedia,\n} from '@acorex-platform/framework-client/realtime';\nimport { HttpClient } from '@angular/common/http';\nimport { Injectable, inject } from '@angular/core';\nimport { firstValueFrom } from 'rxjs';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface AXMChatCallSignalRequest {\n conversationId: string;\n action: AXPRealtimeConversationCallAction;\n media: AXPRealtimeConversationCallMedia;\n callId?: string;\n targetUserIds?: string[];\n}\n\nexport interface AXMChatCallSignalResult {\n ok: true;\n callId: string;\n}\n\nexport interface AXMChatCallLogRequest {\n conversationId: string;\n outcome: 'declined' | 'missed' | 'cancelled';\n media: AXPRealtimeConversationCallMedia;\n callId: string;\n}\n\nexport interface AXMChatCallLogResult {\n ok: true;\n messageId: string;\n callId: string;\n}\n\n//#endregion\n\n//#region ----- Client -----\n\n/**\n * Posts call signaling to the conversation API (built-in realtime fan-out on server).\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMChatCallSignalClient {\n private readonly http = inject(HttpClient);\n private readonly rootConfig = inject(AXP_ROOT_CONFIG_TOKEN);\n\n async signal(request: AXMChatCallSignalRequest): Promise<AXMChatCallSignalResult> {\n const conversationId = request.conversationId.trim();\n const url = `${this.rootConfig.baseUrl}/v1/global/conversation/conversations/${encodeURIComponent(conversationId)}/calls/signal`;\n return firstValueFrom(\n this.http.post<AXMChatCallSignalResult>(\n url,\n {\n action: request.action,\n media: request.media,\n callId: request.callId,\n targetUserIds: request.targetUserIds,\n },\n { withCredentials: true },\n ),\n );\n }\n\n async log(request: AXMChatCallLogRequest): Promise<AXMChatCallLogResult> {\n const conversationId = request.conversationId.trim();\n const url = `${this.rootConfig.baseUrl}/v1/global/conversation/conversations/${encodeURIComponent(conversationId)}/calls/log`;\n return firstValueFrom(\n this.http.post<AXMChatCallLogResult>(\n url,\n {\n outcome: request.outcome,\n media: request.media,\n callId: request.callId,\n },\n { withCredentials: true },\n ),\n );\n }\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { AXPAvatarComponent } from '@acorex-platform/framework-client/layout/components';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, input, output } from '@angular/core';\n\nimport type { AXMChatCallParticipantView } from './chat-call-session.types';\n\n//#endregion\n\n//#region ----- Component -----\n\n@Component({\n selector: 'axm-chat-call-sidebar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AXPAvatarComponent, AXTranslationModule, AsyncPipe],\n templateUrl: './chat-call-sidebar.component.html',\n styles: [\n `\n :host {\n display: flex;\n flex-direction: column;\n width: 16.5rem;\n min-width: 16.5rem;\n height: 100%;\n background: #141517;\n border-inline-start: 1px solid rgba(255, 255, 255, 0.06);\n color: #ffffff;\n }\n\n .axm-chat-call-sidebar__header {\n padding: 1rem 1rem 0.75rem;\n font-size: 0.75rem;\n color: rgba(255, 255, 255, 0.55);\n }\n\n .axm-chat-call-sidebar__list {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n flex: 1;\n min-height: 0;\n overflow: auto;\n padding: 0.5rem 1rem 1rem;\n }\n\n .axm-chat-call-sidebar__row {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n }\n\n .axm-chat-call-sidebar__meta {\n display: flex;\n flex-direction: column;\n gap: 0.2rem;\n min-width: 0;\n }\n\n .axm-chat-call-sidebar__name {\n font-size: 0.875rem;\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .axm-chat-call-sidebar__status {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n font-size: 0.75rem;\n color: #7dd87d;\n }\n\n .axm-chat-call-sidebar__status i {\n font-size: 0.7rem;\n }\n\n .axm-chat-call-sidebar__actions {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n padding: 0.75rem 0.5rem 1rem;\n border-top: 1px solid rgba(255, 255, 255, 0.06);\n }\n\n .axm-chat-call-sidebar__action {\n display: flex;\n align-items: center;\n gap: 0.65rem;\n width: 100%;\n padding: 0.65rem 0.75rem;\n border: 0;\n border-radius: 0.5rem;\n background: transparent;\n color: #ffffff;\n font-size: 0.875rem;\n cursor: pointer;\n text-align: start;\n }\n\n .axm-chat-call-sidebar__action:hover {\n background: rgba(255, 255, 255, 0.06);\n }\n `,\n ],\n})\nexport class AXMChatCallSidebarComponent {\n //#region ----- Inputs / Outputs -----\n\n readonly participants = input<AXMChatCallParticipantView[]>([]);\n\n readonly addPeople = output<void>();\n readonly shareLink = output<void>();\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"axm-chat-call-sidebar__header\">\n {{ '@conversation:chat.call.encrypted' | translate | async }}\n</div>\n\n<div class=\"axm-chat-call-sidebar__list\">\n @for (participant of participants(); track participant.id) {\n <div class=\"axm-chat-call-sidebar__row\">\n <axp-avatar [size]=\"36\" [fullName]=\"participant.name\" [src]=\"participant.avatar ?? ''\" />\n <div class=\"axm-chat-call-sidebar__meta\">\n <span class=\"axm-chat-call-sidebar__name\">{{ participant.name }}</span>\n @if (participant.speaking) {\n <span class=\"axm-chat-call-sidebar__status\">\n <i class=\"fa-solid fa-microphone\" aria-hidden=\"true\"></i>\n <i class=\"fa-solid fa-video\" aria-hidden=\"true\"></i>\n {{ '@conversation:chat.call.speaking' | translate | async }}\n </span>\n }\n </div>\n </div>\n }\n</div>\n\n<div class=\"axm-chat-call-sidebar__actions\">\n <button type=\"button\" class=\"axm-chat-call-sidebar__action\" (click)=\"addPeople.emit()\">\n <i class=\"fa-solid fa-user-plus\" aria-hidden=\"true\"></i>\n <span>{{ '@conversation:chat.call.add-people' | translate | async }}</span>\n </button>\n <button type=\"button\" class=\"axm-chat-call-sidebar__action\" (click)=\"shareLink.emit()\">\n <i class=\"fa-solid fa-link\" aria-hidden=\"true\"></i>\n <span>{{ '@conversation:chat.call.share-link' | translate | async }}</span>\n </button>\n</div>\n","//#region ----- Imports -----\n\nimport { Directive, ElementRef, effect, inject, input } from '@angular/core';\nimport type { LocalTrack, RemoteTrack } from 'livekit-client';\n\n//#endregion\n\n//#region ----- Directive -----\n\ntype AXMChatCallAttachableTrack = LocalTrack | RemoteTrack;\n\n/**\n * Attaches a LiveKit track to the host media element.\n */\n@Directive({\n selector: 'video[axmChatCallTrack]',\n})\nexport class AXMChatCallVideoAttachDirective {\n //#region ----- Inputs -----\n\n readonly axmChatCallTrack = input<AXMChatCallAttachableTrack | null>(null);\n\n //#endregion\n\n //#region ----- Services & Dependencies -----\n\n private readonly host = inject(ElementRef<HTMLVideoElement>);\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n effect((onCleanup) => {\n const track = this.axmChatCallTrack();\n const element = this.host.nativeElement;\n if (!track) {\n element.srcObject = null;\n return;\n }\n\n track.attach(element);\n void element.play().catch(() => undefined);\n\n onCleanup(() => {\n track.detach(element);\n });\n });\n }\n\n //#endregion\n}\n\n//#endregion\n","//#region ----- Imports -----\n\nimport { AXPAvatarComponent } from '@acorex-platform/framework-client/layout/components';\nimport type { AXConversation } from '@acorex/components/conversation';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport { AsyncPipe } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n effect,\n inject,\n OnDestroy,\n OnInit,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { ConnectionState } from 'livekit-client';\nimport { Subscription } from 'rxjs';\n\nimport { AXMConversationRealtimeBus } from '../../services/conversation-realtime.bus';\nimport { AXMChatUserApi } from '../services/chat-conversation-apis.abstract';\nimport { axmResolveConversationListAvatar } from '../utils/chat-avatar.util';\nimport {\n AXMChatCallControlsComponent,\n type AXMChatCallDeviceChoice,\n type AXMChatCallDeviceKind,\n} from './chat-call-controls.component';\nimport { AXMChatCallEventsService } from './chat-call-events.service';\nimport { AXMChatCallRingerService } from './chat-call-ringer.service';\nimport { axmReadChatCallLog, type AXMChatCallLogOutcome } from './chat-call-log.util';\nimport { AXMChatCallRtcSignalInboxService } from './chat-call-rtc-signal-inbox.service';\nimport {\n AXM_CHAT_CALL_RTC_PROVIDERS,\n AXMChatCallRtcService,\n} from './chat-call-rtc.service';\nimport { AXMChatCallSignalClient } from './chat-call-signal.client';\nimport {\n AXMChatCallMediaType,\n AXMChatCallParticipantView,\n AXMChatCallPhase,\n} from './chat-call-session.types';\nimport { AXMChatCallSidebarComponent } from './chat-call-sidebar.component';\nimport { AXMChatCallVideoAttachDirective } from './chat-call-video-attach.directive';\n\n//#endregion\n\n//#region ----- Component -----\n\n/**\n * Call-session popup backed by RTC/LiveKit.\n */\n@Component({\n selector: 'axm-chat-call-session-page',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ax-dark',\n },\n providers: [...AXM_CHAT_CALL_RTC_PROVIDERS],\n imports: [\n AXPAvatarComponent,\n AXTranslationModule,\n AsyncPipe,\n AXMChatCallControlsComponent,\n AXMChatCallSidebarComponent,\n AXMChatCallVideoAttachDirective,\n ],\n templateUrl: './chat-call-session-page.component.html',\n styles: [\n `\n .axm-chat-call-session-overlay .ax-popup-header {\n display: none;\n }\n\n .axm-chat-call-session-overlay .ax-popup .ax-popup-body-container {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n height: 100%;\n }\n\n axm-chat-call-session-page {\n display: flex;\n flex: 1;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 0;\n }\n\n .axm-chat-call-session {\n box-sizing: border-box;\n display: flex;\n flex: 1;\n width: 100%;\n min-height: 0;\n height: 100%;\n }\n\n .axm-chat-call-session__shell {\n display: flex;\n flex: 1;\n width: 100%;\n min-height: 0;\n height: 100%;\n }\n\n .axm-chat-call-session__main {\n display: flex;\n flex: 1;\n flex-direction: column;\n align-items: center;\n min-width: 0;\n min-height: 0;\n padding: 1.25rem 1.25rem 0.5rem;\n }\n\n .axm-chat-call-session__body {\n display: flex;\n flex: 1;\n flex-direction: column;\n align-items: center;\n width: 100%;\n min-height: 0;\n }\n\n .axm-chat-call-session__main--idle .axm-chat-call-session__body {\n justify-content: center;\n }\n\n .axm-chat-call-session__header {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.5rem;\n margin-top: 1.5rem;\n text-align: center;\n }\n\n .axm-chat-call-session__main--idle .axm-chat-call-session__header {\n margin-top: 0;\n }\n\n .axm-chat-call-session__header--compact {\n margin-top: 0.25rem;\n margin-bottom: 0.5rem;\n }\n\n .axm-chat-call-session__name {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 700;\n line-height: 1.3;\n }\n\n .axm-chat-call-session__header--compact .axm-chat-call-session__name {\n font-size: 1rem;\n }\n\n .axm-chat-call-session__phase-text {\n margin: 0;\n font-size: 0.875rem;\n opacity: 0.65;\n }\n\n .axm-chat-call-session__stage {\n position: relative;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n width: 100%;\n min-height: 0;\n margin: 0.75rem 0;\n overflow: hidden;\n }\n\n .axm-chat-call-session__stage--group {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));\n gap: 0.75rem;\n align-content: center;\n padding: 0.5rem;\n }\n\n .axm-chat-call-session__tile {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-radius: 0.75rem;\n background: #101113;\n border: 2px solid transparent;\n }\n\n .axm-chat-call-session__tile--primary {\n width: min(100%, 36rem);\n aspect-ratio: 3 / 4;\n max-height: min(70vh, 40rem);\n }\n\n .axm-chat-call-session__stage--group .axm-chat-call-session__tile {\n aspect-ratio: 3 / 4;\n min-height: 12rem;\n }\n\n .axm-chat-call-session__tile--speaking {\n border-color: #4caf50;\n }\n\n .axm-chat-call-session__tile-name {\n position: absolute;\n inset-inline-start: 0.65rem;\n bottom: 0.65rem;\n padding: 0.15rem 0.45rem;\n border-radius: 0.35rem;\n background: rgba(0, 0, 0, 0.45);\n font-size: 0.75rem;\n }\n\n .axm-chat-call-session__video {\n width: 100%;\n height: 100%;\n object-fit: cover;\n background: #000;\n }\n\n .axm-chat-call-session__pip {\n position: absolute;\n right: 1rem;\n bottom: 1rem;\n width: 8.5rem;\n aspect-ratio: 3 / 4;\n overflow: hidden;\n border-radius: 0.5rem;\n border: 1px solid rgba(255, 255, 255, 0.2);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n background: #000;\n }\n\n .axm-chat-call-session__status-block {\n display: flex;\n flex: 1;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 1rem;\n width: 100%;\n min-height: 0;\n padding: 2rem;\n text-align: center;\n }\n\n .axm-chat-call-session__status-block--error {\n color: #ff8a80;\n }\n\n .axm-chat-call-session__text-button {\n padding: 0.5rem 1rem;\n border: 1px solid currentColor;\n border-radius: 9999px;\n background: transparent;\n color: inherit;\n cursor: pointer;\n opacity: 0.85;\n }\n\n axm-chat-call-controls {\n flex-shrink: 0;\n margin-top: auto;\n width: 100%;\n }\n `,\n ],\n})\nexport class AXMChatCallSessionPageComponent extends AXBasePageComponent implements OnInit, OnDestroy {\n //#region ----- Popup Inputs -----\n\n /** Assigned by {@link AXPopupService} via `data`. */\n sessionConversation?: AXConversation;\n sessionMedia: AXMChatCallMediaType = 'voice';\n sessionPhase: AXMChatCallPhase = 'outgoing-waiting';\n sessionCallId?: string;\n\n //#endregion\n\n //#region ----- Services & Dependencies -----\n\n private readonly userApi = inject(AXMChatUserApi);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n private readonly rtc = inject(AXMChatCallRtcService);\n private readonly callSignal = inject(AXMChatCallSignalClient);\n private readonly signalInbox = inject(AXMChatCallRtcSignalInboxService);\n private readonly callEvents = inject(AXMChatCallEventsService);\n private readonly realtimeBus = inject(AXMConversationRealtimeBus);\n private readonly ringer = inject(AXMChatCallRingerService);\n\n //#endregion\n\n //#region ----- State Signals -----\n\n protected readonly loading = signal(true);\n protected readonly error = signal(false);\n protected readonly errorMessage = signal<string | null>(null);\n protected readonly conversation = signal<AXConversation | null>(null);\n protected readonly phase = signal<AXMChatCallPhase>('outgoing-waiting');\n protected readonly mediaType = signal<AXMChatCallMediaType>('voice');\n protected readonly videoEnabled = signal(false);\n protected readonly micMuted = signal(false);\n protected readonly currentUserId = signal<string | null>(null);\n private readonly callId = signal<string | null>(null);\n private ringTimeoutId: ReturnType<typeof setTimeout> | null = null;\n private outcomeSub: Subscription | null = null;\n private callEventsSub: Subscription | null = null;\n private closing = false;\n private accepting = false;\n protected readonly audioDevices = signal<MediaDeviceInfo[]>([]);\n protected readonly videoDevices = signal<MediaDeviceInfo[]>([]);\n protected readonly selectedAudioDeviceId = signal<string | null>(null);\n protected readonly selectedVideoDeviceId = signal<string | null>(null);\n\n protected readonly localVideoTrack = this.rtc.localVideoTrack;\n protected readonly remoteVideos = this.rtc.remoteVideos;\n\n //#endregion\n\n //#region ----- Computed Properties -----\n\n protected readonly peerDisplayName = computed(() => {\n const conversation = this.conversation();\n if (!conversation) {\n return '';\n }\n return axmResolveConversationListAvatar(conversation).title;\n });\n\n protected readonly peerAvatarSrc = computed(() => {\n const conversation = this.conversation();\n if (!conversation) {\n return '';\n }\n return axmResolveConversationListAvatar(conversation).avatar ?? '';\n });\n\n protected readonly isGroupLayout = computed(() => {\n const conversation = this.conversation();\n if (!conversation) {\n return false;\n }\n return conversation.type === 'group' || (conversation.participants?.length ?? 0) > 2;\n });\n\n protected readonly showStage = computed(() => {\n if (this.phase() === 'active' || this.mediaType() === 'video' || this.videoEnabled()) {\n return true;\n }\n return this.remoteVideos().length > 0;\n });\n\n /** Voice ring / waiting without a video stage — center the profile block. */\n protected readonly idleLayout = computed(() => {\n if (this.showStage()) {\n return false;\n }\n const phase = this.phase();\n return phase === 'incoming' || phase === 'outgoing-waiting' || phase === 'connecting';\n });\n\n protected readonly headerAvatarSize = computed(() => (this.showStage() ? 48 : 128));\n\n protected readonly phaseTextKey = computed(() => {\n switch (this.phase()) {\n case 'incoming':\n return '@conversation:chat.call.is-calling';\n case 'connecting':\n return '@conversation:chat.call.connecting';\n case 'active':\n return '@conversation:chat.call.connected';\n default:\n return '@conversation:chat.call.waiting';\n }\n });\n\n protected readonly primaryRemoteVideo = computed(() => this.remoteVideos()[0] ?? null);\n\n protected readonly selfParticipant = computed((): AXMChatCallParticipantView | null => {\n const conversation = this.conversation();\n const currentUserId = this.currentUserId();\n if (!conversation || !currentUserId) {\n return null;\n }\n const self = conversation.participants?.find((participant) => participant.id === currentUserId);\n return {\n id: currentUserId,\n name: self?.name ?? 'You',\n avatar: self?.avatar,\n isSelf: true,\n micMuted: this.micMuted(),\n videoEnabled: this.videoEnabled(),\n speaking: !this.micMuted(),\n };\n });\n\n protected readonly sidebarParticipants = computed((): AXMChatCallParticipantView[] => {\n const conversation = this.conversation();\n const currentUserId = this.currentUserId();\n if (!conversation) {\n return [];\n }\n\n const remotes = (conversation.participants ?? [])\n .filter((participant) => participant.id !== currentUserId)\n .map((participant) => ({\n id: participant.id,\n name: participant.name,\n avatar: participant.avatar,\n isSelf: false,\n micMuted: false,\n videoEnabled: this.remoteVideos().some((item) => item.participantId === participant.id),\n speaking: this.remoteVideos().some((item) => item.participantId === participant.id),\n }));\n\n const self = this.selfParticipant();\n return self ? [...remotes, self] : remotes;\n });\n\n //#endregion\n\n //#region ----- Lifecycle -----\n\n constructor() {\n super();\n effect(() => {\n const remoteCount = this.rtc.remoteParticipantCount();\n const connectionState = this.rtc.connectionState();\n const phase = this.phase();\n if (\n connectionState === ConnectionState.Connected &&\n remoteCount > 0 &&\n (phase === 'outgoing-waiting' || phase === 'connecting')\n ) {\n this.#clearRingTimeout();\n this.ringer.stop();\n this.phase.set('active');\n void this.rtc.ensureAudioPlayback();\n }\n });\n }\n\n override ngOnInit(): void {\n this.outcomeSub = this.realtimeBus.messageStream$.subscribe((message) => {\n const log = axmReadChatCallLog(message);\n const currentCallId = this.callId();\n if (!log || !currentCallId || log.callId !== currentCallId) {\n return;\n }\n void this.#closeFromRemoteLog();\n });\n this.callEventsSub = this.callEvents.events$.subscribe((payload) => {\n const currentCallId = this.callId();\n if (!currentCallId || payload.callId !== currentCallId) {\n return;\n }\n if (payload.fromUserId === this.currentUserId()) {\n return;\n }\n if (payload.action === 'accept') {\n void this.#onPeerAccepted();\n return;\n }\n if (payload.action === 'end') {\n void this.#closeFromRemoteEnd();\n return;\n }\n if (payload.action === 'decline' || payload.action === 'cancel') {\n void this.#closeFromRemoteLog();\n }\n });\n void this.#bootstrap();\n }\n\n override ngOnDestroy(): void {\n this.ringer.stop();\n this.#clearRingTimeout();\n this.outcomeSub?.unsubscribe();\n this.callEventsSub?.unsubscribe();\n if (!this.closing) {\n const phase = this.phase();\n if (phase === 'incoming') {\n void this.#logOutcome('declined');\n } else if (phase === 'outgoing-waiting') {\n void this.#logOutcome('cancelled');\n }\n }\n this.signalInbox.releaseCall(this.callId());\n void this.rtc.disconnect();\n super.ngOnDestroy();\n }\n\n //#endregion\n\n //#region ----- Event Handlers -----\n\n protected onToggleVideo(): void {\n void this.#setVideoEnabled(!this.videoEnabled());\n }\n\n protected onToggleMute(): void {\n const nextMuted = !this.micMuted();\n this.micMuted.set(nextMuted);\n void this.rtc.setMicrophoneEnabled(!nextMuted);\n if (!nextMuted) {\n void this.rtc.ensureAudioPlayback();\n }\n }\n\n protected async onScreencast(): Promise<void> {\n try {\n await this.rtc.toggleScreenShare(!this.rtc.isScreenSharing());\n } catch {\n const message = await this.translationService.translateAsync('@conversation:chat.call.media-error');\n this.#toast(message, 'danger');\n }\n }\n\n protected onEndCall(): void {\n if (this.phase() === 'outgoing-waiting') {\n void this.#finishWithLog('cancelled');\n return;\n }\n void this.#endActiveCall();\n }\n\n protected onAccept(): void {\n void this.#acceptIncoming();\n }\n\n protected onDecline(): void {\n void this.#finishWithLog('declined');\n }\n\n protected async onAddPeople(): Promise<void> {\n const message = await this.translationService.translateAsync('@conversation:chat.call.add-people-soon');\n this.#toast(message, 'default');\n }\n\n protected onRequestDevices(kind: AXMChatCallDeviceKind): void {\n void this.#refreshDevices(kind);\n }\n\n protected onPickDevice(choice: AXMChatCallDeviceChoice): void {\n if (choice.kind === 'audioinput') {\n this.selectedAudioDeviceId.set(choice.deviceId);\n } else {\n this.selectedVideoDeviceId.set(choice.deviceId);\n }\n void this.rtc.switchInputDevice(choice.kind, choice.deviceId);\n }\n\n protected async onShareLink(): Promise<void> {\n try {\n await navigator.clipboard.writeText(window.location.href);\n const message = await this.translationService.translateAsync('@conversation:chat.call.link-copied');\n this.#toast(message, 'success');\n } catch {\n const message = await this.translationService.translateAsync('@conversation:chat.call.link-copy-failed');\n this.#toast(message, 'danger');\n }\n }\n\n //#endregion\n\n //#region ----- Bootstrap -----\n\n async #bootstrap(): Promise<void> {\n const conversation = this.sessionConversation;\n const conversationId = conversation?.id?.trim();\n const media = this.sessionMedia === 'video' ? 'video' : 'voice';\n const phase: AXMChatCallPhase =\n this.sessionPhase === 'incoming' ||\n this.sessionPhase === 'active' ||\n this.sessionPhase === 'connecting' ||\n this.sessionPhase === 'outgoing-waiting'\n ? this.sessionPhase\n : 'outgoing-waiting';\n\n this.mediaType.set(media);\n this.phase.set(phase);\n this.videoEnabled.set(media === 'video');\n this.callId.set(this.sessionCallId?.trim() || crypto.randomUUID());\n\n if (!conversation || !conversationId) {\n this.loading.set(false);\n this.error.set(true);\n return;\n }\n\n this.loading.set(true);\n this.error.set(false);\n this.errorMessage.set(null);\n this.conversation.set(conversation);\n\n try {\n const currentUser = await this.userApi.getCurrentUser();\n this.currentUserId.set(currentUser.id);\n this.videoEnabled.set(media === 'video');\n this.micMuted.set(false);\n\n if (phase === 'incoming') {\n this.ringer.playIncoming();\n void this.#refreshDevices();\n return;\n }\n\n this.phase.set('outgoing-waiting');\n this.ringer.playOutgoing();\n await this.#ringPeers(currentUser.id);\n this.#armRingTimeout();\n void this.#connectMedia(currentUser.id, currentUser.name, conversationId, media).catch(async (error: unknown) => {\n const fallback = await this.translationService.translateAsync('@conversation:chat.call.connect-error');\n this.#toast(error instanceof Error && error.message ? error.message : fallback, 'danger');\n });\n void this.#refreshDevices();\n } catch (error: unknown) {\n this.error.set(true);\n const fallback = await this.translationService.translateAsync('@conversation:chat.call.connect-error');\n this.errorMessage.set(error instanceof Error && error.message ? error.message : fallback);\n } finally {\n this.loading.set(false);\n }\n }\n\n //#endregion\n\n //#region ----- Call Signaling -----\n\n async #connectMedia(\n participantIdentity: string,\n participantName: string | undefined,\n conversationId: string,\n media: AXMChatCallMediaType,\n ): Promise<void> {\n await this.rtc.connect({\n conversationId,\n participantIdentity,\n participantName,\n media,\n });\n }\n\n async #ringPeers(fromUserId: string): Promise<void> {\n const conversation = this.conversation();\n const callId = this.callId();\n if (!conversation?.id || !callId) {\n return;\n }\n const targetUserIds = (conversation.participants ?? [])\n .map((participant) => participant.id?.trim())\n .filter((id): id is string => Boolean(id) && id !== fromUserId);\n try {\n await this.callSignal.signal({\n conversationId: conversation.id,\n action: 'invite',\n media: this.mediaType(),\n callId,\n targetUserIds,\n });\n } catch {\n // Built-in realtime is the primary ring path.\n }\n }\n\n async #acceptIncoming(): Promise<void> {\n if (this.accepting || this.closing) {\n return;\n }\n const conversationId = this.conversation()?.id?.trim();\n const currentUserId = this.currentUserId();\n if (!conversationId || !currentUserId) {\n return;\n }\n\n this.accepting = true;\n this.#clearRingTimeout();\n this.ringer.stop();\n this.phase.set('connecting');\n void this.#signalCallAction('accept');\n\n try {\n await this.#connectMedia(\n currentUserId,\n this.#selfDisplayName(currentUserId),\n conversationId,\n this.mediaType(),\n );\n this.phase.set('active');\n void this.rtc.ensureAudioPlayback();\n if (this.mediaType() === 'video') {\n void this.#setVideoEnabled(true);\n }\n } catch (error: unknown) {\n this.accepting = false;\n this.phase.set('incoming');\n this.ringer.playIncoming();\n const fallback = await this.translationService.translateAsync('@conversation:chat.call.connect-error');\n this.#toast(error instanceof Error && error.message ? error.message : fallback, 'danger');\n }\n }\n\n async #onPeerAccepted(): Promise<void> {\n if (this.closing) {\n return;\n }\n this.#clearRingTimeout();\n this.ringer.stop();\n this.phase.set(this.rtc.connectionState() === ConnectionState.Connected ? 'active' : 'connecting');\n void this.rtc.ensureAudioPlayback();\n }\n\n async #signalCallAction(action: 'accept' | 'decline' | 'cancel' | 'end'): Promise<void> {\n const conversation = this.conversation();\n const callId = this.callId();\n const fromUserId = this.currentUserId();\n if (!conversation?.id || !callId || !fromUserId) {\n return;\n }\n const targetUserIds = (conversation.participants ?? [])\n .map((participant) => participant.id?.trim())\n .filter((id): id is string => Boolean(id) && id !== fromUserId);\n try {\n await this.callSignal.signal({\n conversationId: conversation.id,\n action,\n media: this.mediaType(),\n callId,\n targetUserIds,\n });\n } catch {\n // Media join is the source of truth; signaling is best-effort.\n }\n }\n\n #selfDisplayName(currentUserId: string): string | undefined {\n return this.conversation()?.participants?.find((participant) => participant.id === currentUserId)?.name;\n }\n\n #armRingTimeout(): void {\n this.#clearRingTimeout();\n this.ringTimeoutId = setTimeout(() => {\n if (this.phase() === 'outgoing-waiting') {\n this.ringer.stop();\n void this.translationService\n .translateAsync('@conversation:chat.call.no-answer')\n .then((message) => this.#toast(message, 'default'));\n }\n }, 45_000);\n }\n\n #clearRingTimeout(): void {\n if (this.ringTimeoutId != null) {\n clearTimeout(this.ringTimeoutId);\n this.ringTimeoutId = null;\n }\n }\n\n async #finishWithLog(outcome: AXMChatCallLogOutcome): Promise<void> {\n if (this.closing) {\n return;\n }\n this.closing = true;\n this.ringer.stop();\n this.#clearRingTimeout();\n await this.#signalCallAction(outcome === 'declined' ? 'decline' : 'cancel');\n await this.#logOutcome(outcome);\n await this.#closeLocal();\n }\n\n async #endActiveCall(): Promise<void> {\n if (this.closing) {\n return;\n }\n this.closing = true;\n this.ringer.stop();\n this.#clearRingTimeout();\n await this.#signalCallAction('end');\n await this.#closeLocal();\n }\n\n async #logOutcome(outcome: AXMChatCallLogOutcome): Promise<void> {\n const conversationId = this.conversation()?.id?.trim();\n const callId = this.callId();\n if (!conversationId || !callId) {\n return;\n }\n try {\n await this.callSignal.log({\n conversationId,\n outcome,\n media: this.mediaType(),\n callId,\n });\n } catch {\n // Transcript write is best-effort; still close the session.\n }\n }\n\n async #closeFromRemoteLog(): Promise<void> {\n if (this.closing || this.phase() === 'active') {\n return;\n }\n this.closing = true;\n this.ringer.stop();\n this.#clearRingTimeout();\n await this.#closeLocal();\n }\n\n async #closeFromRemoteEnd(): Promise<void> {\n if (this.closing) {\n return;\n }\n this.closing = true;\n this.ringer.stop();\n this.#clearRingTimeout();\n await this.#closeLocal();\n }\n\n async #closeLocal(): Promise<void> {\n this.ringer.stop();\n this.signalInbox.releaseCall(this.callId());\n await this.rtc.disconnect();\n this.close();\n }\n\n //#endregion\n\n //#region ----- Media Helpers -----\n\n async #refreshDevices(kind?: AXMChatCallDeviceKind): Promise<void> {\n try {\n if (!kind || kind === 'audioinput') {\n this.audioDevices.set(await this.rtc.listInputDevices('audioinput'));\n }\n if (!kind || kind === 'videoinput') {\n this.videoDevices.set(await this.rtc.listInputDevices('videoinput'));\n }\n } catch {\n // Device lists stay empty until the browser grants media permission.\n }\n }\n\n async #setVideoEnabled(enabled: boolean): Promise<void> {\n this.videoEnabled.set(enabled);\n if (enabled) {\n this.mediaType.set('video');\n }\n try {\n await this.rtc.setCameraEnabled(enabled);\n } catch {\n this.videoEnabled.set(false);\n const message = await this.translationService.translateAsync('@conversation:chat.call.media-error');\n this.#toast(message, 'danger');\n }\n }\n\n #toast(content: string, color: 'success' | 'danger' | 'default'): void {\n this.toastService.show({\n color,\n content,\n location: 'bottom-center',\n timeOut: 3000,\n });\n }\n\n //#endregion\n}\n\n//#endregion\n","<div class=\"axm-chat-call-session\" [class.axm-chat-call-session--group]=\"isGroupLayout()\">\n <!-- ----- Loading conversation / connecting RTC ----- -->\n @if (loading()) {\n <div class=\"axm-chat-call-session__status-block\">\n {{ '@conversation:chat.call.loading' | translate | async }}\n </div>\n }\n <!-- ----- Load / connect error ----- -->\n @else if (error()) {\n <div class=\"axm-chat-call-session__status-block axm-chat-call-session__status-block--error\">\n <p>{{ errorMessage() || ('@conversation:chat.call.load-error' | translate | async) }}</p>\n <button type=\"button\" class=\"axm-chat-call-session__text-button\" (click)=\"onEndCall()\">\n {{ '@conversation:chat.call.cancel' | translate | async }}\n </button>\n </div>\n }\n <!-- ----- Call session ----- -->\n @else {\n <div class=\"axm-chat-call-session__shell\">\n <div\n class=\"axm-chat-call-session__main\"\n [class.axm-chat-call-session__main--idle]=\"idleLayout()\"\n >\n <div class=\"axm-chat-call-session__body\">\n <!-- ----- Profile header (hidden for active group grid) ----- -->\n @if (!(isGroupLayout() && phase() === 'active')) {\n <div\n class=\"axm-chat-call-session__header\"\n [class.axm-chat-call-session__header--compact]=\"showStage()\"\n >\n <axp-avatar\n [size]=\"headerAvatarSize()\"\n [fullName]=\"peerDisplayName()\"\n [src]=\"peerAvatarSrc()\"\n />\n <h1 class=\"axm-chat-call-session__name\">{{ peerDisplayName() }}</h1>\n <p class=\"axm-chat-call-session__phase-text\">{{ phaseTextKey() | translate | async }}</p>\n </div>\n }\n\n <!-- ----- Video / tile stage ----- -->\n @if (showStage()) {\n <div\n class=\"axm-chat-call-session__stage\"\n [class.axm-chat-call-session__stage--group]=\"isGroupLayout() && phase() === 'active'\"\n >\n @if (isGroupLayout() && phase() === 'active') {\n @for (remote of remoteVideos(); track remote.participantId + ':' + remote.track.sid) {\n <div class=\"axm-chat-call-session__tile axm-chat-call-session__tile--speaking\">\n <video\n class=\"axm-chat-call-session__video\"\n autoplay\n playsinline\n [axmChatCallTrack]=\"remote.track\"\n ></video>\n <span class=\"axm-chat-call-session__tile-name\">{{ remote.participantName }}</span>\n </div>\n }\n <div\n class=\"axm-chat-call-session__tile\"\n [class.axm-chat-call-session__tile--speaking]=\"!micMuted()\"\n >\n @if (videoEnabled() && localVideoTrack(); as localTrack) {\n <video\n class=\"axm-chat-call-session__video\"\n autoplay\n playsinline\n muted\n [axmChatCallTrack]=\"localTrack\"\n ></video>\n } @else if (selfParticipant(); as self) {\n <axp-avatar [size]=\"96\" [fullName]=\"self.name\" [src]=\"self.avatar ?? ''\" />\n }\n <span class=\"axm-chat-call-session__tile-name\">\n {{ selfParticipant()?.name || '' }}\n </span>\n </div>\n } @else {\n <div class=\"axm-chat-call-session__tile axm-chat-call-session__tile--primary\">\n @if (primaryRemoteVideo(); as remote) {\n <video\n class=\"axm-chat-call-session__video\"\n autoplay\n playsinline\n [axmChatCallTrack]=\"remote.track\"\n ></video>\n }\n <!-- ----- Local camera fills the stage until the peer joins ----- -->\n @else if (videoEnabled() && localVideoTrack(); as localTrack) {\n <video\n class=\"axm-chat-call-session__video\"\n autoplay\n playsinline\n muted\n [axmChatCallTrack]=\"localTrack\"\n ></video>\n }\n <!-- ----- Avatar placeholder when no camera track is published ----- -->\n @else {\n <axp-avatar [size]=\"160\" [fullName]=\"peerDisplayName()\" [src]=\"peerAvatarSrc()\" />\n }\n </div>\n\n @if (primaryRemoteVideo() && videoEnabled() && localVideoTrack(); as localTrack) {\n <div class=\"axm-chat-call-session__pip\">\n <video\n class=\"axm-chat-call-session__video\"\n autoplay\n playsinline\n muted\n [axmChatCallTrack]=\"localTrack\"\n ></video>\n </div>\n }\n }\n </div>\n }\n </div>\n\n <axm-chat-call-controls\n [phase]=\"phase()\"\n [videoEnabled]=\"videoEnabled()\"\n [micMuted]=\"micMuted()\"\n [showAddPeople]=\"phase() === 'active'\"\n [showScreencast]=\"phase() === 'active'\"\n [audioDevices]=\"audioDevices()\"\n [videoDevices]=\"videoDevices()\"\n [selectedAudioDeviceId]=\"selectedAudioDeviceId()\"\n [selectedVideoDeviceId]=\"selectedVideoDeviceId()\"\n (screencast)=\"onScreencast()\"\n (toggleVideo)=\"onToggleVideo()\"\n (toggleMute)=\"onToggleMute()\"\n (endCall)=\"onEndCall()\"\n (accept)=\"onAccept()\"\n (decline)=\"onDecline()\"\n (addPeople)=\"onAddPeople()\"\n (requestDevices)=\"onRequestDevices($event)\"\n (pickDevice)=\"onPickDevice($event)\"\n />\n </div>\n\n @if (isGroupLayout() && phase() === 'active') {\n <axm-chat-call-sidebar\n [participants]=\"sidebarParticipants()\"\n (addPeople)=\"onAddPeople()\"\n (shareLink)=\"onShareLink()\"\n />\n }\n </div>\n }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;AAmBA;AAEA;MA6Ja,4BAA4B,CAAA;AA3JzC,IAAA,WAAA,GAAA;;QA8JW,IAAA,CAAA,KAAK,GAAG,KAAK,CAAmB,kBAAkB;kFAAC;QACnD,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,KAAK;yFAAC;QAC3B,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK;qFAAC;QACvB,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,KAAK;0FAAC;QAC5B,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC,IAAI;2FAAC;QAC5B,IAAA,CAAA,YAAY,GAAG,KAAK,CAAoB,EAAE;yFAAC;QAC3C,IAAA,CAAA,YAAY,GAAG,KAAK,CAAoB,EAAE;yFAAC;QAC3C,IAAA,CAAA,qBAAqB,GAAG,KAA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;;"}
|
package/fesm2022/acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-open-chat.command-B03q60Qx.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/commands/open-chat.command.ts"],"sourcesContent":["import { AXConversationService } from '@acorex/components/conversation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\n\n//#region ----- Types -----\n\nexport interface AXMOpenChatOptions {\n conversationId?: string;\n}\n\n//#endregion\n\n//#region ----- Command -----\n\n/** Opens an existing conversation in the chat app. */\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationOpenChatCommand implements AXPCommand<AXMOpenChatOptions, { conversationId: string }> {\n //#region ----- Services & Dependencies -----\n\n private readonly conversationService = inject(AXConversationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly router = inject(Router);\n\n //#endregion\n\n async execute(input: AXMOpenChatOptions | unknown): AXPCommandExecuteResultPromise<{ conversationId: string }> {\n const conversationId =\n typeof (input as AXMOpenChatOptions)?.conversationId === 'string'\n ? (input as AXMOpenChatOptions).conversationId!.trim()\n : '';\n\n if (!conversationId) {\n return { success: false, message: { text: '@conversation:chat.route.conversation-not-found' } };\n }\n\n await this.conversationService.selectConversation(conversationId);\n await this.router.navigate([this.applicationRouteSegment(), 'chat', conversationId]);\n return { success: true, kind: 'object', data: { conversationId } };\n }\n\n //#region ----- Private -----\n\n private applicationRouteSegment(): string {\n return this.sessionService.application?.name?.trim() || 'platform';\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAYA;AAEA;AAEA;MAEa,8BAA8B,CAAA;AAD3C,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,qBA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,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable } from '@angular/core';
|
|
3
|
-
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
|
-
import { RootConfig } from '@acorex-platform/module-communication-management-client/contracts';
|
|
5
|
-
import { AXPCommunicationManagementClient } from '@acorex-platform/module-communication-management-client';
|
|
6
|
-
import { A as AXMConversationEntityStoreService, d as AXMConversationFocusService } from './acorex-platform-module-conversation-client-acorex-platform-module-conversation-client-C6fmww4a.mjs';
|
|
7
|
-
|
|
8
|
-
//#region ---- Conversation in-app notification sync ----
|
|
9
|
-
const IN_APP_CHANNEL = 'in-app';
|
|
10
|
-
const SYNC_MIN_INTERVAL_MS = 2500;
|
|
11
|
-
class AXMConversationInAppNotificationSyncService {
|
|
12
|
-
constructor() {
|
|
13
|
-
this.client = inject(AXPCommunicationManagementClient, { optional: true });
|
|
14
|
-
this.entityService = inject(AXPEntityService);
|
|
15
|
-
this.deliveryData = this.entityService
|
|
16
|
-
.withEntity(RootConfig.module.name, RootConfig.entities.communicationDelivery.name)
|
|
17
|
-
.data();
|
|
18
|
-
this.communicationData = this.entityService
|
|
19
|
-
.withEntity(RootConfig.module.name, RootConfig.entities.communication.name)
|
|
20
|
-
.data();
|
|
21
|
-
this.lastSyncAt = new Map();
|
|
22
|
-
this.syncChains = new Map();
|
|
23
|
-
}
|
|
24
|
-
async markConversationInAppRead(conversationId, recipientUserId) {
|
|
25
|
-
if (!this.client || !conversationId.trim() || !recipientUserId.trim()) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
const key = `${conversationId.trim()}:${recipientUserId.trim()}`;
|
|
29
|
-
const now = Date.now();
|
|
30
|
-
const last = this.lastSyncAt.get(key) ?? 0;
|
|
31
|
-
if (now - last < SYNC_MIN_INTERVAL_MS) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const previous = this.syncChains.get(key) ?? Promise.resolve();
|
|
35
|
-
const next = previous.then(() => this.markConversationInAppReadInternal(conversationId, recipientUserId));
|
|
36
|
-
this.syncChains.set(key, next.finally(() => {
|
|
37
|
-
if (this.syncChains.get(key) === next) {
|
|
38
|
-
this.syncChains.delete(key);
|
|
39
|
-
}
|
|
40
|
-
}));
|
|
41
|
-
await next;
|
|
42
|
-
this.lastSyncAt.set(key, Date.now());
|
|
43
|
-
}
|
|
44
|
-
async markConversationInAppReadInternal(conversationId, recipientUserId) {
|
|
45
|
-
const prefix = `conversation:${conversationId.trim()}:`;
|
|
46
|
-
const communications = await this.communicationData.query({
|
|
47
|
-
skip: 0,
|
|
48
|
-
take: 100,
|
|
49
|
-
filter: {
|
|
50
|
-
field: 'correlationId',
|
|
51
|
-
operator: { type: 'contains' },
|
|
52
|
-
value: prefix,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
const communicationIds = communications.items
|
|
56
|
-
.filter((row) => String(row.correlationId ?? '').startsWith(prefix))
|
|
57
|
-
.map((row) => row.id)
|
|
58
|
-
.filter(Boolean);
|
|
59
|
-
if (communicationIds.length === 0) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const deliveries = await this.deliveryData.query({
|
|
63
|
-
skip: 0,
|
|
64
|
-
take: Math.max(communicationIds.length, 1),
|
|
65
|
-
filter: {
|
|
66
|
-
logic: 'and',
|
|
67
|
-
filters: [
|
|
68
|
-
{ field: 'channel', operator: { type: 'equal' }, value: IN_APP_CHANNEL },
|
|
69
|
-
{ field: 'recipientUserId', operator: { type: 'equal' }, value: recipientUserId },
|
|
70
|
-
{ field: 'readAt', operator: { type: 'isNull' }, value: null },
|
|
71
|
-
{
|
|
72
|
-
logic: 'or',
|
|
73
|
-
filters: communicationIds.map((id) => ({
|
|
74
|
-
field: 'communicationId',
|
|
75
|
-
operator: { type: 'equal' },
|
|
76
|
-
value: id,
|
|
77
|
-
})),
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
const deliveryIds = deliveries.items
|
|
83
|
-
.map((row) => row.id)
|
|
84
|
-
.filter(Boolean);
|
|
85
|
-
if (deliveryIds.length === 0) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
await this.client.markInAppRead({ deliveryIds });
|
|
89
|
-
}
|
|
90
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationInAppNotificationSyncService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
91
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationInAppNotificationSyncService, providedIn: 'root' }); }
|
|
92
|
-
}
|
|
93
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationInAppNotificationSyncService, decorators: [{
|
|
94
|
-
type: Injectable,
|
|
95
|
-
args: [{ providedIn: 'root' }]
|
|
96
|
-
}] });
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region ---- Command ----
|
|
100
|
-
class AXMConversationSyncReadStateCommand {
|
|
101
|
-
constructor() {
|
|
102
|
-
this.store = inject(AXMConversationEntityStoreService);
|
|
103
|
-
this.focus = inject(AXMConversationFocusService);
|
|
104
|
-
this.inAppSync = inject(AXMConversationInAppNotificationSyncService);
|
|
105
|
-
}
|
|
106
|
-
async execute(input) {
|
|
107
|
-
const options = input;
|
|
108
|
-
const conversationId = options.conversationId?.trim();
|
|
109
|
-
if (!conversationId) {
|
|
110
|
-
return { success: true, kind: 'object', data: undefined };
|
|
111
|
-
}
|
|
112
|
-
this.focus.setFocusedConversation(conversationId);
|
|
113
|
-
if (!options.messageIds?.length) {
|
|
114
|
-
const cachedConversation = this.store.getCachedConversation(conversationId);
|
|
115
|
-
const cachedMessages = this.store.getCachedMessageList(conversationId);
|
|
116
|
-
const skipInAppSync = cachedMessages !== null &&
|
|
117
|
-
cachedMessages.length === 0 &&
|
|
118
|
-
(cachedConversation?.unreadCount ?? 0) === 0;
|
|
119
|
-
if (cachedConversation?.unreadCount === 0) {
|
|
120
|
-
return { success: true, kind: 'object', data: undefined };
|
|
121
|
-
}
|
|
122
|
-
await this.store.setUnreadCount(conversationId, 0);
|
|
123
|
-
if (!skipInAppSync) {
|
|
124
|
-
await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);
|
|
125
|
-
}
|
|
126
|
-
return { success: true, kind: 'object', data: undefined };
|
|
127
|
-
}
|
|
128
|
-
const marked = await this.focus.markMessagesRead(conversationId, options.messageIds, options.currentUserId);
|
|
129
|
-
await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);
|
|
130
|
-
void marked;
|
|
131
|
-
return { success: true, kind: 'object', data: undefined };
|
|
132
|
-
}
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationSyncReadStateCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
134
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationSyncReadStateCommand, providedIn: 'root' }); }
|
|
135
|
-
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMConversationSyncReadStateCommand, decorators: [{
|
|
137
|
-
type: Injectable,
|
|
138
|
-
args: [{ providedIn: 'root' }]
|
|
139
|
-
}] });
|
|
140
|
-
|
|
141
|
-
export { AXMConversationSyncReadStateCommand };
|
|
142
|
-
//# sourceMappingURL=acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs.map
|
package/fesm2022/acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-conversation-client-sync-read-state.command-B6v_j64v.mjs","sources":["../../../../libs/modules/conversation/client/src/lib/features/chat/services/conversation-in-app-notification-sync.service.ts","../../../../libs/modules/conversation/client/src/lib/features/commands/sync-read-state.command.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n RootConfig,\n type AXMCommunicationDeliveryModel,\n type AXMCommunicationModel,\n} from '@acorex-platform/module-communication-management-client/contracts';\nimport { AXPCommunicationManagementClient } from '@acorex-platform/module-communication-management-client';\n\n//#region ---- Conversation in-app notification sync ----\n\nconst IN_APP_CHANNEL = 'in-app';\nconst SYNC_MIN_INTERVAL_MS = 2500;\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationInAppNotificationSyncService {\n private readonly client = inject(AXPCommunicationManagementClient, { optional: true });\n private readonly entityService = inject(AXPEntityService);\n private readonly deliveryData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communicationDelivery.name)\n .data<string, AXMCommunicationDeliveryModel, AXMCommunicationDeliveryModel>();\n private readonly communicationData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.communication.name)\n .data<string, AXMCommunicationModel, AXMCommunicationModel>();\n\n private readonly lastSyncAt = new Map<string, number>();\n private readonly syncChains = new Map<string, Promise<void>>();\n\n async markConversationInAppRead(conversationId: string, recipientUserId: string): Promise<void> {\n if (!this.client || !conversationId.trim() || !recipientUserId.trim()) {\n return;\n }\n\n const key = `${conversationId.trim()}:${recipientUserId.trim()}`;\n const now = Date.now();\n const last = this.lastSyncAt.get(key) ?? 0;\n if (now - last < SYNC_MIN_INTERVAL_MS) {\n return;\n }\n\n const previous = this.syncChains.get(key) ?? Promise.resolve();\n const next = previous.then(() => this.markConversationInAppReadInternal(conversationId, recipientUserId));\n this.syncChains.set(\n key,\n next.finally(() => {\n if (this.syncChains.get(key) === next) {\n this.syncChains.delete(key);\n }\n }),\n );\n await next;\n this.lastSyncAt.set(key, Date.now());\n }\n\n private async markConversationInAppReadInternal(\n conversationId: string,\n recipientUserId: string,\n ): Promise<void> {\n const prefix = `conversation:${conversationId.trim()}:`;\n\n const communications = await this.communicationData.query({\n skip: 0,\n take: 100,\n filter: {\n field: 'correlationId',\n operator: { type: 'contains' },\n value: prefix,\n },\n });\n\n const communicationIds = (communications.items as AXMCommunicationModel[])\n .filter((row) => String(row.correlationId ?? '').startsWith(prefix))\n .map((row) => row.id)\n .filter(Boolean);\n\n if (communicationIds.length === 0) {\n return;\n }\n\n const deliveries = await this.deliveryData.query({\n skip: 0,\n take: Math.max(communicationIds.length, 1),\n filter: {\n logic: 'and',\n filters: [\n { field: 'channel', operator: { type: 'equal' }, value: IN_APP_CHANNEL },\n { field: 'recipientUserId', operator: { type: 'equal' }, value: recipientUserId },\n { field: 'readAt', operator: { type: 'isNull' }, value: null },\n {\n logic: 'or',\n filters: communicationIds.map((id) => ({\n field: 'communicationId',\n operator: { type: 'equal' as const },\n value: id,\n })),\n },\n ],\n },\n });\n\n const deliveryIds = (deliveries.items as AXMCommunicationDeliveryModel[])\n .map((row) => row.id)\n .filter(Boolean);\n\n if (deliveryIds.length === 0) {\n return;\n }\n\n await this.client!.markInAppRead({ deliveryIds });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport { inject, Injectable } from '@angular/core';\n\nimport { axmIsAssistStreamingMessage } from '../chat/plugins/utils/conversation-unread.util';\nimport { AXMConversationInAppNotificationSyncService } from '../chat/services/conversation-in-app-notification-sync.service';\nimport { AXMConversationEntityStoreService } from '../chat/services/conversation-entity-store.service';\nimport { AXMConversationFocusService } from '../chat/services/conversation-focus.service';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMSyncReadStateOptions {\n conversationId: string;\n messageIds?: string[];\n currentUserId: string;\n}\n\n//#endregion\n\n//#region ---- Command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMConversationSyncReadStateCommand implements AXPCommand<AXMSyncReadStateOptions, void> {\n private readonly store = inject(AXMConversationEntityStoreService);\n private readonly focus = inject(AXMConversationFocusService);\n private readonly inAppSync = inject(AXMConversationInAppNotificationSyncService);\n\n async execute(input: AXMSyncReadStateOptions | unknown): AXPCommandExecuteResultPromise<void> {\n const options = input as AXMSyncReadStateOptions;\n const conversationId = options.conversationId?.trim();\n if (!conversationId) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n this.focus.setFocusedConversation(conversationId);\n\n if (!options.messageIds?.length) {\n const cachedConversation = this.store.getCachedConversation(conversationId);\n const cachedMessages = this.store.getCachedMessageList(conversationId);\n const skipInAppSync =\n cachedMessages !== null &&\n cachedMessages.length === 0 &&\n (cachedConversation?.unreadCount ?? 0) === 0;\n\n if (cachedConversation?.unreadCount === 0) {\n return { success: true, kind: 'object', data: undefined };\n }\n\n await this.store.setUnreadCount(conversationId, 0);\n if (!skipInAppSync) {\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n }\n return { success: true, kind: 'object', data: undefined };\n }\n\n const marked = await this.focus.markMessagesRead(conversationId, options.messageIds, options.currentUserId);\n await this.inAppSync.markConversationInAppRead(conversationId, options.currentUserId);\n void marked;\n return { success: true, kind: 'object', data: undefined };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AASA;AAEA,MAAM,cAAc,GAAG,QAAQ;AAC/B,MAAM,oBAAoB,GAAG,IAAI;MAGpB,2CAA2C,CAAA;AADxD,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,gCAAgC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACrE,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC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