PageSourceSearch

https://canndr.com/app/_next/static/chunks/pages/login-09e3f7eaa02f25bb.js

js canndr.com collected 2026-10-01 23:45:41 UTC 7,352 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3459],{10545:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return r(23196)}])},37971:function(e,t,r){"use strict";r.d(t,{Lf:function(){return d},Vw:function(){return i},Ww:function(){return l},o_:function(){return c},t0:function(){return s},wN:function(){return o}});var a=r(6154),n=r(76799);let s=async e=>{let{headers:t,params:r}=e;try{let e=await a.Z.get("".concat(n.J,"/address"),{headers:t,params:r});if(e)return e.data}catch(e){console.error(e)}},o=async e=>{let{headers:t,params:r,id:s}=e;try{let e=await a.Z.get("".concat(n.J,"/address/").concat(s),{headers:t,params:r});if(e)return e.data}catch(e){console.error(e)}},i=async e=>{let{headers:t,body:r}=e;try{let e=await a.Z.post("".concat(n.J,"/address"),r,{headers:t});if(e)return e.data}catch(e){console.error(e)}},c=async e=>{let{headers:t,body:r,id:s}=e;try{let e=await a.Z.post("".concat(n.J,"/address/").concat(s),r,{headers:t});if(e)return e.data}catch(e){throw console.error(e),e}},l=async e=>{let{headers:t,body:r,id:s}=e;try{let e=await a.Z.post("".concat(n.J,"/address/").concat(s,"/primary"),r,{headers:t});if(e)return e.data}catch(e){throw console.error(e),e}},d=async e=>{let{headers:t,id:r}=e;try{let e=await a.Z.delete("".concat(n.J,"/address/").concat(r),{headers:t});if(e)return e.data}catch(e){throw console.error(e),e}}},23196:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return z}});var a,n=r(85893),s=r(15354),o=r(20166),i=r(43303),c=r(59979),l=r(94246),d=r(50280),p=r(33367),u=r(41664),x=r.n(u),h=r(48402),f=r(7320),g=r(79386),m=r(49979),y=r(11163),w=r(39626);let _={cookieName:"CannDr_App",password:"yPo4T7apfbdvctV1Bso1oAndQH9qwC94",cookieOptions:{secure:!1}};var j=r(97133),E=r(67294),Z=r(4119),b=r(63006),v=r(9473),k=r(69483),F=r.n(k),S=r(93085),N=r(76799),C=r(6154);a=async(e,t)=>{if("POST"===e.method){let{role:r,name:a,first_name:n,access_token:s,firebase_token:o,profile_picture:i,device_footprint:c}=await e.body;try{let l={role:r,name:a,isLoggedIn:!0,first_name:n,access_token:s,firebase_token:o,profile_picture:i,device_footprint:c};e.session.user=l,await e.session.save(),t.json(l)}catch(r){let{response:e}=r;t.status((null==e?void 0:e.status)||500).json(r.data)}}return t.status(404)},async(e,t)=>(e.session=await (0,S.iW)(e,t,_),a(e,t));let D=async e=>{let{headers:t,body:r}=e;try{let e=await C.Z.post(N.J+"/auth/login",r,{headers:t});if(e)return e.data}catch(e){throw console.error(e),e}};var A=r(37971),T=r(77724),z=()=>{let e=(0,y.useRouter)(),{mutateUser:t}=(0,h.Z)({redirectTo:"/product",redirectIfFound:!0}),r=(0,v.I0)(),a=(0,v.v9)(e=>e.address.addressData),[u,_]=(0,E.useState)(!1),[k,S]=(0,E.useState)(""),[N,C]=(0,E.useState)(!1),[z,B]=(0,E.useState)(!1),[H,I]=(0,E.useState)(null),[J,P]=(0,E.useState)(!1),[L,O]=(0,E.useState)("");(0,E.useEffect)(()=>{e.query.error&&(S(e.query.error),C(!0))},[e]);let W=async()=>{P(!0);try{let e=await F().getItem("fcm_token");e||(e=await F().getItem("temp_token")),I(e)}catch(e){console.error(e)}finally{P(!1)}};(0,E.useEffect)(()=>{W()},[]);let R=async e=>{e.preventDefault(),_(!0);try{let n={email:e.target.email.value,password:e.target.password.value,device:"pwa",firebase_token:H,device_footprint:H},s=await D({body:n});if(t(await (0,m.Z)("/app/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.data.name,role:s.data.role,access_token:s.access_token,first_name:s.data.first_name,profile_picture:s.data.profile_picture,device_footprint:s.data.device_footprint,firebase_token:s.data.firebase_token})})),"consumen"===s.data.role&&a.email===e.target.email.value){let e={name:a.name,name_user:"".concat(a.first_name," ").concat(a.last_name),complete_address:a.address,city:a.city,state_province_region:a.state_province_region,postal_code:a.postal_code,country:a.country,phone_number:a.phone_number,is_primary:!0};await (0,A.Vw)({headers:{Authorization:"Bearer ".concat(s.access_token)},body:e}),r((0,T.RH)())}r((0,b.LZ)()),_(!1),C(!1)}catch(e){var n,s;_(!1),C(!0),S(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(n=s.data)||void 0===n?void 0:n.message)}};return J?(0,n.jsx)(E.Fragment,{children:(0,n.jsx)(s.Z,{direction:"row",justifyContent:"center",alignItems:"center",spacing:0,height:"100vh",bgcolor:"#FFFFFF",children:(0,n.jsx)(o.Z,{})})}):(0,n.jsxs)(E.Fragment,{children:[(0,n.jsx)(f.Z,{}),(0,n.jsx)(i.Z,{sx:{background:"var(--Gradient, linear-gradient(180deg, #FFF 0%, #DBE5F4 100%))",padding:{xs:"20px",md:"30px",lg:"50px"}},className:"space-y-5 w-full h-screen ",children:(0,n.jsxs)(c.Z,{sx:{background:"#FFFFFF",padding:"30px",margin:{xs:"50px 0px 0px 0px",md:"0px auto",lg:"0px auto"},width:{xs:"100%",md:"50%",lg:"30%"},borderRadius:"10px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"start",ga
1p:2},children:[(0,n.jsx)(l.Z,{color:"#084B84",fontSize:"32px",lineHeight:"40px",fontWeight:"700",children:"Login"}),(0,n.jsx)(l.Z,{color:"#5E5E5E",fontSize:"15px",lineHeight:"22px",fontWeight:"400",children:"Enter your registered email and password"}),(0,n.jsxs)("form",{onSubmit:R,style:{width:"100%"},children:[N&&(0,n.jsxs)(d.Z,{severity:"error",action:(0,n.jsx)(p.Z,{"aria-label":"close",color:"inherit",size:"small",onClick:()=>{C(!1)},children:(0,n.jsx)(w.Z,{fontSize:"inherit"})}),className:"my-4",children:[k," 'error'"]}),(0,n.jsxs)(s.Z,{direction:"column",justifyContent:"center",gap:4,marginTop:"10px",children:[(0,n.jsxs)(i.Z,{className:"space-y-3",children:[(0,n.jsx)(l.Z,{color:"#5E5E5E",fontSize:"15px",lineHeight:"22px",fontWeight:"400",children:"Email"}),(0,n.jsx)("input",{id:"email",type:"email",className:"border w-full ".concat(N?"border-[#E05A5A]":"border-[#D3D3D3]"," px-4 py-2 rounded-[10px]"),placeholder:"Email"})]}),(0,n.jsxs)(i.Z,{className:"space-y-3",children:[(0,n.jsx)(l.Z,{color:"#5E5E5E",fontSize:"15px",lineHeight:"22px",fontWeight:"400",children:"Password"}),(0,n.jsxs)(s.Z,{direction:"row",alignItems:"center",sx:{border:N?"solid 1px #E05A5A":"solid 1px #D3D3D3",borderRadius:"10px",padding:"5px"},children:[(0,n.jsx)("input",{id:"password",onChange:e=>{O(e.target.value)},type:z?"text":"password",className:"px-4 py-1 w-11/12",placeholder:"Password"}),(0,n.jsx)("span",{className:"align-end",onClick:()=>{B(!z)},children:z?(0,n.jsx)(Z.Z,{sx:{fill:N?"#E05A5A":"#45BEDC"}}):(0,n.jsx)(j.Z,{sx:{fill:N?"#E05A5A":"#45BEDC"}})})]})]})]}),(0,n.jsx)(x(),{href:"/forgot-password",children:(0,n.jsx)(l.Z,{color:"#084B84",fontSize:"12px",lineHeight:"18px",marginTop:"10px",textAlign:"right",children:"Forgot my password?"})}),(0,n.jsx)("button",{type:"submit",className:"w-full rounded-[5px] px-3 py-2 text-white ".concat(u?"bg-[#5E5E5E]":"bg-[#084B84]"," mt-[30px] mb-[40px]"),disabled:u,children:u?"Loading...":"Log in"})]}),(0,n.jsxs)(s.Z,{direction:"row",justifyContent:"center",alignItems:"center",gap:1.5,sx:{margin:"0 auto"},children:[(0,n.jsx)(l.Z,{color:"#5E5E5E",fontSize:"15px",lineHeight:"22px",marginTop:"10px",children:"New to Canndr\xae?"}),(0,n.jsx)(x(),{href:"register",children:(0,n.jsx)(l.Z,{color:"#45BEDC",fontSize:"15px",lineHeight:"22px",marginTop:"10px",children:"Register here."})})]})]})}),(0,n.jsx)(g.Z,{})]})}}},function(e){e.O(0,[314,9510,5396,1664,4466,9e3,3740,1457,7998,7966,9386,2888,9774,179],function(){return e(e.s=10545)}),_N_E=e.O()}]);

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.