1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58137,e=>{"use strict";var t=e.i(52530);let r="https://api.dda.az/api";function a(e={}){let t=new URLSearchParams;Object.entries(e).forEach(([e,r])=>{null!=r&&""!==r&&t.set(e,String(r))});let r=t.toString();return r?`?${r}`:""}e.s(["createCurrentUserAddress",0,function(e){return(0,t.requestJson)(`${r}/users/me/addresses/`,{body:e,method:"POST",requiresAuth:!0})},"deleteCurrentUserAddress",0,function(e){return(0,t.requestJson)(`${r}/users/me/addresses/${e}/`,{method:"DELETE",requiresAuth:!0})},"getCheckoutPreview",0,function(e={}){return(0,t.requestJson)(`${r}/users/me/checkout/${a(e)}`,{requiresAuth:!0})},"getCurrentUserAddresses",0,function(){return(0,t.requestJson)(`${r}/users/me/addresses/`,{requiresAuth:!0})},"getCurrentUserBalance",0,()=>(0,t.requestJson)(`${r}/users/me/balance/`,{requiresAuth:!0}),"getCurrentUserProfile",0,()=>(0,t.requestJson)(`${r}/users/me/`,{requiresAuth:!0}),"getCurrentUserReferal",0,()=>(0,t.requestJson)(`${r}/users/me/referral-profile/`,{requiresAuth:!0}),"getCurrentUserReferalRewards",0,(e={})=>(0,t.requestJson)(`${r}/users/me/referrals/rewards/${a(e)}`,{requiresAuth:!0}),"getCurrentUserReferalStats",0,(e={})=>(0,t.requestJson)(`${r}/users/me/referrals/${a(e)}`,{requiresAuth:!0}),"getDeliveryKargomats",0,function(){return(0,t.requestJson)(`${r}/delivery/kargomats/`,{requiresAuth:!0})},"getDeliveryMethods",0,function(){return(0,t.requestJson)(`${r}/delivery/methods/`,{requiresAuth:!0})},"getDeliveryMetroStations",0,function(){return(0,t.requestJson)(`${r}/delivery/metro-stations/`,{requiresAuth:!0})},"getDeliveryPickUp",0,function(){return(0,t.requestJson)(`${r}/delivery/pickup-addresses/`,{requiresAuth:!0})},"getUserOrder",0,function(e={}){return(0,t.requestJson)(`${r}/users/me/orders/${a(e)}`,{requiresAuth:!0})},"getUserTransactions",0,function(e={}){return(0,t.requestJson)(`${r}/users/me/transactions/${a(e)}`,{requiresAuth:!0})},"increaseUserBalance",0,function(e){return(0,t.requestJson)(`${r}/users/me/balance/top-up/`,{requiresAuth:!0,method:"POST",body:e})},"submitCheckout",0,function(e={}){return(0,t.requestJson)(`${r}/users/me/checkout/`,{requiresAuth:!0,method:"POST",body:e})},"updateCurrentUserAddress",0,function(e,a){return(0,t.requestJson)(`${r}/users/me/addresses/${e}/`,{body:a,method:"PATCH",requiresAuth:!0})},"updateCurrentUserProfile",0,e=>{let a,s,i=e.date_of_birth;i&&(a=[i.getFullYear(),String(i.getMonth()+1).padStart(2,"0"),String(i.getDate()).padStart(2,"0")].join("-"));let n={...e,date_of_birth:a},l=e?.profile_image instanceof File?(s=new FormData,Object.entries(n).forEach(([e,t])=>{if(void 0!==t){if(null===t)return void s.append(e,"");s.append(e,t)}}),s):n;return(0,t.requestJson)(`${r}/users/me/`,{requiresAuth:!0,method:"PATCH",body:l})}])},77544,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(58137);let s=(0,r.createContext)({userProfileInfo:null,setUserProfileInfo:()=>{},isUserInfoLoading:!0});e.s(["ProfileProvider",0,function({children:e}){let[i,n]=(0,r.useState)(null),[l,o]=(0,r.useState)(!0);return(0,r.useEffect)(()=>{(async()=>{try{let e=await (0,a.getCurrentUserProfile)();if(e.ok)return n(e.data);n(null)}finally{o(!1)}})()},[]),(0,t.jsx)(s.Provider,{value:{userProfileInfo:i,setUserProfileInfo:n,isUserInfoLoading:l},children:e})},"useProfile",0,()=>(0,r.useContext)(s)])},89664,e=>{"use strict";let t=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,t],89664)},16327,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",0,t],16327)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},47089,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(16327),s=e.i(89664),i=e.i(66595),n=e.i(46932),l=e.i(88653),o=e.i(88442);e.s(["CustomSelect",0,({options:e,value:u,onChange:d,placeholder:c="Select...",label:h,error:m,className:x,searchable:p=!1,isLoading:f=!1})=>{let[g,b]=(0,r.useState)(!1),[y,v]=(0,r.useState)(""),w=(0,r.useRef)(null),k=(0,r.useRef)(null),j=e.find(e=>e.value===u);(0,r.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&b(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,r.useEffect)(()=>{g?p&&k.current&&setTimeout(()=>k.current?.focus(),50):v("")},[g,p]);let N=p?e.filter(e=>e.label.toLowerCase().includes(y.toLowerCase())):e;return(0,t.jsxs)("div",{className:"w-full flex-1",ref:w,children:[h&&(0,t.jsx)("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1.5",children:h}),f?(0,t.jsx)("div",{className:"overflow-hidden w-full h-[50] bg-white dark:bg-slate-900 border rounded-xl outline-none transition-all dark:text-white border-slate-200 dark:border-slate-800 focus:ring-2 focus:ring-primary/20 focus:border-primary ",children:(0,t.jsx)(o.Skeleton,{className:"w-full h-full"})}):(0,t.jsxs)("button",{type:"button",onClick:()=>b(!g),className:`w-full h-[50] flex items-center justify-between px-4 py-3 bg-white dark:bg-slate-900 border rounded-xl outline-none transition-all dark:text-white ${m?"border-red-500 dark:border-red-500 text-red-500":g?"border-primary ring-2 ring-primary/20 focus:ring-2 focus:ring-primary/20 focus:border-primary ":"hover:border-slate-300 dark:hover:border-slate-600 border-slate-200 dark:border-slate-800"} ${x||""}`,children:[(0,t.jsx)("span",{className:`block truncate text-[13px] ${!j?"text-slate-400":"text-slate-900 dark:text-white"}`,children:j?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[j.icon&&j.icon,j.label]}):c}),(0,t.jsx)(a.ChevronDown,{size:18,className:`text-slate-400 transition-transform duration-200 ${g?"rotate-180":""}`})]}),m&&(0,t.jsx)("p",{className:"mt-1 text-xs text-red-500",children:m}),(0,t.jsx)(l.AnimatePresence,{children:g&&(0,t.jsxs)(n.motion.div,{initial:{opacity:0,scale:.95,y:-10}
1,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:-10},transition:{type:"spring",stiffness:300,damping:24,mass:.8},className:"absolute z-99999 mt-2 bg-white/95 dark:bg-slate-800/95 backdrop-blur-xl border border-slate-200/50 dark:border-slate-700/50 rounded-2xl shadow-[0_8px_30px_rgb(0,0,0,0.12)] dark:shadow-[0_8px_30px_rgb(0,0,0,0.3)] max-h-64 overflow-hidden flex flex-col w-[320px] sm:w-85",children:[p&&(0,t.jsx)("div",{className:"p-2 border-b border-slate-100 dark:border-slate-700/50 shrink-0 bg-white/50 dark:bg-slate-800/50",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(i.Search,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),(0,t.jsx)("input",{ref:k,type:"text",placeholder:"Axtar...",value:y,onChange:e=>v(e.target.value),className:"w-full pl-9 pr-3 py-2 bg-slate-50 dark:bg-slate-900/50 border border-slate-200 dark:border-slate-700 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 text-slate-900 dark:text-white placeholder:text-slate-400 transition-shadow",onClick:e=>e.stopPropagation()})]})}),(0,t.jsx)("div",{className:"overflow-y-auto py-1 custom-scrollbar",children:N.length>0?N.map(e=>(0,t.jsxs)("button",{type:"button",onClick:()=>{var t;(t=e.value)!==u&&d(t),b(!1)},className:`w-full flex items-center justify-between px-4 py-2.5 text-[14px] text-left transition-colors ${e.value===u?"bg-primary/5 text-primary font-semibold":"text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700/50"}`,children:[(0,t.jsxs)("span",{className:"flex items-center gap-2",children:[e.icon&&e.icon,e.label]}),e.value===u&&(0,t.jsx)(s.Check,{size:16,className:"text-primary"})]},e.value)):(0,t.jsx)("div",{className:"px-4 py-3 text-sm text-slate-500 text-center",children:"NÉticÉ tapılmadı"})})]})})]})}])},67927,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,t],67927)},24071,e=>{"use strict";let t=(0,e.i(56420).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],24071)},58379,e=>{"use strict";let t=(0,e.i(56420).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t])},49882,e=>{"use strict";let t=(0,e.i(56420).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],49882)},40047,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(24071),s=e.i(67927),i=e.i(49882),n=e.i(11241),l=e.i(46932),o=e.i(88653),u=e.i(88442);let d=["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],c=["B.e","Ã.a","Ã","C.a","C","Å","B"];e.s(["CustomDatePicker",0,({value:e,onChange:h,label:m,error:x,minYear:p=1940,maxYear:f=new Date().getFullYear()+2,minDate:g,maxDate:b,isLoading:y=!1})=>{let v,w,k,[j,N]=(0,r.useState)(!1),C=(0,r.useRef)(null),[q,S]=(0,r.useState)("days"),[A,$]=(0,r.useState)(e?e.getFullYear():new Date().getFullYear()),[R,D]=(0,r.useState)(e?e.getMonth():new Date().getMonth()),[P,M]=(0,r.useState)(A-A%12),[E,U]=(0,r.useState)(R),[F,L]=(0,r.useState)(A);return(0,r.useEffect)(()=>{e&&($(e.getFullYear()),D(e.getMonth()),L(e.getFullYear()),U(e.getMonth()),M(e.getFullYear()-e.getFullYear()%12))},[e]),(0,r.useEffect)(()=>{if(j){S("days");let t=e?e.getFullYear():new Date().getFullYear();M(t-t%12)}},[j,e]),(0,r.useEffect)(()=>{let e=e=>{C.current&&!C.current.contains(e.target)&&N(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,t.jsxs)("div",{className:"w-full flex-1",ref:C,children:[m&&(0,t.jsx)("label",{className:"block text-sm font-medium text-slate-700 dark:text-slate-300 mb-1.5",children:m}),y?(0,t.jsx)("div",{className:"overflow-hidden w-full h-[50] bg-white dark:bg-slate-900 border rounded-xl outline-none transition-all dark:text-white border-slate-200 dark:border-slate-800 focus:ring-2 focus:ring-primary/20 focus:border-primary ",children:(0,t.jsx)(u.Skeleton,{className:"w-full h-full"})}):(0,t.jsxs)("button",{type:"button",onClick:e=>{e.preventDefault(),N(!j)},className:`w-full h-[50] flex items-center justify-between px-4 py-3 bg-white dark:bg-slate-900 border rounded-xl focus:ring-2 focus:ring-primary/20 focus:border-primary outline-none transition-all dark:text-white ${x?"border-red-500 text-red-500":j?"border-primary ring-2 ring-primary/20":"border-slate-200 dark:border-slate-800 hover:border-slate-300 dark:hover:border-slate-600"}`,children:[(0,t.jsx)("span",{className:`text-[13px] ${!e?"text-slate-400":"text-slate-900 dark:text-white"}`,children:e?(e=>{if(!e)return"";let t=e.getDate().toString().padStart(2,"0"),r=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getFullYear();return`${t}.${r}.${a}`})(e):"DD.MM.YYYY"}),(0,t.jsx)(i.Calendar,{size:16,className:"text-slate-400"})]}),x&&(0,t.jsx)("p",{className:"mt-1 text-xs text-red-500",children:x}),(0,t.jsx)(o.AnimatePresence,{children:j&&(0,t.jsxs)(l.motion.div,{initial:{opacity:0,y:-10,scale:.95}
1,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.95},transition:{duration:.15},className:"absolute z-9999999 mt-2 p-4 bg-white dark:bg-slate-800 border border-slate-100 dark:border-slate-700 rounded-2xl shadow-xl w-[320px] left-0 sm:left-auto sm:w-85",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:["days"===q&&(0,t.jsx)("button",{type:"button",onClick:()=>S("months"),className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(n.ArrowLeft,{size:18})}),"months"===q&&(0,t.jsx)("button",{type:"button",onClick:()=>S("years"),className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(n.ArrowLeft,{size:18})}),"years"===q&&(0,t.jsx)("div",{className:"w-8"})," ",(0,t.jsxs)("div",{className:"text-sm font-bold text-slate-900 dark:text-white capitalize",children:["years"===q&&`${P} - ${Math.min(P+11,f)}`,"months"===q&&`${F}`,"days"===q&&`${d[E]} ${F}`]}),(0,t.jsxs)("div",{className:"flex gap-1",children:["years"===q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>{P-12>=p&&M(P-12)},className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(a.ChevronLeft,{size:20})}),(0,t.jsx)("button",{type:"button",onClick:()=>{P+12<=f&&M(P+12)},className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(s.ChevronRight,{size:20})})]}),"days"===q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",onClick:()=>{let e=E-1,t=F;e<0&&(e=11,t-=1),U(e),L(t)},className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(a.ChevronLeft,{size:20})}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e=E+1,t=F;e>11&&(e=0,t+=1),U(e),L(t)},className:"p-1 hover:bg-slate-100 dark:hover:bg-slate-700 rounded-full text-slate-500",children:(0,t.jsx)(s.ChevronRight,{size:20})})]}),"months"===q&&(0,t.jsx)("div",{className:"w-12"})," "]})]}),(0,t.jsx)("div",{className:"min-h-62.5",children:(0,t.jsxs)(o.AnimatePresence,{mode:"wait",children:["years"===q&&(0,t.jsx)(l.motion.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:(v=Array.from({length:12},(e,t)=>P+t),(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:v.map(e=>e<=f&&e>=p?(0,t.jsx)("button",{onClick:()=>{$(e),L(e),S("months")},type:"button",className:`p-3 rounded-xl text-sm font-semibold transition-all ${e===A?"bg-primary text-white shadow-md":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,children:e},e):(0,t.jsx)("div",{},e))}))},"years"),"months"===q&&(0,t.jsx)(l.motion.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:(0,t.jsx)("div",{className:"grid grid-cols-3 gap-2",children:d.map((e,r)=>(0,t.jsx)("button",{onClick:()=>{D(r),U(r),S("days")},type:"button",className:`p-3 rounded-xl text-sm font-semibold transition-all ${r===R&&F===A?"bg-primary text-white shadow-md":"hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,children:e.slice(0,3)},e))})},"months"),"days"===q&&(0,t.jsxs)(l.motion.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2},children:[(0,t.jsx)("div",{className:"grid grid-cols-7 mb-2",children:c.map(e=>(0,t.jsx)("div",{className:"text-center text-xs font-semibold text-slate-400",children:e},e))}),(0,t.jsx)("div",{className:"grid grid-cols-7 gap-y-1 justify-items-center",children:(w=new Date(F,E+1,0).getDate(),[...Array.from({length:k=0===(k=new Date(F,E,1).getDay())?6:k-1},(e,r)=>(0,t.jsx)("div",{className:"text-center p-2"},`blank-${r}`)),...Array.from({length:w},(r,a)=>{let s=a+1,i=e&&e.getDate()===s&&e.getMonth()===E&&e.getFullYear()===F,n=s===new Date().getDate()&&E===new Date().getMonth()&&F===new Date().getFullYear(),l=((e,t,r)=>{if(!g&&!b)return!1;let a=new Date(e,t,r);a.setHours(0,0,0,0);let s=!1,i=!1;if(g){let e=new Date(g);e.setHours(0,0,0,0),s=a<e}if(b){let e=new Date(b);e.setHours(0,0,0,0),i=a>e}return s||i})(F,E,s);return(0,t.jsx)("button",{onClick:()=>{let t;return!l&&(t=new Date(F,E,s),void(h(t?.getTime()===e?.getTime()?null:t),N(!1)))},disabled:l,type:"button",className:` 2 w-9 h-9 rounded-full flex items-center justify-center text-sm transition-all 3 ${l?"text-slate-300 dark:text-slate-600 cursor-not-allowed":i?"bg-primary text-white shadow-md shadow-primary/30 font-bold":n?"bg-secondary/10 text-secondary font-bold ring-1 ring-secondary/30":"text-slate-700 hover:bg-slate-100 dar
3k:text-slate-300 dark:hover:bg-slate-700"} 4 `,children:s},`day-${s}`)})])})]},"days")]})})]})})]})}])},11241,e=>{"use strict";let t=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],11241)},6537,e=>{"use strict";let t=(0,e.i(56420).default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);e.s(["Lock",0,t],6537)},75315,e=>{"use strict";var t=e.i(99683);e.s(["emailSchema",0,e=>t.object({email:t.string().email(e("auth.emailInvalid")).required(e("auth.emailRequired"))}),"loginSchema",0,e=>t.object({email:t.string().email(e("auth.emailInvalid")).required(e("auth.emailRequired")),password:t.string().required(e("auth.passwordRequired"))}),"phoneSchema",0,e=>t.object({phone:t.string().matches(/^(50|51|10|55|70|77|99)\d{7}$/,e("auth.phoneInvalid")).required(e("auth.phoneRequired"))}),"registerGoogleSchema",0,e=>t.object({phone:t.string().matches(/^(50|51|10|55|70|77|99)\d{7}$/,e("auth.phoneInvalid")).required(e("auth.phoneRequired")),birthDate:t.date().typeError(e("auth.birthDateInvalid")).max(new Date,e("auth.birthDateFuture")).required(e("auth.birthDateRequired")),gender:t.string().oneOf(["M","F","O"],e("auth.genderInvalid")).required(e("auth.genderRequired"))}),"registerSchema",0,e=>t.object({firstName:t.string().min(3,e("auth.stringMin")).required(e("auth.firstNameRequired")),lastName:t.string().min(3,e("auth.stringMin")).required(e("auth.lastNameRequired")),email:t.string().email(e("auth.emailInvalid")).required(e("auth.emailRequired")),phone:t.string().matches(/^(50|51|10|55|70|77|99)\d{7}$/,e("auth.phoneInvalid")).required(e("auth.phoneRequired")),birthDate:t.date().typeError(e("auth.birthDateInvalid")).max(new Date,e("auth.birthDateFuture")).required(e("auth.birthDateRequired")),gender:t.string().oneOf(["M","F","O"],e("auth.genderInvalid")).required(e("auth.genderRequired")),password:t.string().min(8,e("auth.passwordMin")).required(e("auth.passwordRequired")),confirmPassword:t.string().oneOf([t.ref("password")],e("auth.passwordMatch")).required(e("auth.passwordRequired"))}),"resetPasswordSchema",0,e=>t.object({key:t.string().min(6,e("auth.keyMin")).required(e("auth.keyRequired")),password:t.string().min(8,e("auth.passwordMin")).required(e("auth.passwordRequired")),confirmPassword:t.string().oneOf([t.ref("password")],e("auth.passwordMatch")).required(e("auth.passwordRequired"))})])},41968,62511,e=>{"use strict";var t=e.i(43476),r=e.i(11241),a=e.i(68877),s=e.i(96315),i=e.i(1279),n=e.i(71645),l=e.i(91360),o=e.i(5317),u=e.i(58379),u=u,d=e.i(35196);let c=({initialTime:e,canResend:r,onClick:a,isLoading:s=!1})=>{let i,l,o=(0,d.useT)(),[c,h]=(0,n.useState)(e),[m,x]=(0,n.useState)(!0),p=(0,n.useRef)(null),f=(0,n.useRef)(null),g=(0,n.useRef)(e);(0,n.useEffect)(()=>{h(e),g.current=e},[e]);let b=e=>{if(null!=f.current){let t=(e-f.current)/1e3;g.current=Math.max(g.current-t,0),h(g.current)}f.current=e,g.current>0?p.current=requestAnimationFrame(b):x(!1)};return(0,n.useEffect)(()=>(m?p.current=requestAnimationFrame(b):p.current&&cancelAnimationFrame(p.current),()=>cancelAnimationFrame(p.current)),[m]),(0,t.jsx)("button",{type:"button",onClick:a,disabled:!r||s,className:`mt-6 text-sm font-medium transition-colors cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed! ${r?"text-secondary hover:text-secondary/80 cursor-pointer":"text-slate-400 cursor-not-allowed"}`,children:s?(0,t.jsx)(u.default,{className:"animate-spin"}):r?o("auth.sendOtpAgain"):`${o("auth.sendOtpAgain")} (${i=Math.floor(c/60),l=Math.floor(c%60),`${String(i).padStart(2,"0")}:${String(l).padStart(2,"0")}`}s)`})};var h=e.i(46696),m=e.i(39460),x=e.i(18727),p=e.i(76595),f=e.i(18566),g=e.i(77544),b=e.i(64381);e.s(["default",0,({emailValue:e,step:u,setValue:y,isRegister:v=!1,isEmailChange:w=!1,redirectLast:k,redirectBack:j,closeModal:N})=>{let{setUser:C}=(0,p.useUser)(),{userProfileInfo:q,setUserProfileInfo:S}=(0,g.useProfile)(),A=(0,f.useRouter)(),$=(0,d.useT)(),[R,D]=(0,n.useState)(""),[P,M]=(0,n.use
4State)([]),[E,U]=(0,n.useState)(60),[F,L]=(0,n.useState)(!1),[T,z]=(0,n.useState)(!1),[I,O]=(0,n.useState)(""),[_,J]=(0,n.useState)([]),[Y,H]=(0,n.useState)(e??"");(0,n.useEffect)(()=>{let e;return(2===u||3===u)&&E>0?e=setInterval(()=>{U(e=>e-1)},1e3):0===E&&L(!0),()=>clearInterval(e)},[u,E]);let{execute:B,loading:K}=(0,l.useAsync)(o.verifyEmail,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void M(e?.data?.errors);if((0,x.isAuthenticatedSession)(e)&&!v&&!w){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),A.replace(b.ROUTES.HOME);return}if(e?.ok&&v){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),k&&k();return}if(e?.ok&&w){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),q&&S({...q,email:e.data.user.email}),N&&N(),h.toast.success($("profile.changeEmailSuccess"));return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),V=async()=>{M([]),await B(R)},{execute:Z,loading:G}=(0,l.useAsync)(o.resendEmailVerification,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void M(e?.data?.errors);if(e?.ok){h.toast.success($("auth.otpCodeResend")),U(60),L(!1);return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),{execute:Q,loading:W}=(0,l.useAsync)(o.changeEmail,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void J(e?.data?.errors);if(e?.ok){y&&y("email",I),H(I),h.toast.success($("auth.emailChanged")),O(""),z(!1);return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),X=async()=>{M([]),await Z()},ee=async()=>{J([]),await Q(I)};return(0,t.jsxs)("div",{className:"text-center py-6",children:[(0,t.jsx)("div",{className:"w-16 h-16 bg-blue-50 dark:bg-blue-900/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,t.jsx)(s.Mail,{className:"text-primary w-8 h-8"})}),Y?.length>0?(0,t.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",dangerouslySetInnerHTML:{__html:$("auth.otpCodeTitle").replace("{{email}}",Y)}}):(0,t.jsx)("p",{className:"verify-email-line",children:$("auth.otpCodeTitle2")}),T?(0,t.jsxs)("div",{className:"mt-4 flex flex-col",children:[(0,t.jsx)(m.CustomInput,{label:$("auth.newEmail"),placeholder:"nümunÉ@mail.com",icon:(0,t.jsx)(i.User,{size:18}),value:I||"",onChange:e=>{O(e.target.value)},error:_[0]?.message}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-2 gap-4",children:[(0,t.jsx)("button",{onClick:()=>{z(!1),O("")},className:"cursor-pointer py-3 px-6 border border-slate-200 dark:border-slate-800 rounded-xl font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors flex items-center justify-center gap-2",children:$("auth.cancel")}),(0,t.jsx)("button",{disabled:!x.emailRegex.test(I)||W,className:"py-3 flex-1 bg-primary text-white rounded-xl hover:bg-primary/90 transition-all shadow-lg shadow-primary/20 flex items-center justify-center gap-2 cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed!",onClick:ee,children:W?$("auth.updating"):$("auth.updateEmail")})]})]}):(0,t.jsx)("button",{className:"mt-4 cursor-pointer",onClick:()=>z(!0),children:$("auth.wrongEmail")}),(0,t.jsx)("input",{name:"emailCode",value:R.length>3?`${R.slice(0,3)}-${R.slice(3)}`:R,onChange:e=>{D(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6))},type:"text",minLength:7,maxLength:7,placeholder:"000-000",className:"mt-6 w-full text-center text-xl tracking-[.5em] font-bold py-4 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl focus:ring-2 focus:ring-primary/20 focus:border-primary outline-none transition-all dark:text-white"}),P?.length>0&&P.map((e,r)=>(0,t.jsx)("p",{className:"text-sm text-red-500 mt-4",children:e?.message},r)),(0,t.jsx)(c,{initialTime:E,canResend:F,onClick:X,isLoading:G}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 mt-8 pt-6 border-t border-slate-100 dark:border-slate-800",children:[j&&(0,t.jsxs)("button",{type:"button",onClick:j,className:"flex-1 py-3 border border-slate-200 dark:border-slate-800 rounded-xl font-medium text-slate-600 dar
4k:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors flex items-center justify-center gap-2",children:[(0,t.jsx)(r.ArrowLeft,{size:18})," ",$("auth.back")]}),(0,t.jsxs)("button",{type:"button",disabled:6!==R.length||K,className:"flex-1 py-3 bg-primary text-white rounded-xl font-bold hover:bg-primary/90 transition-all shadow-lg shadow-primary/20 flex items-center justify-center gap-2 cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed!",onClick:V,children:[K?$("auth.loading"):$("auth.continue"),!K&&(0,t.jsx)(a.ArrowRight,{size:18})]})]})]})}],41968);var y=e.i(75387);e.s(["default",0,({phoneValue:e,step:s,setValue:i,isRegister:u=!1,redirectEmail:v,redirectBack:w,redirectLast:k,isPhoneChange:j=!1,closeModal:N})=>{let{setUser:C}=(0,p.useUser)(),{userProfileInfo:q,setUserProfileInfo:S}=(0,g.useProfile)(),A=(0,f.useRouter)(),$=(0,d.useT)(),[R,D]=(0,n.useState)(""),[P,M]=(0,n.useState)([]),[E,U]=(0,n.useState)(60),[F,L]=(0,n.useState)(!1),[T,z]=(0,n.useState)(!1),[I,O]=(0,n.useState)(""),[_,J]=(0,n.useState)([]),[Y,H]=(0,n.useState)(e);(0,n.useEffect)(()=>{let e;return(2===s||3===s)&&E>0?e=setInterval(()=>{U(e=>e-1)},1e3):0===E&&L(!0),()=>clearInterval(e)},[s,E]);let{execute:B,loading:K}=(0,l.useAsync)(o.resendPhoneVerification,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void M(e?.data?.errors);if(e?.ok){h.toast.success($("auth.otpCodeResend")),U(60),L(!1);return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),{execute:V,loading:Z}=(0,l.useAsync)(o.verifyPhone,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void M(e?.data?.errors);if((0,x.isAuthenticatedSession)(e)&&!u&&!j){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),A.replace(b.ROUTES.HOME);return}if((0,x.hasFlow)(e,"verify_email")){v&&v();return}if(e?.ok&&u){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),k&&k();return}if(e?.ok&&j){C({...e?.data.user,isAuthenticated:e.meta.is_authenticated}),q&&S({...q,phone:Y}),N&&N(),h.toast.success($("profile.changePhoneSuccess"));return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),{execute:G,loading:Q}=(0,l.useAsync)(o.changePhone,{onSuccess:e=>{if(e?.data?.errors?.length>0)return void J(e?.data?.errors);if(e?.ok){i&&i("phone",I),H(I),h.toast.success($("auth.phoneChanged")),O(""),z(!1);return}h.toast.error($("auth.error"))},onError:()=>{h.toast.error($("auth.error"))}}),W=async()=>{M([]),await V(R)},X=async()=>{M([]),await B()},ee=async()=>{J([]),await G(I)};return(0,t.jsxs)("div",{className:"text-center py-6",children:[(0,t.jsx)("div",{className:"w-16 h-16 bg-blue-50 dark:bg-blue-900/20 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,t.jsx)(y.Phone,{className:"text-secondary w-8 h-8"})}),Y?.length>0?(0,t.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",dangerouslySetInnerHTML:{__html:$("auth.phoneOtpCodeTitle").replace("{{phone}}",(0,x.formatAzPhone)(Y||""))}}):(0,t.jsx)("p",{className:"verify-email-line",children:$("auth.phoneOtpCodeTitle2")}),T?(0,t.jsxs)("div",{className:"mt-4 flex flex-col",children:[(0,t.jsx)(m.CustomInput,{label:$("auth.newPhone"),placeholder:"50-123-45-67",icon:(0,t.jsx)(y.Phone,{size:18}),value:(0,x.formatAzPhone)(I||""),onChange:e=>{O(e.target.value.replace(/\D/g,"").slice(0,9))},error:_[0]?.message}),(0,t.jsxs)("div",{className:"flex items-center justify-between mt-2 gap-4",children:[(0,t.jsx)("button",{onClick:()=>{z(!1),O("")},className:"cursor-pointer py-3 px-6 border border-slate-200 dark:border-slate-800 rounded-xl font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors flex items-center justify-center gap-2",children:$("auth.cancel")}),(0,t.jsx)("button",{disabled:I.length<9||Q,className:"py-3 flex-1 bg-primary text-white rounded-xl hover:bg-primary/90 transition-all shadow-lg shadow-primary/20 flex items-center justify-center gap-2 cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed!",onClick:ee,children:Q?$("auth.updating"):$("auth.updatePhone")})]})]}):(0,t.jsx)("button",{className:"mt-4 cursor-pointer",onClick:()=>z(!0),children:$("auth.wrongPhone")}),(0,t.jsx)("input",{name:"phoneCode",value:R.length>3?`${R.slice(0,3)}-${R.slice(3)}`:R,onChange:e=>{D(e.target.value.toUpperCase().replace(/[^A-Z0-9]/g,"").slice(0,6))},type:"text",minLength:7,maxLength:7,placeholder:"000-000",className:"mt-6 w-full text-center text-xl tracking-[.5em] font-bold py-4 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-xl focus:ring-2 focus:ring-secondary/20 focus:border-secondary outline-none transition-all dark:text-white"}),P?.length>0&&P.map((e,r)=>(0,t.jsx)("p",{className:"text-sm text-red-500 mt-4",children:e?.message},r)),(0,t.jsx)(c,{initialTime:E,canResend:F,onClick:X,isLoading:K}),(0,t.jsxs)("div",{className:"flex justify-between gap-4 mt-8 pt-6 border-t border-slate-100 dar
4k:border-slate-800",children:[w&&(0,t.jsxs)("button",{type:"button",onClick:w,className:"flex-1 py-3 border border-slate-200 dark:border-slate-800 rounded-xl font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 transition-colors flex items-center justify-center gap-2",children:[(0,t.jsx)(r.ArrowLeft,{size:18}),$("auth.back")]}),(0,t.jsxs)("button",{type:"button",disabled:6!==R.length||Z,className:"flex-1 py-3 bg-primary text-white rounded-xl font-bold hover:bg-primary/90 transition-all shadow-lg shadow-primary/20 flex items-center justify-center gap-2 cursor-pointer disabled:opacity-70 disabled:cursor-not-allowed",onClick:W,children:[Z?$("auth.loading"):$("auth.continue"),!Z&&(0,t.jsx)(a.ArrowRight,{size:18})]})]})]})}],62511)}]);
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.