stream-chat-angular 1.3.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/assets/i18n/en.d.ts +1 -0
  2. package/assets/version.d.ts +1 -1
  3. package/bundles/stream-chat-angular.umd.js +1196 -365
  4. package/bundles/stream-chat-angular.umd.js.map +1 -1
  5. package/esm2015/assets/i18n/en.js +2 -1
  6. package/esm2015/assets/version.js +2 -2
  7. package/esm2015/lib/attachment-list/attachment-list.component.js +3 -4
  8. package/esm2015/lib/attachment-preview-list/attachment-preview-list.component.js +38 -0
  9. package/esm2015/lib/attachment.service.js +190 -0
  10. package/esm2015/lib/channel.service.js +53 -4
  11. package/esm2015/lib/chat-client.service.js +16 -1
  12. package/esm2015/lib/injection-tokens.js +3 -0
  13. package/esm2015/lib/is-image-attachment.js +6 -0
  14. package/esm2015/lib/message/highlight-mentions.pipe.js +23 -0
  15. package/esm2015/lib/message/message.component.js +3 -2
  16. package/esm2015/lib/message-actions-box/message-actions-box.component.js +43 -12
  17. package/esm2015/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.js +145 -0
  18. package/esm2015/lib/message-input/message-input-config.service.js +19 -0
  19. package/esm2015/lib/message-input/message-input.component.js +122 -140
  20. package/esm2015/lib/message-input/textarea/textarea.component.js +42 -0
  21. package/esm2015/lib/message-input/textarea.directive.js +69 -0
  22. package/esm2015/lib/message-input/textarea.interface.js +2 -0
  23. package/esm2015/lib/message-list/message-list.component.js +19 -3
  24. package/esm2015/lib/message-preview.js +3 -2
  25. package/esm2015/lib/modal/modal.component.js +63 -0
  26. package/esm2015/lib/notification-list/notification-list.component.js +1 -1
  27. package/esm2015/lib/notification.service.js +1 -1
  28. package/esm2015/lib/stream-autocomplete-textarea.module.js +33 -0
  29. package/esm2015/lib/stream-avatar.module.js +19 -0
  30. package/esm2015/lib/stream-chat.module.js +25 -11
  31. package/esm2015/lib/stream-textarea.module.js +31 -0
  32. package/esm2015/lib/types.js +1 -1
  33. package/esm2015/public-api.js +19 -1
  34. package/fesm2015/stream-chat-angular.js +955 -241
  35. package/fesm2015/stream-chat-angular.js.map +1 -1
  36. package/lib/attachment-preview-list/attachment-preview-list.component.d.ts +14 -0
  37. package/lib/attachment.service.d.ts +25 -0
  38. package/lib/channel.service.d.ts +6 -2
  39. package/lib/chat-client.service.d.ts +1 -0
  40. package/lib/injection-tokens.d.ts +3 -0
  41. package/lib/is-image-attachment.d.ts +2 -0
  42. package/lib/message/highlight-mentions.pipe.d.ts +8 -0
  43. package/lib/message/message.component.d.ts +1 -0
  44. package/lib/message-actions-box/message-actions-box.component.d.ts +11 -4
  45. package/lib/message-input/autocomplete-textarea/autocomplete-textarea.component.d.ts +42 -0
  46. package/lib/message-input/message-input-config.service.d.ts +14 -0
  47. package/lib/message-input/message-input.component.d.ts +30 -20
  48. package/lib/message-input/textarea/textarea.component.d.ts +16 -0
  49. package/lib/message-input/textarea.directive.d.ts +21 -0
  50. package/lib/message-input/textarea.interface.d.ts +12 -0
  51. package/lib/message-list/message-list.component.d.ts +1 -1
  52. package/lib/message-preview.d.ts +1 -1
  53. package/lib/modal/modal.component.d.ts +16 -0
  54. package/lib/notification-list/notification-list.component.d.ts +3 -3
  55. package/lib/notification.service.d.ts +2 -2
  56. package/lib/stream-autocomplete-textarea.module.d.ts +11 -0
  57. package/lib/stream-avatar.module.d.ts +9 -0
  58. package/lib/stream-chat.module.d.ts +23 -19
  59. package/lib/stream-textarea.module.d.ts +9 -0
  60. package/lib/types.d.ts +7 -1
  61. package/package.json +3 -2
  62. package/public-api.d.ts +18 -0
  63. package/src/assets/i18n/en.ts +1 -0
  64. package/src/assets/version.ts +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('dayjs'), require('dayjs/plugin/calendar'), require('@ctrl/ngx-emoji-mart/ngx-emoji'), require('pretty-bytes')) :
3
- typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'dayjs', 'dayjs/plugin/calendar', '@ctrl/ngx-emoji-mart/ngx-emoji', 'pretty-bytes'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.i4, global.ng.common, global.Dayjs, global.calendar, global.i2, global.prettybytes));
5
- }(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i4, i5, Dayjs, calendar, i2, prettybytes) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('stream-chat'), require('rxjs/operators'), require('uuid'), require('@ngx-translate/core'), require('@angular/common'), require('dayjs'), require('dayjs/plugin/calendar'), require('@ctrl/ngx-emoji-mart/ngx-emoji'), require('pretty-bytes'), require('angular-mentions')) :
3
+ typeof define === 'function' && define.amd ? define('stream-chat-angular', ['exports', '@angular/core', 'rxjs', 'stream-chat', 'rxjs/operators', 'uuid', '@ngx-translate/core', '@angular/common', 'dayjs', 'dayjs/plugin/calendar', '@ctrl/ngx-emoji-mart/ngx-emoji', 'pretty-bytes', 'angular-mentions'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['stream-chat-angular'] = {}, global.ng.core, global.rxjs, global.streamChat, global.rxjs.operators, global.uuid, global.i1, global.ng.common, global.Dayjs, global.calendar, global.i2, global.prettybytes, global.i4));
5
+ }(this, (function (exports, i0, rxjs, streamChat, operators, uuid, i1, i5, Dayjs, calendar, i2, prettybytes, i4) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -27,12 +27,13 @@
27
27
  }
28
28
 
29
29
  var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
- var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
30
+ var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
31
31
  var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
32
32
  var Dayjs__default = /*#__PURE__*/_interopDefaultLegacy(Dayjs);
33
33
  var calendar__default = /*#__PURE__*/_interopDefaultLegacy(calendar);
34
34
  var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
35
35
  var prettybytes__default = /*#__PURE__*/_interopDefaultLegacy(prettybytes);
36
+ var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
36
37
 
37
38
  /*! *****************************************************************************
38
39
  Copyright (c) Microsoft Corporation.
@@ -352,7 +353,7 @@
352
353
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
353
354
  }
354
355
 
355
- var version = '1.3.0';
356
+ var version = '2.0.0';
356
357
 
357
358
  var NotificationService = /** @class */ (function () {
358
359
  function NotificationService() {
@@ -483,6 +484,29 @@
483
484
  });
484
485
  });
485
486
  };
487
+ ChatClientService.prototype.autocompleteUsers = function (searchTerm) {
488
+ return __awaiter(this, void 0, void 0, function () {
489
+ var result;
490
+ return __generator(this, function (_a) {
491
+ switch (_a.label) {
492
+ case 0:
493
+ if (!searchTerm) {
494
+ return [2 /*return*/, []];
495
+ }
496
+ return [4 /*yield*/, this.chatClient.queryUsers({
497
+ $or: [
498
+ { id: { $autocomplete: searchTerm } },
499
+ { name: { $autocomplete: searchTerm } },
500
+ ],
501
+ id: { $ne: this.chatClient.userID },
502
+ })];
503
+ case 1:
504
+ result = _a.sent();
505
+ return [2 /*return*/, result.users];
506
+ }
507
+ });
508
+ });
509
+ };
486
510
  return ChatClientService;
487
511
  }());
488
512
  ChatClientService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChatClientService, deps: [{ token: i0__namespace.NgZone }, { token: i0__namespace.ApplicationRef }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
@@ -494,7 +518,7 @@
494
518
  }]
495
519
  }], ctorParameters: function () { return [{ type: i0__namespace.NgZone }, { type: i0__namespace.ApplicationRef }, { type: NotificationService }]; } });
496
520
 
497
- var createMessagePreview = function (user, text, attachments) {
521
+ var createMessagePreview = function (user, text, attachments, mentionedUsers) {
498
522
  var clientSideId = user.id + "-" + uuid.v4();
499
523
  return {
500
524
  __html: text,
@@ -507,6 +531,7 @@
507
531
  type: 'regular',
508
532
  user: user,
509
533
  attachments: attachments,
534
+ mentioned_users: mentionedUsers,
510
535
  };
511
536
  };
512
537
 
@@ -545,7 +570,8 @@
545
570
  this.activeChannelMessages$ = this.activeChannelMessagesSubject.pipe(operators.map(function (messages) {
546
571
  var channel = _this.activeChannelSubject.getValue();
547
572
  return messages.map(function (message) {
548
- if (_this.isStreamMessage(message)) {
573
+ if (_this.isStreamMessage(message) &&
574
+ _this.isFormatMessageResponse(message)) {
549
575
  return message;
550
576
  }
551
577
  else if (_this.isFormatMessageResponse(message)) {
@@ -663,14 +689,15 @@
663
689
  });
664
690
  });
665
691
  };
666
- ChannelService.prototype.sendMessage = function (text, attachments) {
692
+ ChannelService.prototype.sendMessage = function (text, attachments, mentionedUsers) {
667
693
  if (attachments === void 0) { attachments = []; }
694
+ if (mentionedUsers === void 0) { mentionedUsers = []; }
668
695
  return __awaiter(this, void 0, void 0, function () {
669
696
  var preview, channel;
670
697
  return __generator(this, function (_e) {
671
698
  switch (_e.label) {
672
699
  case 0:
673
- preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments);
700
+ preview = createMessagePreview(this.chatClientService.chatClient.user, text, attachments, mentionedUsers);
674
701
  channel = this.activeChannelSubject.getValue();
675
702
  preview.readBy = [];
676
703
  channel.state.addMessageSorted(preview, true);
@@ -698,6 +725,30 @@
698
725
  });
699
726
  });
700
727
  };
728
+ ChannelService.prototype.updateMessage = function (message) {
729
+ return __awaiter(this, void 0, void 0, function () {
730
+ return __generator(this, function (_e) {
731
+ switch (_e.label) {
732
+ case 0: return [4 /*yield*/, this.chatClientService.chatClient.updateMessage(message)];
733
+ case 1:
734
+ _e.sent();
735
+ return [2 /*return*/];
736
+ }
737
+ });
738
+ });
739
+ };
740
+ ChannelService.prototype.deleteMessage = function (message) {
741
+ return __awaiter(this, void 0, void 0, function () {
742
+ return __generator(this, function (_e) {
743
+ switch (_e.label) {
744
+ case 0: return [4 /*yield*/, this.chatClientService.chatClient.deleteMessage(message.id)];
745
+ case 1:
746
+ _e.sent();
747
+ return [2 /*return*/];
748
+ }
749
+ });
750
+ });
751
+ };
701
752
  ChannelService.prototype.uploadAttachments = function (uploads) {
702
753
  return __awaiter(this, void 0, void 0, function () {
703
754
  var result, channel, uploadResults;
@@ -748,7 +799,39 @@
748
799
  });
749
800
  });
750
801
  };
802
+ ChannelService.prototype.autocompleteMembers = function (searchTerm) {
803
+ return __awaiter(this, void 0, void 0, function () {
804
+ var activeChannel, result;
805
+ var _this = this;
806
+ return __generator(this, function (_e) {
807
+ switch (_e.label) {
808
+ case 0:
809
+ activeChannel = this.activeChannelSubject.getValue();
810
+ if (!activeChannel) {
811
+ return [2 /*return*/, []];
812
+ }
813
+ if (!(Object.keys(activeChannel.state.members).length <= 100)) return [3 /*break*/, 1];
814
+ return [2 /*return*/, Object.values(activeChannel.state.members).filter(function (m) { var _a; return ((_a = m.user) === null || _a === void 0 ? void 0 : _a.id) !== _this.chatClientService.chatClient.userID; })];
815
+ case 1:
816
+ if (!searchTerm) {
817
+ return [2 /*return*/, []];
818
+ }
819
+ return [4 /*yield*/, activeChannel.queryMembers({
820
+ $or: [
821
+ { id: { $autocomplete: searchTerm } },
822
+ { name: { $autocomplete: searchTerm } },
823
+ ],
824
+ id: { $ne: this.chatClientService.chatClient.userID },
825
+ })];
826
+ case 2:
827
+ result = _e.sent();
828
+ return [2 /*return*/, Object.values(result.members)];
829
+ }
830
+ });
831
+ });
832
+ };
751
833
  ChannelService.prototype.sendMessageRequest = function (preview) {
834
+ var _a;
752
835
  return __awaiter(this, void 0, void 0, function () {
753
836
  var channel, error_1, stringError, parsedError;
754
837
  return __generator(this, function (_e) {
@@ -762,6 +845,7 @@
762
845
  return [4 /*yield*/, channel.sendMessage({
763
846
  text: preview.text,
764
847
  attachments: preview.attachments,
848
+ mentioned_users: (_a = preview.mentioned_users) === null || _a === void 0 ? void 0 : _a.map(function (u) { return u.id; }),
765
849
  id: preview.id,
766
850
  })];
767
851
  case 2:
@@ -900,6 +984,8 @@
900
984
  .subscribe(function (c) { return void (c === null || c === void 0 ? void 0 : c.markRead()); });
901
985
  });
902
986
  }));
987
+ this.activeChannelSubscriptions.push(channel.on('message.updated', function (event) { return _this.messageUpdated(event); }));
988
+ this.activeChannelSubscriptions.push(channel.on('message.deleted', function (event) { return _this.messageUpdated(event); }));
903
989
  this.activeChannelSubscriptions.push(channel.on('reaction.new', function (e) { return _this.messageReactionEventReceived(e); }));
904
990
  this.activeChannelSubscriptions.push(channel.on('reaction.deleted', function (e) { return _this.messageReactionEventReceived(e); }));
905
991
  this.activeChannelSubscriptions.push(channel.on('reaction.updated', function (e) { return _this.messageReactionEventReceived(e); }));
@@ -915,6 +1001,17 @@
915
1001
  _this.activeChannelMessagesSubject.next(_this.activeChannelMessagesSubject.getValue());
916
1002
  }));
917
1003
  };
1004
+ ChannelService.prototype.messageUpdated = function (event) {
1005
+ var _this = this;
1006
+ this.ngZone.run(function () {
1007
+ var messages = _this.activeChannelMessagesSubject.getValue();
1008
+ var messageIndex = messages.findIndex(function (m) { var _a; return m.id === ((_a = event.message) === null || _a === void 0 ? void 0 : _a.id); });
1009
+ if (messageIndex !== -1 && event.message) {
1010
+ messages[messageIndex] = event.message;
1011
+ _this.activeChannelMessagesSubject.next(__spreadArray([], __read(messages)));
1012
+ }
1013
+ });
1014
+ };
918
1015
  ChannelService.prototype.messageReactionEventReceived = function (e) {
919
1016
  var _this = this;
920
1017
  this.ngZone.run(function () {
@@ -1202,6 +1299,230 @@
1202
1299
  }]
1203
1300
  }], ctorParameters: function () { return []; } });
1204
1301
 
