(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[696],{3416:(e,t,r)=>{"use strict";r.d(t,{ConfirmationCode:()=>d});var o=r(5155),s=r(2115),a=r(63),n=r(2800),l=r(8018),i=r(5279);let d=()=>{i.J.useThemeColor("#EEF3FC"),i.J.useBodyColor("#EEF3FC");let e=(0,a.useRouter)(),[t,r]=(0,s.useState)(["","","","",""]);return(0,o.jsx)(l.d.MotionWrapper,{children:(0,o.jsxs)(l.d.SafeAreaView,{children:[(0,o.jsx)(l.d.Header,{showGoBack:!0,title:"Verify Your Number"}),(0,o.jsxs)("main",{style:{marginTop:n.A.sizes.headerHeight,paddingLeft:20,paddingRight:20,paddingTop:20,paddingBottom:20},children:[(0,o.jsx)("p",{style:{marginBottom:30},children:"Enter your OTP code here."}),(0,o.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:6,marginBottom:30},children:t.map((e,s)=>(0,o.jsx)("button",{onClick:()=>((e,o)=>{let s=window.prompt("Enter code",o);if(null!==s){let o=s.split(""),a=[...t];for(let r=0;r<o.length&&e+r<t.length;r++)a[e+r]=o[r];r(a)}})(s,e),style:{width:"100%",borderRadius:5,padding:"13px 20px",textAlign:"center",fontSize:22,display:"flex",alignItems:"center",justifyContent:"center",aspectRatio:"1",backgroundColor:t[s]?"#F3D0CA":n.A.colors.whiteColor,color:n.A.colors.mainDarkColor},children:e||"_"},s))}),(0,o.jsxs)("span",{style:{marginBottom:30,display:"block"},children:["Didn’t receive the OTP?"," ",(0,o.jsx)("span",{onClick:()=>{alert("Resend OTP logic goes here")},style:{color:n.A.colors.mainColor2,cursor:"pointer"},children:"Resend."})]}),(0,o.jsx)(l.d.Button,{label:"Confirm",onClickAction:()=>{e.push(n.A.routes.home)}})]})]})})}},5279:(e,t,r)=>{"use strict";r.d(t,{J:()=>l});var o=r(5125),s=r(2115);let a="https://george-fx.github.io/yummer-api/",n={GET_OFFERS:"".concat(a,"offers.json"),GET_DISHES:"".concat(a,"dishes.json"),GET_PROMOCODES:"".concat(a,"promocodes.json")},l={useGetDish:e=>{let[t,r]=(0,s.useState)(null),[a,l]=(0,s.useState)(!0),i=async()=>{l(!0);try{var t;let s=await o.A.get(n.GET_DISHES),a=(null!=(t=s.data.dishes)?t:s.data).find(t=>t.id===e);return r(a||null),l(!1),a}catch(e){throw l(!1),console.error("Error fetching dishes:",e),e}};return(0,s.useEffect)(()=>{i()},[e]),{dish:t,isLoading:a}},useFormField:e=>{let[t,r]=(0,s.useState)(e);return{form:t,setForm:r,handleChangeField:(e,o)=>{let s=window.prompt("Enter your ".concat(o),t[e]);null!==s&&r(t=>({...t,[e]:s}))}}},useGetDishes:()=>{let[e,t]=(0,s.useState)([]),[r,a]=(0,s.useState)(!0),l=async()=>{a(!0);try{let e=await o.A.get(n.GET_DISHES);if(!e.data)throw Error("No data in response");let r=e.data.dishes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{a(!1)}};return(0,s.useEffect)(()=>{l()},[]),{dishes:e,loading:r}},useBodyColor:e=>{(0,s.useEffect)(()=>{let t=document.body.style.backgroundColor;return document.body.style.backgroundColor=e,()=>{document.body.style.backgroundColor=t}},[e])},useGetOffers:()=>{let[e,t]=(0,s.useState)([]),[r,a]=(0,s.useState)(!0),l=async()=>{a(!0);try{let e=await o.A.get(n.GET_OFFERS);if(!e.data)throw Error("No data in response");let r=e.data.offers||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{a(!1)}};return(0,s.useEffect)(()=>{l()},[]),{offers:e,loading:r}},useThemeColor:e=>{(0,s.useEffect)(()=>{let t=document.querySelector('meta[name="theme-color"]');t||((t=document.createElement("meta")).setAttribute("name","theme-color"),document.head.appendChild(t));let r=t.getAttribute("content");return t.setAttribute("content",e),()=>{r&&t.setAttribute("content",r)}},[e])},useGetPromocodes:()=>{let[e,t]=(0,s.useState)([]),[r,a]=(0,s.useState)(!0),l=async()=>{a(!0);try{let e=await o.A.get(n.GET_PROMOCODES);if(!e.data)throw Error("No data in response");let r=e.data.promocodes||e.data||[];t(r)}catch(e){throw console.error("API request failed:",e),e}finally{a(!1)}};return(0,s.useEffect)(()=>{l()},[]),{promocodes:e,loading:r}}}},7066:(e,t,r)=>{Promise.resolve().then(r.bind(r,3416))}},e=>{e.O(0,[171,385,125,406,18,441,315,358],()=>e(e.s=7066)),_N_E=e.O()}]);