PageSourceSearch

https://mosaictap.com/assets/Admin-BIFAD4V0.js

js mosaictap.com collected 2026-10-06 08:07:11 UTC 3,550 bytes, 1 lines download raw bytes

1import{r as o,g as x,j as e,L as N,s as f,b as y,N as v,o as b,n as w,p as C,C as I,q as S,t as L}from"./index-Cr_XO-Hb.js";/* empty css                     *//* empty css                    */import"./AdminPanel-ZTpZAxhf.js";/* empty css                          */import"./mobileTabs-C9tFsn84.js";import"./compressor.esm-B9N80obS.js";/* empty css                         */import"./floorPlanMobile-CEyFFLd1.js";/* empty css                          */import"./GeneralKnowledge-5xXCirwZ.js";/* empty css                            */const E=u=>{let[i,h]=o.useState(""),[n,l]=o.useState(""),[r,t]=o.useState(""),[c,m]=o.useState(!1),g=u.setUser;const p=x(),d=async()=>{if(!i||!n){t("Please enter both email and password.");return}m(!0),t("");try{const a=(await f(p,i,n)).user;g(a)}catch(s){const a=s.code,j=s.message;console.error("Sign in error:",a,j),t(a==="auth/invalid-email"?"Invalid email address format.":a==="auth/user-not-found"?"No user found with this email.":a==="auth/wrong-password"?"Incorrect password.":"Failed to sign in. Please try again.")}finally{m(!1)}};return e.jsx("div",{className:"adminSignInContainer",children:e.jsxs("div",{className:"signInFields adminSection",children:[e.jsx("h2",{className:"adminSectionHeader",style:{textAlign:"center",borderBottom:"none",marginBottom:"10px"},children:"Admin Login"}),r&&e.jsx("div",{className:"signInError",children:r}),e.jsxs("div",{className:"formGroup",children:[e.jsx("label",{htmlFor:"email",children:"Email"}),e.jsx("input",{className:"adminInput",id:"email",type:"email",placeholder:"[email protected]",onChange:s=>h(s.target.value),value:i,onKeyDown:s=>s.key==="Enter"&&d()})]}),e.jsxs("div",{className:"formGroup",style:{marginBottom:"20px"},children:[e.jsx("label",{htmlFor:"password",children:"Password"}),e.jsx("input",{className:"adminInput",id:"password",type:"password",placeholder:"••••••••",onChange:s=>l(s.target.value),value:n,onKeyDown:s=>s.key==="Enter"&&d()})]}),e.jsx("button",{className:"actionBtn saveBtn signInButton",onClick:d,disabled:c,style:{width:"100%",display:"flex",justifyContent:"center"},children:c?e.jsx("div",{className:"signInLoadingContainer",children:e.jsx(N,{})}):"SIGN IN"})]})})},Q=u=>{let i=y(),{user:h,setUser:n,roles:l=v}=u;const r=x(),[t,c]=o.useState("");o.useEffect(()=>{const s=b(r,a=>{a?(n(a),c(a.displayName||a.email?.split("@")[0]||"Admin")):n(null)});return()=>s()},[r,n]);const m=async()=>{await S({title:"Log out",message:"Are you sure you want to log out?",confirmLabel:"LOG OUT",danger:!0})&&L(r).then(()=>{i("/admin")}).catch(a=>{console.error("Logout error",a)})};if(h===null)return e.jsx("div",{className:"adminContainer admin-page-background",children:e.jsx(E,{setUser:n})});const g=w.filter(s=>s.path!=="/admin"&&C(s,l)),d=l.isQuizmaster&&!l.isAdmin?"Let's build a quiz.":"Modify the Mosaic Tap.";return e.jsxs("div",{className:"adminDashboard admin-page-background",children:[e.jsxs("header",{className:"dashboardHeader",children:[e.jsxs("div",{className:"welcomeMessage",children:[e.jsxs("h1",{children:["Welcome back, ",t," 👋"]}),e.jsx("p",{children:d})]}),e.jsx("button",{className:"logoutBtn",onClick:m,children:"Logout"})]}),e.jsx("div",{className:"dashboardGrid",children:g.map((s,a)=>e.jsxs("div",{className:"dashboardCard",onClick:()=>i(s.path),children:[e.jsx("div",{className:"cardIcon",dangerouslySetInnerHTML:{__html:s.icon}}),e.jsxs("div",{className:"cardContent",children:[e.jsx("h3",{children:s.title}),e.jsx("p",{children:s.desc})]})]},a))}),e.jsx(I,{})]})};export{Q 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.