isometrik-plugin-chat-sdk 2.0.9 → 2.0.12

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 (43) hide show
  1. package/dist/cjs/attachment-preview_22.cjs.entry.js +253 -36
  2. package/dist/cjs/attachment-preview_22.cjs.entry.js.map +1 -1
  3. package/dist/cjs/isometrik-webchat.cjs.js +1 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js +29 -23
  6. package/dist/collection/components/ChatUIComponent/Footer/ChatFooter.js.map +1 -1
  7. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js +19 -8
  8. package/dist/collection/components/ChatUIComponent/Header/WebChatHeader.js.map +1 -1
  9. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js +129 -3
  10. package/dist/collection/components/ChatUIComponent/shared/contact-info/contact-info.js.map +1 -1
  11. package/dist/collection/components/my-component/web-chat/WebchatRightSide.js +17 -2
  12. package/dist/collection/components/my-component/web-chat/WebchatRightSide.js.map +1 -1
  13. package/dist/collection/lib/chat/group-title.js +8 -0
  14. package/dist/collection/lib/chat/group-title.js.map +1 -0
  15. package/dist/collection/lib/chat/index.js +2 -0
  16. package/dist/collection/lib/chat/index.js.map +1 -1
  17. package/dist/collection/lib/chat/mentioned-users.js +59 -0
  18. package/dist/collection/lib/chat/mentioned-users.js.map +1 -0
  19. package/dist/components/ChatFooter.js +87 -23
  20. package/dist/components/ChatFooter.js.map +1 -1
  21. package/dist/components/WebChatHeader.js +19 -8
  22. package/dist/components/WebChatHeader.js.map +1 -1
  23. package/dist/components/WebchatRightSide.js +17 -2
  24. package/dist/components/WebchatRightSide.js.map +1 -1
  25. package/dist/components/contact-info2.js +138 -5
  26. package/dist/components/contact-info2.js.map +1 -1
  27. package/dist/esm/attachment-preview_22.entry.js +253 -36
  28. package/dist/esm/attachment-preview_22.entry.js.map +1 -1
  29. package/dist/esm/isometrik-webchat.js +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/isometrik-webchat/isometrik-webchat.esm.js +1 -1
  32. package/dist/isometrik-webchat/isometrik-webchat.esm.js.map +1 -1
  33. package/dist/isometrik-webchat/p-2d69086d.entry.js +2 -0
  34. package/dist/isometrik-webchat/p-2d69086d.entry.js.map +1 -0
  35. package/dist/types/components/ChatUIComponent/Footer/ChatFooter.d.ts +7 -3
  36. package/dist/types/components/ChatUIComponent/Header/WebChatHeader.d.ts +1 -0
  37. package/dist/types/components/ChatUIComponent/shared/contact-info/contact-info.d.ts +15 -0
  38. package/dist/types/lib/chat/group-title.d.ts +2 -0
  39. package/dist/types/lib/chat/index.d.ts +2 -0
  40. package/dist/types/lib/chat/mentioned-users.d.ts +18 -0
  41. package/package.json +1 -1
  42. package/dist/isometrik-webchat/p-9f036163.entry.js +0 -2
  43. package/dist/isometrik-webchat/p-9f036163.entry.js.map +0 -1
@@ -18,6 +18,73 @@ import { p as postReaction, d as deleteReaction } from './message-reaction-0a2bb
18
18
  import { d as deriveMessageStatus } from './contracts-50f4ddae.js';
19
19
  import './destroy-chat-d0ee28d6.js';
20
20
 