1302
+ var isImageAttachment = function (attachment) {
1303
+ return (attachment.type === 'image' &&
1304
+ !attachment.title_link &&
1305
+ !attachment.og_scrape_url);
1306
+ };
1307
+
1308
+ var AttachmentService = /** @class */ (function () {
1309
+ function AttachmentService(channelService, notificationService) {
1310
+ this.channelService = channelService;
1311
+ this.notificationService = notificationService;
1312
+ this.attachmentUploadInProgressCounterSubject = new rxjs.BehaviorSubject(0);
1313
+ this.attachmentUploadsSubject = new rxjs.BehaviorSubject([]);
1314
+ this.attachmentUploadInProgressCounter$ =
1315
+ this.attachmentUploadInProgressCounterSubject.asObservable();
1316
+ this.attachmentUploads$ = this.attachmentUploadsSubject.asObservable();
1317
+ }
1318
+ AttachmentService.prototype.resetAttachmentUploads = function () {
1319
+ this.attachmentUploadsSubject.next([]);
1320
+ };
1321
+ AttachmentService.prototype.filesSelected = function (fileList) {
1322
+ return __awaiter(this, void 0, void 0, function () {
1323
+ var imageFiles, dataFiles, newUploads;
1324
+ var _this = this;
1325
+ return __generator(this, function (_d) {
1326
+ switch (_d.label) {
1327
+ case 0:
1328
+ if (!fileList) {
1329
+ return [2 /*return*/];
1330
+ }
1331
+ imageFiles = [];
1332
+ dataFiles = [];
1333
+ Array.from(fileList).forEach(function (file) {
1334
+ if (file.type.startsWith('image/') && !file.type.endsWith('.photoshop')) {
1335
+ // photoshop files begin with 'image/'
1336
+ imageFiles.push(file);
1337
+ }
1338
+ else {
1339
+ dataFiles.push(file);
1340
+ }
1341
+ });
1342
+ imageFiles.forEach(function (f) { return _this.createPreview(f); });
1343
+ newUploads = __spreadArray(__spreadArray([], __read(imageFiles.map(function (file) { return ({
1344
+ file: file,
1345
+ state: 'uploading',
1346
+ type: 'image',
1347
+ }); }))), __read(dataFiles.map(function (file) { return ({
1348
+ file: file,
1349
+ state: 'uploading',
1350
+ type: 'file',
1351
+ }); })));
1352
+ this.attachmentUploadsSubject.next(__spreadArray(__spreadArray([], __read(this.attachmentUploadsSubject.getValue())), __read(newUploads)));
1353
+ return [4 /*yield*/, this.uploadAttachments(newUploads)];
1354
+ case 1:
1355
+ _d.sent();
1356
+ return [2 /*return*/];
1357
+ }
1358
+ });
1359
+ });
1360
+ };
1361
+ AttachmentService.prototype.retryAttachmentUpload = function (file) {
1362
+ return __awaiter(this, void 0, void 0, function () {
1363
+ var attachmentUploads, upload;
1364
+ return __generator(this, function (_d) {
1365
+ switch (_d.label) {
1366
+ case 0:
1367
+ attachmentUploads = this.attachmentUploadsSubject.getValue();
1368
+ upload = attachmentUploads.find(function (u) { return u.file === file; });
1369
+ if (!upload) {
1370
+ return [2 /*return*/];
1371
+ }
1372
+ upload.state = 'uploading';
1373
+ this.attachmentUploadsSubject.next(__spreadArray([], __read(attachmentUploads)));
1374
+ return [4 /*yield*/, this.uploadAttachments([upload])];
1375
+ case 1:
1376
+ _d.sent();
1377
+ return [2 /*return*/];
1378
+ }
1379
+ });
1380
+ });
1381
+ };
1382
+ AttachmentService.prototype.deleteAttachment = function (upload) {
1383
+ return __awaiter(this, void 0, void 0, function () {
1384
+ var attachmentUploads, error_1;
1385
+ return __generator(this, function (_d) {
1386
+ switch (_d.label) {
1387
+ case 0:
1388
+ attachmentUploads = this.attachmentUploadsSubject.getValue();
1389
+ if (!(upload.state === 'success')) return [3 /*break*/, 5];
1390
+ _d.label = 1;
1391
+ case 1:
1392
+ _d.trys.push([1, 3, , 4]);
1393
+ return [4 /*yield*/, this.channelService.deleteAttachment(upload)];
1394
+ case 2:
1395
+ _d.sent();
1396
+ attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);
1397
+ return [3 /*break*/, 4];
1398
+ case 3:
1399
+ error_1 = _d.sent();
1400
+ this.notificationService.addTemporaryNotification('streamChat.Error deleting attachment');
1401
+ return [3 /*break*/, 4];
1402
+ case 4: return [3 /*break*/, 6];
1403
+ case 5:
1404
+ attachmentUploads.splice(attachmentUploads.indexOf(upload), 1);
1405
+ _d.label = 6;
1406
+ case 6:
1407
+ this.attachmentUploadsSubject.next(__spreadArray([], __read(attachmentUploads)));
1408
+ return [2 /*return*/];
1409
+ }
1410
+ });
1411
+ });
1412
+ };
1413
+ AttachmentService.prototype.mapToAttachments = function () {
1414
+ var attachmentUploads = this.attachmentUploadsSubject.getValue();
1415
+ return attachmentUploads
1416
+ .filter(function (r) { return r.state === 'success'; })
1417
+ .map(function (r) {
1418
+ var _a, _b, _c;
1419
+ var attachment = {
1420
+ type: r.type,
1421
+ };
1422
+ if (r.type === 'image') {
1423
+ attachment.fallback = (_a = r.file) === null || _a === void 0 ? void 0 : _a.name;
1424
+ attachment.image_url = r.url;
1425
+ }
1426
+ else {
1427
+ attachment.asset_url = r.url;
1428
+ attachment.title = (_b = r.file) === null || _b === void 0 ? void 0 : _b.name;
1429
+ attachment.file_size = (_c = r.file) === null || _c === void 0 ? void 0 : _c.size;
1430
+ }
1431
+ return attachment;
1432
+ });
1433
+ };
1434
+ AttachmentService.prototype.createFromAttachments = function (attachments) {
1435
+ var attachmentUploads = [];
1436
+ attachments.forEach(function (attachment) {
1437
+ if (isImageAttachment(attachment)) {
1438
+ attachmentUploads.push({
1439
+ url: (attachment.img_url ||
1440
+ attachment.thumb_url ||
1441
+ attachment.image_url),
1442
+ state: 'success',
1443
+ type: 'image',
1444
+ file: {
1445
+ name: attachment.fallback,
1446
+ },
1447
+ });
1448
+ }
1449
+ else if (attachment.type === 'file') {
1450
+ attachmentUploads.push({
1451
+ url: attachment.asset_url,
1452
+ state: 'success',
1453
+ file: {
1454
+ name: attachment.title,
1455
+ size: attachment.file_size,
1456
+ },
1457
+ type: 'file',
1458
+ });
1459
+ }
1460
+ });
1461
+ if (attachmentUploads.length > 0) {
1462
+ this.attachmentUploadsSubject.next(__spreadArray(__spreadArray([], __read(this.attachmentUploadsSubject.getValue())), __read(attachmentUploads)));
1463
+ }
1464
+ };
1465
+ AttachmentService.prototype.createPreview = function (file) {
1466
+ var _this = this;
1467
+ var reader = new FileReader();
1468
+ reader.onload = function (event) {
1469
+ var _a;
1470
+ var attachmentUploads = _this.attachmentUploadsSubject.getValue();
1471
+ var upload = attachmentUploads.find(function (upload) { return upload.file === file; });
1472
+ if (!upload) {
1473
+ return;
1474
+ }
1475
+ upload.previewUri = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.result) || undefined;
1476
+ _this.attachmentUploadsSubject.next(__spreadArray([], __read(attachmentUploads)));
1477
+ };
1478
+ reader.readAsDataURL(file);
1479
+ };
1480
+ AttachmentService.prototype.uploadAttachments = function (uploads) {
1481
+ return __awaiter(this, void 0, void 0, function () {
1482
+ var attachmentUploads, result;
1483
+ var _this = this;
1484
+ return __generator(this, function (_d) {
1485
+ switch (_d.label) {
1486
+ case 0:
1487
+ attachmentUploads = this.attachmentUploadsSubject.getValue();
1488
+ this.attachmentUploadInProgressCounterSubject.next(this.attachmentUploadInProgressCounterSubject.getValue() + 1);
1489
+ return [4 /*yield*/, this.channelService.uploadAttachments(uploads)];
1490
+ case 1:
1491
+ result = _d.sent();
1492
+ result.forEach(function (r) {
1493
+ var upload = attachmentUploads.find(function (upload) { return upload.file === r.file; });
1494
+ if (!upload) {
1495
+ if (r.url) {
1496
+ void _this.channelService.deleteAttachment(r);
1497
+ }
1498
+ return;
1499
+ }
1500
+ upload.state = r.state;
1501
+ upload.url = r.url;
1502
+ if (upload.state === 'error') {
1503
+ _this.notificationService.addTemporaryNotification(upload.type === 'image'
1504
+ ? 'streamChat.Error uploading image'
1505
+ : 'streamChat.Error uploading file');
1506
+ }
1507
+ });
1508
+ this.attachmentUploadInProgressCounterSubject.next(this.attachmentUploadInProgressCounterSubject.getValue() - 1);
1509
+ this.attachmentUploadsSubject.next(__spreadArray([], __read(attachmentUploads)));
1510
+ return [2 /*return*/];
1511
+ }
1512
+ });
1513
+ });
1514
+ };
1515
+ return AttachmentService;
1516
+ }());
1517
+ AttachmentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentService, deps: [{ token: ChannelService }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1518
+ AttachmentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentService, providedIn: 'root' });
1519
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentService, decorators: [{
1520
+ type: i0.Injectable,
1521
+ args: [{
1522
+ providedIn: 'root',
1523
+ }]
1524
+ }], ctorParameters: function () { return [{ type: ChannelService }, { type: NotificationService }]; } });
1525
+
1205
1526
  var en = {
1206
1527
  streamChat: {
1207
1528
  '1 reply': '1 reply',
@@ -1227,6 +1548,7 @@
1227
1548
  'Error unmuting a user ...': 'Error unmuting a user ...',
1228
1549
  'Error uploading file': 'Error uploading file',
1229
1550
  'Error uploading image': 'Error uploading image',
1551
+ 'Error deleting attachment': 'Error deleting attachment',
1230
1552
  'Error · Unsent': 'Error · Unsent',
1231
1553
  'Error: {{ errorMessage }}': 'Error: {{ errorMessage }}',
1232
1554
  Flag: 'Flag',
@@ -1296,14 +1618,14 @@
1296
1618
  };
1297
1619
  return StreamI18nService;
1298
1620
  }());
1299
- StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token: i4__namespace.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1621
+ StreamI18nService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, deps: [{ token: i1__namespace.TranslateService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1300
1622
  StreamI18nService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, providedIn: 'root' });
1301
1623
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamI18nService, decorators: [{
1302
1624
  type: i0.Injectable,
1303
1625
  args: [{
1304
1626
  providedIn: 'root',
1305
1627
  }]
1306
- }], ctorParameters: function () { return [{ type: i4__namespace.TranslateService }]; } });
1628
+ }], ctorParameters: function () { return [{ type: i1__namespace.TranslateService }]; } });
1307
1629
 
1308
1630
  var AvatarComponent = /** @class */ (function () {
1309
1631
  function AvatarComponent() {
@@ -1344,7 +1666,7 @@
1344
1666
  return IconComponent;
1345
1667
  }());
1346
1668
  IconComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1347
- IconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: IconComponent, selector: "stream-icon", inputs: { icon: "icon", size: "size" }, ngImport: i0__namespace, template: "<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n", directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
1669
+ IconComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: IconComponent, selector: "stream-icon", inputs: { icon: "icon", size: "size" }, ngImport: i0__namespace, template: "<svg\n data-testid=\"action-icon\"\n *ngIf=\"icon === 'action-icon'\"\n height=\"4\"\n viewBox=\"0 0 11 4\"\n width=\"11\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M1.5 3a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm4 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'delivered-icon'\"\n height=\"16\"\n width=\"16\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"delivered-icon\"\n>\n <path\n d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm3.72 6.633a.955.955 0 1 0-1.352-1.352L6.986 8.663 5.633 7.31A.956.956 0 1 0 4.28 8.663l2.029 2.028a.956.956 0 0 0 1.353 0l4.058-4.058z\"\n fill=\"#006CFF\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'reaction-icon'\"\n height=\"12\"\n viewBox=\"0 0 12 12\"\n width=\"12\"\n xmlns=\"http://www.w3.org/2000/svg\"\n data-testid=\"reaction-icon\"\n>\n <g clipRule=\"evenodd\" fillRule=\"evenodd\">\n <path\n d=\"M6 1.2C3.3 1.2 1.2 3.3 1.2 6c0 2.7 2.1 4.8 4.8 4.8 2.7 0 4.8-2.1 4.8-4.8 0-2.7-2.1-4.8-4.8-4.8zM0 6c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6-6-2.7-6-6z\"\n ></path>\n <path\n d=\"M5.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM8.4 4.5c0 .5-.4.9-.9.9s-.9-.4-.9-.9.4-.9.9-.9.9.4.9.9zM3.3 6.7c.3-.2.6-.1.8.1.3.4.8.9 1.5 1 .6.2 1.4.1 2.4-1 .2-.2.6-.3.8 0 .2.2.3.6 0 .8-1.1 1.3-2.4 1.7-3.5 1.5-1-.2-1.8-.9-2.2-1.5-.2-.3-.1-.7.2-.9z\"\n ></path>\n </g>\n</svg>\n<svg\n data-testid=\"connection-error\"\n *ngIf=\"icon === 'connection-error'\"\n width=\"78px\"\n height=\"78px\"\n viewBox=\"0 0 78 78\"\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->\n <title>Combined Shape</title>\n <desc>Created with Sketch.</desc>\n <g\n id=\"Interactions\"\n stroke=\"none\"\n stroke-width=\"1\"\n fill=\"none\"\n fill-rule=\"evenodd\"\n >\n <g\n id=\"Connection-Error-_-Connectivity\"\n transform=\"translate(-270.000000, -30.000000)\"\n fill=\"#CF1F25\"\n >\n <g\n id=\"109-network-connection\"\n transform=\"translate(270.000000, 30.000000)\"\n >\n <path\n d=\"M66.4609744,11.414231 C81.6225232,26.5757798 81.6225232,51.157545 66.4609744,66.3188467 C51.2994256,81.4803954 26.7176604,81.4803954 11.5563587,66.3188467 C-3.60519004,51.1572979 -3.60519004,26.5755327 11.5563587,11.414231 C26.7179075,-3.74731776 51.2996727,-3.74731776 66.4609744,11.414231 Z M54.7853215,45.8823776 L54.7853215,40.5882574 C54.7853215,39.613638 53.9952341,38.8235506 53.0206147,38.8235506 L44.9576695,38.8235506 L41.428256,42.3529641 L51.255555,42.3529641 L51.255555,45.8823776 L54.7853215,45.8823776 Z M40.6659027,43.1153174 L37.8988425,45.8823776 L40.6659027,45.8823776 L40.6659027,43.1153174 Z M51.1764962,56.4702653 L58.2353232,56.4702653 C59.2099355,56.4702653 60.00003,55.6801708 60.00003,54.7055585 L60.00003,51.176145 C60.00003,50.2015327 59.2099355,49.4114382 58.2353232,49.4114382 L51.1764962,49.4114382 C50.2018839,49.4114382 49.4117894,50.2015327 49.4117894,51.176145 L49.4117894,54.7055585 C49.4117894,55.6801708 50.2018839,56.4702653 51.1764962,56.4702653 Z M35.2941353,56.4702653 L42.3529624,56.4702653 C43.3275746,56.4702653 44.1176691,55.6801708 44.1176691,54.7055585 L44.1176691,51.176145 C44.1176691,50.2015327 43.3275746,49.4114382 42.3529624,49.4114382 L35.2941353,49.4114382 C34.319523,49.4114382 33.5294285,50.2015327 33.5294285,51.176145 L33.5294285,54.7055585 C33.5294285,55.6801708 34.319523,56.4702653 35.2941353,56.4702653 Z M56.6964989,19.0874231 C56.007381,18.3985134 54.8903216,18.3985134 54.2012036,19.087423 L45.882376,27.4062507 L45.882376,19.4117761 C45.882376,18.4371568 45.0922885,17.6470693 44.1176692,17.6470693 L33.5294286,17.6470693 C32.5548092,17.6470694 31.7647218,18.4371568 31.7647218,19.4117761 L31.7647218,30.0000167 C31.7647219,30.9746363 32.5548092,31.7647237 33.5294285,31.7647237 L41.5239031,31.7647237 L34.4650761,38.8235508 L24.7058947,38.8235508 C23.7312753,38.8235508 22.9411879,39.6136382 22.9411879,40.5882575 L22.9411879,45.8823778 L26.4706014,45.8823778 L26.4706014,42.3529643 L30.9356624,42.3529643 L23.8768354,49.4117914 L19.4117743,49.4117914 C18.4371549,49.4117914 17.6470675,50.2018788 17.6470675,51.1764981 L17.6470675,54.7059117 C17.6504049,54.9674302 17.7129076,55.2248042 17.8298886,55.4587302 L16.4456526,56.8429662 C15.7446193,57.5200453 15.7252005,58.6372282 16.4022825,59.3382615 C17.0793616,60.0392948 18.1965445,60.0587136 18.8975778,59.3816316 C18.9122847,59.3674273 18.9267436,59.3529684 18.940948,59.3382615 L56.6964963,21.5830662 C57.3856425,20.8939094 57.3856425,19.7765747 56.6964963,19.0874179 Z\"\n id=\"Combined-Shape\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'send'\"\n data-testid=\"send\"\n height=\"17\"\n viewBox=\"0 0 18 17\"\n width=\"18\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Send</title>\n <path\n d=\"M0 17.015l17.333-8.508L0 0v6.617l12.417 1.89L0 10.397z\"\n fill=\"#006cff\"\n fillRule=\"evenodd\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'file-upload'\"\n data-testid=\"file-upload\"\n height=\"14\"\n width=\"14\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <title translate>streamChat.Attach files</title>\n <path\n d=\"M1.667.333h10.666c.737 0 1.334.597 1.334 1.334v10.666c0 .737-.597 1.334-1.334 1.334H1.667a1.333 1.333 0 0 1-1.334-1.334V1.667C.333.93.93.333 1.667.333zm2 1.334a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333zm-2 9.333v1.333h10.666v-4l-2-2-4 4-2-2L1.667 11z\"\n fillRule=\"nonzero\"\n />\n</svg>\n<svg\n data-testid=\"retry\"\n *ngIf=\"icon === 'retry'\"\n width=\"22\"\n height=\"20\"\n viewBox=\"0 0 22 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n>\n <path\n d=\"M20 5.535V2a1 1 0 0 1 2 0v6a1 1 0 0 1-1 1h-6a1 1 0 0 1 0-2h3.638l-2.975-2.653a8 8 0 1 0 1.884 8.32 1 1 0 1 1 1.886.666A10 10 0 1 1 5.175 1.245c3.901-2.15 8.754-1.462 11.88 1.667L20 5.535z\"\n fill=\"#FFF\"\n fill-rule=\"nonzero\"\n />\n</svg>\n<svg\n *ngIf=\"icon === 'close'\"\n data-testid=\"close\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n>\n <defs>\n <path\n d=\"M465 5c5.53 0 10 4.47 10 10s-4.47 10-10 10-10-4.47-10-10 4.47-10 10-10zm3.59 5L465 13.59 461.41 10 460 11.41l3.59 3.59-3.59 3.59 1.41 1.41 3.59-3.59 3.59 3.59 1.41-1.41-3.59-3.59 3.59-3.59-1.41-1.41z\"\n id=\"b\"\n />\n <filter\n x=\"-30%\"\n y=\"-30%\"\n width=\"160%\"\n height=\"160%\"\n filterUnits=\"objectBoundingBox\"\n id=\"a\"\n >\n <feOffset in=\"SourceAlpha\" result=\"shadowOffsetOuter1\" />\n <feGaussianBlur\n stdDeviation=\"2\"\n in=\"shadowOffsetOuter1\"\n result=\"shadowBlurOuter1\"\n />\n <feColorMatrix\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0\"\n in=\"shadowBlurOuter1\"\n />\n </filter>\n </defs>\n <g transform=\"translate(-451 -1)\" fill-rule=\"nonzero\" fill=\"none\">\n <use fill=\"#000\" filter=\"url(#a)\" xlink:href=\"#b\" />\n <use fill=\"#FFF\" fill-rule=\"evenodd\" xlink:href=\"#b\" />\n </g>\n</svg>\n<svg\n *ngIf=\"icon === 'file'\"\n data-testid=\"file\"\n className=\"rfu-file-icon--small fa-file-fallback\"\n [attr.height]=\"size || 20\"\n [attr.width]=\"size || 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 384 512\"\n>\n <path\n d=\"M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z\"\n fill=\"#414D54\"\n />\n</svg>\n", directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
1348
1670
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: IconComponent, decorators: [{
1349
1671
  type: i0.Component,
1350
1672
  args: [{
@@ -1380,80 +1702,515 @@
1380
1702
  type: i0.Input
1381
1703
  }] } });
