UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 977 B
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{lo as t}from"./control-ui-connection-Bfj9beF_.js";function n(e,n,i,a){let o=r.then(()=>(i.throwIfAborted(),new Promise((r,o)=>{let s=new Worker(new URL(new URL(`chat-attachment-video.worker-xRGn4pOr.js`,import.meta.url).href,``+import.meta.url),{type:`module`}),c=new AbortController,l={signal:c.signal},u,d=!1,f=(e,t=`failed`)=>{d||(d=!0,clearTimeout(u),c.abort(),s.terminate(),e&&!i.aborted?r(e):o(Error(i.aborted?`aborted`:t)))},p=()=>f(),m=()=>{clearTimeout(u),u=setTimeout(()=>f(),12e4)};t(i,`abort`,p,{...l,once:!0}),t(s,`message`,({data:e})=>{d||(e.type===`progress`?(m(),a(e.progress)):e.type===`ready`?f(e.file):f(void 0,e.reason))},l),t(s,`error`,e=>{e.preventDefault(),f()},l),t(s,`messageerror`,()=>f(),l),m();try{s.postMessage({file:e,maxBytes:n},[])}catch{f()}})));return r=o.then(()=>{},()=>{}),o}var r;function i(){return(i=e((()=>{r=Promise.resolve()})))()}i();export{n as compressChatAttachmentVideo};