21
+ /**
22
+ * API `mentionedUsers` shape for postMessages.
23
+ * Callers (custom UI / HOA) may pass `{ userId, userName }`; we map to
24
+ * `{ userId, wordCount, order }` before send.
25
+ */
26
+ function wordCountForName(userName) {
27
+ const n = userName.trim().split(/\s+/).filter(Boolean).length;
28
+ return n > 0 ? n : 1;
29
+ }
30
+ /**
31
+ * Build API mention list from composer body + picker selections.
32
+ * - Prefers `userName` to locate `@Name` in body and derive wordCount
33
+ * - Drops mentions no longer present in body
34
+ * - One entry per userId (first appearance wins)
35
+ * - `order` is 1-based by appearance in body
36
+ */
37
+ function toMentionedUsersPayload(body, list) {
38
+ var _a, _b;
39
+ if (!Array.isArray(list) || !list.length)
40
+ return [];
41
+ const text = String(body !== null && body !== void 0 ? body : '');
42
+ const hits = [];
43
+ const seen = new Set();
44
+ for (const raw of list) {
45
+ if (!raw || typeof raw !== 'object')
46
+ continue;
47
+ const userId = String((_a = raw.userId) !== null && _a !== void 0 ? _a : '').trim();
48
+ if (!userId || seen.has(userId))
49
+ continue;
50
+ const userName = String((_b = raw.userName) !== null && _b !== void 0 ? _b : '').trim();
51
+ let wordCount = Number(raw.wordCount);
52
+ let start = -1;
53
+ if (userName) {
54
+ start = text.indexOf(`@${userName}`);
55
+ if (start < 0)
56
+ continue;
57
+ if (!Number.isFinite(wordCount) || wordCount < 1) {
58
+ wordCount = wordCountForName(userName);
59
+ }
60
+ }
61
+ else if (Number.isFinite(wordCount) && wordCount >= 1) {
62
+ // Already API-shaped (no name) — keep relative order via `order`
63
+ const ord = Number(raw.order);
64
+ start = Number.isFinite(ord) ? ord : hits.length + 1;
65
+ }
66
+ else {
67
+ continue;
68
+ }
69
+ seen.add(userId);
70
+ hits.push({ userId, wordCount, start });
71
+ }
72
+ hits.sort((a, b) => a.start - b.start);
73
+ return hits.map((h, i) => ({
74
+ userId: h.userId,
75
+ wordCount: h.wordCount,
76
+ order: i + 1,
77
+ }));
78
+ }
79
+
80
+ /** Trim + clamp for Conversation.patchTitle. */
81
+ function normalizeGroupTitle(raw, max = 100) {
82
+ return String(raw !== null && raw !== void 0 ? raw : '')
83
+ .replace(/\s+/g, ' ')
84
+ .trim()
85
+ .slice(0, max);
86
+ }
87
+
21
88
  const NewChat = class {
22
89
  constructor(hostRef) {
23
90
  registerInstance(this, hostRef);
@@ -1625,6 +1692,7 @@ const WebChatHeader = class {
1625
1692
  this.groupMembers = [];
1626
1693
  this.eligibleMembers = [];
1627
1694
  this.displayTitle = '';
1695
+ this.displayImageUrl = '';
1628
1696
  this.typingUserName = '';
1629
1697
  this.menuOpen = false;
1630
1698
  }
@@ -1647,20 +1715,28 @@ const WebChatHeader = class {
1647
1715
  conversationStore.onChange('conversationTitle', (value) => {
1648
1716
  this.displayTitle = value;
1649
1717
  });
1718
+ // Image edits update the store before conversationDetails prop refreshes.
1719
+ conversationStore.onChange('conversationImageUrl', (value) => {
1720
+ this.displayImageUrl = value || '';
1721
+ });
1722
+ this.displayImageUrl =
1723
+ conversationStore.state.conversationImageUrl || this.avatarSrc() || '';
1650
1724
  }
1651
1725
  handleConversationDetailsChange(newValue) {
1652
1726
  var _a, _b;
1653
1727
  if (newValue) {
1728
+ const imageUrl = newValue.isGroup
1729
+ ? newValue.conversationImageUrl
1730
+ : (_a = newValue.opponentDetails) === null || _a === void 0 ? void 0 : _a.userProfileImageUrl;
1654
1731
  conversationStore.updateConversationDetails({
1655
- conversationTitle: newValue.isGroup ? newValue.conversationTitle : (_a = newValue.opponentDetails) === null || _a === void 0 ? void 0 : _a.userName,
1732
+ conversationTitle: newValue.isGroup ? newValue.conversationTitle : (_b = newValue.opponentDetails) === null || _b === void 0 ? void 0 : _b.userName,
1656
1733
  // @ts-ignore
1657
1734
  conversationId: newValue.conversationId,
1658
1735
  isGroup: newValue.isGroup,
1659
- conversationImageUrl: newValue.isGroup
1660
- ? newValue.conversationImageUrl
1661
- : (_b = newValue.opponentDetails) === null || _b === void 0 ? void 0 : _b.userProfileImageUrl,
1736
+ conversationImageUrl: imageUrl || '',
1662
1737
  opponentDetails: newValue.opponentDetails,
1663
1738
  });
1739
+ this.displayImageUrl = imageUrl || '';
1664
1740
  }
1665
1741
  }
1666
1742
  handleDocumentClick(e) {
@@ -1684,8 +1760,9 @@ const WebChatHeader = class {
1684
1760
  const d = this.conversationDetails || {};
1685
1761
  if (d.groupcastId)
1686
1762
  return d.groupcastImageUrl || '';
1687
- if (d.isGroup)
1688
- return d.conversationImageUrl || '';
1763
+ if (d.isGroup) {
1764
+ return this.displayImageUrl || d.conversationImageUrl || '';
1765
+ }
1689
1766
  return ((_a = d.opponentDetails) === null || _a === void 0 ? void 0 : _a.userProfileImageUrl) || '';
1690
1767
  }
1691
1768
  avatarIsGroup() {
@@ -1738,10 +1815,10 @@ const WebChatHeader = class {
1738
1815
  const groupcast = this.isGroupcast();
1739
1816
  const isGroup = !!((_a = this.conversationDetails) === null || _a === void 0 ? void 0 : _a.isGroup) && !groupcast;
1740
1817
  const showBlock = !groupcast && !((_b = this.conversationDetails) === null || _b === void 0 ? void 0 : _b.isGroup);
1741
- return (h(Fragment, { key: '7dc9c100c2cc052b961fdb0236f3d63e688bffef' }, h("div", { key: 'e69c6bd3d8cb3bece316ed7ba5f14bbc7b5ddd76', class: "head-container", style: {
1818
+ return (h(Fragment, { key: '57a94c04c51d4f734dd70f0b66de3fcf08152816' }, h("div", { key: '7763a5e9b131839e5a5f150763ccbee42f2b83bf', class: "head-container", style: {
1742
1819
  backgroundColor: this.headerBgColor || undefined,
1743
1820
  color: this.headerUsernameColor || undefined,
1744
- } }, h("div", { key: '1173e55f29d15c2350b03a54d0228bdebc677d51', class: "head-left" }, h("button", { key: '692dccf76fe4d36c308916d81b7a3389e47bf798', class: "back-button", type: "button", onClick: () => typeof this.onBackButtonClick === 'function' && this.onBackButtonClick(), "aria-label": "Back" }, h("img", { key: 'f8a8b07ca105e9863979362eab889c5e23352922', class: "theme-icon", src: Left_Arrow, alt: "" })), h("div", { key: 'c11d43e4fa2d86d8de96dc77b6192d0a2bf9dec0', class: "identity", onClick: this.handleTextClick }, h("profile-avatar", { key: 'e80c2aa7d3616f7c334d10021ebadf9ca32d9aef', src: this.avatarSrc(), name: this.title(), size: "var(--avatar-sm)", isGroup: this.avatarIsGroup() }), h("div", { key: '9ab9a076176a0479ef6c41e1f601f32a4acdde7c', class: "text-container" }, h("div", { key: 'f084abe95d6e178ffa88adb2ce9927e83f5b5414', class: "title" }, this.title()), h("div", { key: 'c59d4d4e7ac40c245494ad2020f40cb319fa5eb0', class: "subtitle", style: { color: this.headerLastSeenColor || undefined } }, this.subtitle(formattedLastSeen))))), h("div", { key: '8b36023afce02adeb5b730a6ca374ad2ccc05c65', class: "actions" }, !groupcast ? (h("button", { type: "button", class: "icon-btn", title: "Search in conversation", onClick: () => this.openSearch() }, h("img", { class: "theme-icon", src: Search, alt: "" }))) : null, h("div", { key: '02c33a403e1473bee5b18025dccb9897e1f2edf0', class: "more-wrap" }, h("button", { key: '0708283365c2edebd24af299c02d841fb47a8d62', type: "button", class: "icon-btn", title: "Menu", "aria-label": "Menu", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.toggleMenu }, h("img", { key: '76da82722f5077a85423988ee223717b5cbce143', class: "theme-icon", src: Three_Dots, alt: "" })), this.menuOpen ? (h("div", { class: "more-menu", role: "menu" }, isGroup ? (h(Fragment, null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openAddMember }, h("img", { class: "theme-icon", src: Add_User, alt: "" }), h("span", null, "Add member")), h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openGroupInfo }, h("img", { class: "theme-icon", src: Info, alt: "" }), h("span", null, "Group info")))) : null, !groupcast ? (h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.openSearch() }, h("img", { class: "theme-icon", src: Search, alt: "" }), h("span", null, "Search"))) : null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.doCloseChat() }, h("img", { class: "theme-icon", src: CloseButton, alt: "" }), h("span", null, "Close chat")), !groupcast ? (h(Fragment, null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.handleClearChat }, h("img", { class: "theme-icon", src: Clear_Chat, alt: "" }), h("span", null, "Clear chat")), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.deleteChat }, h("img", { class: "theme-icon", src: Delete, alt: "" }), h("span", null, "Delete chat")))) : null, isGroup ? (h(Fragment, null, h("div", { class: "more-divider" }), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.exitGroup }, h("img", { class: "theme-icon", src: Logout, alt: "" }), h("span", null, "Exit group")))) : null, showBlock ? (h(Fragment, null, h("div", { class: "more-divider" }), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.doBlock }, h("img", { class: "theme-icon", src: Block_User, alt: "" }), h("span", null, this.isBlocked ? 'Unblock Chat' : 'Block Chat')))) : null)) : null))), this.isLoading && (h("div", { key: '2c224ca39a8de2a2fb8c6e07191789eb2cb265ba', class: "loading-overlay" }, h("spinner-loader", { key: 'ee2338eec76f57045431a28c78f3c105def0da09', height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" })))));
1821
+ } }, h("div", { key: '0febc95ec5b3cd047f3efe822419d84e1b8649cf', class: "head-left" }, h("button", { key: '9944b8aa9869d8232f68f70eab151b83b6dcd42f', class: "back-button", type: "button", onClick: () => typeof this.onBackButtonClick === 'function' && this.onBackButtonClick(), "aria-label": "Back" }, h("img", { key: '143b10007a063bb1b1d0f2338ada2ff976c2032d', class: "theme-icon", src: Left_Arrow, alt: "" })), h("div", { key: '90913639f468f40c2f5086541e23af179a464e4a', class: "identity", onClick: this.handleTextClick }, h("profile-avatar", { key: '8361c0dfeab12d5bc9964caa313313abeaa33bce', src: this.avatarSrc(), name: this.title(), size: "var(--avatar-sm)", isGroup: this.avatarIsGroup() }), h("div", { key: '2eea1c6e4694ec49db17087318c6e29efeed6866', class: "text-container" }, h("div", { key: '3815b900951bdd4e9fa206a8b36b4345c5ad1853', class: "title" }, this.title()), h("div", { key: '98e18e86abb970c5853b56ffa8eb6ef8a755d2ef', class: "subtitle", style: { color: this.headerLastSeenColor || undefined } }, this.subtitle(formattedLastSeen))))), h("div", { key: 'a1f43c9e9cce0af81a08c0dff7cbf800d40c7d5e', class: "actions" }, !groupcast ? (h("button", { type: "button", class: "icon-btn", title: "Search in conversation", onClick: () => this.openSearch() }, h("img", { class: "theme-icon", src: Search, alt: "" }))) : null, h("div", { key: '1eb744c5e5df5d94203fd1c534626d959322ed46', class: "more-wrap" }, h("button", { key: '0f6649a741e2e72adb57567296326dc2c4c15537', type: "button", class: "icon-btn", title: "Menu", "aria-label": "Menu", "aria-haspopup": "menu", "aria-expanded": this.menuOpen ? 'true' : 'false', onClick: this.toggleMenu }, h("img", { key: '92d40afb11d9a96ff31b9fc175520fb5c5188618', class: "theme-icon", src: Three_Dots, alt: "" })), this.menuOpen ? (h("div", { class: "more-menu", role: "menu" }, isGroup ? (h(Fragment, null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openAddMember }, h("img", { class: "theme-icon", src: Add_User, alt: "" }), h("span", null, "Add member")), h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.openGroupInfo }, h("img", { class: "theme-icon", src: Info, alt: "" }), h("span", null, "Group info")))) : null, !groupcast ? (h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.openSearch() }, h("img", { class: "theme-icon", src: Search, alt: "" }), h("span", null, "Search"))) : null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: () => this.doCloseChat() }, h("img", { class: "theme-icon", src: CloseButton, alt: "" }), h("span", null, "Close chat")), !groupcast ? (h(Fragment, null, h("button", { type: "button", class: "more-item", role: "menuitem", onClick: this.handleClearChat }, h("img", { class: "theme-icon", src: Clear_Chat, alt: "" }), h("span", null, "Clear chat")), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.deleteChat }, h("img", { class: "theme-icon", src: Delete, alt: "" }), h("span", null, "Delete chat")))) : null, isGroup ? (h(Fragment, null, h("div", { class: "more-divider" }), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.exitGroup }, h("img", { class: "theme-icon", src: Logout, alt: "" }), h("span", null, "Exit group")))) : null, showBlock ? (h(Fragment, null, h("div", { class: "more-divider" }), h("button", { type: "button", class: "more-item danger", role: "menuitem", onClick: this.doBlock }, h("img", { class: "theme-icon", src: Block_User, alt: "" }), h("span", null, this.isBlocked ? 'Unblock Chat' : 'Block Chat')))) : null)) : null))), this.isLoading && (h("div", { key: 'b7308b2385393a374edbb60a72a04f4eb12ba828', class: "loading-overlay" }, h("spinner-loader", { key: '93fe73e5a422c0e75827f8605c6458b80bf2953e', height: "30px", width: "30px", spinTime: "1s", spinnerPrimaryColor: "var(--bg-primary)", spinnerSecondaryColor: "var(--text-primary)", spinnerBorderWidth: "2px" })))));
1745
1822
  }
