export const safeWindowRuntimeCall = async ( invoke: () => T | Promise, fallback: T, ): Promise => { try { return await Promise.resolve().then(invoke); } catch { return fallback; } };