(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9566],{3054:function(e,A,t){Promise.resolve().then(t.bind(t,56278))},7235:function(e,A,t){"use strict";t.d(A,{Z:function(){return x}});var s=t(4671),r=t(2265),a=t(41448),l=t.n(a),c=["variant","color","size"],o=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{d:"M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10ZM12 14.5c-5.01 0-9.09 3.36-9.09 7.5 0 .28.22.5.5.5h17.18c.28 0 .5-.22.5-.5 0-4.14-4.08-7.5-9.09-7.5Z",fill:A}))},n=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{d:"M15.02 3.01A4.944 4.944 0 0 0 12 2C9.24 2 7 4.24 7 7s2.24 5 5 5 5-2.24 5-5M20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},i=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{opacity:".4",d:"M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z",fill:A}),r.createElement("path",{d:"M12 14.5c-5.01 0-9.09 3.36-9.09 7.5 0 .28.22.5.5.5h17.18c.28 0 .5-.22.5-.5 0-4.14-4.08-7.5-9.09-7.5Z",fill:A}))},d=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{d:"M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10ZM20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},u=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{d:"M12 12.75c-3.17 0-5.75-2.58-5.75-5.75S8.83 1.25 12 1.25 17.75 3.83 17.75 7s-2.58 5.75-5.75 5.75Zm0-10A4.26 4.26 0 0 0 7.75 7 4.26 4.26 0 0 0 12 11.25 4.26 4.26 0 0 0 16.25 7 4.26 4.26 0 0 0 12 2.75ZM20.59 22.75c-.41 0-.75-.34-.75-.75 0-3.45-3.52-6.25-7.84-6.25S4.16 18.55 4.16 22c0 .41-.34.75-.75.75s-.75-.34-.75-.75c0-4.27 4.19-7.75 9.34-7.75 5.15 0 9.34 3.48 9.34 7.75 0 .41-.34.75-.75.75Z",fill:A}))},m=function(e){var A=e.color;return r.createElement(r.Fragment,null,r.createElement("path",{d:"M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),r.createElement("path",{opacity:".4",d:"M20.59 22c0-3.87-3.85-7-8.59-7s-8.59 3.13-8.59 7",stroke:A,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},h=function(e,A){switch(e){case"Bold":return r.createElement(o,{color:A});case"Broken":return r.createElement(n,{color:A});case"Bulk":return r.createElement(i,{color:A});case"Linear":default:return r.createElement(d,{color:A});case"Outline":return r.createElement(u,{color:A});case"TwoTone":return r.createElement(m,{color:A})}},x=(0,r.forwardRef)(function(e,A){var t=e.variant,a=e.color,l=e.size,o=(0,s._)(e,c);return r.createElement("svg",(0,s.a)({},o,{xmlns:"http://www.w3.org/2000/svg",ref:A,width:l,height:l,viewBox:"0 0 24 24",fill:"none"}),h(t,a))});x.propTypes={variant:l().oneOf(["Linear","Bold","Broken","Bulk","Outline","TwoTone"]),color:l().string,size:l().oneOfType([l().string,l().number])},x.defaultProps={variant:"Linear",color:"currentColor",size:"24"},x.displayName="User"},56278:function(e,A,t){"use strict";t.r(A),t.d(A,{default:function(){return y}});var s=t(57437),r=t(46907),a=t(83248),l=t(32878),c=t(66997),o=t(71485),n=t(53576),i=t(18951),d=t(99200),u=t(46682),m=t(38472),h=t(7235),x=t(66648),g=t(87138),f=t(16463),p=t(2265),E=t(57079),v=t(95472),b=t(23104);let w=l.map(e=>({label:e.title,value:e.id})),j=e=>{let{visible:A,setVisible:t}=e,[r,a]=(0,p.useState)([]);(0,p.useEffect)(()=>{(async()=>{try{let e=await m.Z.post("/api/user/privacy-policy");a(e.data)}catch(e){console.error("Failed to fetch privacy policy",e)}})()},[]);let l=e=>e.replace(/\r\n|\r|\n/g,"<br />");return(0,s.jsx)(v.V,{header:"Privacy Policy",visible:A,draggable:!1,className:"max-w-[800px] w-[96%] max-h-[60vh]",onHide:()=>{t(!1)},resizable:!1,children:(0,s.jsx)("div",{className:"m-0 flex flex-col space-y-4",children:r.map((e,A)=>(0,s.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-slate-800",children:e.subject}),(0,s.jsx)("p",{className:"text-sm text-slate-700",dangerouslySetInnerHTML:{__html:l(e.description)}})]},A))})})};var B=()=>{let{selectedSite:e,setSelectedSite:A}=(0,b.H)();(0,p.useEffect)(()=>{if(!e&&w.length>0){let e=setTimeout(()=>{A({label:w[0].label,value:w[0].value})},1e3);return()=>clearTimeout(e)}},[e,A,w]);let[t,r]=(0,p.useState)(!1),[l,v]=(0,p.useState)(""),[B,Q]=(0,p.useState)(""),[y,N]=(0,p.useState)(""),[k,C]=(0,p.useState)(!0),Z=(0,f.useRouter)(),{clearAll:O}=(0,c.Z)(),S=async A=>{A.preventDefault();try{if(!k){(0,o.Z)("You must agree to our privacy policy","error");return}if(!l||!B){(0,o.Z)("Email and password are required","error");return}if(B!==y){(0,o.Z)("Passwords do not match","error");return}r(!0);let A=await m.Z.post("/api/user/register",{email:l,password:B,site_id:null==e?void 0:e.value});A.data.status&&((0,o.Z)(A.data.message,"success"),O(),Z.replace("/face-recognition"))}catch(e){e.response.data.message?(0,o.Z)(e.response.data.message,"error"):(0,o.Z)("An error occurred","error")}finally{r(!1)}},[z,I]=(0,p.useState)(!1);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("form",{className:"p-4 pb-8 md:pb-4 flex flex-col w-full space-y-3 md:shadow-xl rounded-md mt-16",onSubmit:S,children:[(0,s.jsx)("div",{className:"flex justify-center bg-white shadow-md rounded-md m-auto h-20 -mt-16",children:(0,s.jsx)(x.default,{src:a.Z.src,alt:"GL Clix",width:80,height:80,className:"p-2"})}),(0,s.jsx)("div",{className:"flex flex-col space-y-2 !mt-5",children:(0,s.jsx)("h1",{className:"text-lg font-medium text-center",children:"Register your account"})}),(0,s.jsx)("div",{children:(0,s.jsx)(n.Z,{style:{width:"100%"},placeholder:"Select a site",value:e,onChange:(e,t)=>{Array.isArray(t)?A({label:t[0].label,value:t[0].value}):A(t)},options:w})}),(0,s.jsx)("div",{children:(0,s.jsx)(E.Z,{})}),(0,s.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,s.jsx)("div",{className:"w-full border-t border-slate-300"}),(0,s.jsx)("p",{className:"text-xs text-slate-400",children:"OR"}),(0,s.jsx)("div",{className:"w-full border-t border-slate-300"})]}),(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"email",className:"text-xs text-slate-600",children:"Email"}),(0,s.jsx)(i.Z,{type:"email",value:l,className:"!text-base",onChange:e=>v(e.target.value),suffix:(0,s.jsx)(h.Z,{size:"16",color:"#888"}),id:"email"})]}),(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"password",className:"text-xs text-slate-600",children:"Create Password"}),(0,s.jsx)(i.Z.Password,{id:"password",value:B,className:"!text-base",onChange:e=>Q(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[(0,s.jsx)("label",{htmlFor:"confirm_password",className:"text-xs text-slate-600",children:"Confirm Password"}),(0,s.jsx)(i.Z.Password,{id:"confirm_password",value:y,className:"!text-base",onChange:e=>N(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex justify-start items-center space-x-2",children:[(0,s.jsx)(d.Z,{id:"privacy_policy_checkbox",checked:k,onChange:e=>C(e.target.checked)}),(0,s.jsxs)("label",{htmlFor:"privacy_policy_checkbox",className:"text-xs text-slate-600",children:["By signing up you agree to our",(0,s.jsx)("button",{type:"button",className:"font-bold ml-1",onClick:()=>I(!0),children:"Privacy Policy"})]})]}),(0,s.jsx)(u.ZP,{type:"primary",htmlType:"submit",loading:t,children:"Register"}),(0,s.jsxs)("p",{className:"text-sm text-slate-600 text-center",children:["Have an account?",(0,s.jsx)(g.default,{href:"/login",children:(0,s.jsx)("b",{className:"ml-1 text-primary",children:"Login"})})]})]}),(0,s.jsx)(j,{visible:z,setVisible:I})]})},Q=t(1427);function y(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Q.Z,{title:"Register"}),(0,s.jsx)(N,{})]})}let N=()=>(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"bg-white w-full h-dvh overflow-auto flex flex-col md:flex-row justify-between items-center md:p-8 md:space-x-4",children:[(0,s.jsx)("div",{className:"max-w-[50%] w-full h-full rounded-lg hidden md:block",children:(0,s.jsx)(r.Z,{})}),(0,s.jsx)("div",{className:"w-full h-full -mb-16 md:hidden",children:(0,s.jsx)(r.Z,{})}),(0,s.jsx)("div",{className:"w-full h-full flex justify-center items-center m-auto z-50",children:(0,s.jsx)("div",{className:"w-full md:max-w-[350px] md:w-[96%] m-auto",children:(0,s.jsx)(B,{})})})]})})},57079:function(e,A,t){"use strict";t.d(A,{Z:function(){return m}});var s=t(57437),r=t(66648),a=t(2265),l={src:"/_next/static/media/google-login.45e331aa.png"},c=t(30998),o=t(71485),n=t(38472),i=t(16463),d=t(23104),u=t(78421),m=()=>{let{selectedSite:e}=(0,d.H)(),A=null==e?void 0:e.value,{data:t}=(0,c.useSession)(),m=(0,i.useRouter)(),[h,x]=(0,a.useState)(!1),g=async()=>{(0,c.signIn)("google")};return(0,a.useEffect)(()=>{(async()=>{var e;if((null==t?void 0:null===(e=t.user)||void 0===e?void 0:e.email)&&t.token)try{x(!0);let e=await n.Z.post("/api/user/google-authentication",{email:t.user.email,auth_token:t.token,site_id:A});(0,o.Z)(e.data.message,"success"),(0,c.signOut)({redirect:!1}),e.data.isNew?m.push("/face-recognition"):m.push("/album")}catch(e){e.response.data.message?(0,o.Z)(e.response.data.message,"error"):(0,o.Z)("An error occurred","error")}finally{x(!1)}})()},[t,A,m]),(0,s.jsx)("button",{type:"button",className:"w-full bg-transparent flex justify-center items-center space-x-2 border border-slate-200 p-1 rounded-lg bg-white hover:bg-slate-100 transition disabled:pointer-events-none",onClick:g,disabled:h,children:h?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"w-4 h-6",children:(0,s.jsx)(u.Z,{size:"small"})})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.default,{width:22,height:22,src:l.src,alt:"Google",className:"bg-white p-0.5 rounded-full"}),(0,s.jsx)("p",{className:"text-xs text-slate-800",children:"Continue with Google"})]})})}},46907:function(e,A,t){"use strict";t.d(A,{Z:function(){return l}});var s=t(57437),r=t(2265);let a=[{src:"/_next/static/media/DSC2063.09d274b1.png",height:1210,width:1613,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAXVBMVEXTza4/U17Qz8FFcYMCoOw/kqEKk90vn95pgJA/sO8ThNMkputDntFpteISiNVrpc4Vnd6GuNtnc4Q6ipq9wsmUj5ibyuxVhYa9waxJW2WJxOhwqpNUpJpzmIadnYJ/Zho6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAOklEQVR4nGPg4mNjZ2Nh4WZgl+Ll52EX4GTg5GTm4BASFGOQk2WUZOQQEWWQlmFlZRUWZ2YAAwkmJgA6/QIc88XqKQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:6},{src:"/_next/static/media/DSC2064.13d7d0b9.jpg",height:970,width:960,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOz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AAAAAAAAAAAAAAAAx/9oACAEDAQE/AY//xAAVEQEBAAAAAAAAAAAAAAAAAAAAAf/aAAgBAgEBPwGP/8QAGBAAAgMAAAAAAAAAAAAAAAAAAREAIUH/2gAIAQEABj8CRLvZ/8QAFxABAQEBAAAAAAAAAAAAAAAAAREAIf/aAAgBAQABPyF4pHEWG//aAAwDAQACAAMAAAAQC//EABYRAQEBAAAAAAAAAAAAAAAAAAEAEf/aAAgBAwEBPxBwgF//xAAWEQEBAQAAAAAAAAAAAAAAAAABEQD/2gAIAQIBAT8QVW7/xAAaEAABBQEAAAAAAAAAAAAAAAABABEhQVFh/9oACAEBAAE/EI0AFsGB7a//2Q==",blurWidth:8,blurHeight:7}];var l=()=>{let[e,A]=(0,r.useState)(0);return(0,r.useEffect)(()=>{let e=setInterval(()=>{A(e=>(e+1)%a.length)},3e3);return()=>clearInterval(e)},[]),(0,s.jsx)("div",{className:"relative w-full h-full",children:a.map((A,t)=>(0,s.jsx)("div",{style:{backgroundImage:"url(".concat(A.src,")"),backgroundPosition:"right",backgroundSize:"cover"},className:"absolute top-0 left-0 w-full h-full transition-opacity duration-1000 ease-in-out lg:rounded-lg ".concat(t===e?"opacity-100":"opacity-0")},t))})}},1427:function(e,A,t){"use strict";var s=t(57437);A.Z=function(e){let{title:A}=e;return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("title",{children:"".concat(A," | ").concat("GL Clix")})})}},23104:function(e,A,t){"use strict";t.d(A,{H:function(){return a}});var s=t(39099),r=t(89291);let a=(0,s.Ue)((0,r.tJ)(e=>({selectedSite:null,setSelectedSite:A=>e({selectedSite:A})}),{name:"site-selection",storage:(0,r.FL)(()=>localStorage)}))},66997:function(e,A,t){"use strict";var s=t(39099),r=t(89291);let a=(0,s.Ue)()((0,r.tJ)((e,A)=>({products:{},combos:{},addSelectedToProduct:(A,t)=>e(e=>{let s=e.products[A]||[];return{products:{...e.products,[A]:Array.from(new Set([...s,t]))}}}),removeSelectedFromProduct:(A,t)=>e(e=>{let s=e.products[A]||[];return{products:{...e.products,[A]:s.filter(e=>e!==t)}}}),addSelectedToCombo:(A,t,s)=>e(e=>{let r=e.combos[A]||{},a=r[t]||[];return{combos:{...e.combos,[A]:{...r,[t]:Array.from(new Set([...a,s]))}}}}),removeSelectedFromCombo:(A,t,s)=>e(e=>{let r=e.combos[A]||{},a=r[t]||[];return{combos:{...e.combos,[A]:{...r,[t]:a.filter(e=>e!==s)}}}}),checkAlbumIdInProduct:(e,t)=>{let s=A().products[e];return!!s&&s.includes(t)},checkAlbumInCombo:(e,t,s)=>{let r=A().combos[e],a=r?r[t]:[];return(null==a?void 0:a.includes(s))||!1},getProductDetails:e=>A().products[e],getComboDetails:e=>A().combos[e],clearProduct:A=>e(e=>{let t={...e.products};return delete t[A],{products:t}}),clearCombo:A=>e(e=>{let t={...e.combos};return delete t[A],{combos:t}}),clearAll:()=>e({products:{},combos:{}})}),{name:"gl_selected_products",storage:(0,r.FL)(()=>localStorage)}));A.Z=a},71485:function(e,A,t){"use strict";t.d(A,{Z:function(){return r}});var s=t(88726);function r(e){let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";switch(A){case"success":s.ZP.success(e,{duration:4e3});break;case"error":s.ZP.error(e,{duration:4e3});break;default:(0,s.ZP)(e,{duration:4e3})}}},83248:function(e,A){"use strict";A.Z={src:"/_next/static/media/icon-site.d44a2746.svg",height:84,width:76,blurWidth:0,blurHeight:0}},32878:function(e){"use strict";e.exports=JSON.parse('[{"title":"SplashMania @ Gamuda Cove","id":19},{"title":"FunPark @ Gamuda Luge Gardens","id":23},{"title":"Paya Indah Discovery Wetlands @ Gamuda Cove","id":24}]')}},function(e){e.O(0,[8472,8726,1021,6682,6648,7734,2783,3155,6229,7138,3840,8951,4165,3574,4641,8421,998,5472,9200,2971,7023,1744],function(){return e(e.s=3054)}),_N_E=e.O()}]);