import{b3 as i,b4 as f}from"./index-Cy4uayzW.js";import"./vue-vendor-CxLCUzY4.js";import"./antd-vue-vendor-CahNzUUa.js";import"./vxe-table-vendor-Cdi8WfTx.js";let c;const n=new Map;function y(e){const s=i()||"";c=f(e,{autoReconnect:{retries:10,delay:5e3},heartbeat:{message:"ping",interval:5e3},protocols:[s],onConnected:function(o){},onDisconnected:function(o,t){},onError:function(o,t){},onMessage:function(o,t){try{if(t.data==="ping")return;const r=JSON.parse(t.data);for(const a of n.keys())try{a(r)}catch(u){}}catch(r){}}})}function b(e){n.has(e)||typeof e=="function"&&n.set(e,null)}function g(e){n.delete(e)}function S(){return c}export{y as connectWebSocket,g as offWebSocket,b as onWebSocket,S as useMyWebSocket};
