export function reloadPreview(e,t=200){const{port1:o,port2:n}=new MessageChannel;let s;const c=new Promise((e=>{s=e})),done=()=>{s(),n.close()},r=setTimeout((()=>{const t=e.src;e.src=t,done()}),t);return n.addEventListener("message",(e=>{const t=e.data;null!=t&&"object"==typeof t&&"LOCALSERVICE_WINDOW_RELOADED"===t.type&&(clearTimeout(r),done())})),e.contentWindow?.postMessage({type:"LOCALSERVICE_RELOAD_WINDOW",callback:o},"*",[o]),c}