Files
doormile_crm_build/dist/assets/Login-CgdxLoPW.js
2026-06-20 15:13:25 +05:30

2 lines
8.8 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{a5 as B,j as o,l as N,m as q,a as u,n as E,o as T,_ as m,p as F,q as f,v as D,w as W,a4 as O,A as U,aq as V,ar as Y,T as p,S as M,as as J,B as k,at as G,I as K,au as Q}from"./index-mDUCEeiv.js";import{S as X,d as Z,a as ee}from"./VisibilityOff-DQRJ2Fa5.js";import{C as oe,L as re}from"./Link-BkghO-68.js";import{T as A}from"./TextField-CdVeyUgA.js";import{I as te}from"./InputAdornment-Bt0pkIZg.js";import{B as ae}from"./Button-D2bq7RYw.js";const se=B(o.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),ne=B(o.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),le=B(o.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function ie(e){return N("MuiCheckbox",e)}const R=q("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),ce=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],de=e=>{const{classes:r,indeterminate:t,color:n,size:l}=e,a={root:["root",t&&"indeterminate",`color${f(n)}`,`size${f(l)}`]},i=D(a,ie,r);return m({},r,i)},pe=W(X,{shouldForwardProp:e=>O(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.indeterminate&&r.indeterminate,r[`size${f(t.size)}`],t.color!=="default"&&r[`color${f(t.color)}`]]}})(({theme:e,ownerState:r})=>m({color:(e.vars||e).palette.text.secondary},!r.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${r.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[r.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:U(r.color==="default"?e.palette.action.active:e.palette[r.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},r.color!=="default"&&{[`&.${R.checked}, &.${R.indeterminate}`]:{color:(e.vars||e).palette[r.color].main},[`&.${R.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ue=o.jsx(ne,{}),me=o.jsx(se,{}),be=o.jsx(le,{}),xe=u.forwardRef(function(r,t){var n,l;const a=E({props:r,name:"MuiCheckbox"}),{checkedIcon:i=ue,color:b="primary",icon:c=me,indeterminate:d=!1,indeterminateIcon:s=be,inputProps:S,size:v="medium",className:y}=a,z=T(a,ce),I=d?s:c,x=d?s:i,C=m({},a,{color:b,indeterminate:d,size:v}),h=de(C);return o.jsx(pe,m({type:"checkbox",inputProps:m({"data-indeterminate":d},S),icon:u.cloneElement(I,{fontSize:(n=I.props.fontSize)!=null?n:v}),checkedIcon:u.cloneElement(x,{fontSize:(l=x.props.fontSize)!=null?l:v}),ownerState:C,ref:t,className:F(h.root,y)},z,{classes:h}))});function he(e){return N("MuiFormControlLabel",e)}const j=q("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fe=e=>{const{classes:r,disabled:t,labelPlacement:n,error:l,required:a}=e,i={root:["root",t&&"disabled",`labelPlacement${f(n)}`,l&&"error",a&&"required"],label:["label",t&&"disabled"],asterisk:["asterisk",l&&"error"]};return D(i,he,r)},ve=W("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[{[`& .${j.label}`]:r.label},r.root,r[`labelPlacement${f(t.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>m({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${j.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${j.label}`]:{[`&.${j.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),Ce=W("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${j.error}`]:{color:(e.vars||e).palette.error.main}})),ke=u.forwardRef(function(r,t){var n,l;const a=E({props:r,name:"MuiFormControlLabel"}),{className:i,componentsProps:b={},control:c,disabled:d,disableTypography:s,label:S,labelPlacement:v="end",required:y,slotProps:z={}}=a,I=T(a,ge),x=V(),C=(n=d??c.props.disabled)!=null?n:x==null?void 0:x.disabled,h=y??c.props.required,_={disabled:C,required:h};["checked","name","onChange","value","inputRef"].forEach(P=>{typeof c.props[P]>"u"&&typeof a[P]<"u"&&(_[P]=a[P])});const H=Y({props:a,muiFormControl:x,states:["error"]}),$=m({},a,{disabled:C,labelPlacement:v,required:h,error:H.error}),w=fe($),L=(l=z.typography)!=null?l:b.typography;let g=S;return g!=null&&g.type!==p&&!s&&(g=o.jsx(p,m({component:"span"},L,{className:F(w.label,L==null?void 0:L.className),children:g}))),o.jsxs(ve,m({className:F(w.root,i),ownerState:$,ref:t},I,{children:[u.cloneElement(c,_),h?o.jsxs(M,{display:"block",children:[g,o.jsxs(Ce,{ownerState:$,"aria-hidden":!0,className:w.asterisk,children:["","*"]})]}):g]}))}),je="/assets/mid-mile-approach-Drwn-ig9.jpg";function we(){const e=J(),[r,t]=u.useState(!1),[n,l]=u.useState(""),[a,i]=u.useState(""),[b,c]=u.useState(""),d=async()=>{try{c("");const s=await Q(n,a);localStorage.setItem("logged_in","true"),localStorage.setItem("auth_token",s.token),localStorage.setItem("user",JSON.stringify(s.user)),e("/dashboard")}catch(s){c(s.message||"Invalid email or password")}};return o.jsxs(k,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundImage:`url(${je})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(15,23,42,0.6) 0%, rgba(192, 18, 39, 0.8) 100%)",zIndex:1}},children:[o.jsxs(oe,{sx:{position:"relative",zIndex:2,width:"100%",maxWidth:440,p:{xs:4,sm:5},m:2,background:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",borderRadius:4},children:[o.jsx(k,{sx:{mb:4,display:"flex",justifyContent:"center"},children:o.jsx(G,{})}),o.jsx(p,{variant:"h3",sx:{fontWeight:800,textAlign:"center",letterSpacing:"-0.5px",color:"#1e293b"},children:"Welcome back"}),o.jsx(p,{variant:"body1",sx:{mt:1,mb:4,textAlign:"center",color:"#475569"},children:"Sign in to your Doormile operations account."}),o.jsxs(M,{spacing:2.5,children:[o.jsxs(k,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Email"}),o.jsx(A,{fullWidth:!0,placeholder:"Enter your email address",value:n,onChange:s=>l(s.target.value),sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}}})]}),o.jsxs(k,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Password"}),o.jsx(A,{fullWidth:!0,type:r?"text":"password",placeholder:"Enter your password",value:a,onChange:s=>i(s.target.value),sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}},InputProps:{endAdornment:o.jsx(te,{position:"end",children:o.jsx(K,{onClick:()=>t(s=>!s),edge:"end",size:"small",children:r?o.jsx(Z,{fontSize:"small",sx:{color:"#94a3b8"}}):o.jsx(ee,{fontSize:"small",sx:{color:"#94a3b8"}})})})}})]}),o.jsxs(M,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[o.jsx(ke,{control:o.jsx(xe,{defaultChecked:!0,size:"small",sx:{color:"#cbd5e1","&.Mui-checked":{color:"primary.main"}}}),label:o.jsx(p,{variant:"body2",sx:{color:"#475569",fontWeight:500},children:"Remember me"})}),o.jsx(re,{href:"#",underline:"hover",variant:"body2",color:"primary",sx:{fontWeight:600},children:"Forgot password?"})]}),b&&o.jsx(p,{variant:"body2",color:"error",textAlign:"center",sx:{fontWeight:600},children:b}),o.jsx(ae,{fullWidth:!0,size:"large",variant:"contained",onClick:d,sx:{mt:2,py:1.5,borderRadius:2,fontSize:"1.05rem",fontWeight:700,textTransform:"none",boxShadow:"0 8px 16px rgba(192, 18, 39, 0.25)","&:hover":{boxShadow:"0 12px 20px rgba(192, 18, 39, 0.35)",transform:"translateY(-1px)"},transition:"all 0.2s ease"},children:"Sign In"})]})]}),o.jsx(k,{sx:{position:"absolute",bottom:20,zIndex:2},children:o.jsxs(p,{variant:"caption",sx:{color:"rgba(255,255,255,0.8)",fontSize:"0.8rem"},children:["© ",new Date().getFullYear()," Doormile Technologies. All rights reserved."]})})]})}export{we as default};