alice-and-bot 1.0.95 → 1.0.96

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 (2) hide show
  1. package/components.js +860 -345
  2. package/package.json +1 -1
package/components.js CHANGED
@@ -438,7 +438,7 @@ var require__ = __commonJS({
438
438
  });
439
439
 
440
440
  // lit/components/connected-chat.ts
441
- import { html as html11, LitElement as LitElement10, nothing as nothing6 } from "lit";
441
+ import { html as html12, LitElement as LitElement10, nothing as nothing6 } from "lit";
442
442
 
443
443
  // protocol/src/pushNotification.ts
444
444
  var maxPreviewLength = 160;
@@ -1544,7 +1544,7 @@ var makeCreateVoiceCall = (deps) => (params) => {
1544
1544
  var createVoiceCall = (params) => makeCreateVoiceCall(defaultDeps())(params);
1545
1545
 
1546
1546
  // lit/components/chat-box.ts
1547
- import { html as html9, LitElement as LitElement8, nothing as nothing4 } from "lit";
1547
+ import { html as html10, LitElement as LitElement8, nothing as nothing4 } from "lit";
1548
1548
  import { repeat } from "lit/directives/repeat.js";
1549
1549
 
1550
1550
  // lit/components/design.ts
@@ -1828,9 +1828,22 @@ var faCopy = icon("M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-2
1828
1828
  var faReply = icon("M8.309 189.836L184.313 37.851C199.719 24.546 224 35.347 224 56.015v80.053c160.629 5.618 288 66.816 288 207.931 0 56.548-36.256 112.589-76.437 141.821-12.73 9.261-30.669-2.577-25.536-17.832C449.428 344.102 376.389 292.009 224 288.063v84.421c0 20.7-24.3 31.453-39.687 18.164L8.309 238.477c-11.078-9.592-11.078-26.049 0-35.641z", "0 0 512 512");
1829
1829
  var faShare = icon("M503.7 226.2l-160-160c-21.9-21.9-59.7-6.3-59.7 24.7V160H224C100.3 160 0 260.3 0 384c0 35.3 28.7 64 64 64 27.2 0 50.4-16.9 59.8-41.4 24.4-63.7 85.3-110.6 156.2-110.6h5v69.1c0 31.1 37.8 46.6 59.7 24.7l160-160c12.5-12.5 12.5-32.8 0-45.6z", "0 0 512 512");
1830
1830
  var faChevronDown = icon("M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z", "0 0 24 24");
1831
+ var faPlus = html`
1832
+ <svg
1833
+ xmlns="http://www.w3.org/2000/svg"
1834
+ viewBox="0 0 24 24"
1835
+ fill="none"
1836
+ stroke="currentColor"
1837
+ stroke-width="2.4"
1838
+ stroke-linecap="round"
1839
+ style="width:1em;height:1em;display:block"
1840
+ >
1841
+ <path d="M12 5v14M5 12h14" />
1842
+ </svg>
1843
+ `;
1831
1844
 
1832
1845
  // lit/components/chat-message.ts
1833
- import { html as html7, LitElement as LitElement6, nothing as nothing3 } from "lit";
1846
+ import { html as html8, LitElement as LitElement6, nothing as nothing3 } from "lit";
1834
1847
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
1835
1848
 
1836
1849
  // lit/components/chat-attachment.ts
@@ -2944,11 +2957,13 @@ var ChatAttachment = class extends LitElement4 {
2944
2957
  }
2945
2958
  if (attachment.type === "image") {
2946
2959
  const isSelected = this._decryptedUrl && this._decryptedUrl === this.selectedImageSrc;
2960
+ const highlightAnim = isDark ? "msg-highlight-dark" : "msg-highlight-light";
2961
+ const selectedShadow = isDark ? "0 0 0 1px rgba(255,255,255,0.18),0 14px 36px rgba(0,0,0,0.62)" : "0 0 0 1px rgba(24,23,21,0.08),0 12px 32px rgba(24,23,21,0.22)";
2947
2962
  return this._decryptedUrl ? html5`
2948
2963
  <img
2949
2964
  src="${this._decryptedUrl}"
2950
2965
  alt="${attachment.name}"
2951
- style="max-width:100%;border-radius:8px;cursor:pointer;transition:box-shadow .15s${isSelected ? ";box-shadow:0 0 0 3px rgba(57,88,127,0.35),0 6px 18px rgba(57,88,127,0.22)" : ""}${this.longPressActive && isSelected ? ";animation:msg-highlight .3s ease forwards" : ""}"
2966
+ style="max-width:100%;border-radius:8px;cursor:pointer;transition:box-shadow .22s ease,filter .22s ease${isSelected ? `;box-shadow:${selectedShadow}` : ""}${this.longPressActive && isSelected ? `;animation:${highlightAnim} .28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards` : ""}"
2952
2967
  />
2953
2968
  ` : this._failed ? unavailableAttachmentHtml(isDark) : html5`
2954
2969
  <div style="${imagePlaceholderStyle(isDark)}">${spinnerHtml(isDark)}</div>
@@ -3836,7 +3851,7 @@ var blurredSecretHtml = (secret) => {
3836
3851
  };
3837
3852
  var withSecretsBlurred = (text) => secretsInText(text).reverse().reduce((result, { start, end }) => result.slice(0, start) + blurredSecretHtml(result.slice(start, end)) + result.slice(end), text);
3838
3853
  var tagOrText = /(<[^>]+>)/;
3839
- var blurSecretsInHtml = (html13) => html13.split(tagOrText).map((part) => part.startsWith("<") ? part : withSecretsBlurred(part)).join("");
3854
+ var blurSecretsInHtml = (html14) => html14.split(tagOrText).map((part) => part.startsWith("<") ? part : withSecretsBlurred(part)).join("");
3840
3855
  var secretBlurCss = (isDark) => `
3841
3856
  .secret-blur{border-radius:4px;padding:0 3px;cursor:default;background:${isDark ? "#ffffff14" : "#0000000d"}}
3842
3857
  .secret-blur .secret-prefix{font-family:inherit;opacity:.85}
@@ -4081,10 +4096,10 @@ var processButtons = (text, isDark, primaryColor, showButtons) => {
4081
4096
  var escapeHtmlTags = (text) => text.replace(/<(\/?[a-zA-Z!])/g, "&lt;$1");
4082
4097
  var renderMarkdown = (text, textColor, isDark, primaryColor = defaultPrimary(isDark), showButtons = true) => {
4083
4098
  const { text: cleanText, buttonsHtml } = processButtons(text, isDark, primaryColor, showButtons);
4084
- const html13 = createMarked(textColor, isDark).parse(escapeHtmlTags(preprocessText(cleanText)), {
4099
+ const html14 = createMarked(textColor, isDark).parse(escapeHtmlTags(preprocessText(cleanText)), {
4085
4100
  async: false
4086
4101
  }).trim();
4087
- const trimmedHtml = html13.replace(/(?:<br\s*\/?>)+$/gi, "");
4102
+ const trimmedHtml = html14.replace(/(?:<br\s*\/?>)+$/gi, "");
4088
4103
  const spanCount = (trimmedHtml.match(/<span\b/g) || []).length;
4089
4104
  const hasOtherBlocks = /<(div|pre|blockquote|ul|ol|table|h[1-6])\b/i.test(trimmedHtml);
4090
4105
  const baseHtml = spanCount === 1 && !hasOtherBlocks && trimmedHtml.startsWith("<span") && trimmedHtml.endsWith("</span>") ? trimmedHtml.replace(/^<span\b[^>]*>/i, "").replace(/<\/span>$/i, "") : trimmedHtml;
@@ -4092,6 +4107,9 @@ var renderMarkdown = (text, textColor, isDark, primaryColor = defaultPrimary(isD
4092
4107
  };
4093
4108
  var fencedCodeHoverCss = `.fenced-code-wrap:hover [data-testid="copy-code-button"]{opacity:1!important;background:#ffffff1a!important}`;
4094
4109
 
4110
+ // lit/components/reaction-picker.ts
4111
+ import { html as html7 } from "lit";
4112
+
4095
4113
  // lit/components/emoji.ts
4096
4114
  var quickReactionEmojis = [
4097
4115
  "\u{1F44D}",
@@ -6558,6 +6576,389 @@ var parseReactionCommand = (text) => {
6558
6576
  } : null;
6559
6577
  };
6560
6578
 
6579
+ // lit/components/reaction-picker.ts
6580
+ var clamp = (value, min, max2) => Math.max(min, Math.min(value, Math.max(min, max2)));
6581
+ var viewportMargin = 12;
6582
+ var anchorGap = 8;
6583
+ var mobileAnchorGap = 10;
6584
+ var quickBarHeight = 46;
6585
+ var quickBarWidth = 242;
6586
+ var mobilePillHeight = 52;
6587
+ var mobilePillMaxWidth = 276;
6588
+ var mobileMenuMaxWidth = 236;
6589
+ var mobileActionRowHeight = 46;
6590
+ var desktopPopoverMaxWidth = 352;
6591
+ var desktopPopoverMaxHeight = 416;
6592
+ var computeQuickBarPosition = ({ anchor, isOwn, vpWidth, vpHeight }) => {
6593
+ const width = Math.min(quickBarWidth, vpWidth - viewportMargin * 2);
6594
+ const aboveTop = anchor.top - quickBarHeight - anchorGap;
6595
+ const fitsAbove = aboveTop >= viewportMargin;
6596
+ const placement = fitsAbove ? "above" : "below";
6597
+ const rawTop = fitsAbove ? aboveTop : anchor.bottom + anchorGap;
6598
+ const top = clamp(rawTop, viewportMargin, vpHeight - quickBarHeight - viewportMargin);
6599
+ const rawLeft = isOwn ? anchor.right - width : anchor.left;
6600
+ const left = clamp(rawLeft, viewportMargin, vpWidth - width - viewportMargin);
6601
+ return {
6602
+ top,
6603
+ left,
6604
+ width,
6605
+ placement
6606
+ };
6607
+ };
6608
+ var computeEmojiPopoverPosition = ({ anchor, isOwn, vpWidth, vpHeight }) => {
6609
+ const width = Math.min(desktopPopoverMaxWidth, vpWidth - viewportMargin * 2);
6610
+ const height = Math.min(desktopPopoverMaxHeight, vpHeight - viewportMargin * 2);
6611
+ const fitsAbove = anchor.top - anchorGap - viewportMargin >= height;
6612
+ const fitsBelow = vpHeight - anchor.bottom - anchorGap - viewportMargin >= height;
6613
+ if (fitsAbove) {
6614
+ const left2 = clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
6615
+ return {
6616
+ top: anchor.top - height - anchorGap,
6617
+ left: left2,
6618
+ width,
6619
+ height,
6620
+ placement: "above"
6621
+ };
6622
+ }
6623
+ if (fitsBelow) {
6624
+ const left2 = clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
6625
+ return {
6626
+ top: anchor.bottom + anchorGap,
6627
+ left: left2,
6628
+ width,
6629
+ height,
6630
+ placement: "below"
6631
+ };
6632
+ }
6633
+ const sideLeft = isOwn ? anchor.left - width - anchorGap : anchor.right + anchorGap;
6634
+ const fitsSide = sideLeft >= viewportMargin && sideLeft + width <= vpWidth - viewportMargin;
6635
+ const left = fitsSide ? sideLeft : clamp(isOwn ? anchor.right - width : anchor.left, viewportMargin, vpWidth - width - viewportMargin);
6636
+ const top = clamp(anchor.top, viewportMargin, vpHeight - height - viewportMargin);
6637
+ return {
6638
+ top,
6639
+ left,
6640
+ width,
6641
+ height,
6642
+ placement: "side"
6643
+ };
6644
+ };
6645
+ var computeMobileContextLayout = ({ anchor, isOwn, hasReactions, actionCount, vpWidth, vpHeight }) => {
6646
+ const topSafe = 16;
6647
+ const bottomSafe = 16;
6648
+ const pillWidth = Math.min(mobilePillMaxWidth, vpWidth - viewportMargin * 2);
6649
+ const menuWidth = Math.min(mobileMenuMaxWidth, vpWidth - viewportMargin * 2);
6650
+ const menuHeight = Math.max(1, actionCount) * mobileActionRowHeight + 8;
6651
+ const pillLeft = clamp(isOwn ? anchor.right - pillWidth : anchor.left, viewportMargin, vpWidth - pillWidth - viewportMargin);
6652
+ const menuLeft = clamp(isOwn ? anchor.right - menuWidth : anchor.left, viewportMargin, vpWidth - menuWidth - viewportMargin);
6653
+ const idealPillTop = anchor.top - mobilePillHeight - mobileAnchorGap;
6654
+ const idealMenuTop = anchor.bottom + mobileAnchorGap;
6655
+ const fitsSplit = (!hasReactions || idealPillTop >= topSafe) && idealMenuTop + menuHeight <= vpHeight - bottomSafe;
6656
+ if (fitsSplit) {
6657
+ return {
6658
+ pillTop: idealPillTop,
6659
+ pillLeft,
6660
+ pillWidth,
6661
+ menuTop: idealMenuTop,
6662
+ menuLeft,
6663
+ menuWidth,
6664
+ pillPlacement: "above"
6665
+ };
6666
+ }
6667
+ const stackedHeight = menuHeight + (hasReactions ? mobilePillHeight + mobileAnchorGap : 0);
6668
+ const fitsAllAbove = anchor.top - mobileAnchorGap - stackedHeight >= topSafe;
6669
+ if (fitsAllAbove) {
6670
+ const menuTop2 = anchor.top - menuHeight - mobileAnchorGap;
6671
+ const pillTop2 = menuTop2 - mobilePillHeight - mobileAnchorGap;
6672
+ return {
6673
+ pillTop: pillTop2,
6674
+ pillLeft,
6675
+ pillWidth,
6676
+ menuTop: menuTop2,
6677
+ menuLeft,
6678
+ menuWidth,
6679
+ pillPlacement: "above"
6680
+ };
6681
+ }
6682
+ const fitsAllBelow = anchor.bottom + mobileAnchorGap + stackedHeight <= vpHeight - bottomSafe;
6683
+ if (fitsAllBelow) {
6684
+ const pillTop2 = anchor.bottom + mobileAnchorGap;
6685
+ const menuTop2 = hasReactions ? pillTop2 + mobilePillHeight + mobileAnchorGap : anchor.bottom + mobileAnchorGap;
6686
+ return {
6687
+ pillTop: pillTop2,
6688
+ pillLeft,
6689
+ pillWidth,
6690
+ menuTop: menuTop2,
6691
+ menuLeft,
6692
+ menuWidth,
6693
+ pillPlacement: "below"
6694
+ };
6695
+ }
6696
+ const centeredTop = clamp(Math.round((vpHeight - stackedHeight) / 2), topSafe, vpHeight - bottomSafe - stackedHeight);
6697
+ const pillTop = centeredTop;
6698
+ const menuTop = hasReactions ? pillTop + mobilePillHeight + mobileAnchorGap : centeredTop;
6699
+ return {
6700
+ pillTop,
6701
+ pillLeft,
6702
+ pillWidth,
6703
+ menuTop,
6704
+ menuLeft,
6705
+ menuWidth,
6706
+ pillPlacement: "above"
6707
+ };
6708
+ };
6709
+ var reactionPickerCss = (isDark) => `
6710
+ @keyframes emoji-tray-in{from{opacity:0;transform:scale(.92) translateY(4px)}to{opacity:1;transform:scale(1) translateY(0)}}
6711
+ @keyframes emoji-popover-in{from{opacity:0;transform:scale(.95) translateY(6px)}to{opacity:1;transform:scale(1) translateY(0)}}
6712
+ @keyframes emoji-sheet-up{from{transform:translateY(100%)}to{transform:translateY(0)}}
6713
+ @keyframes emoji-fade-in{from{opacity:0}to{opacity:1}}
6714
+ @keyframes emoji-item-pop{0%{opacity:0;transform:scale(.6) translateY(4px)}100%{opacity:1;transform:scale(1) translateY(0)}}
6715
+ .msg-emoji-btn{transition:transform .14s cubic-bezier(0.2,0.9,0.3,1.2),background .14s ease}
6716
+ @media (hover:hover) and (pointer:fine){
6717
+ .msg-emoji-btn:hover{transform:scale(1.24) translateY(-2px);background:${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.06)"}!important}
6718
+ .msg-emoji-expand-btn:hover{transform:scale(1.08);background:${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.12)"}!important;color:${isDark ? "#f3f1ea" : "#181715"}!important}
6719
+ }
6720
+ .msg-emoji-btn:active{transform:scale(.88)!important}
6721
+ .msg-emoji-expand-btn{transition:transform .14s ease,background .14s ease,color .14s ease}
6722
+ .msg-emoji-expand-btn:active{transform:scale(.92)!important}
6723
+ .msg-mobile-action{transition:background .12s ease}
6724
+ .msg-mobile-action:active{background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.06)"}!important}
6725
+ `;
6726
+ var pickerSurface = (isDark) => isDark ? "#1c1b19" : "#ffffff";
6727
+ var pickerBorder = (isDark) => isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.09)";
6728
+ var pillShadow = (isDark) => isDark ? "0 10px 30px rgba(0,0,0,0.52),0 2px 8px rgba(0,0,0,0.3)" : "0 8px 28px rgba(24,23,21,0.14),0 2px 6px rgba(24,23,21,0.06)";
6729
+ var quickEmojiPillStyle = ({ isDark, top, left, isMobile, placement }) => `position:fixed;top:${top}px;left:${left}px;display:inline-flex;align-items:center;gap:${isMobile ? "3px" : "2px"};background:${pickerSurface(isDark)};border:1px solid ${pickerBorder(isDark)};border-radius:999px;padding:${isMobile ? "5px 8px" : "4px 6px"};box-shadow:${pillShadow(isDark)};z-index:10001;transform-origin:${placement === "above" ? "bottom center" : "top center"};animation:emoji-tray-in .18s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
6730
+ var quickEmojiItemStyle = (baseStyle, { isDark, isActive, isMobile, index }) => {
6731
+ const size = isMobile ? "40px" : "36px";
6732
+ const fontSize = isMobile ? "24px" : "21px";
6733
+ const activeBg = isDark ? "rgba(125,162,207,0.22)" : "rgba(57,88,127,0.13)";
6734
+ const activeRing = isDark ? "inset 0 0 0 1px rgba(125,162,207,0.34)" : "inset 0 0 0 1px rgba(57,88,127,0.24)";
6735
+ return `${baseStyle};width:${size};height:${size};font-size:${fontSize};padding:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:${isActive ? activeBg : "transparent"};box-shadow:${isActive ? activeRing : "none"};animation:emoji-item-pop .2s cubic-bezier(0.16, 1, 0.3, 1) ${index * 20}ms backwards`;
6736
+ };
6737
+ var quickEmojiDividerStyle = (isDark) => `width:1px;height:20px;margin:0 3px;flex-shrink:0;background:${isDark ? "rgba(255,255,255,0.11)" : "rgba(24,23,21,0.09)"}`;
6738
+ var quickEmojiExpandBtnStyle = (baseStyle, isDark, isMobile) => {
6739
+ const size = isMobile ? "36px" : "32px";
6740
+ const fontSize = isMobile ? "17px" : "15px";
6741
+ return `${baseStyle};width:${size};height:${size};font-size:${fontSize};padding:0;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.065)"};color:${isDark ? "#c7c2b8" : "#57534e"}`;
6742
+ };
6743
+ var emojiPickerState = {
6744
+ loaded: null
6745
+ };
6746
+ var ensureEmojiPickerLoaded = () => {
6747
+ if (!emojiPickerState.loaded) {
6748
+ emojiPickerState.loaded = import("emoji-picker-element").catch((err) => {
6749
+ emojiPickerState.loaded = null;
6750
+ console.error("Failed to load emoji picker", err);
6751
+ });
6752
+ }
6753
+ return emojiPickerState.loaded;
6754
+ };
6755
+ var emojiPickerCssVars = (isDark, isMobile, accentColor) => [
6756
+ `width:100%`,
6757
+ `height:${isMobile ? "min(56vh, 420px)" : "100%"}`,
6758
+ `--background:${pickerSurface(isDark)}`,
6759
+ `--border-color:${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.08)"}`,
6760
+ `--border-size:0px`,
6761
+ `--border-radius:0px`,
6762
+ `--button-hover-background:${isDark ? "rgba(255,255,255,0.09)" : "rgba(24,23,21,0.065)"}`,
6763
+ `--button-active-background:${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.12)"}`,
6764
+ `--indicator-color:${accentColor}`,
6765
+ `--indicator-height:2.5px`,
6766
+ `--input-border-color:${isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.10)"}`,
6767
+ `--input-border-radius:999px`,
6768
+ `--input-border-size:1px`,
6769
+ `--input-font-color:${isDark ? "#f3f1ea" : "#181715"}`,
6770
+ `--input-font-size:13.5px`,
6771
+ `--input-padding:7px 12px`,
6772
+ `--input-placeholder-color:${isDark ? "#8c877d" : "#78736a"}`,
6773
+ `--category-font-color:${isDark ? "#9c968c" : "#6b665d"}`,
6774
+ `--category-font-size:11.5px`,
6775
+ `--emoji-size:${isMobile ? "1.6rem" : "1.4rem"}`,
6776
+ `--emoji-padding:${isMobile ? "0.42rem" : "0.38rem"}`,
6777
+ `--category-emoji-size:${isMobile ? "1.2rem" : "1.12rem"}`,
6778
+ `--category-emoji-padding:0.42rem`,
6779
+ `--num-columns:${isMobile ? "7" : "8"}`,
6780
+ `--outline-color:${accentColor}`,
6781
+ `--skintone-border-radius:14px`
6782
+ ].join(";");
6783
+ var searchIconDataUri = (isDark) => {
6784
+ const stroke = isDark ? "%238c877d" : "%2378736a";
6785
+ return `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='${stroke}' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E")`;
6786
+ };
6787
+ var emojiShadowPolishCss = (isDark, isMobile, accentColor) => {
6788
+ const searchBg = isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.05)";
6789
+ const searchFocusBg = isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.03)";
6790
+ const scrollThumb = isDark ? "rgba(255,255,255,0.18)" : "rgba(24,23,21,0.16)";
6791
+ const skinShadow = isDark ? "0 8px 24px rgba(0,0,0,0.5)" : "0 8px 24px rgba(24,23,21,0.14)";
6792
+ return `
6793
+ .picker{border:0}
6794
+ .pad-top{height:${isMobile ? "4px" : "10px"}}
6795
+ .search-row{padding:0 12px 8px 12px;gap:6px}
6796
+ input.search{background:${searchBg} ${searchIconDataUri(isDark)} no-repeat 12px center / 14px 14px;padding:7px 12px 7px 34px;border-radius:999px;transition:border-color .15s,background-color .15s}
6797
+ input.search:focus{outline:none;border-color:${accentColor};background-color:${searchFocusBg}}
6798
+ .nav{padding:0 8px}
6799
+ .nav-button{opacity:.56;border-radius:8px;transition:opacity .15s}
6800
+ .nav-button:hover{opacity:.88}
6801
+ .nav-button[aria-selected="true"]{opacity:1}
6802
+ .indicator-wrapper{margin:0 8px}
6803
+ .indicator{border-radius:999px}
6804
+ .tabpanel{padding:4px 8px 8px;scrollbar-width:thin;scrollbar-color:${scrollThumb} transparent}
6805
+ .category{font-weight:600;letter-spacing:.03em;text-transform:uppercase;opacity:.7;padding:8px 6px 4px}
6806
+ .emoji,button.emoji{border-radius:10px;transition:transform .12s cubic-bezier(0.2,0.8,0.2,1),background .12s ease}
6807
+ @media (hover:hover) and (pointer:fine){.emoji:hover,button.emoji:hover{transform:scale(1.14)}}
6808
+ .emoji:active,button.emoji:active{transform:scale(.9)}
6809
+ .skintone-button-wrapper button.emoji{border-radius:50%;background:${searchBg};width:34px;height:34px;font-size:18px}
6810
+ .skintone-list{border-radius:14px;box-shadow:${skinShadow};border:1px solid var(--border-color)}
6811
+ .favorites{padding:6px 8px;justify-content:space-around;scrollbar-width:thin}
6812
+ `;
6813
+ };
6814
+ var applyEmojiPickerShadowPolish = (picker, isDark, isMobile, accentColor, shouldAutoFocus) => {
6815
+ const root = picker.shadowRoot;
6816
+ if (!root) return false;
6817
+ const existing = root.querySelector("style[data-alice-emoji-polish]");
6818
+ const css2 = emojiShadowPolishCss(isDark, isMobile, accentColor);
6819
+ if (existing) {
6820
+ if (existing.textContent !== css2) existing.textContent = css2;
6821
+ } else {
6822
+ const styleEl = document.createElement("style");
6823
+ styleEl.setAttribute("data-alice-emoji-polish", "");
6824
+ styleEl.textContent = css2;
6825
+ root.appendChild(styleEl);
6826
+ }
6827
+ if (shouldAutoFocus && !isMobile) {
6828
+ const searchInput = root.querySelector("input.search");
6829
+ if (searchInput instanceof HTMLInputElement) {
6830
+ searchInput.focus({
6831
+ preventScroll: true
6832
+ });
6833
+ }
6834
+ }
6835
+ return true;
6836
+ };
6837
+ var desktopBackdropStyle = "position:fixed;inset:0;background:transparent;z-index:10002";
6838
+ var mobileSheetBackdropStyle = "position:fixed;inset:0;background:rgba(0,0,0,0.42);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);display:flex;align-items:flex-end;justify-content:center;z-index:10002;animation:emoji-fade-in .18s ease-out";
6839
+ var mobileSheetStyle = (isDark, dragOffset) => `width:100%;max-width:520px;background:${pickerSurface(isDark)};border-radius:22px 22px 0 0;border-top:1px solid ${pickerBorder(isDark)};box-shadow:0 -10px 36px rgba(0,0,0,${isDark ? "0.6" : "0.24"});overflow:hidden;display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom,0px);${dragOffset > 0 ? `transform:translateY(${dragOffset}px);transition:none` : "animation:emoji-sheet-up .24s cubic-bezier(0.16, 1, 0.3, 1);transition:transform .2s ease"}`;
6840
+ var sheetHandleWrapStyle = "display:flex;align-items:center;justify-content:center;padding:10px 0 6px;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none";
6841
+ var sheetHandleBarStyle = (isDark) => `width:38px;height:4px;border-radius:999px;background:${isDark ? "rgba(255,255,255,0.22)" : "rgba(24,23,21,0.16)"}`;
6842
+ var desktopPopoverStyle = (isDark, pos) => `position:fixed;top:${pos.top}px;left:${pos.left}px;width:${pos.width}px;height:${pos.height}px;background:${pickerSurface(isDark)};border-radius:18px;border:1px solid ${pickerBorder(isDark)};box-shadow:${isDark ? "0 14px 44px rgba(0,0,0,0.62),0 2px 10px rgba(0,0,0,0.36)" : "0 12px 40px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.07)"};overflow:hidden;display:flex;flex-direction:column;transform-origin:${pos.placement === "above" ? "bottom center" : pos.placement === "below" ? "top center" : "center"};animation:emoji-popover-in .16s cubic-bezier(0.16, 1, 0.3, 1)`;
6843
+ var renderQuickEmojiBar = ({ isDark, isMobile, top, left, placement, ownReactions, baseBtnStyle, onPick, onExpand }) => html7`
6844
+ <div
6845
+ class="msg-quick-emojis"
6846
+ data-testid="quick-emoji-bar"
6847
+ style="${quickEmojiPillStyle({
6848
+ isDark,
6849
+ top,
6850
+ left,
6851
+ isMobile,
6852
+ placement
6853
+ })}"
6854
+ @click="${(e) => e.stopPropagation()}"
6855
+ >
6856
+ ${quickReactionEmojis.map((emoji, index) => {
6857
+ const isActive = ownReactions.has(emoji);
6858
+ return html7`
6859
+ <button
6860
+ type="button"
6861
+ class="msg-emoji-btn"
6862
+ aria-pressed="${isActive}"
6863
+ @click="${() => onPick(emoji)}"
6864
+ style="${quickEmojiItemStyle(baseBtnStyle, {
6865
+ isDark,
6866
+ isActive,
6867
+ isMobile,
6868
+ index
6869
+ })}"
6870
+ >
6871
+ ${emoji}
6872
+ </button>
6873
+ `;
6874
+ })}
6875
+ <span aria-hidden="true" style="${quickEmojiDividerStyle(isDark)}"></span>
6876
+ <button
6877
+ type="button"
6878
+ class="msg-emoji-expand-btn"
6879
+ data-testid="emoji-expand-btn"
6880
+ @click="${onExpand}"
6881
+ style="${quickEmojiExpandBtnStyle(baseBtnStyle, isDark, isMobile)}"
6882
+ title="More reactions"
6883
+ aria-label="More reactions"
6884
+ >
6885
+ ${faPlus}
6886
+ </button>
6887
+ </div>
6888
+ `;
6889
+ var renderEmojiPickerPanel = ({ isDark, isMobile, accentColor, anchor, isOwn, sheetDragOffset, onSheetTouchStart, onSheetTouchMove, onSheetTouchEnd, onPick, onClose }) => {
6890
+ ensureEmojiPickerLoaded();
6891
+ const handleKeydown = (e) => {
6892
+ if (e.key === "Escape") {
6893
+ e.preventDefault();
6894
+ e.stopPropagation();
6895
+ onClose();
6896
+ }
6897
+ };
6898
+ const pickerEl = html7`
6899
+ <emoji-picker
6900
+ class="${isDark ? "dark" : "light"}"
6901
+ style="${emojiPickerCssVars(isDark, isMobile, accentColor)}"
6902
+ @emoji-click="${(e) => {
6903
+ onPick(e.detail.unicode);
6904
+ onClose();
6905
+ }}"
6906
+ ></emoji-picker>
6907
+ `;
6908
+ if (isMobile) {
6909
+ return html7`
6910
+ <div
6911
+ data-testid="emoji-picker-backdrop"
6912
+ style="${mobileSheetBackdropStyle}"
6913
+ @click="${onClose}"
6914
+ @keydown="${handleKeydown}"
6915
+ >
6916
+ <div
6917
+ data-testid="emoji-picker-panel"
6918
+ data-presentation="sheet"
6919
+ style="${mobileSheetStyle(isDark, sheetDragOffset)}"
6920
+ @click="${(e) => e.stopPropagation()}"
6921
+ >
6922
+ <div
6923
+ data-testid="emoji-sheet-handle"
6924
+ style="${sheetHandleWrapStyle}"
6925
+ @touchstart="${onSheetTouchStart}"
6926
+ @touchmove="${onSheetTouchMove}"
6927
+ @touchend="${onSheetTouchEnd}"
6928
+ @touchcancel="${onSheetTouchEnd}"
6929
+ >
6930
+ <div style="${sheetHandleBarStyle(isDark)}"></div>
6931
+ </div>
6932
+ ${pickerEl}
6933
+ </div>
6934
+ </div>
6935
+ `;
6936
+ }
6937
+ const pos = computeEmojiPopoverPosition({
6938
+ anchor,
6939
+ isOwn,
6940
+ vpWidth: globalThis.innerWidth || 1024,
6941
+ vpHeight: globalThis.innerHeight || 768
6942
+ });
6943
+ return html7`
6944
+ <div
6945
+ data-testid="emoji-picker-backdrop"
6946
+ style="${desktopBackdropStyle}"
6947
+ @click="${onClose}"
6948
+ @keydown="${handleKeydown}"
6949
+ >
6950
+ <div
6951
+ data-testid="emoji-picker-panel"
6952
+ data-presentation="popover"
6953
+ style="${desktopPopoverStyle(isDark, pos)}"
6954
+ @click="${(e) => e.stopPropagation()}"
6955
+ >
6956
+ ${pickerEl}
6957
+ </div>
6958
+ </div>
6959
+ `;
6960
+ };
6961
+
6561
6962
  // lit/components/chat-message.ts
