UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines 956 B
import{n as e}from"./rolldown-runtime-DkW27tQK.js";var t;function n(){return(n=e((()=>{t=class{constructor(e,t){this.host=e,this.options=t,this.atBottom=!0,this.frame=null,e.addController(this)}schedule(e=!1){this.frame!==null&&(cancelAnimationFrame(this.frame),this.frame=null);let t=this.options.captureCurrent?.()??(()=>this.host.isConnected);t()&&this.host.updateComplete.then(()=>{t()&&(this.frame=requestAnimationFrame(()=>{this.frame=null;let n=t()?this.host.querySelector(this.options.selector):null;if(!n)return;let r=n.scrollHeight-n.scrollTop-n.clientHeight;!e&&(!this.options.isEnabled()||!this.atBottom&&r>=120)||(n.scrollTop=n.scrollHeight,this.atBottom=!0)}))})}handleScroll(e){let t=e.currentTarget;t&&(this.atBottom=t.scrollHeight-t.scrollTop-t.clientHeight<120)}hostDisconnected(){this.frame!==null&&(cancelAnimationFrame(this.frame),this.frame=null)}}})))()}export{n,t}; //# sourceMappingURL=stream-auto-follow-controller-DQpG-yCd.js.map