1import { s as styled, r as reactExports, G as GoogleAuthProvider, a as GithubAuthProvider, T as ThemeProvider, c as clientExports } from "./index-BmWEJH2C.js"; 2import { j as jsxs, a as jsx, L as Localized, S as StyledFirebaseAuth, b as auth, t as themes, G as GlobalCSS, c as LocalizationContext } from "./StyledFirebaseAuth-4SwSiw7S.js"; 3const Container$1 = styled.div` 4 text-align: center; 5 padding: 20px; 6 border-radius: 10px; 7 background-color: var(--color-background-dark); 8 box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 9 max-width: 30rem; 10 margin: 10rem auto; 11`; 12const Title$1 = styled.h1` 13 color: var(--color-theme); 14`; 15const Text = styled.p` 16 color: var(--color-text-secondary); 17`; 18const SignInSuccessPage = () => { 19 return /* @__PURE__ */ jsxs(Container$1, { children: [ 20 /* @__PURE__ */ jsx(Title$1, { children: "Authentication Successful" }), 21 /* @__PURE__ */ jsx(Text, { children: "You may now close this page." }), 22 /* @__PURE__ */ jsx(Text, { children: "Thank you for using signal." }) 23 ] }); 24}; 25const Title = styled.div` 26 font-size: 1.25rem; 27 color: var(--color-text); 28 margin-bottom: 1.5rem; 29`; 30const Content = styled.div` 31 overflow-x: hidden; 32 overflow-y: auto; 33 margin-bottom: 1rem; 34`; 35const Container = styled.div` 36 padding: 2rem 3rem; 37`; 38const SignInPage = () => { 39 const [isSucceeded, setIsSucceeded] = reactExports.useState(false); 40 if (isSucceeded) { 41 return /* @__PURE__ */ jsx(SignInSuccessPage, {}); 42 } 43 return /* @__PURE__ */ jsxs(Container, { children: [ 44 /* @__PURE__ */ jsx(Title, { children: /* @__PURE__ */ jsx(Localized, { name: "sign-in" }) }), 45 /* @__PURE__ */ jsx(Content, { children: /* @__PURE__ */ jsx( 46 StyledFirebaseAuth, 47 { 48 uiConfig: { 49 signInOptions: [ 50 GoogleAuthProvider.PROVIDER_ID, 51 GithubAuthProvider.PROVIDER_ID, 52 "apple.com" 53 ], 54 callbacks: { 55 signInSuccessWithAuthResult: ({ credential }) => { 56 const redirectUrl = new URLSearchParams(location.search).get( 57 "redirect_uri" 58 ); 59 if (redirectUrl && (redirectUrl.startsWith("jp.codingcafe.signal://") || redirectUrl.startsWith("jp.codingcafe.signal.dev://"))) { 60 const url = redirectUrl + "?credential=" + JSON.stringify(credential); 61 try { 62 location.assign(url); 63 setIsSucceeded(true); 64 } catch { 65 alert("Failed to open the app. Please try again."); 66 } 67 } 68 return false; 69 }, 70 signInFailure(error) { 71 console.error(error); 72 alert("Failed to sign in. Please try again."); 73 } 74 }, 75 signInFlow: "popup" 76 }, 77 firebaseAuth: auth 78 } 79 ) }) 80 ] }); 81}; 82const App = () => { 83 return /* @__PURE__ */ jsx(ThemeProvider, { theme: themes.dark, children: /* @__PURE__ */ jsxs(LocalizationContext.Provider, { value: { language: null }, children: [ 84 /* @__PURE__ */ jsx(GlobalCSS, {}), 85 /* @__PURE__ */ jsx(SignInPage, {}) 86 ] }) }); 87}; 88const rootElement = document.querySelector("#root"); 89if (rootElement === null) { 90 throw new Error("Root element '#root' was not found"); 91} 92const root = clientExports.createRoot(rootElement); 93root.render(/* @__PURE__ */ jsx(App, {})); 94//# sourceMappingURL=auth-gGqPT_iU.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.