1382
1704
 
1383
- var MessageActionsBoxComponent = /** @class */ (function () {
1384
- function MessageActionsBoxComponent(chatClientService, notificationService) {
1385
- this.chatClientService = chatClientService;
1386
- this.notificationService = notificationService;
1387
- this.isOpen = false;
1388
- this.isMine = false;
1389
- this.enabledActions = [];
1390
- this.displayedActionsCount = new i0.EventEmitter();
1705
+ var textareaInjectionToken = new i0.InjectionToken('textareaInjectionToken');
1706
+
1707
+ var TextareaDirective = /** @class */ (function () {
1708
+ function TextareaDirective(viewContainerRef) {
1709
+ this.viewContainerRef = viewContainerRef;
1710
+ this.value = '';
1711
+ this.valueChange = new i0.EventEmitter();
1712
+ this.send = new i0.EventEmitter();
1713
+ this.userMentions = new i0.EventEmitter();
1714
+ this.subscriptions = [];
1391
1715
  }
1392
- MessageActionsBoxComponent.prototype.ngOnChanges = function (changes) {
1393
- if (changes.isMine || changes.enabledActions) {
1394
- var displayedActionsCount = 0;
1395
- if (this.isQuoteVisible) {
1396
- displayedActionsCount++;
1397
- }
1398
- if (this.isEditVisible) {
1399
- displayedActionsCount++;
1400
- }
1401
- if (this.isDeleteVisible) {
1402
- displayedActionsCount++;
1403
- }
1404
- if (this.isMuteVisible) {
1405
- displayedActionsCount++;
1406
- }
1407
- if (this.isFlagVisible) {
1408
- displayedActionsCount++;
1409
- }
1410
- if (this.isPinVisible) {
1411
- displayedActionsCount++;
1716
+ TextareaDirective.prototype.ngOnChanges = function (changes) {
1717
+ var _this = this;
1718
+ if (!this.componentRef) {
1719
+ return;
1720
+ }
1721
+ if (changes.componentRef) {
1722
+ this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
1723
+ if (this.componentRef) {
1724
+ this.subscriptions.push(this.componentRef.instance.valueChange.subscribe(function (value) { return _this.valueChange.next(value); }));
1725
+ this.subscriptions.push(this.componentRef.instance.send.subscribe(function (value) { return _this.send.next(value); }));
1726
+ if (this.componentRef.instance.userMentions) {
1727
+ this.subscriptions.push(this.componentRef.instance.userMentions.subscribe(function (value) { return _this.userMentions.next(value); }));
1728
+ }
1412
1729
  }
1413
- this.displayedActionsCount.next(displayedActionsCount);
1414
1730
  }
1731
+ if (changes.areMentionsEnabled) {
1732
+ this.componentRef.instance.areMentionsEnabled = this.areMentionsEnabled;
1733
+ }
1734
+ if (changes.mentionAutocompleteItemTemplate) {
1735
+ this.componentRef.instance.mentionAutocompleteItemTemplate =
1736
+ this.mentionAutocompleteItemTemplate;
1737
+ }
1738
+ if (changes.mentionScope) {
1739
+ this.componentRef.instance.mentionScope = this.mentionScope;
1740
+ }
1741
+ if (changes.value) {
1742
+ this.componentRef.instance.value = this.value;
1743
+ }
1744
+ // ngOnChanges not called for dynamic components since we don't use template binding
1745
+ // eslint-disable-next-line @angular-eslint/no-lifecycle-call
1746
+ this.componentRef.instance.ngOnChanges(changes);
1415
1747
  };
1416
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isQuoteVisible", {
1417
- get: function () {
1418
- return this.enabledActions.indexOf('quote') !== -1;
1419
- },
1420
- enumerable: false,
1421
- configurable: true
1422
- });
1423
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isEditVisible", {
1424
- get: function () {
1425
- return this.enabledActions.indexOf('edit') !== -1;
1426
- },
1427
- enumerable: false,
1428
- configurable: true
1429
- });
1430
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isDeleteVisible", {
1431
- get: function () {
1432
- return this.enabledActions.indexOf('delete') !== -1;
1433
- },
1434
- enumerable: false,
1435
- configurable: true
1436
- });
1437
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isMuteVisible", {
1438
- get: function () {
1439
- return this.enabledActions.indexOf('mute') !== -1;
1440
- },
1441
- enumerable: false,
1442
- configurable: true
1443
- });
1444
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isFlagVisible", {
1445
- get: function () {
1446
- return this.enabledActions.indexOf('flag') !== -1 && !this.isMine;
1447
- },
1448
- enumerable: false,
1449
- configurable: true
1450
- });
1451
- Object.defineProperty(MessageActionsBoxComponent.prototype, "isPinVisible", {
1452
- get: function () {
1453
- return this.enabledActions.indexOf('pin') !== -1;
1454
- },
1455
- enumerable: false,
1456
- configurable: true
1748
+ return TextareaDirective;
1749
+ }());
1750
+ TextareaDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaDirective, deps: [{ token: i0__namespace.ViewContainerRef }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1751
+ TextareaDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: TextareaDirective, selector: "[streamTextarea]", inputs: { componentRef: "componentRef", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", mentionScope: "mentionScope", value: "value" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, usesOnChanges: true, ngImport: i0__namespace });
1752
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaDirective, decorators: [{
1753
+ type: i0.Directive,
1754
+ args: [{
1755
+ selector: '[streamTextarea]',
1756
+ }]
1757
+ }], ctorParameters: function () { return [{ type: i0__namespace.ViewContainerRef }]; }, propDecorators: { componentRef: [{
1758
+ type: i0.Input
1759
+ }], areMentionsEnabled: [{
1760
+ type: i0.Input
1761
+ }], mentionAutocompleteItemTemplate: [{
1762
+ type: i0.Input
1763
+ }], mentionScope: [{
1764
+ type: i0.Input
1765
+ }], value: [{
1766
+ type: i0.Input
1767
+ }], valueChange: [{
1768
+ type: i0.Output
1769
+ }], send: [{
1770
+ type: i0.Output
1771
+ }], userMentions: [{
1772
+ type: i0.Output
1773
+ }] } });
1774
+
1775
+ var MessageInputConfigService = /** @class */ (function () {
1776
+ function MessageInputConfigService() {
1777
+ this.isFileUploadEnabled = true;
1778
+ this.areMentionsEnabled = true;
1779
+ this.isMultipleFileUploadEnabled = true;
1780
+ this.mentionScope = 'channel';
1781
+ }
1782
+ return MessageInputConfigService;
1783
+ }());
1784
+ MessageInputConfigService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputConfigService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1785
+ MessageInputConfigService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputConfigService, providedIn: 'root' });
1786
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputConfigService, decorators: [{
1787
+ type: i0.Injectable,
1788
+ args: [{
1789
+ providedIn: 'root',
1790
+ }]
1791
+ }], ctorParameters: function () { return []; } });
1792
+
1793
+ var AttachmentPreviewListComponent = /** @class */ (function () {
1794
+ function AttachmentPreviewListComponent(attachmentService) {
1795
+ this.attachmentService = attachmentService;
1796
+ this.attachmentUploads$ = this.attachmentService.attachmentUploads$;
1797
+ }
1798
+ AttachmentPreviewListComponent.prototype.retryAttachmentUpload = function (file) {
1799
+ return __awaiter(this, void 0, void 0, function () {
1800
+ return __generator(this, function (_a) {
1801
+ switch (_a.label) {
1802
+ case 0: return [4 /*yield*/, this.attachmentService.retryAttachmentUpload(file)];
1803
+ case 1:
1804
+ _a.sent();
1805
+ return [2 /*return*/];
1806
+ }
1807
+ });
1808
+ });
1809
+ };
1810
+ AttachmentPreviewListComponent.prototype.deleteAttachment = function (upload) {
1811
+ return __awaiter(this, void 0, void 0, function () {
1812
+ return __generator(this, function (_a) {
1813
+ switch (_a.label) {
1814
+ case 0: return [4 /*yield*/, this.attachmentService.deleteAttachment(upload)];
1815
+ case 1:
1816
+ _a.sent();
1817
+ return [2 /*return*/];
1818
+ }
1819
+ });
1820
+ });
1821
+ };
1822
+ AttachmentPreviewListComponent.prototype.trackByFile = function (_, item) {
1823
+ return item.file;
1824
+ };
1825
+ return AttachmentPreviewListComponent;
1826
+ }());
1827
+ AttachmentPreviewListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, deps: [{ token: AttachmentService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1828
+ AttachmentPreviewListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list", ngImport: i0__namespace, template: "<div class=\"rfu-image-previewer\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads$ | async;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"attachmentUpload.url ? null : $event.preventDefault()\"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n \u2718\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i5__namespace.AsyncPipe } });
1829
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AttachmentPreviewListComponent, decorators: [{
1830
+ type: i0.Component,
1831
+ args: [{
1832
+ selector: 'stream-attachment-preview-list',
1833
+ templateUrl: './attachment-preview-list.component.html',
1834
+ styles: [],
1835
+ }]
1836
+ }], ctorParameters: function () { return [{ type: AttachmentService }]; } });
1837
+
1838
+ var MessageInputComponent = /** @class */ (function () {
1839
+ function MessageInputComponent(channelService, notificationService, attachmentService, configService, textareaType, componentFactoryResolver) {
1840
+ var _this = this;
1841
+ this.channelService = channelService;
1842
+ this.notificationService = notificationService;
1843
+ this.attachmentService = attachmentService;
1844
+ this.configService = configService;
1845
+ this.textareaType = textareaType;
1846
+ this.componentFactoryResolver = componentFactoryResolver;
1847
+ this.messageUpdate = new i0.EventEmitter();
1848
+ this.textareaValue = '';
1849
+ this.mentionedUsers = [];
1850
+ this.subscriptions = [];
1851
+ this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
1852
+ var _a;
1853
+ _this.textareaValue = '';
1854
+ _this.attachmentService.resetAttachmentUploads();
1855
+ var capabilities = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
1856
+ if (capabilities) {
1857
+ _this.isFileUploadAuthorized =
1858
+ capabilities.indexOf('upload-file') !== -1;
1859
+ }
1860
+ }));
1861
+ this.subscriptions.push(this.attachmentService.attachmentUploadInProgressCounter$.subscribe(function (counter) {
1862
+ if (counter === 0 && _this.hideNotification) {
1863
+ _this.hideNotification();
1864
+ _this.hideNotification = undefined;
1865
+ }
1866
+ }));
1867
+ this.attachmentUploads$ = this.attachmentService.attachmentUploads$;
1868
+ this.isFileUploadEnabled = this.configService.isFileUploadEnabled;
1869
+ this.acceptedFileTypes = this.configService.acceptedFileTypes;
1870
+ this.isMultipleFileUploadEnabled =
1871
+ this.configService.isMultipleFileUploadEnabled;
1872
+ this.areMentionsEnabled = this.configService.areMentionsEnabled;
1873
+ this.mentionAutocompleteItemTemplate =
1874
+ this.configService.mentionAutocompleteItemTemplate;
1875
+ this.mentionScope = this.configService.mentionScope;
1876
+ }
1877
+ MessageInputComponent.prototype.ngOnInit = function () {
1878
+ var componentFactory = this.componentFactoryResolver.resolveComponentFactory(this.textareaType);
1879
+ this.textareaRef =
1880
+ this.textareaAnchor.viewContainerRef.createComponent(componentFactory);
1881
+ };
1882
+ MessageInputComponent.prototype.ngOnChanges = function (changes) {
1883
+ if (changes.message) {
1884
+ this.attachmentService.resetAttachmentUploads();
1885
+ if (this.isUpdate) {
1886
+ this.attachmentService.createFromAttachments(this.message.attachments || []);
1887
+ this.textareaValue = this.message.text || '';
1888
+ }
1889
+ }
1890
+ if (changes.isFileUploadEnabled) {
1891
+ this.configService.isFileUploadEnabled = this.isFileUploadEnabled;
1892
+ }
1893
+ if (changes.acceptedFileTypes) {
1894
+ this.configService.acceptedFileTypes = this.acceptedFileTypes;
1895
+ }
1896
+ if (changes.isMultipleFileUploadEnabled) {
1897
+ this.configService.isMultipleFileUploadEnabled =
1898
+ this.isMultipleFileUploadEnabled;
1899
+ }
1900
+ if (changes.areMentionsEnabled) {
1901
+ this.configService.areMentionsEnabled = this.areMentionsEnabled;
1902
+ }
1903
+ if (changes.mentionAutocompleteItemTemplate) {
1904
+ this.configService.mentionAutocompleteItemTemplate =
1905
+ this.mentionAutocompleteItemTemplate;
1906
+ }
1907
+ if (changes.mentionScope) {
1908
+ this.configService.mentionScope = this.mentionScope;
1909
+ }
1910
+ };
1911
+ MessageInputComponent.prototype.ngOnDestroy = function () {
1912
+ this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
1913
+ };
1914
+ MessageInputComponent.prototype.messageSent = function () {
1915
+ return __awaiter(this, void 0, void 0, function () {
1916
+ var attachmentUploadInProgressCounter, attachments, text, error_1;
1917
+ return __generator(this, function (_b) {
1918
+ switch (_b.label) {
1919
+ case 0:
1920
+ this.attachmentService.attachmentUploadInProgressCounter$
1921
+ .pipe(operators.first())
1922
+ .subscribe(function (counter) { return (attachmentUploadInProgressCounter = counter); });
1923
+ if (attachmentUploadInProgressCounter > 0) {
1924
+ if (!this.hideNotification) {
1925
+ this.hideNotification =
1926
+ this.notificationService.addPermanentNotification('streamChat.Wait until all attachments have uploaded');
1927
+ }
1928
+ return [2 /*return*/];
1929
+ }
1930
+ attachments = this.attachmentService.mapToAttachments();
1931
+ text = this.textareaValue;
1932
+ if (!text && (!attachments || attachments.length === 0)) {
1933
+ return [2 /*return*/];
1934
+ }
1935
+ if (!this.isUpdate) {
1936
+ this.textareaValue = '';
1937
+ }
1938
+ _b.label = 1;
1939
+ case 1:
1940
+ _b.trys.push([1, 3, , 4]);
1941
+ return [4 /*yield*/, (this.isUpdate
1942
+ ? this.channelService.updateMessage(Object.assign(Object.assign({}, this.message), { text: text, attachments: attachments }))
1943
+ : this.channelService.sendMessage(text, attachments, this.mentionedUsers))];
1944
+ case 2:
1945
+ _b.sent();
1946
+ this.messageUpdate.emit();
1947
+ if (!this.isUpdate) {
1948
+ this.attachmentService.resetAttachmentUploads();
1949
+ }
1950
+ return [3 /*break*/, 4];
1951
+ case 3:
1952
+ error_1 = _b.sent();
1953
+ if (this.isUpdate) {
1954
+ this.notificationService.addTemporaryNotification('streamChat.Edit message request failed');
1955
+ }
1956
+ return [3 /*break*/, 4];
1957
+ case 4: return [2 /*return*/];
1958
+ }
1959
+ });
1960
+ });
1961
+ };
1962
+ Object.defineProperty(MessageInputComponent.prototype, "accept", {
1963
+ get: function () {
1964
+ var _a;
1965
+ return this.acceptedFileTypes ? (_a = this.acceptedFileTypes) === null || _a === void 0 ? void 0 : _a.join(',') : '';
1966
+ },
1967
+ enumerable: false,
1968
+ configurable: true
1969
+ });
1970
+ MessageInputComponent.prototype.filesSelected = function (fileList) {
1971
+ return __awaiter(this, void 0, void 0, function () {
1972
+ return __generator(this, function (_b) {
1973
+ switch (_b.label) {
1974
+ case 0: return [4 /*yield*/, this.attachmentService.filesSelected(fileList)];
1975
+ case 1:
1976
+ _b.sent();
1977
+ this.clearFileInput();
1978
+ return [2 /*return*/];
1979
+ }
1980
+ });
1981
+ });
1982
+ };
1983
+ MessageInputComponent.prototype.clearFileInput = function () {
1984
+ this.fileInput.nativeElement.value = '';
1985
+ };
1986
+ Object.defineProperty(MessageInputComponent.prototype, "isUpdate", {
1987
+ get: function () {
1988
+ return !!this.message;
1989
+ },
1990
+ enumerable: false,
1991
+ configurable: true
1992
+ });
1993
+ return MessageInputComponent;
1994
+ }());
1995
+ MessageInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }, { token: AttachmentService }, { token: MessageInputConfigService }, { token: textareaInjectionToken }, { token: i0__namespace.ComponentFactoryResolver }], target: i0__namespace.ɵɵFactoryTarget.Component });
1996
+ MessageInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", areMentionsEnabled: "areMentionsEnabled", mentionScope: "mentionScope", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled", message: "message" }, outputs: { messageUpdate: "messageUpdate" }, providers: [AttachmentService], viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }, { propertyName: "textareaAnchor", first: true, predicate: TextareaDirective, descendants: true, static: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n class=\"str-chat__input-flat\"\n [class.str-chat__input-flat-has-attachments]=\"\n (attachmentUploads$ | async)!.length > 0\n \"\n>\n <div class=\"str-chat__input-flat-wrapper\">\n <div class=\"str-chat__input-flat--textarea-wrapper\">\n <stream-attachment-preview-list\n class=\"rfu-image-previewer-angular-host\"\n ></stream-attachment-preview-list>\n <div class=\"rta str-chat__textarea\">\n <ng-template\n streamTextarea\n [(value)]=\"textareaValue\"\n (send)=\"messageSent()\"\n [componentRef]=\"textareaRef\"\n (userMentions)=\"mentionedUsers = $event\"\n [areMentionsEnabled]=\"areMentionsEnabled\"\n [mentionAutocompleteItemTemplate]=\"mentionAutocompleteItemTemplate\"\n [mentionScope]=\"mentionScope\"\n ></ng-template>\n </div>\n <div\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized\"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n", components: [{ type: AttachmentPreviewListComponent, selector: "stream-attachment-preview-list" }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: TextareaDirective, selector: "[streamTextarea]", inputs: ["componentRef", "areMentionsEnabled", "mentionAutocompleteItemTemplate", "mentionScope", "value"], outputs: ["valueChange", "send", "userMentions"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i5__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
1997
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
1998
+ type: i0.Component,
1999
+ args: [{
2000
+ selector: 'stream-message-input',
2001
+ templateUrl: './message-input.component.html',
2002
+ styles: [],
2003
+ providers: [AttachmentService],
2004
+ }]
2005
+ }], ctorParameters: function () {
2006
+ return [{ type: ChannelService }, { type: NotificationService }, { type: AttachmentService }, { type: MessageInputConfigService }, { type: i0__namespace.Type, decorators: [{
2007
+ type: i0.Inject,
2008
+ args: [textareaInjectionToken]
2009
+ }] }, { type: i0__namespace.ComponentFactoryResolver }];
2010
+ }, propDecorators: { isFileUploadEnabled: [{
2011
+ type: i0.Input
2012
+ }], areMentionsEnabled: [{
2013
+ type: i0.Input
2014
+ }], mentionScope: [{
2015
+ type: i0.Input
2016
+ }], mentionAutocompleteItemTemplate: [{
2017
+ type: i0.Input
2018
+ }], acceptedFileTypes: [{
2019
+ type: i0.Input
2020
+ }], isMultipleFileUploadEnabled: [{
2021
+ type: i0.Input
2022
+ }], message: [{
2023
+ type: i0.Input
2024
+ }], messageUpdate: [{
2025
+ type: i0.Output
2026
+ }], fileInput: [{
2027
+ type: i0.ViewChild,
2028
+ args: ['fileInput']
2029
+ }], textareaAnchor: [{
2030
+ type: i0.ViewChild,
2031
+ args: [TextareaDirective, { static: true }]
2032
+ }] } });
2033
+
2034
+ var ModalComponent = /** @class */ (function () {
2035
+ function ModalComponent() {
2036
+ var _this = this;
2037
+ this.isOpen = false;
2038
+ this.isOpenChange = new i0.EventEmitter();
2039
+ this.watchForEscPress = function (event) {
2040
+ if (event.key === 'Escape') {
2041
+ _this.close();
2042
+ }
2043
+ };
2044
+ this.stopWatchForEscPress = function () {
2045
+ window.removeEventListener('keyup', _this.watchForEscPress);
2046
+ };
2047
+ this.watchForOutsideClicks = function (event) {
2048
+ var _a;
2049
+ if (!((_a = _this.content) === null || _a === void 0 ? void 0 : _a.nativeElement.contains(event.target))) {
2050
+ _this.close();
2051
+ }
2052
+ };
2053
+ }
2054
+ ModalComponent.prototype.ngOnChanges = function (changes) {
2055
+ var _this = this;
2056
+ if (changes.isOpen) {
2057
+ if (this.isOpen) {
2058
+ window.addEventListener('keyup', this.watchForEscPress);
2059
+ setTimeout(function () { return window.addEventListener('click', _this.watchForOutsideClicks); }, 0);
2060
+ }
2061
+ else {
2062
+ this.stopWatchForOutsideClicks();
2063
+ this.stopWatchForEscPress();
2064
+ }
2065
+ }
2066
+ };
2067
+ ModalComponent.prototype.close = function () {
2068
+ this.isOpen = false;
2069
+ this.isOpenChange.emit(false);
2070
+ this.stopWatchForOutsideClicks();
2071
+ this.stopWatchForEscPress();
2072
+ };
2073
+ ModalComponent.prototype.stopWatchForOutsideClicks = function () {
2074
+ window.removeEventListener('click', this.watchForOutsideClicks);
2075
+ };
2076
+ return ModalComponent;
2077
+ }());
2078
+ ModalComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2079
+ ModalComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ModalComponent, selector: "stream-modal", inputs: { isOpen: "isOpen" }, outputs: { isOpenChange: "isOpenChange" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"modal\"\n class=\"str-chat__modal str-chat__modal--{{ isOpen ? 'open' : 'close' }}\"\n>\n <div\n data-testid=\"close\"\n class=\"str-chat__modal__close-button\"\n (click)=\"close()\"\n (keyup.enter)=\"close()\"\n translate\n >\n streamChat.Close\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n <div class=\"str-chat__modal__inner\" #content>\n <ng-content></ng-content>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }] });
2080
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ModalComponent, decorators: [{
2081
+ type: i0.Component,
2082
+ args: [{
2083
+ selector: 'stream-modal',
2084
+ templateUrl: './modal.component.html',
2085
+ styles: [],
2086
+ }]
2087
+ }], ctorParameters: function () { return []; }, propDecorators: { isOpen: [{
2088
+ type: i0.Input
2089
+ }], isOpenChange: [{
2090
+ type: i0.Output
2091
+ }], content: [{
2092
+ type: i0.ViewChild,
2093
+ args: ['content']
2094
+ }] } });
2095
+
2096
+ var NotificationComponent = /** @class */ (function () {
2097
+ function NotificationComponent() {
2098
+ }
2099
+ return NotificationComponent;
2100
+ }());
2101
+ NotificationComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2102
+ NotificationComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationComponent, selector: "stream-notification", inputs: { type: "type" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__custom-notification notification-{{ type }}\"\n data-testid=\"custom-notification\"\n>\n <ng-content></ng-content>\n</div>\n" });
2103
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationComponent, decorators: [{
2104
+ type: i0.Component,
2105
+ args: [{
2106
+ selector: 'stream-notification',
2107
+ templateUrl: './notification.component.html',
2108
+ styles: [],
2109
+ }]
2110
+ }], ctorParameters: function () { return []; }, propDecorators: { type: [{
2111
+ type: i0.Input
2112
+ }] } });
2113
+
2114
+ var NotificationListComponent = /** @class */ (function () {
2115
+ function NotificationListComponent(notificationService) {
2116
+ this.notificationService = notificationService;
2117
+ this.notifications$ = this.notificationService.notifications$;
2118
+ }
2119
+ NotificationListComponent.prototype.trackByItem = function (_, item) {
2120
+ return item;
2121
+ };
2122
+ return NotificationListComponent;
2123
+ }());
2124
+ NotificationListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, deps: [{ token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2125
+ NotificationListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0__namespace, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackByItem\"\n [type]=\"notification.type\"\n ><div data-testclass=\"notification-content\" translate>\n {{ notification.text }}\n </div></stream-notification\n >\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i5__namespace.AsyncPipe } });
2126
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
2127
+ type: i0.Component,
2128
+ args: [{
2129
+ selector: 'stream-notification-list',
2130
+ templateUrl: './notification-list.component.html',
2131
+ styles: [],
2132
+ }]
2133
+ }], ctorParameters: function () { return [{ type: NotificationService }]; } });
2134
+
2135
+ var MessageActionsBoxComponent = /** @class */ (function () {
2136
+ function MessageActionsBoxComponent(chatClientService, notificationService, channelService) {
2137
+ this.chatClientService = chatClientService;
2138
+ this.notificationService = notificationService;
2139
+ this.channelService = channelService;
2140
+ this.isOpen = false;
2141
+ this.isMine = false;
2142
+ this.enabledActions = [];
2143
+ this.displayedActionsCount = new i0.EventEmitter();
2144
+ this.isEditing = new i0.EventEmitter();
2145
+ this.isEditModalOpen = false;
2146
+ }
2147
+ MessageActionsBoxComponent.prototype.ngOnChanges = function (changes) {
2148
+ if (changes.isMine || changes.enabledActions) {
2149
+ var displayedActionsCount = 0;
2150
+ if (this.isQuoteVisible) {
2151
+ displayedActionsCount++;
2152
+ }
2153
+ if (this.isEditVisible) {
2154
+ displayedActionsCount++;
2155
+ }
2156
+ if (this.isDeleteVisible) {
2157
+ displayedActionsCount++;
2158
+ }
2159
+ if (this.isMuteVisible) {
2160
+ displayedActionsCount++;
2161
+ }
2162
+ if (this.isFlagVisible) {
2163
+ displayedActionsCount++;
2164
+ }
2165
+ if (this.isPinVisible) {
2166
+ displayedActionsCount++;
2167
+ }
2168
+ this.displayedActionsCount.next(displayedActionsCount);
2169
+ }
2170
+ };
2171
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isQuoteVisible", {
2172
+ get: function () {
2173
+ return this.enabledActions.indexOf('quote') !== -1;
2174
+ },
2175
+ enumerable: false,
2176
+ configurable: true
2177
+ });
2178
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isEditVisible", {
2179
+ get: function () {
2180
+ return ((this.enabledActions.indexOf('edit') !== -1 && this.isMine) ||
2181
+ this.enabledActions.indexOf('edit-any') !== -1);
2182
+ },
2183
+ enumerable: false,
2184
+ configurable: true
2185
+ });
2186
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isDeleteVisible", {
2187
+ get: function () {
2188
+ return ((this.enabledActions.indexOf('delete') !== -1 && this.isMine) ||
2189
+ this.enabledActions.indexOf('delete-any') !== -1);
2190
+ },
2191
+ enumerable: false,
2192
+ configurable: true
2193
+ });
2194
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isMuteVisible", {
2195
+ get: function () {
2196
+ return this.enabledActions.indexOf('mute') !== -1;
2197
+ },
2198
+ enumerable: false,
2199
+ configurable: true
2200
+ });
2201
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isFlagVisible", {
2202
+ get: function () {
2203
+ return this.enabledActions.indexOf('flag') !== -1 && !this.isMine;
2204
+ },
2205
+ enumerable: false,
2206
+ configurable: true
2207
+ });
2208
+ Object.defineProperty(MessageActionsBoxComponent.prototype, "isPinVisible", {
2209
+ get: function () {
2210
+ return this.enabledActions.indexOf('pin') !== -1;
2211
+ },
2212
+ enumerable: false,
2213
+ configurable: true
1457
2214
  });
