1import{p as V,u as W,r as j,a5 as je,q as v,aV as ve,aW as be,aX as we,aY as O,aZ as ye,a_ as Ne,h as P,g as R,j as e,c as w,a$ as X,b0 as x,a2 as a,b1 as K,b2 as Z,b3 as Q,b4 as ee,b5 as te,y as G,z as N,D as k,E as C,a as T,b6 as se,b7 as ae,b8 as ne,b9 as le,ba as oe,bb as ie,bc as re,bd as J,be as ce,e as ke,f as Ce,L,bf as z,bg as Y,bh as Ie,bi as Se,bj as $e,B as _,bk as De,bl as Oe}from"./index-DxhIxHch.js";import{a as Ae,M as Pe,L as Ee}from"./CanonicalTag-2LNbKerX.js";import{u as Le}from"./useGteNavbarStatus-BrLAdpnn.js";import{u as M}from"./useModal-COv5c6nQ.js";function Ge(r){const t=V(),{cart:m}=W(o=>o.cart),g=()=>{const o=localStorage.getItem("pocket_wifi_cart"),s=localStorage.getItem("router_cart"),c=localStorage.getItem("sim_cart");if(o&&r==="pocketWifi"){const h=JSON.parse(o);t(ve(h))}else localStorage.removeItem("pocket_wifi_cart");if(s&&r==="router"){const h=JSON.parse(s);t(be(h))}else localStorage.removeItem("router_cart");if(c&&r==="sim"){const h=JSON.parse(c);t(we(h))}else localStorage.removeItem("sim_cart")},d=()=>{if(window.location.href.includes("localhost")){const o={ip:"175.141.173.182",city:"Johor Bahru",region:"Johor",country:"SG",loc:"1.4655,103.7578",org:"AS4788 TM TECHNOLOGY SERVICES SDN. BHD.",postal:"80500",timezone:"Asia/Kuala_Lumpur"};sessionStorage.setItem("i18next",O[o==null?void 0:o.country]),sessionStorage.setItem("user_country",JSON.stringify(o)),sessionStorage.setItem("source","urwifi"),sessionStorage.setItem("user_language","en"),t(v({userCountry:o}))}else fetch(window.location.href).then(o=>{let s={};o.headers.forEach((l,f)=>{s[f]=l}),console.log("resHeaders",s);const c=o.headers.get("domain"),h=o.headers.get("cloudfront-viewer-country");if(console.log("cloudfront-viewer-country:",h),c!=null&&c.toLowerCase().includes("yoowifi.jp")){const l={country:"JP"};sessionStorage.setItem("user_language","jp"),sessionStorage.setItem("i18next","jp"),sessionStorage.setItem("user_country",JSON.stringify(l)),sessionStorage.setItem("source","urwifijp"),t(v({userCountry:l}))}else if(c!=null&&c.toLowerCase().includes("yoowifi.my")){const l={country:"MY"};sessionStorage.setItem("user_language","en"),sessionStorage.setItem("i18next","en"),sessionStorage.setItem("user_country",JSON.stringify(l)),t(v({userCountry:l}))}else if(c!=null&&c.toLowerCase().includes("yoowifi.id")){const l={country:"ID"};sessionStorage.setItem("user_language","id"),sessionStorage.setItem("i18next","id"),sessionStorage.setItem("user_country",JSON.stringify(l)),sessionStorage.setItem("source","urwifiid"),t(v({userCountry:l}))}else if(c!=null&&c.toLowerCase().includes("yoowifi.th")){const l={country:"TH"};sessionStorage.setItem("user_language","th"),sessionStorage.setItem("i18next","th"),sessionStorage.setItem("user_country",JSON.stringify(l)),sessionStorage.setItem("source","urwifith"),t(v({userCountry:l}))}else if(c!=null&&c.toLowerCase().includes("yoowifi.com")&&h==="ID"){const l={country:"ID"};sessionStorage.setItem("user_language","id"),sessionStorage.setItem("i18next","id"),sessionStorage.setItem("user_country",JSON.stringify(l)),t(v({userCountry:l}))}else if(c!=null&&c.toLowerCase().includes("yoowifi.com")&&h==="PH"){const l={country:"PH"};sessionStorage.setItem("user_language","en"),sessionStorage.setItem("i18next","en"),sessionStorage.setItem("user_country",JSON.stringify(l)),t(v({userCountry:l}))}else if(h){const l=Object.keys(O).filter(f=>f!=="SG").includes(h)?{country:h}:{country:"SG"};console.log("cloudfront newResp",l),l.country==="PH"?(sessionStorage.setItem("i18next","en"),sessionStorage.setItem("user_language","en")):(sessionStorage.setItem("i18next",O[l==null?void 0:l.country]),sessionStorage.setItem("user_language",O[l==null?void 0:l.country])),sessionStorage.setItem("user_country",JSON.stringify(l)),t(v({userCountry:l}))}else console.log("INSIDE COUNTRY SERVICE"),ye().then(l=>{console.log("counResp :",l);const f=Object.keys(O).filter(i=>i!=="SG").includes(l==null?void 0:l.country)?l:{...l,country:"SG"};console.log("newResp",f),f.country==="PH"?sessionStorage.setItem("i18next","en"):sessionStorage.setItem("i18next",O[f==null?void 0:f.country]),sessionStorage.setItem("user_country",JSON.stringify(f)),t(v({userCountry:f}))}).catch(l=>{console.log("COUNTRY API EXCEPTION",l)})}).catch(o=>{console.error("Error fetching:",o)})},n=()=>{var o;if(((o=m.reactCountries)==null?void 0:o.length)===0){const s=Ne.map(c=>({...c,iso2:c.countryCode,name:c.countryName}));console.log("reactCountries",s),t(v({reactCountries:s}))}};j.useEffect(()=>{const o=JSON.parse(sessionStorage.getItem("user_country")),s=JSON.parse(localStorage.getItem("user_data"));console.log("userCountry",o),t(je(s)),t(v({userCountry:o})),o||d(),g(),n()},[])}const _e=({isShow:r=!1,onClose:t})=>{const{t:m}=P(["translation","english","local"]),{currentCountry:g,isTargetCountry:d,nameSpace:n}=R(),o=()=>{t&&t()};return e.jsx("div",{className:w(" hidden xl:block overflow-hidden duration-300 absolute w-[100vw] left-0",r?"max-h-[320px]":"max-h-0"),children:e.jsx("div",{className:"pt-6",children:e.jsx("div",{className:"bg-neutral-black text-white px-4 py-8",children:e.jsx("div",{className:"w-full max-w-[1392px] mx-auto relative ",children:e.jsxs("div",{className:"w-full grid grid-cols-6 gap-3 2xl:gap-6",children:[e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded ",children:e.jsx(X,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m("navbar.megamenu.menuItems.0.title")}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[e.jsx(x,{onClick:o,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,to:a.pocketWifiDetails.path,children:m("navbar.megamenu.menuItems.0.items.0")}),e.jsx(x,{onClick:o,to:a.simEsimDetails.path,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m(`${n}:navbar.megamenu.menuItems.0.items.1`)})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded ",children:e.jsx(K,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m("navbar.megamenu.menuItems.1.title")}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[e.jsx(x,{onClick:o,to:`${a.countryCoverage.path}?region=asia`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.1.items.0")}),e.jsx(x,{onClick:o,to:`${a.countryCoverage.path}?region=europe`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.1.items.1")}),e.jsx(x,{onClick:o,to:`${a.countryCoverage.path}?region=americas`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.1.items.2")}),e.jsx(x,{onClick:o,to:`${a.countryCoverage.path}?region=oceania`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.1.items.3")}),e.jsx(x,{onClick:o,to:`${a.countryCoverage.path}?region=africa`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.1.items.4")})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded shrink-0",children:e.jsx(Z,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m(d?`${n}:navbar.megamenu.menuItems.2.titleJP`:"navbar.megamenu.menuItems.2.title")}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[!d&&e.jsx(x,{onClick:o,to:a.pickDropLocation.path,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.2.items.0")}),e.jsx(x,{onClick:o,to:a.pickDropLocation.path,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m(`${n}:navbar.megamenu.menuItems.2.items.1`)})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded shrink-0",children:e.jsx(Q,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m("navbar.megamenu.menuItems.3.title")}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[e.jsx(x,{onClick:o,to:`${a.howItWorks.path}/#rent`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.3.items.0")}),e.jsx(x,{onClick:o,to:`${a.howItWorks.path}/#self-return`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m(`${n}:navbar.megamenu.menuItems.3.items.1`)}),e.jsx(x,{onClick:o,to:`${a.howItWorks.path}/#topup`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.3.items.2")})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded shrink-0",children:e.jsx(ee,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m("navbar.megamenu.menuItems.4.title")}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[e.jsx(x,{onClick:o,to:`${a.affiliate.path}/#join-affiliate`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.4.items.0")}),e.jsx(x,{onClick:o,to:`${a.affiliate.path}/#lets-talk`,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.4.items.1")})]})]})]}),e.jsxs("div",{className:"flex items-start gap-3 flex-1 w-full",children:[e.jsx("div",{className:"w-8 aspect-square flex items-center justify-center bg-main-600 rounded shrink-0",children:e.jsx(te,{className:"shrink-0 w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-lg font-semibold leading-[140%]",children:m(`${n}:navbar.megamenu.menuItems.5.title`)}),e.jsxs("div",{className:"text-sm flex flex-col gap-3 mt-3",children:[e.jsx(x,{onClick:o,to:a.howToSetupSim.path,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.5.items.0")}),e.jsx(x,{onClick:o,to:a.howToConnectPocketWifi.path,className:({isActive:s})=>` hover:text-main-500 duration-300 ${s?"text-main-600":"text-white"}`,children:m("navbar.megamenu.menuItems.5.items.1")})]})]})]})]})})})})})};function He({setIsShowMenu:r=()=>{}}){const{t}=P(),{currentCountry:m,isTargetCountry:g,nameSpace:d}=R();return e.jsx("li",{className:"xl:hidden",children:e.jsx(G,{type:"single",className:"flex flex-col !bg-transparent p-0 xl:hidden",collapsible:!0,children:e.jsxs(N,{value:"parent-1",className:"bg-transparent border-none ",children:[e.jsx(k,{className:"menuItem text-lg text-white [&[data-state=open]]:bg-main-600",iconClass:"text-white w-5",children:e.jsx("div",{children:e.jsx("span",{children:e.jsx("span",{children:t("navbar.megamenu.menuText")})})})}),e.jsx(C,{children:e.jsxs(G,{type:"single",className:"flex flex-col !bg-transparent pl-3 xl:hidden",collapsible:!0,children:[e.jsxs(N,{value:"item-1",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(X,{className:"shrink-0"})}),e.jsx("span",{children:t("navbar.megamenu.menuItems.0.title")})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.pocketWifiDetails.path,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.0.items.0")})}),!g&&e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.simEsimDetails.path,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.0.items.1")})})]})})]}),e.jsxs(N,{value:"item-2",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(K,{className:"shrink-0"})}),e.jsx("span",{children:t("navbar.megamenu.menuItems.1.title")})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.countryCoverage.path}?region=asia`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.1.items.0")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.countryCoverage.path}?region=europe`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.1.items.1")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.countryCoverage.path}?region=americas`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.1.items.2")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.countryCoverage.path}?region=oceania`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.1.items.3")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.countryCoverage.path}?region=africa`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.1.items.4")})})]})})]}),e.jsxs(N,{value:"item-3",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1 whitespace-nowrap",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(Z,{className:"shrink-0"})}),e.jsx("span",{children:t(g?`${d}:navbar.megamenu.menuItems.2.titleJP`:"navbar.megamenu.menuItems.2.title")})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[!g&&e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.pickDropLocation.path,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.2.items.0")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.pickDropLocation.path,onClick:()=>r(!1),children:t(`${d}:navbar.megamenu.menuItems.2.items.1`)})})]})})]}),e.jsxs(N,{value:"item-4",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(Q,{className:"shrink-0"})}),e.jsxs("span",{children:[" ",t("navbar.megamenu.menuItems.3.title")]})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to
1:`${a.howItWorks.path}#rent`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.3.items.0")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.howItWorks.path}#self-return`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.3.items.1")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.howItWorks.path}#topup`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.3.items.2")})})]})})]}),e.jsxs(N,{value:"item-5",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(ee,{className:"shrink-0"})}),e.jsx("span",{children:t("navbar.megamenu.menuItems.4.title")})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.affiliate.path}/#join-affiliate`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.4.items.0")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:`${a.affiliate.path}/#lets-talk`,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.4.items.1")})})]})})]}),e.jsxs(N,{value:"item-6",className:"bg-transparent border-none",children:[e.jsx(k,{className:"p-3 text-white text-lg font-normal flex items-center justify-between",iconClass:"text-white w-5",children:e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"w-6 aspect-square flex items-center justify-center bg-main-600 rounded",children:e.jsx(te,{className:"shrink-0"})}),e.jsx("span",{children:t("navbar.megamenu.menuItems.5.title")})]})}),e.jsx(C,{className:"pl-9 pt-0",children:e.jsxs("ul",{children:[!g&&e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.howToSetupSim.path,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.5.items.0")})}),e.jsx("li",{children:e.jsx(x,{className:({isActive:n})=>` text-lg font-normal p-3 flex ${n?"text-main-600":"text-white"}`,to:a.howToConnectPocketWifi.path,onClick:()=>r(!1),children:t("navbar.megamenu.menuItems.5.items.1")})})]})})]})]})})]})})})}function We(){const[r,t]=j.useState(!1),m=j.useRef(null),g=T(),{t:d}=P(),{setIsAuthDialogOpen:n,setAppDownloadDialogOpen:o,setIsShowMenu:s}=M(),c=[{key:"myHome",label:d("myAccount.myHome"),icon:se,path:a.userHome.path},{key:"myorders",label:d("myAccount.myOrder"),icon:ae,path:a.userOrder.path},{key:"myaddress",label:d("myAccount.myAddress"),icon:ne,path:a.userAddress.path},{key:"mydata",label:d("myAccount.myData"),icon:le,path:a.userData.path},{key:"mycards",label:d("myAccount.myCards"),icon:oe,path:a.userCards.path},{key:"profile",label:d("myAccount.profile"),icon:ie,path:a.userProfile.path},{key:"logout",label:d("myAccount.logout"),icon:re,color:"#DE3737"}],h=(i="auth",u)=>{i=="auth"?n(u):i=="download"?o(u):n(u),s(!1)},l=i=>{t(!1),i.path&&g(i.path),i.key==="logout"&&h("auth",!0)};j.useEffect(()=>{const i=u=>{m.current&&!m.current.contains(u.target)&&t(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);const f=({item:i,isLast:u})=>{const[b,y]=j.useState(!1),I=i.icon,E=b?"#f24144":i.color||"#888888";return e.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 cursor-pointer rounded-md hover:bg-[#FEF2F2] hover:font-medium 2 ${i.color==="#f24144"?"text-[#f24144]":""} ${u?"":"border-b border-[#EEEEEE]"}`,onClick:()=>l(i),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[e.jsx(I,{className:"w-5 h-5",color:E}),e.jsx("span",{className:b?"text-[#f24144]":"",children:i.label})]})};return e.jsxs("div",{className:"relative",ref:m,children:[e.jsx("button",{onClick:()=>t(!r),className:"min-w-10 min-h-10 p-0 rounded-[10px] hidden xl:flex justify-center items-center bg-secondary-500 border-secondary-500 hover:bg-secondary-400",children:e.jsx(J,{className:"!h-6 !w-6 shrink-0"})}),r&&e.jsx("div",{className:"absolute right-0 mt-2 w-48 bg-white shadow-lg rounded-md py-2 z-50 text-[#888888] font-sansPro font-normal text-[14px] px-2",children:c.map((i,u)=>e.jsx(f,{item:i,isLast:u===c.length-1},i.key))})]})}function Re({setIsShowMenu:r=()=>{}}){const{setIsAuthDialogOpen:t,setAppDownloadDialogOpen:m}=M(),[g,d]=j.useState(!1),n=j.useRef(null),o=T(),{t:s}=P(),c=[{key:"myHome",label:s("myAccount.myHome"),icon:se,path:a.userHome.path},{key:"myorders",label:s("myAccount.myOrder"),icon:ae,path:a.userOrder.path},{key:"myaddress",label:s("myAccount.myAddress"),icon:ne,path:a.userAddress.path},{key:"mydata",label:s("myAccount.myData"),icon:le,path:a.userData.path},{key:"mycards",label:s("myAccount.myCards"),icon:oe,path:a.userCards.path},{key:"profile",label:s("myAccount.profile"),icon:ie,path:a.userProfile.path},{key:"logout",label:s("myAccount.logout"),icon:re,color:"#DE3737"}],h=(i="auth",u)=>{i=="auth"?t(u):i=="download"?m(u):t(u),r(!1)},l=i=>{d(!1),r(!1),i.path&&o(i.path),i.key==="logout"&&h("auth",!0)};j.useEffect(()=>{const i=u=>{n.current&&!n.current.contains(u.target)&&d(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);const f=({item:i})=>{const[u,b]=j.useState(!1),y=i.icon,I=u?"#f24144":i.color||"white";return e.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 cursor-pointer rounded-md hover:bg-[#FEF2F2] hover:font-medium 3 ${i.color==="#f24144"?"text-[#f24144]":""}`,onClick:()=>l(i),onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[e.jsx(y,{className:"w-6 h-6",color:I}),e.jsx("span",{className:u?"text-[#f24144]":"",children:i.label})]})};return e.jsxs("div",{className:"relative xl:hidden",ref:n,children:[e.jsxs("button",{onClick:()=>d(!g),className:"px-4 py-3 rounded-[10px] w-full max-w-[320px] flex justify-between items-center bg-[#f24144] border-[#f24144] hover:bg-[#f24144] text-white font-bold",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"!h-6 !w-6",color:"white"}),e.jsx("span",{children:s("myAccount.myProfile")})]}),e.jsx(ce,{className:`w-6 h-6 transform transition-transform duration-200 ${g?"rotate-180":"rotate-0"}`,pathClass:"fill-white"})]}),g&&e.jsx("div",{className:"absolute left-0 mt-2 w-full bg-black shadow-lg rounded-md py-2 z-50 font-sansPro text-[16px] px-2 text-white font-bold",children:c.map(i=>e.jsx(f,{item:i},i.key))})]})}const Te=[{path:"/ratings",backgroundColor:"#F7D259",textWhite:!1},{path:"/money-back-guarantee",backgroundColor:"#D81F22",textWhite:!0},{path:"/internet-packages/",backgroundColor:"#F7D259",textWhite:!1,matchPrefix:!0},{path:"/pickup/",backgroundColor:"#000000",textWhite:!0,matchPrefix:!0}],Je=r=>r&&Te.find(t=>t.matchPrefix?r.startsWith(t.path):r===t.path)||null,Me=()=>{const{pathname:r}=ke(),{isScrolled:t,isWhite:m,isRedBorder:g,isHome:d,isBlack:n,isBannerRoutes:o}
3=Le(),s=Je(r),c=s&&!t,l=Ce("&/countries/{currentCountry}/src/components/shared/navigation/NavBarLogo.jsx"),[f,i]=j.useState(!1),[u,b]=j.useState(!1),[y,I]=j.useState(!1),{setIsAuthDialogOpen:E,setAppDownloadDialogOpen:me}=M(),xe=T(),ue=V(),{t:S}=P(),{user:$}=W(p=>p.auth);W(p=>p.cart);const{currentCountry:de,isTargetCountry:he}=R(),B=he?de:"sg",{hideNavbarItems:q}=Oe[B],fe=[{name:"Home",value:"home",path:a.home.path,activePath:a.home.activePath},{name:"Pocket WIFI",value:"pocketwifi",path:a.pocketWifiHome.path,activePath:a.pocketWifiHome.activePath},{name:"Router",value:"router",path:a.productRouters.path,activePath:a.productRouters.activePath},{name:"SIM/eSIM",value:B=="jp"?"esim":"simesim",path:a.simHome.path,activePath:a.simHome.activePath},{name:"Contact Us",value:"contact",path:a.contact.path,activePath:a.contact.activePath},{name:"About Us",value:"about",path:a.aboutUs.path,activePath:a.aboutUs.activePath}],pe=Ae(fe.filter(p=>!q.includes(p.value))),H=(p="auth",A)=>{p=="auth"?E(A):p=="download"?me(A):E(A),i(!1)},F=p=>{p&&(p.isCallPlans=!0,ue(v({productCountry:p,countriesList:[p]})),xe("country-coverage/filter"))},U=c?s.backgroundColor:t?"#000000":void 0,ge=t||c?"border-transparent":"border-neutral-200",D=t||c&&(s==null?void 0:s.textWhite);return e.jsx("header",{className:w("sticky top-0 left-0 w-full z-40 duration-300 border-b",ge),style:U?{backgroundColor:U}:void 0,children:e.jsx("div",{className:"w-full max-w-[1600px] mx-auto",children:e.jsxs("nav",{className:w("w-full duration-300 flex items-center lg:gap-10 2xl:gap-15 justify-between px-4 py-2 sm:py-4",D?"text-white":"text-white xl:text-black-700"),children:[e.jsxs("div",{className:"flex w-full xl:w-auto items-center gap-2 sm:gap-6 justify-between",children:[e.jsx(L,{to:a.home.path,children:e.jsx("div",{className:"relative w-[140px] h-auto",children:e.jsx(j.Suspense,{fallback:e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-center",children:"Loading..."})}),children:l?e.jsx("div",{className:"absolute inset-0 flex justify-between items-center",children:e.jsx(l,{isSecondaryNavBar:!0,forceWhite:D})}):e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-center",children:"Loading..."})})})})}),e.jsxs("div",{className:"w-full max-w-[200px] xs:max-w-full items-center justify-end xs:gap-1 flex xl:hidden",children:[e.jsx("div",{className:w("w-full relative duration-300 origin-left",y?"max-w-[200px] xs:max-w-full":"max-w-0 overflow-hidden "),children:e.jsx(z,{onChange:F,defaultHeight:"h-[40px]"})}),y?e.jsx("button",{type:"button",className:"border-none outline-none",onClick:()=>I(!1),children:e.jsx(Y,{className:"w-6 h-6",color:D?"#757575":"#191919"})}):e.jsx("button",{type:"button",className:"border-none outline-none",onClick:()=>I(!0),children:e.jsx(Ie,{className:"w-6 h-6",color:"#757575"})})]}),e.jsx("button",{type:"button",className:"outline-none border-none xl:hidden",onClick:()=>i(!0),children:e.jsx(Pe,{color:D?"#fff":"#000"})})]}),e.jsx("div",{className:w("flex-1 xl:flex flex-col xl:flex-row xl:items-center xl:justify-between text-lg xl:text-sm font-semibold fixed xl:!static top-0 left-0 w-full bg-black h-screen xl:bg-transparent xl:h-auto p-4 xl:p-0 overflow-auto xl:overflow-visible duration-500",f?"translate-x-0":"translate-x-full xl:translate-x-[auto]"),children:e.jsxs("div",{className:"max-w-[360px] pt-10 xl:pt-0 xl:max-w-none mx-auto flex-1 xl:flex flex-col xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{className:"flex xl:hidden w-full xl:w-auto items-center justify-between pb-10",children:[e.jsx(L,{to:a.home.path,children:e.jsx(Se,{color:"#E41F26"})}),e.jsx("button",{type:"butotn",className:"outline-none border-none xl:hidden absolute top-4 right-4",onClick:()=>i(!1),children:e.jsx(Y,{})})]}),e.jsxs("ul",{className:"flex flex-col xl:flex-row xl:items-center gap-y-1 gap-x-2",children:[pe.map((p,A)=>e.jsx("li",{children:e.jsx(L,{className:w("menuItem hover:after:bg-main-600",p.isActive?"after:scale-x-100 font-semibold after:bg-main-600 bg-main-600 xl:bg-transparent":""),onClick:()=>i(!1),to:p.path,children:S(`navbar.commercialLatest.${p.value}`)})},A)),e.jsxs("li",{className:"hidden xl:block",onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:[e.jsxs("div",{className:"flex items-center justify-between xl:justify-start cursor-pointer w-full max-w-[320px] p-3 rounded-lg xl:rounded-none hover:bg-main-600 xl:w-auto xl:max-w-none xl:p-0 xl:hover:text-inherit xl:hover:bg-transparent hover:text-white",onClick:()=>b(!u),children:[e.jsx("span",{children:S("navbar.megamenu.menuText")}),e.jsx(ce,{className:w(u?"-rotate-180":"-rotate-0","transform transition_common duration-150"),pathClass:D?"fill-white":"fill-neutral-black"})]}),e.jsx(_e,{isShow:u,onClose:()=>b(!1)})]}),e.jsx(He,{setIsShowMenu:i})]}),!q.includes("corporate")&&e.jsx(L,{className:w("menuItem p-3 xl:p-0",D?"text-white":"text-white xl:text-main-600"),to:$e.home.path,children:S("extraText.corporate")}),e.jsxs("div",{className:"flex flex-col xl:flex-row xl:items-center gap-3 w-full xl:w-auto flex-1 xl:flex-none justify-end xl:justify-center mt-6 xl:mt-0",children:[e.jsx("div",{className:"w-full relative hidden xl:block max-w-[198px]",children:e.jsx(z,{onChange:F,defaultHeight:"h-[40px]"})}),e.jsx(_,{variant:"secondary",className:"px-6 md:py-3 rounded-[10px] w-full max-w-[320px] xl:w-auto hidden",children:e.jsxs("span",{children:[" ",
3S("buttonText.login")]})}),$!=null&&$.userId?e.jsx(Re,{}):e.jsx(_,{variant:"outline",className:"px-6 py-3 bg-transparent border-main-600 text-main-600 hover:bg-main-600 hover:text-white rounded-[10px] w-full max-w-[320px] xl:w-auto xl:hidden",onClick:()=>H("auth",!0),children:e.jsxs("span",{children:[" ",S("buttonText.login")]})}),e.jsxs(_,{className:w("px-6 py-3 rounded-[10px] w-full max-w-[320px] xl:w-auto bg-main-600 text-white"),onClick:()=>H("download",!0),children:[e.jsx(De,{color:"#fff",className:"w-5 h-5 shrink-0"}),e.jsx("span",{children:S("buttonText.downloadApp")})]}),e.jsx(Ee,{}),$!=null&&$.userId?e.jsx(We,{}):e.jsx(_,{className:"min-w-10 min-h-10 p-0 rounded-[10px] hidden xl:flex",variant:"secondary",onClick:()=>H("auth",!0),"aria-label":"Modal",children:e.jsx(J,{className:"!h-6 !w-6 shrink-0"})})]})]})})]})})})},ze=j.memo(Me);export{_e as D,He as M,ze as N,Re as P,We as a,Ge as u};
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.