Build 589089stable
Module 418126
940 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{Ay:()=>d});var i=n(562465),r=n(228366),a=n(287809),s=n(38405),l=n(692744),o=n(652215);let d={connect:async function(e){try{let t=await i.Bo.post({url:o.Rsh.HAVEN_CONNECT(e),rejectWithError:!0});return r.h.dispatch({type:"HAVEN_CONNECT",room:(0,l.xf)(t.body)}),t}catch(e){s.A.captureException(e)}},disconnect:async function(e){try{await i.Bo.post({url:o.Rsh.HAVEN_DISCONNECT(e),rejectWithError:!0})}catch(t){if(t?.status===404){let t=a.default.getCurrentUser();null!=t&&r.h.dispatch({type:"HAVEN_DISCONNECT",roomId:e,userId:t.id})}s.A.captureException(t)}},update:async function(e,t){let{position:n,avatar:r,seat:a}=t;try{await i.Bo.post({url:o.Rsh.HAVEN_UPDATE(e),body:{position:n,avatar:r,seat:a},rejectWithError:!0})}catch(e){s.A.captureException(e)}},getAssets:async function(){try{return await i.Bo.get({url:o.Rsh.HAVEN_GET_ASSETS,rejectWithError:!0})}catch(e){return s.A.captureException(e),null}}}}