1458
2215
  MessageActionsBoxComponent.prototype.pinClicked = function () {
1459
2216
  alert('Feature not yet implemented');
@@ -1461,17 +2218,17 @@
1461
2218
  MessageActionsBoxComponent.prototype.flagClicked = function () {
1462
2219
  return __awaiter(this, void 0, void 0, function () {
1463
2220
  var err_1;
1464
- return __generator(this, function (_a) {
1465
- switch (_a.label) {
2221
+ return __generator(this, function (_b) {
2222
+ switch (_b.label) {
1466
2223
  case 0:
1467
- _a.trys.push([0, 2, , 3]);
2224
+ _b.trys.push([0, 2, , 3]);
1468
2225
  return [4 /*yield*/, this.chatClientService.flagMessage(this.message.id)];
1469
2226
  case 1:
1470
- _a.sent();
2227
+ _b.sent();
1471
2228
  this.notificationService.addTemporaryNotification('streamChat.Message has been successfully flagged', 'success');
1472
2229
  return [3 /*break*/, 3];
1473
2230
  case 2:
1474
- err_1 = _a.sent();
2231
+ err_1 = _b.sent();
1475
2232
  this.notificationService.addTemporaryNotification('streamChat.Error adding flag');
1476
2233
  return [3 /*break*/, 3];
1477
2234
  case 3: return [2 /*return*/];
@@ -1486,15 +2243,41 @@
1486
2243
  alert('Feature not yet implemented');
1487
2244
  };
1488
2245
  MessageActionsBoxComponent.prototype.editClicked = function () {
1489
- alert('Feature not yet implemented');
2246
+ this.isEditing.emit(true);
2247
+ this.isEditModalOpen = true;
2248
+ };
2249
+ MessageActionsBoxComponent.prototype.sendClicked = function () {
2250
+ var _a;
2251
+ (_a = this.messageInput) === null || _a === void 0 ? void 0 : _a.messageSent();
2252
+ };
2253
+ MessageActionsBoxComponent.prototype.modalClosed = function () {
2254
+ this.isEditModalOpen = false;
2255
+ this.isEditing.emit(false);
1490
2256
  };
1491
2257
  MessageActionsBoxComponent.prototype.deleteClicked = function () {
1492
- alert('Feature not yet implemented');
2258
+ return __awaiter(this, void 0, void 0, function () {
2259
+ var error_1;
2260
+ return __generator(this, function (_b) {
2261
+ switch (_b.label) {
2262
+ case 0:
2263
+ _b.trys.push([0, 2, , 3]);
2264
+ return [4 /*yield*/, this.channelService.deleteMessage(this.message)];
2265
+ case 1:
2266
+ _b.sent();
2267
+ return [3 /*break*/, 3];
2268
+ case 2:
2269
+ error_1 = _b.sent();
2270
+ this.notificationService.addTemporaryNotification('streamChat.Error deleting message');
2271
+ return [3 /*break*/, 3];
2272
+ case 3: return [2 /*return*/];
2273
+ }
2274
+ });
2275
+ });
1493
2276
  };
1494
2277
  return MessageActionsBoxComponent;
1495
2278
  }());
1496
- MessageActionsBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, deps: [{ token: ChatClientService }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1497
- MessageActionsBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { isOpen: "isOpen", isMine: "isMine", message: "message", enabledActions: "enabledActions" }, outputs: { displayedActionsCount: "displayedActionsCount" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n", directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "translate": i4__namespace.TranslatePipe } });
2279
+ MessageActionsBoxComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, deps: [{ token: ChatClientService }, { token: NotificationService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2280
+ MessageActionsBoxComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: { isOpen: "isOpen", isMine: "isMine", message: "message", enabledActions: "enabledActions" }, outputs: { displayedActionsCount: "displayedActionsCount", isEditing: "isEditing" }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: MessageInputComponent, descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<div\n data-testid=\"action-box\"\n class=\"str-chat__message-actions-box\"\n [class.str-chat__message-actions-box--open]=\"isOpen\"\n [class.str-chat__message-actions-box--mine]=\"isMine\"\n>\n <ul class=\"str-chat__message-actions-list\">\n <button\n data-testid=\"quote-action\"\n *ngIf=\"isQuoteVisible\"\n (click)=\"quoteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Reply\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"pin-action\"\n *ngIf=\"isPinVisible\"\n (click)=\"pinClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{\n (message?.pinned ? \"streamChat.Unpin\" : \"streamChat.Pin\") | translate\n }}\n </li>\n </button>\n <button\n data-testid=\"flag-action\"\n *ngIf=\"isFlagVisible\"\n (click)=\"flagClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Flag\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"mute-action\"\n *ngIf=\"isMuteVisible\"\n (click)=\"muteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Mute\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"edit-action\"\n *ngIf=\"isEditVisible\"\n (click)=\"editClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Edit Message\" | translate }}\n </li>\n </button>\n <button\n data-testid=\"delete-action\"\n *ngIf=\"isDeleteVisible\"\n (click)=\"deleteClicked()\"\n >\n <li class=\"str-chat__message-actions-list-item\">\n {{ \"streamChat.Delete\" | translate }}\n </li>\n </button>\n </ul>\n</div>\n\n<stream-modal\n [isOpen]=\"isEditModalOpen\"\n (isOpenChange)=\"\n isEditModalOpen = $event; isEditModalOpen ? '' : modalClosed()\n \"\n>\n <div class=\"str-chat__edit-message-form\" *ngIf=\"isEditModalOpen\">\n <stream-message-input\n [message]=\"message\"\n (messageUpdate)=\"modalClosed()\"\n ></stream-message-input>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__message-team-form-footer\">\n <div></div>\n <div>\n <button translate data-testid=\"cancel-button\" (click)=\"modalClosed()\">\n streamChat.Cancel\n </button>\n <button\n type=\"submit\"\n translate\n data-testid=\"send-button\"\n (click)=\"sendClicked()\"\n (keyup.enter)=\"sendClicked()\"\n >\n streamChat.Send\n </button>\n </div>\n </div>\n </div>\n</stream-modal>\n", components: [{ type: ModalComponent, selector: "stream-modal", inputs: ["isOpen"], outputs: ["isOpenChange"] }, { type: MessageInputComponent, selector: "stream-message-input", inputs: ["isFileUploadEnabled", "areMentionsEnabled", "mentionScope", "mentionAutocompleteItemTemplate", "acceptedFileTypes", "isMultipleFileUploadEnabled", "message"], outputs: ["messageUpdate"] }, { type: NotificationListComponent, selector: "stream-notification-list" }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
1498
2281
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageActionsBoxComponent, decorators: [{
1499
2282
  type: i0.Component,
1500
2283
  args: [{
@@ -1502,7 +2285,7 @@
1502
2285
  templateUrl: './message-actions-box.component.html',
1503
2286
  styles: [],
1504
2287
  }]
1505
- }], ctorParameters: function () { return [{ type: ChatClientService }, { type: NotificationService }]; }, propDecorators: { isOpen: [{
2288
+ }], ctorParameters: function () { return [{ type: ChatClientService }, { type: NotificationService }, { type: ChannelService }]; }, propDecorators: { isOpen: [{
1506
2289
  type: i0.Input
1507
2290
  }], isMine: [{
1508
2291
  type: i0.Input
@@ -1512,6 +2295,11 @@
1512
2295
  type: i0.Input
1513
2296
  }], displayedActionsCount: [{
1514
2297
  type: i0.Output
2298
+ }], isEditing: [{
2299
+ type: i0.Output
2300
+ }], messageInput: [{
2301
+ type: i0.ViewChild,
2302
+ args: [MessageInputComponent]
1515
2303
  }] } });
1516
2304
 
1517
2305
  var ChannelComponent = /** @class */ (function () {
@@ -1628,7 +2416,7 @@
1628
2416
  return ChannelHeaderComponent;
1629
2417
  }());
1630
2418
  ChannelHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1631
- ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{'streamChat.{{ watcherCount }} online' | translate:watcherCountParam}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i4__namespace.TranslatePipe } });
2419
+ ChannelHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelHeaderComponent, selector: "stream-channel-header", ngImport: i0__namespace, template: "<div class=\"str-chat__header-livestream\">\n <div\n class=\"str-chat__header-hamburger\"\n (click)=\"toggleMenu($event)\"\n (keyup.enter)=\"toggleMenu($event)\"\n >\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n <span class=\"str-chat__header-hamburger--line\"></span>\n </div>\n <stream-avatar\n imageUrl=\"{{ activeChannel?.data?.image }}\"\n name=\"{{ activeChannel?.data?.name }}\"\n ></stream-avatar>\n <div class=\"str-chat__header-livestream-left\">\n <p class=\"str-chat__header-livestream-left--title\">\n {{ activeChannel?.data?.name }}\n </p>\n <p class=\"str-chat__header-livestream-left--members\">\n {{'streamChat.{{ memberCount }} members' | translate:memberCountParam}}\n {{'streamChat.{{ watcherCount }} online' | translate:watcherCountParam}}\n </p>\n </div>\n</div>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
1632
2420
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelHeaderComponent, decorators: [{
1633
2421
  type: i0.Component,
1634
2422
  args: [{
@@ -1718,7 +2506,7 @@
1718
2506
  return ChannelPreviewComponent;
1719
2507
  }());
1720
2508
  ChannelPreviewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, deps: [{ token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1721
- ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i4__namespace.TranslatePipe } });
2509
+ ChannelPreviewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: { channel: "channel" }, ngImport: i0__namespace, template: "<button\n class=\"str-chat__channel-preview-messenger\"\n [class.str-chat__channel-preview-messenger--active]=\"isActive\"\n [class.str-chat__channel-preview-messenger--unread]=\"isUnread\"\n (click)=\"setAsActiveChannel()\"\n data-testid=\"channel-preview-container\"\n>\n <div class=\"str-chat__channel-preview-messenger--left\">\n <stream-avatar\n imageUrl=\"{{ avatarImage }}\"\n name=\"{{ avatarName }}\"\n [size]=\"40\"\n ></stream-avatar>\n </div>\n <div class=\"str-chat__channel-preview-messenger--right\">\n <div class=\"str-chat__channel-preview-messenger--name\">\n <span data-testid=\"channel-preview-title\">{{ title }}</span>\n </div>\n <div\n data-testid=\"latest-message\"\n class=\"str-chat__channel-preview-messenger--last-message\"\n >\n {{ latestMessage | translate }}\n </div>\n </div>\n</button>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
1722
2510
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelPreviewComponent, decorators: [{
1723
2511
  type: i0.Component,
1724
2512
  args: [{
@@ -1768,7 +2556,7 @@
1768
2556
  return ChannelListComponent;
1769
2557
  }());
1770
2558
  ChannelListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, deps: [{ token: ChannelService }, { token: ChannelListToggleService }], target: i0__namespace.ɵɵFactoryTarget.Component });
1771
- ChannelListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelListComponent, selector: "stream-channel-list", inputs: { customChannelPreviewTemplate: "customChannelPreviewTemplate" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i5__namespace.AsyncPipe, "translate": i4__namespace.TranslatePipe } });
2559
+ ChannelListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: ChannelListComponent, selector: "stream-channel-list", inputs: { customChannelPreviewTemplate: "customChannelPreviewTemplate" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n data-testid=\"channel-list-container\"\n class=\"str-chat str-chat-channel-list messaging\"\n [class.str-chat-channel-list--open]=\"(isOpen$ | async) === true\"\n>\n <div\n *ngIf=\"\n (isError$ | async) === false && (isInitializing$ | async) === false;\n else statusIndicator\n \"\n class=\"str-chat__channel-list-messenger\"\n >\n <div class=\"str-chat__channel-list-messenger__main\">\n <p\n data-testid=\"empty-channel-list-indicator\"\n *ngIf=\"!(channels$ | async)?.length\"\n >\n {{ \"streamChat.You have no channels currently\" | translate }}\n </p>\n <ng-container\n *ngFor=\"let channel of channels$ | async; trackBy: trackByChannelId\"\n >\n <ng-container\n *ngIf=\"customChannelPreviewTemplate; else defaultTemplate\"\n >\n <div (click)=\"channelSelected()\" (keyup.enter)=\"channelSelected()\">\n <ng-container\n *ngTemplateOutlet=\"\n customChannelPreviewTemplate;\n context: { channel: channel }\n \"\n ></ng-container>\n </div>\n </ng-container>\n <ng-template #defaultTemplate>\n <stream-channel-preview\n data-testclass=\"channel-preview\"\n [channel]=\"channel\"\n (click)=\"channelSelected()\"\n (keyup.enter)=\"channelSelected()\"\n ></stream-channel-preview>\n </ng-template>\n </ng-container>\n <div\n *ngIf=\"hasMoreChannels$ | async\"\n class=\"str-chat__load-more-button\"\n (click)=\"loadMoreChannels()\"\n (keyup.enter)=\"loadMoreChannels()\"\n data-testid=\"load-more\"\n >\n <button\n class=\"str-chat__load-more-button__button\"\n data-testid=\"load-more-button\"\n [disabled]=\"isLoadingMoreChannels\"\n >\n <span *ngIf=\"!isLoadingMoreChannels; else loadingIndicator\">{{\n \"Load more\" | translate\n }}</span>\n <ng-template #loadingIndicator\n ><stream-loading-indicator></stream-loading-indicator\n ></ng-template>\n </button>\n </div>\n </div>\n </div>\n</div>\n\n<ng-template #statusIndicator>\n <ng-container *ngIf=\"isError$ | async\">\n <ng-container *ngTemplateOutlet=\"chatDown\"></ng-container>\n </ng-container>\n <ng-container *ngIf=\"isInitializing$ | async\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n </ng-container>\n</ng-template>\n\n<ng-template #chatDown>\n <div data-testid=\"chatdown-container\" class=\"str-chat__down\">\n <ng-container *ngTemplateOutlet=\"loadingChannels\"></ng-container>\n <div class=\"str-chat__down-main\">\n <stream-icon icon=\"connection-error\"></stream-icon>\n <h1>{{ \"streamChat.Connection error\" | translate }}</h1>\n <h3>\n {{\n \"streamChat.Error connecting to chat, refresh the page to try again.\"\n | translate\n }}\n </h3>\n </div>\n </div>\n</ng-template>\n\n<ng-template #loadingChannels>\n <div data-testid=\"loading-indicator\" class=\"str-chat__loading-channels\">\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n <ng-container *ngTemplateOutlet=\"loadingChannel\"></ng-container>\n </div>\n</ng-template>\n\n<ng-template #loadingChannel>\n <div class=\"str-chat__loading-channels-item\">\n <div class=\"str-chat__loading-channels-avatar\"></div>\n <div class=\"str-chat__loading-channels-meta\">\n <div class=\"str-chat__loading-channels-username\"></div>\n <div class=\"str-chat__loading-channels-status\"></div>\n </div>\n </div>\n</ng-template>\n", components: [{ type: ChannelPreviewComponent, selector: "stream-channel-preview", inputs: ["channel"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i5__namespace.AsyncPipe, "translate": i1__namespace.TranslatePipe } });
1772
2560
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: ChannelListComponent, decorators: [{
1773
2561
  type: i0.Component,
1774
2562
  args: [{
@@ -1992,9 +2780,7 @@
1992
2780
  return index;
1993
2781
  };
1994
2782
  AttachmentListComponent.prototype.isImage = function (attachment) {
1995
- return (attachment.type === 'image' &&
1996
- !attachment.title_link &&
1997
- !attachment.og_scrape_url);
2783
+ return isImageAttachment(attachment);
1998
2784
  };
1999
2785
  AttachmentListComponent.prototype.isFile = function (attachment) {
2000
2786
  return attachment.type === 'file';
@@ -2036,6 +2822,30 @@
2036
2822
  type: i0.Input
2037
2823
  }] } });
2038
2824
 
2825
+ var HighlightMentionsPipe = /** @class */ (function () {
2826
+ function HighlightMentionsPipe() {
2827
+ }
2828
+ HighlightMentionsPipe.prototype.transform = function (value, mentionedUsers) {
2829
+ if (!value || !mentionedUsers) {
2830
+ return value || '';
2831
+ }
2832
+ var result = value;
2833
+ mentionedUsers.forEach(function (u) {
2834
+ result = result.replace(new RegExp("@" + (u.name || u.id), 'g'), "<b>@" + (u.name || u.id) + "</b>");
2835
+ });
2836
+ return result;
2837
+ };
2838
+ return HighlightMentionsPipe;
2839
+ }());
2840
+ HighlightMentionsPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: HighlightMentionsPipe, deps: [], target: i0__namespace.ɵɵFactoryTarget.Pipe });
2841
+ HighlightMentionsPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: HighlightMentionsPipe, name: "highlightMentions" });
2842
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: HighlightMentionsPipe, decorators: [{
2843
+ type: i0.Pipe,
2844
+ args: [{
2845
+ name: 'highlightMentions',
2846
+ }]
2847
+ }] });
2848
+
2039
2849
  var MessageComponent = /** @class */ (function () {
2040
2850
  function MessageComponent(chatClientService, channelService) {
2041
2851
  this.chatClientService = chatClientService;
@@ -2163,7 +2973,7 @@
2163
2973
  return MessageComponent;
2164
2974
  }());
2165
2975
  MessageComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, deps: [{ token: ChatClientService }, { token: ChannelService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2166
- MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container *ngIf=\"isMessageDeliveredAndRead; else deliveredStatus\">\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <div\n *ngIf=\"areReactionsEnabled && canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment\"\n [attachments]=\"message!.attachments!\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n [innerHTML]=\"message?.html || message?.text\"\n ></div>\n </div>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"sending-indicator\">\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"read-indicator\">\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n class=\"str-chat__message-simple-status\"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i4__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i4__namespace.TranslatePipe } });
2976
+ MessageComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageComponent, selector: "stream-message", inputs: { message: "message", enabledMessageActions: "enabledMessageActions", areReactionsEnabled: "areReactionsEnabled", canReactToMessage: "canReactToMessage", isLastSentMessage: "isLastSentMessage" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], ngImport: i0__namespace, template: "<div\n #container\n class=\"str-chat__message-simple str-chat__message str-chat__message--{{\n message?.type\n }} str-chat__message--{{ message?.status }} {{\n message?.text ? 'str-chat__message--has-text' : 'has-no-text'\n }}\"\n [class.str-chat__message--me]=\"isSentByCurrentUser\"\n [class.str-chat__message-simple--me]=\"isSentByCurrentUser\"\n [class.mobile-press]=\"isPressedOnMobile\"\n [class.str-chat__message--has-attachment]=\"hasAttachment\"\n [class.str-chat__message--with-reactions]=\"\n areReactionsEnabled && hasReactions\n \"\n data-testid=\"message-container\"\n>\n <ng-container *ngIf=\"!message?.deleted_at; else deletedMessage\">\n <ng-container *ngIf=\"message?.type !== 'system'; else systemMessage\">\n <ng-container\n *ngIf=\"\n isSentByCurrentUser &&\n ((isLastSentMessage && message?.status === 'received') ||\n message?.status === 'sending')\n \"\n >\n <ng-container *ngIf=\"message?.status === 'sending'; else sentStatus\">\n <ng-container *ngTemplateOutlet=\"sendingStatus\"></ng-container>\n </ng-container>\n <ng-template #sentStatus>\n <ng-container *ngIf=\"isMessageDeliveredAndRead; else deliveredStatus\">\n <ng-container *ngTemplateOutlet=\"readStatus\"></ng-container>\n </ng-container>\n </ng-template>\n </ng-container>\n <stream-avatar\n data-testid=\"avatar\"\n class=\"str-chat-angular__avatar-host\"\n [imageUrl]=\"message?.user?.image\"\n [name]=\"message?.user?.name || message?.user?.id\"\n ></stream-avatar>\n <div class=\"str-chat__message-inner\">\n <div\n class=\"str-chat__message-simple__actions\"\n data-testid=\"message-options\"\n *ngIf=\"areOptionsVisible\"\n >\n <div\n data-testid=\"message-actions-container\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n \"\n [class.str-chat-angular__message-simple__actions__action--options--editing]=\"\n isEditing\n \"\n >\n <stream-message-actions-box\n [isOpen]=\"isActionBoxOpen\"\n [isMine]=\"isSentByCurrentUser\"\n [enabledActions]=\"enabledMessageActions\"\n [message]=\"message\"\n (displayedActionsCount)=\"visibleMessageActionsCount = $event\"\n (isEditing)=\"isEditing = $event; isActionBoxOpen = !isEditing\"\n ></stream-message-actions-box>\n <stream-icon\n *ngIf=\"visibleMessageActionsCount > 0\"\n data-testid=\"action-icon\"\n icon=\"action-icon\"\n (keyup.enter)=\"isActionBoxOpen = !isActionBoxOpen\"\n (click)=\"isActionBoxOpen = !isActionBoxOpen\"\n ></stream-icon>\n </div>\n <div\n *ngIf=\"areReactionsEnabled && canReactToMessage\"\n class=\"\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--reactions\n \"\n data-testid=\"reaction-icon\"\n (click)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n (keyup.enter)=\"isReactionSelectorOpen = !isReactionSelectorOpen\"\n >\n <stream-icon icon=\"reaction-icon\"></stream-icon>\n </div>\n </div>\n <stream-message-reactions\n *ngIf=\"areReactionsEnabled\"\n [messageReactionCounts]=\"message?.reaction_counts || {}\"\n [latestReactions]=\"message?.latest_reactions || []\"\n [(isSelectorOpen)]=\"isReactionSelectorOpen\"\n [messageId]=\"message?.id\"\n [ownReactions]=\"message?.own_reactions || []\"\n ></stream-message-reactions>\n <stream-attachment-list\n *ngIf=\"hasAttachment\"\n [attachments]=\"message!.attachments!\"\n ></stream-attachment-list>\n <div class=\"str-chat__message-text\" *ngIf=\"message?.text\">\n <div\n data-testid=\"inner-message\"\n class=\"\n str-chat__message-text-inner str-chat__message-simple-text-inner\n \"\n [class.str-chat__message-light-text-inner--has-attachment]=\"\n hasAttachment\n \"\n (click)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n (keyup.enter)=\"\n message?.status === 'failed' && message?.errorStatusCode !== 403\n ? resendMessage()\n : undefined\n \"\n >\n <div\n data-testid=\"client-error-message\"\n *ngIf=\"message?.type === 'error'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{ \"streamChat.Error \u00B7 Unsent\" | translate }}\n </div>\n <div\n data-testid=\"error-message\"\n *ngIf=\"message?.status === 'failed'\"\n class=\"str-chat__simple-message--error-message\"\n >\n {{\n (message?.errorStatusCode === 403\n ? \"streamChat.Message Failed \u00B7 Unauthorized\"\n : \"streamChat.Message Failed \u00B7 Click to try again\"\n ) | translate\n }}\n </div>\n <div\n (click)=\"textClicked()\"\n (keyup.enter)=\"textClicked()\"\n data-testid=\"text\"\n [innerHTML]=\"\n message?.html || message?.text\n | highlightMentions: message?.mentioned_users\n \"\n ></div>\n </div>\n </div>\n <div class=\"str-chat__message-data str-chat__message-simple-data\">\n <span\n data-testid=\"sender\"\n *ngIf=\"!isSentByCurrentUser\"\n class=\"str-chat__message-simple-name\"\n >\n {{ message?.user?.name ? message?.user?.name : message?.user?.id }}\n </span>\n <span data-testid=\"date\" class=\"str-chat__message-simple-timestamp\">\n {{ parsedDate }}\n </span>\n </div>\n </div>\n </ng-container>\n </ng-container>\n</div>\n\n<ng-template #sendingStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"sending-indicator\">\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Sending...\" | translate }}\n </div>\n <stream-loading-indicator\n data-testid=\"loading-indicator\"\n ></stream-loading-indicator>\n </span>\n</ng-template>\n<ng-template #readStatus>\n <span class=\"str-chat__message-simple-status\" data-testid=\"read-indicator\">\n <div class=\"str-chat__tooltip\" data-testid=\"read-by-tooltip\">\n {{ readByText }}\n </div>\n <stream-avatar\n class=\"str-chat-angular__avatar-host\"\n data-test-id=\"last-read-user-avatar\"\n [size]=\"15\"\n [imageUrl]=\"lastReadUser?.image\"\n [name]=\"lastReadUser?.name || lastReadUser?.id\"\n ></stream-avatar>\n <span\n data-test-id=\"read-by-length\"\n *ngIf=\"isReadByMultipleUsers\"\n class=\"str-chat__message-simple-status-number\"\n >\n {{ (message?.readBy)!.length }}\n </span>\n </span>\n</ng-template>\n<ng-template #deliveredStatus>\n <span\n class=\"str-chat__message-simple-status\"\n data-testid=\"delivered-indicator\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Delivered\" | translate }}\n </div>\n <stream-icon\n data-testid=\"delivered-icon\"\n icon=\"delivered-icon\"\n ></stream-icon>\n </span>\n</ng-template>\n\n<ng-template #deletedMessage>\n <div data-testid=\"message-deleted-component\">\n <div class=\"str-chat__message--deleted-inner\" translate>\n streamChat.This message was deleted...\n </div>\n </div>\n</ng-template>\n\n<ng-template #systemMessage>\n <div data-testid=\"system-message\" class=\"str-chat__message--system\">\n <div class=\"str-chat__message--system__text\">\n <div class=\"str-chat__message--system__line\"></div>\n <p>{{ message?.text }}</p>\n <div class=\"str-chat__message--system__line\"></div>\n </div>\n <div class=\"str-chat__message--system__date\">\n {{ parsedDate }}\n </div>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }, { type: MessageActionsBoxComponent, selector: "stream-message-actions-box", inputs: ["isOpen", "isMine", "message", "enabledActions"], outputs: ["displayedActionsCount", "isEditing"] }, { type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: MessageReactionsComponent, selector: "stream-message-reactions", inputs: ["messageId", "messageReactionCounts", "isSelectorOpen", "latestReactions", "ownReactions"], outputs: ["isSelectorOpenChange"] }, { type: AttachmentListComponent, selector: "stream-attachment-list", inputs: ["attachments"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i1__namespace.TranslatePipe, "highlightMentions": HighlightMentionsPipe } });
2167
2977
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageComponent, decorators: [{
2168
2978
  type: i0.Component,
2169
2979
  args: [{
@@ -2171,263 +2981,207 @@
2171
2981
  templateUrl: './message.component.html',
2172
2982
  styles: [],
2173
2983
  }]
2174
- }], ctorParameters: function () { return [{ type: ChatClientService }, { type: ChannelService }]; }, propDecorators: { message: [{
2175
- type: i0.Input
2176
- }], enabledMessageActions: [{
2177
- type: i0.Input
2178
- }], areReactionsEnabled: [{
2179
- type: i0.Input
2180
- }], canReactToMessage: [{
2181
- type: i0.Input
2182
- }], isLastSentMessage: [{
2984
+ }], ctorParameters: function () { return [{ type: ChatClientService }, { type: ChannelService }]; }, propDecorators: { message: [{
2985
+ type: i0.Input
2986
+ }], enabledMessageActions: [{
2987
+ type: i0.Input
2988
+ }], areReactionsEnabled: [{
2989
+ type: i0.Input
2990
+ }], canReactToMessage: [{
2991
+ type: i0.Input
2992
+ }], isLastSentMessage: [{
2993
+ type: i0.Input
2994
+ }], container: [{
2995
+ type: i0.ViewChild,
2996
+ args: ['container']
2997
+ }] } });
2998
+
2999
+ var TextareaComponent = /** @class */ (function () {
3000
+ function TextareaComponent() {
3001
+ this.class = 'str-chat__textarea';
3002
+ this.value = '';
3003
+ this.valueChange = new i0.EventEmitter();
3004
+ this.send = new i0.EventEmitter();
3005
+ }
3006
+ // eslint-disable-next-line @angular-eslint/no-empty-lifecycle-method
3007
+ TextareaComponent.prototype.ngOnChanges = function () { };
3008
+ TextareaComponent.prototype.inputChanged = function () {
3009
+ this.valueChange.emit(this.messageInput.nativeElement.value);
3010
+ };
3011
+ TextareaComponent.prototype.sent = function (event) {
3012
+ event.preventDefault();
3013
+ this.send.next();
3014
+ };
3015
+ return TextareaComponent;
3016
+ }());
3017
+ TextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
3018
+ TextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: TextareaComponent, selector: "stream-textarea", inputs: { value: "value" }, outputs: { valueChange: "valueChange", send: "send" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n></textarea>\n", pipes: { "translate": i1__namespace.TranslatePipe } });
3019
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: TextareaComponent, decorators: [{
3020
+ type: i0.Component,
3021
+ args: [{
3022
+ selector: 'stream-textarea',
3023
+ templateUrl: './textarea.component.html',
3024
+ styles: [],
3025
+ }]
3026
+ }], ctorParameters: function () { return []; }, propDecorators: { class: [{
3027
+ type: i0.HostBinding
3028
+ }], value: [{
2183
3029
  type: i0.Input
2184
- }], container: [{
3030
+ }], valueChange: [{
3031
+ type: i0.Output
3032
+ }], send: [{
3033
+ type: i0.Output
3034
+ }], messageInput: [{
2185
3035
  type: i0.ViewChild,
2186
- args: ['container']
3036
+ args: ['input']
2187
3037
  }] } });
2188
3038
 
2189
- var MessageInputComponent = /** @class */ (function () {
2190
- function MessageInputComponent(channelService, notificationService) {
3039
+ var AutocompleteTextareaComponent = /** @class */ (function () {
3040
+ function AutocompleteTextareaComponent(channelService, chatClientService) {
2191
3041
  var _this = this;
2192
3042
  this.channelService = channelService;
2193
- this.notificationService = notificationService;
2194
- this.isFileUploadEnabled = true;
2195
- this.isMultipleFileUploadEnabled = true;
2196
- this.attachmentUploads = [];
2197
- this.attachmentUploadInProgressCounter = 0;
3043
+ this.chatClientService = chatClientService;
3044
+ this.class = 'str-chat__textarea';
3045
+ this.value = '';
3046
+ this.areMentionsEnabled = true;
3047
+ this.mentionScope = 'channel';
3048
+ this.valueChange = new i0.EventEmitter();
3049
+ this.send = new i0.EventEmitter();
3050
+ this.userMentions = new i0.EventEmitter();
3051
+ this.labelKey = 'autocompleteLabel';
3052
+ this.triggerChar = '@';
3053
+ this.autocompleteConfig = {
3054
+ mentions: [],
3055
+ };
2198
3056
  this.subscriptions = [];
2199
- this.subscriptions.push(this.channelService.activeChannel$.subscribe(function (channel) {
2200
- var _a;
2201
- if (_this.messageInput) {
2202
- _this.messageInput.nativeElement.value = '';
2203
- }
2204
- _this.attachmentUploads = [];
2205
- var capabilities = (_a = channel === null || channel === void 0 ? void 0 : channel.data) === null || _a === void 0 ? void 0 : _a.own_capabilities;
2206
- if (capabilities) {
2207
- _this.isFileUploadAuthorized =
2208
- capabilities.indexOf('upload-file') !== -1;
2209
- }
3057
+ this.mentionedUsers = [];
3058
+ this.userMentionConfig = {
3059
+ triggerChar: this.triggerChar,
3060
+ dropUp: true,
3061
+ labelKey: this.labelKey,
3062
+ mentionFilter: this.filter,
3063
+ mentionSelect: function (item, triggerChar) { return _this.mentioned(item, triggerChar); },
3064
+ };
3065
+ this.searchTerm$ = new rxjs.BehaviorSubject('');
3066
+ this.searchTerm$
3067
+ .pipe(operators.debounceTime(300), operators.distinctUntilChanged())
3068
+ .subscribe(function (searchTerm) { return void _this.updateMentionOptions(searchTerm); });
3069
+ this.subscriptions.push(this.channelService.activeChannel$.subscribe(function () {
3070
+ _this.mentionedUsers = [];
3071
+ _this.userMentions.next(__spreadArray([], __read(_this.mentionedUsers)));
3072
+ void _this.updateMentionOptions(_this.searchTerm$.getValue());
2210
3073
  }));
2211
3074
  }
2212
- MessageInputComponent.prototype.ngOnDestroy = function () {
2213
- this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
3075
+ AutocompleteTextareaComponent.prototype.ngOnChanges = function (changes) {
3076
+ if (changes.areMentionsEnabled) {
3077
+ if (this.areMentionsEnabled) {
3078
+ this.autocompleteConfig.mentions = [this.userMentionConfig];
3079
+ this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
3080
+ }
3081
+ else {
3082
+ this.autocompleteConfig.mentions = [];
3083
+ this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
3084
+ }
3085
+ }
3086
+ if (changes.mentionScope) {
3087
+ void this.updateMentionOptions(this.searchTerm$.getValue());
3088
+ }
2214
3089
  };
2215
- MessageInputComponent.prototype.messageSent = function (event) {
2216
- return __awaiter(this, void 0, void 0, function () {
2217
- var text, attachments;
2218
- return __generator(this, function (_b) {
2219
- switch (_b.label) {
2220
- case 0:
2221
- event === null || event === void 0 ? void 0 : event.preventDefault();
2222
- if (this.attachmentUploadInProgressCounter > 0) {
2223
- if (!this.hideNotification) {
2224
- this.hideNotification =
2225
- this.notificationService.addPermanentNotification('streamChat.Wait until all attachments have uploaded');
2226
- }
2227
- return [2 /*return*/];
2228
- }
2229
- text = this.messageInput.nativeElement.value;
2230
- attachments = this.attachmentUploads
2231
- .filter(function (r) { return r.state === 'success'; })
2232
- .map(function (r) {
2233
- var attachment = {
2234
- type: r.type,
2235
- };
2236
- if (r.type === 'image') {
2237
- attachment.fallback = r.file.name;
2238
- attachment.image_url = r.url;
2239
- }
2240
- else {
2241
- attachment.asset_url = r.url;
2242
- attachment.title = r.file.name;
2243
- attachment.file_size = r.file.size;
2244
- }
2245
- return attachment;
2246
- });
2247
- this.messageInput.nativeElement.value = '';
2248
- return [4 /*yield*/, this.channelService.sendMessage(text, attachments)];
2249
- case 1:
2250
- _b.sent();
2251
- this.attachmentUploads = [];
2252
- return [2 /*return*/];
2253
- }
2254
- });
2255
- });
3090
+ AutocompleteTextareaComponent.prototype.filter = function (searchString, items) {
3091
+ return items.filter(function (item) { return item.autocompleteLabel.toLowerCase().includes(searchString.toLowerCase()); });
2256
3092
  };
2257
- Object.defineProperty(MessageInputComponent.prototype, "accept", {
2258
- get: function () {
2259
- var _a;
2260
- return this.acceptedFileTypes ? (_a = this.acceptedFileTypes) === null || _a === void 0 ? void 0 : _a.join(',') : '';
2261
- },
2262
- enumerable: false,
2263
- configurable: true
2264
- });
2265
- MessageInputComponent.prototype.filesSelected = function (fileList) {
2266
- return __awaiter(this, void 0, void 0, function () {
2267
- var imageFiles, dataFiles, newUploads;
2268
- var _this = this;
2269
- return __generator(this, function (_b) {
2270
- switch (_b.label) {
2271
- case 0:
2272
- if (!fileList) {
2273
- return [2 /*return*/];
2274
- }
2275
- imageFiles = [];
2276
- dataFiles = [];
2277
- Array.from(fileList).forEach(function (file) {
2278
- if (file.type.startsWith('image/') && !file.type.endsWith('.photoshop')) {
2279
- // photoshop files begin with 'image/'
2280
- imageFiles.push(file);
2281
- }
2282
- else {
2283
- dataFiles.push(file);
2284
- }
2285
- });
2286
- imageFiles.forEach(function (f) { return _this.createPreview(f); });
2287
- newUploads = __spreadArray(__spreadArray([], __read(imageFiles.map(function (file) { return ({
2288
- file: file,
2289
- state: 'uploading',
2290
- type: 'image',
2291
- }); }))), __read(dataFiles.map(function (file) { return ({
2292
- file: file,
2293
- state: 'uploading',
2294
- type: 'file',
2295
- }); })));
2296
- this.attachmentUploads = __spreadArray(__spreadArray([], __read(this.attachmentUploads)), __read(newUploads));
2297
- this.clearFileInput();
2298
- return [4 /*yield*/, this.uploadAttachments(newUploads)];
2299
- case 1:
2300
- _b.sent();
2301
- return [2 /*return*/];
2302
- }
2303
- });
2304
- });
3093
+ AutocompleteTextareaComponent.prototype.mentioned = function (item, triggerChar) {
3094
+ if (triggerChar === void 0) { triggerChar = ''; }
3095
+ this.mentionedUsers.push((item.user ? item.user : item));
3096
+ this.userMentions.next(__spreadArray([], __read(this.mentionedUsers)));
3097
+ return triggerChar + item.autocompleteLabel;
2305
3098
  };
2306
- MessageInputComponent.prototype.retryAttachmentUpload = function (file) {
2307
- return __awaiter(this, void 0, void 0, function () {
2308
- var upload;
2309
- return __generator(this, function (_b) {
2310
- switch (_b.label) {
2311
- case 0:
2312
- upload = this.attachmentUploads.find(function (u) { return u.file === file; });
2313
- if (!upload) {
2314
- return [2 /*return*/];
2315
- }
2316
- upload.state = 'uploading';
2317
- return [4 /*yield*/, this.uploadAttachments([upload])];
2318
- case 1:
2319
- _b.sent();
2320
- return [2 /*return*/];
2321
- }
2322
- });
2323
- });
3099
+ AutocompleteTextareaComponent.prototype.autcompleteSearchTermChanged = function (searchTerm) {
3100
+ this.searchTerm$.next(searchTerm);
2324
3101
  };
2325
- MessageInputComponent.prototype.deleteAttachment = function (upload) {
2326
- return __awaiter(this, void 0, void 0, function () {
2327
- var error_1;
2328
- return __generator(this, function (_b) {
2329
- switch (_b.label) {
2330
- case 0:
2331
- if (!(upload.state === 'success')) return [3 /*break*/, 5];
2332
- _b.label = 1;
2333
- case 1:
2334
- _b.trys.push([1, 3, , 4]);
2335
- return [4 /*yield*/, this.channelService.deleteAttachment(upload)];
2336
- case 2:
2337
- _b.sent();
2338
- this.attachmentUploads.splice(this.attachmentUploads.indexOf(upload), 1);
2339
- return [3 /*break*/, 4];
2340
- case 3:
2341
- error_1 = _b.sent();
2342
- return [3 /*break*/, 4];
2343
- case 4: return [3 /*break*/, 6];
2344
- case 5:
2345
- this.attachmentUploads.splice(this.attachmentUploads.indexOf(upload), 1);
2346
- _b.label = 6;
2347
- case 6: return [2 /*return*/];
2348
- }
2349
- });
2350
- });
3102
+ AutocompleteTextareaComponent.prototype.inputChanged = function () {
3103
+ this.valueChange.emit(this.messageInput.nativeElement.value);
2351
3104
  };
2352
- MessageInputComponent.prototype.trackByFile = function (_, item) {
2353
- return item.file;
3105
+ AutocompleteTextareaComponent.prototype.inputLeft = function () {
3106
+ this.updateMentionedUsersFromText();
2354
3107
  };
2355
- MessageInputComponent.prototype.createPreview = function (file) {
2356
- var _this = this;
2357
- var reader = new FileReader();
2358
- reader.onload = function (event) {
2359
- var _a;
2360
- var upload = _this.attachmentUploads.find(function (upload) { return upload.file === file; });
2361
- if (!upload) {
2362
- return;
2363
- }
2364
- upload.previewUri = ((_a = event.target) === null || _a === void 0 ? void 0 : _a.result) || undefined;
2365
- };
2366
- reader.readAsDataURL(file);
3108
+ AutocompleteTextareaComponent.prototype.sent = function (event) {
3109
+ event.preventDefault();
3110
+ this.updateMentionedUsersFromText();
3111
+ this.send.next();
2367
3112
  };
2368
- MessageInputComponent.prototype.uploadAttachments = function (uploads) {
3113
+ AutocompleteTextareaComponent.prototype.updateMentionOptions = function (searchTerm) {
2369
3114
  return __awaiter(this, void 0, void 0, function () {
2370
- var result;
3115
+ var request, result, items;
2371
3116
  var _this = this;
2372
- return __generator(this, function (_b) {
2373
- switch (_b.label) {
3117
+ return __generator(this, function (_a) {
3118
+ switch (_a.label) {
2374
3119
  case 0:
2375
- this.attachmentUploadInProgressCounter++;
2376
- return [4 /*yield*/, this.channelService.uploadAttachments(uploads)];
2377
- case 1:
2378
- result = _b.sent();
2379
- result.forEach(function (r) {
2380
- var upload = _this.attachmentUploads.find(function (upload) { return upload.file === r.file; });
2381
- if (!upload) {
2382
- if (r.url) {
2383
- void _this.channelService.deleteAttachment(r);
2384
- }
2385
- return;
2386
- }
2387
- upload.state = r.state;
2388
- upload.url = r.url;
2389
- if (upload.state === 'error') {
2390
- _this.notificationService.addTemporaryNotification(upload.type === 'image'
2391
- ? 'streamChat.Error uploading image'
2392
- : 'streamChat.Error uploading file');
2393
- }
2394
- });
2395
- this.attachmentUploadInProgressCounter--;
2396
- if (this.attachmentUploadInProgressCounter === 0 && this.hideNotification) {
2397
- this.hideNotification();
2398
- this.hideNotification = undefined;
3120
+ if (!this.areMentionsEnabled) {
3121
+ return [2 /*return*/];
2399
3122
  }
3123
+ request = this.mentionScope === 'application'
3124
+ ? function (s) { return _this.chatClientService.autocompleteUsers(s); }
3125
+ : function (s) { return _this.channelService.autocompleteMembers(s); };
3126
+ return [4 /*yield*/, request(searchTerm || '')];
3127
+ case 1:
3128
+ result = _a.sent();
3129
+ items = this.filter(searchTerm || '', result.map(function (i) {
3130
+ var user = (i.user ? i.user : i);
3131
+ return Object.assign(Object.assign({}, i), { autocompleteLabel: user.name || user.id, type: 'mention' });
3132
+ }));
3133
+ this.userMentionConfig.items = items;
3134
+ this.autocompleteConfig.mentions = [this.userMentionConfig];
3135
+ this.autocompleteConfig = Object.assign({}, this.autocompleteConfig);
2400
3136
  return [2 /*return*/];
2401
3137
  }
2402
3138
  });
2403
3139
  });
2404
3140
  };
2405
- MessageInputComponent.prototype.clearFileInput = function () {
2406
- this.fileInput.nativeElement.value = '';
3141
+ AutocompleteTextareaComponent.prototype.updateMentionedUsersFromText = function () {
3142
+ var _this = this;
3143
+ var updatedMentionedUsers = [];
3144
+ this.mentionedUsers.forEach(function (u) {
3145
+ var key = u.name || u.id;
3146
+ if (_this.value.includes("" + _this.triggerChar + key)) {
3147
+ updatedMentionedUsers.push(u);
3148
+ }
3149
+ });
3150
+ if (updatedMentionedUsers.length !== this.mentionedUsers.length) {
3151
+ this.userMentions.next(__spreadArray([], __read(updatedMentionedUsers)));
3152
+ this.mentionedUsers = updatedMentionedUsers;
3153
+ }
2407
3154
  };
2408
- return MessageInputComponent;
3155
+ return AutocompleteTextareaComponent;
2409
3156
  }());
2410
- MessageInputComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, deps: [{ token: ChannelService }, { token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2411
- MessageInputComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: MessageInputComponent, selector: "stream-message-input", inputs: { isFileUploadEnabled: "isFileUploadEnabled", acceptedFileTypes: "acceptedFileTypes", isMultipleFileUploadEnabled: "isMultipleFileUploadEnabled" }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }, { propertyName: "fileInput", first: true, predicate: ["fileInput"], descendants: true }], ngImport: i0__namespace, template: "<div class=\"str-chat__input-flat\">\n <div class=\"str-chat__input-flat-wrapper\">\n <div class=\"str-chat__input-flat--textarea-wrapper\">\n <div class=\"rfu-image-previewer\">\n <ng-container\n *ngFor=\"\n let attachmentUpload of attachmentUploads;\n trackBy: trackByFile\n \"\n >\n <div\n *ngIf=\"attachmentUpload.type === 'image'\"\n class=\"rfu-image-previewer__image\"\n [class.rfu-image-previewer__image--loaded]=\"\n attachmentUpload.state === 'success'\n \"\n data-testclass=\"attachment-image-preview\"\n >\n <div\n *ngIf=\"attachmentUpload.state === 'error'\"\n class=\"rfu-image-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"retryAttachmentUpload(attachmentUpload.file)\"\n data-testclass=\"upload-error\"\n >\n <stream-icon icon=\"retry\"></stream-icon>\n </div>\n <div class=\"rfu-thumbnail__wrapper\" style=\"width: 100; height: 100\">\n <div class=\"rfu-thumbnail__overlay\">\n <div\n class=\"rfu-icon-button\"\n data-testclass=\"delete-attachment\"\n role=\"button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n <stream-icon icon=\"close\"></stream-icon>\n </div>\n </div>\n <img\n *ngIf=\"attachmentUpload.url || attachmentUpload.previewUri\"\n src=\"{{\n attachmentUpload.url\n ? attachmentUpload.url\n : attachmentUpload.previewUri\n }}\"\n alt=\"attachmentUpload.file.name\"\n class=\"rfu-thumbnail__image\"\n data-testclass=\"attachment-image\"\n />\n </div>\n <stream-loading-indicator\n data-testclass=\"loading-indicator\"\n color=\"rgba(255,255,255,0.7)\"\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n ></stream-loading-indicator>\n </div>\n <div\n class=\"rfu-file-previewer\"\n *ngIf=\"attachmentUpload.type === 'file'\"\n data-testclass=\"attachment-file-preview\"\n >\n <ol>\n <li\n class=\"rfu-file-previewer__file\"\n [class.rfu-file-previewer__file--uploading]=\"\n attachmentUpload.state === 'uploading'\n \"\n [class.rfu-file-previewer__file--failed]=\"\n attachmentUpload.state === 'error'\n \"\n >\n <stream-icon icon=\"file\"></stream-icon>\n\n <a\n data-testclass=\"file-download-link\"\n href=\"{{ attachmentUpload.url }}\"\n (click)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n (keyup.enter)=\"\n attachmentUpload.url ? null : $event.preventDefault()\n \"\n download\n >\n {{ attachmentUpload.file.name }}\n <ng-container *ngIf=\"attachmentUpload.state === 'error'\">\n <div\n data-testclass=\"file-upload-retry\"\n class=\"rfu-file-previewer__failed\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"\n retryAttachmentUpload(attachmentUpload.file)\n \"\n translate\n >\n streamChat.failed\n </div>\n <div\n class=\"rfu-file-previewer__retry\"\n (click)=\"retryAttachmentUpload(attachmentUpload.file)\"\n (keyup.enter)=\"\n retryAttachmentUpload(attachmentUpload.file)\n \"\n translate\n >\n streamChat.retry\n </div>\n </ng-container>\n </a>\n\n <span\n data-testclass=\"file-delete\"\n class=\"rfu-file-previewer__close-button\"\n (click)=\"deleteAttachment(attachmentUpload)\"\n (keyup.enter)=\"deleteAttachment(attachmentUpload)\"\n >\n \u2718\n </span>\n <div\n *ngIf=\"attachmentUpload.state === 'uploading'\"\n class=\"rfu-file-previewer__loading-indicator\"\n >\n <stream-loading-indicator></stream-loading-indicator>\n </div>\n </li>\n </ol>\n </div>\n </ng-container>\n </div>\n <div class=\"rta str-chat__textarea\">\n <textarea\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (keydown.enter)=\"messageSent($event)\"\n ></textarea>\n </div>\n <div\n *ngIf=\"isFileUploadEnabled && isFileUploadAuthorized\"\n class=\"str-chat__fileupload-wrapper\"\n data-testid=\"file-upload-button\"\n >\n <div class=\"str-chat__tooltip\">\n {{ \"streamChat.Attach files\" | translate }}\n </div>\n <div class=\"rfu-file-upload-button\">\n <label>\n <input\n #fileInput\n type=\"file\"\n class=\"rfu-file-input\"\n data-testid=\"file-input\"\n [accept]=\"accept\"\n [multiple]=\"isMultipleFileUploadEnabled\"\n (change)=\"filesSelected(fileInput.files)\"\n />\n <span class=\"str-chat__input-flat-fileupload\">\n <stream-icon icon=\"file-upload\"></stream-icon>\n </span>\n </label>\n </div>\n </div>\n </div>\n <button\n data-testid=\"send-button\"\n class=\"str-chat__send-button\"\n (click)=\"messageSent()\"\n (keyup.enter)=\"messageSent()\"\n >\n <stream-icon icon=\"send\"></stream-icon>\n </button>\n </div>\n</div>\n", components: [{ type: IconComponent, selector: "stream-icon", inputs: ["icon", "size"] }, { type: LoadingIndicatorComponent, selector: "stream-loading-indicator", inputs: ["size", "color"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "translate": i4__namespace.TranslatePipe } });
2412
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: MessageInputComponent, decorators: [{
3157
+ AutocompleteTextareaComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, deps: [{ token: ChannelService }, { token: ChatClientService }], target: i0__namespace.ɵɵFactoryTarget.Component });
3158
+ AutocompleteTextareaComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: AutocompleteTextareaComponent, selector: "stream-autocomplete-textarea", inputs: { value: "value", areMentionsEnabled: "areMentionsEnabled", mentionAutocompleteItemTemplate: "mentionAutocompleteItemTemplate", mentionScope: "mentionScope" }, outputs: { valueChange: "valueChange", send: "send", userMentions: "userMentions" }, host: { properties: { "class": "this.class" } }, viewQueries: [{ propertyName: "messageInput", first: true, predicate: ["input"], descendants: true }], usesOnChanges: true, ngImport: i0__namespace, template: "<textarea\n [value]=\"value || ''\"\n autofocus\n data-testid=\"textarea\"\n #input\n placeholder=\"{{ 'streamChat.Type your message' | translate }}\"\n class=\"rta__textarea str-chat__textarea__textarea\"\n rows=\"1\"\n (input)=\"inputChanged()\"\n (keydown.enter)=\"sent($event)\"\n [mentionConfig]=\"autocompleteConfig\"\n (searchTerm)=\"autcompleteSearchTermChanged($event)\"\n [mentionListTemplate]=\"autocompleteItem\"\n (blur)=\"inputLeft()\"\n></textarea>\n<ng-template #autocompleteItem let-item=\"item\">\n <div class=\"rta rta__item str-chat__emojisearch__item\" [ngSwitch]=\"item.type\">\n <div class=\"rta__entity\" *ngSwitchCase=\"'mention'\">\n <ng-container\n *ngTemplateOutlet=\"\n mentionAutocompleteItemTemplate || defaultMentionTemplate;\n context: { item: item }\n \"\n ></ng-container>\n </div>\n </div>\n</ng-template>\n\n<ng-template #defaultMentionTemplate let-item=\"item\">\n <div class=\"str-chat__user-item\">\n <stream-avatar\n data-testclass=\"avatar\"\n class=\"str-chat__avatar str-chat__avatar--circle\"\n style=\"height: 20px\"\n [size]=\"20\"\n [imageUrl]=\"item.image || item.user?.image\"\n [name]=\"item.autocompleteLabel\"\n ></stream-avatar>\n <span data-testclass=\"username\" class=\"str-chat__user-item--name\">{{\n item.autocompleteLabel\n }}</span>\n </div>\n</ng-template>\n", components: [{ type: AvatarComponent, selector: "stream-avatar", inputs: ["name", "imageUrl", "size"] }], directives: [{ type: i4__namespace.MentionDirective, selector: "[mention], [mentionConfig]", inputs: ["mentionConfig", "mention", "mentionListTemplate"], outputs: ["searchTerm", "itemSelected", "opened", "closed"] }, { type: i5__namespace.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i5__namespace.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i5__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "translate": i1__namespace.TranslatePipe } });
3159
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: AutocompleteTextareaComponent, decorators: [{
2413
3160
  type: i0.Component,
2414
3161
  args: [{
2415
- selector: 'stream-message-input',
2416
- templateUrl: './message-input.component.html',
3162
+ selector: 'stream-autocomplete-textarea',
3163
+ templateUrl: './autocomplete-textarea.component.html',
2417
3164
  styles: [],
2418
3165
  }]
2419
- }], ctorParameters: function () { return [{ type: ChannelService }, { type: NotificationService }]; }, propDecorators: { isFileUploadEnabled: [{
3166
+ }], ctorParameters: function () { return [{ type: ChannelService }, { type: ChatClientService }]; }, propDecorators: { class: [{
3167
+ type: i0.HostBinding
3168
+ }], value: [{
2420
3169
  type: i0.Input
2421
- }], acceptedFileTypes: [{
3170
+ }], areMentionsEnabled: [{
2422
3171
  type: i0.Input
2423
- }], isMultipleFileUploadEnabled: [{
3172
+ }], mentionAutocompleteItemTemplate: [{
3173
+ type: i0.Input
3174
+ }], mentionScope: [{
2424
3175
  type: i0.Input
3176
+ }], valueChange: [{
3177
+ type: i0.Output
3178
+ }], send: [{
3179
+ type: i0.Output
3180
+ }], userMentions: [{
3181
+ type: i0.Output
2425
3182
  }], messageInput: [{
2426
3183
  type: i0.ViewChild,
2427
3184
  args: ['input']
2428
- }], fileInput: [{
2429
- type: i0.ViewChild,
2430
- args: ['fileInput']
2431
3185
  }] } });
2432
3186
 
2433
3187
  var getGroupStyles = function (message, previousMessage, nextMessage, noGroupByUser) {
@@ -2478,7 +3232,9 @@
2478
3232
  this.chatClientService = chatClientService;
2479
3233
  this.imageLoadService = imageLoadService;
2480
3234
  this.areReactionsEnabled = true;
2481
- this.enabledMessageActions = ['flag'];
3235
+ /* eslint-disable-next-line @angular-eslint/no-input-rename */
3236
+ this.enabledMessageActionsInput = ['flag', 'edit', 'edit-any', 'delete', 'delete-any'];
3237
+ this.enabledMessageActions = [];
2482
3238
  this.class = 'str-chat-angular__main-panel-inner str-chat-angular__message-list-host';
2483
3239
  this.unreadMessageCount = 0;
2484
3240
  this.groupStyles = [];
@@ -2501,6 +3257,20 @@
2501
3257
  if (capabilites.indexOf('flag-message') !== -1) {
2502
3258
  _this.authorizedMessageActions.push('flag');
2503
3259
  }
3260
+ if (capabilites.indexOf('update-own-message') !== -1) {
3261
+ _this.authorizedMessageActions.push('edit');
3262
+ }
3263
+ if (capabilites.indexOf('update-any-message') !== -1) {
3264
+ _this.authorizedMessageActions.push('edit');
3265
+ _this.authorizedMessageActions.push('edit-any');
3266
+ }
3267
+ if (capabilites.indexOf('delete-own-message') !== -1) {
3268
+ _this.authorizedMessageActions.push('delete');
3269
+ }
3270
+ if (capabilites.indexOf('delete-any-message') !== -1) {
3271
+ _this.authorizedMessageActions.push('delete');
3272
+ _this.authorizedMessageActions.push('delete-any');
3273
+ }
2504
3274
  _this.setEnabledActions();
2505
3275
  }
2506
3276
  });
@@ -2601,10 +3371,10 @@
2601
3371
  };
2602
3372
  MessageListComponent.prototype.setEnabledActions = function () {
2603
3373
  var _this = this;
3374
+ this.enabledMessageActions = [];
2604
3375
  if (!this.enabledMessageActionsInput) {
2605
3376
  return;
2606
3377
  }
2607
- this.enabledMessageActions = [];
2608
3378
  this.enabledMessageActionsInput.forEach(function (action) {
2609
3379
  var isAuthorized = _this.authorizedMessageActions.indexOf(action) !== -1;
2610
3380
  if (isAuthorized) {
@@ -2638,44 +3408,22 @@
2638
3408
  args: ['scrollContainer']
2639
3409
  }] } });
2640
3410
 
2641
- var NotificationComponent = /** @class */ (function () {
2642
- function NotificationComponent() {
2643
- }
2644
- return NotificationComponent;
2645
- }());
2646
- NotificationComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2647
- NotificationComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationComponent, selector: "stream-notification", inputs: { type: "type" }, ngImport: i0__namespace, template: "<div\n class=\"str-chat__custom-notification notification-{{ type }}\"\n data-testid=\"custom-notification\"\n>\n <ng-content></ng-content>\n</div>\n" });
2648
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationComponent, decorators: [{
2649
- type: i0.Component,
2650
- args: [{
2651
- selector: 'stream-notification',
2652
- templateUrl: './notification.component.html',
2653
- styles: [],
2654
- }]
2655
- }], ctorParameters: function () { return []; }, propDecorators: { type: [{
2656
- type: i0.Input
2657
- }] } });
2658
-
2659
- var NotificationListComponent = /** @class */ (function () {
2660
- function NotificationListComponent(notificationService) {
2661
- this.notificationService = notificationService;
2662
- this.notifications$ = this.notificationService.notifications$;
3411
+ var StreamAvatarModule = /** @class */ (function () {
3412
+ function StreamAvatarModule() {
2663
3413
  }
2664
- NotificationListComponent.prototype.trackByItem = function (_, item) {
2665
- return item;
2666
- };
2667
- return NotificationListComponent;
3414
+ return StreamAvatarModule;
2668
3415
  }());
2669
- NotificationListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, deps: [{ token: NotificationService }], target: i0__namespace.ɵɵFactoryTarget.Component });
2670
- NotificationListComponentcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.5", type: NotificationListComponent, selector: "stream-notification-list", ngImport: i0__namespace, template: "<div class=\"str-chat__list-notifications\">\n <stream-notification\n *ngFor=\"let notification of notifications$ | async; trackBy: trackByItem\"\n [type]=\"notification.type\"\n ><div data-testclass=\"notification-content\" translate>\n {{ notification.text }}\n </div></stream-notification\n >\n</div>\n", components: [{ type: NotificationComponent, selector: "stream-notification", inputs: ["type"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4__namespace.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }], pipes: { "async": i5__namespace.AsyncPipe } });
2671
- i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: NotificationListComponent, decorators: [{
2672
- type: i0.Component,
3416
+ StreamAvatarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3417
+ StreamAvatarModulemod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, declarations: [AvatarComponent], imports: [i5.CommonModule, i1.TranslateModule], exports: [AvatarComponent] });
3418
+ StreamAvatarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, imports: [[i5.CommonModule, i1.TranslateModule]] });
3419
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAvatarModule, decorators: [{
3420
+ type: i0.NgModule,
2673
3421
  args: [{
2674
- selector: 'stream-notification-list',
2675
- templateUrl: './notification-list.component.html',
2676
- styles: [],
3422
+ declarations: [AvatarComponent],
3423
+ imports: [i5.CommonModule, i1.TranslateModule],
3424
+ exports: [AvatarComponent],
2677
3425
  }]
2678
- }], ctorParameters: function () { return [{ type: NotificationService }]; } });
3426
+ }] });
2679
3427
 
2680
3428
  var StreamChatModule = /** @class */ (function () {
2681
3429
  function StreamChatModule() {
@@ -2683,8 +3431,7 @@
2683
3431
  return StreamChatModule;
2684
3432
  }());
2685
3433
  StreamChatModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2686
- StreamChatModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, declarations: [AvatarComponent,
2687
- ChannelComponent,
3434
+ StreamChatModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, declarations: [ChannelComponent,
2688
3435
  ChannelHeaderComponent,
2689
3436
  ChannelListComponent,
2690
3437
  ChannelPreviewComponent,
@@ -2697,8 +3444,11 @@
2697
3444
  AttachmentListComponent,
2698
3445
  MessageReactionsComponent,
2699
3446
  NotificationComponent,
2700
- NotificationListComponent], imports: [i5.CommonModule, i2.EmojiModule, i4.TranslateModule], exports: [AvatarComponent,
2701
- ChannelComponent,
3447
+ NotificationListComponent,
3448
+ AttachmentPreviewListComponent,
3449
+ ModalComponent,
3450
+ TextareaDirective,
3451
+ HighlightMentionsPipe], imports: [i5.CommonModule, i2.EmojiModule, i1.TranslateModule, StreamAvatarModule], exports: [ChannelComponent,
2702
3452
  ChannelHeaderComponent,
2703
3453
  ChannelListComponent,
2704
3454
  ChannelPreviewComponent,
@@ -2711,13 +3461,15 @@
2711
3461
  AttachmentListComponent,
2712
3462
  MessageReactionsComponent,
2713
3463
  NotificationComponent,
2714
- NotificationListComponent] });
2715
- StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i5.CommonModule, i2.EmojiModule, i4.TranslateModule]] });
3464
+ NotificationListComponent,
3465
+ AttachmentPreviewListComponent,
3466
+ ModalComponent,
3467
+ HighlightMentionsPipe] });
3468
+ StreamChatModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, imports: [[i5.CommonModule, i2.EmojiModule, i1.TranslateModule, StreamAvatarModule]] });
2716
3469
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamChatModule, decorators: [{
2717
3470
  type: i0.NgModule,
2718
3471
  args: [{
2719
3472
  declarations: [
2720
- AvatarComponent,
2721
3473
  ChannelComponent,
2722
3474
  ChannelHeaderComponent,
2723
3475
  ChannelListComponent,
@@ -2732,10 +3484,13 @@
2732
3484
  MessageReactionsComponent,
2733
3485
  NotificationComponent,
2734
3486
  NotificationListComponent,
3487
+ AttachmentPreviewListComponent,
3488
+ ModalComponent,
3489
+ TextareaDirective,
3490
+ HighlightMentionsPipe,
2735
3491
  ],
2736
- imports: [i5.CommonModule, i2.EmojiModule, i4.TranslateModule],
3492
+ imports: [i5.CommonModule, i2.EmojiModule, i1.TranslateModule, StreamAvatarModule],
2737
3493
  exports: [
2738
- AvatarComponent,
2739
3494
  ChannelComponent,
2740
3495
  ChannelHeaderComponent,
2741
3496
  ChannelListComponent,
@@ -2750,6 +3505,65 @@
2750
3505
  MessageReactionsComponent,
2751
3506
  NotificationComponent,
2752
3507
  NotificationListComponent,
3508
+ AttachmentPreviewListComponent,
3509
+ ModalComponent,
3510
+ HighlightMentionsPipe,
3511
+ ],
3512
+ }]
3513
+ }] });
3514
+
3515
+ var StreamAutocompleteTextareaModule = /** @class */ (function () {
3516
+ function StreamAutocompleteTextareaModule() {
3517
+ }
3518
+ return StreamAutocompleteTextareaModule;
3519
+ }());
3520
+ StreamAutocompleteTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3521
+ StreamAutocompleteTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, declarations: [AutocompleteTextareaComponent], imports: [i5.CommonModule, i1.TranslateModule, i4.MentionModule, StreamAvatarModule], exports: [AutocompleteTextareaComponent] });
3522
+ StreamAutocompleteTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, providers: [
3523
+ {
3524
+ provide: textareaInjectionToken,
3525
+ useValue: AutocompleteTextareaComponent,
3526
+ },
3527
+ ], imports: [[i5.CommonModule, i1.TranslateModule, i4.MentionModule, StreamAvatarModule]] });
3528
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamAutocompleteTextareaModule, decorators: [{
3529
+ type: i0.NgModule,
3530
+ args: [{
3531
+ declarations: [AutocompleteTextareaComponent],
3532
+ imports: [i5.CommonModule, i1.TranslateModule, i4.MentionModule, StreamAvatarModule],
3533
+ exports: [AutocompleteTextareaComponent],
3534
+ providers: [
3535
+ {
3536
+ provide: textareaInjectionToken,
3537
+ useValue: AutocompleteTextareaComponent,
3538
+ },
3539
+ ],
3540
+ }]
3541
+ }] });
3542
+
3543
+ var StreamTextareaModule = /** @class */ (function () {
3544
+ function StreamTextareaModule() {
3545
+ }
3546
+ return StreamTextareaModule;
3547
+ }());
3548
+ StreamTextareaModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3549
+ StreamTextareaModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, declarations: [TextareaComponent], imports: [i5.CommonModule, i1.TranslateModule], exports: [TextareaComponent] });
3550
+ StreamTextareaModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, providers: [
3551
+ {
3552
+ provide: textareaInjectionToken,
3553
+ useValue: TextareaComponent,
3554
+ },
3555
+ ], imports: [[i5.CommonModule, i1.TranslateModule]] });
3556
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0__namespace, type: StreamTextareaModule, decorators: [{
3557
+ type: i0.NgModule,
3558
+ args: [{
3559
+ declarations: [TextareaComponent],
3560
+ imports: [i5.CommonModule, i1.TranslateModule],
3561
+ exports: [TextareaComponent],
3562
+ providers: [
3563
+ {
3564
+ provide: textareaInjectionToken,
3565
+ useValue: TextareaComponent,
3566
+ },
2753
3567
  ],
2754
3568
  }]
2755
3569
  }] });
