import{j as i,ak as l}from"./vendor-mui-core-DnR6WYuU.js";import{u as x,r as w}from"./vendor-react-CTtPmzVP.js";import{b as g}from"./vendor-hooks-cYMUGE4V.js";import{I as v}from"./invitation-DwMnPB2W.js";import{K as u}from"./landing-page-Cv6belCa.js";import{V as I,a5 as k}from"./vendor-ux-DfSgTRg5.js";import{u as S,o as E,a as T,d as j,c as P,H as R}from"./index-BHa1_Bjz.js";import{g as W}from"./get-safe-url-CqAaHb9L.js";import{c as N}from"./passport-D6ZhqZ1F.js";import"./vendor-utils-drLlzTVq.js";import"./index-B7jV3her.js";import"./use-passport-id-B-b-_oYF.js";import"./session-Cm8j8XeZ.js";import"./sdk-C3wBexZ2.js";import"./wrap-locale-DtcRIeKF.js";import"./index-BNeXCm1B.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CPCSE54a.js";import"./create-passport-svg-BQhmIwWD.js";function J(n){const c=x(),{searchParams:s}=new URL(window.location.href),{api:m,session:p}=S(),{t:d}=I(),a=s.get("inviteId"),r=s.get("redirect"),f=w.useCallback(async()=>{const{data:t}=await E.get("invitation",{params:{inviteId:a}});return t},[a]),h=g(async(t,o=e=>e)=>{t&&(T(o(t.sessionToken)),j(o(t.refreshToken)),t.visitorId&&k(o(t.visitorId))),await p.refresh(),setTimeout(()=>{if(r){const e=decodeURIComponent(r);e.startsWith(P.WELLKNOWN_SERVICE_PATH_PREFIX)?c(e,{replace:!0}):window.location.href=W(e)}else window.location.href=window.env.pathPrefix||"/"},50)});return i.jsxs(u,{did:window.blocklet?.appPid,children:[i.jsx(R,{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:m.get,createPassportSvg:t=>N({...t}),onLoginSuccess:h,inService:!0})})]})}export{J as default};