6562
6963
  var clearSelection = () => globalThis.getSelection?.()?.removeAllRanges();
6563
6964
  var kebabHoverCss = `.msg-bubble .msg-kebab{opacity:0;transition:opacity .15s}.msg-bubble:hover .msg-kebab,.msg-kebab[data-open]{opacity:.7}`;
@@ -6572,44 +6973,41 @@ var historyCloseButtonStyle = (isDark) => `margin-top:8px;padding:6px 12px;backg
6572
6973
  var editTextareaStyle = "width:100%;padding:6px;border-radius:8px;border:none;font-size:14px;resize:vertical;min-height:40px";
6573
6974
  var saveButtonStyle = (isDark) => `padding:4px 8px;border-radius:6px;border:none;background:${isDark ? "#2a2a2a" : "#e5e7eb"};cursor:pointer;font-size:12px`;
6574
6975
  var cancelButtonStyle = "padding:4px 8px;border-radius:6px;border:none;background:transparent;cursor:pointer;font-size:12px;opacity:0.7";
6575
- var quickEmojis = quickReactionEmojis;
6576
6976
  var keyboardSelectedRowStyle = (isDark) => `;border-radius:14px;padding:4px 6px;margin:-4px -6px;background:${isDark ? "rgba(125,162,207,0.12)" : "rgba(57,88,127,0.08)"};outline:1.5px solid ${isDark ? "rgba(125,162,207,0.45)" : "rgba(57,88,127,0.38)"};outline-offset:1px;transition:background 0.15s,outline-color 0.15s`;
6577
6977
  var keyboardHintBarStyle = (isDark) => `display:inline-flex;align-items:center;gap:6px;margin-top:4px;padding:2px 8px;border-radius:999px;font-size:11px;background:${isDark ? "#1e1d1a" : "#f3f1ea"};border:1px solid ${isDark ? "#2e2d28" : "#dcd8cc"};color:${isDark ? "#b8b2a6" : "#5a564f"};user-select:none`;
6578
6978
  var keyboardHintKeyStyle = (isDark) => `font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:10px;padding:0 4px;border-radius:4px;background:${isDark ? "#2c2b26" : "#e5e1d6"};color:${isDark ? "#f3f1ea" : "#181715"}`;
6579
- var longPressHighlightCss = `@keyframes msg-highlight{0%{box-shadow:0 0 0 0 rgba(57,88,127,0)}100%{box-shadow:0 0 0 3px rgba(57,88,127,0.32),0 6px 20px rgba(57,88,127,0.18)}}`;
6580
- var longPressHighlightDelayMs = 150;
6581
- var longPressTriggerDelayMs = 500;
6979
+ var longPressHighlightCss = `@keyframes msg-highlight-light{0%{box-shadow:0 1px 3px rgba(24,23,21,0.08);filter:brightness(1)}100%{box-shadow:0 0 0 1px rgba(24,23,21,0.10),0 10px 26px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.10);filter:brightness(0.96)}}@keyframes msg-highlight-dark{0%{box-shadow:0 1px 2px rgba(0,0,0,0.28);filter:brightness(1)}100%{box-shadow:0 0 0 1px rgba(255,255,255,0.18),0 10px 28px rgba(0,0,0,0.55),0 2px 8px rgba(0,0,0,0.32);filter:brightness(1.10)}}`;
6980
+ var longPressHighlightDelayMs = 120;
6981
+ var longPressTriggerDelayMs = 420;
6582
6982
  var longPressMoveSlopPx = 8;
6983
+ var sheetDismissThresholdPx = 72;
6583
6984
  var msgEntranceCss = `@keyframes msg-enter{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}`;
6584
6985
  var liveCursorCss = `@keyframes msg-live-cursor{0%,100%{opacity:.35;transform:scaleY(.9)}50%{opacity:1;transform:scaleY(1)}}`;
6585
6986
  var streamTickMs = 20;
6586
6987
  var liveCursorHtml = (isDark) => `<span aria-hidden="true" style="display:inline-block;width:2px;height:1.05em;margin-inline-start:2px;border-radius:999px;vertical-align:-0.12em;background:${isDark ? "#ffffffcc" : "#111111aa"};animation:msg-live-cursor .9s ease-in-out infinite"></span>`;