@@ -2763,6 +3577,9 @@
2763
3577
  */
2764
3578
 
2765
3579
  exports.AttachmentListComponent = AttachmentListComponent;
3580
+ exports.AttachmentPreviewListComponent = AttachmentPreviewListComponent;
3581
+ exports.AttachmentService = AttachmentService;
3582
+ exports.AutocompleteTextareaComponent = AutocompleteTextareaComponent;
2766
3583
  exports.AvatarComponent = AvatarComponent;
2767
3584
  exports.ChannelComponent = ChannelComponent;
2768
3585
  exports.ChannelHeaderComponent = ChannelHeaderComponent;
@@ -2771,21 +3588,35 @@
2771
3588
  exports.ChannelPreviewComponent = ChannelPreviewComponent;
2772
3589
  exports.ChannelService = ChannelService;
2773
3590
  exports.ChatClientService = ChatClientService;
3591
+ exports.HighlightMentionsPipe = HighlightMentionsPipe;
2774
3592
  exports.IconComponent = IconComponent;
2775
3593
  exports.ImageLoadService = ImageLoadService;
2776
3594
  exports.LoadingIndicatorComponent = LoadingIndicatorComponent;
2777
3595
  exports.MessageActionsBoxComponent = MessageActionsBoxComponent;
2778
3596
  exports.MessageComponent = MessageComponent;
