@gamention/pulse-elements 0.1.17 → 0.1.18

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.
@@ -2859,7 +2859,7 @@
2859
2859
  height: 32px;
2860
2860
  }
2861
2861
  }
2862
- `];j([x({attribute:!1})],R.prototype,"client",2);j([x({type:Boolean})],R.prototype,"collapsed",2);j([x()],R.prototype,"activePanel",2);j([x({type:Boolean})],R.prototype,"pinModeActive",2);j([x({type:Boolean})],R.prototype,"featuresDisabled",2);j([x({type:Boolean})],R.prototype,"drawModeActive",2);j([x()],R.prototype,"followingUserId",2);j([x()],R.prototype,"display",2);j([$()],R.prototype,"users",2);j([$()],R.prototype,"unreadCount",2);R=j([L("pulse-widget-toolbar")],R);class vs{constructor(e){this.container=null,this.unsubs=[],this.enabled=!1,this.pillEls=new Map,this.client=e}enable(){this.enabled||(this.enabled=!0,this.container=document.createElement("div"),this.container.id="pulse-widget-viewports",Object.assign(this.container.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"9996"}),document.body.appendChild(this.container),this.unsubs.push(this.client.state.on("viewport",()=>{this.render()})),this.unsubs.push(this.client.state.on("presence",()=>{this.render()})),this.render())}disable(){var e;this.enabled&&(this.enabled=!1,this.unsubs.forEach(t=>t()),this.unsubs=[],(e=this.container)==null||e.remove(),this.container=null,this.pillEls.clear())}destroy(){this.disable()}render(){var r;if(!this.container)return;if(document.documentElement.scrollHeight<=window.innerHeight){for(const a of this.pillEls.values())a.remove();this.pillEls.clear();return}const e=window.scrollY,t=window.innerHeight,i=document.documentElement.scrollHeight,s=(r=this.client.state.user)==null?void 0:r.id,n=new Set;for(const[a,l]of this.client.state.viewports){if(a===s)continue;const d=l.scrollY,c=l.scrollY+l.viewportHeight,h=e,p=e+t;if(d>=h&&c<=p){const k=this.pillEls.get(a);k&&(k.style.display="none");continue}n.add(a);const m=this.client.state.presence.find(k=>k.user.id===a);if(!m)continue;const g=l.scrollY+l.viewportHeight/2,y=i>0?g/i:0,b=Math.max(8,Math.min(t-28,y*t));let w=this.pillEls.get(a);w||(w=document.createElement("div"),Object.assign(w.style,{position:"absolute",right:"8px",padding:"2px 6px",borderRadius:"10px",fontSize:"10px",fontWeight:"700",color:"#fff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",whiteSpace:"nowrap",pointerEvents:"none",transition:"top 0.3s ease"}),this.container.appendChild(w),this.pillEls.set(a,w)),w.style.display="",w.style.background=m.user.color,w.style.top=`${b}px`,w.textContent=this.getInitials(m.user.name)}for(const[a,l]of this.pillEls)!n.has(a)&&!this.client.state.viewports.has(a)&&(l.remove(),this.pillEls.delete(a))}getInitials(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}}var bs=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var s=i>1?void 0:i?xs(e,t):e,n=o.length-1,r;n>=0;n--)(r=o[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&bs(e,t,s),s};exports.PulseWidget=class extends T{constructor(){super(...arguments),this.apiKey="",this.token="",this.room="",this.position="bottom-right",this.display="floating",this.collapsed=!0,this.activePanel=null,this.pinModeActive=!1,this.highlightThreadId=null,this.settings={...me},this.followingUserId=null,this.drawModeActive=!1,this.connectionState="disconnected",this.showConnectedFlash=!1,this.unsubs=[],this.clientConfigKey="",this._isFollowScrolling=!1,this._viewportThrottleTimer=null,this._selectionThrottleTimer=null,this._connectedFlashTimer=null,this._wasDisconnected=!1,this.handleScroll=()=>{!this.settings.enabled||!this.client||this._isFollowScrolling||(this.followingUserId&&(this.followingUserId=null),!this._viewportThrottleTimer&&(this._viewportThrottleTimer=setTimeout(()=>{var e;this._viewportThrottleTimer=null,(e=this.client)==null||e.updateViewport({scrollX:window.scrollX,scrollY:window.scrollY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,pageWidth:document.documentElement.scrollWidth,pageHeight:document.documentElement.scrollHeight})},200)))},this.handleSelectionChange=()=>{!this.settings.enabled||!this.settings.showSelections||!this.client||this._selectionThrottleTimer||(this._selectionThrottleTimer=setTimeout(()=>{var i,s;this._selectionThrottleTimer=null;const e=window.getSelection();if(!e||e.isCollapsed){(i=this.client)==null||i.updateSelection(null);return}const t=ls(e);(s=this.client)==null||s.updateSelection(t)},500))},this.handleDocumentClick=e=>{var t;this.settings.enabled&&this.settings.showMyClicks&&(this.contains(e.target)||(t=this.client)==null||t.performClick({x:e.clientX,y:e.clientY,pageX:e.pageX,pageY:e.pageY}))},this.handleKeydown=e=>{var t,i;e.key==="Escape"&&(this.drawModeActive?((t=this.drawingOverlay)==null||t.disableDrawMode(),this.drawModeActive=!1):this.followingUserId?this.followingUserId=null:this.pinModeActive?((i=this.commentPins)==null||i.exitPinMode(),this.pinModeActive=!1):this.activePanel&&(this.activePanel=null,this.highlightThreadId=null))}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("pointerup",this.handleDocumentClick),this.apiKey&&this.token&&this.room&&this.initClient()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("pointerup",this.handleDocumentClick),this.teardownClient()}getConfigKey(){return`${this.apiKey}\0${this.token}\0${this.room}\0${this.endpoint??""}`}initClient(){const e={apiKey:this.apiKey,token:this.token,room:this.room,endpoint:this.endpoint};this.client=new mt(e),this.clientConfigKey=this.getConfigKey(),this.cursorOverlay=new rs(this.client),this.commentPins=new Ji(this.client,{onPinModeExit:()=>{this.pinModeActive=!1}}),this.viewportOverlay=new vs(this.client),this.selectionOverlay=new ds(this.client),this.drawingOverlay=new as(this.client),this.settings=us(this.room),this.applySettings(this.settings),this.unsubs.push(this.client.on("connection",t=>{this.connectionState=t,t==="connected"&&this._wasDisconnected?(this.showConnectedFlash=!0,this._connectedFlashTimer&&clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=setTimeout(()=>{this.showConnectedFlash=!1,this._connectedFlashTimer=null},2e3),this._wasDisconnected=!1):(t==="connecting"||t==="disconnected")&&(this._wasDisconnected=!0,this.showConnectedFlash=!1,this._connectedFlashTimer&&(clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=null))})),this.unsubs.push(this.client.state.on("click",({userId:t,position:i})=>{var s;this.settings.showOthersClicks&&((s=this.cursorOverlay)!=null&&s.isEnabled)&&this.cursorOverlay.showClickRipple(t,i)})),this.unsubs.push(this.client.state.on("viewport",({userId:t})=>{if(this.followingUserId===t){const i=this.client.state.getViewport(t);i&&(this._isFollowScrolling=!0,window.scrollTo({top:i.scrollY,left:i.scrollX,behavior:"smooth"}),setTimeout(()=>{this._isFollowScrolling=!1},500))}})),window.addEventListener("scroll",this.handleScroll),document.addEventListener("selectionchange",this.handleSelectionChange),this.client.connect()}teardownClient(){var e,t,i,s,n,r;this.unsubs.forEach(a=>a()),this.unsubs=[],window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("selectionchange",this.handleSelectionChange),this._viewportThrottleTimer&&(clearTimeout(this._viewportThrottleTimer),this._viewportThrottleTimer=null),this._selectionThrottleTimer&&(clearTimeout(this._selectionThrottleTimer),this._selectionThrottleTimer=null),(e=this.cursorOverlay)==null||e.destroy(),(t=this.commentPins)==null||t.destroy(),(i=this.viewportOverlay)==null||i.destroy(),(s=this.selectionOverlay)==null||s.destroy(),(n=this.drawingOverlay)==null||n.destroy(),(r=this.client)==null||r.disconnect(),this.client=void 0,this.cursorOverlay=void 0,this.commentPins=void 0,this.viewportOverlay=void 0,this.selectionOverlay=void 0,this.drawingOverlay=void 0,this.clientConfigKey="",this.followingUserId=null,this.drawModeActive=!1,this.connectionState="disconnected",this.showConnectedFlash=!1,this._wasDisconnected=!1,this._connectedFlashTimer&&(clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=null)}handlePanelClose(){this.activePanel=null,this.highlightThreadId=null}handleToolbarAction(e){var i,s,n,r;const t=e.detail;if(!(!this.settings.enabled&&t!=="settings"))switch(t){case"comments":this.activePanel=this.activePanel==="comments"?null:"comments",this.highlightThreadId=null;break;case"settings":this.activePanel=this.activePanel==="settings"?null:"settings";break;case"notifications":this.activePanel=this.activePanel==="notifications"?null:"notifications";break;case"activity":this.activePanel=this.activePanel==="activity"?null:"activity";break;case"pin-mode":this.pinModeActive=!this.pinModeActive,this.pinModeActive?(i=this.commentPins)==null||i.enterPinMode():(s=this.commentPins)==null||s.exitPinMode();break;case"draw-mode":this.drawModeActive=!this.drawModeActive,this.drawModeActive?(n=this.drawingOverlay)==null||n.enableDrawMode():(r=this.drawingOverlay)==null||r.disableDrawMode();break}}handleFollow(e){const t=e.detail;this.followingUserId===t?this.followingUserId=null:this.followingUserId=t}handleSettingsChange(e){const t=e.detail;this.settings=t,fs(this.room,t),this.applySettings(t)}applySettings(e){var t,i,s,n,r,a,l,d,c,h,p,m,g,y,b,w,k;if(!e.enabled){(t=this.cursorOverlay)==null||t.disable(),(i=this.viewportOverlay)==null||i.disable(),(s=this.selectionOverlay)==null||s.disable(),(n=this.drawingOverlay)==null||n.disable(),this.drawModeActive&&((r=this.drawingOverlay)==null||r.disableDrawMode(),this.drawModeActive=!1),(a=this.client)==null||a.setAppearOffline(!0),(l=this.commentPins)==null||l.setVisible(!1),this.followingUserId=null,this.pinModeActive&&((d=this.commentPins)==null||d.exitPinMode(),this.pinModeActive=!1),this.activePanel=this.activePanel==="settings"?"settings":null,this.highlightThreadId=null;return}this.applyCursorSettings(e),(c=this.client)==null||c.setAppearOffline(e.appearOffline),(h=this.commentPins)==null||h.setVisible(e.showCommentPins),e.showViewportIndicators?(p=this.viewportOverlay)==null||p.enable():(m=this.viewportOverlay)==null||m.disable(),e.showSelections?(g=this.selectionOverlay)==null||g.enable():(y=this.selectionOverlay)==null||y.disable(),e.showDrawings?(b=this.drawingOverlay)==null||b.enable():((w=this.drawingOverlay)==null||w.disable(),this.drawModeActive&&((k=this.drawingOverlay)==null||k.disableDrawMode(),this.drawModeActive=!1))}applyCursorSettings(e){if(!this.cursorOverlay)return;e.showMyCursor||e.showOthersCursors?(this.cursorOverlay.enable(),this.cursorOverlay.setSending(e.showMyCursor),this.cursorOverlay.setReceiving(e.showOthersCursors)):this.cursorOverlay.disable()}updated(e){(e.has("room")||e.has("token")||e.has("apiKey")||e.has("endpoint"))&&this.apiKey&&this.token&&this.room&&this.getConfigKey()!==this.clientConfigKey&&(this.teardownClient(),this.initClient(),this.activePanel=null,this.highlightThreadId=null,this.pinModeActive=!1),(e.has("activePanel")||e.has("collapsed"))&&requestAnimationFrame(()=>this.positionPopups())}positionPopups(){var y,b,w,k;const e=this.display==="inline",t=(y=this.shadowRoot)==null?void 0:y.querySelector(".inline-trigger"),i=(b=this.shadowRoot)==null?void 0:b.querySelector("pulse-widget-toolbar"),s=e?t:i;if(!s)return;const n=s.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,l=8,d=(w=this.shadowRoot)==null?void 0:w.querySelector(".toolbar-popover");if(d){Object.assign(d.style,{top:"auto",left:"auto"});const _=d.getBoundingClientRect(),M=this.computePosition(n,_,r,a,l);d.style.top=`${M.top}px`,d.style.left=`${M.left}px`}const c=(k=this.shadowRoot)==null?void 0:k.querySelector(".panel-container");if(!c)return;Object.assign(c.style,{top:"auto",left:"auto"});const h=d??i;if(!h)return;const p=h.getBoundingClientRect(),m=c.getBoundingClientRect(),g=this.computePosition(p,m,r,a,l);c.style.top=`${g.top}px`,c.style.left=`${g.left}px`}computePosition(e,t,i,s,n){const r=e.top,a=s-e.bottom;let l;r>=t.height+n?l=e.top-t.height-n:a>=t.height+n?l=e.bottom+n:l=r>=a?Math.max(n,e.top-t.height-n):e.bottom+n;let d;const c=e.right-t.width;return c>=n?d=c:e.left+t.width+n<=i?d=e.left:d=Math.max(n,Math.min(i-t.width-n,e.left)),l=Math.max(n,Math.min(s-t.height-n,l)),d=Math.max(n,Math.min(i-t.width-n,d)),{top:l,left:d}}getFollowUserName(){var t;if(!this.followingUserId)return"";const e=(t=this.client)==null?void 0:t.state.presence.find(i=>i.user.id===this.followingUserId);return(e==null?void 0:e.user.name)??"user"}renderConnectionBanner(){return this.showConnectedFlash?u`<div class="connection-banner connected">
2862
+ `];j([x({attribute:!1})],R.prototype,"client",2);j([x({type:Boolean})],R.prototype,"collapsed",2);j([x()],R.prototype,"activePanel",2);j([x({type:Boolean})],R.prototype,"pinModeActive",2);j([x({type:Boolean})],R.prototype,"featuresDisabled",2);j([x({type:Boolean})],R.prototype,"drawModeActive",2);j([x()],R.prototype,"followingUserId",2);j([x()],R.prototype,"display",2);j([$()],R.prototype,"users",2);j([$()],R.prototype,"unreadCount",2);R=j([L("pulse-widget-toolbar")],R);class vs{constructor(e){this.container=null,this.unsubs=[],this.enabled=!1,this.pillEls=new Map,this.client=e}enable(){this.enabled||(this.enabled=!0,this.container=document.createElement("div"),this.container.id="pulse-widget-viewports",Object.assign(this.container.style,{position:"fixed",top:"0",left:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"9996"}),document.body.appendChild(this.container),this.unsubs.push(this.client.state.on("viewport",()=>{this.render()})),this.unsubs.push(this.client.state.on("presence",()=>{this.render()})),this.render())}disable(){var e;this.enabled&&(this.enabled=!1,this.unsubs.forEach(t=>t()),this.unsubs=[],(e=this.container)==null||e.remove(),this.container=null,this.pillEls.clear())}destroy(){this.disable()}render(){var r;if(!this.container)return;if(document.documentElement.scrollHeight<=window.innerHeight){for(const a of this.pillEls.values())a.remove();this.pillEls.clear();return}const e=window.scrollY,t=window.innerHeight,i=document.documentElement.scrollHeight,s=(r=this.client.state.user)==null?void 0:r.id,n=new Set;for(const[a,l]of this.client.state.viewports){if(a===s)continue;const d=l.scrollY,c=l.scrollY+l.viewportHeight,h=e,p=e+t;if(d>=h&&c<=p){const k=this.pillEls.get(a);k&&(k.style.display="none");continue}n.add(a);const m=this.client.state.presence.find(k=>k.user.id===a);if(!m)continue;const g=l.scrollY+l.viewportHeight/2,y=i>0?g/i:0,b=Math.max(8,Math.min(t-28,y*t));let w=this.pillEls.get(a);w||(w=document.createElement("div"),Object.assign(w.style,{position:"absolute",right:"8px",padding:"2px 6px",borderRadius:"10px",fontSize:"10px",fontWeight:"700",color:"#fff",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",whiteSpace:"nowrap",pointerEvents:"none",transition:"top 0.3s ease"}),this.container.appendChild(w),this.pillEls.set(a,w)),w.style.display="",w.style.background=m.user.color,w.style.top=`${b}px`,w.textContent=this.getInitials(m.user.name)}for(const[a,l]of this.pillEls)!n.has(a)&&!this.client.state.viewports.has(a)&&(l.remove(),this.pillEls.delete(a))}getInitials(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2)}}var bs=Object.defineProperty,xs=Object.getOwnPropertyDescriptor,A=(o,e,t,i)=>{for(var s=i>1?void 0:i?xs(e,t):e,n=o.length-1,r;n>=0;n--)(r=o[n])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&bs(e,t,s),s};exports.PulseWidget=class extends T{constructor(){super(...arguments),this.apiKey="",this.token="",this.room="",this.position="bottom-right",this.display="floating",this.collapsed=!0,this.activePanel=null,this.pinModeActive=!1,this.highlightThreadId=null,this.settings={...me},this.followingUserId=null,this.drawModeActive=!1,this.connectionState="disconnected",this.showConnectedFlash=!1,this.unsubs=[],this.clientConfigKey="",this._isFollowScrolling=!1,this._viewportThrottleTimer=null,this._selectionThrottleTimer=null,this._connectedFlashTimer=null,this._wasDisconnected=!1,this.handleScroll=()=>{!this.settings.enabled||!this.client||this._isFollowScrolling||(this.followingUserId&&(this.followingUserId=null),!this._viewportThrottleTimer&&(this._viewportThrottleTimer=setTimeout(()=>{var e;this._viewportThrottleTimer=null,(e=this.client)==null||e.updateViewport({scrollX:window.scrollX,scrollY:window.scrollY,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,pageWidth:document.documentElement.scrollWidth,pageHeight:document.documentElement.scrollHeight})},200)))},this.handleSelectionChange=()=>{!this.settings.enabled||!this.settings.showSelections||!this.client||this._selectionThrottleTimer||(this._selectionThrottleTimer=setTimeout(()=>{var i,s;this._selectionThrottleTimer=null;const e=window.getSelection();if(!e||e.isCollapsed){(i=this.client)==null||i.updateSelection(null);return}const t=ls(e);(s=this.client)==null||s.updateSelection(t)},500))},this.handleDocumentClick=e=>{var t;this.settings.enabled&&this.settings.showMyClicks&&(this.contains(e.target)||(t=this.client)==null||t.performClick({x:e.clientX,y:e.clientY,pageX:e.pageX,pageY:e.pageY}))},this.handleKeydown=e=>{var t,i;e.key==="Escape"&&(this.drawModeActive?((t=this.drawingOverlay)==null||t.disableDrawMode(),this.drawModeActive=!1):this.followingUserId?this.followingUserId=null:this.pinModeActive?((i=this.commentPins)==null||i.exitPinMode(),this.pinModeActive=!1):this.activePanel&&(this.activePanel=null,this.highlightThreadId=null))}}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.handleKeydown),document.addEventListener("pointerup",this.handleDocumentClick),this.apiKey&&this.token&&this.room&&this.initClient()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleKeydown),document.removeEventListener("pointerup",this.handleDocumentClick),this.teardownClient()}getConfigKey(){return`${this.apiKey}\0${this.token}\0${this.room}\0${this.endpoint??""}`}initClient(){const e={apiKey:this.apiKey,token:this.token,room:this.room,endpoint:this.endpoint};this.client=new mt(e),this.clientConfigKey=this.getConfigKey(),this.cursorOverlay=new rs(this.client),this.commentPins=new Ji(this.client,{onPinModeExit:()=>{this.pinModeActive=!1}}),this.viewportOverlay=new vs(this.client),this.selectionOverlay=new ds(this.client),this.drawingOverlay=new as(this.client),this.settings=us(this.room),this.applySettings(this.settings),this.unsubs.push(this.client.on("connection",t=>{this.connectionState=t,t==="connected"&&this._wasDisconnected?(this.showConnectedFlash=!0,this._connectedFlashTimer&&clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=setTimeout(()=>{this.showConnectedFlash=!1,this._connectedFlashTimer=null},2e3),this._wasDisconnected=!1):(t==="connecting"||t==="disconnected")&&(this._wasDisconnected=!0,this.showConnectedFlash=!1,this._connectedFlashTimer&&(clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=null))})),this.unsubs.push(this.client.state.on("click",({userId:t,position:i})=>{var s;this.settings.showOthersClicks&&((s=this.cursorOverlay)!=null&&s.isEnabled)&&this.cursorOverlay.showClickRipple(t,i)})),this.unsubs.push(this.client.state.on("viewport",({userId:t})=>{if(this.followingUserId===t){const i=this.client.state.getViewport(t);i&&(this._isFollowScrolling=!0,window.scrollTo({top:i.scrollY,left:i.scrollX,behavior:"smooth"}),setTimeout(()=>{this._isFollowScrolling=!1},500))}})),window.addEventListener("scroll",this.handleScroll),document.addEventListener("selectionchange",this.handleSelectionChange),this.client.connect()}teardownClient(){var e,t,i,s,n,r;this.unsubs.forEach(a=>a()),this.unsubs=[],window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("selectionchange",this.handleSelectionChange),this._viewportThrottleTimer&&(clearTimeout(this._viewportThrottleTimer),this._viewportThrottleTimer=null),this._selectionThrottleTimer&&(clearTimeout(this._selectionThrottleTimer),this._selectionThrottleTimer=null),(e=this.cursorOverlay)==null||e.destroy(),(t=this.commentPins)==null||t.destroy(),(i=this.viewportOverlay)==null||i.destroy(),(s=this.selectionOverlay)==null||s.destroy(),(n=this.drawingOverlay)==null||n.destroy(),(r=this.client)==null||r.disconnect(),this.client=void 0,this.cursorOverlay=void 0,this.commentPins=void 0,this.viewportOverlay=void 0,this.selectionOverlay=void 0,this.drawingOverlay=void 0,this.clientConfigKey="",this.followingUserId=null,this.drawModeActive=!1,this.connectionState="disconnected",this.showConnectedFlash=!1,this._wasDisconnected=!1,this._connectedFlashTimer&&(clearTimeout(this._connectedFlashTimer),this._connectedFlashTimer=null)}handlePanelClose(){this.activePanel=null,this.highlightThreadId=null}handleToolbarAction(e){var s,n,r,a;const t=e.detail;if(!this.settings.enabled&&t!=="settings")return;const i=t==="comments"||t==="settings"||t==="notifications"||t==="activity";switch((i||t==="pin-mode")&&this.drawModeActive&&(this.drawModeActive=!1,(s=this.drawingOverlay)==null||s.disableDrawMode()),(i||t==="draw-mode")&&this.pinModeActive&&(this.pinModeActive=!1,(n=this.commentPins)==null||n.exitPinMode()),(t==="pin-mode"||t==="draw-mode")&&(this.activePanel=null),t){case"comments":this.activePanel=this.activePanel==="comments"?null:"comments",this.highlightThreadId=null;break;case"settings":this.activePanel=this.activePanel==="settings"?null:"settings";break;case"notifications":this.activePanel=this.activePanel==="notifications"?null:"notifications";break;case"activity":this.activePanel=this.activePanel==="activity"?null:"activity";break;case"pin-mode":this.pinModeActive=!this.pinModeActive,this.pinModeActive&&((r=this.commentPins)==null||r.enterPinMode());break;case"draw-mode":this.drawModeActive=!this.drawModeActive,this.drawModeActive&&((a=this.drawingOverlay)==null||a.enableDrawMode());break}}handleFollow(e){const t=e.detail;this.followingUserId===t?this.followingUserId=null:this.followingUserId=t}handleSettingsChange(e){const t=e.detail;this.settings=t,fs(this.room,t),this.applySettings(t)}applySettings(e){var t,i,s,n,r,a,l,d,c,h,p,m,g,y,b,w,k;if(!e.enabled){(t=this.cursorOverlay)==null||t.disable(),(i=this.viewportOverlay)==null||i.disable(),(s=this.selectionOverlay)==null||s.disable(),(n=this.drawingOverlay)==null||n.disable(),this.drawModeActive&&((r=this.drawingOverlay)==null||r.disableDrawMode(),this.drawModeActive=!1),(a=this.client)==null||a.setAppearOffline(!0),(l=this.commentPins)==null||l.setVisible(!1),this.followingUserId=null,this.pinModeActive&&((d=this.commentPins)==null||d.exitPinMode(),this.pinModeActive=!1),this.activePanel=this.activePanel==="settings"?"settings":null,this.highlightThreadId=null;return}this.applyCursorSettings(e),(c=this.client)==null||c.setAppearOffline(e.appearOffline),(h=this.commentPins)==null||h.setVisible(e.showCommentPins),e.showViewportIndicators?(p=this.viewportOverlay)==null||p.enable():(m=this.viewportOverlay)==null||m.disable(),e.showSelections?(g=this.selectionOverlay)==null||g.enable():(y=this.selectionOverlay)==null||y.disable(),e.showDrawings?(b=this.drawingOverlay)==null||b.enable():((w=this.drawingOverlay)==null||w.disable(),this.drawModeActive&&((k=this.drawingOverlay)==null||k.disableDrawMode(),this.drawModeActive=!1))}applyCursorSettings(e){if(!this.cursorOverlay)return;e.showMyCursor||e.showOthersCursors?(this.cursorOverlay.enable(),this.cursorOverlay.setSending(e.showMyCursor),this.cursorOverlay.setReceiving(e.showOthersCursors)):this.cursorOverlay.disable()}updated(e){(e.has("room")||e.has("token")||e.has("apiKey")||e.has("endpoint"))&&this.apiKey&&this.token&&this.room&&this.getConfigKey()!==this.clientConfigKey&&(this.teardownClient(),this.initClient(),this.activePanel=null,this.highlightThreadId=null,this.pinModeActive=!1),(e.has("activePanel")||e.has("collapsed"))&&requestAnimationFrame(()=>this.positionPopups())}positionPopups(){var y,b,w,k;const e=this.display==="inline",t=(y=this.shadowRoot)==null?void 0:y.querySelector(".inline-trigger"),i=(b=this.shadowRoot)==null?void 0:b.querySelector("pulse-widget-toolbar"),s=e?t:i;if(!s)return;const n=s.getBoundingClientRect(),r=window.innerWidth,a=window.innerHeight,l=8,d=(w=this.shadowRoot)==null?void 0:w.querySelector(".toolbar-popover");if(d){Object.assign(d.style,{top:"auto",left:"auto"});const _=d.getBoundingClientRect(),M=this.computePosition(n,_,r,a,l);d.style.top=`${M.top}px`,d.style.left=`${M.left}px`}const c=(k=this.shadowRoot)==null?void 0:k.querySelector(".panel-container");if(!c)return;Object.assign(c.style,{top:"auto",left:"auto"});const h=d??i;if(!h)return;const p=h.getBoundingClientRect(),m=c.getBoundingClientRect(),g=this.computePosition(p,m,r,a,l);c.style.top=`${g.top}px`,c.style.left=`${g.left}px`}computePosition(e,t,i,s,n){const r=e.top,a=s-e.bottom;let l;r>=t.height+n?l=e.top-t.height-n:a>=t.height+n?l=e.bottom+n:l=r>=a?Math.max(n,e.top-t.height-n):e.bottom+n;let d;const c=e.right-t.width;return c>=n?d=c:e.left+t.width+n<=i?d=e.left:d=Math.max(n,Math.min(i-t.width-n,e.left)),l=Math.max(n,Math.min(s-t.height-n,l)),d=Math.max(n,Math.min(i-t.width-n,d)),{top:l,left:d}}getFollowUserName(){var t;if(!this.followingUserId)return"";const e=(t=this.client)==null?void 0:t.state.presence.find(i=>i.user.id===this.followingUserId);return(e==null?void 0:e.user.name)??"user"}renderConnectionBanner(){return this.showConnectedFlash?u`<div class="connection-banner connected">
2863
2863
  <span class="connection-dot"></span>Connected
