1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2705],{2705:(e,t,s)=>{s.r(t),s.d(t,{default:()=>P});var a=s(23347),i=s(23779),l=s(48971),n=s(92639),r=s(99721),o=s(25346),c=s(21319),d=s(48727),m=s(95035),x=s(71443),u=s(49567),p=s(57542),h=s(98225),f=s(98208),g=s(76454),N=s(76024),j=s(70558),b=s(5415),w=s(32507),A=s(18050),_=s(43814),y=s(38839),v=s(68578);let S=e=>{let{onClose:t}=e,s=(0,m.c)(),{setFieldEmail:o,setIsOpenModalSignUp:w,setIsOpenModalSignIn:S,setIsOpenVerifyEmail:P}=(0,g.A)(),[U,k]=x.useState(!1),[E,C]=x.useState(!1),{mutateAsync:R,isPending:F}=(0,c.n)({mutationFn:e=>v.ZQ.signup(e)}),{register:L,handleSubmit:V,reset:q,watch:O,formState:{errors:D}}=(0,u.mN)(),M=O("password",""),T=()=>{q(),k(!1),C(!1),t()},G=async e=>{if(F)return;let{confirmPassword:t,...a}=e;try{o(e.email);let t=await R(a);q(),w(!1),t.user.confirmed?(p.Ay.success(s("Authentication.Action.SignUp_Success_Confirmed")),S(!0)):(p.Ay.success(s("Authentication.Action.SignUp_Success")),P(!0))}catch(a){console.warn("ERROR",a);let{code:e,params:t}=(0,h.D8)(a);p.Ay.error(s.has(e)?s(e,t):s("Errors.SOMETHING_WENT_WRONG"))}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:(0,N.cn)("text-brand font-libre mb-1 text-[32px] leading-[150%] font-semibold","md:text-5xl"),children:s("Authentication.SignUp.title")}),(0,a.jsx)("p",{className:(0,N.cn)("text-sub font-libre text-lg leading-[150%] font-semibold","md:text-xl"),children:s("Authentication.SignUp.subtitle")}),(0,a.jsxs)("form",{className:"pt-6",onSubmit:V(G),children:[(0,a.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,a.jsxs)(i.D,{className:"flex flex-col gap-1",children:[(0,a.jsxs)(l.JU,{className:"font-roboto text-[13px] leading-[150%] lg:text-sm",htmlFor:"fullname",children:[s("Authentication.SignUp.fullName"),(0,a.jsx)("span",{className:"ml-[2px] text-red-500",children:"*"})]}),(0,a.jsx)(n.p,{type:"text",id:"fullname",...L("fullname",{required:s("Authentication.Validate.field_Fullname_Required"),minLength:{value:3,message:s("Authentication.Validate.field_FullName_MinLength")}}),placeholder:s("Authentication.SignUp.placeholder_FullName"),className:(0,j.R)(!!D.fullname)}),D.fullname&&(0,a.jsx)("span",{className:"text-xs text-red-500",children:D.fullname.message})]}),(0,a.jsxs)(i.D,{className:"flex flex-col gap-1",children:[(0,a.jsxs)(l.JU,{className:"font-roboto text-[13px] leading-[150%] lg:text-sm",htmlFor:"email",children:["Email",(0,a.jsx)("span",{className:"ml-[2px] text-red-500",children:"*"})]}),(0,a.jsx)(n.p,{type:"text",id:"email",...L("email",{required:s("Authentication.Validate.field_Email_Required"),pattern:{value:b.eT,message:s("Authentication.Validate.invali
1d_Email")}}),placeholder:s("Authentication.Login.placeholder_Email"),className:(0,j.R)(!!D.email)}),D.email&&(0,a.jsx)("span",{className:"text-xs text-red-500",children:D.email.message})]}),(0,a.jsxs)(i.D,{className:"flex flex-col gap-1",children:[(0,a.jsxs)(l.JU,{className:"font-roboto text-[13px] leading-[150%] lg:text-sm",htmlFor:"password",children:[s("Authentication.Login.password"),(0,a.jsx)("span",{className:"ml-[2px] text-red-500",children:"*"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(n.p,{type:U?"text":"password",id:"password",...L("password",{required:s("Authentication.Validate.field_Password_Required"),minLength:{value:8,message:s("Authentication.Validate.field_Password_MinLength")},pattern:{value:b.Lq,message:s("Authentication.Validate.field_Password_Format")}}),placeholder:s("Authentication.Login.placeholder_Password"),className:(0,N.cn)((0,j.R)(!!D.password),"w-full pr-8")}),(0,a.jsx)(d.default,{src:U?A.A:_.A,alt:"eye",width:16,height:16,className:"absolute top-1/2 right-3 -translate-y-1/2 transform cursor-pointer",onClick:()=>k(!U)})]}),D.password&&(0,a.jsx)("span",{className:"text-xs text-red-500",children:D.password.message})]}),(0,a.jsxs)(i.D,{className:"flex flex-col gap-1",children:[(0,a.jsxs)(l.JU,{className:"font-roboto text-[13px] leading-[150%] lg:text-sm",htmlFor:"confirmPassword",children:[s("Authentication.SignUp.confirmPassword"),(0,a.jsx)("span",{className:"ml-[2px] text-red-500",children:"*"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(n.p,{type:E?"text":"password",id:"confirmPassword",...L("confirmPassword",{required:s("Authentication.Validate.field_ConfirmPassword_Required"),minLength:{value:8,message:s("Authentication.Validate.field_Password_MinLength")},validate:e=>e!==M?s("Authentication.Validate.field_ConfirmPassword_NotMatch"):void 0}),placeholder:s("Authentication.SignUp.placeholder_ConfirmPassword"),className:(0,N.cn)((0,j.R)(!!D.confirmPassword),"w-full pr-8")}),(0,a.jsx)(d.default,{src:E?A.A:_.A,alt:"eye",width:16,height:16,className:"absolute top-1/2 right-3 -translate-y-1/2 transform cursor-pointer",onClick:()=>C(!E)})]}),D.confirmPassword&&(0,a.jsx)("span",{className:"text-xs text-red-500",children:D.confirmPassword.message})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-4 pt-6 pb-4",children:[(0,a.jsx)(r.$,{type:"submit",className:"bg-brand-primary font-roboto hover:bg-brand min-h-10 w-full cursor-pointer px-6 py-2 text-sm leading-[150%] font-medium text-white transition-colors md:text-base",children:F?(0,a.jsx)(f.A,{}):s("Authentication.SignUp.signUp")}),(0,a.jsx)("div",{className:"text-center",children:(0,a.jsxs)("p",{className:(0,N.cn)("text-sub font-roboto text-[13px] leading-[150%] font-medium","md:text-sm"),children:[(0,a.jsxs)("span",{children:[s("Authentication.SignUp.agreeTo")," "]}),(0,a.jsx)(y.N_,{href:"/terms-of-use",className:"text-brand cursor-pointer underline",onClick:T,children:s("Booking.termsOfUse")})," ","&"," ",(0,a.jsx)(y.N_,{href:"/privacy-policy",className:"text-brand cursor-pointer underline",onClick:T,children:s("Booking.policy")})]})})]})]})]})},P=()=>{let{isOpenModalSignUp:e,setIsOpenModalSignUp:t}=(0,g.A)(),s=()=>{t(!1)};return(0,a.jsxs)(o.lG,{open:e,onClose:s,transition:!0,className:"fixed inset-0 z-80 flex w-screen items-center justify-center bg-black/30 p-4 transition duration-300 ease-out data-[closed]:opacity-0",children:[(0,a.jsx)(o.Xi,{className:"fixed inset-0 bg-black/30"}),(0,a.jsx)("div",{className:"fixed inset-0 flex w-screen items-center justify-center p-4",children:(0,a.jsx)(o.Lj,{className:"modal-auth relative max-h-full w-full max-w-[350px] overflow-y-auto bg-white md:max-w-[480px] lg:max-w-[560px]",children:(0,a.jsxs)("div",{className:"border-brand border-t-8 p-4 md:p-8",children:[(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)(r.$,{className:"bg-brand-disabled z-10 flex h-[30px] w-[30px] cursor-pointer items-center justify-center rounded-full",onClick:s,type:"button",children:(0,a.jsx)(d.default,{src:w.A,className:"h-[14px] w-[14px] text-black",alt:"close"})})}),(0,a.jsx)(S,{onClose:s})]})})})]})}},98225:(e,t,s)=>{s.d(t,{D8:()=>l,ax:()=>i});var a=s(41925);function i(e){let t=e.error;if(t&&"object"==typeof t&&!Array.isArray(t)&&"string"==typeof t.code)return t}function l(e){if(e instanceof a.h){let t=i(e.body);if(t)return{code:"Errors.".concat(t.code),params:function(e){if(!e)return;let t={};for(let[s,a]of Object.entries(e))"number"==typeof a&&Number.isFinite(a)||"string"==typeof a||a instanceof Date?t[
1s]=a:null!=a&&(t[s]=String(a));return Object.keys(t).length>0?t:void 0}(t.params)}}return{code:"Errors.SOMETHING_WENT_WRONG"}}}}]);
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.