sceyt-chat-react-uikit 1.8.8 → 1.8.9-beta.2

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 (3) hide show
  1. package/index.js +412 -341
  2. package/index.modern.js +412 -341
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -10490,7 +10490,7 @@ if (isBrowser) {
10490
10490
  } else {
10491
10491
  cacheAvailable = 'caches' in global;
10492
10492
  }
10493
- var ATTACHMENT_VERSION = "_1_0_1";
10493
+ var ATTACHMENT_VERSION = "_1_0_2";
10494
10494
  var setAttachmentToCache = function setAttachmentToCache(attachmentUrl, attachmentResponse) {
10495
10495
  try {
10496
10496
  var attachmentURLVersion = attachmentUrl + ATTACHMENT_VERSION;
@@ -15984,7 +15984,8 @@ var compressAndCacheImage = function compressAndCacheImage(url, cacheKey, maxWid
15984
15984
  var file = new File([blob], 'image.jpeg', {
15985
15985
  type: blob.type
15986
15986
  });
15987
- return Promise.resolve(resizeImageWithPica(file, maxWidth || 1280, maxHeight || 1080, quality || 1)).then(function (_ref2) {
15987
+ var dpr = Math.min(window.devicePixelRatio || 1, 2);
15988
+ return Promise.resolve(resizeImageWithPica(file, (maxWidth || 1280) * dpr, (maxHeight || 1080) * dpr, quality || 1)).then(function (_ref2) {
15988
15989
  var compressedBlob = _ref2.blob;
15989
15990
  var returningUrl = compressedBlob ? URL.createObjectURL(compressedBlob) : '';
15990
15991
  if (compressedBlob) {
@@ -16071,6 +16072,75 @@ var createAttachmentUnavailableError = function createAttachmentUnavailableError
16071
16072
  return error;
16072
16073
  };
16073
16074
 
16075
+ var preparations = new Map();
16076
+ var beginVideoPreparation = function beginVideoPreparation(tid, file) {
16077
+ var resolvePreparation;
16078
+ var promise = new Promise(function (resolve) {
16079
+ resolvePreparation = resolve;
16080
+ });
16081
+ preparations.set(tid, {
16082
+ file: file,
16083
+ status: 'loading',
16084
+ promise: promise,
16085
+ resolve: resolvePreparation
16086
+ });
16087
+ };
16088
+ var completeVideoPreparation = function completeVideoPreparation(tid, preparation) {
16089
+ var entry = preparations.get(tid);
16090
+ if (!entry || entry.status !== 'loading') return;
16091
+ var completed = _extends({}, preparation, {
16092
+ status: 'ready'
16093
+ });
16094
+ preparations.set(tid, _extends({}, entry, completed));
16095
+ entry.resolve(completed);
16096
+ };
16097
+ var failVideoPreparation = function failVideoPreparation(tid) {
16098
+ var entry = preparations.get(tid);
16099
+ if (!entry || entry.status !== 'loading') return;
16100
+ var failed = {
16101
+ file: entry.file,
16102
+ status: 'failed'
16103
+ };
16104
+ preparations.set(tid, _extends({}, entry, failed));
16105
+ entry.resolve(failed);
16106
+ };
16107
+ var waitForVideoPreparation = function waitForVideoPreparation(tid, timeoutMs) {
16108
+ try {
16109
+ var _temp2 = function _temp2(_result) {
16110
+ return _exit ? _result : Promise.resolve(new Promise(function (resolve) {
16111
+ var timeout = setTimeout(function () {
16112
+ return resolve({
16113
+ file: entry.file,
16114
+ status: 'failed'
16115
+ });
16116
+ }, timeoutMs);
16117
+ entry.promise.then(function (prepared) {
16118
+ clearTimeout(timeout);
16119
+ resolve(prepared);
16120
+ });
16121
+ }));
16122
+ };
16123
+ var _exit = false;
16124
+ var entry = preparations.get(tid);
16125
+ if (!entry) return Promise.resolve(null);
16126
+ if (entry.status !== 'loading') return Promise.resolve(entry);
16127
+ var _temp = function () {
16128
+ if (timeoutMs === undefined) {
16129
+ return Promise.resolve(entry.promise).then(function (_await$entry$promise) {
16130
+ _exit = true;
16131
+ return _await$entry$promise;
16132
+ });
16133
+ }
16134
+ }();
16135
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
16136
+ } catch (e) {
16137
+ return Promise.reject(e);
16138
+ }
16139
+ };
16140
+ var clearVideoPreparation = function clearVideoPreparation(tid) {
16141
+ preparations["delete"](tid);
16142
+ };
16143
+
16074
16144
  var _excluded$1 = ["lastMessage"];
16075
16145
  var _marked = /*#__PURE__*/_regenerator().m(setMessageListLoading),
16076
16146
  _marked2 = /*#__PURE__*/_regenerator().m(cancelChannelMessageProcesses),
@@ -16140,6 +16210,31 @@ var queuedPrefetchRequests = new Map();
16140
16210
  var prefetchCompletionWaiters = new Map();
16141
16211
  var prefetchCancelVersions = new Map();
16142
16212
  var ACTIVE_CHANNEL_RECONNECT_REFRESH_TIMEOUT_MS = 1500;
16213
+ var applyPreparedVideoAttachments = function applyPreparedVideoAttachments(attachments) {
16214
+ try {
16215
+ return Promise.resolve(Promise.all(attachments.map(function (attachment) {
16216
+ try {
16217
+ if (!attachment.tid) return Promise.resolve();
16218
+ return Promise.resolve(waitForVideoPreparation(attachment.tid)).then(function (prepared) {
16219
+ if ((prepared === null || prepared === void 0 ? void 0 : prepared.status) === 'ready' && prepared.metadata) {
16220
+ attachment.url = prepared.file;
16221
+ attachment.data = prepared.file;
16222
+ attachment.name = prepared.file.name;
16223
+ attachment.size = prepared.file.size;
16224
+ attachment.metadata = prepared.metadata;
16225
+ }
16226
+ clearVideoPreparation(attachment.tid);
16227
+ });
16228
+ } catch (e) {
16229
+ return Promise.reject(e);
16230
+ }
16231
+ }))).then(function () {
16232
+ return attachments;
16233
+ });
16234
+ } catch (e) {
16235
+ return Promise.reject(e);
16236
+ }
16237
+ };
16143
16238
  var activeDisplayedCacheKey = null;
16144
16239
  var updateTabAttachmentCache = function updateTabAttachmentCache(channelId, attachments, messageUser) {
16145
16240
  if (!(attachments !== null && attachments !== void 0 && attachments.length)) return;
@@ -17259,7 +17354,7 @@ function sendMessage(action) {
17259
17354
  messagesToSend.push(messageToSend);
17260
17355
  case 12:
17261
17356
  _loop3 = /*#__PURE__*/_regenerator().m(function _callee4() {
17262
- var messageAttachment, messageToSend, pendingState, messageCopy, _getStoredChannel6, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, activeChannelId, messageToUpdate, resolvedLastMessage, channelUpdateParam, _channel2, _messageToSend2, isErrorResendable, _messageToSend$attach, _iterator2, _step2, att, _t;
17357
+ var messageAttachment, messageToSend, pendingState, pendingAttachments, messageCopy, _getStoredChannel6, _attachmentsToSend, linkAttachmentToSend, linkAttachmentBuilder, messageResponse, k, attachmentsToUpdate, currentAttachmentsMap, messageUpdateData, activeChannelId, messageToUpdate, resolvedLastMessage, channelUpdateParam, _channel2, _messageToSend2, isErrorResendable, _messageToSend$attach, _iterator2, _step2, att, _t;
17263
17358
  return _regenerator().w(function (_context12) {
17264
17359
  while (1) switch (_context12.p = _context12.n) {
17265
17360
  case 0:
@@ -17282,21 +17377,40 @@ function sendMessage(action) {
17282
17377
  messageToSend = _extends({}, messageToSend, pendingState);
17283
17378
  case 2:
17284
17379
  _context12.p = 2;
17380
+ _context12.n = 3;
17381
+ return effects.call(applyPreparedVideoAttachments, messageAttachment);
17382
+ case 3:
17383
+ pendingAttachments = messageAttachment.map(function (attachment) {
17384
+ return _extends({}, attachment, {
17385
+ data: attachment.data || attachment.url
17386
+ });
17387
+ });
17388
+ updateMessageOnMap(channel.id, {
17389
+ messageId: messageToSend.tid,
17390
+ params: {
17391
+ attachments: pendingAttachments
17392
+ }
17393
+ });
17394
+ _context12.n = 4;
17395
+ return effects.put(updateMessageAC(messageToSend.tid, {
17396
+ attachments: pendingAttachments
17397
+ }));
17398
+ case 4:
17285
17399
  messageCopy = JSON.parse(JSON.stringify(messagesToSend[_i2]));
17286
17400
  if (!(connectionState === CONNECTION_STATUS.CONNECTED)) {
17287
- _context12.n = 15;
17401
+ _context12.n = 17;
17288
17402
  break;
17289
17403
  }
17290
17404
  _attachmentsToSend = messageAttachment;
17291
17405
  if (!customUploader) {
17292
- _context12.n = 4;
17406
+ _context12.n = 6;
17293
17407
  break;
17294
17408
  }
17295
- _context12.n = 3;
17409
+ _context12.n = 5;
17296
17410
  return effects.call(handleUploadAttachments, messageAttachment || [], messageCopy, channel);
17297
- case 3:
17411
+ case 5:
17298
17412
  _attachmentsToSend = _context12.v;
17299
- case 4:
17413
+ case 6:
17300
17414
  linkAttachmentToSend = null;
17301
17415
  if (_i2 === 0 && linkAttachment) {
17302
17416
  linkAttachmentBuilder = channel.createAttachmentBuilder(linkAttachment.data, linkAttachment.type);
@@ -17311,40 +17425,40 @@ function sendMessage(action) {
17311
17425
  attachments: [].concat(_attachmentsToSend)
17312
17426
  });
17313
17427
  }
17314
- _context12.n = 5;
17428
+ _context12.n = 7;
17315
17429
  return effects.call(channel.sendMessage, messageToSend);
17316
- case 5:
17430
+ case 7:
17317
17431
  messageResponse = _context12.v;
17318
17432
  if (messageToSend.tid) {
17319
17433
  autoResendAttempts["delete"](messageToSend.tid);
17320
17434
  }
17321
17435
  if (!customUploader) {
17322
- _context12.n = 10;
17436
+ _context12.n = 12;
17323
17437
  break;
17324
17438
  }
17325
17439
  k = 0;
17326
- case 6:
17440
+ case 8:
17327
17441
  if (!(k < messageAttachment.length)) {
17328
- _context12.n = 10;
17442
+ _context12.n = 12;
17329
17443
  break;
17330
17444
  }
17331
17445
  messageResponse.attachments[k] = _extends({}, messageResponse.attachments[k], {
17332
17446
  user: JSON.parse(JSON.stringify(messageResponse.user)),
17333
17447
  tid: messageAttachment[k].tid
17334
17448
  });
17335
- _context12.n = 7;
17449
+ _context12.n = 9;
17336
17450
  return effects.put(removeAttachmentProgressAC(messageAttachment[k].tid));
17337
- case 7:
17338
- _context12.n = 8;
17451
+ case 9:
17452
+ _context12.n = 10;
17339
17453
  return effects.put(removeAttachmentUploadingStateAC(messageAttachment[k].tid));
17340
- case 8:
17454
+ case 10:
17341
17455
  deletePendingAttachment(messageAttachment[k].tid);
17342
17456
  releaseBlobUrls(["compose_" + messageAttachment[k].tid]);
17343
- case 9:
17457
+ case 11:
17344
17458
  k++;
17345
- _context12.n = 6;
17459
+ _context12.n = 8;
17346
17460
  break;
17347
- case 10:
17461
+ case 12:
17348
17462
  attachmentsToUpdate = [];
17349
17463
  if (messageResponse.attachments && messageResponse.attachments.length > 0) {
17350
17464
  currentAttachmentsMap = {};
@@ -17371,25 +17485,25 @@ function sendMessage(action) {
17371
17485
  });
17372
17486
  activeChannelId = getActiveChannelId();
17373
17487
  if (!(activeChannelId === channel.id)) {
17374
- _context12.n = 11;
17488
+ _context12.n = 13;
17375
17489
  break;
17376
17490
  }
17377
- _context12.n = 11;
17491
+ _context12.n = 13;
17378
17492
  return effects.put(updateMessageAC(messageToSend.tid, messageUpdateData, true));
17379
- case 11:
17493
+ case 13:
17380
17494
  messageToUpdate = JSON.parse(JSON.stringify(messageResponse));
17381
17495
  addConfirmedMessageToCache(channel.id, messageToUpdate);
17382
17496
  updateTabAttachmentCache(channel.id, attachmentsToUpdate, messageResponse.user);
17383
17497
  if (!channel.unread) {
17384
- _context12.n = 12;
17498
+ _context12.n = 14;
17385
17499
  break;
17386
17500
  }
17387
- _context12.n = 12;
17501
+ _context12.n = 14;
17388
17502
  return effects.put(markChannelAsReadAC(channel.id));
17389
- case 12:
17503
+ case 14:
17390
17504
  resolvedLastMessage = getResolvedChannelLastMessage(channel.id, messageToUpdate, messageToSend);
17391
17505
  if (!lastMessageNeedsUpdate((_getStoredChannel6 = getStoredChannel(channel.id)) === null || _getStoredChannel6 === void 0 ? void 0 : _getStoredChannel6.lastMessage, resolvedLastMessage)) {
17392
- _context12.n = 14;
17506
+ _context12.n = 16;
17393
17507
  break;
17394
17508
  }
17395
17509
  updateChannelLastMessageOnAllChannels(channel.id, resolvedLastMessage);
@@ -17397,54 +17511,54 @@ function sendMessage(action) {
17397
17511
  lastMessage: resolvedLastMessage,
17398
17512
  lastReactedMessage: null
17399
17513
  };
17400
- _context12.n = 13;
17514
+ _context12.n = 15;
17401
17515
  return effects.put(updateChannelDataAC(channel.id, channelUpdateParam, true));
17402
- case 13:
17403
- updateChannelOnAllChannels(channel.id, channelUpdateParam);
17404
- case 14:
17405
- _context12.n = 16;
17406
- break;
17407
17516
  case 15:
17408
- throw new Error('Connection required to send message');
17517
+ updateChannelOnAllChannels(channel.id, channelUpdateParam);
17409
17518
  case 16:
17410
- _context12.n = 21;
17519
+ _context12.n = 18;
17411
17520
  break;
17412
17521
  case 17:
17413
- _context12.p = 17;
17522
+ throw new Error('Connection required to send message');
17523
+ case 18:
17524
+ _context12.n = 23;
17525
+ break;
17526
+ case 19:
17527
+ _context12.p = 19;
17414
17528
  _t = _context12.v;
17415
17529
  isErrorResendable = isResendableError(_t === null || _t === void 0 ? void 0 : _t.type);
17416
17530
  if (!((_channel2 = channel) !== null && _channel2 !== void 0 && _channel2.id && (_messageToSend2 = messageToSend) !== null && _messageToSend2 !== void 0 && _messageToSend2.tid)) {
17417
- _context12.n = 21;
17531
+ _context12.n = 23;
17418
17532
  break;
17419
17533
  }
17420
17534
  log.error('Error on uploading attachment', messageToSend.tid, _t);
17421
17535
  if (!((_messageToSend$attach = messageToSend.attachments) !== null && _messageToSend$attach !== void 0 && _messageToSend$attach.length)) {
17422
- _context12.n = 20;
17536
+ _context12.n = 22;
17423
17537
  break;
17424
17538
  }
17425
17539
  _iterator2 = _createForOfIteratorHelperLoose(messageToSend.attachments);
17426
- case 18:
17540
+ case 20:
17427
17541
  if ((_step2 = _iterator2()).done) {
17428
- _context12.n = 20;
17542
+ _context12.n = 22;
17429
17543
  break;
17430
17544
  }
17431
17545
  att = _step2.value;
17432
17546
  if (!att.tid) {
17433
- _context12.n = 19;
17547
+ _context12.n = 21;
17434
17548
  break;
17435
17549
  }
17436
- _context12.n = 19;
17550
+ _context12.n = 21;
17437
17551
  return effects.put(updateAttachmentUploadingStateAC(UPLOAD_STATE.FAIL, att.tid));
17438
- case 19:
17439
- _context12.n = 18;
17552
+ case 21:
17553
+ _context12.n = 20;
17440
17554
  break;
17441
- case 20:
17442
- _context12.n = 21;
17555
+ case 22:
17556
+ _context12.n = 23;
17443
17557
  return effects.call(syncFailedMessageState, channel, messageToSend.tid, pendingMessages[_i2] || messageToSend, isErrorResendable);
17444
- case 21:
17558
+ case 23:
17445
17559
  return _context12.a(2);
17446
17560
  }
17447
- }, _callee4, null, [[2, 17]]);
17561
+ }, _callee4, null, [[2, 19]]);
17448
17562
  });
17449
17563
  _i2 = 0;
17450
17564
  case 13:
@@ -39583,7 +39697,7 @@ var VideoIcon = styled__default.div(_templateObject8$a || (_templateObject8$a =
39583
39697
  return bg;
39584
39698
  });
39585
39699
 
39586
- var _templateObject$z, _templateObject2$v, _templateObject3$p, _templateObject4$l, _templateObject5$h, _templateObject6$e, _templateObject7$d, _templateObject8$b, _templateObject9$9, _templateObject0$8, _templateObject1$8, _templateObject10$6, _templateObject11$5;
39700
+ var _templateObject$z, _templateObject2$v, _templateObject3$p, _templateObject4$l, _templateObject5$h, _templateObject6$e, _templateObject7$d, _templateObject8$b, _templateObject9$9, _templateObject0$8, _templateObject1$8, _templateObject10$6, _templateObject11$5, _templateObject12$4, _templateObject13$4;
39587
39701
  var Attachment = function Attachment(_ref) {
39588
39702
  var attachment = _ref.attachment,
39589
39703
  _ref$isPreview = _ref.isPreview,
@@ -40382,7 +40496,9 @@ var Attachment = function Attachment(_ref) {
40382
40496
  border: selectedFileAttachmentsBoxBorder || (theme === THEME.DARK ? 'none' : ''),
40383
40497
  width: fileAttachmentWidth,
40384
40498
  borderColor: borderColor
40385
- }, attachmentThumb ? (/*#__PURE__*/React__default.createElement(FileThumbnail, {
40499
+ }, attachment.thumbnailState === 'loading' ? (/*#__PURE__*/React__default.createElement(FileThumbnailSkeleton, {
40500
+ color: overlayBackground2
40501
+ })) : attachmentThumb ? (/*#__PURE__*/React__default.createElement(FileThumbnail, {
40386
40502
  src: withPrefix ? "data:image/jpeg;base64," + attachmentThumb : attachmentThumb,
40387
40503
  loading: 'lazy',
40388
40504
  decoding: 'async',
@@ -40492,18 +40608,26 @@ var AttachmentImgCont = styled__default.div(_templateObject2$v || (_templateObje
40492
40608
  return props.isPreview && "\n width: 48px;\n min-width: 48px;\n height: 48px;\n ";
40493
40609
  });
40494
40610
  var FileThumbnail = styled__default.img(_templateObject3$p || (_templateObject3$p = _taggedTemplateLiteralLoose(["\n min-width: 40px;\n max-width: 40px;\n height: 40px;\n object-fit: cover;\n border-radius: 8px;\n"])));
40495
- var DownloadFile$1 = styled__default.span(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n display: none;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n background-color: ", ";\n min-width: 40px;\n max-width: 40px;\n height: 40px;\n position: ", ";\n border-radius: ", ";\n\n & > svg {\n width: 20px;\n height: 20px;\n }\n"])), function (props) {
40611
+ var fileThumbnailShimmer = styled.keyframes(_templateObject4$l || (_templateObject4$l = _taggedTemplateLiteralLoose(["\n 0% { background-position: -120px 0; }\n 100% { background-position: 120px 0; }\n"])));
40612
+ var FileThumbnailSkeleton = styled__default.div(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n min-width: 40px;\n max-width: 40px;\n height: 40px;\n border-radius: 8px;\n background-color: ", ";\n background-image: linear-gradient(\n 90deg,\n ", ",\n rgba(255, 255, 255, 0.55),\n ", "\n );\n background-size: 240px 100%;\n animation: ", " 1.1s ease infinite;\n"])), function (props) {
40613
+ return props.color;
40614
+ }, function (props) {
40615
+ return props.color;
40616
+ }, function (props) {
40617
+ return props.color;
40618
+ }, fileThumbnailShimmer);
40619
+ var DownloadFile$1 = styled__default.span(_templateObject6$e || (_templateObject6$e = _taggedTemplateLiteralLoose(["\n display: none;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n background-color: ", ";\n min-width: 40px;\n max-width: 40px;\n height: 40px;\n position: ", ";\n border-radius: ", ";\n\n & > svg {\n width: 20px;\n height: 20px;\n }\n"])), function (props) {
40496
40620
  return props.backgroundColor;
40497
40621
  }, function (props) {
40498
40622
  return props.widthThumb && 'absolute';
40499
40623
  }, function (props) {
40500
40624
  return props.widthThumb ? '7.3px' : '50%';
40501
40625
  });
40502
- var ProgressWrapper$1 = styled__default.span(_templateObject5$h || (_templateObject5$h = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n animation: preloader 1.5s linear infinite;\n\n @keyframes preloader {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
40503
- var SizeProgress = styled__default.span(_templateObject6$e || (_templateObject6$e = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: -26px;\n background-color: rgba(0, 0, 0, 0.4);\n color: ", ";\n font-size: 12px;\n border-radius: 12px;\n padding: 3px 6px;\n white-space: nowrap;\n"])), function (props) {
40626
+ var ProgressWrapper$1 = styled__default.span(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n width: 100%;\n height: 100%;\n animation: preloader 1.5s linear infinite;\n\n @keyframes preloader {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
40627
+ var SizeProgress = styled__default.span(_templateObject8$b || (_templateObject8$b = _taggedTemplateLiteralLoose(["\n position: absolute;\n bottom: -26px;\n background-color: rgba(0, 0, 0, 0.4);\n color: ", ";\n font-size: 12px;\n border-radius: 12px;\n padding: 3px 6px;\n white-space: nowrap;\n"])), function (props) {
40504
40628
  return props.color;
40505
40629
  });
40506
- var AttachmentFile$1 = styled__default.div(_templateObject7$d || (_templateObject7$d = _taggedTemplateLiteralLoose(["\n display: flex;\n position: relative;\n align-items: center;\n padding: ", ";\n //width: ", ";\n min-width: ", ";\n //height: 70px;\n background: ", ";\n border: ", ";\n box-sizing: border-box;\n margin-right: ", ";\n border-radius: ", ";\n\n ", "\n\n & > ", " svg {\n width: 40px;\n height: 40px;\n }\n"])), function (props) {
40630
+ var AttachmentFile$1 = styled__default.div(_templateObject9$9 || (_templateObject9$9 = _taggedTemplateLiteralLoose(["\n display: flex;\n position: relative;\n align-items: center;\n padding: ", ";\n //width: ", ";\n min-width: ", ";\n //height: 70px;\n background: ", ";\n border: ", ";\n box-sizing: border-box;\n margin-right: ", ";\n border-radius: ", ";\n\n ", "\n\n & > ", " svg {\n width: 40px;\n height: 40px;\n }\n"])), function (props) {
40507
40631
  return !props.isRepliedMessage && '8px 12px;';
40508
40632
  }, function (props) {
40509
40633
  return !props.isRepliedMessage && (props.width ? props.width + "px" : '350px');
@@ -40520,25 +40644,25 @@ var AttachmentFile$1 = styled__default.div(_templateObject7$d || (_templateObjec
40520
40644
  }, function (props) {
40521
40645
  return !props.isRepliedMessage && !props.isPreview && !props.isUploading && "\n &:hover " + DownloadFile$1 + " {\n display: flex;\n }\n\n &:hover " + UploadPercent + " {\n border-radius: 50%\n }\n\n &:hover " + FileThumbnail + " {\n }\n &:hover " + AttachmentIconCont + " {\n display: none;\n }\n ";
40522
40646
  }, AttachmentIconCont);
40523
- var RemoveChosenFile = styled__default(SvgDeleteUpload)(_templateObject8$b || (_templateObject8$b = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 20px;\n height: 20px !important;\n top: -11px;\n right: -11px;\n padding: 2px;\n cursor: pointer;\n color: ", ";\n z-index: 5;\n circle {\n stroke: ", ";\n }\n path {\n stroke: ", ";\n }\n"])), function (props) {
40647
+ var RemoveChosenFile = styled__default(SvgDeleteUpload)(_templateObject0$8 || (_templateObject0$8 = _taggedTemplateLiteralLoose(["\n position: absolute;\n width: 20px;\n height: 20px !important;\n top: -11px;\n right: -11px;\n padding: 2px;\n cursor: pointer;\n color: ", ";\n z-index: 5;\n circle {\n stroke: ", ";\n }\n path {\n stroke: ", ";\n }\n"])), function (props) {
40524
40648
  return props.color;
40525
40649
  }, function (props) {
40526
40650
  return props.$backgroundColor;
40527
40651
  }, function (props) {
40528
40652
  return props.$backgroundColor;
40529
40653
  });
40530
- var AttachmentName = styled__default.h3(_templateObject9$9 || (_templateObject9$9 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n font-weight: 500;\n line-height: 18px;\n color: ", ";\n max-width: 275px;\n white-space: nowrap;\n margin: 0;\n"])), function (props) {
40654
+ var AttachmentName = styled__default.h3(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n font-size: 15px;\n font-weight: 500;\n line-height: 18px;\n color: ", ";\n max-width: 275px;\n white-space: nowrap;\n margin: 0;\n"])), function (props) {
40531
40655
  return props.color;
40532
40656
  });
40533
- var AttachmentSize = styled__default.span(_templateObject0$8 || (_templateObject0$8 = _taggedTemplateLiteralLoose(["\n font-size: 13px;\n color: ", ";\n & > span {\n color: ", ";\n margin-left: 8px;\n }\n"])), function (props) {
40657
+ var AttachmentSize = styled__default.span(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n font-size: 13px;\n color: ", ";\n & > span {\n color: ", ";\n margin-left: 8px;\n }\n"])), function (props) {
40534
40658
  return props.color;
40535
40659
  }, function (props) {
40536
40660
  return props.errorColor;
40537
40661
  });
40538
- var AttachmentFileInfo = styled__default.div(_templateObject1$8 || (_templateObject1$8 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
40662
+ var AttachmentFileInfo = styled__default.div(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n margin-left: 12px;\n ", "\n"])), function (props) {
40539
40663
  return props.isPreview && "line-height: 14px;\n max-width: calc(100% - 44px);\n ";
40540
40664
  });
40541
- var AttachmentImg = styled__default.img(_templateObject10$6 || (_templateObject10$6 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n width: ", ";\n height: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n opacity: ", ";\n transition: opacity 0.3s ease-in-out;\n"])), function (props) {
40665
+ var AttachmentImg = styled__default.img(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n position: ", ";\n border-radius: ", ";\n padding: ", ";\n box-sizing: border-box;\n width: ", ";\n height: ", ";\n object-fit: cover;\n visibility: ", ";\n z-index: 2;\n opacity: ", ";\n transition: opacity 0.3s ease-in-out;\n"])), function (props) {
40542
40666
  return props.absolute && 'absolute';
40543
40667
  }, function (props) {
40544
40668
  return props.isRepliedMessage ? '4px' : props.borderRadius || '6px';
@@ -40553,7 +40677,7 @@ var AttachmentImg = styled__default.img(_templateObject10$6 || (_templateObject1
40553
40677
  }, function (props) {
40554
40678
  return props.$shouldAnimate && !props.$isLoaded ? 0 : 1;
40555
40679
  });
40556
- var VideoCont = styled__default.div(_templateObject11$5 || (_templateObject11$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n cursor: pointer;\n height: ", ";\n"])), function (props) {
40680
+ var VideoCont = styled__default.div(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n position: relative;\n cursor: pointer;\n height: ", ";\n"])), function (props) {
40557
40681
  return props.isDetailsView && '100%';
40558
40682
  });
40559
40683
 
@@ -41936,7 +42060,7 @@ function SvgFilledCheckbox(props) {
41936
42060
  })));
41937
42061
  }
41938
42062
 
41939
- var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$q, _templateObject5$l, _templateObject6$i, _templateObject7$h, _templateObject8$f, _templateObject9$c, _templateObject0$b, _templateObject1$b, _templateObject10$9, _templateObject11$6, _templateObject12$4;
42063
+ var _templateObject$G, _templateObject2$B, _templateObject3$v, _templateObject4$q, _templateObject5$l, _templateObject6$i, _templateObject7$h, _templateObject8$f, _templateObject9$c, _templateObject0$b, _templateObject1$b, _templateObject10$9, _templateObject11$6, _templateObject12$5;
41940
42064
  var PollMessage = function PollMessage(_ref) {
41941
42065
  var _poll$voteDetails3, _poll$voteDetails4, _poll$voteDetails5, _poll$voteDetails6, _poll$voteDetails7;
41942
42066
  var message = _ref.message,
@@ -42127,7 +42251,7 @@ var Bar = styled__default.div(_templateObject10$9 || (_templateObject10$9 = _tag
42127
42251
  return p.track;
42128
42252
  });
42129
42253
  var Fill = styled__default.div(_templateObject11$6 || (_templateObject11$6 = _taggedTemplateLiteralLoose(["\n height: 100%;\n border-radius: 6px;\n transition: width 0.3s ease-in-out;\n"])));
42130
- var UsersContainer = styled__default.div(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n cursor: ", ";\n"])), function (p) {
42254
+ var UsersContainer = styled__default.div(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n margin-left: auto;\n padding-left: 16px;\n height: max-content;\n cursor: ", ";\n"])), function (p) {
42131
42255
  return p.cursor;
42132
42256
  });
42133
42257
 
@@ -43702,7 +43826,7 @@ function SvgCircleDashed(props) {
43702
43826
  })));
43703
43827
  }
43704
43828
 
43705
- var _templateObject$L, _templateObject2$G, _templateObject3$A, _templateObject4$v, _templateObject5$q, _templateObject6$m, _templateObject7$l, _templateObject8$j, _templateObject9$g, _templateObject0$f, _templateObject1$d, _templateObject10$a, _templateObject11$7, _templateObject12$5, _templateObject13$4;
43829
+ var _templateObject$L, _templateObject2$G, _templateObject3$A, _templateObject4$v, _templateObject5$q, _templateObject6$m, _templateObject7$l, _templateObject8$j, _templateObject9$g, _templateObject0$f, _templateObject1$d, _templateObject10$a, _templateObject11$7, _templateObject12$6, _templateObject13$5;
43706
43830
  var defaultFormatDate = function defaultFormatDate(date) {
43707
43831
  var m = moment(date);
43708
43832
  if (m.isSame(moment(), 'day')) {
@@ -44325,10 +44449,10 @@ var Content = styled__default.div(_templateObject1$d || (_templateObject1$d = _t
44325
44449
  });
44326
44450
  var P2PStatusList = styled__default.div(_templateObject10$a || (_templateObject10$a = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
44327
44451
  var P2PStatusRow = styled__default.div(_templateObject11$7 || (_templateObject11$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 4px;\n height: 48px;\n"])));
44328
- var P2PStatusLabel = styled__default.div(_templateObject12$5 || (_templateObject12$5 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (p) {
44452
+ var P2PStatusLabel = styled__default.div(_templateObject12$6 || (_templateObject12$6 = _taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Inter;\n font-weight: 500;\n font-size: 15px;\n line-height: 18px;\n letter-spacing: -0.2px;\n"])), function (p) {
44329
44453
  return p.color;
44330
44454
  });
44331
- var P2PStatusDate = styled__default.div(_templateObject13$4 || (_templateObject13$4 = _taggedTemplateLiteralLoose(["\n color: ", ";\n min-width: max-content;\n font-family: Inter;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: 0px;\n"])), function (p) {
44455
+ var P2PStatusDate = styled__default.div(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose(["\n color: ", ";\n min-width: max-content;\n font-family: Inter;\n font-weight: 400;\n font-size: 13px;\n line-height: 16px;\n letter-spacing: 0px;\n"])), function (p) {
44332
44456
  return p.color;
44333
44457
  });
44334
44458
 
@@ -52255,7 +52379,7 @@ var SettingItem = styled__default.div(_templateObject9$i || (_templateObject9$i
52255
52379
  return props.color;
52256
52380
  });
52257
52381
 
52258
- var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$j, _templateObject0$h, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$6, _templateObject13$5, _templateObject14$4, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45;
52382
+ var _templateObject$W, _templateObject2$R, _templateObject3$I, _templateObject4$C, _templateObject5$x, _templateObject6$t, _templateObject7$q, _templateObject8$n, _templateObject9$j, _templateObject0$h, _templateObject1$f, _templateObject10$c, _templateObject11$9, _templateObject12$7, _templateObject13$6, _templateObject14$4, _templateObject15$2, _templateObject16$2, _templateObject17$2, _templateObject18$2, _templateObject19$2, _templateObject20$2, _templateObject21$2, _templateObject22$1, _templateObject23$1, _templateObject24$1, _templateObject25$1, _templateObject26$1, _templateObject27$1, _templateObject28$1, _templateObject29$1, _templateObject30$1, _templateObject31$1, _templateObject32$1, _templateObject33$1, _templateObject34$1, _templateObject35$1, _templateObject36$1, _templateObject37$1, _templateObject38$1, _templateObject39$1, _templateObject40$1, _templateObject41$1, _templateObject42, _templateObject43, _templateObject44, _templateObject45;
52259
52383
  function AutoFocusPlugin(_ref) {
52260
52384
  var messageForReply = _ref.messageForReply;
52261
52385
  var _useLexicalComposerCo = LexicalComposerContext.useLexicalComposerContext(),
@@ -52810,7 +52934,8 @@ var SendMessageInput = function SendMessageInput(_ref3) {
52810
52934
  upload: attachment.upload,
52811
52935
  metadata: attachment.metadata,
52812
52936
  type: attachment.type,
52813
- size: attachment.size
52937
+ size: attachment.size,
52938
+ thumbnailState: attachment.thumbnailState
52814
52939
  };
52815
52940
  });
52816
52941
  if (viewOnce && canShowViewOnceToggle) {
@@ -52954,10 +53079,14 @@ var SendMessageInput = function SendMessageInput(_ref3) {
52954
53079
  var updatedAttachments = attachmentsUpdate.filter(function (item) {
52955
53080
  return item.tid !== attachmentId;
52956
53081
  });
53082
+ clearVideoPreparation(attachmentId);
52957
53083
  releaseBlobUrls(["compose_" + attachmentId]);
52958
53084
  setAttachments(updatedAttachments);
52959
53085
  attachmentsUpdate = updatedAttachments;
52960
53086
  } else {
53087
+ attachmentsUpdate.forEach(function (attachment) {
53088
+ return clearVideoPreparation(attachment.tid);
53089
+ });
52961
53090
  releaseBlobUrls(attachmentsUpdate.map(function (item) {
52962
53091
  return "compose_" + item.tid;
52963
53092
  }));
@@ -53189,260 +53318,213 @@ var SendMessageInput = function SendMessageInput(_ref3) {
53189
53318
  };
53190
53319
  var handleAddAttachment = function handleAddAttachment(file, isMediaAttachment) {
53191
53320
  try {
53192
- var _temp4 = function _temp4() {
53193
- var fileType = file.type.split('/')[0];
53194
- var tid = uuid.v4();
53195
- var reader = new FileReader();
53196
- var handleAttachmentImageForCache = function handleAttachmentImageForCache(attachment) {
53197
- try {
53198
- var _attachment$metadata;
53199
- var url = URL.createObjectURL(attachment.data);
53200
- dispatch(setUpdateMessageAttachmentAC((attachment === null || attachment === void 0 ? void 0 : (_attachment$metadata = attachment.metadata) === null || _attachment$metadata === void 0 ? void 0 : _attachment$metadata.tmb) || '', url));
53201
- return Promise.resolve();
53202
- } catch (e) {
53203
- return Promise.reject(e);
53204
- }
53205
- };
53206
- var handleAttachmentVideoForCache = function handleAttachmentVideoForCache(attachment) {
53207
- try {
53208
- var _calculateRenderedIma = calculateRenderedImageWidth(attachment.metadata.szh || 400, attachment.metadata.szh || 400),
53209
- newWidth = _calculateRenderedIma[0],
53210
- newHeight = _calculateRenderedIma[1];
53211
- return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
53212
- if (result) {
53213
- var _attachment$metadata2;
53214
- var frameBlobUrl = result.frameBlobUrl;
53215
- dispatch(setUpdateMessageAttachmentAC((attachment === null || attachment === void 0 ? void 0 : (_attachment$metadata2 = attachment.metadata) === null || _attachment$metadata2 === void 0 ? void 0 : _attachment$metadata2.tmb) || '', frameBlobUrl));
53216
- }
53217
- });
53218
- } catch (e) {
53219
- return Promise.reject(e);
53220
- }
53221
- };
53222
- reader.onload = function () {
53223
- try {
53224
- setPendingAttachment(tid, {
53225
- file: file
53226
- });
53227
- var _temp0 = function () {
53228
- if (customUploader) {
53229
- var _temp6 = function () {
53230
- if (fileType === 'image') {
53231
- resizeImage(file).then(function (resizedFile) {
53232
- try {
53233
- return Promise.resolve(createImageThumbnail(file)).then(function (_ref4) {
53234
- var _resizedFile$blob;
53235
- var thumbnail = _ref4.thumbnail,
53236
- imageWidth = _ref4.imageWidth,
53237
- imageHeight = _ref4.imageHeight;
53238
- var attachment = {
53239
- data: file,
53240
- upload: false,
53241
- type: isMediaAttachment ? fileType : 'file',
53242
- attachmentUrl: createComposePreviewUrl(tid, resizedFile.blob),
53243
- tid: tid,
53244
- size: isMediaAttachment ? resizedFile !== null && resizedFile !== void 0 && resizedFile.blob ? resizedFile === null || resizedFile === void 0 ? void 0 : (_resizedFile$blob = resizedFile.blob) === null || _resizedFile$blob === void 0 ? void 0 : _resizedFile$blob.size : file.size : file.size,
53245
- metadata: {
53246
- szw: imageWidth,
53247
- szh: imageHeight,
53248
- tmb: thumbnail
53249
- }
53250
- };
53251
- handleAttachmentImageForCache(attachment);
53252
- setAttachments(function (prevState) {
53253
- return [].concat(prevState, [attachment]);
53254
- });
53255
- });
53256
- } catch (e) {
53257
- return Promise.reject(e);
53258
- }
53259
- });
53260
- } else {
53261
- var _temp1 = function () {
53262
- if (fileType === 'video') {
53263
- return Promise.resolve(getFrame(file, 0)).then(function (_ref5) {
53264
- var thumb = _ref5.thumb,
53265
- width = _ref5.width,
53266
- height = _ref5.height,
53267
- duration = _ref5.duration;
53268
- var attachment = {
53269
- data: file,
53270
- upload: false,
53271
- type: isMediaAttachment ? fileType : 'file',
53272
- attachmentUrl: createComposePreviewUrl(tid, file),
53273
- tid: tid,
53274
- size: file.size,
53275
- metadata: {
53276
- szw: width,
53277
- szh: height,
53278
- tmb: thumb,
53279
- dur: duration
53280
- }
53281
- };
53282
- handleAttachmentVideoForCache(attachment);
53283
- setAttachments(function (prevState) {
53284
- return [].concat(prevState, [attachment]);
53285
- });
53286
- });
53287
- } else {
53288
- setAttachments(function (prevState) {
53289
- return [].concat(prevState, [{
53290
- data: file,
53291
- upload: false,
53292
- type: 'file',
53293
- tid: tid,
53294
- size: file.size
53295
- }]);
53296
- });
53297
- }
53298
- }();
53299
- if (_temp1 && _temp1.then) return _temp1.then(function () {});
53300
- }
53301
- }();
53302
- if (_temp6 && _temp6.then) return _temp6.then(function () {});
53303
- } else {
53304
- var _temp9 = function () {
53305
- if (fileType === 'image') {
53306
- var _temp7 = function () {
53307
- if (isMediaAttachment) {
53308
- return Promise.resolve(createImageThumbnail(file)).then(function (_ref6) {
53309
- var thumbnail = _ref6.thumbnail,
53310
- imageWidth = _ref6.imageWidth,
53311
- imageHeight = _ref6.imageHeight;
53312
- var metas = {
53313
- thumbnail: thumbnail,
53314
- imageWidth: imageWidth,
53315
- imageHeight: imageHeight
53316
- };
53317
- if (file.type === 'image/gif') {
53318
- setAttachments(function (prevState) {
53319
- return [].concat(prevState, [{
53320
- data: file,
53321
- upload: true,
53322
- attachmentUrl: createComposePreviewUrl(tid, file),
53323
- tid: tid,
53324
- type: fileType,
53325
- size: file.size,
53326
- metadata: JSON.stringify({
53327
- tmb: metas.thumbnail,
53328
- szw: metas.imageWidth,
53329
- szh: metas.imageHeight
53330
- })
53331
- }]);
53332
- });
53333
- } else {
53334
- resizeImage(file).then(function (resizedFileData) {
53335
- try {
53336
- var resizedFile = new File([resizedFileData.blob], resizedFileData.file.name);
53337
- var attachment = {
53338
- data: resizedFile,
53339
- upload: true,
53340
- attachmentUrl: createComposePreviewUrl(tid, resizedFile),
53341
- tid: tid,
53342
- type: fileType,
53343
- size: resizedFile.size,
53344
- metadata: JSON.stringify({
53345
- tmb: metas.thumbnail,
53346
- szw: resizedFileData.newWidth,
53347
- szh: resizedFileData.newHeight
53348
- })
53349
- };
53350
- handleAttachmentImageForCache(attachment);
53351
- setAttachments(function (prevState) {
53352
- return [].concat(prevState, [attachment]);
53353
- });
53354
- return Promise.resolve();
53355
- } catch (e) {
53356
- return Promise.reject(e);
53357
- }
53358
- });
53321
+ var customUploader = getCustomUploader();
53322
+ var fileType = file.type.split('/')[0];
53323
+ var tid = uuid.v4();
53324
+ var handleAttachmentImageForCache = function handleAttachmentImageForCache(attachment) {
53325
+ try {
53326
+ var _attachment$metadata;
53327
+ var url = URL.createObjectURL(attachment.data);
53328
+ dispatch(setUpdateMessageAttachmentAC((attachment === null || attachment === void 0 ? void 0 : (_attachment$metadata = attachment.metadata) === null || _attachment$metadata === void 0 ? void 0 : _attachment$metadata.tmb) || '', url));
53329
+ return Promise.resolve();
53330
+ } catch (e) {
53331
+ return Promise.reject(e);
53332
+ }
53333
+ };
53334
+ var handleAttachmentVideoForCache = function handleAttachmentVideoForCache(attachment) {
53335
+ try {
53336
+ var _calculateRenderedIma = calculateRenderedImageWidth(attachment.metadata.szh || 400, attachment.metadata.szh || 400),
53337
+ newWidth = _calculateRenderedIma[0],
53338
+ newHeight = _calculateRenderedIma[1];
53339
+ return Promise.resolve(getVideoFirstFrame(attachment.data, newWidth, newHeight)).then(function (result) {
53340
+ if (result) {
53341
+ var _attachment$metadata2;
53342
+ var frameBlobUrl = result.frameBlobUrl;
53343
+ dispatch(setUpdateMessageAttachmentAC((attachment === null || attachment === void 0 ? void 0 : (_attachment$metadata2 = attachment.metadata) === null || _attachment$metadata2 === void 0 ? void 0 : _attachment$metadata2.tmb) || '', frameBlobUrl));
53344
+ }
53345
+ });
53346
+ } catch (e) {
53347
+ return Promise.reject(e);
53348
+ }
53349
+ };
53350
+ setPendingAttachment(tid, {
53351
+ file: file
53352
+ });
53353
+ if (fileType === 'video') {
53354
+ beginVideoPreparation(tid, file);
53355
+ }
53356
+ var type = fileType === 'video' && (!customUploader || isMediaAttachment) ? 'video' : isMediaAttachment && fileType === 'image' ? 'image' : 'file';
53357
+ var attachment = _extends({
53358
+ data: file,
53359
+ upload: !customUploader,
53360
+ type: type,
53361
+ tid: tid,
53362
+ size: file.size
53363
+ }, fileType === 'video' && !isMediaAttachment ? {
53364
+ thumbnailState: 'loading'
53365
+ } : {}, fileType === 'image' || fileType === 'video' ? {
53366
+ attachmentUrl: createComposePreviewUrl(tid, file),
53367
+ metadata: customUploader ? {} : '{}'
53368
+ } : {});
53369
+ setAttachments(function (prevState) {
53370
+ return [].concat(prevState, [attachment]);
53371
+ });
53372
+ var updateAttachment = function updateAttachment(patch) {
53373
+ setAttachments(function (prevState) {
53374
+ return prevState.map(function (current) {
53375
+ return current.tid === tid ? _extends({}, current, patch) : current;
53376
+ });
53377
+ });
53378
+ };
53379
+ setTimeout(function () {
53380
+ try {
53381
+ var _temp1 = function () {
53382
+ if (fileType === 'image') {
53383
+ var _temp5 = _catch(function () {
53384
+ return Promise.resolve(createImageThumbnail(file)).then(function (_ref4) {
53385
+ var thumbnail = _ref4.thumbnail,
53386
+ imageWidth = _ref4.imageWidth,
53387
+ imageHeight = _ref4.imageHeight;
53388
+ var _temp4 = function () {
53389
+ if (customUploader) {
53390
+ return Promise.resolve(resizeImage(file)).then(function (resizedFile) {
53391
+ var patch = {
53392
+ size: isMediaAttachment && resizedFile !== null && resizedFile !== void 0 && resizedFile.blob ? resizedFile.blob.size : file.size,
53393
+ metadata: {
53394
+ szw: imageWidth,
53395
+ szh: imageHeight,
53396
+ tmb: thumbnail
53359
53397
  }
53360
- });
53361
- } else {
53362
- return Promise.resolve(createImageThumbnail(file, undefined, 50, 50)).then(function (_ref7) {
53363
- var thumbnail = _ref7.thumbnail;
53364
- setAttachments(function (prevState) {
53365
- return [].concat(prevState, [{
53366
- data: file,
53367
- type: 'file',
53368
- upload: true,
53369
- attachmentUrl: createComposePreviewUrl(tid, file),
53370
- tid: tid,
53371
- size: file.size,
53398
+ };
53399
+ updateAttachment(patch);
53400
+ handleAttachmentImageForCache(_extends({}, attachment, patch));
53401
+ });
53402
+ } else {
53403
+ var _temp10 = function () {
53404
+ if (isMediaAttachment && file.type !== 'image/gif') {
53405
+ return Promise.resolve(resizeImage(file)).then(function (resizedFileData) {
53406
+ var resizedFile = resizedFileData.blob ? new File([resizedFileData.blob], resizedFileData.file.name, {
53407
+ type: file.type
53408
+ }) : file;
53409
+ var patch = {
53410
+ data: resizedFile,
53411
+ size: resizedFile.size,
53372
53412
  metadata: JSON.stringify({
53373
- tmb: thumbnail
53413
+ tmb: thumbnail,
53414
+ szw: resizedFileData.newWidth,
53415
+ szh: resizedFileData.newHeight
53374
53416
  })
53375
- }]);
53417
+ };
53418
+ updateAttachment(patch);
53419
+ setPendingAttachment(tid, {
53420
+ file: resizedFile
53421
+ });
53422
+ handleAttachmentImageForCache(_extends({}, attachment, patch));
53423
+ });
53424
+ } else {
53425
+ updateAttachment({
53426
+ metadata: JSON.stringify({
53427
+ tmb: thumbnail,
53428
+ szw: imageWidth,
53429
+ szh: imageHeight
53430
+ })
53376
53431
  });
53432
+ }
53433
+ }();
53434
+ if (_temp10 && _temp10.then) return _temp10.then(function () {});
53435
+ }
53436
+ }();
53437
+ if (_temp4 && _temp4.then) return _temp4.then(function () {});
53438
+ });
53439
+ }, function (error) {
53440
+ log.warn('Unable to prepare image attachment preview:', error);
53441
+ });
53442
+ if (_temp5 && _temp5.then) return _temp5.then(function () {});
53443
+ } else {
53444
+ var _temp11 = function () {
53445
+ if (fileType === 'video') {
53446
+ var _temp9 = function _temp9() {
53447
+ return Promise.resolve(remuxPromise).then(function (uploadFile) {
53448
+ if (uploadFile !== file) {
53449
+ updateAttachment({
53450
+ data: uploadFile,
53451
+ size: uploadFile.size
53452
+ });
53453
+ setPendingAttachment(tid, {
53454
+ file: uploadFile
53377
53455
  });
53378
53456
  }
53379
- }();
53380
- if (_temp7 && _temp7.then) return _temp7.then(function () {});
53381
- } else {
53382
- var _temp10 = function () {
53383
- if (fileType === 'video') {
53384
- return Promise.resolve(getFrame(file, 0)).then(function (_ref8) {
53385
- var thumb = _ref8.thumb,
53386
- width = _ref8.width,
53387
- height = _ref8.height,
53388
- duration = _ref8.duration;
53389
- var metas = JSON.stringify({
53390
- tmb: thumb,
53391
- width: width,
53392
- height: height,
53393
- dur: duration
53394
- });
53395
- var attachment = {
53396
- data: file,
53397
- type: 'video',
53398
- upload: true,
53399
- size: file.size,
53400
- attachmentUrl: createComposePreviewUrl(tid, file),
53401
- tid: tid,
53402
- metadata: metas
53403
- };
53404
- handleAttachmentVideoForCache(attachment);
53405
- setAttachments(function (prevState) {
53406
- return [].concat(prevState, [attachment]);
53407
- });
53457
+ if (metadata) {
53458
+ completeVideoPreparation(tid, {
53459
+ file: uploadFile,
53460
+ metadata: metadata
53408
53461
  });
53409
53462
  } else {
53410
- setAttachments(function (prevState) {
53411
- return [].concat(prevState, [{
53412
- data: file,
53413
- upload: true,
53414
- type: 'file',
53415
- size: file.size,
53416
- tid: tid
53417
- }]);
53463
+ failVideoPreparation(tid);
53464
+ updateAttachment({
53465
+ thumbnailState: 'failed'
53418
53466
  });
53419
53467
  }
53420
- }();
53421
- if (_temp10 && _temp10.then) return _temp10.then(function () {});
53422
- }
53423
- }();
53424
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
53425
- }
53426
- }();
53427
- return Promise.resolve(_temp0 && _temp0.then ? _temp0.then(function () {}) : void 0);
53428
- } catch (e) {
53429
- return Promise.reject(e);
53430
- }
53431
- };
53432
- reader.onerror = function (e) {
53433
- log.info(' error on read file onError', e);
53434
- };
53435
- reader.readAsBinaryString(file);
53436
- };
53437
- var customUploader = getCustomUploader();
53438
- var _temp3 = function () {
53439
- if (file.type.split('/')[0] === 'video') {
53440
- return Promise.resolve(remuxVideoFileForUpload(file)).then(function (_remuxVideoFileForUpl) {
53441
- file = _remuxVideoFileForUpl;
53442
- });
53468
+ });
53469
+ };
53470
+ var remuxPromise = remuxVideoFileForUpload(file);
53471
+ var thumbnailSource = file;
53472
+ var metadata;
53473
+ var _temp8 = _catch(function () {
53474
+ function _temp7() {
53475
+ var _frame = frame,
53476
+ thumb = _frame.thumb,
53477
+ width = _frame.width,
53478
+ height = _frame.height,
53479
+ duration = _frame.duration;
53480
+ metadata = customUploader ? {
53481
+ szw: width,
53482
+ szh: height,
53483
+ tmb: thumb,
53484
+ dur: duration
53485
+ } : JSON.stringify({
53486
+ tmb: thumb,
53487
+ szw: width,
53488
+ szh: height,
53489
+ dur: duration
53490
+ });
53491
+ updateAttachment({
53492
+ metadata: metadata,
53493
+ thumbnailState: 'ready'
53494
+ });
53495
+ handleAttachmentVideoForCache(_extends({}, attachment, {
53496
+ metadata: metadata
53497
+ }));
53498
+ }
53499
+ var frame;
53500
+ var _temp6 = _catch(function () {
53501
+ return Promise.resolve(getFrame(thumbnailSource, 0)).then(function (_getFrame) {
53502
+ frame = _getFrame;
53503
+ });
53504
+ }, function () {
53505
+ return Promise.resolve(remuxPromise).then(function (_remuxPromise) {
53506
+ thumbnailSource = _remuxPromise;
53507
+ return Promise.resolve(getFrame(thumbnailSource, 0)).then(function (_getFrame2) {
53508
+ frame = _getFrame2;
53509
+ });
53510
+ });
53511
+ });
53512
+ return _temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6);
53513
+ }, function (error) {
53514
+ log.warn('Unable to generate video thumbnail:', error);
53515
+ });
53516
+ return _temp8 && _temp8.then ? _temp8.then(_temp9) : _temp9(_temp8);
53517
+ }
53518
+ }();
53519
+ if (_temp11 && _temp11.then) return _temp11.then(function () {});
53520
+ }
53521
+ }();
53522
+ return Promise.resolve(_temp1 && _temp1.then ? _temp1.then(function () {}) : void 0);
53523
+ } catch (e) {
53524
+ return Promise.reject(e);
53443
53525
  }
53444
- }();
53445
- return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
53526
+ }, 0);
53527
+ return Promise.resolve();
53446
53528
  } catch (e) {
53447
53529
  return Promise.reject(e);
53448
53530
  }
@@ -53501,14 +53583,14 @@ var SendMessageInput = function SendMessageInput(_ref3) {
53501
53583
  }
53502
53584
  }
53503
53585
  }
53504
- var _temp11 = function () {
53586
+ var _temp12 = function () {
53505
53587
  if (allowUpload) {
53506
53588
  return Promise.resolve(handleAddAttachmentWithViewOnceCheck(file, isMediaAttachment)).then(function () {});
53507
53589
  } else {
53508
53590
  showFileUploadError(errorMessage);
53509
53591
  }
53510
53592
  }();
53511
- return Promise.resolve(_temp11 && _temp11.then ? _temp11.then(function () {}) : void 0);
53593
+ return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
53512
53594
  } catch (e) {
53513
53595
  return Promise.reject(e);
53514
53596
  }
@@ -53611,18 +53693,7 @@ var SendMessageInput = function SendMessageInput(_ref3) {
53611
53693
  React.useEffect(function () {
53612
53694
  if (messageText.trim() || editMessageText !== null && editMessageText !== void 0 && editMessageText.trim() && editMessageText && (editMessageText === null || editMessageText === void 0 ? void 0 : editMessageText.trim()) !== (messageToEdit === null || messageToEdit === void 0 ? void 0 : messageToEdit.body) || attachments.length) {
53613
53695
  if (attachments.length) {
53614
- var videoAttachment = false;
53615
- attachments.forEach(function (att) {
53616
- if ((att.type === 'video' || att.data.type.split('/')[0] === 'video') && att.type !== 'file') {
53617
- videoAttachment = true;
53618
- if (readyVideoAttachments[att.tid]) {
53619
- setSendMessageIsActive(true);
53620
- }
53621
- }
53622
- });
53623
- if (!videoAttachment) {
53624
- setSendMessageIsActive(true);
53625
- }
53696
+ setSendMessageIsActive(true);
53626
53697
  } else {
53627
53698
  setSendMessageIsActive(true);
53628
53699
  }
@@ -54305,14 +54376,14 @@ var SendMessageInputContainer = styled__default.div(_templateObject11$9 || (_tem
54305
54376
  }, AddAttachmentIcon, function (props) {
54306
54377
  return props.iconColor;
54307
54378
  });
54308
- var MessageInputWrapper = styled__default.div(_templateObject12$6 || (_templateObject12$6 = _taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n max-width: calc(100% - 50px);\n //max-width: ", ";\n //max-width: calc(100% - 110px);\n background-color: ", ";\n border-radius: ", ";\n position: relative;\n"])), function (props) {
54379
+ var MessageInputWrapper = styled__default.div(_templateObject12$7 || (_templateObject12$7 = _taggedTemplateLiteralLoose(["\n display: flex;\n width: 100%;\n max-width: calc(100% - 50px);\n //max-width: ", ";\n //max-width: calc(100% - 110px);\n background-color: ", ";\n border-radius: ", ";\n position: relative;\n"])), function (props) {
54309
54380
  return props.channelDetailsIsOpen ? "calc(100% - " + (props.channelDetailsIsOpen ? 362 : 0) + "px)" : '';
54310
54381
  }, function (props) {
54311
54382
  return props.backgroundColor;
54312
54383
  }, function (props) {
54313
54384
  return props.borderRadius || '18px';
54314
54385
  });
54315
- var LexicalWrapper = styled__default.div(_templateObject13$5 || (_templateObject13$5 = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n\n & .rich_text_editor {\n width: 100%;\n max-height: 80px;\n min-height: 20px;\n display: block;\n border: none;\n box-sizing: border-box;\n outline: none !important;\n border-radius: ", ";\n background-color: ", ";\n padding: ", ";\n color: ", ";\n order: ", ";\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n\n & p {\n font-size: 15px;\n line-height: 20px;\n color: ", ";\n }\n\n &::selection {\n background-color: ", ";\n }\n\n & *::selection {\n background-color: ", ";\n }\n\n & span::selection {\n background-color: ", ";\n }\n\n &:empty:before {\n content: attr(data-placeholder);\n }\n\n & .content_editable_input {\n border: none !important;\n outline: none !important;\n }\n\n & .mention {\n color: ", ";\n background-color: inherit !important;\n user-modify: read-only;\n }\n\n & span.bold {\n font-weight: bold;\n }\n\n & .editor_paragraph {\n margin: 0;\n }\n\n & .text_bold {\n font-weight: 600;\n }\n\n & .text_italic {\n font-style: italic;\n }\n\n & .text_underline {\n text-decoration: underline;\n }\n\n & .text_strikethrough {\n text-decoration: line-through;\n }\n\n & .text_underlineStrikethrough {\n text-decoration: underline line-through;\n }\n\n & code {\n font-family: inherit;\n letter-spacing: 4px;\n }\n }\n"])), function (props) {
54386
+ var LexicalWrapper = styled__default.div(_templateObject13$6 || (_templateObject13$6 = _taggedTemplateLiteralLoose(["\n position: relative;\n width: 100%;\n\n & .rich_text_editor {\n width: 100%;\n max-height: 80px;\n min-height: 20px;\n display: block;\n border: none;\n box-sizing: border-box;\n outline: none !important;\n border-radius: ", ";\n background-color: ", ";\n padding: ", ";\n color: ", ";\n order: ", ";\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-width: none;\n scrollbar-color: transparent transparent;\n overscroll-behavior: none;\n\n @supports (overflow: overlay) {\n overflow-y: overlay;\n }\n\n &::-webkit-scrollbar {\n width: 8px;\n background: transparent;\n }\n &::-webkit-scrollbar-thumb {\n background: transparent;\n }\n\n &.show-scrollbar::-webkit-scrollbar-thumb {\n background: ", ";\n border-radius: 4px;\n }\n &.show-scrollbar::-webkit-scrollbar-track {\n background: transparent;\n }\n\n &.show-scrollbar {\n scrollbar-width: thin;\n scrollbar-color: ", " transparent;\n }\n\n & p {\n font-size: 15px;\n line-height: 20px;\n color: ", ";\n }\n\n &::selection {\n background-color: ", ";\n }\n\n & *::selection {\n background-color: ", ";\n }\n\n & span::selection {\n background-color: ", ";\n }\n\n &:empty:before {\n content: attr(data-placeholder);\n }\n\n & .content_editable_input {\n border: none !important;\n outline: none !important;\n }\n\n & .mention {\n color: ", ";\n background-color: inherit !important;\n user-modify: read-only;\n }\n\n & span.bold {\n font-weight: bold;\n }\n\n & .editor_paragraph {\n margin: 0;\n }\n\n & .text_bold {\n font-weight: 600;\n }\n\n & .text_italic {\n font-style: italic;\n }\n\n & .text_underline {\n text-decoration: underline;\n }\n\n & .text_strikethrough {\n text-decoration: line-through;\n }\n\n & .text_underlineStrikethrough {\n text-decoration: underline line-through;\n }\n\n & code {\n font-family: inherit;\n letter-spacing: 4px;\n }\n }\n"])), function (props) {
54316
54387
  return props.borderRadius;
54317
54388
  }, function (props) {
54318
54389
  return props.backgroundColor;
@@ -55184,7 +55255,7 @@ var EmptyText = styled__default.div(_templateObject7$s || (_templateObject7$s =
55184
55255
  });
55185
55256
  var ChevronRightIconWrapper = styled__default.span(_templateObject8$p || (_templateObject8$p = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n\n & > svg {\n width: 16px;\n height: 16px;\n transform: rotate(-90deg);\n }\n"])));
55186
55257
 
55187
- var _templateObject$_, _templateObject2$V, _templateObject3$M, _templateObject4$F, _templateObject5$A, _templateObject6$w, _templateObject7$t, _templateObject8$q, _templateObject9$k, _templateObject0$i, _templateObject1$g, _templateObject10$d, _templateObject11$a, _templateObject12$7, _templateObject13$6, _templateObject14$5, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3, _templateObject19$3, _templateObject20$3;
55258
+ var _templateObject$_, _templateObject2$V, _templateObject3$M, _templateObject4$F, _templateObject5$A, _templateObject6$w, _templateObject7$t, _templateObject8$q, _templateObject9$k, _templateObject0$i, _templateObject1$g, _templateObject10$d, _templateObject11$a, _templateObject12$8, _templateObject13$7, _templateObject14$5, _templateObject15$3, _templateObject16$3, _templateObject17$3, _templateObject18$3, _templateObject19$3, _templateObject20$3;
55188
55259
  var Actions = function Actions(_ref) {
55189
55260
  var _getDisappearingSetti;
55190
55261
  var setActionsHeight = _ref.setActionsHeight,
@@ -55721,8 +55792,8 @@ var DefaultMarkAsRead = styled__default(SvgMarkAsRead)(_templateObject0$i || (_t
55721
55792
  var DefaultMarkAsUnRead = styled__default(SvgMarkAsUnRead)(_templateObject1$g || (_templateObject1$g = _taggedTemplateLiteralLoose([""])));
55722
55793
  var DefaultBlockIcon = styled__default(SvgBlockChannel)(_templateObject10$d || (_templateObject10$d = _taggedTemplateLiteralLoose([""])));
55723
55794
  var DefaultReportIcon = styled__default(SvgReport)(_templateObject11$a || (_templateObject11$a = _taggedTemplateLiteralLoose([""])));
55724
- var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$7 || (_templateObject12$7 = _taggedTemplateLiteralLoose([""])));
55725
- var DefaultDeleteChannelIcon = styled__default(SvgDeleteChannel)(_templateObject13$6 || (_templateObject13$6 = _taggedTemplateLiteralLoose([""])));
55795
+ var DefaultClearIcon = styled__default(SvgClear)(_templateObject12$8 || (_templateObject12$8 = _taggedTemplateLiteralLoose([""])));
55796
+ var DefaultDeleteChannelIcon = styled__default(SvgDeleteChannel)(_templateObject13$7 || (_templateObject13$7 = _taggedTemplateLiteralLoose([""])));
55726
55797
  var DefaultBottomIcon = styled__default(SvgBottom)(_templateObject14$5 || (_templateObject14$5 = _taggedTemplateLiteralLoose([""])));
55727
55798
  var DefaultMarkAsReadIcon = styled__default(SvgLeave)(_templateObject15$3 || (_templateObject15$3 = _taggedTemplateLiteralLoose([""])));
55728
55799
  var DefaultWatchIcon = styled__default(SvgWatch)(_templateObject16$3 || (_templateObject16$3 = _taggedTemplateLiteralLoose(["\n width: 24px;\n height: 24px;\n\n path.watch-ticks,\n path:nth-child(2) {\n fill: ", " !important;\n }\n"])), function (props) {
@@ -55911,7 +55982,7 @@ function SvgDownloadFile(props) {
55911
55982
  })));
55912
55983
  }
55913
55984
 
55914
- var _templateObject$10, _templateObject2$X, _templateObject3$O, _templateObject4$H, _templateObject5$C, _templateObject6$y, _templateObject7$v, _templateObject8$s, _templateObject9$m, _templateObject0$k, _templateObject1$h, _templateObject10$e, _templateObject11$b, _templateObject12$8, _templateObject13$7, _templateObject14$6, _templateObject15$4;
55985
+ var _templateObject$10, _templateObject2$X, _templateObject3$O, _templateObject4$H, _templateObject5$C, _templateObject6$y, _templateObject7$v, _templateObject8$s, _templateObject9$m, _templateObject0$k, _templateObject1$h, _templateObject10$e, _templateObject11$b, _templateObject12$9, _templateObject13$8, _templateObject14$6, _templateObject15$4;
55915
55986
  var Files = function Files(_ref) {
55916
55987
  var channelId = _ref.channelId,
55917
55988
  filePreviewIcon = _ref.filePreviewIcon,
@@ -56126,12 +56197,12 @@ var FileIconCont = styled__default.span(_templateObject11$b || (_templateObject1
56126
56197
  }, function (props) {
56127
56198
  return props.fillColor;
56128
56199
  });
56129
- var FileHoverIconCont = styled__default.span(_templateObject12$8 || (_templateObject12$8 = _taggedTemplateLiteralLoose(["\n display: none;\n & > svg {\n width: 40px;\n height: 40px;\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
56200
+ var FileHoverIconCont = styled__default.span(_templateObject12$9 || (_templateObject12$9 = _taggedTemplateLiteralLoose(["\n display: none;\n & > svg {\n width: 40px;\n height: 40px;\n color: ", ";\n rect {\n fill: ", ";\n }\n }\n"])), function (props) {
56130
56201
  return props.iconColor;
56131
56202
  }, function (props) {
56132
56203
  return props.fillColor;
56133
56204
  });
56134
- var FileThumb = styled__default.img(_templateObject13$7 || (_templateObject13$7 = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n object-fit: cover;\n"])));
56205
+ var FileThumb = styled__default.img(_templateObject13$8 || (_templateObject13$8 = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border: 0.5px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n object-fit: cover;\n"])));
56135
56206
  var FileItem = styled__default.div(_templateObject14$6 || (_templateObject14$6 = _taggedTemplateLiteralLoose(["\n position: relative;\n padding: 11px 16px;\n display: flex;\n align-items: center;\n font-size: 15px;\n transition: all 0.2s;\n div {\n margin-left: 7px;\n width: calc(100% - 48px);\n }\n &:hover {\n background-color: ", ";\n ", " {\n visibility: visible;\n }\n & ", " {\n display: none;\n }\n & ", " {\n display: inline-flex;\n }\n }\n"])), function (props) {
56136
56207
  return props.hoverBackgroundColor;
56137
56208
  }, DownloadWrapper, FileIconCont, FileHoverIconCont);
@@ -56820,7 +56891,7 @@ function ResetLinkConfirmModal(_ref) {
56820
56891
  });
56821
56892
  }
56822
56893
 
56823
- var _templateObject$16, _templateObject2$11, _templateObject3$U, _templateObject4$M, _templateObject5$H, _templateObject6$C, _templateObject7$z, _templateObject8$w, _templateObject9$p, _templateObject0$m, _templateObject1$i, _templateObject10$f, _templateObject11$c, _templateObject12$9, _templateObject13$8;
56894
+ var _templateObject$16, _templateObject2$11, _templateObject3$U, _templateObject4$M, _templateObject5$H, _templateObject6$C, _templateObject7$z, _templateObject8$w, _templateObject9$p, _templateObject0$m, _templateObject1$i, _templateObject10$f, _templateObject11$c, _templateObject12$a, _templateObject13$9;
56824
56895
  function loadImage$1(src) {
56825
56896
  return new Promise(function (resolve, reject) {
56826
56897
  var img = document.createElement('img');
@@ -57437,16 +57508,16 @@ var Switch = styled__default.div(_templateObject10$f || (_templateObject10$f = _
57437
57508
  return p.active ? '22px' : '3px';
57438
57509
  });
57439
57510
  var ResetLink = styled__default.button(_templateObject11$c || (_templateObject11$c = _taggedTemplateLiteralLoose(["\n margin-top: 12px;\n border: none;\n background: transparent;\n color: #ff4d4f;\n cursor: pointer;\n"])));
57440
- var QRCodeBox = styled__default.div(_templateObject12$9 || (_templateObject12$9 = _taggedTemplateLiteralLoose(["\n border-radius: 8px;\n border: 1px solid ", ";\n background-color: ", ";\n display: flex;\n width: max-content;\n padding: 13.5px;\n margin: auto;\n position: relative;\n"])), function (p) {
57511
+ var QRCodeBox = styled__default.div(_templateObject12$a || (_templateObject12$a = _taggedTemplateLiteralLoose(["\n border-radius: 8px;\n border: 1px solid ", ";\n background-color: ", ";\n display: flex;\n width: max-content;\n padding: 13.5px;\n margin: auto;\n position: relative;\n"])), function (p) {
57441
57512
  return p.borderColor;
57442
57513
  }, function (p) {
57443
57514
  return p.backgroundColor;
57444
57515
  });
57445
- var QrHint = styled__default.p(_templateObject13$8 || (_templateObject13$8 = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n margin: 12px 0 0;\n"])), function (p) {
57516
+ var QrHint = styled__default.p(_templateObject13$9 || (_templateObject13$9 = _taggedTemplateLiteralLoose(["\n text-align: center;\n font-size: 14px;\n line-height: 16px;\n color: ", ";\n margin: 12px 0 0;\n"])), function (p) {
57446
57517
  return p.color;
57447
57518
  });
57448
57519
 
57449
- var _templateObject$17, _templateObject2$12, _templateObject3$V, _templateObject4$N, _templateObject5$I, _templateObject6$D, _templateObject7$A, _templateObject8$x, _templateObject9$q, _templateObject0$n, _templateObject1$j, _templateObject10$g, _templateObject11$d, _templateObject12$a, _templateObject13$9;
57520
+ var _templateObject$17, _templateObject2$12, _templateObject3$V, _templateObject4$N, _templateObject5$I, _templateObject6$D, _templateObject7$A, _templateObject8$x, _templateObject9$q, _templateObject0$n, _templateObject1$j, _templateObject10$g, _templateObject11$d, _templateObject12$b, _templateObject13$a;
57450
57521
  var Members = function Members(_ref) {
57451
57522
  var _members$find;
57452
57523
  var channel = _ref.channel,
@@ -57804,12 +57875,12 @@ var SkeletonBlock$5 = styled__default.div(_templateObject0$n || (_templateObject
57804
57875
  var SkeletonMemberRow = styled__default.div(_templateObject1$j || (_templateObject1$j = _taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n padding: 6px 16px;\n gap: 12px;\n height: 56px;\n"])));
57805
57876
  var SkeletonAvatar$1 = styled__default(SkeletonBlock$5)(_templateObject10$g || (_templateObject10$g = _taggedTemplateLiteralLoose(["\n width: 40px;\n height: 40px;\n border-radius: 50%;\n flex-shrink: 0;\n"])));
57806
57877
  var SkeletonTextGroup$2 = styled__default.div(_templateObject11$d || (_templateObject11$d = _taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
57807
- var SkeletonLine$4 = styled__default(SkeletonBlock$5)(_templateObject12$a || (_templateObject12$a = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n border-radius: 7px;\n"])), function (p) {
57878
+ var SkeletonLine$4 = styled__default(SkeletonBlock$5)(_templateObject12$b || (_templateObject12$b = _taggedTemplateLiteralLoose(["\n width: ", ";\n height: ", ";\n border-radius: 7px;\n"])), function (p) {
57808
57879
  return p.width;
57809
57880
  }, function (p) {
57810
57881
  return p.height || '14px';
57811
57882
  });
57812
- var RoleBadge = styled__default.span(_templateObject13$9 || (_templateObject13$9 = _taggedTemplateLiteralLoose(["\n position: relative;\n padding: 2px 8px;\n border-radius: 12px;\n margin-left: 4px;\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n border-radius: 12px;\n width: 100%;\n height: 100%;\n background-color: ", ";\n opacity: 0.1;\n }\n"])), function (props) {
57883
+ var RoleBadge = styled__default.span(_templateObject13$a || (_templateObject13$a = _taggedTemplateLiteralLoose(["\n position: relative;\n padding: 2px 8px;\n border-radius: 12px;\n margin-left: 4px;\n font-weight: 500;\n font-size: 12px;\n line-height: 16px;\n color: ", ";\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n border-radius: 12px;\n width: 100%;\n height: 100%;\n background-color: ", ";\n opacity: 0.1;\n }\n"])), function (props) {
57813
57884
  return props.color;
57814
57885
  }, function (props) {
57815
57886
  return props.backgroundColor;
@@ -58789,7 +58860,7 @@ function SvgChevronDownSearch(props) {
58789
58860
  })));
58790
58861
  }
58791
58862
 
58792
- var _templateObject$1b, _templateObject2$16, _templateObject3$Y, _templateObject4$Q, _templateObject5$K, _templateObject6$F, _templateObject7$C, _templateObject8$z, _templateObject9$s, _templateObject0$p, _templateObject1$l, _templateObject10$i, _templateObject11$f, _templateObject12$b, _templateObject13$a, _templateObject14$7, _templateObject15$5, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$4, _templateObject20$4, _templateObject21$3, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2;
58863
+ var _templateObject$1b, _templateObject2$16, _templateObject3$Y, _templateObject4$Q, _templateObject5$K, _templateObject6$F, _templateObject7$C, _templateObject8$z, _templateObject9$s, _templateObject0$p, _templateObject1$l, _templateObject10$i, _templateObject11$f, _templateObject12$c, _templateObject13$b, _templateObject14$7, _templateObject15$5, _templateObject16$4, _templateObject17$4, _templateObject18$4, _templateObject19$4, _templateObject20$4, _templateObject21$3, _templateObject22$2, _templateObject23$2, _templateObject24$2, _templateObject25$2;
58793
58864
  var SEARCH_DEBOUNCE_MS = 400;
58794
58865
  function formatMessageDate(date) {
58795
58866
  if (!date) return '';
@@ -59231,8 +59302,8 @@ var StatusText$1 = styled__default.p(_templateObject11$f || (_templateObject11$f
59231
59302
  }, function (props) {
59232
59303
  return props.full ? 'height: 100%;' : '';
59233
59304
  });
59234
- var GroupSection = styled__default.div(_templateObject12$b || (_templateObject12$b = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
59235
- var GroupLabel = styled__default.div(_templateObject13$a || (_templateObject13$a = _taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ", ";\n text-transform: capitalize;\n letter-spacing: 0.5px;\n color: ", ";\n padding: 12px 16px 4px;\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n user-select: none;\n"])), function (p) {
59305
+ var GroupSection = styled__default.div(_templateObject12$c || (_templateObject12$c = _taggedTemplateLiteralLoose(["\n position: relative;\n"])));
59306
+ var GroupLabel = styled__default.div(_templateObject13$b || (_templateObject13$b = _taggedTemplateLiteralLoose(["\n position: sticky;\n top: 0;\n z-index: 1;\n background-color: ", ";\n text-transform: capitalize;\n letter-spacing: 0.5px;\n color: ", ";\n padding: 12px 16px 4px;\n font-weight: 500;\n font-size: 13px;\n line-height: 16px;\n user-select: none;\n"])), function (p) {
59236
59307
  return p.backgroundColor;
59237
59308
  }, function (p) {
59238
59309
  return p.color;