2864
2864
  </div>`:this.connectionState==="connecting"?u`<div class="connection-banner connecting">
2865
2865
  <span class="connection-dot"></span>Reconnecting...
@@ -870,7 +870,7 @@ G.elementStyles = [], G.shadowRootOptions = { mode: "open" }, G[ne("elementPrope
870
870
  */
871
871
  const oe = globalThis, tt = (n) => n, Ee = oe.trustedTypes, it = Ee ? Ee.createPolicy("lit-html", { createHTML: (n) => n }) : void 0, Et = "$lit$", D = `lit$${Math.random().toFixed(9).slice(2)}$`, Ct = "?" + D, Gt = `<${Ct}>`, V = document, ae = () => V.createComment(""), le = (n) => n === null || typeof n != "object" && typeof n != "function", Fe = Array.isArray, Jt = (n) => Fe(n) || typeof (n == null ? void 0 : n[Symbol.iterator]) == "function", Ie = `[
872
872
  \f\r]`, se = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, nt = />/g, B = RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^
873
- \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), b = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
873
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), ot = /'/g, rt = /"/g, Tt = /^(?:script|style|textarea|title)$/i, St = (n) => (e, ...t) => ({ _$litType$: n, strings: e, values: t }), u = St(1), Zt = St(2), W = Symbol.for("lit-noChange"), v = Symbol.for("lit-nothing"), at = /* @__PURE__ */ new WeakMap(), F = V.createTreeWalker(V, 129);
874
874
  function At(n, e) {
875
875
  if (!Fe(n) || !n.hasOwnProperty("raw")) throw Error("invalid template strings array");
876
876
  return it !== void 0 ? it.createHTML(e) : e;
@@ -965,7 +965,7 @@ class me {
965
965
  return ((e = this._$AM) == null ? void 0 : e._$AU) ?? this._$Cv;
966
966
  }
967
967
  constructor(e, t, i, s) {
968
- this.type = 2, this._$AH = b, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
968
+ this.type = 2, this._$AH = v, this._$AN = void 0, this._$AA = e, this._$AB = t, this._$AM = i, this.options = s, this._$Cv = (s == null ? void 0 : s.isConnected) ?? !0;
969
969
  }
970
970
  get parentNode() {
971
971
  let e = this._$AA.parentNode;
@@ -979,7 +979,7 @@ class me {
979
979
  return this._$AB;
980
980
  }
981
981
  _$AI(e, t = this) {
982
- e = J(this, e, t), le(e) ? e === b || e == null || e === "" ? (this._$AH !== b && this._$AR(), this._$AH = b) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
982
+ e = J(this, e, t), le(e) ? e === v || e == null || e === "" ? (this._$AH !== v && this._$AR(), this._$AH = v) : e !== this._$AH && e !== W && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Jt(e) ? this.k(e) : this._(e);
983
983
  }
984
984
  O(e) {
985
985
  return this._$AA.parentNode.insertBefore(e, this._$AB);
@@ -988,7 +988,7 @@ class me {
988
988
  this._$AH !== e && (this._$AR(), this._$AH = this.O(e));
989
989
  }
990
990
  _(e) {
991
- this._$AH !== b && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
991
+ this._$AH !== v && le(this._$AH) ? this._$AA.nextSibling.data = e : this.T(V.createTextNode(e)), this._$AH = e;
992
992
  }
993
993
  $(e) {
994
994
  var o;
@@ -1030,7 +1030,7 @@ class Se {
1030
1030
  return this._$AM._$AU;
1031
1031
  }
1032
1032
  constructor(e, t, i, s, o) {
1033
- this.type = 1, this._$AH = b, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = b;
1033
+ this.type = 1, this._$AH = v, this._$AN = void 0, this.element = e, this.name = t, this._$AM = s, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = v;
1034
1034
  }
1035
1035
  _$AI(e, t = this, i, s) {
1036
1036
  const o = this.strings;
@@ -1039,12 +1039,12 @@ class Se {
1039
1039
  else {
1040
1040
  const a = e;
1041
1041
  let l, d;
1042
- for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === b ? e = b : e !== b && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1042
+ for (e = o[0], l = 0; l < o.length - 1; l++) d = J(this, a[i + l], t, l), d === W && (d = this._$AH[l]), r || (r = !le(d) || d !== this._$AH[l]), d === v ? e = v : e !== v && (e += (d ?? "") + o[l + 1]), this._$AH[l] = d;
1043
1043
  }
1044
1044
  r && !s && this.j(e);
1045
1045
  }
1046
1046
  j(e) {
1047
- e === b ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1047
+ e === v ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "");
1048
1048
  }
1049
1049
  }
1050
1050
  class ti extends Se {
@@ -1052,7 +1052,7 @@ class ti extends Se {
1052
1052
  super(...arguments), this.type = 3;
1053
1053
  }
1054
1054
  j(e) {
1055
- this.element[this.name] = e === b ? void 0 : e;
1055
+ this.element[this.name] = e === v ? void 0 : e;
1056
1056
  }
1057
1057
  }
1058
1058
  class ii extends Se {
@@ -1060,7 +1060,7 @@ class ii extends Se {
1060
1060
  super(...arguments), this.type = 4;
1061
1061
  }
1062
1062
  j(e) {
1063
- this.element.toggleAttribute(this.name, !!e && e !== b);
1063
+ this.element.toggleAttribute(this.name, !!e && e !== v);
1064
1064
  }
1065
1065
  }
1066
1066
  class si extends Se {
@@ -1068,8 +1068,8 @@ class si extends Se {
1068
1068
  super(e, t, i, s, o), this.type = 5;
1069
1069
  }
1070
1070
  _$AI(e, t = this) {
1071
- if ((e = J(this, e, t, 0) ?? b) === W) return;
1072
- const i = this._$AH, s = e === b && i !== b || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== b && (i === b || s);
1071
+ if ((e = J(this, e, t, 0) ?? v) === W) return;
1072
+ const i = this._$AH, s = e === v && i !== v || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive, o = e !== v && (i === v || s);
1073
1073
  s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e;
1074
1074
  }
1075
1075
  handleEvent(e) {
@@ -1600,7 +1600,7 @@ let Y = class extends A {
1600
1600
  ${n.comments.map((e, t) => {
1601
1601
  const i = this.getUserForComment(e.userId);
1602
1602
  return u`
1603
- ${t > 0 ? u`<div class="divider"></div>` : b}
1603
+ ${t > 0 ? u`<div class="divider"></div>` : v}
1604
1604
  <div class="comment">
1605
1605
  <div class="comment-header">
1606
1606
  <div
@@ -1637,7 +1637,7 @@ let Y = class extends A {
1637
1637
  <input type="text" placeholder="Write a reply..." />
1638
1638
  <button type="submit">Send</button>
1639
1639
  </form>
1640
- ` : b}
1640
+ ` : v}
1641
1641
  </div>
1642
1642
  `;
1643
1643
  }
@@ -1877,12 +1877,12 @@ ge([
1877
1877
  Y = ge([
1878
1878
  L("pulse-comments")
1879
1879
  ], Y);
1880
- var gi = Object.defineProperty, bi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
1881
- for (var s = i > 1 ? void 0 : i ? bi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1880
+ var gi = Object.defineProperty, vi = Object.getOwnPropertyDescriptor, Ve = (n, e, t, i) => {
1881
+ for (var s = i > 1 ? void 0 : i ? vi(e, t) : e, o = n.length - 1, r; o >= 0; o--)
1882
1882
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
1883
1883
  return i && s && gi(e, t, s), s;
1884
1884
  };
1885
- const vi = {
1885
+ const bi = {
1886
1886
  "comment:created": "left a comment",
1887
1887
  "comment:mention": "mentioned you",
1888
1888
  "comment:reply": "replied to your comment",
@@ -1946,11 +1946,11 @@ let he = class extends A {
1946
1946
  <div class="header">
1947
1947
  <span class="title">
1948
1948
  Notifications
1949
- ${n > 0 ? u`<span class="badge">${n}</span>` : b}
1949
+ ${n > 0 ? u`<span class="badge">${n}</span>` : v}
1950
1950
  </span>
1951
1951
  ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
1952
1952
  Mark all read
1953
- </button>` : b}
1953
+ </button>` : v}
1954
1954
  </div>
1955
1955
  <div class="list">
1956
1956
  ${this.notifications.length === 0 ? u`<div class="empty">
@@ -1966,7 +1966,7 @@ let he = class extends A {
1966
1966
  <div class="content">
1967
1967
  <div class="text">
1968
1968
  <span class="actor">${this.getActorName(e.actorId)}</span>
1969
- ${vi[e.type] ?? e.type}
1969
+ ${bi[e.type] ?? e.type}
1970
1970
  </div>
1971
1971
  <div class="time">${this.formatTime(e.createdAt)}</div>
1972
1972
  </div>
@@ -2204,7 +2204,7 @@ let N = class extends A {
2204
2204
  `
2205
2205
  )}
2206
2206
  </div>
2207
- ` : b}
2207
+ ` : v}
2208
2208
  </div>
2209
2209
  `;
2210
2210
  }
@@ -2369,10 +2369,10 @@ class Ci {
2369
2369
  */
2370
2370
  class Re extends Ci {
2371
2371
  constructor(e) {
2372
- if (super(e), this.it = b, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2372
+ if (super(e), this.it = v, e.type !== ki.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
2373
2373
  }
2374
2374
  render(e) {
2375
- if (e === b || e == null) return this._t = void 0, this.it = e;
2375
+ if (e === v || e == null) return this._t = void 0, this.it = e;
2376
2376
  if (e === W) return e;
2377
2377
  if (typeof e != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");
2378
2378
  if (e === this.it) return this._t;
@@ -2551,7 +2551,7 @@ const ji = [
2551
2551
  * This source code is licensed under the ISC license.
2552
2552
  * See the LICENSE file in the root directory of this source tree.
2553
2553
  */
2554
- const be = [
2554
+ const ve = [
2555
2555
  ["path", { d: "M18 6 6 18" }],
2556
2556
  ["path", { d: "m6 6 12 12" }]
2557
2557
  ];
@@ -2631,7 +2631,7 @@ const ie = M`
2631
2631
  --pw-shadow: var(--pulse-shadow);
2632
2632
  --pw-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
2633
2633
  }
2634
- `, ve = M`
2634
+ `, be = M`
2635
2635
  .pw-btn {
2636
2636
  display: inline-flex;
2637
2637
  align-items: center;
@@ -2743,7 +2743,7 @@ let K = class extends A {
2743
2743
  <div class="panel-header">
2744
2744
  <span class="panel-title">Activity</span>
2745
2745
  <button class="close-btn" @click=${this.fireClose} title="Close">
2746
- ${C(be, 16)}
2746
+ ${C(ve, 16)}
2747
2747
  </button>
2748
2748
  </div>
2749
2749
 
@@ -2776,7 +2776,7 @@ let K = class extends A {
2776
2776
  };
2777
2777
  K.styles = [
2778
2778
  ie,
2779
- ve,
2779
+ be,
2780
2780
  Pe,
2781
2781
  M`
2782
2782
  :host {
@@ -3018,11 +3018,11 @@ class je {
3018
3018
  whiteSpace: "nowrap",
3019
3019
  lineHeight: "1"
3020
3020
  });
3021
- function v() {
3021
+ function b() {
3022
3022
  const E = ht(o), I = ht(s);
3023
3023
  y.textContent = `${E} / ${I}`;
3024
3024
  }
3025
- v(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
3025
+ b(), p.appendChild(m), p.appendChild(y), a.appendChild(l), a.appendChild(p);
3026
3026
  function w() {
3027
3027
  const E = s > 0 ? o / s : 0, I = Math.floor(E * we);
3028
3028
  for (let z = 0; z < we; z++)
@@ -3034,7 +3034,7 @@ class je {
3034
3034
  1,
3035
3035
  Math.max(0, (E.clientX - I.left) / I.width)
3036
3036
  );
3037
- r.currentTime = z * s, o = r.currentTime, w(), v();
3037
+ r.currentTime = z * s, o = r.currentTime, w(), b();
3038
3038
  }), l.addEventListener("click", () => {
3039
3039
  i ? r.pause() : r.play().catch(() => {
3040
3040
  });
@@ -3043,13 +3043,13 @@ class je {
3043
3043
  }), r.addEventListener("pause", () => {
3044
3044
  i = !1, c();
3045
3045
  }), r.addEventListener("ended", () => {
3046
- i = !1, c(), o = 0, w(), v();
3046
+ i = !1, c(), o = 0, w(), b();
3047
3047
  }), r.addEventListener("timeupdate", () => {
3048
- o = r.currentTime, w(), v();
3048
+ o = r.currentTime, w(), b();
3049
3049
  }), r.addEventListener("loadedmetadata", () => {
3050
- r.duration && isFinite(r.duration) && (s = r.duration, v());
3050
+ r.duration && isFinite(r.duration) && (s = r.duration, b());
3051
3051
  }), r.addEventListener("durationchange", () => {
3052
- r.duration && isFinite(r.duration) && (s = r.duration, v());
3052
+ r.duration && isFinite(r.duration) && (s = r.duration, b());
3053
3053
  }), a;
3054
3054
  }
3055
3055
  }
@@ -4032,8 +4032,8 @@ class ns {
4032
4032
  const l = this.form.querySelector("textarea"), d = this.form.querySelector(".pulse-close-btn"), c = this.form.querySelector(".pin-submit");
4033
4033
  d.addEventListener("click", () => this.exitPinMode()), this.pendingAttachmentIds = [], this.upload || (this.upload = new re(this.client));
4034
4034
  const h = this.form.querySelector(".pin-attachments-preview"), p = (g, y) => {
4035
- const v = document.createElement("div");
4036
- Object.assign(v.style, { position: "relative", display: "inline-block" }), v.appendChild(y);
4035
+ const b = document.createElement("div");
4036
+ Object.assign(b.style, { position: "relative", display: "inline-block" }), b.appendChild(y);
4037
4037
  const w = document.createElement("button");
4038
4038
  w.innerHTML = "×", Object.assign(w.style, {
4039
4039
  position: "absolute",
@@ -4055,17 +4055,17 @@ class ns {
4055
4055
  fontWeight: "700"
4056
4056
  }), w.addEventListener("click", () => {
4057
4057
  const E = this.pendingAttachmentIds.indexOf(g);
4058
- E !== -1 && this.pendingAttachmentIds.splice(E, 1), v.remove();
4059
- }), v.appendChild(w), h.appendChild(v);
4058
+ E !== -1 && this.pendingAttachmentIds.splice(E, 1), b.remove();
4059
+ }), b.appendChild(w), h.appendChild(b);
4060
4060
  }, m = 5;
4061
4061
  this.form.querySelector(".attach-img").addEventListener("click", async () => {
4062
4062
  const g = m - this.pendingAttachmentIds.length;
4063
4063
  if (g <= 0) return;
4064
4064
  const y = await this.upload.pickFiles("image/*", g);
4065
- for (const v of y) {
4066
- this.pendingAttachmentIds.push(v.id);
4065
+ for (const b of y) {
4066
+ this.pendingAttachmentIds.push(b.id);
4067
4067
  const w = document.createElement("img");
4068
- w.src = v.thumbnailUrl || v.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(v.id, w);
4068
+ w.src = b.thumbnailUrl || b.url, Object.assign(w.style, { width: "48px", height: "48px", borderRadius: "6px", objectFit: "cover", border: "1px solid #e2e8f0", display: "block" }), p(b.id, w);
4069
4069
  }
4070
4070
  }), this.form.querySelector(".attach-mic").addEventListener("click", async () => {
4071
4071
  if (this.pendingAttachmentIds.length >= m) return;
@@ -4075,8 +4075,8 @@ class ns {
4075
4075
  const y = await this.upload.uploadBlob(g, "audio.webm");
4076
4076
  if (y) {
4077
4077
  this.pendingAttachmentIds.push(y.id);
4078
- const v = document.createElement("span");
4079
- Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎤 Audio", p(y.id, v);
4078
+ const b = document.createElement("span");
4079
+ Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎤 Audio", p(y.id, b);
4080
4080
  }
4081
4081
  }
4082
4082
  }), this.form.querySelector(".attach-video").addEventListener("click", async () => {
@@ -4087,14 +4087,14 @@ class ns {
4087
4087
  const y = await this.upload.uploadBlob(g.blob, "video.webm");
4088
4088
  if (y) {
4089
4089
  this.pendingAttachmentIds.push(y.id);
4090
- const v = document.createElement("span");
4091
- Object.assign(v.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), v.textContent = "🎥 Video", p(y.id, v);
4090
+ const b = document.createElement("span");
4091
+ Object.assign(b.style, { display: "flex", alignItems: "center", padding: "4px 10px", borderRadius: "6px", background: "#f1f5f9", fontSize: "11px", color: "#64748b", height: "48px", boxSizing: "border-box" }), b.textContent = "🎥 Video", p(y.id, b);
4092
4092
  }
4093
4093
  }
4094
4094
  }), c.addEventListener("click", () => {
4095
4095
  const g = l.value.trim();
4096
4096
  if (!g && this.pendingAttachmentIds.length === 0) return;
4097
- const y = [...(g || "").matchAll(/@(\w+)/g)].map((v) => v[1]);
4097
+ const y = [...(g || "").matchAll(/@(\w+)/g)].map((b) => b[1]);
4098
4098
  this.client.createThread(g, { position: i, mentions: y, attachmentIds: this.pendingAttachmentIds.length > 0 ? [...this.pendingAttachmentIds] : void 0 }), this.pendingAttachmentIds = [], this.exitPinMode();
4099
4099
  }), l.addEventListener("keydown", (g) => {
4100
4100
  g.key === "Escape" && this.exitPinMode(), g.stopPropagation();
@@ -4161,7 +4161,7 @@ class ns {
4161
4161
  }
4162
4162
  const i = (d = this.client.state.user) == null ? void 0 : d.id;
4163
4163
  t.innerHTML = e.comments.map((c) => {
4164
- const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), v = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4164
+ const h = this.client.state.getUser(c.userId), p = h ? h.name.split(" ").map((O) => O[0]).join("").toUpperCase().slice(0, 2) : "?", m = (h == null ? void 0 : h.color) ?? "#94a3b8", g = this.escapeHtml((h == null ? void 0 : h.name) ?? "Unknown"), y = this.formatTime(c.createdAt), b = i === c.userId, w = c.editedAt ? '<span style="font-size:10px;color:#94a3b8;font-style:italic;">(edited)</span>' : "";
4165
4165
  if (this.editingPopoverCommentId === c.id)
4166
4166
  return `
4167
4167
  <div style="margin-bottom:10px;" data-comment-id="${c.id}">
@@ -4189,7 +4189,7 @@ class ns {
4189
4189
  </div>`;
4190
4190
  }
4191
4191
  return O.type === "audio" ? `<div class="popover-attachment-audio" data-url="${this.escapeHtml(O.url)}" data-duration="${O.durationMs ?? ""}" style="margin:4px 0 4px 29px;"></div>` : O.type === "video" ? `<div class="popover-attachment-video" data-url="${this.escapeHtml(O.url)}" data-poster="${this.escapeHtml(O.thumbnailUrl ?? "")}" style="margin:4px 0 4px 29px;"></div>` : "";
4192
- }).join(""), z = v ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4192
+ }).join(""), z = b ? `<div class="popover-comment-actions" style="display:flex;gap:2px;margin-top:2px;margin-left:29px;">
4193
4193
  <button class="edit-btn" data-comment-id="${c.id}" style="border:none;background:none;cursor:pointer;color:#94a3b8;padding:3px;border-radius:4px;display:flex;align-items:center;transition:all 0.15s;" title="Edit"
4194
4194
  onmouseover="this.style.color='#6366f1';this.style.background='#eef2ff'"
4195
4195
  onmouseout="this.style.color='#94a3b8';this.style.background='none'">${is}</button>
@@ -4319,8 +4319,8 @@ class ns {
4319
4319
  padding: "0",
4320
4320
  fontWeight: "700"
4321
4321
  }), y.addEventListener("click", () => {
4322
- const v = l.indexOf(p);
4323
- v !== -1 && l.splice(v, 1), g.remove();
4322
+ const b = l.indexOf(p);
4323
+ b !== -1 && l.splice(b, 1), g.remove();
4324
4324
  }), g.appendChild(y), a.appendChild(g);
4325
4325
  }, c = 5;
4326
4326
  t.querySelector(".reply-attach-img").addEventListener("click", async () => {
@@ -4747,14 +4747,14 @@ let P = class extends A {
4747
4747
  `
4748
4748
  )}
4749
4749
  </div>
4750
- ` : b}
4750
+ ` : v}
4751
4751
  </button>
4752
4752
  </div>
4753
4753
  `;
4754
4754
  }
4755
4755
  renderTypingIndicator(n) {
4756
4756
  const e = this.typingByThread.get(n) ?? [];
4757
- if (e.length === 0) return b;
4757
+ if (e.length === 0) return v;
4758
4758
  const t = e.length === 1 ? `${e[0]} is typing...` : `${e.join(", ")} are typing...`;
4759
4759
  return u`<div class="typing-indicator">${t}</div>`;
4760
4760
  }
@@ -4775,7 +4775,7 @@ let P = class extends A {
4775
4775
  <span class="thread-count">${this.threads.length}</span>
4776
4776
  </span>
4777
4777
  <button class="close-btn" @click=${this.fireClose} title="Close">
4778
- ${C(be, 16)}
4778
+ ${C(ve, 16)}
4779
4779
  </button>
4780
4780
  </div>
4781
4781
 
@@ -4793,7 +4793,7 @@ let P = class extends A {
4793
4793
  `;
4794
4794
  }
4795
4795
  renderAttachments(n) {
4796
- if (!n || n.length === 0) return b;
4796
+ if (!n || n.length === 0) return v;
4797
4797
  const e = n.filter((t) => t.type === "image").map((t) => t.url);
4798
4798
  return u`
4799
4799
  ${n.map((t) => {
@@ -4818,7 +4818,7 @@ let P = class extends A {
4818
4818
  <div class="comment-attachment-media" id="video-${t.id}">
4819
4819
  ${this.renderVideoPlayer(t)}
4820
4820
  </div>
4821
- ` : b;
4821
+ ` : v;
4822
4822
  })}
4823
4823
  `;
4824
4824
  }
@@ -4839,11 +4839,11 @@ let P = class extends A {
4839
4839
  ${n.position ? u`<div class="pin-badge">
4840
4840
  ${C(Pt, 12)}
4841
4841
  Pinned
4842
- </div>` : b}
4842
+ </div>` : v}
4843
4843
  ${n.comments.map((t, i) => {
4844
4844
  const s = this.getUserForComment(t.userId), o = this.isOwnComment(t), r = this.editingCommentId === t.id;
4845
4845
  return u`
4846
- ${i > 0 ? u`<div class="comment-divider"></div>` : b}
4846
+ ${i > 0 ? u`<div class="comment-divider"></div>` : v}
4847
4847
  <div class="comment">
4848
4848
  <div class="comment-header">
4849
4849
  <div
@@ -4854,16 +4854,16 @@ let P = class extends A {
4854
4854
  </div>
4855
4855
  <span class="comment-author">${(s == null ? void 0 : s.name) ?? "Unknown"}</span>
4856
4856
  <span class="comment-time">${this.formatTime(t.createdAt)}</span>
4857
- ${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : b}
4857
+ ${t.editedAt ? u`<span class="edited-badge">(edited)</span>` : v}
4858
4858
  </div>
4859
4859
  ${r ? this.renderEditForm(t) : u`
4860
- ${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : b}
4860
+ ${t.body && t.body !== "(attachment)" ? u`<div class="comment-body">${this.parseMentions(t.body)}</div>` : v}
4861
4861
  ${this.renderAttachments(t.attachments ?? [])}
4862
4862
  `}
4863
4863
  ${o && !r ? u`<div class="comment-actions">
4864
4864
  <button @click=${() => this.startEdit(t)} title="Edit">${C(Oi, 14)}</button>
4865
4865
  <button class="danger" @click=${() => this.deleteComment(t.id)} title="Delete">${C(Li, 14)}</button>
4866
- </div>` : b}
4866
+ </div>` : v}
4867
4867
  ${this.renderReactions(t)}
4868
4868
  </div>
4869
4869
  `;
@@ -4930,14 +4930,14 @@ let P = class extends A {
4930
4930
  </div>
4931
4931
  </div>
4932
4932
  </form>
4933
- ` : b}
4933
+ ` : v}
4934
4934
  </div>
4935
4935
  `;
4936
4936
  }
4937
4937
  };
4938
4938
  P.styles = [
4939
4939
  ie,
4940
- ve,
4940
+ be,
4941
4941
  Pe,
4942
4942
  M`
4943
4943
  :host {
@@ -5577,14 +5577,14 @@ let pe = class extends A {
5577
5577
  <div class="panel-header">
5578
5578
  <span class="panel-title">
5579
5579
  Notifications
5580
- ${n > 0 ? u`<span class="unread-badge">${n}</span>` : b}
5580
+ ${n > 0 ? u`<span class="unread-badge">${n}</span>` : v}
5581
5581
  </span>
5582
5582
  <div style="display:flex;align-items:center;gap:4px;">
5583
5583
  ${n > 0 ? u`<button class="mark-all" @click=${() => this.client.markAllRead()}>
5584
5584
  Mark all read
5585
- </button>` : b}
5585
+ </button>` : v}
5586
5586
  <button class="close-btn" @click=${this.fireClose} title="Close">
5587
- ${C(be, 16)}
5587
+ ${C(ve, 16)}
5588
5588
  </button>
5589
5589
  </div>
5590
5590
  </div>
@@ -5618,7 +5618,7 @@ let pe = class extends A {
5618
5618
  };
5619
5619
  pe.styles = [
5620
5620
  ie,
5621
- ve,
5621
+ be,
5622
5622
  Pe,
5623
5623
  M`
5624
5624
  :host {
@@ -6056,7 +6056,7 @@ class fs {
6056
6056
  }
6057
6057
  function ms(n) {
6058
6058
  if (!n.rangeCount || n.isCollapsed) return null;
6059
- const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = bt(t), o = bt(i);
6059
+ const e = n.getRangeAt(0), t = e.startContainer, i = e.endContainer, s = vt(t), o = vt(i);
6060
6060
  return !s || !o ? null : {
6061
6061
  startSelector: s,
6062
6062
  startOffset: e.startOffset,
@@ -6075,18 +6075,18 @@ function gs(n) {
6075
6075
  return null;
6076
6076
  }
6077
6077
  }
6078
- function bt(n) {
6078
+ function vt(n) {
6079
6079
  if (n.nodeType === Node.TEXT_NODE) {
6080
6080
  const e = n.parentElement;
6081
6081
  if (!e) return null;
6082
- const t = vt(e);
6082
+ const t = bt(e);
6083
6083
  if (!t) return null;
6084
6084
  const i = Array.from(e.childNodes).indexOf(n);
6085
6085
  return `${t}::text(${i})`;
6086
6086
  }
6087
- return n.nodeType === Node.ELEMENT_NODE ? vt(n) : null;
6087
+ return n.nodeType === Node.ELEMENT_NODE ? bt(n) : null;
6088
6088
  }
6089
- function vt(n) {
6089
+ function bt(n) {
6090
6090
  if (!n || n === document.documentElement) return "html";
6091
6091
  if (n === document.body) return "body";
6092
6092
  if (n.id) return `#${CSS.escape(n.id)}`;
@@ -6129,7 +6129,7 @@ function xt(n) {
6129
6129
  return null;
6130
6130
  }
6131
6131
  }
6132
- class bs {
6132
+ class vs {
6133
6133
  constructor(e) {
6134
6134
  this.container = null, this.unsubs = [], this.enabled = !1, this.selectionEls = /* @__PURE__ */ new Map(), this.clearTimers = /* @__PURE__ */ new Map(), this.client = e;
6135
6135
  }
@@ -6212,10 +6212,10 @@ class bs {
6212
6212
  }
6213
6213
  }
6214
6214
  }
6215
- var vs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
6215
+ var bs = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Ye = (n, e, t, i) => {
6216
6216
  for (var s = i > 1 ? void 0 : i ? xs(e, t) : e, o = n.length - 1, r; o >= 0; o--)
6217
6217
  (r = n[o]) && (s = (i ? r(e, t, s) : r(s)) || s);
6218
- return i && s && vs(e, t, s), s;
6218
+ return i && s && bs(e, t, s), s;
6219
6219
  };
6220
6220
  let ue = class extends A {
6221
6221
  constructor() {
@@ -6258,7 +6258,7 @@ let ue = class extends A {
6258
6258
  <div class="panel-header">
6259
6259
  <span class="panel-title">Settings</span>
6260
6260
  <button class="close-btn" @click=${this.fireClose} title="Close">
6261
- ${C(be, 16)}
6261
+ ${C(ve, 16)}
6262
6262
  </button>
6263
6263
  </div>
6264
6264
 
@@ -6305,7 +6305,7 @@ let ue = class extends A {
6305
6305
  };
6306
6306
  ue.styles = [
6307
6307
  ie,
6308
- ve,
6308
+ be,
6309
6309
  Pe,
6310
6310
  M`
6311
6311
  :host {
@@ -6579,7 +6579,7 @@ let R = class extends A {
6579
6579
  <!-- Presence avatars -->
6580
6580
  ${this.users.length > 0 ? u`
6581
6581
  <div class="presence">
6582
- ${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : b}
6582
+ ${t > 0 ? u`<div class="presence-overflow">+${t}</div>` : v}
6583
6583
  ${e.map(
6584
6584
  (i) => u`
6585
6585
  <div
@@ -6590,13 +6590,13 @@ let R = class extends A {
6590
6590
  >
6591
6591
  ${i.user.avatar ? u`<img src="${i.user.avatar}" alt="${i.user.name}" />` : this.getInitials(i.user.name)}
6592
6592
  <span class="presence-tooltip">${i.user.name}</span>
6593
- ${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : b}
6593
+ ${i.deviceType && i.deviceType !== "desktop" ? u`<span class="device-icon">${i.deviceType === "mobile" ? "📱" : "📲"}</span>` : v}
6594
6594
  </div>
6595
6595
  `
6596
6596
  )}
6597
6597
  </div>
6598
6598
  <div class="separator"></div>
6599
- ` : b}
6599
+ ` : v}
6600
6600
 
6601
6601
  <!-- Pin comment (primary) -->
6602
6602
  <button
@@ -6651,7 +6651,7 @@ let R = class extends A {
6651
6651
  style="${this.featuresDisabled ? "opacity:0.35;pointer-events:none" : "position:relative"}"
6652
6652
  >
6653
6653
  ${C(Si)}
6654
- ${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : b}
6654
+ ${this.unreadCount > 0 ? u`<span class="badge">${this.unreadCount > 9 ? "9+" : this.unreadCount}</span>` : v}
6655
6655
  </button>
6656
6656
 
6657
6657
  <!-- Settings -->
@@ -6671,7 +6671,7 @@ let R = class extends A {
6671
6671
  @click=${this.fireToggle}
6672
6672
  title="Collapse"
6673
6673
  >
6674
- ${C(be, 14)}
6674
+ ${C(ve, 14)}
6675
6675
  </button>
6676
6676
  </div>
6677
6677
  `;
@@ -6679,7 +6679,7 @@ let R = class extends A {
6679
6679
  };
6680
6680
  R.styles = [
6681
6681
  ie,
6682
- ve,
6682
+ be,
6683
6683
  M`
6684
6684
  :host {
6685
6685
  display: block;
@@ -6977,7 +6977,7 @@ class Es {
6977
6977
  (E) => E.user.id === a
6978
6978
  );
6979
6979
  if (!m) continue;
6980
- const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, v = Math.max(
6980
+ const g = l.scrollY + l.viewportHeight / 2, y = i > 0 ? g / i : 0, b = Math.max(
6981
6981
  8,
6982
6982
  Math.min(t - 28, y * t)
6983
6983
  );
@@ -6994,7 +6994,7 @@ class Es {
6994
6994
  whiteSpace: "nowrap",
6995
6995
  pointerEvents: "none",
6996
6996
  transition: "top 0.3s ease"
6997
- }), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${v}px`, w.textContent = this.getInitials(m.user.name);
6997
+ }), this.container.appendChild(w), this.pillEls.set(a, w)), w.style.display = "", w.style.background = m.user.color, w.style.top = `${b}px`, w.textContent = this.getInitials(m.user.name);
6998
6998
  }
6999
6999
  for (const [a, l] of this.pillEls)
7000
7000
  !o.has(a) && !this.client.state.viewports.has(a) && (l.remove(), this.pillEls.delete(a));
@@ -7067,7 +7067,7 @@ let T = class extends A {
7067
7067
  onPinModeExit: () => {
7068
7068
  this.pinModeActive = !1;
7069
7069
  }
7070
- }), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new bs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
7070
+ }), this.viewportOverlay = new Es(this.client), this.selectionOverlay = new vs(this.client), this.drawingOverlay = new fs(this.client), this.settings = ys(this.room), this.applySettings(this.settings), this.unsubs.push(
7071
7071
  this.client.on("connection", (e) => {
7072
7072
  this.connectionState = e, e === "connected" && this._wasDisconnected ? (this.showConnectedFlash = !0, this._connectedFlashTimer && clearTimeout(this._connectedFlashTimer), this._connectedFlashTimer = setTimeout(() => {
7073
7073
  this.showConnectedFlash = !1, this._connectedFlashTimer = null;
@@ -7104,29 +7104,30 @@ let T = class extends A {
7104
7104
  this.activePanel = null, this.highlightThreadId = null;
7105
7105
  }
7106
7106
  handleToolbarAction(n) {
7107
- var t, i, s, o;
7107
+ var i, s, o, r;
7108
7108
  const e = n.detail;
7109
- if (!(!this.settings.enabled && e !== "settings"))
7110
- switch (e) {
7111
- case "comments":
7112
- this.activePanel = this.activePanel === "comments" ? null : "comments", this.highlightThreadId = null;
7113
- break;
7114
- case "settings":
7115
- this.activePanel = this.activePanel === "settings" ? null : "settings";
7116
- break;
7117
- case "notifications":
7118
- this.activePanel = this.activePanel === "notifications" ? null : "notifications";
7119
- break;
7120
- case "activity":
7121
- this.activePanel = this.activePanel === "activity" ? null : "activity";
7122
- break;
7123
- case "pin-mode":
7124
- this.pinModeActive = !this.pinModeActive, this.pinModeActive ? (t = this.commentPins) == null || t.enterPinMode() : (i = this.commentPins) == null || i.exitPinMode();
7125
- break;
7126
- case "draw-mode":
7127
- this.drawModeActive = !this.drawModeActive, this.drawModeActive ? (s = this.drawingOverlay) == null || s.enableDrawMode() : (o = this.drawingOverlay) == null || o.disableDrawMode();
7128
- break;
7129
- }
7109
+ if (!this.settings.enabled && e !== "settings") return;
7110
+ const t = e === "comments" || e === "settings" || e === "notifications" || e === "activity";
7111
+ switch ((t || e === "pin-mode") && this.drawModeActive && (this.drawModeActive = !1, (i = this.drawingOverlay) == null || i.disableDrawMode()), (t || e === "draw-mode") && this.pinModeActive && (this.pinModeActive = !1, (s = this.commentPins) == null || s.exitPinMode()), (e === "pin-mode" || e === "draw-mode") && (this.activePanel = null), e) {
7112
+ case "comments":
7113
+ this.activePanel = this.activePanel === "comments" ? null : "comments", this.highlightThreadId = null;
7114
+ break;
7115
+ case "settings":
7116
+ this.activePanel = this.activePanel === "settings" ? null : "settings";
7117
+ break;
7118
+ case "notifications":
7119
+ this.activePanel = this.activePanel === "notifications" ? null : "notifications";
7120
+ break;
7121
+ case "activity":
7122
+ this.activePanel = this.activePanel === "activity" ? null : "activity";
7123
+ break;
7124
+ case "pin-mode":
7125
+ this.pinModeActive = !this.pinModeActive, this.pinModeActive && ((o = this.commentPins) == null || o.enterPinMode());
7126
+ break;
7127
+ case "draw-mode":
7128
+ this.drawModeActive = !this.drawModeActive, this.drawModeActive && ((r = this.drawingOverlay) == null || r.enableDrawMode());
7129
+ break;
7130
+ }
7130
7131
  }
7131
7132
  handleFollow(n) {
7132
7133
  const e = n.detail;
@@ -7137,12 +7138,12 @@ let T = class extends A {
7137
7138
  this.settings = e, ws(this.room, e), this.applySettings(e);
7138
7139
  }
7139
7140
  applySettings(n) {
7140
- var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, v, w;
7141
+ var e, t, i, s, o, r, a, l, d, c, h, p, m, g, y, b, w;
7141
7142
  if (!n.enabled) {
7142
7143
  (e = this.cursorOverlay) == null || e.disable(), (t = this.viewportOverlay) == null || t.disable(), (i = this.selectionOverlay) == null || i.disable(), (s = this.drawingOverlay) == null || s.disable(), this.drawModeActive && ((o = this.drawingOverlay) == null || o.disableDrawMode(), this.drawModeActive = !1), (r = this.client) == null || r.setAppearOffline(!0), (a = this.commentPins) == null || a.setVisible(!1), this.followingUserId = null, this.pinModeActive && ((l = this.commentPins) == null || l.exitPinMode(), this.pinModeActive = !1), this.activePanel = this.activePanel === "settings" ? "settings" : null, this.highlightThreadId = null;
7143
7144
  return;
7144
7145
  }
7145
- this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((v = this.drawingOverlay) == null || v.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
7146
+ this.applyCursorSettings(n), (d = this.client) == null || d.setAppearOffline(n.appearOffline), (c = this.commentPins) == null || c.setVisible(n.showCommentPins), n.showViewportIndicators ? (h = this.viewportOverlay) == null || h.enable() : (p = this.viewportOverlay) == null || p.disable(), n.showSelections ? (m = this.selectionOverlay) == null || m.enable() : (g = this.selectionOverlay) == null || g.disable(), n.showDrawings ? (y = this.drawingOverlay) == null || y.enable() : ((b = this.drawingOverlay) == null || b.disable(), this.drawModeActive && ((w = this.drawingOverlay) == null || w.disableDrawMode(), this.drawModeActive = !1));
7146
7147
  }
7147
7148
  applyCursorSettings(n) {
7148
7149
  if (!this.cursorOverlay) return;
@@ -7156,10 +7157,10 @@ let T = class extends A {
7156
7157
  * the trigger element, flipping vertically/horizontally as needed.
7157
7158
  */
7158
7159
  positionPopups() {
7159
- var g, y, v, w;
7160
+ var g, y, b, w;
7160
7161
  const n = this.display === "inline", e = (g = this.shadowRoot) == null ? void 0 : g.querySelector(".inline-trigger"), t = (y = this.shadowRoot) == null ? void 0 : y.querySelector("pulse-widget-toolbar"), i = n ? e : t;
7161
7162
  if (!i) return;
7162
- const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (v = this.shadowRoot) == null ? void 0 : v.querySelector(".toolbar-popover");
7163
+ const s = i.getBoundingClientRect(), o = window.innerWidth, r = window.innerHeight, a = 8, l = (b = this.shadowRoot) == null ? void 0 : b.querySelector(".toolbar-popover");
7163
7164
  if (l) {
7164
7165
  Object.assign(l.style, { top: "auto", left: "auto" });
7165
7166
  const E = l.getBoundingClientRect(), I = this.computePosition(s, E, o, r, a);
@@ -7196,7 +7197,7 @@ let T = class extends A {
7196
7197
  <span class="connection-dot"></span>Reconnecting...
7197
7198
  </div>` : this.connectionState === "disconnected" && this.client ? u`<div class="connection-banner disconnected">
7198
7199
  <span class="connection-dot"></span>Disconnected
7199
- </div>` : b;
7200
+ </div>` : v;
7200
7201
  }
7201
7202
  handleToolbarToggle() {
7202
7203
  this.collapsed = !this.collapsed, this.collapsed && (this.activePanel = null, this.highlightThreadId = null);
@@ -7216,25 +7217,25 @@ let T = class extends A {
7216
7217
  ${this.activePanel === "comments" ? u`<pulse-widget-comments-panel
7217
7218
  .client=${this.client}
7218
7219
  .highlightThreadId=${this.highlightThreadId}
7219
- ></pulse-widget-comments-panel>` : b}
7220
+ ></pulse-widget-comments-panel>` : v}
7220
7221
  ${this.activePanel === "settings" ? u`<pulse-widget-settings-panel
7221
7222
  .settings=${this.settings}
7222
7223
  .roomId=${this.room}
7223
7224
  @settings-change=${this.handleSettingsChange}
7224
- ></pulse-widget-settings-panel>` : b}
7225
+ ></pulse-widget-settings-panel>` : v}
7225
7226
  ${this.activePanel === "notifications" ? u`<pulse-widget-notifications-panel
7226
7227
  .client=${this.client}
7227
- ></pulse-widget-notifications-panel>` : b}
7228
+ ></pulse-widget-notifications-panel>` : v}
7228
7229
  ${this.activePanel === "activity" ? u`<pulse-widget-activity-panel
7229
7230
  .client=${this.client}
7230
- ></pulse-widget-activity-panel>` : b}
7231
+ ></pulse-widget-activity-panel>` : v}
7231
7232
  </div>
7232
- ` : b, t = this.followingUserId ? u`<div class="follow-banner">
7233
+ ` : v, t = this.followingUserId ? u`<div class="follow-banner">
7233
7234
  Following ${this.getFollowUserName()}
7234
7235
  <button @click=${() => {
7235
7236
  this.followingUserId = null;
7236
7237
  }}>Stop</button>
7237
- </div>` : b;
7238
+ </div>` : v;
7238
7239
  return n ? u`
7239
7240
  ${t}
7240
7241
  <div class="widget-root">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamention/pulse-elements",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Drop-in web components for real-time collaboration — comments, cursors, presence, drawing, and more",
5
5
  "type": "module",
6
6
  "main": "./dist/pulse-elements.cjs",