2779
3597
  exports.MessageInputComponent = MessageInputComponent;
3598
+ exports.MessageInputConfigService = MessageInputConfigService;
2780
3599
  exports.MessageListComponent = MessageListComponent;
2781
3600
  exports.MessageReactionsComponent = MessageReactionsComponent;
3601
+ exports.ModalComponent = ModalComponent;
2782
3602
  exports.NotificationComponent = NotificationComponent;
2783
3603
  exports.NotificationListComponent = NotificationListComponent;
3604
+ exports.NotificationService = NotificationService;
3605
+ exports.StreamAutocompleteTextareaModule = StreamAutocompleteTextareaModule;
2784
3606
  exports.StreamChatModule = StreamChatModule;
2785
3607
  exports.StreamI18nService = StreamI18nService;
3608
+ exports.StreamTextareaModule = StreamTextareaModule;
3609
+ exports.TextareaComponent = TextareaComponent;
3610
+ exports.TextareaDirective = TextareaDirective;
2786
3611
  exports.ThemeService = ThemeService;
3612
+ exports.createMessagePreview = createMessagePreview;
3613
+ exports.getDeviceWidth = getDeviceWidth;
3614
+ exports.getGroupStyles = getGroupStyles;
3615
+ exports.getReadBy = getReadBy;
2787
3616
  exports.getReadByText = getReadByText;
3617
+ exports.isImageAttachment = isImageAttachment;
2788
3618
  exports.parseDate = parseDate;
3619
+ exports.textareaInjectionToken = textareaInjectionToken;
2789
3620
 
2790
3621
  Object.defineProperty(exports, '__esModule', { value: true });
2791
3622