PageSourceSearch

https://openroot-hypersite.firebaseapp.com/assets/LoginModal-BWcbZytt.js

js openroot-hypersite.firebaseapp.com collected 2026-10-03 14:07:03 UTC 13,469 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-DgWYsVhk.js","assets/index-Fc5OyK-h.js","assets/index-BZXJ95jP.css"])))=>i.map(i=>d[i]);
2import{r as s,o as te,b as R,s as ae,c as ne,f as re,j as e,g as ie,d as oe,_ as ce}from"./index-Fc5OyK-h.js";import{g as le}from"./index-SFc2wnMY.js";const V=s.lazy(()=>ce(()=>import("./index.es-DgWYsVhk.js"),__vite__mapDeps([0,1,2]))),G="openrootUser",E="openrootUserUID",A="openrootOpenProfileDetails",z="isLoggedIn",W=s.memo(()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{fill:"#4285F4",d:"M17.64 9.2c0-.637-.057-1.251-.164-1.84H9v3.481h4.844c-.209 1.125-.843 2.078-1.796 2.717v2.258h2.908C18.658 12.01 17.64 9.762 17.64 9.2z"}),e.jsx("path",{fill:"#34A853",d:"M9 18c2.43 0 4.467-.806 5.956-2.184l-2.908-2.258c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332C2.438 15.983 5.482 18 9 18z"}),e.jsx("path",{fill:"#FBBC05",d:"M3.964 10.707c-.18-.54-.282-1.117-.282-1.707s.102-1.167.282-1.707V4.961H.957A9.006 9.006 0 0 0 0 9c0 1.452.348 2.825.957 4.039l3.007-2.332z"}),e.jsx("path",{fill:"#EA4335",d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0 5.482 0 2.438 2.017.957 4.961L3.964 6.293C4.672 4.166 6.656 3.58 9 3.58z"})]}));W.displayName="GoogleIcon";const $=s.memo(()=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M24 12C24 5.372 18.628 0 12 0C5.372 0 0 5.372 0 12C0 17.989 4.388 22.954 10.125 23.854V15.469H7.078V12H10.125V9.356C10.125 6.348 11.917 4.688 14.658 4.688C15.97 4.688 17.344 4.922 17.344 4.922V7.875H15.83C14.34 7.875 13.875 8.8 13.875 9.75V12H17.203L16.672 15.469H13.875V23.854C19.612 22.954 24 17.989 24 12Z",fill:"#1877F2"})}));$.displayName="FacebookIcon";const Y=s.memo(()=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M12 .297C5.373.297 0 5.67 0 12.297c0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61-.546-1.387-1.332-1.756-1.332-1.756-1.089-.744.083-.729.083-.729 1.205.084 1.84 1.236 1.84 1.236 1.07 1.835 2.807 1.304 3.492.997.108-.775.418-1.305.762-1.604-2.665-.303-5.466-1.333-5.466-5.931 0-1.31.465-2.381 1.236-3.221-.135-.303-.54-1.523.104-3.176 0 0 1.005-.322 3.3 1.23A11.507 11.507 0 0 1 12 6.844c1.02.005 2.045.138 3.003.404 2.294-1.552 3.298-1.23 3.298-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.221 0 4.609-2.805 5.625-5.475 5.921.43.372.81 1.102.81 2.222 0 1.606-.015 2.896-.015 3.286 0 .321.21.694.825.576C20.565 22.092 24 17.592 24 12.297 24 5.67 18.627.297 12 .297z"})}));Y.displayName="GitHubIcon";const O=s.memo(()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),e.jsx("path",{d:"M3 3v5h5"})]}));O.displayName="RetryIcon";const L=s.memo(()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),e.jsx("polyline",{points:"16 17 21 12 16 7"}),e.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}));L.displayName="LogoutIcon";const K=s.memo(()=>e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M9 12l2 2 4-4"}),e.jsx("path",{d:"M12 3l7 4v5c0 5-3.5 8-7 9-3.5-1-7-4-7-9V7l7-4z"})]}));K.displayName="VerifiedBadgeIcon";const de=t=>{switch(t==null?void 0:t.code){case"auth/popup-closed-by-user":return"Login cancelled.";case"auth/popup-blocked":return"Popup blocked. Please allow popups and try again.";case"auth/account-exists-with-different-credential":return"This email is already registered with a different provider.";case"auth/network-request-failed":return"Network error. Please check your connection and try again.";
2case"auth/unauthorized-domain":return"This domain is not authorized for authentication.";case"auth/operation-not-allowed":return"This login provider is not enabled.";default:return"Login failed. Please try again."}},ue=()=>typeof navigator>"u"?!1:/FBAN|FBAV|Instagram|WhatsApp|Line|WebView/i.test(navigator.userAgent??""),B=t=>t.email?`${t.email.split("@")[0].toLowerCase()}@openroot`:t.phoneNumber?`${t.phoneNumber.replace(/[^0-9]/g,"")}@openroot`:t.displayName?`${t.displayName.toLowerCase().replace(/[^a-z0-9]/g,"").slice(0,16)}@openroot`:`guest${t.uid.slice(0,5)}@openroot`,he=t=>{var a,n;return((n=(a=t==null?void 0:t.trim())==null?void 0:a.charAt(0))==null?void 0:n.toUpperCase())??"O"},P=(t,a="Not specified")=>t||a,F=t=>{var a,n;return t.photoURL?((n=(a=t.providerData)==null?void 0:a[0])==null?void 0:n.providerId)==="facebook.com"?`${t.photoURL}?height=400&width=400`:t.photoURL:null},D=(t,a)=>{try{sessionStorage.setItem(G,a),sessionStorage.setItem(E,t.uid),localStorage.setItem(z,"true")}catch{}},H=()=>{try{localStorage.removeItem(z),localStorage.removeItem(E),sessionStorage.removeItem(G),sessionStorage.removeItem(E),sessionStorage.removeItem(A)}catch{}},xe=s.memo(function({onClose:a,onLogin:n,onLogout:g}){const[i,c]=s.useState("loading"),[d,b]=s.useState(null),[q,N]=s.useState("guest@openroot"),[Z,U]=s.useState(5),[J,x]=s.useState(""),[p,C]=s.useState(null),j=p!==null,[M,Q]=s.useState(null),[_,X]=s.useState(null),v=s.useRef(null),y=s.useRef(null),w=s.useRef(null),l=s.useRef(!0),k=s.useRef(0),u=s.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null),w.current&&(clearInterval(w.current),w.current=null)},[]),S=s.useCallback(()=>{u(),c("initial"),x(""),C(null)},[u]);s.useEffect(()=>(l.current=!0,()=>{l.current=!1,u()}),[u]),s.useEffect(()=>{v.current&&le.fromTo(v.current,{y:40,opacity:0},{y:0,opacity:1,duration:.45,ease:"power2.out"})},[i]),s.useEffect(()=>te(R,h=>{if(!l.current)return;const f=typeof window<"u"&&sessionStorage.getItem(A)==="1";if(h){const o=B(h);if(b(h),N(o),D(h,o),f)try{sessionStorage.removeItem(A)}catch{}c(m=>m==="success"||m==="error"?m:"profile"),n==null||n(h);return}b(null),N("guest@openroot"),H(),c(o=>o==="success"||o==="error"?o:"initial")}),[n]),s.useEffect(()=>{Promise.all([fetch("/lotties/successfullogin.json").then(r=>r.json()).then(Q),fetch("/lotties/failedlogin.json").then(r=>r.json()).then(X)]).catch(console.error)},[]),s.useEffect(()=>{if(i!=="success"){u();return}return u(),U(5),w.current=setInterval(()=>{U(r=>Math.max(r-1,0))},1e3),y.current=setTimeout(()=>{l.current&&i==="success"&&(a==null||a())},5e3),u},[i,a,u]);const I=s.useCallback(async(r,h)=>{const f=++k.current;C(h),x("");try{const o=await ae(R,r);if(!l.current||f!==k.current)return;const m=o.user,T=B(m);b(m),N(T),D(m,T),c("success"),n==null||n(m)}catch(o){if(!l.current||f!==k.current)return;console.error(`LOGIN ERROR (${h}):`,o),x(de(o)),c("error")}finally{l.current&&f===k.current&&C(null)}},[n]),ee=s.useCallback(async()=>{x("");try{if(await ne(R),!l.current)return;b(null),N("guest@openroot"),H(),g==null||g(),S(),a==null||a()}catch(r){if(!l.current)return;console.error("LOGOUT ERROR:",r),x((r==null?void 0:r.message)||"Logout failed. Please try again."),c("error")}},[a,g,S]),se=s.useCallback(()=>{if(ue()){x("Facebook login is not supported in this in-app browser. Please open the site in Chrome or Safari and try again."),c("error");return}I(re,"facebook")},[I]);return i==="loading"?e.jsx("div",{className:"auth-overlay",children:e.jsx("div",{className:"auth-shell",children:e.jsx("div",{className:"auth-card auth-center",ref:v,children:e.jsx("p",{children:"Authenticating…"})})})}):e.jsx("div",{className:"auth-overlay",role:"presentation",children:e.jsxs("div",{className:"auth-shell",role:"dialog","aria-modal":"true","aria-labelledby":"login-modal-title",ref:v,children:[i!=="success"&&i!=="error"&&e.jsx("button",{className:"modal-close",onClick:a,"aria-label":"Close modal",children:"×"}),e.jsxs("div",{className:"auth-card",children:[e.jsx("span",{className:"ue-corner ue-corner--tl"}),e.jsx("span",{className:"ue-corner ue-corner--tr"}),e.jsx("span",{className:"ue-corner ue-corner--bl"}),e.jsx("span",{className:"ue-corner ue-corner--br"}),e.jsxs("div",{className:"auth-left",children:[e.jsx("div",{className:"auth-brand",children:e.jsx("img",{src:"/logo-nobg.png",alt:"Openroot"})}),i==="initial"&&e.jsxs("div",{className:"auth-content",children:[e.jsx("h2",{id:"login-modal-title",children:"Welcome to The World of Smart People"}),e.jsx("p",{children:"Sign in to continue to your dashboard and profile."}),e.jsxs("div",{className:"auth-buttons",children:[e.jsxs("button",{className:"btn google",onClick:()=>void I(ie,"google"),disabled:j,"aria-busy":p==="google",children:[e.jsx("span",{className:"btn-icon",children:e.jsx(W,{})}),e.jsx("span",{className:"btn-label",children:p==="google"?"Connecting…":"Continue with Google"})]}),e.jsxs("button",{className:"btn facebook",onClick:se,disabled:j,"aria-busy":p==="facebook",children:[e.jsx("span",{className:"btn-icon",children:e.jsx($,{})}),e.jsx("span",{className:"btn-label",children:p==="facebook"?"Connecting…":"Continue with Facebook"})]}),e.jsxs("button",{className:"btn github",onClick:()=>void I(oe,"github"),disabled:j,"aria-busy":p==="github",children:[e.jsx("span",{className:"btn-icon",children:e.jsx(Y,{})}),e.jsx("span",{className:"btn-label",children:p==="github"?"Connecting…":"Continue with GitHub"})]})]}),e.jsx("div",{className:"auth-terms",children:"By continuing you agree to the Terms & Privacy Policy"})]}),i==="success"&&e.jsxs("div",{className:"auth-center",children:[M&&e.jsx(s.Suspense,{fallback:null,children:e.jsx(V,{animationData:M,loop:!1,autoplay:!0})}),e.jsx("p",{children:"Login successful!"}),e.jsxs("p",{children:["Closing in ",e.jsxs("strong",{children:[Math.max(Z,0),"s"]})]})]}),i==="error"&&e.jsxs("div",{className:"auth-center",children:[_&&e.jsx(s.Suspense,{fallback:null,children:e.jsx(V,{animationData:_,loop:!1,autoplay:!0})}),e.jsx("p",{children:J}),e.jsxs("button",{className:"btn retry",onClick:S,children:[e.jsx("span",{className:"btn-icon",children:e.jsx(O,{})}),e.jsx("span",{className:"btn-label",children:"Try Again"})]})]}),i==="profile"&&d&&e.jsxs("div",{className:"auth-profile auth-profile--enhanced",children:[F(d)?e.jsx("img",{src:F(d),className:"profile-avatar-lg",alt:"User avatar",referrerPolicy:"no-referrer"}):e.jsx("div",{className:"avatar-fallback-lg","aria-hidden":"true",children:e.jsx("span",{children:he(d.displayName)})}),e.jsxs("div",{className:"profile-verified",children:[e.jsx(K,{}),e.jsx("span",{children:"Verified User"})]}),e.jsx("h3",{children:P(d.displayName,"OpenRoot User")}),e.jsxs("p",{className:"profile-row",children:["Email ID: ",e.jsx("strong",{children:P(d.email,"No email linked")})]}),e.jsxs("p",{className:"profile-row",children:["Username: ",e.jsx("strong",{children:q})]}),d.phoneNumber&&e.jsxs("p",{className:"profile-row",children:["Phone: ",e.jsx("strong",{children:P(d.phoneNumber)})]}),e.jsxs("button",{className:"btn logout",onClick:()=>c("confirmLogout"),disabled:j,children:[e.jsx("span",{className:"btn-icon",children:e.jsx(L,{})}),e.jsx("span",{className:"btn-label",children:"Logout"})]})]}),i==="confirmLogout"&&e.jsxs("div",{className:"auth-center",children:[e.jsx("h3",{children:"Confirm Logout"}),e.jsxs("button",{className:"btn logout",onClick:()=>void ee(),disabled:j,children:[e.jsx("span",{className:"btn-icon",children:e.jsx(L,{})}),e.jsx("span",{className:"btn-label",children:"Yes, Logout"})]}),e.jsxs("button",{className:"btn retry",onClick:()=>c("profile"),children:[e.jsx("span",{className:"btn-icon",children:e.jsx(O,{})}),e.jsx("span",{className:"btn-label",children:"Cancel"})]})]})]}),e.jsxs("div",{className:"auth-right",children:[e.jsx("span",{className:"flow-label",children:"AUTH FLOW"}),e.jsxs("span",{className:"ue-node ue-node--1",children:[e.jsx("span",{className:"node-step",children:"01"}),"Init Session"]}),e.jsxs("span",{className:"ue-node ue-node--2",children:[e.jsx("span",{className:"node-step",children:"02"}),"OAuth Popup"]}),e.jsxs("span",{className:"ue-node ue-node--3",children:[e.jsx("span",{className:"node-step",children:"03"}),"Verify Token"]}),e.jsxs("span",{className:"ue-node ue-node--4",children:[e.jsx("span",{className:"node-step",children:"04"}),"Access Granted"]}),e.jsxs("svg",{className:"ue-wires",viewBox:"0 0 400 560",preserveAspectRatio:"none","aria-hidden":"true",children:[e.jsx("path",{className:"primary",d:"M 170 73 C 240 73, 180 196, 210 196"}),e.jsx("text",{className:"wire-label",x:"205",y:"126",children:"check_token"}),e.jsx("path",{className:"mid",d:"M 330 196 C 380 196, 380 331, 50 331"}),e.jsx("text",{className:"wire-label",x:"295",y:"268",children:"id_token"}),e.jsx("path",{className:"primary",d:"M 170 331 C 240 331, 180 459, 210 459"}),e.jsx("text",{className:"wire-label",x:"195",y:"389",children:"uid + claims"}),e.jsx("circle",{className:"wire-dot",cx:"205",cy:"134",r:"3"}),e.jsx("circle",{className:"wire-dot wire-dot--mid",cx:"375",cy:"263",r:"3"}),e.jsx("circle",{className:"wire-dot",cx:"200",cy:"395",r:"3"})]})]})]})]})})});export{xe as default};

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.