try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`b559c3fa-24bb-45ea-8b97-932af8a28924`,e._sentryDebugIdIdentifier=`sentry-dbid-b559c3fa-24bb-45ea-8b97-932af8a28924`)}catch{}import{K as e,L as t,n,t as r}from"./index-Dul-9Slf.js";async function i(i,a){try{let o=i();if(!o)return e.log(`No session stored; continuing without a client`),null;e.log(`Using a standalone client`);let{user_id:s,device_id:c,access_token:l,passwordlessUser:u}=o,d={baseUrl:n.defaultHomeserverUrl(),accessToken:l,userId:s,deviceId:c,fallbackICEServerAllowed:!1,livekitServiceURL:n.get().livekit?.livekit_service_url};try{return{widgetApi:null,client:await r(d,!0),passwordlessUser:u}}catch(n){if(n instanceof t&&n.errcode===`M_UNKNOWN_TOKEN`)return e.log(`The session from local store is invalid; continuing without a client`),a(),null;throw n}}catch(e){throw a(),e}}export{i as initSPA};
//# sourceMappingURL=spa-DfPO1OBn.js.map