"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5913],{8594:(e,l,t)=>{t.d(l,{n:()=>a});let a=(0,t(65453).v)(e=>({user:null,setUser:l=>e({user:l}),clearUser:()=>e({user:null})}))},23900:(e,l,t)=>{t.d(l,{default:()=>h});var a=t(95155),s=t(12115),r=t(6874),n=t.n(r),i=t(35695),o=t(82961),c=t(8594),d=t(91218);function h(){let[e,l]=(0,s.useState)(!1),{user:t,clearUser:r}=(0,c.n)(),h=(0,i.useRouter)(),m=(0,i.usePathname)(),x=m.startsWith("/auth"),u=["/profile","/bookings"],{i18n:g,t:b}=(0,d.Bd)(),p=e=>{g.changeLanguage(e),document.documentElement.lang=e,document.documentElement.dir="ar"===e?"rtl":"ltr",(0,o.setCookie)(null,"lang",e,{path:"/",maxAge:2592e3}),window.location.pathname.startsWith("/cars")&&window.location.reload()},[f,w]=(0,s.useState)(!0),j=(0,s.useRef)(0);(0,s.useEffect)(()=>{let e=()=>{let e=window.scrollY;ewindow.removeEventListener("scroll",e)},[]),(0,s.useEffect)(()=>{document.documentElement.lang=g.language,document.documentElement.dir="ar"===g.language?"rtl":"ltr"},[g.language]);let v="ar"===g.language;return x?(0,a.jsx)("div",{className:"w-full md:w-1/2 px-4 md:px-8 pt-6 bg-white z-100 relative",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)(n(),{href:"/",children:(0,a.jsx)("img",{src:v?"/logoArabic.svg":"/logo/Agerlee word.svg",alt:"Agerlee Logo",className:"w-[120px] h-auto"})}),(0,a.jsxs)("div",{className:"dropdown dropdown-end",children:[(0,a.jsxs)("div",{tabIndex:0,role:"button",className:"btn btn-sm !border-0 text-black bg-white hover:bg-white flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"ar"===g.language?"عربي":"English"}),(0,a.jsx)("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"})})]}),(0,a.jsxs)("ul",{className:"dropdown-content z-[100] menu p-2 shadow bg-white rounded-box w-36 !text-black !border-0 mt-2",children:["en"!==g.language&&(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:e=>{p("en"),e.currentTarget.blur()},className:"flex items-center gap-2 hover:bg-gray-50 rounded-md p-2",children:(0,a.jsx)("span",{className:"font-medium",children:"English"})})}),"ar"!==g.language&&(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:e=>{p("ar"),e.currentTarget.blur()},className:"flex items-center gap-2 hover:bg-gray-50 rounded-md p-2",children:(0,a.jsx)("span",{className:"font-medium",children:"عربي"})})})]})]})]})}):(0,a.jsxs)("div",{className:"navbar flex items-center justify-between bg-white !w-full max-w-[1200px] shadow-lg fixed rounded-2xl px-4 md:px-8 left-1/2 transform -translate-x-1/2 top-4 z-50 ".concat(v?"flex-row-reverse":""),dir:"ltr",children:[(0,a.jsx)("div",{className:"flex-none",children:(0,a.jsx)(n(),{href:"/",children:(0,a.jsx)("img",{src:v?"/logoArabic.svg":"/logo/Agerlee word.svg",alt:"Agerlee Logo",className:"w-[96px] h-[38px]"})})}),(0,a.jsx)("div",{className:" navbar-center absolute left-1/2 transform -translate-x-1/2 hidden lg:flex",children:(0,a.jsxs)("ul",{className:"menu menu-horizontal px-1 gap-8 ".concat(v?"flex-row-reverse":""),children:[(0,a.jsx)("li",{children:(0,a.jsx)(n(),{href:"/",className:"text-black font-semibold hover:text-primary hover:bg-[#EBF3FF] rounded-md px-2 py-2",children:b("auth.Home")})}),(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:()=>{if("/"===window.location.pathname){var e;null==(e=document.getElementById("about"))||e.scrollIntoView({behavior:"smooth"})}else h.push("/#about")},className:"font-semibold text-black hover:text-primary hover:bg-[#EBF3FF] rounded-md px-2 py-2",children:b("auth.AboutUs")})}),(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:()=>{if("/"===window.location.pathname){var e;null==(e=document.getElementById("services"))||e.scrollIntoView({behavior:"smooth"})}else h.push("/#services")},className:"font-semibold text-black hover:text-primary hover:bg-[#EBF3FF] rounded-md px-2 py-2",children:b("auth.Services")})}),(0,a.jsx)("li",{children:(0,a.jsx)(n(),{href:"/bussiness-request",className:"text-black font-semibold hover:text-primary hover:bg-[#EBF3FF] rounded-md px-2 py-2",children:b("businessRequest.menuLabel")})})]})}),(0,a.jsxs)("div",{className:"gap-2 flex items-center ".concat(v?"flex-row-reverse":""),children:[(0,a.jsxs)("div",{className:"dropdown dropdown-end relative",children:[(0,a.jsxs)("div",{tabIndex:0,role:"button",className:"btn btn-sm !border-0 text-black bg-white hover:bg-white flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-medium",children:"ar"===g.language?"عربي":"English"}),(0,a.jsx)("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"})})]}),(0,a.jsxs)("ul",{className:"dropdown-content z-[100] menu p-2 shadow bg-white rounded-box w-36 !text-black !border-0 absolute right-0 top-full mt-2",children:["en"!==g.language&&(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:e=>{p("en"),e.currentTarget.blur()},className:"flex items-center gap-2 hover:bg-gray-50 rounded-md p-2",children:(0,a.jsx)("span",{className:"font-medium",children:"English"})})}),"ar"!==g.language&&(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:e=>{p("ar"),e.currentTarget.blur()},className:"flex items-center gap-2 hover:bg-gray-50 rounded-md p-2",children:(0,a.jsx)("span",{className:"font-medium",children:"عربي"})})})]})]}),t?(0,a.jsxs)("div",{className:"dropdown ".concat(v?"dropdown-start":"dropdown-end"),children:[(0,a.jsxs)("div",{tabIndex:0,role:"button",className:"avatar flex items-center gap-2 lg:gap-4 cursor-pointer ".concat(v?"flex-row-reverse":""),children:[(0,a.jsx)("span",{className:"hidden lg:inline text-md font-medium text-black",children:t.fullName||"User"}),(0,a.jsx)("div",{className:"w-10 h-10 rounded-full overflow-hidden",children:t.avatar?(0,a.jsx)("img",{src:t.avatar,alt:"Profile"}):(0,a.jsx)("div",{className:"bg-primary text-white flex items-center justify-center h-full rounded-full",children:t.fullName?t.fullName.charAt(0).toUpperCase():"U"})})]}),(0,a.jsxs)("ul",{className:"mt-3 z-[100] p-2 shadow menu dropdown-content bg-white text-black rounded-box w-52 ".concat(v?"text-right":""),children:[(0,a.jsx)("li",{className:"lg:hidden",children:(0,a.jsx)(n(),{href:"/",className:"".concat(v?"block w-full text-right":""),children:b("auth.Home")})}),(0,a.jsx)("li",{className:"lg:hidden",children:(0,a.jsx)("button",{onClick:()=>{if("/"===window.location.pathname){var e;null==(e=document.getElementById("about"))||e.scrollIntoView({behavior:"smooth"})}else h.push("/#about")},className:"".concat(v?"block w-full text-right":""),children:b("auth.AboutUs")})}),(0,a.jsx)("li",{className:"lg:hidden",children:(0,a.jsx)("button",{onClick:()=>{if("/"===window.location.pathname){var e;null==(e=document.getElementById("services"))||e.scrollIntoView({behavior:"smooth"})}else h.push("/#services")},className:"".concat(v?"block w-full text-right":""),children:b("auth.Service")})}),(0,a.jsx)("li",{className:"lg:hidden",children:(0,a.jsx)(n(),{href:"/bussiness-request",className:"".concat(v?"block w-full text-right":""),children:b("businessRequest.menuLabel")})}),(0,a.jsx)("li",{children:(0,a.jsx)(n(),{href:"/bookings",className:"".concat(v?"block w-full text-right":""),children:b("auth.Booking")})}),(0,a.jsx)("li",{children:(0,a.jsx)(n(),{href:"/profile",className:"".concat(v?"block w-full text-right":""),children:b("auth.Profile")})}),(0,a.jsx)("li",{children:(0,a.jsx)("button",{onClick:()=>{(0,o.destroyCookie)(null,"accessToken",{path:"/"}),(0,o.destroyCookie)(null,"refreshToken",{path:"/"}),null==r||r(),u.some(e=>m.startsWith(e))&&h.push("/")},className:"".concat(v?"block w-full text-right":""),children:b("auth.Logout")})})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n(),{href:"/auth/signin",className:"btn btn-outline border-2 border-primary text-primary hover:bg-primary hover:text-white rounded-lg",children:b("auth.LoginIn")}),(0,a.jsx)(n(),{href:"/auth/signup",className:"hidden lg:inline-flex btn bg-primary text-white hover:bg-primary border-none rounded-lg",children:b("auth.SignUp")})]})]})]})}},60008:(e,l,t)=>{t.d(l,{default:()=>n});var a=t(95155),s=t(12115),r=t(91218);function n(){let{t:e,i18n:l}=(0,r.Bd)("common"),t="ar"===l.language,[n,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{let e=new MutationObserver(()=>{c(!!document.querySelector("#location_modal, .fixed.inset-0.z-50.bg-white.flex"))});return e.observe(document.body,{childList:!0,subtree:!0}),()=>e.disconnect()},[]),o)?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed bottom-25 z-50 max-w-md mx-auto right-4 md:hidden ",children:(0,a.jsx)("div",{className:"flex items-center bg-white shadow-lg rounded-2xl p-3 border border-gray-200",children:(0,a.jsxs)("a",{href:"https://apps.apple.com/app/id6670305720",target:"_blank",rel:"noopener noreferrer",className:"flex items-center px-3 py-2 rounded-full border border-gray-300 hover:bg-gray-100 text-sm text-black",children:[e("auth.Download"),(0,a.jsx)("img",{src:"/Playstore.png",alt:"Google Play",className:"w-5 h-5 ml-2"}),(0,a.jsx)("img",{src:"/appleBlack.png",alt:"App Store",className:"w-5 h-5 ml-2 object-contain"})]})})}),(0,a.jsxs)("div",{className:"fixed bottom-25 z-50 hidden md:block ".concat(t?"left-6":"right-6"),children:[(0,a.jsx)("button",{onClick:()=>i(!n),className:"bg-primary hover-bg-primary text-white rounded-full p-4 shadow-lg transition-all duration-300 transform hover:scale-105","aria-label":"Download App",children:(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",className:"bi bi-download",viewBox:"0 0 16 16",children:[(0,a.jsx)("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),(0,a.jsx)("path",{d:"M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"})]})}),n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>i(!1)}),(0,a.jsxs)("div",{className:"absolute bottom-16 bg-white rounded-lg shadow-xl border border-gray-200 p-4 min-w-[280px] animate-in slide-in-from-bottom-2 duration-300 z-50 ".concat(t?"left-0":"right-0"),children:[(0,a.jsxs)("div",{className:"text-center mb-4",children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-gray-800",children:[e("auth.Download")," ",e("auth.OurApp")]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mt-1",children:e("auth.GetOnIt")})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("a",{href:"https://onelink.to/jxjmvr",className:"block",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsxs)("div",{className:"flex items-center bg-black text-white rounded-lg p-3 hover:bg-gray-800 transition-colors",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mr-3 rtl:mr-0 rtl:ml-3",children:(0,a.jsx)("img",{src:"/Playstore.png",alt:"Google Play Store",className:"w-6 h-6"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 text-left rtl:text-right",children:[(0,a.jsx)("div",{className:"text-xs text-gray-300 leading-tight",children:e("auth.GetOnIt")}),(0,a.jsx)("div",{className:"text-sm font-medium text-white leading-tight",children:e("auth.GooglePlay")})]})]})}),(0,a.jsx)("a",{href:"https://apps.apple.com/app/id6670305720",className:"block",target:"_blank",rel:"noopener noreferrer",children:(0,a.jsxs)("div",{className:"flex items-center bg-black text-white rounded-lg p-3 hover:bg-gray-800 transition-colors",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mr-3 rtl:mr-0 rtl:ml-3",children:(0,a.jsx)("img",{src:"/Apple.png",alt:"Apple App Store",className:"w-6 h-6"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 text-left rtl:text-right",children:[(0,a.jsx)("div",{className:"text-xs text-gray-300 leading-tight",children:e("auth.DownloadOnThe")}),(0,a.jsx)("div",{className:"text-sm font-medium text-white leading-tight",children:e("auth.AppStore")})]})]})})]}),(0,a.jsx)("button",{onClick:()=>i(!1),className:"absolute top-2 text-gray-400 hover:text-gray-600 transition-colors ".concat(t?"left-2":"right-2"),"aria-label":"Close",children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"bi bi-x",viewBox:"0 0 16 16",children:(0,a.jsx)("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"})})})]})]})]})]})}}}]);