6587
- var injectCursorAtEnd = (html13, cursor) => {
6588
- const i = html13.lastIndexOf("</div>");
6589
- return i === -1 ? html13 + cursor : html13.slice(0, i) + cursor + html13.slice(i);
6590
- };
6591
- var mobileContextOverlayStyle = "position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.4);z-index:999;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent";
6592
- var mobileContextMenuStyle = (isDark, touchY, touchX) => {
6593
- const menuWidth = 250;
6594
- const menuHeight = 220;
6595
- const vp = globalThis.innerHeight;
6596
- const vpW = globalThis.innerWidth;
6597
- const top = touchY - menuHeight - 12 < 0 ? Math.min(touchY + 12, vp - menuHeight - 12) : touchY - menuHeight - 12;
6598
- const left = Math.max(12, Math.min(touchX - menuWidth / 2, vpW - menuWidth - 12));
6599
- return `position:fixed;top:${top}px;left:${left}px;background:${isDark ? "#1a1a1a" : "#fff"};border-radius:16px;padding:8px 0;min-width:220px;max-width:280px;box-shadow:${isDark ? "0 8px 32px #000a" : "0 8px 32px #0003"};overflow:hidden;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
6600
- };
6601
- var mobileContextEmojiRowStyle = (isDark) => `display:flex;justify-content:center;gap:4px;padding:8px 12px;border-bottom:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none`;
6602
- var mobileContextActionStyle = (isDark) => `display:flex;align-items:center;gap:10px;width:100%;padding:12px 16px;background:transparent;border:none;cursor:pointer;font-size:15px;color:${isDark ? "#e5e7eb" : "#1a1a1a"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none`;
6603
- var smileyTriggerCss = `.msg-wrap .msg-smiley-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-smiley-trigger{opacity:1}`;
6604
- var smileyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% - 18px);transform:translateY(-50%);background:${isDark ? "#1a1a1a" : "#fff"};border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;box-shadow:${isDark ? "0 1px 4px #0006" : "0 1px 4px #0002"};color:${isDark ? "#aaa" : "#666"};font-size:17px;padding:0`;
6605
- var quickEmojiRowStyle = (isDark, isOwn) => `position:absolute;top:50%;transform:translateY(calc(-100% - 24px));${isOwn ? "left:-36px" : "right:-36px"};display:flex;gap:2px;background:${isDark ? "#1e1e1e" : "#ffffff"};border:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};border-radius:20px;padding:4px 6px;box-shadow:${isDark ? "0 2px 12px #0008" : "0 2px 12px #0003"};z-index:10000;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
6988
+ var injectCursorAtEnd = (html14, cursor) => {
6989
+ const i = html14.lastIndexOf("</div>");
6990
+ return i === -1 ? html14 + cursor : html14.slice(0, i) + cursor + html14.slice(i);
6991
+ };
6992
+ var mobileContextOverlayStyle = "position:fixed;inset:0;background:rgba(0,0,0,0.38);backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);z-index:999;animation:emoji-fade-in .16s ease-out;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent";
6993
+ var mobileContextMenuStyle = (isDark, top, left, width = 236) => {
6994
+ const bg = isDark ? "#1c1b19" : "#ffffff";
6995
+ const border = isDark ? "rgba(255,255,255,0.10)" : "rgba(24,23,21,0.09)";
6996
+ const shadow = isDark ? "0 14px 40px rgba(0,0,0,0.58),0 2px 10px rgba(0,0,0,0.32)" : "0 12px 36px rgba(24,23,21,0.18),0 2px 8px rgba(24,23,21,0.07)";
6997
+ return `position:fixed;top:${top}px;left:${left}px;width:${width}px;background:${bg};border:1px solid ${border};border-radius:16px;padding:4px 0;box-shadow:${shadow};overflow:hidden;z-index:10001;animation:emoji-popover-in .18s cubic-bezier(0.16, 1, 0.3, 1);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent`;
6998
+ };
6999
+ var mobileContextActionStyle = (isDark, withDivider) => `display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;height:46px;padding:0 16px;background:transparent;border:none;${withDivider ? `border-bottom:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.06)"};` : ""}cursor:pointer;font-size:15px;font-weight:450;color:${isDark ? "#f3f1ea" : "#181715"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none`;
7000
+ var mobileActionIconStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;font-size:15px;color:${isDark ? "#a8a29e" : "#6b665d"}`;
7001
+ var smileyTriggerCss = `.msg-wrap .msg-smiley-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-smiley-trigger,.msg-smiley-trigger[data-open]{opacity:1}`;
7002
+ var smileyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% - 18px);transform:translateY(-50%);background:${isDark ? "#1c1b19" : "#fff"};border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.07)"};box-shadow:${isDark ? "0 2px 6px rgba(0,0,0,0.4)" : "0 1px 4px rgba(24,23,21,0.08)"};color:${isDark ? "#a8a29e" : "#6b665d"};font-size:17px;padding:0`;
7003
+ var spotlightBubbleStyle = (isDark) => `;position:relative;z-index:1000;box-shadow:${isDark ? "0 0 0 1px rgba(255,255,255,0.14),0 14px 36px rgba(0,0,0,0.62)" : "0 0 0 1px rgba(24,23,21,0.08),0 12px 32px rgba(24,23,21,0.22)"}`;
6606
7004
  var reactionBtnStyle = "background:transparent;border:none;cursor:pointer;font-size:16px;padding:2px 3px;line-height:1;border-radius:4px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none";
6607
7005
  var reactionPillStyle = (isDark, isActive) => `display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:999px;font-size:12px;cursor:pointer;border:1px solid ${isActive ? isDark ? "#4a4740" : "#c7c2b6" : isDark ? "#292824" : "#e7e4dc"};background:${isActive ? isDark ? "#262521" : "#ebe8df" : isDark ? "#171614" : "#faf9f5"};color:${isDark ? "#f3f1ea" : "#181715"};user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;outline:none`;
6608
7006
  var diffPartStyle = (kind, isDark) => kind === "add" ? `background:${isDark ? "#16532e" : "#d4edda"};color:${isDark ? "#6ee7b7" : "#155724"}` : kind === "del" ? `background:${isDark ? "#5c1d1d" : "#f8d7da"};color:${isDark ? "#fca5a5" : "#721c24"};text-decoration:line-through` : "";
6609
- var renderDiff = (parts, isDark) => parts.map((p) => html7`
7007
+ var renderDiff = (parts, isDark) => parts.map((p) => html8`
6610
7008
  <span style="${diffPartStyle(p.kind, isDark)}">${p.text}</span>
6611
7009
  `);
6612
- var renderEditHistory = (edits, currentText, isDark, onClose) => html7`
7010
+ var renderEditHistory = (edits, currentText, isDark, onClose) => html8`
6613
7011
  <div style="${overlayStyle}" @click="${onClose}">
6614
7012
  <div style="${historyPopupStyle(isDark)}" @click="${(e) => e.stopPropagation()}">
6615
7013
  <div style="font-weight:bold;margin-bottom:12px">Edit History</div>
@@ -6617,7 +7015,7 @@ var renderEditHistory = (edits, currentText, isDark, onClose) => html7`
6617
7015
  <div style="font-size:10px;opacity:0.7">Current</div>
6618
7016
  <div>${currentText}</div>
6619
7017
  </div>
6620
- ${edits.map((edit, i) => html7`
7018
+ ${edits.map((edit, i) => html8`
6621
7019
  <div style="${historyEntryStyle(isDark)}">
6622
7020
  <div style="font-size:10px;opacity:0.7">${formatEditTime(edit.timestamp)}</div>
6623
7021
  <div>${renderDiff(wordDiff(edit.text, successorText(edits, currentText, i)), isDark)}</div>
@@ -6632,7 +7030,7 @@ var renderEditHistory = (edits, currentText, isDark, onClose) => html7`
6632
7030
  var replyTriggerStyle = (isDark, isOwn) => `position:absolute;${isOwn ? "left:-36px" : "right:-36px"};top:calc(50% + 20px);transform:translateY(-50%);background:${isDark ? "#1a1a1a" : "#fff"};border-radius:50%;width:28px;height:28px;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;box-shadow:${isDark ? "0 1px 4px #0006" : "0 1px 4px #0002"};color:${isDark ? "#aaa" : "#666"};font-size:13px;padding:0`;
6633
7031
  var renderQuotedMessage = (reply, isDark, customColors, bubbleTextColor) => {
6634
7032
  const barColor2 = quoteBarColor(isDark, customColors);
6635
- return html7`
7033
+ return html8`
6636
7034
  <div
6637
7035
  style="margin-bottom:4px;padding:6px 8px;border-radius:6px;border-left:3px solid ${barColor2};background:${isDark ? "rgba(255,255,255,0.06)" : "rgba(0,0,0,0.05)"};cursor:pointer;user-select:none;-webkit-user-select:none"
6638
7036
  >
@@ -6666,9 +7064,9 @@ var groupReactions = (userId) => (reactions) => {
6666
7064
  hasOwn
6667
7065
  }));
6668
7066
  };
6669
- var renderReactionPills = (groups, isDark, onToggle) => html7`
7067
+ var renderReactionPills = (groups, isDark, onToggle) => html8`
6670
7068
  <div style="display:flex;flex-wrap:wrap;gap:4px;margin-top:4px">
6671
- ${groups.map(({ emoji, count: count2, hasOwn }) => html7`
7069
+ ${groups.map(({ emoji, count: count2, hasOwn }) => html8`
6672
7070
  <button
6673
7071
  type="button"
6674
7072
  @click="${() => onToggle(emoji)}"
@@ -6681,37 +7079,25 @@ var renderReactionPills = (groups, isDark, onToggle) => html7`
6681
7079
  `)}
6682
7080
  </div>
6683
7081
  `;
6684
- var emojiPickerState = {
6685
- loaded: null
6686
- };
6687
- var ensureEmojiPickerLoaded = () => {
6688
- if (!emojiPickerState.loaded) {
6689
- emojiPickerState.loaded = import("emoji-picker-element").catch((err) => {
6690
- emojiPickerState.loaded = null;
6691
- console.error("Failed to load emoji picker", err);
6692
- });
6693
- }
6694
- };
6695
- var renderEmojiGrid = (isDark, onPick, onClose) => {
6696
- ensureEmojiPickerLoaded();
6697
- return html7`
6698
- <div style="${overlayStyle}" @click="${onClose}">
6699
- <div
6700
- style="background:${isDark ? "#1a1a1a" : "#fff"};border-radius:12px;overflow:hidden;border:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};box-shadow:${isDark ? "0 4px 16px #0008" : "0 4px 16px #0003"};display:flex;align-items:center;justify-content:center"
6701
- @click="${(e) => e.stopPropagation()}"
6702
- >
6703
- <emoji-picker
6704
- class="${isDark ? "dark" : "light"}"
6705
- style="width:100%;height:350px;max-height:60vh;max-width:350px;--background:transparent"
6706
- @emoji-click="${(e) => {
6707
- onPick(e.detail.unicode);
6708
- onClose();
6709
- }}"
6710
- ></emoji-picker>
6711
- </div>
7082
+ var renderMobileContextCard = ({ isDark, top, left, width, actions }) => html8`
7083
+ <div
7084
+ data-testid="mobile-context-menu"
7085
+ style="${mobileContextMenuStyle(isDark, top, left, width)}"
7086
+ @click="${(e) => e.stopPropagation()}"
7087
+ >
7088
+ ${actions.map((item, idx) => html8`
7089
+ <button
7090
+ type="button"
7091
+ class="msg-mobile-action"
7092
+ @click="${item.onClick}"
7093
+ style="${mobileContextActionStyle(isDark, idx < actions.length - 1)}"
7094
+ >
7095
+ <span>${item.label}</span>
7096
+ <span style="${mobileActionIconStyle(isDark)}">${item.icon}</span>
7097
+ </button>
7098
+ `)}
6712
7099
  </div>
6713
7100
  `;
6714
- };
6715
7101
  var resolveTargetMedia = (target, msg, host) => {
6716
7102
  const el = target instanceof HTMLElement ? target : null;
6717
7103
  const imgEl = el?.closest("img");
@@ -6831,6 +7217,12 @@ var ChatMessage = class extends LitElement6 {
6831
7217
  },
6832
7218
  _touchX: {
6833
7219
  state: true
7220
+ },
7221
+ _anchorRect: {
7222
+ state: true
7223
+ },
7224
+ _sheetDragY: {
7225
+ state: true
6834
7226
  }
6835
7227
  };
6836
7228
  _streamTimer = 0;
@@ -6840,6 +7232,8 @@ var ChatMessage = class extends LitElement6 {
6840
7232
  _outsideClickHandler = null;
6841
7233
  _longPressTimer = 0;
6842
7234
  _longPressHighlightTimer = 0;
7235
+ _sheetDragStartY = 0;
7236
+ _emojiPickerFocused = false;
6843
7237
  constructor() {
6844
7238
  super();
6845
7239
  this.isOwn = false;
@@ -6863,6 +7257,15 @@ var ChatMessage = class extends LitElement6 {
6863
7257
  this._selectedMedia = null;
6864
7258
  this._touchY = 0;
6865
7259
  this._touchX = 0;
7260
+ this._anchorRect = {
7261
+ top: 0,
7262
+ bottom: 0,
7263
+ left: 0,
7264
+ right: 0,
7265
+ width: 0,
7266
+ height: 0
7267
+ };
7268
+ this._sheetDragY = 0;
6866
7269
  this._visibleText = "";
6867
7270
  }
6868
7271
  createRenderRoot() {
@@ -6886,7 +7289,7 @@ var ChatMessage = class extends LitElement6 {
6886
7289
  clearTimeout(this._streamTimer);
6887
7290
  clearTimeout(this._longPressTimer);
6888
7291
  clearTimeout(this._longPressHighlightTimer);
6889
- document.removeEventListener("mousedown", this._dismissQuickEmojis);
7292
+ this._removeQuickEmojiListeners();
6890
7293
  this._removeOutsideClick();
6891
7294
  this.removeEventListener("click", this._handleCopyCode);
6892
7295
  this.removeEventListener("click", this._handleQuickReplyClick);
@@ -6984,10 +7387,73 @@ var ChatMessage = class extends LitElement6 {
6984
7387
  this._startEdit();
6985
7388
  return true;
6986
7389
  };
6987
- openReactionPicker = () => {
6988
- if (!this.onReact) return false;
7390
+ _readAnchorRect = () => {
7391
+ const bubble = this.querySelector(".msg-bubble");
7392
+ if (bubble) {
7393
+ const r = bubble.getBoundingClientRect();
7394
+ if (r.width > 0 || r.height > 0) {
7395
+ return {
7396
+ top: r.top,
7397
+ bottom: r.bottom,
7398
+ left: r.left,
7399
+ right: r.right,
7400
+ width: r.width,
7401
+ height: r.height
7402
+ };
7403
+ }
7404
+ }
7405
+ return {
7406
+ top: this._touchY,
7407
+ bottom: this._touchY,
7408
+ left: this._touchX,
7409
+ right: this._touchX,
7410
+ width: 0,
7411
+ height: 0
7412
+ };
7413
+ };
7414
+ _removeQuickEmojiListeners = () => {
7415
+ document.removeEventListener("mousedown", this._dismissQuickEmojis);
7416
+ globalThis.removeEventListener("scroll", this._dismissQuickEmojisOnScroll, true);
7417
+ globalThis.removeEventListener("resize", this._dismissQuickEmojisOnScroll);
7418
+ };
7419
+ _addQuickEmojiListeners = () => {
7420
+ requestAnimationFrame(() => {
7421
+ if (!this._showQuickEmojis) return;
7422
+ document.addEventListener("mousedown", this._dismissQuickEmojis);
7423
+ globalThis.addEventListener("scroll", this._dismissQuickEmojisOnScroll, true);
7424
+ globalThis.addEventListener("resize", this._dismissQuickEmojisOnScroll);
7425
+ });
7426
+ };
7427
+ _openFullEmojiPicker = () => {
7428
+ this._anchorRect = this._readAnchorRect();
6989
7429
  this._showQuickEmojis = false;
7430
+ this._removeQuickEmojiListeners();
7431
+ this._showMobileContext = false;
7432
+ this._selectedMedia = null;
7433
+ this._sheetDragY = 0;
7434
+ this._emojiPickerFocused = false;
6990
7435
  this._showEmojiPicker = true;
7436
+ ensureEmojiPickerLoaded();
7437
+ };
7438
+ _closeFullEmojiPicker = () => {
7439
+ this._showEmojiPicker = false;
7440
+ this._sheetDragY = 0;
7441
+ this._emojiPickerFocused = false;
7442
+ };
7443
+ _toggleQuickEmojis = () => {
7444
+ if (this._showQuickEmojis) {
7445
+ this._showQuickEmojis = false;
7446
+ this._removeQuickEmojiListeners();
7447
+ return;
7448
+ }
7449
+ this._anchorRect = this._readAnchorRect();
7450
+ this._showQuickEmojis = true;
7451
+ ensureEmojiPickerLoaded();
7452
+ this._addQuickEmojiListeners();
7453
+ };
7454
+ openReactionPicker = () => {
7455
+ if (!this.onReact) return false;
7456
+ this._openFullEmojiPicker();
6991
7457
  return true;
6992
7458
  };
6993
7459
  toggleReaction = (emoji) => {
@@ -6995,12 +7461,12 @@ var ChatMessage = class extends LitElement6 {
6995
7461
  };
6996
7462
  dismissActivePopup = () => {
6997
7463
  if (this._showEmojiPicker) {
6998
- this._showEmojiPicker = false;
7464
+ this._closeFullEmojiPicker();
6999
7465
  return true;
7000
7466
  }
7001
7467
  if (this._showQuickEmojis) {
7002
7468
  this._showQuickEmojis = false;
7003
- document.removeEventListener("mousedown", this._dismissQuickEmojis);
7469
+ this._removeQuickEmojiListeners();
7004
7470
  return true;
7005
7471
  }
7006
7472
  if (this._showHistory) {
@@ -7079,6 +7545,7 @@ var ChatMessage = class extends LitElement6 {
7079
7545
  const hasOwn = (this.msg.reactions ?? []).some((r) => r.emoji === emoji && r.authorId === this.userId);
7080
7546
  this.onReact(emoji, hasOwn || void 0);
7081
7547
  this._showQuickEmojis = false;
7548
+ this._removeQuickEmojiListeners();
7082
7549
  };
7083
7550
  _longPressStart = (e) => {
7084
7551
  if (!this.isMobile) return;
@@ -7096,8 +7563,11 @@ var ChatMessage = class extends LitElement6 {
7096
7563
  }, longPressHighlightDelayMs);
7097
7564
  this._longPressTimer = globalThis.setTimeout(() => {
7098
7565
  this._longPressActive = false;
7566
+ this._anchorRect = this._readAnchorRect();
7099
7567
  this._showMobileContext = true;
7100
7568
  clearSelection();
7569
+ globalThis.navigator?.vibrate?.(12);
7570
+ if (this.onReact) ensureEmojiPickerLoaded();
7101
7571
  }, longPressTriggerDelayMs);
7102
7572
  };
7103
7573
  _longPressMove = (e) => {
@@ -7122,10 +7592,31 @@ var ChatMessage = class extends LitElement6 {
7122
7592
  };
7123
7593
  _dismissQuickEmojis = (e) => {
7124
7594
  const target = e.target;
7125
- if (!target.closest?.(".msg-quick-emojis")) {
7126
- this._showQuickEmojis = false;
7127
- document.removeEventListener("mousedown", this._dismissQuickEmojis);
7595
+ if (target instanceof Element && (target.closest(".msg-quick-emojis") || target.closest(".msg-smiley-trigger"))) {
7596
+ return;
7128
7597
  }
7598
+ this._showQuickEmojis = false;
7599
+ this._removeQuickEmojiListeners();
7600
+ };
7601
+ _dismissQuickEmojisOnScroll = () => {
7602
+ if (!this._showQuickEmojis) return;
7603
+ this._showQuickEmojis = false;
7604
+ this._removeQuickEmojiListeners();
7605
+ };
7606
+ _sheetTouchStart = (e) => {
7607
+ this._sheetDragStartY = e.touches[0]?.clientY ?? 0;
7608
+ this._sheetDragY = 0;
7609
+ };
7610
+ _sheetTouchMove = (e) => {
7611
+ const y = e.touches[0]?.clientY ?? this._sheetDragStartY;
7612
+ this._sheetDragY = Math.max(0, y - this._sheetDragStartY);
7613
+ };
7614
+ _sheetTouchEnd = () => {
7615
+ if (this._sheetDragY >= sheetDismissThresholdPx) {
7616
+ this._closeFullEmojiPicker();
7617
+ return;
7618
+ }
7619
+ this._sheetDragY = 0;
7129
7620
  };
7130
7621
  _closeMobileContext = () => {
7131
7622
  this._showMobileContext = false;
@@ -7153,7 +7644,7 @@ var ChatMessage = class extends LitElement6 {
7153
7644
  };
7154
7645
  _copyText = () => {
7155
7646
  copyToClipboard(this.msg.text);
7156
- this._showMobileContext = false;
7647
+ this._closeMobileContext();
7157
7648
  };
7158
7649
  render() {
7159
7650
  const { authorId, authorName, authorAvatar, text, timestamp, attachments, editHistory, callDetails } = this.msg;
@@ -7186,11 +7677,76 @@ var ChatMessage = class extends LitElement6 {
7186
7677
  const primaryColor = attachmentPrimaryColor(isDark, customColors);
7187
7678
  const markdownHtml = renderMarkdown(displayedText, textColor, isDark, primaryColor, !this.hideQuickReplies);
7188
7679
  const canSave = !!this._editText.trim() && this._editText !== text;
7680
+ const ownReactions = new Set((this.msg.reactions ?? []).filter((r) => r.authorId === this.userId).map((r) => r.emoji));
7681
+ const quickBarPos = this._showQuickEmojis && this.onReact ? computeQuickBarPosition({
7682
+ anchor: this._anchorRect,
7683
+ isOwn,
7684
+ vpWidth: globalThis.innerWidth || 1024,
7685
+ vpHeight: globalThis.innerHeight || 768
7686
+ }) : null;
7687
+ const mobileActions = this._showMobileContext ? [
7688
+ ...this.onReply ? [
7689
+ {
7690
+ icon: faReply,
7691
+ label: "Reply",
7692
+ onClick: () => {
7693
+ this.onReply?.();
7694
+ this._closeMobileContext();
7695
+ }
7696
+ }
7697
+ ] : [],
7698
+ ...this._selectedMedia ? [
7699
+ {
7700
+ icon: this._selectedMedia.type === "video" ? faShare : faImage,
7701
+ label: `Share ${this._selectedMedia.type === "video" ? "Video" : "Image"}`,
7702
+ onClick: this._shareSelectedMedia
7703
+ },
7704
+ {
7705
+ icon: faDownload,
7706
+ label: `Download ${this._selectedMedia.type === "video" ? "Video" : "Image"}`,
7707
+ onClick: this._downloadSelectedMedia
7708
+ }
7709
+ ] : [],
7710
+ {
7711
+ icon: faCopy,
7712
+ label: "Copy",
7713
+ onClick: this._copyText
7714
+ },
7715
+ ...canEdit ? [
7716
+ {
7717
+ icon: faPen,
7718
+ label: "Edit",
7719
+ onClick: () => {
7720
+ this._closeMobileContext();
7721
+ this._startEdit();
7722
+ }
7723
+ }
7724
+ ] : [],
7725
+ ...hasEdits ? [
7726
+ {
7727
+ icon: faHistory,
7728
+ label: "View history",
7729
+ onClick: () => {
7730
+ this._closeMobileContext();
7731
+ this._showHistory = true;
7732
+ }
7733
+ }
7734
+ ] : []
7735
+ ] : [];
7736
+ const mobileLayout = this._showMobileContext ? computeMobileContextLayout({
7737
+ anchor: this._anchorRect,
7738
+ isOwn,
7739
+ hasReactions: Boolean(this.onReact),
7740
+ actionCount: mobileActions.length,
7741
+ vpWidth: globalThis.innerWidth || 390,
7742
+ vpHeight: globalThis.innerHeight || 844
7743
+ }) : null;
7189
7744
  const isLiveNew = this.sessionStart > 0 && timestamp >= this.sessionStart;
7190
7745
  const bubbleDecoration = noBubble ? "" : isOwn ? `;box-shadow:${isDark ? "0 1px 2px rgba(0,0,0,0.28)" : "0 1px 3px rgba(24,23,21,0.08)"}` : `;border:1px solid ${isDark ? "rgba(255,255,255,0.07)" : "rgba(24,23,21,0.07)"};box-shadow:${isDark ? "0 1px 2px rgba(0,0,0,0.22)" : "0 1px 2px rgba(24,23,21,0.04)"}`;
7191
- return html7`
7746
+ const longPressBubbleEffect = this._showMobileContext ? this._selectedMedia ? ";position:relative;z-index:1000" : spotlightBubbleStyle(isDark) : this._longPressActive && !this._selectedMedia ? `;animation:${isDark ? "msg-highlight-dark" : "msg-highlight-light"} .28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards` : "";
7747
+ return html8`
7192
7748
  <style>
7193
- ${kebabHoverCss}${fencedCodeHoverCss}${smileyTriggerCss}${longPressHighlightCss}${msgEntranceCss}${liveCursorCss}${highlightCss}${secretBlurCss(isDark)}
7749
+ ${kebabHoverCss}${fencedCodeHoverCss}${smileyTriggerCss}${longPressHighlightCss}${msgEntranceCss}${liveCursorCss}${highlightCss}${reactionPickerCss(isDark)}${secretBlurCss(isDark)}
7194
7750
  .msg-wrap .msg-reply-trigger{opacity:0;transition:opacity .15s}.msg-wrap:hover .msg-reply-trigger{opacity:1}
7195
7751
  .chat-quick-reply-btn:hover{filter:brightness(1.08)}
7196
7752
  [data-testid="message-text"]{unicode-bidi:plaintext;text-align:start}
@@ -7203,7 +7759,7 @@ var ChatMessage = class extends LitElement6 {
7203
7759
  ?data-keyboard-selected="${this.isKeyboardSelected}"
7204
7760
  style="display:flex;gap:6px;align-items:flex-start;flex-direction:${isOwn ? "row-reverse" : "row"};min-width:0${isLiveNew ? ";animation:msg-enter .22s cubic-bezier(0.16, 1, 0.3, 1)" : ""}${this.isKeyboardSelected ? keyboardSelectedRowStyle(isDark) : ""}"
7205
7761
  >
7206
- ${showAvatar ? html7`
7762
+ ${showAvatar ? html8`
7207
7763
  <chat-avatar
7208
7764
  .image="${authorAvatar ?? ""}"
7209
7765
  .name="${authorName}"
@@ -7227,24 +7783,31 @@ var ChatMessage = class extends LitElement6 {
7227
7783
  <div
7228
7784
  class="msg-bubble"
7229
7785
  dir="${textDirection(displayedText)}"
7786
+ @click="${(e) => {
7787
+ if (this._showMobileContext) {
7788
+ e.preventDefault();
7789
+ e.stopPropagation();
7790
+ this._closeMobileContext();
7791
+ }
7792
+ }}"
7230
7793
  style="display:${noBubble ? "block" : "inline-block"};min-width:0;max-width:100%;box-sizing:border-box;${noBubble ? "width:100%;" : ""}background:${noBubble ? "transparent" : baseColor};color:${textColor};align-self:${isOwn ? "flex-end" : "flex-start"};border-radius:${messageBubbleRadius({
7231
7794
  noBubble,
7232
7795
  isOwn,
7233
7796
  isStartOfSequence
7234
- })};padding:${noBubble ? "2px 0" : "8px 13px"};margin-left:${isOwn ? "0" : showAvatar ? "0" : avatarSpace + "px"};margin-right:${isOwn ? showAvatar ? "0" : avatarSpace + "px" : "0"};overflow-x:hidden;overflow-y:hidden;word-break:break-word;overflow-wrap:anywhere${bubbleDecoration}${this._longPressActive && !this._selectedMedia ? ";animation:msg-highlight .3s ease forwards" : ""}"
7797
+ })};padding:${noBubble ? "2px 0" : "8px 13px"};margin-left:${isOwn ? "0" : showAvatar ? "0" : avatarSpace + "px"};margin-right:${isOwn ? showAvatar ? "0" : avatarSpace + "px" : "0"};overflow-x:hidden;overflow-y:hidden;word-break:break-word;overflow-wrap:anywhere;transition:box-shadow .22s ease,filter .22s ease${bubbleDecoration}${longPressBubbleEffect}"
7235
7798
  >
7236
7799
  ${shouldShowName({
7237
7800
  isStartOfSequence,
7238
7801
  isOwn,
7239
7802
  isGroupChat: this.isGroupChat,
7240
7803
  hideNames: customColors?.hideNames
7241
- }) ? html7`
7804
+ }) ? html8`
7242
7805
  <b
7243
7806
  data-testid="author-name"
7244
7807
  dir="auto"
7245
7808
  style="font-size:11px;color:${participantColor};user-select:none;-webkit-user-select:none"
7246
7809
  >${authorName}</b>
7247
- ` : nothing3}${this.msg.replyTo ? renderQuotedMessage(this.msg.replyTo, isDark, customColors, textColor) : nothing3}${this._isEditing ? html7`
7810
+ ` : nothing3}${this.msg.replyTo ? renderQuotedMessage(this.msg.replyTo, isDark, customColors, textColor) : nothing3}${this._isEditing ? html8`
7248
7811
  <div style="margin-top:4px">
7249
7812
  <textarea
7250
7813
  data-testid="edit-message-input"
@@ -7269,16 +7832,16 @@ var ChatMessage = class extends LitElement6 {
7269
7832
  </button>
7270
7833
  </div>
7271
7834
  </div>
7272
- ` : displayedText || this.streamActive ? html7`
7835
+ ` : displayedText || this.streamActive ? html8`
7273
7836
  <span
7274
7837
  data-testid="message-text"
7275
7838
  dir="${textDirection(displayedText)}"
7276
7839
  style="${callDetails ? "display:flex;align-items:center;gap:8px;" : "display:inline;"}user-select:${this.isMobile ? "none" : "text"};-webkit-user-select:${this.isMobile ? "none" : "text"};overflow-wrap:anywhere;word-break:break-word;min-width:0"
7277
7840
  >${callDetails ? faPhoneAlt : nothing3}${unsafeHTML((this.streamActive || isRevealing) && displayedText.trim() ? injectCursorAtEnd(markdownHtml, liveCursorHtml(isDark)) : markdownHtml)}</span>
7278
- ` : nothing3}${attachments && attachments.length > 0 ? html7`
7841
+ ` : nothing3}${attachments && attachments.length > 0 ? html8`
7279
7842
  <div
7280
7843
  style="display:flex;flex-direction:column;gap:6px;margin-top:6px;min-width:0;max-width:100%">
7281
- ${attachments.map((att) => html7`
7844
+ ${attachments.map((att) => html8`
7282
7845
  <chat-attachment
7283
7846
  .attachment="${att}"
7284
7847
  .isDark="${isDark}"
@@ -7296,9 +7859,9 @@ var ChatMessage = class extends LitElement6 {
7296
7859
  ` : nothing3}<div
7297
7860
  style="display:flex;justify-content:flex-end;align-items:center;gap:4px;margin-top:4px;user-select:none;-webkit-user-select:none"
7298
7861
  >
7299
- ${showMenu ? html7`
7862
+ ${showMenu ? html8`
7300
7863
  <div style="display:flex;align-items:center;gap:4px">
7301
- ${hasEdits ? html7`
7864
+ ${hasEdits ? html8`
7302
7865
  <span dir="auto" style="font-size:10px;opacity:0.7">edited</span>
7303
7866
  ` : nothing3}
7304
7867
  <button
@@ -7311,11 +7874,11 @@ var ChatMessage = class extends LitElement6 {
7311
7874
  >
7312
7875
  ${faEllipsisV}
7313
7876
  </button>
7314
- ${this._menuOpen ? html7`
7877
+ ${this._menuOpen ? html8`
7315
7878
  <div
7316
7879
  style="${dropdownMenuStyle(isDark, this._btnEl?.getBoundingClientRect() ?? new DOMRect())}"
7317
7880
  >
7318
- ${canEdit ? html7`
7881
+ ${canEdit ? html8`
7319
7882
  <button
7320
7883
  type="button"
7321
7884
  @click="${this._startEdit}"
@@ -7325,7 +7888,7 @@ var ChatMessage = class extends LitElement6 {
7325
7888
  >
7326
7889
  ${faPen} Edit
7327
7890
  </button>
7328
- ` : nothing3} ${hasEdits ? html7`
7891
+ ` : nothing3} ${hasEdits ? html8`
7329
7892
  <button
7330
7893
  type="button"
7331
7894
  @click="${() => {
@@ -7343,7 +7906,7 @@ var ChatMessage = class extends LitElement6 {
7343
7906
  </div>
7344
7907
  ` : nothing3}
7345
7908
  </div>
7346
- ` : html7`
7909
+ ` : html8`
7347
7910
  <div style="display:flex;align-items:center;gap:4px">
7348
7911
  <button type="button" style="${kebabMenuStyle(textColor)};visibility:hidden">
7349
7912
  ${faEllipsisV}
@@ -7357,22 +7920,18 @@ var ChatMessage = class extends LitElement6 {
7357
7920
  >${this._timeAgo}</span>
7358
7921
  </div>
7359
7922
  </div>
7360
- ${this.onReact && !this.isMobile ? html7`
7923
+ ${this.onReact && !this.isMobile ? html8`
7361
7924
  <button
7362
7925
  type="button"
7363
7926
  class="msg-smiley-trigger"
7927
+ ?data-open="${this._showQuickEmojis || this._showEmojiPicker || void 0}"
7364
7928
  style="${smileyTriggerStyle(isDark, isOwn)}"
7365
- @click="${() => {
7366
- this._showQuickEmojis = !this._showQuickEmojis;
7367
- if (this._showQuickEmojis) {
7368
- requestAnimationFrame(() => document.addEventListener("mousedown", this._dismissQuickEmojis));
7369
- }
7370
- }}"
7929
+ @click="${this._toggleQuickEmojis}"
7371
7930
  title="React"
7372
7931
  >
7373
7932
  ${faSmile}
7374
7933
  </button>
7375
- ` : nothing3} ${this.onReply && !this.isMobile ? html7`
7934
+ ` : nothing3} ${this.onReply && !this.isMobile ? html8`
7376
7935
  <button
7377
7936
  type="button"
7378
7937
  class="msg-reply-trigger"
@@ -7382,142 +7941,95 @@ var ChatMessage = class extends LitElement6 {
7382
7941
  >
7383
7942
  ${faReply}
7384
7943
  </button>
7385
- ` : nothing3} ${this._showQuickEmojis && this.onReact ? html7`
7386
- <div class="msg-quick-emojis" style="${quickEmojiRowStyle(isDark, isOwn)}">
7387
- ${quickEmojis.map((emoji) => html7`
7388
- <button
7389
- type="button"
7390
- @click="${() => this._toggleReaction(emoji)}"
7391
- style="${reactionBtnStyle}"
7392
- >
7393
- ${emoji}
7394
- </button>
7395
- `)}
7396
- <button
7397
- type="button"
7398
- @click="${() => {
7399
- this._showQuickEmojis = false;
7400
- this._showEmojiPicker = true;
7401
- }}"
7402
- style="${reactionBtnStyle};font-size:14px"
7403
- title="More reactions"
7404
- >
7405
- +
7406
- </button>
7407
- </div>
7408
- ` : nothing3} ${!empty(this.msg.reactions ?? []) ? renderReactionPills(groupReactions(this.userId)(this.msg.reactions), isDark, (emoji) => this._toggleReaction(emoji)) : nothing3} ${this.isKeyboardSelected && !this.isMobile && !this._isEditing ? html7`
7944
+ ` : nothing3} ${quickBarPos ? renderQuickEmojiBar({
7945
+ isDark,
7946
+ isMobile: false,
7947
+ top: quickBarPos.top,
7948
+ left: quickBarPos.left,
7949
+ placement: quickBarPos.placement,
7950
+ ownReactions,
7951
+ baseBtnStyle: reactionBtnStyle,
7952
+ onPick: (emoji) => this._toggleReaction(emoji),
7953
+ onExpand: this._openFullEmojiPicker
7954
+ }) : nothing3} ${!empty(this.msg.reactions ?? []) ? renderReactionPills(groupReactions(this.userId)(this.msg.reactions), isDark, (emoji) => this._toggleReaction(emoji)) : nothing3} ${this.isKeyboardSelected && !this.isMobile && !this._isEditing ? html8`
7409
7955
  <div
7410
7956
  data-testid="message-keyboard-hint"
7411
7957
  style="${keyboardHintBarStyle(isDark)}"
7412
7958
  >
7413
- ${this.onReact ? html7`
7959
+ ${this.onReact ? html8`
7414
7960
  <span><kbd style="${keyboardHintKeyStyle(isDark)}">1–5</kbd> react</span>
7415
7961
  <span><kbd style="${keyboardHintKeyStyle(isDark)}">+</kbd> emoji</span>
7416
- ` : nothing3} ${this.onReply ? html7`
7962
+ ` : nothing3} ${this.onReply ? html8`
7417
7963
  <span><kbd style="${keyboardHintKeyStyle(isDark)}">r</kbd> reply</span>
7418
- ` : nothing3} ${canEdit ? html7`
7964
+ ` : nothing3} ${canEdit ? html8`
7419
7965
  <span><kbd style="${keyboardHintKeyStyle(isDark)}">e</kbd> edit</span>
7420
7966
  ` : nothing3}
7421
7967
  <span><kbd style="${keyboardHintKeyStyle(isDark)}">Esc</kbd> back</span>
7422
7968
  </div>
7423
7969
  ` : nothing3}
7424
7970
  </div>
7425
- ${this._showMobileContext ? html7`
7426
- <div style="${mobileContextOverlayStyle}" @click="${this._closeMobileContext}">
7427
- <div style="${mobileContextMenuStyle(isDark, this._touchY, this._touchX)}" @click="${(e) => e.stopPropagation()}">
7428
- ${this.onReact ? html7`
7429
- <div style="${mobileContextEmojiRowStyle(isDark)}">
7430
- ${quickEmojis.map((emoji) => html7`
7431
- <button
7432
- type="button"
7433
- @click="${() => {
7434
- this._toggleReaction(emoji);
7435
- this._showMobileContext = false;
7436
- }}"
7437
- style="${reactionBtnStyle};font-size:22px;padding:4px 6px"
7438
- >
7439
- ${emoji}
7440
- </button>
7441
- `)}
7442
- <button
7443
- type="button"
7444
- @click="${() => {
7445
- this._showMobileContext = false;
7446
- this._showEmojiPicker = true;
7447
- }}"
7448
- style="${reactionBtnStyle};font-size:16px;padding:4px 6px;color:${isDark ? "#aaa" : "#666"}"
7449
- title="More reactions"
7450
- >
7451
- +
7452
- </button>
7453
- </div>
7454
- ` : nothing3} ${this.onReply ? html7`
7455
- <button
7456
- type="button"
7457
- @click="${() => {
7458
- this.onReply?.();
7459
- this._closeMobileContext();
7460
- }}"
7461
- style="${mobileContextActionStyle(isDark)}"
7462
- >
7463
- ${faReply} Reply
7464
- </button>
7465
- ` : nothing3} ${this._selectedMedia ? html7`
7466
- <button
7467
- type="button"
7468
- @click="${this._shareSelectedMedia}"
7469
- style="${mobileContextActionStyle(isDark)}"
7470
- >
7471
- ${this._selectedMedia.type === "video" ? faShare : faImage} Share ${this._selectedMedia.type === "video" ? "Video" : "Image"}
7472
- </button>
7473
- <button
7474
- type="button"
7475
- @click="${this._downloadSelectedMedia}"
7476
- style="${mobileContextActionStyle(isDark)}"
7477
- >
7478
- ${faDownload} Download ${this._selectedMedia.type === "video" ? "Video" : "Image"}
7479
- </button>
7480
- ` : nothing3}
7481
- <button
7482
- type="button"
7483
- @click="${this._copyText}"
7484
- style="${mobileContextActionStyle(isDark)}"
7485
- >
7486
- ${faCopy} Copy
7487
- </button>
7488
- ${canEdit ? html7`
7489
- <button
7490
- type="button"
7491
- @click="${() => {
7492
- this._showMobileContext = false;
7493
- this._startEdit();
7494
- }}"
7495
- style="${mobileContextActionStyle(isDark)}"
7496
- >
7497
- ${faPen} Edit
7498
- </button>
7499
- ` : nothing3} ${hasEdits ? html7`
7500
- <button
7501
- type="button"
7502
- @click="${() => {
7503
- this._showMobileContext = false;
7504
- this._showHistory = true;
7505
- }}"
7506
- style="${mobileContextActionStyle(isDark)}"
7507
- >
7508
- ${faHistory} View history
7509
- </button>
7510
- ` : nothing3}
7511
- </div>
7512
- </div>
7513
- ` : nothing3} ${this._showEmojiPicker ? renderEmojiGrid(isDark, (emoji) => this._toggleReaction(emoji), () => {
7514
- this._showEmojiPicker = false;
7971
+ ${this._showMobileContext && mobileLayout ? html8`
7972
+ <div
7973
+ data-testid="mobile-context-backdrop"
7974
+ style="${mobileContextOverlayStyle}"
7975
+ @click="${this._closeMobileContext}"
7976
+ ></div>
7977
+ ${this.onReact ? renderQuickEmojiBar({
7978
+ isDark,
7979
+ isMobile: true,
7980
+ top: mobileLayout.pillTop,
7981
+ left: mobileLayout.pillLeft,
7982
+ placement: mobileLayout.pillPlacement,
7983
+ ownReactions,
7984
+ baseBtnStyle: reactionBtnStyle,
7985
+ onPick: (emoji) => {
7986
+ this._toggleReaction(emoji);
7987
+ this._closeMobileContext();
7988
+ },
7989
+ onExpand: this._openFullEmojiPicker
7990
+ }) : nothing3} ${renderMobileContextCard({
7991
+ isDark,
7992
+ top: mobileLayout.menuTop,
7993
+ left: mobileLayout.menuLeft,
7994
+ width: mobileLayout.menuWidth,
7995
+ actions: mobileActions
7996
+ })}
7997
+ ` : nothing3} ${this._showEmojiPicker ? renderEmojiPickerPanel({
7998
+ isDark,
7999
+ isMobile: this.isMobile,
8000
+ accentColor: primaryColor,
8001
+ anchor: this._anchorRect,
8002
+ isOwn,
8003
+ sheetDragOffset: this._sheetDragY,
8004
+ onSheetTouchStart: this._sheetTouchStart,
8005
+ onSheetTouchMove: this._sheetTouchMove,
8006
+ onSheetTouchEnd: this._sheetTouchEnd,
8007
+ onPick: (emoji) => this._toggleReaction(emoji),
8008
+ onClose: this._closeFullEmojiPicker
7515
8009
  }) : nothing3} ${this._showHistory && editHistory ? renderEditHistory(editHistory, text, isDark, () => {
7516
8010
  this._showHistory = false;
7517
8011
  }) : nothing3}
7518
8012
  </div>
7519
8013
  `;
7520
8014
  }
8015
+ _polishMountedEmojiPicker = () => {
8016
+ const picker = this.querySelector("emoji-picker");
8017
+ if (!picker) return;
8018
+ const primaryColor = attachmentPrimaryColor(this.isDark, this.customColors);
8019
+ const applied = applyEmojiPickerShadowPolish(picker, this.isDark, this.isMobile, primaryColor, !this._emojiPickerFocused);
8020
+ if (applied) {
8021
+ this._emojiPickerFocused = true;
8022
+ return;
8023
+ }
8024
+ customElements.whenDefined("emoji-picker").then(() => {
8025
+ if (!this._showEmojiPicker || !this.isConnected) return;
8026
+ const upgraded = this.querySelector("emoji-picker");
8027
+ if (!upgraded) return;
8028
+ const done = applyEmojiPickerShadowPolish(upgraded, this.isDark, this.isMobile, attachmentPrimaryColor(this.isDark, this.customColors), !this._emojiPickerFocused);
8029
+ if (done) this._emojiPickerFocused = true;
8030
+ }).catch(() => {
8031
+ });
8032
+ };
7521
8033
  updated() {
7522
8034
  if (!this._btnEl) {
7523
8035
  this._btnEl = this.querySelector(".msg-kebab");
@@ -7527,6 +8039,9 @@ var ChatMessage = class extends LitElement6 {
7527
8039
  if (dropdown) this._menuEl = dropdown;
7528
8040
  }
7529
8041
  if (!this._menuOpen) this._menuEl = null;
8042
+ if (this._showEmojiPicker) {
8043
+ this._polishMountedEmojiPicker();
8044
+ }
7530
8045
  }
7531
8046
  };
7532
8047
  if (!customElements.get("chat-message")) {
@@ -7534,7 +8049,7 @@ if (!customElements.get("chat-message")) {
7534
8049
  }
7535
8050
 
7536
8051
  // lit/components/chat-typing-indicator.ts
7537
- import { html as html8, LitElement as LitElement7 } from "lit";
8052
+ import { html as html9, LitElement as LitElement7 } from "lit";
7538
8053
  var typingIndicatorStyle = (isDark) => `padding:0 8px 6px 44px;color:${isDark ? "#cbd5e1" : "#475569"};font-size:12px`;
7539
8054
  var typingLabel = (names) => names.length === 1 ? `${names[0]} is typing` : `${names.slice(0, 2).join(", ")}${names.length > 2 ? " and others" : ""} are typing`;
7540
8055
  var ChatTypingIndicator = class extends LitElement7 {
@@ -7570,7 +8085,7 @@ var ChatTypingIndicator = class extends LitElement7 {
7570
8085
  clearInterval(this._interval);
7571
8086
  }
7572
8087
  render() {
7573
- return html8`
8088
+ return html9`
7574
8089
  <div style="${typingIndicatorStyle(this.isDark)}">
7575
8090
  ${typingLabel(this.names)}<span style="display:inline-block;width:18px;letter-spacing:2px"
7576
8091
  >${".".repeat(this._dots)}</span>
@@ -7673,18 +8188,18 @@ var renderSpinnerIndicator = (spinner, isDark, hideNames, isGroupChat, color) =>
7673
8188
  const active = spinner.active && !stale;
7674
8189
  const direction = textDirection(spinner.text);
7675
8190
  const isRtl = direction === "rtl";
7676
- return html9`
8191
+ return html10`
7677
8192
  <div
7678
8193
  data-testid="spinner-indicator"
7679
8194
  dir="${direction}"
7680
8195
  style="${indicatorTextStyle(isDark, color, stale, isRtl)}"
7681
8196
  >
7682
- <span>${showAuthorName(hideNames, isGroupChat) ? html9`<b dir="auto">${spinner.authorName}: </b>` : nothing4}<span data-testid="spinner-text" dir="${direction}">${spinner.text}</span>${stale ? " (failed)" : nothing4}</span>
7683
- ${active ? html9`
8197
+ <span>${showAuthorName(hideNames, isGroupChat) ? html10`<b dir="auto">${spinner.authorName}: </b>` : nothing4}<span data-testid="spinner-text" dir="${direction}">${spinner.text}</span>${stale ? " (failed)" : nothing4}</span>
8198
+ ${active ? html10`
7684
8199
  <div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
7685
8200
  <div style="${indeterminateBarStyle(isDark, color)}"></div>
7686
8201
  </div>
7687
- ` : html9`
8202
+ ` : html10`
7688
8203
  <div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
7689
8204
  <div style="${linearBarFillStyle(1, isDark, color, stale)}"></div>
7690
8205
  </div>
@@ -7697,20 +8212,20 @@ var renderProgressIndicator = (progress, isDark, hideNames, isGroupChat, color)
7697
8212
  const stale = progress.percentage < 1 && isStale(progress.timestamp);
7698
8213
  const direction = textDirection(progress.text);
7699
8214
  const isRtl = direction === "rtl";
7700
- return html9`
8215
+ return html10`
7701
8216
  <div
7702
8217
  data-testid="progress-indicator"
7703
8218
  dir="${direction}"
7704
8219
  style="${indicatorTextStyle(isDark, color, stale, isRtl)}"
7705
8220
  >
7706
- <span>${showAuthorName(hideNames, isGroupChat) ? html9`<b dir="auto">${progress.authorName}: </b>` : nothing4}<span dir="${direction}">${progress.text}</span> (${Math.round(progress.percentage * 100)}%)${stale ? " (failed)" : nothing4}</span>
8221
+ <span>${showAuthorName(hideNames, isGroupChat) ? html10`<b dir="auto">${progress.authorName}: </b>` : nothing4}<span dir="${direction}">${progress.text}</span> (${Math.round(progress.percentage * 100)}%)${stale ? " (failed)" : nothing4}</span>
7707
8222
  <div style="${linearBarTrackStyle(isDark, color, stale, isRtl)}">
7708
8223
  <div style="${linearBarFillStyle(progress.percentage, isDark, color, stale)}"></div>
7709
8224
  </div>
7710
8225
  </div>
7711
8226
  `;
7712
8227
  };
7713
- var renderTypingIndicatorEntry = (typingUsers, isDark) => empty(typingUsers) ? nothing4 : html9`
8228
+ var renderTypingIndicatorEntry = (typingUsers, isDark) => empty(typingUsers) ? nothing4 : html10`
7714
8229
  <chat-typing-indicator
7715
8230
  .names="${typingUsers}"
7716
8231
  .isDark="${isDark}"
@@ -7729,7 +8244,7 @@ var activeQuickReplyEntryId = (timeline, isSending) => isSending ? null : timeli
7729
8244
  var spinnerKeyframes = `@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}`;
7730
8245
  var indeterminateKeyframes = `@keyframes indeterminate{0%{transform:translateX(-100%)}100%{transform:translateX(200px)}}`;
7731
8246
  var pulseKeyframes2 = `@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.3}}`;
7732
- var spinnerEl = (isDark, color) => html9`
8247
+ var spinnerEl = (isDark, color) => html10`
7733
8248
  <style>
7734
8249
  ${spinnerKeyframes}
7735
8250
  </style>
@@ -7747,7 +8262,7 @@ var syncingTrackStyle = (isDark) => `width:100%;height:2px;overflow:hidden;backg
7747
8262
  var syncingTrackBarStyle = (isDark, color) => `height:100%;width:32%;border-radius:9999px;background:${color ?? (isDark ? "rgba(147,197,253,0.75)" : "rgba(57,88,127,0.65)")};animation:syncingSweep 1.3s ease-in-out infinite`;
7748
8263
  var syncingPillStyle = (isDark, textColor) => `margin-top:8px;display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:9999px;font-size:11px;font-weight:500;letter-spacing:0.01em;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);background:${isDark ? "rgba(24,24,22,0.78)" : "rgba(250,249,245,0.84)"};color:${textColor ?? (isDark ? "#b8b3a8" : "#625e56")};border:1px solid ${isDark ? "rgba(255,255,255,0.08)" : "rgba(24,23,21,0.08)"};box-shadow:0 2px 8px ${isDark ? "rgba(0,0,0,0.28)" : "rgba(24,23,21,0.06)"}`;
7749
8264
  var syncingSpinnerStyle = (isDark, color) => `width:10px;height:10px;border:1.5px solid ${isDark ? "rgba(255,255,255,0.16)" : "rgba(24,23,21,0.14)"};border-top:1.5px solid ${color ?? (isDark ? "#93c5fd" : "#39587f")};border-radius:50%;animation:spin 0.85s linear infinite;flex-shrink:0`;
7750
- var syncingIndicator = (isDark, color) => html9`
8265
+ var syncingIndicator = (isDark, color) => html10`
7751
8266
  <div
7752
8267
  data-testid="messages-syncing-indicator"
7753
8268
  role="status"
@@ -7767,7 +8282,7 @@ var syncingIndicator = (isDark, color) => html9`
7767
8282
  </div>
7768
8283
  </div>
7769
8284
  `;
7770
- var sendingIndicator = (label, primaryColor, isDark) => html9`
8285
+ var sendingIndicator = (label, primaryColor, isDark) => html10`
7771
8286
  <div style="display:flex;flex-direction:row-reverse;gap:6px">
7772
8287
  <div
7773
8288
  style="background:${primaryColor};border-radius:16px;padding:10px 14px;display:flex;align-items:center;gap:10px;opacity:0.7"
@@ -7787,7 +8302,7 @@ var replyBarStyle = (isDark, custom) => `display:flex;align-items:center;gap:8px
7787
8302
  var replyBarQuoteStyle = (isDark, custom) => `flex:1;min-width:0;border-left:3px solid ${quoteBarColor(isDark, custom)};padding:2px 8px;font-size:13px;overflow:hidden`;
7788
8303
  var renderReplyBar = (reply, isDark, onClear, custom) => {
7789
8304
  const lightSurface = inputSurfaceIsLight(isDark, custom);
7790
- return html9`
8305
+ return html10`
7791
8306
  <div style="${replyBarStyle(isDark, custom)}">
7792
8307
  <span style="color:${lightSurface ? "#6b7280" : "#9ca3af"};font-size:16px;display:flex;align-items:center"
7793
8308
  >${faReply}</span>
@@ -7816,7 +8331,7 @@ var renderReplyBar = (reply, isDark, onClear, custom) => {
7816
8331
  var reactionPreviewKeyStyle = (isDark, custom) => `font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;padding:2px 6px;border-radius:6px;flex-shrink:0;background:${inputSurfaceIsLight(isDark, custom) ? "rgba(24,23,21,0.08)" : "rgba(255,255,255,0.1)"};color:${inputSurfaceIsLight(isDark, custom) ? "#374151" : "#d1d5db"}`;
7817
8332
  var renderReactionPreviewBar = ({ emoji, remove: remove2, target, isDark, custom }) => {
7818
8333
  const lightSurface = inputSurfaceIsLight(isDark, custom);
7819
- return html9`
8334
+ return html10`
7820
8335
  <div
7821
8336
  data-testid="reaction-command-preview"
7822
8337
  style="${replyBarStyle(isDark, custom)}"
@@ -7881,7 +8396,7 @@ var unreadDividerRowStyle = "display:flex;align-items:center;gap:10px;margin:8px
7881
8396
  var unreadDividerLineStyle = (isDark) => `flex:1;height:1px;background:${isDark ? "rgba(96,165,250,0.28)" : "rgba(37,99,235,0.24)"}`;
7882
8397
  var unreadDividerPillStyle = (isDark) => `font-size:11px;font-weight:700;letter-spacing:0.01em;padding:3px 10px;border-radius:9999px;white-space:nowrap;background:${isDark ? "rgba(96,165,250,0.18)" : "rgba(37,99,235,0.10)"};color:${isDark ? "#93c5fd" : "#1d4ed8"};border:1px solid ${isDark ? "rgba(96,165,250,0.34)" : "rgba(37,99,235,0.24)"}`;
7883
8398
  var backUnreadBadgeStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;margin-left:-4px;margin-right:4px;border-radius:9999px;border:none;cursor:pointer;font-size:11px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;background:${isDark ? "#60a5fa" : "#2563eb"};color:${isDark ? "#0d1526" : "#ffffff"};flex-shrink:0`;
7884
- var renderUnreadMessagesDivider = (count2, isDark) => html9`
8399
+ var renderUnreadMessagesDivider = (count2, isDark) => html10`
7885
8400
  <div
7886
8401
  data-testid="unread-messages-divider"
7887
8402
  role="separator"
@@ -8492,15 +9007,15 @@ var ChatBox = class extends LitElement8 {
8492
9007
  this.onToggleNotificationsMute?.();
8493
9008
  };
8494
9009
  _renderMenuContent() {
8495
- return html9`
8496
- ${this.enableVoiceCall && this.voiceCallState === "idle" ? html9`
9010
+ return html10`
9011
+ ${this.enableVoiceCall && this.voiceCallState === "idle" ? html10`
8497
9012
  <div
8498
9013
  class="menu-item"
8499
9014
  @click="${this._handleMenuCall}"
8500
9015
  >
8501
9016
  Voice Call
8502
9017
  </div>
8503
- ` : nothing4} ${this.onToggleNotificationsMute ? html9`
9018
+ ` : nothing4} ${this.onToggleNotificationsMute ? html10`
8504
9019
  <div
8505
9020
  data-testid="menu-toggle-mute-notifications"
8506
9021
  class="menu-item"
@@ -8508,7 +9023,7 @@ var ChatBox = class extends LitElement8 {
8508
9023
  >
8509
9024
  ${this.notificationsMuted ? "Unmute notifications" : "Mute notifications"}
8510
9025
  </div>
8511
- ` : nothing4} ${this.credentials ? html9`
9026
+ ` : nothing4} ${this.credentials ? html10`
8512
9027
  <div
8513
9028
  class="menu-item"
8514
9029
  @click="${this._handleMenuNewThread}"
@@ -8538,7 +9053,7 @@ var ChatBox = class extends LitElement8 {
8538
9053
  }
8539
9054
  _renderHeaderMenu() {
8540
9055
  const isDark = this._effectiveDark;
8541
- return html9`
9056
+ return html10`
8542
9057
  <div style="position:relative;display:flex;align-items:center;flex-shrink:0">
8543
9058
  <button
8544
9059
  data-testid="menu-button"
@@ -8555,7 +9070,7 @@ var ChatBox = class extends LitElement8 {
8555
9070
  >
8556
9071
  ${faEllipsisV}
8557
9072
  </button>
8558
- ${this._showMenu ? html9`
9073
+ ${this._showMenu ? html10`
8559
9074
  <div
8560
9075
  data-testid="menu-container"
8561
9076
  style="position:absolute;top:calc(100% + 8px);right:0;background:${isDark ? "#2a2a2a" : "#ffffff"};color:${isDark ? "#ffffff" : "#000000"};border:1px solid ${isDark ? "#4b5563" : "#d1d5db"};border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.15);padding:4px 0;z-index:100000;font-size:14px;min-width:160px;display:flex;flex-direction:column"
@@ -8569,7 +9084,7 @@ var ChatBox = class extends LitElement8 {
8569
9084
  _renderBottomMenu() {
8570
9085
  const isDark = this._effectiveDark;
8571
9086
  const customColors = this.customColors;
8572
- return html9`
9087
+ return html10`
8573
9088
  <div style="position:relative;display:flex">
8574
9089
  <button
8575
9090
  data-testid="menu-button"
@@ -8584,7 +9099,7 @@ var ChatBox = class extends LitElement8 {
8584
9099
  >
8585
9100
  ${faEllipsisV}
8586
9101
  </button>
8587
- ${this._showMenu ? html9`
9102
+ ${this._showMenu ? html10`
8588
9103
  <div
8589
9104
  data-testid="menu-container"
8590
9105
  style="position:absolute;bottom:calc(100% + 8px);right:0;background:${isDark ? "#2a2a2a" : "#ffffff"};color:${isDark ? "#ffffff" : "#000000"};border:1px solid ${isDark ? "#4b5563" : "#d1d5db"};border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.15);padding:4px 0;z-index:100000;font-size:14px;min-width:160px;display:flex;flex-direction:column"
@@ -9313,7 +9828,7 @@ var ChatBox = class extends LitElement8 {
9313
9828
  } : null;
9314
9829
  })() : null;
9315
9830
  const remaining = maxTextLength - estimateSerializedLength(this._input);
9316
- return html9`
9831
+ return html10`
9317
9832
  <style>
9318
9833
  ${kebabHoverCss2}${indeterminateKeyframes}${pulseKeyframes2}
9319
9834
  .menu-item {
@@ -9410,12 +9925,12 @@ var ChatBox = class extends LitElement8 {
9410
9925
  data-testid="chat-container"
9411
9926
  style="${chatContainerStyle(isDark, customColors)}"
9412
9927
  >
9413
- ${!customColors?.hideTitle ? html9`
9928
+ ${!customColors?.hideTitle ? html10`
9414
9929
  <div data-testid="title-bar" style="${titleStyle(isDark, customColors)}">
9415
9930
  <div
9416
9931
  style="${contentMaxWidthStyle(customColors) ? contentMaxWidthStyle(customColors) + ";" : ""}width:100%;display:flex;align-items:center;padding:0 ${this.onClose || this.onBack ? "16px" : "44px"} 0 16px"
9417
9932
  >
9418
- ${this.onBack ? html9`
9933
+ ${this.onBack ? html10`
9419
9934
  <button
9420
9935
  type="button"
9421
9936
  data-testid="back-to-chats-button"
@@ -9428,7 +9943,7 @@ var ChatBox = class extends LitElement8 {
9428
9943
  >
9429
9944
  ${faArrowLeft}
9430
9945
  </button>
9431
- ${this.otherUnreadCount > 0 ? html9`
9946
+ ${this.otherUnreadCount > 0 ? html10`
9432
9947
  <button
9433
9948
  type="button"
9434
9949
  data-testid="back-unread-badge"
@@ -9441,7 +9956,7 @@ var ChatBox = class extends LitElement8 {
9441
9956
  ` : nothing4}
9442
9957
  ` : nothing4}
9443
9958
  <div style="flex:1;display:flex;justify-content:center;min-width:0;overflow:hidden">
9444
- ${this._isEditingTitle ? html9`
9959
+ ${this._isEditingTitle ? html10`
9445
9960
  <input
9446
9961
  type="text"
9447
9962
  data-testid="rename-conversation-input"
@@ -9453,7 +9968,7 @@ var ChatBox = class extends LitElement8 {
9453
9968
  @keydown="${this._onTitleDraftKeydown}"
9454
9969
  @blur="${this._commitEditingTitle}"
9455
9970
  />
9456
- ` : html9`
9971
+ ` : html10`
9457
9972
  <div
9458
9973
  data-testid="title-text"
9459
9974
  class="${this.credentials ? "title-editable" : ""}"
@@ -9461,11 +9976,11 @@ var ChatBox = class extends LitElement8 {
9461
9976
  @click="${this.credentials ? this._startEditingTitle : void 0}"
9462
9977
  style="text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis"
9463
9978
  >
9464
- <span style="overflow:hidden;text-overflow:ellipsis">${this.title}</span>${this.credentials ? html9`<span class="title-edit-icon">${faPen}</span>` : nothing4}
9979
+ <span style="overflow:hidden;text-overflow:ellipsis">${this.title}</span>${this.credentials ? html10`<span class="title-edit-icon">${faPen}</span>` : nothing4}
9465
9980
  </div>
9466
9981
  `}
9467
9982
  </div>
9468
- ${this._renderHeaderMenu()} ${this.onClose ? html9`
9983
+ ${this._renderHeaderMenu()} ${this.onClose ? html10`
9469
9984
  <button
9470
9985
  type="button"
9471
9986
  data-testid="widget-close-button"
@@ -9480,13 +9995,13 @@ var ChatBox = class extends LitElement8 {
9480
9995
  ` : nothing4}
9481
9996
  </div>
9482
9997
  </div>
9483
- ` : nothing4} ${this.voiceCallState !== "idle" ? html9`
9998
+ ` : nothing4} ${this.voiceCallState !== "idle" ? html10`
9484
9999
  <div
9485
10000
  style="background:${isDark ? "#2a2a2a" : "#e2e8f0"};padding:12px 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid ${isDark ? "#1a1a1a" : "#cbd5e1"}"
9486
10001
  >
9487
10002
  <div style="color:${isDark ? "#fff" : "#000"};font-weight:bold">${voiceCallLabel(this.voiceCallState, this.voiceCallDuration)}</div>
9488
10003
  <div style="display:flex;gap:8px">
9489
- ${this.voiceCallState === "active" && this.onToggleMute ? html9`
10004
+ ${this.voiceCallState === "active" && this.onToggleMute ? html10`
9490
10005
  <button
9491
10006
  type="button"
9492
10007
  @click="${this.onToggleMute}"
@@ -9494,7 +10009,7 @@ var ChatBox = class extends LitElement8 {
9494
10009
  >
9495
10010
  ${this.voiceCallMuted ? faMicrophoneSlash : faMicrophone} ${this.voiceCallMuted ? "Unmute" : "Mute"}
9496
10011
  </button>
9497
- ` : nothing4} ${this.voiceCallState === "ringing" && this.onAcceptCall ? html9`
10012
+ ` : nothing4} ${this.voiceCallState === "ringing" && this.onAcceptCall ? html10`
9498
10013
  <button
9499
10014
  type="button"
9500
10015
  @click="${this.onAcceptCall}"
@@ -9502,7 +10017,7 @@ var ChatBox = class extends LitElement8 {
9502
10017
  >
9503
10018
  Accept
9504
10019
  </button>
9505
- ` : nothing4} ${(this.voiceCallState === "ringing" || this.voiceCallState === "active" || this.voiceCallState === "calling" || this.voiceCallState === "connecting") && this.onEndCall && this.onRejectCall ? html9`
10020
+ ` : nothing4} ${(this.voiceCallState === "ringing" || this.voiceCallState === "active" || this.voiceCallState === "calling" || this.voiceCallState === "connecting") && this.onEndCall && this.onRejectCall ? html10`
9506
10021
  <button
9507
10022
  type="button"
9508
10023
  @click="${this.voiceCallState === "ringing" ? this.onRejectCall : this.onEndCall}"
@@ -9531,11 +10046,11 @@ var ChatBox = class extends LitElement8 {
9531
10046
  data-content-inner
9532
10047
  style="display:flex;flex-direction:column;gap:8px;padding:12px 12px ${this._inputAreaHeight}px 12px;flex-grow:1;width:100%;max-width:100%;box-sizing:border-box;min-width:0;${contentMaxWidthStyle(customColors)}"
9533
10048
  >
9534
- ${this.isLoading || this.isSyncing && allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html9`
10049
+ ${this.isLoading || this.isSyncing && allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html10`
9535
10050
  <div style="${centerFillStyle(isDark)}">${spinnerEl(isDark, customColors?.text)}</div>
9536
- ` : allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html9`
10051
+ ` : allMsgs.length === 0 && this.activeSpinners.length === 0 && this.activeProgress.length === 0 && this.activeStreams.length === 0 ? html10`
9537
10052
  <div style="${centerFillStyle(isDark)}">
9538
- ${nonempty(this.suggestedMessages ?? []) ? html9`
10053
+ ${nonempty(this.suggestedMessages ?? []) ? html10`
9539
10054
  <div style="${emptySuggestionsWrapStyle}">
9540
10055
  <span
9541
10056
  data-testid="empty-state"
@@ -9547,7 +10062,7 @@ var ChatBox = class extends LitElement8 {
9547
10062
  >
9548
10063
  ${map((item) => {
9549
10064
  const { label, text } = resolveSuggestedMessage(item);
9550
- return html9`
10065
+ return html10`
9551
10066
  <button
9552
10067
  type="button"
9553
10068
  class="suggested-message-btn"
@@ -9562,13 +10077,13 @@ var ChatBox = class extends LitElement8 {
9562
10077
  })(this.suggestedMessages ?? [])}
9563
10078
  </div>
9564
10079
  </div>
9565
- ` : this.emptyMessage ? html9`
10080
+ ` : this.emptyMessage ? html10`
9566
10081
  <span data-testid="empty-state">${this.emptyMessage}</span>
9567
- ` : html9`
10082
+ ` : html10`
9568
10083
  <span data-testid="empty-state">No messages yet. Start the conversation!</span>
9569
10084
  `}
9570
10085
  </div>
9571
- ` : html9`
10086
+ ` : html10`
9572
10087
  ${repeat(timeline, (entry) => {
9573
10088
  if (entry.kind === "message") return entry.msg.id;
9574
10089
  if (entry.kind === "spinner") {
@@ -9585,7 +10100,7 @@ var ChatBox = class extends LitElement8 {
9585
10100
  </div>
9586
10101
  </div>
9587
10102
 
9588
- ${this._showScrollDownButton ? html9`
10103
+ ${this._showScrollDownButton ? html10`
9589
10104
  <button
9590
10105
  class="scroll-down-btn"
9591
10106
  style="bottom:${this._inputAreaHeight + 16}px"
@@ -9608,10 +10123,10 @@ var ChatBox = class extends LitElement8 {
9608
10123
  custom: customColors
9609
10124
  }) : this._replyingTo ? renderReplyBar(this._replyingTo, isDark, () => {
9610
10125
  this._replyingTo = null;
9611
- }, customColors) : nothing4} ${!empty(this._pendingFiles) ? html9`
10126
+ }, customColors) : nothing4} ${!empty(this._pendingFiles) ? html10`
9612
10127
  <div style="background:${inputBgColor}">
9613
10128
  <div style="display:flex;gap:8px;padding:8px 12px;flex-wrap:wrap;${contentMaxWidthStyle(customColors)}">
9614
- ${this._pendingFiles.map((f, i) => html9`
10129
+ ${this._pendingFiles.map((f, i) => html10`
9615
10130
  <div
9616
10131
  style="display:flex;align-items:center;gap:4px;padding:4px 8px;background:${isDark ? "#2a2a2a" : "#cbd5e1"};border-radius:4px;font-size:12px"
9617
10132
  >
@@ -9629,7 +10144,7 @@ var ChatBox = class extends LitElement8 {
9629
10144
  `)}
9630
10145
  </div>
9631
10146
  </div>
9632
- ` : nothing4} ${this._isRecording ? html9`
10147
+ ` : nothing4} ${this._isRecording ? html10`
9633
10148
  <div style="${recordingIndicatorStyle(isDark)}">
9634
10149
  <div style="display:flex;align-items:center;gap:8px">
9635
10150
  <span
@@ -9637,7 +10152,7 @@ var ChatBox = class extends LitElement8 {
9637
10152
  ></span>
9638
10153
  <span>Recording... ${formatDuration(this._recordingDuration)}</span>
9639
10154
  </div>
9640
- ${this._isMobile && !this._isRecordingLocked ? html9`
10155
+ ${this._isMobile && !this._isRecordingLocked ? html10`
9641
10156
  <div style="display:flex;align-items:center;gap:16px;font-size:12px">
9642
10157
  <span
9643
10158
  style="opacity:${0.6 + Math.min(0.4, Math.abs(this._swipeOffset.x) / 50)};transform:translateX(${Math.min(0, this._swipeOffset.x / 3)}px);transition:opacity 0.15s"
@@ -9646,7 +10161,7 @@ var ChatBox = class extends LitElement8 {
9646
10161
  style="opacity:${0.4 + Math.min(0.6, Math.abs(this._swipeOffset.y) / 30)};transform:translateY(${Math.min(0, this._swipeOffset.y / 3)}px);transition:opacity 0.15s"
9647
10162
  >↑ lock</span>
9648
10163
  </div>
9649
- ` : nothing4} ${this._isMobile && this._isRecordingLocked ? html9`
10164
+ ` : nothing4} ${this._isMobile && this._isRecordingLocked ? html10`
9650
10165
  <div style="display:flex;gap:8px">
9651
10166
  <button
9652
10167
  type="button"
@@ -9663,7 +10178,7 @@ var ChatBox = class extends LitElement8 {
9663
10178
  Send
9664
10179
  </button>
9665
10180
  </div>
9666
- ` : nothing4} ${!this._isMobile ? html9`
10181
+ ` : nothing4} ${!this._isMobile ? html10`
9667
10182
  <button
9668
10183
  type="button"
9669
10184
  @click="${() => this._stopRecording(false)}"
@@ -9703,7 +10218,7 @@ var ChatBox = class extends LitElement8 {
9703
10218
  <div
9704
10219
  style="position:relative;flex-grow:1;display:flex;align-items:flex-end"
9705
10220
  >
9706
- ${this._autocompleteState?.kind === "mention" ? html9`
10221
+ ${this._autocompleteState?.kind === "mention" ? html10`
9707
10222
  <div
9708
10223
  class="autocomplete-dropdown"
9709
10224
  data-testid="mention-autocomplete"
@@ -9711,7 +10226,7 @@ var ChatBox = class extends LitElement8 {
9711
10226
  >
9712
10227
  ${repeat(this._autocompleteState.filtered, (p) => p.publicSignKey, (p, index) => {
9713
10228
  const isSelected = this._autocompleteState.selectedIndex === index;
9714
- return html9`
10229
+ return html10`
9715
10230
  <div
9716
10231
  style="${autocompleteItemStyle(isSelected, isDark, customColors)}"
9717
10232
  @click="${() => this._selectAutocompleteItem(p)}"
@@ -9734,19 +10249,19 @@ var ChatBox = class extends LitElement8 {
9734
10249
  `;
9735
10250
  })}
9736
10251
  </div>
9737
- ` : this._autocompleteState?.kind === "emoji" ? html9`
10252
+ ` : this._autocompleteState?.kind === "emoji" ? html10`
9738
10253
  <div
9739
10254
  class="autocomplete-dropdown"
9740
10255
  data-testid="emoji-autocomplete"
9741
10256
  style="${autocompleteDropdownStyle(isDark, customColors)}"
9742
10257
  >
9743
- ${this._autocompleteState.reactionMode ? html9`
10258
+ ${this._autocompleteState.reactionMode ? html10`
9744
10259
  <div style="${autocompleteHeaderStyle(isDark, customColors)}">
9745
10260
  ${this._autocompleteState.reactionMode === "remove" ? "Remove reaction from" : "React to"} ${this._reactionTargetMessage()?.authorName || "previous message"}
9746
10261
  </div>
9747
10262
  ` : nothing4} ${repeat(this._autocompleteState.items, (entry) => entry.shortcode, (entry, index) => {
9748
10263
  const isSelected = this._autocompleteState.selectedIndex === index;
9749
- return html9`
10264
+ return html10`
9750
10265
  <div
9751
10266
  data-testid="emoji-autocomplete-item"
9752
10267
  data-shortcode="${entry.shortcode}"
@@ -9762,7 +10277,7 @@ var ChatBox = class extends LitElement8 {
9762
10277
  >${entry.emoji}</span>
9763
10278
  <div style="display:flex;align-items:baseline;gap:8px;min-width:0;flex:1">
9764
10279
  <span style="${autocompleteItemNameStyle(isDark, customColors)}">:${entry.shortcode}:</span>
9765
- ${entry.aliases && entry.aliases.length > 0 ? html9`
10280
+ ${entry.aliases && entry.aliases.length > 0 ? html10`
9766
10281
  <span style="${autocompleteItemKeyStyle(isDark, customColors)}">${entry.aliases[0]}</span>
9767
10282
  ` : nothing4}
9768
10283
  </div>
@@ -9770,7 +10285,7 @@ var ChatBox = class extends LitElement8 {
9770
10285
  `;
9771
10286
  })}
9772
10287
  </div>
9773
- ` : nothing4} ${this.enableAttachments ? html9`
10288
+ ` : nothing4} ${this.enableAttachments ? html10`
9774
10289
  <div
9775
10290
  data-attach-wrapper
9776
10291
  style="position:absolute;right:${isTransparentInput(customColors) ? "0px" : "4px"};top:50%;transform:translateY(-50%);z-index:100"
@@ -9784,7 +10299,7 @@ var ChatBox = class extends LitElement8 {
9784
10299
  >
9785
10300
  ${faPaperclip}
9786
10301
  </button>
9787
- ${this._showAttachMenu ? html9`
10302
+ ${this._showAttachMenu ? html10`
9788
10303
  <div data-testid="attach-menu" style="${attachMenuStyle(isDark)}">
9789
10304
  <button
9790
10305
  type="button"
@@ -9813,7 +10328,7 @@ var ChatBox = class extends LitElement8 {
9813
10328
  >
9814
10329
  ${faFile} Document
9815
10330
  </button>
9816
- ${this.onSendLocation ? html9`
10331
+ ${this.onSendLocation ? html10`
9817
10332
  <button
9818
10333
  type="button"
9819
10334
  @click="${this._onAttachLocation}"
@@ -9861,14 +10376,14 @@ var ChatBox = class extends LitElement8 {
9861
10376
  </button>
9862
10377
  ${customColors?.hideTitle ? this._renderBottomMenu() : nothing4}
9863
10378
  </div>
9864
- ${remaining < charCountThreshold ? html9`
10379
+ ${remaining < charCountThreshold ? html10`
9865
10380
  <div style="${charCountStyle(isDark, remaining < 0)}">
9866
10381
  ${remaining < 0 ? `${-remaining} characters over limit` : `${remaining} characters remaining`}
9867
10382
  </div>
9868
10383
  ` : nothing4}
9869
10384
  </div>
9870
10385
  </div>
9871
- ${this._fetchingMore ? html9`
10386
+ ${this._fetchingMore ? html10`
9872
10387
  <div style="${loadingStyle}">Loading more...</div>
9873
10388
  ` : nothing4}
9874
10389
  </div>
@@ -9878,7 +10393,7 @@ var ChatBox = class extends LitElement8 {
9878
10393
  const isDark = this._effectiveDark;
9879
10394
  const { customColors } = this;
9880
10395
  const showUnreadDivider = unreadDivider !== null && entry.msg.id === unreadDivider.firstUnreadMessageId;
9881
- return html9`
10396
+ return html10`
9882
10397
  ${showUnreadDivider ? renderUnreadMessagesDivider(unreadDivider.count, isDark) : nothing4}
9883
10398
  <chat-message
9884
10399
  .msg="${entry.msg}"
@@ -9923,7 +10438,7 @@ var ChatBox = class extends LitElement8 {
9923
10438
  text: entry.stream.text,
9924
10439
  timestamp: entry.stream.timestamp
9925
10440
  };
9926
- return html9`
10441
+ return html10`
9927
10442
  <chat-message
9928
10443
  .msg="${streamMsg}"
9929
10444
  .prev="${entry.prevMsg}"
@@ -9945,7 +10460,7 @@ if (!customElements.get("chat-box")) {
9945
10460
  }
9946
10461
 
9947
10462
  // lit/components/user-profile-popup.ts
9948
- import { html as html10, LitElement as LitElement9, nothing as nothing5 } from "lit";
10463
+ import { html as html11, LitElement as LitElement9, nothing as nothing5 } from "lit";
9949
10464
  var overlayStyle2 = "position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:1000";
9950
10465
  var popupStyle = (isDark) => `background:${isDark ? "#1a1a1a" : "#fff"};border-radius:16px;padding:24px;min-width:260px;max-width:320px;border:1px solid ${isDark ? "#2a2a2a" : "#e5e7eb"};box-shadow:${isDark ? "0 8px 24px #0008" : "0 8px 24px #0002"};display:flex;flex-direction:column;align-items:center;gap:16px`;
9951
10466
  var bigAvatarStyle = (baseColor, isDark) => `display:flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:${baseColor};box-shadow:${isDark ? "0 2px 8px #0004" : "0 2px 8px #0001"}`;
@@ -10029,20 +10544,20 @@ var UserProfilePopup = class extends LitElement9 {
10029
10544
  render() {
10030
10545
  const baseColor = avatarColor(this.authorId, this.isDark);
10031
10546
  const shortId = compactPublicKey(this.authorId);
10032
- return html10`
10547
+ return html11`
10033
10548
  <div style="${overlayStyle2}" @click="${this.onClose}">
10034
10549
  <div style="${popupStyle(this.isDark)}" @click="${(e) => e.stopPropagation()}">
10035
- ${this.authorAvatar ? html10`
10550
+ ${this.authorAvatar ? html11`
10036
10551
  <div style="${bigAvatarStyle(baseColor, this.isDark)}">
10037
10552
  <img src="${this.authorAvatar}" alt="${this.authorName}" style="${bigAvatarImgStyle}" />
10038
10553
  </div>
10039
- ` : html10`
10554
+ ` : html11`
10040
10555
  <div style="${bigAvatarStyle(baseColor, this.isDark)}">
10041
10556
  <span style="${bigInitialsStyle(baseColor, this.isDark)}">${(this.authorName ?? "").slice(0, 2).toUpperCase()}</span>
10042
10557
  </div>
10043
10558
  `}
10044
10559
  <div style="${nameStyle2(this.isDark)}">${this.authorName}</div>
10045
- ${this._alias ? html10`
10560
+ ${this._alias ? html11`
10046
10561
  <div style="${aliasStyle(this.isDark)}">@${this._alias}</div>
10047
10562
  ` : nothing5}
10048
10563
  <div style="${idRowStyle}">
@@ -10051,7 +10566,7 @@ var UserProfilePopup = class extends LitElement9 {
10051
10566
  ${this._copied ? "Copied!" : "Copy"}
10052
10567
  </button>
10053
10568
  </div>
10054
- ${this.onChatWith ? html10`
10569
+ ${this.onChatWith ? html11`
10055
10570
  <button type="button" style="${chatBtnStyle(this.isDark)}" @click="${this._handleChatWith}">
10056
10571
  Chat with ${this.authorName}
10057
10572
  </button>
@@ -10160,7 +10675,7 @@ var sidebarItemTypingStyle = (isDark) => `${sidebarItemPreviewRowStyle};font-wei
10160
10675
  var sidebarUnreadBadgeStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 5px;border-radius:9999px;font-size:11px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;flex-shrink:0;background:${isDark ? "#60a5fa" : "#2563eb"};color:${isDark ? "#0d1526" : "#ffffff"}`;
10161
10676
  var sidebarUnreadDotStyle = (isDark) => `display:inline-block;width:12px;height:12px;border-radius:9999px;flex-shrink:0;background:${isDark ? "#60a5fa" : "#2563eb"}`;
10162
10677
  var sidebarPinnedIndicatorStyle = (isDark) => `display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;color:${isDark ? "#9e988e" : "#625e56"}`;
10163
- var sidebarPinSvg = html11`
10678
+ var sidebarPinSvg = html12`
10164
10679
  <svg
10165
10680
  width="12"
10166
10681
  height="12"
@@ -10310,7 +10825,7 @@ var sidebarItemTitleStyle = (isDark, isSelected, customColors) => `font-size:13p
10310
10825
  var mobileBackButtonStyle = (isDark, customColors) => `position:absolute;top:10px;left:10px;z-index:90;display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:18px;background:${isDark ? "rgba(30,30,30,0.9)" : "rgba(255,255,255,0.9)"};color:${customColors?.text ?? (isDark ? "#f4f4f4" : "#111827")};border:1px solid ${isDark ? "#444" : "#e5e7eb"};box-shadow:0 2px 8px rgba(0,0,0,0.15);cursor:pointer;font-size:12px;font-weight:600;backdrop-filter:blur(4px)`;
10311
10826
  var mobileFullListStyle = (isDark, customColors) => `display:flex;flex-direction:column;width:100%;height:100%;min-height:0;background:${customColors?.background ?? (isDark ? "#111110" : "#f6f4ee")};font-family:sans-serif;box-sizing:border-box`;
10312
10827
  var mainChatContainerStyle = "display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;overflow:hidden;position:relative";
10313
- var chatsIconSvg = html11`
10828
+ var chatsIconSvg = html12`
10314
10829
  <svg
10315
10830
  width="14"
10316
10831
  height="14"
@@ -10324,7 +10839,7 @@ var chatsIconSvg = html11`
10324
10839
  <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
10325
10840
  </svg>
10326
10841
  `;
10327
- var notFoundHtml = (customColors, isDark) => html11`
10842
+ var notFoundHtml = (customColors, isDark) => html12`
10328
10843
  <div
10329
10844
  style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${customColors?.text ?? "#6b7280"};background:${customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
10330
10845
  >
@@ -10335,7 +10850,7 @@ var notFoundHtml = (customColors, isDark) => html11`
10335
10850
  <div style="font-size:0.9rem">This conversation does not exist.</div>
10336
10851
  </div>
10337
10852
  `;
10338
- var accessDeniedHtml = (onClose, customColors, isDark) => html11`
10853
+ var accessDeniedHtml = (onClose, customColors, isDark) => html12`
10339
10854
  <div
10340
10855
  style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${customColors?.text ?? "#6b7280"};background:${customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
10341
10856
  >
@@ -10346,7 +10861,7 @@ var accessDeniedHtml = (onClose, customColors, isDark) => html11`
10346
10861
  <div style="font-size:0.9rem">
10347
10862
  You do not have the encryption keys for this conversation.
10348
10863
  </div>
10349
- ${onClose ? html11`
10864
+ ${onClose ? html12`
10350
10865
  <button
10351
10866
  type="button"
10352
10867
  @click="${onClose}"
@@ -11508,7 +12023,7 @@ var ConnectedChat = class extends LitElement10 {
11508
12023
  };
11509
12024
  _renderConversationList(isDark) {
11510
12025
  if (!this._conversations) {
11511
- return html11`
12026
+ return html12`
11512
12027
  <div style="font-size:12px;color:${isDark ? "#888" : "#999"};padding:16px;text-align:center">
11513
12028
  Loading chats...
11514
12029
  </div>
@@ -11517,7 +12032,7 @@ var ConnectedChat = class extends LitElement10 {
11517
12032
  const myKey = this.credentials?.publicSignKey ?? "";
11518
12033
  const filtered = this._filteredConversations();
11519
12034
  if (empty(filtered)) {
11520
- return html11`
12035
+ return html12`
11521
12036
  <div style="font-size:12px;color:${isDark ? "#888" : "#999"};padding:16px;text-align:center">
11522
12037
  No chats found
11523
12038
  </div>
@@ -11550,7 +12065,7 @@ var ConnectedChat = class extends LitElement10 {
11550
12065
  }) : null;
11551
12066
  const timeLabel = preview?.empty ? "" : formatConversationTime(preview?.timestamp || conv.updatedAt);
11552
12067
  const isPinned = isConversationPinned(conv);
11553
- return html11`
12068
+ return html12`
11554
12069
  <div
11555
12070
  class="alice-sidebar-item"
11556
12071
  data-conversation-id="${conv.id}"
@@ -11567,7 +12082,7 @@ var ConnectedChat = class extends LitElement10 {
11567
12082
  ></chat-avatar>
11568
12083
  <div style="${sidebarItemBodyStyle}">
11569
12084
  <div style="${sidebarItemTopRowStyle}">
11570
- ${this._editingSidebarConvId === conv.id ? html11`
12085
+ ${this._editingSidebarConvId === conv.id ? html12`
11571
12086
  <input
11572
12087
  type="text"
11573
12088
  data-testid="sidebar-rename-input"
@@ -11580,11 +12095,11 @@ var ConnectedChat = class extends LitElement10 {
11580
12095
  @keydown="${this._onSidebarRenameKeydown}"
11581
12096
  @blur="${this._commitSidebarRename}"
11582
12097
  />
11583
- ` : html11`
12098
+ ` : html12`
11584
12099
  <div style="${sidebarItemTitleStyle(isDark, isSelected, this.customColors)}">
11585
12100
  ${displayName}
11586
12101
  </div>
11587
- `} ${timeLabel && this._editingSidebarConvId !== conv.id ? html11`
12102
+ `} ${timeLabel && this._editingSidebarConvId !== conv.id ? html12`
11588
12103
  <span style="${sidebarItemTimeStyle(isDark)}">${timeLabel}</span>
11589
12104
  ` : nothing6}
11590
12105
  </div>
@@ -11597,20 +12112,20 @@ var ConnectedChat = class extends LitElement10 {
11597
12112
  </div>
11598
12113
  <span
11599
12114
  style="display:inline-flex;align-items:center;gap:6px;flex-shrink:0">
11600
- ${isPinned ? html11`
12115
+ ${isPinned ? html12`
11601
12116
  <span
11602
12117
  data-testid="conversation-pin-indicator"
11603
12118
  aria-label="Pinned"
11604
12119
  style="${sidebarPinnedIndicatorStyle(isDark)}"
11605
12120
  >${sidebarPinSvg}</span>
11606
12121
  ` : nothing6}
11607
- ${unread.isUnread ? unreadLabel ? html11`
12122
+ ${unread.isUnread ? unreadLabel ? html12`
11608
12123
  <span
11609
12124
  data-testid="conversation-unread-badge"
11610
12125
  aria-label="${unread.count === 1 ? "1 unread message" : `${unreadLabel} unread messages`}"
11611
12126
  style="${sidebarUnreadBadgeStyle(isDark)}"
11612
12127
  >${unreadLabel}</span>
11613
- ` : html11`
12128
+ ` : html12`
11614
12129
  <span
11615
12130
  data-testid="conversation-unread-badge"
11616
12131
  data-unread-dot
@@ -11640,7 +12155,7 @@ var ConnectedChat = class extends LitElement10 {
11640
12155
  _renderChatContent(isDark) {
11641
12156
  const targetId = this._activeConversationId || this.conversationId;
11642
12157
  if (!targetId) {
11643
- return html11`
12158
+ return html12`
11644
12159
  <div
11645
12160
  style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;width:100%;color:${this.customColors?.text ?? (isDark ? "#888" : "#999")};background:${this.customColors?.background ?? (isDark ? "#111" : "#f9fafb")};font-family:sans-serif"
11646
12161
  >
@@ -11656,7 +12171,7 @@ var ConnectedChat = class extends LitElement10 {
11656
12171
  }
11657
12172
  const { chatMessages, activeSpinners, activeProgress, activeStreams } = this._processMessages();
11658
12173
  const isLoadingMessages = !this._messages || !this._hasFreshMessages && this._isSyncingMessages;
11659
- return html11`
12174
+ return html12`
11660
12175
  <chat-box
11661
12176
  .messages="${chatMessages}"
11662
12177
  .participants="${this._participants.map((p) => ({
@@ -11723,8 +12238,8 @@ var ConnectedChat = class extends LitElement10 {
11723
12238
  return nothing6;
11724
12239
  }
11725
12240
  const isDark = this._effectiveDark;
11726
- const renderPopups = () => html11`
11727
- ${this._profileAuthorId ? html11`
12241
+ const renderPopups = () => html12`
12242
+ ${this._profileAuthorId ? html12`
11728
12243
  <user-profile-popup
11729
12244
  .authorId="${this._profileAuthorId}"
11730
12245
  .authorName="${resolveName(this._identityDetails)(this._profileAuthorId)}"
@@ -11733,7 +12248,7 @@ var ConnectedChat = class extends LitElement10 {
11733
12248
  .onClose="${this._closeProfile}"
11734
12249
  .onChatWith="${this.onChatWith ?? (this.enableChatSwitching ? this._handleChatWith : void 0)}"
11735
12250
  ></user-profile-popup>
11736
- ` : nothing6} ${this._showParticipantsPopup ? html11`
12251
+ ` : nothing6} ${this._showParticipantsPopup ? html12`
11737
12252
  <div style="${participantsOverlayStyle}" @click="${this._handleCloseParticipants}">
11738
12253
  <div style="${participantsPopupStyle(isDark)}" @click="${(e) => e.stopPropagation()}">
11739
12254
  <h3 style="${popupTitleStyle(isDark)}">Participants</h3>
@@ -11743,7 +12258,7 @@ var ConnectedChat = class extends LitElement10 {
11743
12258
  const avatar = resolveParticipantAvatar(p, this._identityDetails);
11744
12259
  const baseColor = avatarColor(p.publicSignKey, isDark);
11745
12260
  const isCopied = this._copiedParticipantId === p.publicSignKey;
11746
- return html11`
12261
+ return html12`
11747
12262
  <div
11748
12263
  style="${participantRowStyle(isDark)}"
11749
12264
  @click="${() => this._handleParticipantClick(p.publicSignKey)}"
@@ -11788,7 +12303,7 @@ var ConnectedChat = class extends LitElement10 {
11788
12303
  </button>
11789
12304
  </div>
11790
12305
  </div>
11791
- ` : nothing6} ${this._showSecretIdentityPopup && this.credentials ? html11`
12306
+ ` : nothing6} ${this._showSecretIdentityPopup && this.credentials ? html12`
11792
12307
  <div style="${participantsOverlayStyle}" @click="${() => {
11793
12308
  this._showSecretIdentityPopup = false;
11794
12309
  this.requestUpdate();
@@ -11802,13 +12317,13 @@ var ConnectedChat = class extends LitElement10 {
11802
12317
  <div
11803
12318
  style="display:flex;justify-content:center;align-items:center;width:200px;height:200px;background:#ffffff;border-radius:8px;padding:8px;margin: 0 auto;"
11804
12319
  >
11805
- ${this._qrCodeDataUrl ? html11`
12320
+ ${this._qrCodeDataUrl ? html12`
11806
12321
  <img
11807
12322
  src="${this._qrCodeDataUrl}"
11808
12323
  alt="Export Identity QR Code"
11809
12324
  style="width:100%;height:100%"
11810
12325
  />
11811
- ` : html11`
12326
+ ` : html12`
11812
12327
  <div style="color:#000000;font-size:14px">Generating...</div>
11813
12328
  `}
11814
12329
  </div>
@@ -11836,7 +12351,7 @@ var ConnectedChat = class extends LitElement10 {
11836
12351
  </div>
11837
12352
  </div>
11838
12353
  </div>
11839
- ` : nothing6} ${this._showImportIdentityPopup ? html11`
12354
+ ` : nothing6} ${this._showImportIdentityPopup ? html12`
11840
12355
  <div style="${participantsOverlayStyle}" @click="${() => {
11841
12356
  this._showImportIdentityPopup = false;
11842
12357
  this.requestUpdate();
@@ -11880,12 +12395,12 @@ var ConnectedChat = class extends LitElement10 {
11880
12395
  ` : nothing6}
11881
12396
  `;
11882
12397
  if (!this.enableChatSwitching) {
11883
- return html11`
12398
+ return html12`
11884
12399
  ${this._renderChatContent(isDark)} ${renderPopups()}
11885
12400
  `;
11886
12401
  }
11887
12402
  if (this._isMobile && this._mobileShowList) {
11888
- return html11`
12403
+ return html12`
11889
12404
  <style>${sidebarHoverStyles}</style>
11890
12405
  <div style="${mobileFullListStyle(isDark, this.customColors)}">
11891
12406
  <div style="${sidebarHeaderStyle(isDark)}">
@@ -11908,7 +12423,7 @@ var ConnectedChat = class extends LitElement10 {
11908
12423
  `;
11909
12424
  }
11910
12425
  if (this._isMobile && !this._mobileShowList) {
11911
- return html11`
12426
+ return html12`
11912
12427
  <div style="${mainChatContainerStyle}">
11913
12428
  <button
11914
12429
  type="button"
@@ -11927,7 +12442,7 @@ var ConnectedChat = class extends LitElement10 {
11927
12442
  ${renderPopups()}
11928
12443
  `;
11929
12444
  }
11930
- return html11`
12445
+ return html12`
11931
12446
  <style>${sidebarHoverStyles}</style>
11932
12447
  <div style="${chatSwitcherContainerStyle}">
11933
12448
  <div
@@ -12735,7 +13250,7 @@ import { createComponent } from "@lit/react";
12735
13250
  import React from "react";
12736
13251
 
12737
13252
  // canvas/canvas-view.ts
12738
- import { html as html12, LitElement as LitElement11, nothing as nothing7 } from "lit";
13253
+ import { html as html13, LitElement as LitElement11, nothing as nothing7 } from "lit";
12739
13254
  var toastLifetimeMs = 5e3;
12740
13255
  var canvasViewCss = (isDark) => `
12741
13256
  .canvas-view {
@@ -12929,7 +13444,7 @@ var sanitizeCanvasClassName = (raw) => (raw ?? "").split(/\s+/).filter((token) =
12929
13444
  var isExternalCanvasHref = (href) => href.startsWith("https://") || href.startsWith("http://");
12930
13445
  var renderNode = (node, onAction) => {
12931
13446
  if (typeof node === "string" || typeof node === "number") {
12932
- return html12`${node}`;
13447
+ return html13`${node}`;
12933
13448
  }
12934
13449
  const tag = node.tag.toLowerCase();
12935
13450
  if (!isRenderableTag(tag)) return nothing7;
@@ -12944,25 +13459,25 @@ var renderNode = (node, onAction) => {
12944
13459
  onAction(node.on.submit, collectFields(e.currentTarget));
12945
13460
  } : void 0;
12946
13461
  if (tag === "button") {
12947
- return html12`
13462
+ return html13`
12948
13463
  <button dir="auto" class="canvas-el ${className}" type="button"
12949
13464
  @click=${clickHandler}>${node.text ?? nothing7}${children}</button>
12950
13465
  `;
12951
13466
  }
12952
13467
  if (tag === "form") {
12953
- return html12`
13468
+ return html13`
12954
13469
  <form dir="auto" class="canvas-el ${className}"
12955
13470
  @submit=${submitHandler}>${node.text ?? nothing7}${children}</form>
12956
13471
  `;
12957
13472
  }
12958
13473
  if (tag === "input") {
12959
- return html12`
13474
+ return html13`
12960
13475
  <input dir="auto" class="canvas-el ${className}" name=${node.attrs?.name ?? nothing7}
12961
13476
  placeholder=${node.attrs?.placeholder ?? nothing7} .value=${node.attrs?.value ?? ""} />
12962
13477
  `;
12963
13478
  }
12964
13479
  if (tag === "textarea") {
12965
- return html12`
13480
+ return html13`
12966
13481
  <textarea dir="auto" class="canvas-el ${className}" name=${node.attrs?.name ?? nothing7}
12967
13482
  placeholder=${node.attrs?.placeholder ?? nothing7}>${node.text ?? ""}</textarea>
12968
13483
  `;
@@ -12970,7 +13485,7 @@ var renderNode = (node, onAction) => {
12970
13485
  if (tag === "a") {
12971
13486
  const safeHref = sanitizeViewUrl(node.attrs?.href, "#");
12972
13487
  const external = isExternalCanvasHref(safeHref);
12973
- return html12`
13488
+ return html13`
12974
13489
  <a dir="auto" class="canvas-el ${className}" href=${safeHref}
12975
13490
  target=${external ? "_blank" : nothing7}
12976
13491
  rel=${external ? "noopener noreferrer" : nothing7}
@@ -12978,75 +13493,75 @@ var renderNode = (node, onAction) => {
12978
13493
  `;
12979
13494
  }
12980
13495
  if (tag === "img") {
12981
- return html12`<img class="canvas-el ${className}" src=${sanitizeViewUrl(node.attrs?.src, "")} alt=${node.attrs?.alt ?? ""} />`;
13496
+ return html13`<img class="canvas-el ${className}" src=${sanitizeViewUrl(node.attrs?.src, "")} alt=${node.attrs?.alt ?? ""} />`;
12982
13497
  }
12983
13498
  if (tag === "label") {
12984
- return html12`
13499
+ return html13`
12985
13500
  <label dir="auto" class="canvas-el ${className}"
12986
13501
  for=${node.attrs?.for ?? nothing7}>${node.text ?? nothing7}${children}</label>
12987
13502
  `;
12988
13503
  }
12989
13504
  if (tag === "h1") {
12990
- return html12`<h1 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h1>`;
13505
+ return html13`<h1 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h1>`;
12991
13506
  }
12992
13507
  if (tag === "h2") {
12993
- return html12`<h2 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h2>`;
13508
+ return html13`<h2 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h2>`;
12994
13509
  }
12995
13510
  if (tag === "h3") {
12996
- return html12`<h3 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h3>`;
13511
+ return html13`<h3 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h3>`;
12997
13512
  }
12998
13513
  if (tag === "h4") {
12999
- return html12`<h4 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h4>`;
13514
+ return html13`<h4 dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</h4>`;
13000
13515
  }
13001
13516
  if (tag === "p") {
13002
- return html12`<p dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</p>`;
13517
+ return html13`<p dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</p>`;
13003
13518
  }
13004
13519
  if (tag === "span") {
13005
- return html12`<span dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</span>`;
13520
+ return html13`<span dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</span>`;
13006
13521
  }
13007
13522
  if (tag === "strong") {
13008
- return html12`<strong dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</strong>`;
13523
+ return html13`<strong dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</strong>`;
13009
13524
  }
13010
13525
  if (tag === "em") {
13011
- return html12`<em dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</em>`;
13526
+ return html13`<em dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</em>`;
13012
13527
  }
13013
13528
  if (tag === "small") {
13014
- return html12`<small dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</small>`;
13529
+ return html13`<small dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</small>`;
13015
13530
  }
13016
13531
  if (tag === "ul") {
13017
- return html12`<ul dir="auto" class="canvas-el ${className}">${children}</ul>`;
13532
+ return html13`<ul dir="auto" class="canvas-el ${className}">${children}</ul>`;
13018
13533
  }
13019
13534
  if (tag === "li") {
13020
- return html12`<li dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</li>`;
13535
+ return html13`<li dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</li>`;
13021
13536
  }
13022
13537
  if (tag === "code") {
13023
- return html12`<code dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</code>`;
13538
+ return html13`<code dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</code>`;
13024
13539
  }
13025
13540
  if (tag === "pre") {
13026
- return html12`<pre dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</pre>`;
13541
+ return html13`<pre dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</pre>`;
13027
13542
  }
13028
13543
  if (tag === "blockquote") {
13029
- return html12`
13544
+ return html13`
13030
13545
  <blockquote dir="auto"
13031
13546
  class="canvas-el ${className}">${node.text ?? nothing7}${children}</blockquote>
13032
13547
  `;
13033
13548
  }
13034
13549
  if (tag === "section") {
13035
- return html12`<section dir="auto" class="canvas-el ${className}">${children}</section>`;
13550
+ return html13`<section dir="auto" class="canvas-el ${className}">${children}</section>`;
13036
13551
  }
13037
13552
  if (tag === "header") {
13038
- return html12`<header dir="auto" class="canvas-el ${className}">${children}</header>`;
13553
+ return html13`<header dir="auto" class="canvas-el ${className}">${children}</header>`;
13039
13554
  }
13040
13555
  if (tag === "footer") {
13041
- return html12`<footer dir="auto" class="canvas-el ${className}">${children}</footer>`;
13556
+ return html13`<footer dir="auto" class="canvas-el ${className}">${children}</footer>`;
13042
13557
  }
13043
13558
  if (tag === "nav") {
13044
- return html12`<nav dir="auto" class="canvas-el ${className}">${children}</nav>`;
13559
+ return html13`<nav dir="auto" class="canvas-el ${className}">${children}</nav>`;
13045
13560
  }
13046
13561
  if (tag === "main") {
13047
- return html12`<main dir="auto" class="canvas-el ${className}">${children}</main>`;
13562
+ return html13`<main dir="auto" class="canvas-el ${className}">${children}</main>`;
13048
13563
  }
13049
- return html12`<div dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</div>`;
13564
+ return html13`<div dir="auto" class="canvas-el ${className}">${node.text ?? nothing7}${children}</div>`;
13050
13565
  };
13051
13566
  var problemText = (problems) => problems.map((problem) => `${problem.stage}: ${problem.message}`).join("\n\n");
13052
13567
  var messageToast = (text, authorName) => authorName ? `${authorName}: ${text}` : text;
@@ -13253,22 +13768,22 @@ var CanvasView = class extends LitElement11 {
13253
13768
  }
13254
13769
  render() {
13255
13770
  const onAction = (action, fields) => this._act(action, fields);
13256
- return html12`
13771
+ return html13`
13257
13772
  <style>${canvasViewCss(this.isDark)}</style>
13258
13773
  <div class="canvas-view">
13259
- ${this._toasts.length === 0 ? nothing7 : html12`
13774
+ ${this._toasts.length === 0 ? nothing7 : html13`
13260
13775
  <div class="canvas-view-toasts">
13261
- ${this._toasts.map((toast) => html12`
13776
+ ${this._toasts.map((toast) => html13`
13262
13777
  <div class="canvas-view-toast" .dataId=${toast.id}>${toast.text}</div>
13263
13778
  `)}
13264
13779
  </div>
13265
13780
  `}
13266
- ${this._problems.length === 0 ? nothing7 : html12`
13781
+ ${this._problems.length === 0 ? nothing7 : html13`
13267
13782
  <div class="canvas-view-error">${problemText(this._problems)}</div>
13268
13783
  `}
13269
- ${this._view ? html12`<div class="canvas-view-body">
13784
+ ${this._view ? html13`<div class="canvas-view-body">
13270
13785
  ${renderNode(this._view, onAction)}
13271
- </div>` : html12`<div class="canvas-view-empty">${this.emptyMessage}</div>`}
13786
+ </div>` : html13`<div class="canvas-view-empty">${this.emptyMessage}</div>`}
13272
13787
  </div>
13273
13788
  `;
13274
13789
  }