@posiwise/messaging-module 0.0.29 → 0.0.30

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.
@@ -1,546 +0,0 @@
1
- import { ScrollingModule } from '@angular/cdk/scrolling';
2
- import * as i2 from '@angular/common';
3
- import { CommonModule } from '@angular/common';
4
- import * as i0 from '@angular/core';
5
- import { Component, ViewChild, NgModule } from '@angular/core';
6
- import * as i1$1 from '@angular/router';
7
- import { RouterModule } from '@angular/router';
8
- import * as i7 from '@ctrl/ngx-emoji-mart';
9
- import { PickerModule } from '@ctrl/ngx-emoji-mart';
10
- import { EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
11
- import { NgxFileDropModule } from 'ngx-file-drop';
12
- import * as i8 from 'ngx-infinite-scroll';
13
- import { InfiniteScrollModule } from 'ngx-infinite-scroll';
14
- import * as i4 from 'primeng/progressspinner';
15
- import { ProgressSpinnerModule } from 'primeng/progressspinner';
16
- import * as i5 from 'primeng/autocomplete';
17
- import { AutoCompleteModule } from 'primeng/autocomplete';
18
- import * as i3 from '@angular/forms';
19
- import { FormsModule } from '@angular/forms';
20
- import groupBy from 'lodash/groupBy';
21
- import sortBy from 'lodash/sortBy';
22
- import uniqBy from 'lodash/uniqBy';
23
- import { lastValueFrom } from 'rxjs';
24
- import { ATTACHMENT_TYPE, ChatUser, Conversation, SOCKET_TYPE } from '@posiwise/common-utilities';
25
- import { AppBaseComponent } from '@posiwise/app-base-component';
26
- import { HelperService } from '@posiwise/helper-service';
27
- import * as i1 from '@posiwise/common-services';
28
- import { PermissionService } from '@posiwise/common-services';
29
- import moment from 'moment';
30
- import * as i6 from 'primeng/api';
31
- import * as i9 from '@posiwise/pipes';
32
- import { PipesModule } from '@posiwise/pipes';
33
-
34
- class ChatBoxComponent extends AppBaseComponent {
35
- constructor(elRef, mailboxService, profileService, socketService, injector) {
36
- super(injector);
37
- this.elRef = elRef;
38
- this.mailboxService = mailboxService;
39
- this.profileService = profileService;
40
- this.socketService = socketService;
41
- this.ObjectKeys = Object.keys;
42
- this.showEmoji = false;
43
- // Conversation list
44
- this.pristineConversation = [];
45
- this.conversations = [];
46
- // Boolean to unsubscribe on Destroy
47
- // List of messages per conversation Id
48
- this.messagesGroupedByDate = {};
49
- this.isDrift = true;
50
- this.recipients = [];
51
- this.files = [];
52
- this.units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
53
- this.attachedFiles = [];
54
- this.initialLoad = true;
55
- this.selectedIndex = 0;
56
- this.isChatLoading = true;
57
- this.totalMessages = 0;
58
- this.currentPage = 1;
59
- this.isLoaded = true;
60
- this.throttle = 300;
61
- this.scrollUpDistance = 2;
62
- this.currentThreads = [];
63
- this.scrollDistance = 1;
64
- this.ATTACHMENT_TYPE = ATTACHMENT_TYPE;
65
- }
66
- onUp(_ev, conversationId) {
67
- this.currentPage++;
68
- const totalPages = Math.ceil(this.totalMessages / 10);
69
- // Prevent API call if all messages have been fetched
70
- if (this.currentPage <= totalPages) {
71
- this.loadMore(conversationId, this.currentPage);
72
- }
73
- }
74
- ngOnInit() {
75
- $.getScript('/assets/js/chat.js');
76
- this.listenToNewMessage();
77
- this.userStore().subscribe(resp => {
78
- this.currentUser = resp;
79
- if (this.currentUser) {
80
- this.mailboxService
81
- .getConversations()
82
- .subscribe((response) => {
83
- if (response === null || response === void 0 ? void 0 : response.length) {
84
- let raw;
85
- if (this.conversations.length > 0) {
86
- raw = this.conversations.find(x => x.id === null);
87
- }
88
- response.forEach(x => {
89
- x.datetime = x.latest_message.created_at;
90
- });
91
- const chats = sortBy(response, 'datetime').reverse();
92
- this.pristineConversation = chats;
93
- this.conversations = [...chats];
94
- if (raw) {
95
- this.conversations.unshift(raw);
96
- }
97
- this.parseConversation();
98
- }
99
- if (this.initialLoad) {
100
- this.checkIfNewConversation();
101
- }
102
- else {
103
- this.activateThread();
104
- }
105
- })
106
- .add(() => {
107
- this.isChatLoading = false;
108
- this.initialLoad = false;
109
- });
110
- }
111
- });
112
- }
113
- ngDoCheck() {
114
- // Hiding Drift messenger for Chat-box
115
- if (this.isDrift &&
116
- $('#drift-widget-container').length > 0 &&
117
- $('#drift-widget-container:visible')) {
118
- this.isDrift = false;
119
- $('#drift-widget-container').hide();
120
- }
121
- }
122
- ngOnDestroy() {
123
- $('.drift-widget-container').show();
124
- }
125
- parseConversation() {
126
- this.conversations.forEach((element, index) => {
127
- element.to = element.participants.find(x => x.id !== this.currentUser.id);
128
- element.from = element.participants.find(x => x.id === this.currentUser.id);
129
- if (index === 0) {
130
- this.currentUserImg = element.from.avatar
131
- ? element.from.avatar
132
- : '/assets/img/icons/male.png';
133
- }
134
- });
135
- }
136
- activateThread() {
137
- setTimeout(() => {
138
- const selector = `.list-group-item:nth-child(${this.selectedIndex + 1})`;
139
- $(selector)
140
- .removeClass('no-border')
141
- .addClass('list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2');
142
- });
143
- }
144
- checkIfNewConversation() {
145
- this.route.fragment.subscribe((fragment) => {
146
- if (fragment) {
147
- // Check for existing conversation
148
- const existingConversation = this.conversations.find(x => x.to.slug === fragment);
149
- if (existingConversation) {
150
- this.otherUser = existingConversation.to;
151
- // sets the active tab when navigate to chat page
152
- this.setActive(existingConversation);
153
- }
154
- else {
155
- this.newParticipant(fragment);
156
- }
157
- }
158
- else if (this.conversations.length > 0) {
159
- this.router.navigate(['/message'], { fragment: this.conversations[0].to.slug });
160
- }
161
- });
162
- }
163
- onParticipantClick(conversation) {
164
- var _a;
165
- this.otherUser = conversation.participants.find(x => x.id !== this.currentUser.id);
166
- const slug = (_a = this.otherUser) === null || _a === void 0 ? void 0 : _a.slug;
167
- this.clearUnreadCount();
168
- this.router.navigate(['/message'], { fragment: slug });
169
- }
170
- newParticipant(slug) {
171
- this.profileService.getUserProfile(slug).subscribe(response => {
172
- this.otherUser = response;
173
- const to = new ChatUser(response.id, response.first_name, response.slug, response.email, response.avatar ? response.avatar[0].url : '', new Date());
174
- const from = new ChatUser(this.currentUser.id, this.currentUser.first_name, this.currentUser.slug, this.currentUser.email, this.currentUser.avatar
175
- ? this.currentUser.avatar[0].url
176
- : '/assets/img/icons/male.png', new Date());
177
- const newConversation = new Conversation(null, 1, null, 'chat', [to, from], null, 0, from, to);
178
- this.conversations.unshift(newConversation);
179
- this.setActive(this.conversations[0]);
180
- });
181
- }
182
- // chat user list click event function
183
- setActive(conversation) {
184
- this.currentPage = 0;
185
- this.currentThreads = [];
186
- this.totalMessages = 0;
187
- this.otherUser = conversation.participants.find(x => x.id !== this.currentUser.id);
188
- this.selectedConversationId = conversation.id;
189
- this.currentConversation = conversation;
190
- const hElement = this.elRef.nativeElement;
191
- // now you can simply get your elements with their class name
192
- const allAnchors = hElement.getElementsByClassName('list-group-item');
193
- // do something with selected elements
194
- [].forEach.call(allAnchors, (item) => {
195
- item.setAttribute('class', 'list-group-item no-border');
196
- });
197
- const index = this.conversations.findIndex(x => { var _a, _b; return ((_a = x === null || x === void 0 ? void 0 : x.to) === null || _a === void 0 ? void 0 : _a.id) === ((_b = this.otherUser) === null || _b === void 0 ? void 0 : _b.id); }) || 0;
198
- setTimeout(() => {
199
- $(`.list-group-item:nth-child(${index + 1})`)
200
- .removeClass('no-border')
201
- .addClass('list-group-item bg-blue-grey bg-lighten-5 border-right-primary border-right-2');
202
- this.selectedIndex = $('.list-group-item.border-right-2').index();
203
- }, 500);
204
- this.markAsRead(conversation.id);
205
- this.getMessage(conversation.id);
206
- }
207
- search(searchTxt) {
208
- var _a;
209
- if (((_a = searchTxt === null || searchTxt === void 0 ? void 0 : searchTxt.value) === null || _a === void 0 ? void 0 : _a.length) > 2) {
210
- this.conversations = this.pristineConversation.filter(x => x.to.slug.includes(searchTxt.value) || x.to.email.includes(searchTxt.value));
211
- }
212
- else {
213
- this.conversations = this.pristineConversation;
214
- }
215
- }
216
- // Socket For Listening to new Message
217
- listenToNewMessage() {
218
- this.socketService.webSocket$.subscribe((result) => {
219
- if (result.event === SOCKET_TYPE.MSG) {
220
- if ((result === null || result === void 0 ? void 0 : result.new_conversation) === 'false') {
221
- const newMessage = result === null || result === void 0 ? void 0 : result.data;
222
- newMessage.formattedDate = moment(new Date(newMessage.created_at)).format('YYYYMMDD');
223
- // Append the new message to conversation
224
- const conversation = this.conversations.find(x => x.id === result.id);
225
- if (conversation) {
226
- conversation.latest_message = result.data;
227
- conversation.created_at = newMessage.created_at;
228
- conversation.unread_count += 1;
229
- }
230
- if (newMessage.conversation_id === this.selectedConversationId &&
231
- newMessage.formattedDate in this.messagesGroupedByDate) {
232
- this.messagesGroupedByDate[newMessage.formattedDate].push(newMessage);
233
- this.animateOnScroll();
234
- }
235
- }
236
- else if (result && typeof result.new_conversation === 'object') {
237
- this.conversations.unshift(result.new_conversation);
238
- this.parseConversation();
239
- }
240
- }
241
- });
242
- }
243
- getMessage(messageId, reload = true) {
244
- if (reload) {
245
- this.messagesGroupedByDate = null;
246
- }
247
- if (messageId) {
248
- this.isLoaded = false;
249
- this.mailboxService
250
- .getMessages(messageId)
251
- .subscribe(response => {
252
- if (response) {
253
- this.totalMessages = response.object_count;
254
- this.currentThreads = response.messages;
255
- const ifExist = this.conversations.find(x => x.id === response.id);
256
- if (!ifExist) {
257
- this.conversations.find(x => x.id === null).id = response.id;
258
- }
259
- const messages = sortBy(response.messages, 'created_at');
260
- messages.forEach(msg => {
261
- msg.messageType = msg.attachment.url
262
- ? this.getMessageType(msg.attachment.url)
263
- : null;
264
- });
265
- this.messagesGroupedByDate = groupBy(messages, (o) => {
266
- return moment(o.created_at).format('YYYYMMDD');
267
- });
268
- // Append the latest message to conversation list
269
- const current = this.conversations.find(x => x.id === response.id).latest_message;
270
- if (current) {
271
- current.body = response.messages[0].body;
272
- current.created_at = response.messages[0].created_at;
273
- }
274
- }
275
- })
276
- .add(() => {
277
- this.isChatLoading = false;
278
- this.isLoaded = true;
279
- this.animateOnScroll();
280
- });
281
- }
282
- }
283
- loadMore(conversationId, pageNumber, pageSize = 10) {
284
- this.mailboxService
285
- .getMessages(conversationId, pageNumber, pageSize)
286
- .subscribe(response => {
287
- if (response) {
288
- this.currentThreads = uniqBy(this.currentThreads.concat(response.messages), 'id');
289
- const messages = sortBy(this.currentThreads, 'created_at');
290
- this.messagesGroupedByDate = groupBy(messages, (o) => {
291
- return moment(o.created_at).format('YYYYMMDD');
292
- });
293
- }
294
- });
295
- }
296
- clearUnreadCount() {
297
- this.mailboxService.decrementUnreadCount(this.currentConversation.unread_count);
298
- this.currentConversation['unread_count'] = 0;
299
- }
300
- onSendMessage() {
301
- var _a;
302
- const text = this.messageInputRef.nativeElement.value;
303
- const formData = new FormData();
304
- formData.append('to', this.otherUser.email);
305
- formData.append('message', text);
306
- formData.append('type', '1');
307
- if ((_a = this.files) === null || _a === void 0 ? void 0 : _a.length) {
308
- this.isFileUploading = true;
309
- formData.append('file', this.files[0], this.files[0].name);
310
- }
311
- if (text || this.files.length > 0) {
312
- this.mailboxService
313
- .postMessage(formData)
314
- .subscribe(response => {
315
- this.files = [];
316
- this.attachedFiles = [];
317
- this.messageInputRef.nativeElement.value = '';
318
- this.messageInputRef.nativeElement.focus();
319
- this.getMessage(response.conversation_id, false);
320
- })
321
- .add(() => {
322
- this.isFileUploading = false;
323
- });
324
- }
325
- }
326
- markAsRead(conversationId) {
327
- if (conversationId) {
328
- this.clearUnreadCount();
329
- this.mailboxService.markAsRead(conversationId).subscribe(() => {
330
- this.conversations.find(x => x.id === conversationId).unread_count = 0;
331
- });
332
- }
333
- }
334
- transform(bytes = 0, precision = 2) {
335
- // eslint-disable-next-line no-restricted-globals
336
- if (Number.isNaN(Number.parseFloat(String(bytes))) || !Number.isFinite(bytes)) {
337
- return '?';
338
- }
339
- let unit = 0;
340
- while (bytes >= 1024) {
341
- bytes /= 1024;
342
- unit++;
343
- }
344
- return `${bytes.toFixed(+precision)} ${this.units[unit]}`;
345
- }
346
- dropped(files) {
347
- // eslint-disable-next-line no-restricted-syntax
348
- for (const droppedFile of files) {
349
- // Is it a file?
350
- if (droppedFile.fileEntry.isFile) {
351
- const fileEntry = droppedFile.fileEntry;
352
- fileEntry.file((file) => {
353
- this.files.push(file);
354
- this.attachedFiles.push({
355
- name: file.name,
356
- size: this.transform(Number(file.size))
357
- });
358
- });
359
- }
360
- }
361
- }
362
- onRemoveAttachment(item) {
363
- this.files = this.files.filter(x => x.name !== item.name);
364
- this.attachedFiles = this.attachedFiles.filter(x => x.name !== item.name);
365
- }
366
- fileOver(_event) {
367
- console.log();
368
- }
369
- onEmojiSelect($event) {
370
- this.messageInputRef.nativeElement.value += $event.emoji.native;
371
- this.showEmoji = false;
372
- }
373
- fileChangeListener($event) {
374
- const file = $event.target.files[0];
375
- this.files.push(file);
376
- this.attachedFiles.push({
377
- name: file.name,
378
- size: this.transform(Number(file.size / 1024))
379
- });
380
- }
381
- toggleSidebar() {
382
- $('.chat-sidebar').removeClass('d-none d-sm-none').addClass('d-block d-sm-block');
383
- $('.content-overlay').addClass('show');
384
- }
385
- trackByMessageId(_index, item) {
386
- return item.id;
387
- }
388
- animateOnScroll() {
389
- setTimeout(() => {
390
- var _a;
391
- if ((_a = $('#chats-wrapper')) === null || _a === void 0 ? void 0 : _a.length) {
392
- $('#chats-wrapper')
393
- .stop()
394
- .animate({
395
- scrollTop: $('#chats-wrapper')[0].scrollHeight
396
- }, 800);
397
- }
398
- });
399
- }
400
- getMessageType(filename) {
401
- const ext = this.getExtension(filename);
402
- switch (ext.toLowerCase()) {
403
- case 'jpg':
404
- case 'gif':
405
- case 'bmp':
406
- case 'png':
407
- return ATTACHMENT_TYPE.IMG;
408
- case 'm4v':
409
- case 'avi':
410
- case 'mpg':
411
- case 'mp4':
412
- return ATTACHMENT_TYPE.VIDEO;
413
- default:
414
- return '';
415
- }
416
- }
417
- getExtension(filename) {
418
- const parts = filename.split('.');
419
- return parts[parts.length - 1];
420
- }
421
- recipientSearch() {
422
- lastValueFrom(this.mailboxService.getRecipient({
423
- page: 1,
424
- page_size: 20,
425
- subscription_id: PermissionService.selectedSubscription.id,
426
- search: this.searchText
427
- })).then(response => {
428
- this.recipients = response.filter(x => { var _a; return x.id !== ((_a = this.currentUser) === null || _a === void 0 ? void 0 : _a.id); });
429
- });
430
- }
431
- onMemberSelection(member) {
432
- this.otherUser = member;
433
- this.router.navigate(['/message'], { fragment: member.slug });
434
- }
435
- onDeleteMessage(message) {
436
- HelperService.raiseDeletePopup().then(rep => {
437
- if (rep.value) {
438
- this.mailboxService
439
- .deleteMessage(this.selectedConversationId, message === null || message === void 0 ? void 0 : message.id)
440
- .subscribe(response => {
441
- if ((response === null || response === void 0 ? void 0 : response.status_code) === 200) {
442
- const createdAt = moment(message.created_at).format('YYYYMMDD');
443
- // eslint-disable-next-line no-restricted-syntax
444
- for (const property in this.messagesGroupedByDate) {
445
- if (property === createdAt) {
446
- this.messagesGroupedByDate[property] =
447
- this.messagesGroupedByDate[property].filter(x => x.id !== (message === null || message === void 0 ? void 0 : message.id));
448
- }
449
- }
450
- }
451
- });
452
- }
453
- });
454
- }
455
- }
456
- ChatBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: ChatBoxComponent, deps: [{ token: i0.ElementRef }, { token: i1.MailBoxService }, { token: i1.ProfileService }, { token: i1.WebsocketService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
457
- ChatBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: ChatBoxComponent, selector: "ng-component", viewQueries: [{ propertyName: "messageInputRef", first: true, predicate: ["messageInput"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n <div *ngIf=\"isChatLoading\"\n class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading\">\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Type here to search member\"\n [ngModelOptions]=\"{ standalone: true }\"\n field=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n <div class=\"users-list-padding\"\n *ngIf=\"conversations?.length\">\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\"\n *ngFor=\"let conversation of conversations\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n <ng-template [ngIf]=\"conversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"conversation.to.avatar\"\n width=\"40\"\n height=\"40\"\n onerror=\"this.onerror=null;this.src='assets/img/icons/male.png';\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation.participants\n ? conversation.to.slug.charAt(0).toUpperCase()\n : conversation.to.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to.name\n : conversation.to.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\"\n *ngIf=\"conversation.unread_count\">\n {{ conversation.unread_count }}\n </span>\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading && conversations?.length\"\n [ngIfElse]=\"nomessage\">\n <!-- Chat Header -->\n <div class=\"chat-name p-2 bg-white\"\n *ngIf=\"otherUser\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n <ng-template [ngIf]=\"currentConversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n onerror=\"this.onerror=null;this.src='assets/img/icons/male.png';\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div *ngIf=\"currentUser\"\n class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n\n <ng-template [ngIf]=\"currentUser\">\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n </ng-template>\n </div>\n </div>\n </div>\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <!-- [scrollTop]=\"scrollMe.scrollHeight\" -->\n <!-- <ngx-file-drop (onFileDrop)=\"dropped($event)\" (onFileOver)=\"fileOver($event)\"> -->\n <div class=\"chats\">\n <!-- Shows Message -->\n <div *ngIf=\"!isLoaded\"\n class=\"spinner\"></div>\n <ng-container *ngIf=\"messagesGroupedByDate\">\n <ng-container *ngFor=\"let item of ObjectKeys(messagesGroupedByDate)\">\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\"\n *ngFor=\"\n let message of messagesGroupedByDate[item];\n trackBy: trackByMessageId;\n let i = index\n \">\n <ng-container *ngIf=\"message.body || message.attachment.url\">\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n <ng-container *ngIf=\"message.sender_id === currentUser.id\">\n <ng-template [ngIf]=\"currentUserImg\"\n [ngIfElse]=\"curDummy\">\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n <ng-template #curDummy>\n <div class=\"dummy-avatar bg-bown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- Participant -->\n <ng-container *ngIf=\"message.sender_id !== currentUser.id\">\n <ng-template [ngIf]=\"currentUser && otherUser?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </ng-container>\n </a>\n </div>\n <div class=\"chat-body\">\n <div class=\"chat-content attachment\"\n *ngIf=\"\n !message?.attachment?.url;\n else withAttachmentRef\n \">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n ></i>\n <i\n *ngIf=\"\n message.sender_id === currentUser.id &&\n message.is_open\n \"\n class=\"fa fa-check-double msg-dblcheck\"\n ></i>\n <p>{{ message.body }}</p>\n </div>\n\n <ng-template #withAttachmentRef>\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n ></i>\n <div *ngIf=\"message.attachment\"\n class=\"message-attachment\">\n <i *ngIf=\"message.attachment.url\">\n <img\n [src]=\"message.attachment.url\"\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.IMG\n \"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n <video\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.VIDEO\n \"\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n Your browser does not support the video\n tag.\n </video>\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!messagesGroupedByDate && isLoaded\">\n <div class=\"mt-3 text-center\">No message history.</div>\n </ng-container>\n\n <ng-container *ngIf=\"isFileUploading\">\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n </ng-container>\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n <div class=\"card px-3 py-2 m-0 mb-1\"\n *ngFor=\"let item of attachedFiles; let i = index\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- </ngx-file-drop> -->\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Textbox area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\"></i>\n </div>\n <input type=\"text\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <i class=\"fa fa-paperclip\">\n <input\n id=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n />\n </i>\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n </ng-template>\n\n <ng-template #nomessage>\n <div class=\"container-fluid pw-tab overflow-hidden nomessage-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing in the chat search field the name of the member you\n want to send a message and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-template>\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-dblcheck{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media (min-width: 768px){.nomessage-center{margin-left:auto;width:calc(100% - 300px)}}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: i4.ProgressSpinner, selector: "p-progressSpinner", inputs: ["style", "styleClass", "strokeWidth", "fill", "animationDuration"] }, { kind: "component", type: i5.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "itemSize", "suggestions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "directive", type: i6.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i7.PickerComponent, selector: "emoji-mart", inputs: ["perLine", "totalFrequentLines", "i18n", "style", "title", "emoji", "darkMode", "color", "hideObsolete", "categories", "activeCategories", "set", "skin", "isNative", "emojiSize", "sheetSize", "emojisToShowFilter", "showPreview", "emojiTooltip", "autoFocus", "custom", "hideRecent", "imageUrlFn", "include", "exclude", "notFoundEmoji", "categoriesIcons", "searchIcons", "useButton", "enableFrequentEmojiSort", "enableSearch", "showSingleCategory", "virtualize", "virtualizeOffset", "recent", "backgroundImageFn"], outputs: ["emojiClick", "emojiSelect", "skinChange"] }, { kind: "directive", type: i8.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i9.TextTruncatePipe, name: "textTruncate" }, { kind: "pipe", type: i9.CommonPipe, name: "common" }] });
458
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: ChatBoxComponent, decorators: [{
459
- type: Component,
460
- args: [{ template: "<div class=\"chat-application mt-5\">\n <div class=\"content-overlay\"></div>\n\n <div *ngIf=\"isChatLoading\"\n class=\"text-center\">\n <p-progressSpinner> </p-progressSpinner>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading\">\n <div class=\"chat-sidebar float-start d-none d-sm-none d-md-block d-lg-block\">\n <div class=\"chat-sidebar-content\">\n <div class=\"chat-fixed-search p-2\">\n <div class=\"d-flex\">\n <p-autoComplete [(ngModel)]=\"searchText\"\n #searchTxt\n placeholder=\"Type here to search member\"\n [ngModelOptions]=\"{ standalone: true }\"\n field=\"first_name\"\n (onSelect)=\"onMemberSelection(searchText)\"\n [suggestions]=\"recipients\"\n (completeMethod)=\"recipientSearch()\">\n <ng-template let-item\n pTemplate=\"item\">\n <div>\n {{ item.first_name + ' ' }}\n {{ item.last_name ? item.last_name : '' }}\n </div>\n </ng-template>\n </p-autoComplete>\n </div>\n </div>\n\n <!-- Thread/conversation List -->\n <div id=\"users-list\"\n class=\"list-group position-relative\">\n <div class=\"users-list-padding\"\n *ngIf=\"conversations?.length\">\n <a class=\"list-group-item no-border\"\n (click)=\"onParticipantClick(conversation)\"\n *ngFor=\"let conversation of conversations\">\n <div class=\"d-flex\">\n <span class=\"avatar avatar-md avatar-away\">\n <ng-template [ngIf]=\"conversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"conversation.to.avatar\"\n width=\"40\"\n height=\"40\"\n onerror=\"this.onerror=null;this.src='assets/img/icons/male.png';\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar me-2\">\n <strong>{{\n conversation.participants\n ? conversation.to.slug.charAt(0).toUpperCase()\n : conversation.to.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </span>\n <div class=\"clearfix\">\n <h6 class=\"list-group-item-heading mb-1\">\n {{\n conversation.to?.name\n ? conversation.to.name\n : conversation.to.slug\n }}\n <span class=\"font-small-3 float-end ms-5 ps-5\">\n <span class=\"badge bg-primary rounded-pill bg-primary mx-1\"\n *ngIf=\"conversation.unread_count\">\n {{ conversation.unread_count }}\n </span>\n {{ conversation.created_at | date: 'shortTime' }}\n </span>\n </h6>\n <p class=\"list-group-item-text text-muted\">\n {{ conversation.latest_message?.body | textTruncate: 25 }}\n </p>\n </div>\n </div>\n </a>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template [ngIf]=\"!isChatLoading && conversations?.length\"\n [ngIfElse]=\"nomessage\">\n <!-- Chat Header -->\n <div class=\"chat-name p-2 bg-white\"\n *ngIf=\"otherUser\">\n <div class=\"d-flex\">\n <span class=\"chat-app-sidebar-toggle ft-align-justify font-large-1 me-2 d-none d-block d-sm-block d-md-none\"\n (click)=\"toggleSidebar()\"></span>\n <div class=\"clearfix\">\n <ng-template [ngIf]=\"currentConversation?.to?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"currentConversation?.to?.avatar\"\n width=\"40\"\n height=\"40\"\n class=\"rounded-circle me-1\"\n alt=\"avatar\"\n onerror=\"this.onerror=null;this.src='assets/img/icons/male.png';\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div *ngIf=\"currentUser\"\n class=\"dummy-avatar me-2\">\n <strong>{{\n otherUser?.name\n ? otherUser.name.charAt(0).toUpperCase()\n : otherUser.slug.charAt(0).toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n\n <ng-template [ngIf]=\"currentUser\">\n <strong class=\"mt-2\">{{\n otherUser.name ? otherUser.name : otherUser.slug\n }}</strong>\n </ng-template>\n </div>\n </div>\n </div>\n\n <!-- Chat Window -->\n <div class=\"chat-app-window\"\n id=\"chats-wrapper\"\n #scrollMe\n infinite-scroll\n [infiniteScrollDistance]=\"scrollDistance\"\n [scrollWindow]=\"false\"\n [infiniteScrollUpDistance]=\"scrollUpDistance\"\n [infiniteScrollThrottle]=\"throttle\"\n [alwaysCallback]=\"true\"\n (scrolledUp)=\"onUp($event, selectedConversationId)\">\n <!-- [scrollTop]=\"scrollMe.scrollHeight\" -->\n <!-- <ngx-file-drop (onFileDrop)=\"dropped($event)\" (onFileOver)=\"fileOver($event)\"> -->\n <div class=\"chats\">\n <!-- Shows Message -->\n <div *ngIf=\"!isLoaded\"\n class=\"spinner\"></div>\n <ng-container *ngIf=\"messagesGroupedByDate\">\n <ng-container *ngFor=\"let item of ObjectKeys(messagesGroupedByDate)\">\n <strong class=\"badge bg-secondary mb-1\">{{\n messagesGroupedByDate[item][0]?.created_at | date\n }}</strong>\n <!-- Every Message -->\n <div class=\"chat\"\n [ngClass]=\"{\n 'chat-left ms-2': message.sender_id !== currentUser.id,\n 'me-2': message.sender_id === currentUser.id\n }\"\n *ngFor=\"\n let message of messagesGroupedByDate[item];\n trackBy: trackByMessageId;\n let i = index\n \">\n <ng-container *ngIf=\"message.body || message.attachment.url\">\n <div class=\"chat-avatar\">\n <a class=\"avatar\"\n data-toggle=\"tooltip\"\n data-placement=\"right\"\n data-original-title=\"\">\n <!-- Setting up Avatar Image for Logged In User -->\n <ng-container *ngIf=\"message.sender_id === currentUser.id\">\n <ng-template [ngIf]=\"currentUserImg\"\n [ngIfElse]=\"curDummy\">\n <img [src]=\"currentUserImg\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n <ng-template #curDummy>\n <div class=\"dummy-avatar bg-bown\">\n <strong>{{\n currentUser?.name\n ? currentUser.name\n .charAt(0)\n .toUpperCase()\n : currentUser.slug\n .charAt(0)\n .toUpperCase()\n }}\n </strong>\n </div>\n </ng-template>\n </ng-container>\n\n <!-- Participant -->\n <ng-container *ngIf=\"message.sender_id !== currentUser.id\">\n <ng-template [ngIf]=\"currentUser && otherUser?.avatar\"\n [ngIfElse]=\"dummyAvatar\">\n <img [src]=\"otherUser?.avatar\"\n class=\"d-flex height-50 rounded-circle\"\n alt=\"avatar\" />\n </ng-template>\n\n <ng-template #dummyAvatar>\n <div class=\"dummy-avatar\">\n <strong>{{\n otherUser?.name\n ? otherUser.name\n .charAt(0)\n .toUpperCase()\n : otherUser.slug\n .charAt(0)\n .toUpperCase()\n }}</strong>\n </div>\n </ng-template>\n </ng-container>\n </a>\n </div>\n <div class=\"chat-body\">\n <div class=\"chat-content attachment\"\n *ngIf=\"\n !message?.attachment?.url;\n else withAttachmentRef\n \">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n ></i>\n <i\n *ngIf=\"\n message.sender_id === currentUser.id &&\n message.is_open\n \"\n class=\"fa fa-check-double msg-dblcheck\"\n ></i>\n <p>{{ message.body }}</p>\n </div>\n\n <ng-template #withAttachmentRef>\n <div class=\"chat-content with-attachment\">\n <small class=\"message-time\">{{\n message.created_at | date: 'shortTime'\n }}</small>\n <i\n class=\"far fa-trash-alt btn-delete danger\"\n aria-hidden=\"true\"\n *ngIf=\"message.sender_id === currentUser.id\"\n (click)=\"onDeleteMessage(message)\"\n ></i>\n <div *ngIf=\"message.attachment\"\n class=\"message-attachment\">\n <i *ngIf=\"message.attachment.url\">\n <img\n [src]=\"message.attachment.url\"\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.IMG\n \"\n class=\"img-thumbnail\"\n alt=\"message attachment\"\n />\n <video\n *ngIf=\"\n message?.messageType ===\n ATTACHMENT_TYPE.VIDEO\n \"\n width=\"320\"\n height=\"240\"\n controls\n class=\"img-thumbnail\"\n >\n <source\n [src]=\"message.attachment.url\"\n type=\"video/mp4\"\n />\n Your browser does not support the video\n tag.\n </video>\n <a\n [attr.href]=\"message.attachment.url\"\n target=\"_blank\"\n >\n <i\n class=\"fa fa-file-download me-2\"\n aria-hidden=\"true\"\n ></i>\n {{\n message.attachment.url\n | common: 'filename'\n }}</a>\n </i>\n </div>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </ng-container>\n\n <ng-container *ngIf=\"!messagesGroupedByDate && isLoaded\">\n <div class=\"mt-3 text-center\">No message history.</div>\n </ng-container>\n\n <ng-container *ngIf=\"isFileUploading\">\n <i class=\"fa fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n </ng-container>\n\n <!-- Shows Metadata of the file being uploaded -->\n <div class=\"compose-message-attachment\">\n <div class=\"m-0\">\n <div class=\"card px-3 py-2 m-0 mb-1\"\n *ngFor=\"let item of attachedFiles; let i = index\">\n <div class=\"card-body\">\n <div class=\"d-inline-block file-name\">{{ item.name }}</div>\n <div class=\"d-inline-block file-size\">{{ item.size }}</div>\n <div class=\"d-inline-block float-end file-remove\"\n (click)=\"onRemoveAttachment(item)\">\n\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <!-- </ngx-file-drop> -->\n </div>\n\n <div [hidden]=\"!showEmoji\">\n <emoji-mart title=\"Pick your emoji\u2026\"\n set=\"facebook\"\n [showPreview]=\"false\"\n (emojiSelect)=\"onEmojiSelect($event)\"\n [emojiSize]=\"30\">\n </emoji-mart>\n </div>\n\n <!-- Compose Textbox area -->\n <div class=\"chat-app-form bg-blue-grey bg-lighten-5\">\n <form class=\"chat-app-input row\">\n <fieldset class=\"mb-3 position-relative has-icon-left col-10 m-0 mb-1\">\n <div class=\"form-control-position emoji-container\">\n <i class=\"icon-emoticon-smile\" (click)=\"showEmoji = !showEmoji\"></i>\n </div>\n <input type=\"text\"\n class=\"form-control\"\n autocomplete=\"off\"\n placeholder=\"Type your message here...\"\n (keydown.enter)=\"onSendMessage(); $event.preventDefault()\"\n #messageInput />\n <div class=\"form-control-position control-position-right\">\n <div class=\"image-upload\">\n <label for=\"file-input\">\n <i class=\"fa fa-paperclip\">\n <input\n id=\"file-input\"\n type=\"file\"\n (change)=\"fileChangeListener($event)\"\n size=\"60\"\n />\n </i>\n </label>\n </div>\n </div>\n </fieldset>\n\n <fieldset class=\"mb-3 position-relative has-icon-left col-2 m-0 mb-1\">\n <button type=\"button\"\n class=\"btn btn-primary d-lg-flex align-items-center btn-send\"\n (click)=\"onSendMessage()\">\n <i class=\"fa fa-paper-plane\"></i><span class=\"d-none d-lg-block ms-1\">Send</span>\n </button>\n </fieldset>\n </form>\n </div>\n </ng-template>\n\n <ng-template #nomessage>\n <div class=\"container-fluid pw-tab overflow-hidden nomessage-center\">\n <div class=\"dashboard\">\n <div class=\"dashboard-body text-center mt-5\">\n <div>\n <img src=\"/assets/img/icons/empty-chat-icon.png\"\n alt=\"No Chat\" />\n </div>\n <div class=\"h4 mt-4\">No messages yet!</div>\n <div class=\"mt-3\">\n <p>It looks like you haven't shared or received any messages yet.</p>\n <p>\n Start typing in the chat search field the name of the member you\n want to send a message and send them a message.\n </p>\n </div>\n </div>\n </div>\n </div>\n </ng-template>\n </ng-template>\n</div>\n", styles: [":root{--first: rgb(23 105 225);--second: rgb(54 194 131);--third: rgb(255 171 0);--text: rgb(34 34 34);--tabs_bg: rgb(23 105 225);--tabs_text: rgb(255 255 255);--titles: rgb(34 34 34);--sidebar_bg: rgb(0, 48, 63);--sidebar_text: rgb(255 255 255)}#drift-widget-container{display:none!important}#file-input{height:0;visibility:hidden;width:0}.message-attachment{color:#fff}.compose-message-attachment{bottom:0;color:#676767;left:0;position:absolute;width:55%}.compose-message-attachment .file-name{font-size:14px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;width:400px}.compose-message-attachment .file-size{width:100px}.compose-message-attachment .file-remove{width:45px}.compose-message-attachment .file-remove i{margin-left:37px;margin-top:7px}.fa-spinner{font-size:24px}.fa-paperclip{font-size:19px;margin-top:7px;width:13px}.dummy-avatar{background-color:#ff586b;border-radius:50%;color:#fff;font-size:18px;height:40px;line-height:40px;text-align:center;width:40px;display:inline-block}.card{border:1px solid rgb(204,204,204)}.msg-dblcheck{color:#4fc3f7;font-size:10px;left:-13px;position:absolute;top:11px}.btn-delete{display:none;left:-85px;position:absolute;top:11px}.chat-body:hover .btn-delete{display:block!important}.bg-brown{background-color:#cc6000}.btn-send{border-radius:5px;padding:7px 13px}@keyframes spinner{to{transform:rotate(360deg)}}.spinner{animation:spinner .6s linear infinite!important;border:3px solid rgb(204,204,204);border-radius:50%;border-top-color:#000;box-sizing:border-box;content:\"\";height:50px;left:50%;margin-left:-10px;margin-top:-10px;position:absolute;top:10%;width:50px}@media (min-width: 768px){.nomessage-center{margin-left:auto;width:calc(100% - 300px)}}\n"] }]
461
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.MailBoxService }, { type: i1.ProfileService }, { type: i1.WebsocketService }, { type: i0.Injector }]; }, propDecorators: { messageInputRef: [{
462
- type: ViewChild,
463
- args: ['messageInput', { static: false }]
464
- }] } });
465
-
466
- const routes = [
467
- {
468
- path: '',
469
- component: ChatBoxComponent,
470
- data: {
471
- title: 'Chat'
472
- }
473
- },
474
- {
475
- path: ':memberId',
476
- component: ChatBoxComponent,
477
- data: {
478
- title: 'Chat'
479
- }
480
- }
481
- ];
482
- class MessageRoutingModule {
483
- }
484
- MessageRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessageRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
485
- MessageRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: MessageRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
486
- MessageRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessageRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] });
487
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessageRoutingModule, decorators: [{
488
- type: NgModule,
489
- args: [{
490
- imports: [RouterModule.forChild(routes)],
491
- exports: [RouterModule]
492
- }]
493
- }] });
494
-
495
- class MessagingModule {
496
- }
497
- MessagingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
498
- MessagingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: MessagingModule, declarations: [ChatBoxComponent], imports: [CommonModule,
499
- PipesModule,
500
- FormsModule,
501
- MessageRoutingModule,
502
- ProgressSpinnerModule,
503
- AutoCompleteModule,
504
- PickerModule,
505
- EmojiModule,
506
- NgxFileDropModule,
507
- InfiniteScrollModule,
508
- ScrollingModule], exports: [RouterModule, ChatBoxComponent] });
509
- MessagingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessagingModule, imports: [CommonModule,
510
- PipesModule,
511
- FormsModule,
512
- MessageRoutingModule,
513
- ProgressSpinnerModule,
514
- AutoCompleteModule,
515
- PickerModule,
516
- EmojiModule,
517
- NgxFileDropModule,
518
- InfiniteScrollModule,
519
- ScrollingModule, RouterModule] });
520
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: MessagingModule, decorators: [{
521
- type: NgModule,
522
- args: [{
523
- imports: [
524
- CommonModule,
525
- PipesModule,
526
- FormsModule,
527
- MessageRoutingModule,
528
- ProgressSpinnerModule,
529
- AutoCompleteModule,
530
- PickerModule,
531
- EmojiModule,
532
- NgxFileDropModule,
533
- InfiniteScrollModule,
534
- ScrollingModule
535
- ],
536
- declarations: [ChatBoxComponent],
537
- exports: [RouterModule, ChatBoxComponent]
538
- }]
539
- }] });
540
-
541
- /**
542
- * Generated bundle index. Do not edit.
543
- */
544
-
545
- export { ChatBoxComponent, MessagingModule };
546
- //# sourceMappingURL=posiwise-messaging-module.mjs.map