import{j as i,al as l}from"./vendor-mui-core-D7t4vMS5.js";import{u as x,r as w}from"./vendor-react-DX7tU9aY.js";import{b as g}from"./vendor-hooks-DAZ1H6Va.js";import{I as v}from"./invitation-CUluW5mi.js";import{K as u}from"./landing-page-BJAji-kI.js";import{W as I,ab as S}from"./vendor-ux-Dl3wVbv_.js";import{u as k,n as E,b as T,e as j,c as P,H as W}from"./index-Ca33rdd_.js";import{g as b}from"./get-safe-url-D4zRnTpF.js";import{c as R}from"./passport-DKYg_d4G.js";import"./vendor-utils-BzQg432x.js";import"./index-_uJPC7_n.js";import"./purify.es-HRjpPm7y.js";import"./use-passport-id-B-b-_oYF.js";import"./session-lE2gmzzF.js";import"./sdk-CXEy5Pgp.js";import"./wrap-locale-BJF_SaOe.js";import"./index-BoJbHOhC.js";import"./use-blocklet-logo-BWPJOOVd.js";import"./vendor-arcblock-ivFYo5vP.js";import"./create-passport-svg-De1vqcmo.js";function Q(n){const m=x(),{searchParams:s}=new URL(window.location.href),{api:p,session:c}=k(),{t:d}=I(),r=s.get("inviteId"),a=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:r}});return t},[r]),h=g(async(t,o=e=>e)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&S(o(t.visitorId))),await c.refresh(),setTimeout(()=>{if(a){const e=decodeURIComponent(a);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?m(e,{replace:!0}):window.location.href=b(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(W,{children:i.jsxs("title",{children:[d("pageTitle.invite")," | ",window.blocklet?.appName]})}),i.jsx(l,{sx:{width:"560px",maxWidth:"100%",height:"100%"},className:"page-invite",children:i.jsx(v,{...n,getDataFn:f,checkFn:p.get,createPassportSvg:t=>R({...t}),onLoginSuccess:h,inService:!0})})]})}export{Q as default};
