PageSourceSearch

https://izios.com/assets/login-C60aZzyn.js

js izios.com collected 2026-10-07 11:22:52 UTC 7,695 bytes, 1 lines download raw bytes

1import{j as e,L as x,b as m,r as d,K as S,h as C,H as L,o as p,I as f,ba as I,aw as P,aj as E,al as F,cp as c}from"./index-CHwprGYH.js";const R=({variant:r="link",className:i=""})=>r==="button"?e.jsx(x,{href:"/password-reset",children:e.jsx(m,{variant:"outline",className:i,children:"Forgot Password?"})}):e.jsx(x,{href:"/password-reset",className:`hover:underline ${i}`,children:"Forgot password?"}),U=()=>{const[r,i]=d.useState(""),[h,w]=d.useState(""),[n,j]=d.useState(!1),[l,u]=d.useState(!1),{login:y}=S(),[A,b]=C(),o=typeof window<"u"?new URLSearchParams(window.location.search).get("redirect"):null,t=o&&o.startsWith("/")&&!o.startsWith("//")?o:null,v=typeof window<"u"?new URLSearchParams(window.location.search).get("google_error"):null,N=()=>{const s=new URLSearchParams;t&&s.set("redirect",t),window.location.href=`/api/auth/google/start${s.toString()?`?${s.toString()}`:""}`},k=async s=>{if(s.preventDefault(),!r||!h){c({title:"Missing information",description:"Please enter both username and password",variant:"destructive"});return}try{u(!0);const a=await y(r,h);a&&a.isAdmin&&!t?(c({title:"Admin Access Granted!",description:"Redirecting to admin dashboard..."}),setTimeout(()=>{b("/admin")},100)):a&&(c({title:"Welcome back!",description:t?"Continuing where you left off...":"Redirecting to diamond collection..."}),setTimeout(()=>{const g=t||"/diamonds";if(g.startsWith("/api/extension/auth/connect?")){window.location.assign(g);return}b(g)},500))}catch(a){c({title:"Login failed",description:a instanceof Error?a.message:"Invalid credentials",variant:"destructive"})}finally{u(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(L,{children:[e.jsx("title",{children:"Login - IZIOS"}),e.jsx("meta",{name:"robots",content:"noindex, nofollow"})]}),e.jsx("main",{id:"main-content",tabIndex:-1,className:"min-h-[100dvh] flex flex-col bg-slate-50 dark:bg-slate-950",style:{paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)"},children:e.jsx("div",{className:"flex-1 flex items-start justify-center px-4 pt-6 pb-8 sm:pt-8 relative z-10",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-4 sm:mb-5",children:[e.jsx(x,{href:"/",className:"inline-block",children:e.jsx("img",{src:"/IZIOS-Logo-final.svg",alt:"IZIOS",className:"h-8 sm:h-9 mx-auto mb-3"})}),e.jsx("h1",{className:"text-xl sm:text-2xl font-semibold tracking-tight text-gray-900 dark:text-white",children:"Welcome back"}),e.jsx("p",{className:"mt-1.5 sm:mt-2 text-sm text-gray-600 dark:text-gray-400",children:"Sign in to access your diamond collection"})]}),e.jsxs("div",{className:"rounded-lg border border-slate-200 bg-white p-5 shadow-sm dark:border-slate-700 dark:bg-slate-900 sm:p-6",children:[v&&e.jsx("div",{className:"mb-5 rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300",children:"Google sign-in could not complete. Please try again."}),e.jsxs(m,{type:"button",variant:"outline",onClick:N,className:"w-full h-11 rounded-lg border-gray-200 bg-white text-gray-700 hover:bg-gray-50 dark:border-slate-700 dark:bg-white dark:text-gray-800 dark:hover:bg-gray-100","data-testid":"button-google-login",children:[e.jsx("span",{className:"mr-2 inline-flex h-5 w-5 items-center justify-center","aria-hidden":"true",children:e.jsxs("svg",{viewBox:"0 0 48 48",className:"h-5 w-5",children:[e.jsx("path",{fill:"#EA4335",d:"M24 9.5c3.5 0 6.6 1.2 9.1 3.6l6.8-6.8C35.7 2.4 30.2 0 24 0 14.6 0 6.5 5.4 2.6 13.3l7.9 6.1C12.4 13.6 17.8 9.5 24 9.5z"}),e.jsx("path",{fill:"#4285F4",d:"M46.5 24.5c0-1.6-.1-3.1-.4-4.5H24v9h12.7c-.5 2.9-2.2 5.4-4.8 7l7.4 5.7c4.3-4 7.2-9.8 7.2-17.2z"}),e.jsx("path",{fill:"#FBBC05",d:"M10.5 28.6c-.5-1.5-.8-3.1-.8-4.8s.3-3.3.8-4.8l-7.9-6.1C1 16.2 0 20 0 23.8s1 7.6 2.6 10.9l7.9-6.1z"}),e.jsx("path",{fill:"#34A853",d:"M24 48c6.2 0 11.5-2 15.3-5.5l-7.4-5.7c-2 1.4-4.7 2.2-7.9 2.2-6.2 0-11.5-4.1-13.5-9.7l-7.9 6.1C6.5 42.6 14.6 48 24 48z"})]})}),"Continue with Google"]}),e.jsxs("div",{className:"relative my-4",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-200 dark:border-slate-700"})}),e.jsx("div",{className:"relative flex justify-center text-xs",children:e.jsx("span",{className:"bg-white dark:bg-slate-900 px-3 text-gray-500 dark:text-gray-400",children:"Or use email"})})]}),e.jsxs("form",{onSubmit:k,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(p,{htmlFor:"username",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Email or Username"}),e.jsx(f,{id:"username",type:"text",autoComplete:"username",placeholder:"[email protected]",value:r,onChange:s=>i(s.target.value),disabled:l,className:"h-11 bg-white dark:bg-slate-800 border-gray-200 dark:border-slate-700 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500","data-testid":"input-username"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(p,{htmlFor:"password",className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Password"}),e.jsx(R,{variant:"link",className:"text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 p-0 h-auto"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(f,{id:"password",type:n?"text":"password",autoComplete:"current-password",placeholder:"Enter your password",value:h,onChange:s=>w(s.target.value),disabled:l,className:"h-11 pr-10 bg-white dark:bg-slate-800 border-gray-200 dark:border-slate-700 focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500","data-testid":"input-password"}),e.jsx("button",{type:"button","aria-label":n?"Hide password":"Show password",onClick:()=>j(!n),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors","data-testid":"button-toggle-password",children:n?e.jsx(I,{className:"h-4 w-4"}):e.jsx(P,{className:"h-4 w-4"})})]})]}),e.jsx(m,{type:"submit",className:"w-full h-11 !bg-blue-600 hover:!bg-blue-700 text-white font-medium rounded-lg shadow-sm transition-colors",disabled:l,"data-testid":"button-login",children:l?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-4 w-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Signing in..."]}):e.jsxs("span",{className:"flex items-center gap-2",children:["Sign In",e.jsx(E,{className:"h-4 w-4"})]})})]}),e.jsxs("div",{className:"relative my-4",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-200 dark:border-slate-700"})}),e.jsx("div",{className:"relative flex justify-center text-xs",children:e.jsx("span",{className:"bg-white dark:bg-slate-900 px-3 text-gray-500 dark:text-gray-400",children:"New to IZIOS?"})})]}),e.jsx(m,{asChild:!0,type:"button",variant:"outline",className:"w-full h-11 border-gray-200 dark:border-slate-700 hover:bg-gray-50 dark:hover:bg-slate-800 text-gray-700 dark:text-gray-300 font-medium rounded-lg transition-colors","data-testid":"button-register",children:e.jsx(x,{href:t?`/register?redirect=${encodeURIComponent(t)}`:"/register",children:"Create a free account"})})]}),e.jsx("div",{className:"mt-4 sm:mt-5 text-center",children:e.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 flex items-center justify-center gap-1.5",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-blue-500 flex-shrink-0"}),e.jsx("span",{children:"Free membership includes wishlists, price alerts & exclusive deals"})]})})]})})})]})};export{U 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.