1746
1823
  get el() { return getElement(this); }
1747
1824
  static get watchers() { return {
@@ -5037,7 +5114,12 @@ const ChatFooter = class {
5037
5114
  };
5038
5115
  this.createLocalMessage = (messageBody, attachments = null, messageId) => {
5039
5116
  var _a;
5040
- return (Object.assign(Object.assign(Object.assign({ body: messageBody, messageId: messageId, deliveredToAll: 'pending', senderId: this.userMetaData.userId, messageType: this.replyMessage ? 2 : 0, sentAt: Date.now() }, (attachments && { attachments })), (((_a = this.mentionUserList) === null || _a === void 0 ? void 0 : _a.length) > 0 && { mentionedUsers: this.mentionUserList })), (this.replyMessage && { metaData: this.getReplyMetadata() })));
5117
+ const mentionedUsers = this.mentionedUsersForApi(messageBody);
5118
+ return Object.assign(Object.assign(Object.assign({ body: messageBody, messageId: messageId, deliveredToAll: 'pending', senderId: this.userMetaData.userId, messageType: this.replyMessage ? 2 : 0, sentAt: Date.now() }, (attachments && { attachments })), (((_a = this.mentionUserList) === null || _a === void 0 ? void 0 : _a.length) > 0 && {
5119
+ mentionedUsers: this.mentionUserList.some(m => m === null || m === void 0 ? void 0 : m.userName)
5120
+ ? this.mentionUserList
5121
+ : mentionedUsers,
5122
+ })), (this.replyMessage && { metaData: this.getReplyMetadata() }));
5041
5123
  };
5042
5124
  this.updateMessageWithApiResponse = (messageId, oldMessageId) => {
5043
5125
  const newMessages = [...this.allMessages];
@@ -5453,6 +5535,10 @@ const ChatFooter = class {
5453
5535
  console.warn('updateConversationListProp is not a function', this.updateConversationListProp);
5454
5536
  }
5455
5537
  }
5538
+ /** API payload only — strips userName, sets wordCount + order. */
5539
+ mentionedUsersForApi(body) {
5540
+ return toMentionedUsersPayload(body, this.mentionUserList);
5541
+ }
5456
5542
  clearLinkPreview() {
5457
5543
  this.linkPreview = '';
5458
5544
  this.linkToPreview = '';
@@ -5469,7 +5555,6 @@ const ChatFooter = class {
5469
5555
  document.removeEventListener('pointerdown', this.closeAttachOutside);
5470
5556
  }
5471
5557
  async sendTextMessage(body, conversationId) {
5472
- var _a;
5473
5558
  this.messageBody = '';
5474
5559
  let messageId = 'localId' + Date.now().toString() + Math.random() * 100;
5475
5560
  const localMessage = this.createLocalMessage(body, null, messageId);
@@ -5484,22 +5569,9 @@ const ChatFooter = class {
5484
5569
  const urlParams = new URLSearchParams(window.location.search);
5485
5570
  const isGroupcast = urlParams.has('groupcast');
5486
5571
  const groupcastId = urlParams.get('groupcast');
5572
+ const mentionedUsers = this.mentionedUsersForApi(body);
5487
5573
  if (isGroupcast) {
5488
- const payloadForGroupcastMessage = {
5489
- showInConversation: true,
5490
- sendPushForNewConversationCreated: true,
5491
- searchableTags: this.generateSearchableTags(body),
5492
- metaData: this.getReplyMetadata(),
5493
- body: body,
5494
- groupcastId: groupcastId,
5495
- readCount: 1,
5496
- notifyOnCompletion: true,
5497
- messageType: this.replyMessage ? 2 : 0,
5498
- hideNewConversationsForSender: true,
5499
- encrypted: true,
5500
- deviceId: this.deviceId,
5501
- deliveryCount: 1,
5502
- };
5574
+ const payloadForGroupcastMessage = Object.assign({ showInConversation: true, sendPushForNewConversationCreated: true, searchableTags: this.generateSearchableTags(body), metaData: this.getReplyMetadata(), body: body, groupcastId: groupcastId, readCount: 1, notifyOnCompletion: true, messageType: this.replyMessage ? 2 : 0, hideNewConversationsForSender: true, encrypted: true, deviceId: this.deviceId, deliveryCount: 1 }, (mentionedUsers.length > 0 && { mentionedUsers }));
5503
5575
  try {
5504
5576
  const res = await postGroupCastMessage(payloadForGroupcastMessage);
5505
5577
  this.updateMessageWithApiResponse(res.messageId, messageId);
@@ -5512,6 +5584,12 @@ const ChatFooter = class {
5512
5584
  position: 'bottom-right',
5513
5585
  });
5514
5586
  }
5587
+ finally {
5588
+ this.changeMessageSendingState(false);
5589
+ this.replyMessage = null;
5590
+ this.messageBody = '';
5591
+ this.mentionUserList = [];
5592
+ }
5515
5593
  }
5516
5594
  else {
5517
5595
  const payload = {
@@ -5526,8 +5604,8 @@ const ChatFooter = class {
5526
5604
  body: body,
5527
5605
  metaData: this.getReplyMetadata(),
5528
5606
  };
5529
- if (((_a = this.mentionUserList) === null || _a === void 0 ? void 0 : _a.length) > 0) {
5530
- payload['mentionedUsers'] = this.mentionUserList;
5607
+ if (mentionedUsers.length > 0) {
5608
+ payload['mentionedUsers'] = mentionedUsers;
5531
5609
  }
5532
5610
  try {
5533
5611
  const res = await M.getInstance().message.postMessages(payload);
@@ -5545,6 +5623,7 @@ const ChatFooter = class {
5545
5623
  this.changeMessageSendingState(false);
5546
5624
  this.replyMessage = null;
5547
5625
  this.messageBody = '';
5626
+ this.mentionUserList = [];
5548
5627
  }
5549
5628
  }
5550
5629
  }
@@ -5627,7 +5706,7 @@ const ChatFooter = class {
5627
5706
  }
5628
5707
  }
5629
5708
  async uploadAndSendMedia(presignedUrls, attachments, conversationId, oldMessageId) {
5630
- var _a, _b, _c, _d;
5709
+ var _a, _b, _c;
5631
5710
  const allPayloads = [];
5632
5711
  const uploadPromises = presignedUrls.map(async (urlDetails, index) => {
5633
5712
  let mediaId, mediaUrl, thumbnailUrl, mediaPresignedUrl;
@@ -5695,8 +5774,10 @@ const ChatFooter = class {
5695
5774
  metaData: this.getReplyMetadata(),
5696
5775
  };
5697
5776
  let payloadForGroupcastMessage = Object.assign(Object.assign({}, payload), { hideNewConversationsForSender: false, groupcastId: this.groupcastId, notifyOnCompletion: true, sendPushForNewConversationCreated: true });
5698
- if (((_d = this.mentionUserList) === null || _d === void 0 ? void 0 : _d.length) > 0) {
5699
- payload['mentionedUsers'] = this.mentionUserList;
5777
+ const mentionedUsers = this.mentionedUsersForApi(caption);
5778
+ if (mentionedUsers.length > 0) {
5779
+ payload['mentionedUsers'] = mentionedUsers;
5780
+ payloadForGroupcastMessage['mentionedUsers'] = mentionedUsers;
5700
5781
  }
5701
5782
  try {
5702
5783
  let sendMessageRes;
@@ -5706,6 +5787,7 @@ const ChatFooter = class {
5706
5787
  else {
5707
5788
  sendMessageRes = await M.getInstance().message.postMessages(payload);
5708
5789
  }
5790
+ this.mentionUserList = [];
5709
5791
  this.updateMessageWithApiResponse(sendMessageRes.messageId, oldMessageId);
5710
5792
  this.replyMessage = null;
5711
5793
  showToast({
@@ -5757,7 +5839,7 @@ const ChatFooter = class {
5757
5839
  const webChat = findWebChatHost(this.el);
5758
5840
  const hasCustomReply = (webChat ? hasNamedSlot(webChat, 'reply-preview') : false) || hasNamedSlot(this.el, 'reply-preview');
5759
5841
  const showAttachment = this.attachmentDetails || this.showCamera;
5760
- return (h(Host, { key: '4aecc1f90f540e9082f8abbaf4faadbbcd549fd4', class: { 'attachment-open': !!showAttachment } }, h("div", { key: 'f11f01df71447e564785543322ad9cefffb2df19', class: "chat-footer-container" }, showAttachment ? (h("slot", { name: "attachment-preview" }, h("attachment-preview", { showCamera: this.showCamera, onClose: this.handleClearAttachment, width: "150px", height: "150px", bgColor: "var(--bg-primary-light)", padding: "3px", margin: "10px 0 0 0", contentType: contentType, content: this.mediaPreviews, onSend: this.handleSendMessage, "onfile-uploaded": this.handleFileUpload, "onattachment-removed": this.handleRemoveAttachment, "oncamera-retake": this.handleCameraRetake, key: this.inputKey, inputValue: this.messageBody, "oninput-change": this.handleInputChange, backgroundColor: "var(--bg-primary-color)", containerBoxShadow: "none", inputFontColor: "var(--text-primary-color)", inputBorderRadius: "10px", conversationDetails: this.conversationDetails, userMetaData: this.userMetaData }))) : (h(Fragment, null, hasCustomReply ? h("slot", { name: "reply-preview" }) : null, h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (h("reply-block", { messageBody: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.body, messageInfo: this.replyMessage, senderName: ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) === ((_d = (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.senderInfo) === null || _d === void 0 ? void 0 : _d.userId)
5842
+ return (h(Host, { key: 'de774ccefb329af2fe95f29fc90fa4cad874af9c', class: { 'attachment-open': !!showAttachment } }, h("div", { key: '0e8d6829943505e92e45c38980c827b57366902c', class: "chat-footer-container" }, showAttachment ? (h("slot", { name: "attachment-preview" }, h("attachment-preview", { showCamera: this.showCamera, onClose: this.handleClearAttachment, width: "150px", height: "150px", bgColor: "var(--bg-primary-light)", padding: "3px", margin: "10px 0 0 0", contentType: contentType, content: this.mediaPreviews, onSend: this.handleSendMessage, "onfile-uploaded": this.handleFileUpload, "onattachment-removed": this.handleRemoveAttachment, "oncamera-retake": this.handleCameraRetake, key: this.inputKey, inputValue: this.messageBody, "oninput-change": this.handleInputChange, backgroundColor: "var(--bg-primary-color)", containerBoxShadow: "none", inputFontColor: "var(--text-primary-color)", inputBorderRadius: "10px", conversationDetails: this.conversationDetails, userMetaData: this.userMetaData }))) : (h(Fragment, null, hasCustomReply ? h("slot", { name: "reply-preview" }) : null, h("slot", { name: "composer-input" }, !hasCustomReply && this.replyMessage ? (h("reply-block", { messageBody: (_a = this.replyMessage) === null || _a === void 0 ? void 0 : _a.body, messageInfo: this.replyMessage, senderName: ((_b = this.userMetaData) === null || _b === void 0 ? void 0 : _b.userId) === ((_d = (_c = this.replyMessage) === null || _c === void 0 ? void 0 : _c.senderInfo) === null || _d === void 0 ? void 0 : _d.userId)
5761
5843
  ? 'You'
5762
5844
  : (_f = (_e = this.replyMessage) === null || _e === void 0 ? void 0 : _e.senderInfo) === null || _f === void 0 ? void 0 : _f.userName, onIconClick: this.handleremoveReplyMessage })) : null, h("div", { class: "composer-wrap", key: this.inputKey, ref: el => (this.composerWrapRef = el) }, this.showEmojiPicker ? (h("div", { class: "emoji-panel", style: this.emojiPanelStyle }, h("div", { class: "emoji-panel-header" }, h("span", null, "Emoji"), h("button", { class: "emoji-panel-close", type: "button", "aria-label": "Close", onClick: this.handleEmojiToggle }, "\u00D7")), h("emoji-picker", { class: "emoji-picker light", ref: this.bindEmojiPicker }))) : null, h("div", { class: { composer: true, recording: this.isRecording } }, this.isRecording ? (h("div", { class: "rec-body" }, h("div", { class: "rec-left" }, h("button", { class: "rec-icon-btn danger", type: "button", title: "Delete recording", "aria-label": "Delete recording", onClick: this.handleRecDelete }, h("img", { class: "theme-icon", src: Delete, alt: "" })), h("div", { class: "rec-timer-wrap" }, h("span", { class: { 'rec-dot': true, live: !this.isPaused } }), h("span", { class: "rec-timer" }, this.formatRecTime(this.recordingSeconds)))), h("div", { class: "rec-wave" }, h("audio-bubble", { liveRecord: true, audioProgressColor: "#2563eb", audioWaveColor: "#2563eb", ref: el => (this.recBubble = el), onRecordingProgress: this.onRecordingProgress, onRecordingError: this.onRecordingError })), h("button", { class: { 'rec-icon-btn': true, 'rec-toggle': true, pause: !this.isPaused }, type: "button", title: this.isPaused ? 'Resume recording' : 'Pause recording', "aria-label": this.isPaused ? 'Resume recording' : 'Pause recording', onClick: this.handleRecPauseToggle }, h("img", { class: "theme-icon", src: this.isPaused ? PlayIcon : PauseIcon, alt: "" })), h("button", { class: "rec-send", type: "button", title: "Send voice note", "aria-label": "Send voice note", onClick: this.handleRecSend }, h("img", { src: Send, alt: "" })))) : (h(Fragment, null, h("div", { class: "attach-wrap" }, h("button", { class: "icon-btn", type: "button", title: "Attach file", "aria-label": "Attach", onClick: this.handleAttachClick }, h("img", { src: Attachment, alt: "" })), this.showAttachMenu ? (h("div", { class: "attach-menu", style: this.attachMenuStyle }, h("button", { class: "attach-opt", type: "button", onClick: this.pickDocument }, h("span", { class: "attach-opt-icon attach-opt-icon--doc" }, h("img", { src: DocumentsIcon, alt: "" })), h("span", null, "Document")), h("button", { class: "attach-opt", type: "button", onClick: this.pickPhotos }, h("span", { class: "attach-opt-icon attach-opt-icon--photos" }, h("img", { class: "theme-icon", src: PhotosIcon, alt: "" })), h("span", null, "Photos & videos")), h("button", { class: "attach-opt", type: "button", onClick: this.pickCamera }, h("span", { class: "attach-opt-icon attach-opt-icon--camera" }, h("img", { class: "theme-icon", src: CameraIcon, alt: "" })), h("span", null, "Camera")))) : null), h("button", { class: "icon-btn", type: "button", title: "Emojis", "aria-label": "Emojis", onClick: this.handleEmojiToggle }, h("img", { src: Smile, alt: "" })), h("input", { class: "file-input", type: "file", multiple: true, accept: ".jpg,.jpeg,.png,.gif,.webp,.bmp,.heic,.mp4,.mov,.webm,.mkv,.mp3,.wav,.m4a,.aac,.ogg", ref: el => (this.mediaInputRef = el), onChange: this.handleNativeFileChange }), h("input", { class: "file-input", type: "file", multiple: true, accept: ".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.rtf,application/*", ref: el => (this.docInputRef = el), onChange: this.handleNativeFileChange }), h("textarea", { class: "composer-input", rows: 1, placeholder: "Type a message", value: this.messageBody, ref: el => (this.inputRef = el), onInput: this.handleComposerInput, onKeyDown: this.handleComposerKeyDown }), this.messageBody.trim() ? (h("button", { class: "icon-btn", type: "button", title: "Send", "aria-label": "Send", onClick: this.handleSendMessage }, h("img", { src: Send, alt: "" }))) : (h("button", { class: "icon-btn", type: "button", title: "Voice note", "aria-label": "Voice note", onClick: this.handleMicClick }, h("img", { src: Microphone, alt: "" })))))))))))));
5763
5845
  }
@@ -6097,6 +6179,10 @@ const leftArrowSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNv
6097
6179
 
6098
6180
  const addUserSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMTcgMTBIMjBNMjMgMTBIMjBNMjAgMTBWN00yMCAxMFYxMyIgc3Ryb2tlPSJjdXJyZW50Q29sb3Ii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XZlbm9kZCIvPjwvc3ZnPg==';const ExcelIcon = excelSvg;
@@ -6148,6 +6234,104 @@ const ContactInfo = class {
6148
6234
  isGroupcast: !!this.isGroupcast || !!this.groupcastId,
6149
6235
  });
6150
6236
  };
6237
+ this.startTitleEdit = (e) => {
6238
+ e === null || e === void 0 ? void 0 : e.preventDefault();
6239
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
6240
+ if (!this.canEditGroupInfo())
6241
+ return;
6242
+ this.titleDraft = normalizeGroupTitle(String(this.contactName || ''));
6243
+ this.titleEditing = true;
6244
+ };
6245
+ this.openImagePicker = (e) => {
6246
+ var _a;
6247
+ e === null || e === void 0 ? void 0 : e.preventDefault();
6248
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
6249
+ if (!this.canEditGroupInfo() || this.imageUploading)
6250
+ return;
6251
+ (_a = this.imageFileInput) === null || _a === void 0 ? void 0 : _a.click();
6252
+ };
6253
+ this.onImageFileChange = (e) => {
6254
+ var _a;
6255
+ const input = e.target;
6256
+ const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
6257
+ input.value = '';
6258
+ if (!file || !this.canEditGroupInfo())
6259
+ return;
6260
+ const conversationId = String(this.conversationId || this.groupcastId || '').trim();
6261
+ if (!conversationId)
6262
+ return;
6263
+ const currentImage = String(this.contactImage || '');
6264
+ this.imageUploading = true;
6265
+ // WebchatRightSide @Listen('edit-image') → presign + patchImage.
6266
+ this.el.dispatchEvent(new CustomEvent('edit-image', {
6267
+ bubbles: true,
6268
+ composed: true,
6269
+ detail: {
6270
+ currentImage,
6271
+ conversationId,
6272
+ file,
6273
+ onError: () => {
6274
+ this.contactImage = currentImage;
6275
+ this.imageUploading = false;
6276
+ },
6277
+ onSuccess: () => {
6278
+ this.imageUploading = false;
6279
+ },
6280
+ },
6281
+ }));
6282
+ // Safety unlock if host never calls back.
6283
+ window.setTimeout(() => {
6284
+ this.imageUploading = false;
6285
+ }, 15000);
6286
+ };
6287
+ this.cancelTitleEdit = (e) => {
6288
+ e === null || e === void 0 ? void 0 : e.preventDefault();
6289
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
6290
+ this.titleEditing = false;
6291
+ this.titleDraft = '';
6292
+ };
6293
+ this.onTitleDraftInput = (e) => {
6294
+ var _a;
6295
+ const el = e.target;
6296
+ this.titleDraft = (_a = el === null || el === void 0 ? void 0 : el.value) !== null && _a !== void 0 ? _a : '';
6297
+ };
6298
+ this.onTitleDraftKeyDown = (e) => {
6299
+ if (e.key === 'Enter') {
6300
+ e.preventDefault();
6301
+ this.saveTitleEdit();
6302
+ }
6303
+ else if (e.key === 'Escape') {
6304
+ e.preventDefault();
6305
+ this.cancelTitleEdit();
6306
+ }
6307
+ };
6308
+ this.saveTitleEdit = (e) => {
6309
+ e === null || e === void 0 ? void 0 : e.preventDefault();
6310
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
6311
+ const currentTitle = normalizeGroupTitle(String(this.contactName || ''));
6312
+ const newTitle = normalizeGroupTitle(this.titleDraft);
6313
+ this.titleEditing = false;
6314
+ this.titleDraft = '';
6315
+ if (!newTitle || newTitle === currentTitle)
6316
+ return;
6317
+ const conversationId = String(this.conversationId || this.groupcastId || '').trim();
6318
+ if (!conversationId)
6319
+ return;
6320
+ // Optimistic local label; WebchatRightSide @Listen('edit-title') → patchTitle.
6321
+ this.contactName = newTitle;
6322
+ this.el.dispatchEvent(new CustomEvent('edit-title', {
6323
+ bubbles: true,
6324
+ composed: true,
6325
+ detail: {
6326
+ currentTitle,
6327
+ newTitle,
6328
+ conversationId,
6329
+ onError: () => {
6330
+ this.contactName = currentTitle;
6331
+ },
6332
+ },
6333
+ }));
6334
+ };
6151
6335
  this.toggleMemberMenu = (userId, e) => {
6152
6336
  e.stopPropagation();
6153
6337
  this.memberMenuUserId = this.memberMenuUserId === userId ? null : userId;
@@ -6270,6 +6454,9 @@ const ContactInfo = class {
6270
6454
  this.docItems = [];
6271
6455
  this.previewTry = {};
6272
6456
  this.memberMenuUserId = null;
6457
+ this.titleEditing = false;
6458
+ this.titleDraft = '';
6459
+ this.imageUploading = false;
6273
6460
  }
6274
6461
  onAttachmentsChange() {
6275
6462
  this.extractAttachments();
@@ -6302,6 +6489,19 @@ const ContactInfo = class {
6302
6489
  const self = members.find((m) => m.userId === me);
6303
6490
  return !!(self === null || self === void 0 ? void 0 : self.isAdmin);
6304
6491
  }
6492
+ /** Admin-only rename + photo (same gate). */
6493
+ canEditGroupInfo() {
6494
+ return !!(this.isGroup || this.isGroupcast) && this.isSelfAdmin();
6495
+ }
6496
+ onConversationChange() {
6497
+ this.titleEditing = false;
6498
+ this.titleDraft = '';
6499
+ this.imageUploading = false;
6500
+ }
6501
+ onContactImageChange() {
6502
+ // Host updated after successful patchImage.
6503
+ this.imageUploading = false;
6504
+ }
6305
6505
  emitMemberEvent(name, detail) {
6306
6506
  this.closeMemberMenu();
6307
6507
  this.el.dispatchEvent(new CustomEvent(name, {
@@ -6412,7 +6612,7 @@ const ContactInfo = class {
6412
6612
  if (this.mediaListOpen) {
6413
6613
  return (h("div", { class: "panel" }, h("div", { class: "header" }, h("button", { class: "close-btn", type: "button", "aria-label": "Back", title: "Back", onClick: () => this.close() }, h("img", { class: "theme-icon", src: LeftArrowIcon, alt: "" })), h("h2", null, "Media, links and docs")), h("div", { class: "tabs" }, h("button", { class: { tab: true, active: this.mediaTab === 'media' }, type: "button", onClick: () => this.switchTab('media') }, "Media"), h("button", { class: { tab: true, active: this.mediaTab === 'docs' }, type: "button", onClick: () => this.switchTab('docs') }, "Docs"), h("button", { class: { tab: true, active: this.mediaTab === 'links' }, type: "button", onClick: () => this.switchTab('links') }, "Links")), h("div", { class: "tab-body" }, this.renderMediaListBody()), this.renderGallery()));
6414
6614
  }
6415
- return (h("div", { class: "panel" }, h("div", { class: "header" }, h("button", { class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => this.close() }, h("img", { class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", null, isGroup ? 'Group info' : 'Contact info')), h("div", { class: "body" }, h("div", { class: "card hero" }, h("profile-avatar", { src: this.contactImage || '', name: this.contactName || '?', size: "7rem", isGroup: isGroup }), h("h3", { class: "hero-name" }, this.contactName || 'Unknown'), isGroup ? (h("p", { class: "hero-meta" }, "Group \u00B7 ", h("span", { class: "count" }, members.length, " members"))) : this.contactEmail ? (h("p", { class: "hero-meta" }, this.contactEmail)) : null), h("div", { class: "card" }, h("div", { class: "media-head", onClick: this.openMediaList }, h("div", { class: "media-label-row" }, h("span", { class: "media-icon", style: { ['--media-mask']: `url(${PhotosIcon})` } }), h("span", { class: "media-label" }, "Media, links and docs")), h("div", { class: "media-count-row" }, h("span", null, mediaCount || 0), h("span", { class: "chevron" }))), thumbs.length > 0 ? (h("div", { class: "media-grid" }, thumbs.map(item => (h("div", { class: "media-cell", onClick: this.openMediaList }, this.isVideo(item) ? (h("video", { src: item.mediaUrl || this.attUrl(item), muted: true, preload: "metadata" })) : (h("img", { src: this.shownSrc(item), alt: "", onError: () => this.onPreviewError(item) })), this.isVideo(item) ? h("img", { class: "play-badge", src: PlayIcon, alt: "" }) : null))))) : (h("div", { style: { height: 'var(--space-16)' } }))), isGroup ? (h("div", { class: "card" }, h("div", { class: "members-head" }, members.length, " members"), h("button", { type: "button", class: "add-member-row", onClick: this.openAddMember }, h("span", { class: "add-member-icon" }, h("img", { class: "theme-icon", src: AddUserIcon, alt: "" })), h("span", null, "Add member")), members.map((m) => {
6615
+ return (h("div", { class: "panel" }, h("div", { class: "header" }, h("button", { class: "close-btn", type: "button", "aria-label": "Close", title: "Close", onClick: () => this.close() }, h("img", { class: "theme-icon", src: CancelIcon, alt: "" })), h("h2", null, isGroup ? 'Group info' : 'Contact info')), h("div", { class: "body" }, h("div", { class: "card hero" }, h("div", { class: "hero-avatar-wrap" }, h("profile-avatar", { src: this.contactImage || '', name: this.contactName || '?', size: "7rem", isGroup: isGroup }), this.canEditGroupInfo() ? (h("button", { class: "photo-edit-btn", type: "button", "aria-label": "Change group photo", title: "Change group photo", disabled: this.imageUploading, onClick: this.openImagePicker }, h("img", { class: "theme-icon", src: CameraAddIcon, alt: "" }))) : null, h("input", { type: "file", accept: "image/*", hidden: true, ref: el => (this.imageFileInput = el), onChange: this.onImageFileChange })), this.titleEditing ? (h("div", { class: "title-edit-row" }, h("input", { class: "title-edit-input", type: "text", maxlength: 100, value: this.titleDraft, "aria-label": "Group name", onInput: this.onTitleDraftInput, onKeyDown: this.onTitleDraftKeyDown }), h("button", { class: "title-edit-save", type: "button", onClick: this.saveTitleEdit }, "Save"), h("button", { class: "title-edit-cancel", type: "button", onClick: this.cancelTitleEdit }, "Cancel"))) : (h("div", { class: "hero-name-row" }, h("h3", { class: "hero-name" }, this.contactName || 'Unknown'), this.canEditGroupInfo() ? (h("button", { class: "title-edit-btn", type: "button", "aria-label": "Edit group name", title: "Edit group name", onClick: this.startTitleEdit }, h("img", { class: "theme-icon", src: EditIcon, alt: "" }))) : null)), isGroup ? (h("p", { class: "hero-meta" }, "Group \u00B7 ", h("span", { class: "count" }, members.length, " members"))) : this.contactEmail ? (h("p", { class: "hero-meta" }, this.contactEmail)) : null), h("div", { class: "card" }, h("div", { class: "media-head", onClick: this.openMediaList }, h("div", { class: "media-label-row" }, h("span", { class: "media-icon", style: { ['--media-mask']: `url(${PhotosIcon})` } }), h("span", { class: "media-label" }, "Media, links and docs")), h("div", { class: "media-count-row" }, h("span", null, mediaCount || 0), h("span", { class: "chevron" }))), thumbs.length > 0 ? (h("div", { class: "media-grid" }, thumbs.map(item => (h("div", { class: "media-cell", onClick: this.openMediaList }, this.isVideo(item) ? (h("video", { src: item.mediaUrl || this.attUrl(item), muted: true, preload: "metadata" })) : (h("img", { src: this.shownSrc(item), alt: "", onError: () => this.onPreviewError(item) })), this.isVideo(item) ? h("img", { class: "play-badge", src: PlayIcon, alt: "" }) : null))))) : (h("div", { style: { height: 'var(--space-16)' } }))), isGroup ? (h("div", { class: "card" }, h("div", { class: "members-head" }, members.length, " members"), h("button", { type: "button", class: "add-member-row", onClick: this.openAddMember }, h("span", { class: "add-member-icon" }, h("img", { class: "theme-icon", src: AddUserIcon, alt: "" })), h("span", null, "Add member")), members.map((m) => {
6416
6616
  var _a, _b, _c;
6417
6617
  const isSelf = m.userId === ((_a = this.userMetaData) === null || _a === void 0 ? void 0 : _a.userId);
6418
6618
  const canManage = this.isSelfAdmin() && !isSelf;
@@ -6422,10 +6622,12 @@ const ContactInfo = class {
6422
6622
  }
6423
6623
  get el() { return getElement(this); }
6424
6624
  static get watchers() { return {
6425
- "allAttachments": ["onAttachmentsChange"]
6625
+ "allAttachments": ["onAttachmentsChange"],
6626
+ "conversationId": ["onConversationChange"],
6627
+ "contactImage": ["onContactImageChange"]
6426
6628
  }; }
6427
6629
  };
6428
- ContactInfo.style = ":host {\n display: block;\n height: var(--h-full);\n width: var(--w-full);\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n height: var(--h-full);\n background: var(--bg-primary);\n }\n .header {\n height: var(--rail-width);\n padding: 0 var(--space-16);\n background: var(--bg-primary);\n border-bottom: 1px solid var(--border);\n display: flex;\n align-items: center;\n gap: var(--gap-16);\n flex-shrink: 0;\n box-sizing: border-box;\n }\n .header h2 {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .close-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n border-radius: var(--rounded-full);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--icon);\n }\n .close-btn:hover { background: var(--hover-overlay); color: var(--text-primary); }\n .close-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n background: var(--bg-primary);\n }\n .card {\n background: var(--bg-primary);\n border-bottom: 1px solid var(--border);\n box-sizing: border-box;\n }\n .hero {\n padding: 1.5rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n }\n .hero-name {\n margin: var(--gap-16) 0 var(--gap-4);\n font-size: var(--text-20);\n font-weight: var(--fw-700);\n color: var(--text-primary);\n }\n .hero-meta {\n margin: 0;\n font-size: var(--text-12);\n font-weight: var(--fw-500);\n color: var(--text-secondary);\n }\n .hero-meta .count { color: var(--brand); font-weight: var(--fw-600); }\n .media-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--space-16) 1.25rem 0;\n cursor: pointer;\n }\n .media-head:hover .media-label { color: var(--brand); }\n .media-label-row {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n }\n .media-icon {\n width: var(--icon-sm);\n height: var(--icon-sm);\n min-width: var(--icon-sm);\n flex-shrink: 0;\n background-color: var(--icon);\n -webkit-mask: var(--media-mask) center / contain no-repeat;\n mask: var(--media-mask) center / contain no-repeat;\n }\n .media-label {\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n }\n .media-count-row {\n display: flex;\n align-items: center;\n gap: var(--gap-4);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n }\n .chevron {\n width: 0.4rem;\n height: 0.4rem;\n border-right: 2px solid var(--text-secondary);\n border-bottom: 2px solid var(--text-secondary);\n transform: rotate(-45deg);\n margin-left: 2px;\n }\n .media-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--gap-8);\n padding: var(--gap-8) 1.25rem 1.25rem;\n }\n .media-cell {\n position: relative;\n aspect-ratio: 16 / 9;\n border-radius: var(--rounded-8);\n overflow: hidden;\n background: var(--bg-input);\n border: 1px solid var(--border);\n cursor: pointer;\n }\n .members-head {\n padding: var(--space-16) 1.25rem var(--space-12);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n .add-member-row {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: 0.625rem 1.25rem;\n border: none;\n border-top: 1px solid var(--border-subtle);\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n box-sizing: border-box;\n }\n .add-member-row:hover { background: var(--hover-overlay); }\n .add-member-icon {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: var(--rounded-full);\n background: var(--brand);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n .add-member-icon img {\n width: 1.25rem;\n height: 1.25rem;\n display: block;\n filter: brightness(0) invert(1);\n }\n .member {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: 0.625rem 1.25rem;\n border-top: 1px solid var(--border-subtle);\n box-sizing: border-box;\n }\n .member-text { min-width: 0; flex: 1; }\n .member-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n gap: var(--gap-6);\n }\n .member-badge {\n flex-shrink: 0;\n font-size: var(--text-10);\n font-weight: var(--fw-600);\n padding: 0.1rem 0.35rem;\n border-radius: var(--rounded-full);\n background: var(--brand-soft);\n color: var(--brand);\n text-transform: uppercase;\n letter-spacing: 0.02em;\n }\n .member-sub {\n margin: 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .member-more-wrap { position: relative; flex-shrink: 0; }\n .member-more-btn {\n width: 2rem;\n height: 2rem;\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n color: var(--icon);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.125rem;\n line-height: 1;\n padding: 0;\n }\n .member-more-btn:hover { background: var(--hover-overlay); }\n .member-menu {\n position: absolute;\n right: 0;\n top: calc(100% + 0.25rem);\n min-width: 10.5rem;\n padding: 0.35rem;\n border-radius: var(--rounded-8);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);\n z-index: 20;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n .member-menu button {\n border: none;\n background: transparent;\n text-align: left;\n padding: 0.55rem 0.65rem;\n border-radius: var(--rounded-6);\n cursor: pointer;\n font-family: var(--font-primary);\n font-size: var(--text-13, 0.8125rem);\n color: var(--text-primary);\n }\n .member-menu button:hover { background: var(--hover-overlay); }\n .member-menu button.danger { color: var(--danger); }\n .actions {\n padding: var(--space-16);\n display: flex;\n flex-direction: column;\n gap: var(--gap-8);\n }\n .action {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-8);\n border: none;\n border-radius: var(--rounded-8);\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-family: var(--font-primary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--danger);\n box-sizing: border-box;\n }\n .action:hover { background: rgba(250, 0, 0, 0.08); }\n .action-icon {\n width: var(--icon-md);\n height: var(--icon-md);\n min-width: var(--icon-md);\n min-height: var(--icon-md);\n flex-shrink: 0;\n background-color: currentColor;\n -webkit-mask: var(--action-mask) center / contain no-repeat;\n mask: var(--action-mask) center / contain no-repeat;\n }\n\n /* Media list (full Media / Docs / Links) */\n .tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n flex-shrink: 0;\n background: var(--bg-primary);\n }\n .tab {\n flex: 1;\n padding: var(--space-12) var(--space-8);\n border: none;\n background: transparent;\n cursor: pointer;\n font-family: var(--font-primary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-secondary);\n position: relative;\n }\n .tab.active { color: var(--brand); font-weight: var(--fw-600); }\n .tab.active::after {\n content: '';\n position: absolute;\n left: 20%;\n right: 20%;\n bottom: 0;\n height: 2px;\n background: var(--brand);\n border-radius: 2px 2px 0 0;\n }\n .tab-body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: var(--space-12);\n background: var(--bg-primary);\n }\n .media-list-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--gap-8);\n }\n .media-list-cell {\n position: relative;\n aspect-ratio: 1;\n border-radius: var(--rounded-8);\n overflow: hidden;\n background: var(--bg-input);\n cursor: pointer;\n }\n .media-list-cell img, .media-list-cell video,\n .media-cell img, .media-cell video {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n }\n .media-list-cell .play-badge, .media-cell .play-badge {\n position: absolute;\n inset: auto;\n left: 50%;\n top: 50%;\n width: 1.5rem;\n height: 1.5rem;\n object-fit: contain;\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n .empty {\n padding: 2.5rem var(--space-16);\n text-align: center;\n color: var(--text-secondary);\n font-size: var(--text-14);\n }\n .empty strong {\n display: block;\n margin-bottom: var(--gap-4);\n color: var(--text-primary);\n font-size: var(--text-16);\n }\n .doc-item, .link-item {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-12);\n border-radius: var(--rounded-8);\n text-decoration: none;\n color: inherit;\n cursor: pointer;\n border: none;\n background: transparent;\n width: 100%;\n text-align: left;\n font-family: var(--font-primary);\n box-sizing: border-box;\n }\n .doc-item:hover, .link-item:hover { background: var(--hover-overlay); }\n .doc-icon {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--rounded-8);\n background: var(--bg-input);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n .doc-icon img {\n width: var(--icon-md);\n height: var(--icon-md);\n display: block;\n }\n .doc-meta { min-width: 0; flex: 1; }\n .doc-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .doc-sub {\n margin: 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n }\n .month-sep {\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n padding: var(--space-8) var(--space-4);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n .gallery-overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n flex-direction: column;\n }\n .gallery-top {\n display: flex;\n justify-content: flex-end;\n padding: var(--space-12);\n }\n .gallery-top button {\n border: none;\n background: transparent;\n color: #fff;\n font-size: 1.5rem;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n }\n .gallery-main {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 0;\n padding: var(--space-16);\n }\n .gallery-main img, .gallery-main video {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
6630
+ ContactInfo.style = ":host {\n display: block;\n height: var(--h-full);\n width: var(--w-full);\n font-family: var(--font-primary);\n color: var(--text-primary);\n }\n .panel {\n display: flex;\n flex-direction: column;\n height: var(--h-full);\n background: var(--bg-primary);\n }\n .header {\n height: var(--rail-width);\n padding: 0 var(--space-16);\n background: var(--bg-primary);\n border-bottom: 1px solid var(--border);\n display: flex;\n align-items: center;\n gap: var(--gap-16);\n flex-shrink: 0;\n box-sizing: border-box;\n }\n .header h2 {\n margin: 0;\n font-size: var(--text-16);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n }\n .close-btn {\n border: none;\n background: transparent;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n border-radius: var(--rounded-full);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n color: var(--icon);\n }\n .close-btn:hover { background: var(--hover-overlay); color: var(--text-primary); }\n .close-btn img {\n width: var(--icon-sm);\n height: var(--icon-sm);\n display: block;\n }\n .body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n background: var(--bg-primary);\n }\n .card {\n background: var(--bg-primary);\n border-bottom: 1px solid var(--border);\n box-sizing: border-box;\n }\n .hero {\n padding: 1.5rem;\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n }\n .hero-avatar-wrap {\n position: relative;\n width: 7rem;\n height: 7rem;\n flex-shrink: 0;\n }\n .photo-edit-btn {\n position: absolute;\n right: 0;\n bottom: 0;\n width: 2rem;\n height: 2rem;\n border: 1px solid var(--border);\n border-radius: var(--rounded-full);\n background: var(--bg-primary);\n color: var(--text-primary);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding: 0;\n box-shadow: 0 1px 3px rgb(0 0 0 / 0.12);\n z-index: 2;\n }\n .photo-edit-btn:hover { background: var(--hover-overlay); }\n .photo-edit-btn:disabled {\n opacity: 0.55;\n cursor: wait;\n }\n .photo-edit-btn img {\n width: 0.95rem;\n height: 0.95rem;\n display: block;\n }\n .hero-name-row {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: var(--gap-4);\n margin: var(--gap-16) 0 var(--gap-4);\n max-width: 100%;\n }\n .hero-name {\n margin: 0;\n font-size: var(--text-20);\n font-weight: var(--fw-700);\n color: var(--text-primary);\n word-break: break-word;\n }\n .title-edit-btn {\n flex-shrink: 0;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n border-radius: var(--rounded-8);\n background: transparent;\n color: var(--text-secondary);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n padding: 0;\n }\n .title-edit-btn:hover {\n background: var(--hover-overlay);\n color: var(--text-primary);\n }\n .title-edit-btn img {\n width: 0.95rem;\n height: 0.95rem;\n display: block;\n }\n .title-edit-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: var(--gap-8);\n margin: var(--gap-16) 0 var(--gap-4);\n width: 100%;\n max-width: 18rem;\n }\n .title-edit-input {\n flex: 1 1 8rem;\n min-width: 0;\n height: 2.25rem;\n padding: 0 0.75rem;\n border: 1px solid var(--border);\n border-radius: var(--rounded-8);\n background: var(--bg-input, var(--bg-primary));\n color: var(--text-primary);\n font: inherit;\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n box-sizing: border-box;\n }\n .title-edit-input:focus {\n outline: none;\n border-color: var(--brand, var(--text-primary));\n }\n .title-edit-save,\n .title-edit-cancel {\n height: 2.25rem;\n padding: 0 0.75rem;\n border-radius: var(--rounded-8);\n font: inherit;\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n cursor: pointer;\n }\n .title-edit-save {\n border: none;\n background: var(--text-primary);\n color: var(--bg-primary);\n }\n .title-edit-cancel {\n border: 1px solid var(--border);\n background: transparent;\n color: var(--text-secondary);\n }\n .hero-meta {\n margin: 0;\n font-size: var(--text-12);\n font-weight: var(--fw-500);\n color: var(--text-secondary);\n }\n .hero-meta .count { color: var(--brand); font-weight: var(--fw-600); }\n .media-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--space-16) 1.25rem 0;\n cursor: pointer;\n }\n .media-head:hover .media-label { color: var(--brand); }\n .media-label-row {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n }\n .media-icon {\n width: var(--icon-sm);\n height: var(--icon-sm);\n min-width: var(--icon-sm);\n flex-shrink: 0;\n background-color: var(--icon);\n -webkit-mask: var(--media-mask) center / contain no-repeat;\n mask: var(--media-mask) center / contain no-repeat;\n }\n .media-label {\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n }\n .media-count-row {\n display: flex;\n align-items: center;\n gap: var(--gap-4);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n }\n .chevron {\n width: 0.4rem;\n height: 0.4rem;\n border-right: 2px solid var(--text-secondary);\n border-bottom: 2px solid var(--text-secondary);\n transform: rotate(-45deg);\n margin-left: 2px;\n }\n .media-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--gap-8);\n padding: var(--gap-8) 1.25rem 1.25rem;\n }\n .media-cell {\n position: relative;\n aspect-ratio: 16 / 9;\n border-radius: var(--rounded-8);\n overflow: hidden;\n background: var(--bg-input);\n border: 1px solid var(--border);\n cursor: pointer;\n }\n .members-head {\n padding: var(--space-16) 1.25rem var(--space-12);\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n .add-member-row {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: 0.625rem 1.25rem;\n border: none;\n border-top: 1px solid var(--border-subtle);\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-family: inherit;\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n box-sizing: border-box;\n }\n .add-member-row:hover { background: var(--hover-overlay); }\n .add-member-icon {\n width: 2.25rem;\n height: 2.25rem;\n border-radius: var(--rounded-full);\n background: var(--brand);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n .add-member-icon img {\n width: 1.25rem;\n height: 1.25rem;\n display: block;\n filter: brightness(0) invert(1);\n }\n .member {\n position: relative;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: 0.625rem 1.25rem;\n border-top: 1px solid var(--border-subtle);\n box-sizing: border-box;\n }\n .member-text { min-width: 0; flex: 1; }\n .member-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-600);\n color: var(--text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: flex;\n align-items: center;\n gap: var(--gap-6);\n }\n .member-badge {\n flex-shrink: 0;\n font-size: var(--text-10);\n font-weight: var(--fw-600);\n padding: 0.1rem 0.35rem;\n border-radius: var(--rounded-full);\n background: var(--brand-soft);\n color: var(--brand);\n text-transform: uppercase;\n letter-spacing: 0.02em;\n }\n .member-sub {\n margin: 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .member-more-wrap { position: relative; flex-shrink: 0; }\n .member-more-btn {\n width: 2rem;\n height: 2rem;\n border: none;\n border-radius: var(--rounded-full);\n background: transparent;\n color: var(--icon);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.125rem;\n line-height: 1;\n padding: 0;\n }\n .member-more-btn:hover { background: var(--hover-overlay); }\n .member-menu {\n position: absolute;\n right: 0;\n top: calc(100% + 0.25rem);\n min-width: 10.5rem;\n padding: 0.35rem;\n border-radius: var(--rounded-8);\n background: var(--bg-primary);\n border: 1px solid var(--border);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);\n z-index: 20;\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n .member-menu button {\n border: none;\n background: transparent;\n text-align: left;\n padding: 0.55rem 0.65rem;\n border-radius: var(--rounded-6);\n cursor: pointer;\n font-family: var(--font-primary);\n font-size: var(--text-13, 0.8125rem);\n color: var(--text-primary);\n }\n .member-menu button:hover { background: var(--hover-overlay); }\n .member-menu button.danger { color: var(--danger); }\n .actions {\n padding: var(--space-16);\n display: flex;\n flex-direction: column;\n gap: var(--gap-8);\n }\n .action {\n width: 100%;\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-8);\n border: none;\n border-radius: var(--rounded-8);\n background: transparent;\n cursor: pointer;\n text-align: left;\n font-family: var(--font-primary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--danger);\n box-sizing: border-box;\n }\n .action:hover { background: rgba(250, 0, 0, 0.08); }\n .action-icon {\n width: var(--icon-md);\n height: var(--icon-md);\n min-width: var(--icon-md);\n min-height: var(--icon-md);\n flex-shrink: 0;\n background-color: currentColor;\n -webkit-mask: var(--action-mask) center / contain no-repeat;\n mask: var(--action-mask) center / contain no-repeat;\n }\n\n /* Media list (full Media / Docs / Links) */\n .tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n flex-shrink: 0;\n background: var(--bg-primary);\n }\n .tab {\n flex: 1;\n padding: var(--space-12) var(--space-8);\n border: none;\n background: transparent;\n cursor: pointer;\n font-family: var(--font-primary);\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-secondary);\n position: relative;\n }\n .tab.active { color: var(--brand); font-weight: var(--fw-600); }\n .tab.active::after {\n content: '';\n position: absolute;\n left: 20%;\n right: 20%;\n bottom: 0;\n height: 2px;\n background: var(--brand);\n border-radius: 2px 2px 0 0;\n }\n .tab-body {\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n padding: var(--space-12);\n background: var(--bg-primary);\n }\n .media-list-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: var(--gap-8);\n }\n .media-list-cell {\n position: relative;\n aspect-ratio: 1;\n border-radius: var(--rounded-8);\n overflow: hidden;\n background: var(--bg-input);\n cursor: pointer;\n }\n .media-list-cell img, .media-list-cell video,\n .media-cell img, .media-cell video {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n display: block;\n }\n .media-list-cell .play-badge, .media-cell .play-badge {\n position: absolute;\n inset: auto;\n left: 50%;\n top: 50%;\n width: 1.5rem;\n height: 1.5rem;\n object-fit: contain;\n transform: translate(-50%, -50%);\n pointer-events: none;\n }\n .empty {\n padding: 2.5rem var(--space-16);\n text-align: center;\n color: var(--text-secondary);\n font-size: var(--text-14);\n }\n .empty strong {\n display: block;\n margin-bottom: var(--gap-4);\n color: var(--text-primary);\n font-size: var(--text-16);\n }\n .doc-item, .link-item {\n display: flex;\n align-items: center;\n gap: var(--gap-12);\n padding: var(--space-12);\n border-radius: var(--rounded-8);\n text-decoration: none;\n color: inherit;\n cursor: pointer;\n border: none;\n background: transparent;\n width: 100%;\n text-align: left;\n font-family: var(--font-primary);\n box-sizing: border-box;\n }\n .doc-item:hover, .link-item:hover { background: var(--hover-overlay); }\n .doc-icon {\n width: 2.5rem;\n height: 2.5rem;\n border-radius: var(--rounded-8);\n background: var(--bg-input);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n .doc-icon img {\n width: var(--icon-md);\n height: var(--icon-md);\n display: block;\n }\n .doc-meta { min-width: 0; flex: 1; }\n .doc-name {\n margin: 0;\n font-size: var(--text-14);\n font-weight: var(--fw-500);\n color: var(--text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .doc-sub {\n margin: 0;\n font-size: var(--text-12);\n color: var(--text-secondary);\n }\n .month-sep {\n font-size: var(--text-12);\n font-weight: var(--fw-600);\n color: var(--text-secondary);\n padding: var(--space-8) var(--space-4);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n }\n .gallery-overlay {\n position: fixed;\n inset: 0;\n z-index: 1000;\n background: rgba(0, 0, 0, 0.85);\n display: flex;\n flex-direction: column;\n }\n .gallery-top {\n display: flex;\n justify-content: flex-end;\n padding: var(--space-12);\n }\n .gallery-top button {\n border: none;\n background: transparent;\n color: #fff;\n font-size: 1.5rem;\n cursor: pointer;\n width: var(--control);\n height: var(--control);\n }\n .gallery-main {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 0;\n padding: var(--space-16);\n }\n .gallery-main img, .gallery-main video {\n max-width: 100%;\n max-height: 100%;\n object-fit: contain;\n }\n .theme-icon { filter: var(--svg-icon-filter); }";
6429
6631
 
6430
6632
  const ProfileInfo = class {
6431
6633
  constructor(hostRef) {
@@ -6762,8 +6964,21 @@ const WebChatRightSide = class {
6762
6964
  },
6763
6965
  });
6764
6966
  await this.handleEditGroupImage(mediaUrl, conversationId);
6765
- // Update conversation details with the new image URL
6967
+ // Keep Group info + header store + conversation list in sync
6968
+ // (same path as edit-title → hostConversationUpdate type:'image').
6766
6969
  this.conversationMetaData = Object.assign(Object.assign({}, this.conversationMetaData), { conversationImageUrl: mediaUrl });
6970
+ conversationStore.updateConversationDetails({
6971
+ conversationImageUrl: mediaUrl,
6972
+ });
6973
+ this.el.dispatchEvent(new CustomEvent('conversation-updated', {
6974
+ detail: {
6975
+ conversationId,
6976
+ type: 'image',
6977
+ value: mediaUrl,
6978
+ },
6979
+ bubbles: true,
6980
+ composed: true,
6981
+ }));
6767
6982
  if (onSuccess)
6768
6983
  onSuccess();
6769
6984
  }
@@ -6772,8 +6987,10 @@ const WebChatRightSide = class {
6772
6987
  console.error('Failed to update image:', error);
6773
6988
  if (onError)
6774
6989
  onError();
6775
- // Revert optimistic update in conversation details
6776
6990
  this.conversationMetaData = Object.assign(Object.assign({}, this.conversationMetaData), { conversationImageUrl: currentImage });
6991
+ conversationStore.updateConversationDetails({
6992
+ conversationImageUrl: currentImage,
6993
+ });
6777
6994
  }
6778
6995
  }
6779
6996
  }